You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
916 B
C

7 years ago
#ifndef PARSER_H_
#define PARSER_H_
#include <variable.h>
typedef variable *stack_t;
7 years ago
typedef struct {
variable *vars;
char **vnames;
7 years ago
stack_t *stack;
uint32_t stidx;
char **lines;
uint32_t lnidx;
uint8_t indent;
7 years ago
} interpreter;
typedef void (*func_t)(interpreter *);
7 years ago
void iinit(interpreter *);
7 years ago
void inew_string(interpreter *, const char *, char *);
void inew_integer(interpreter *, const char *, int32_t);
void inew_float(interpreter *, const char *, float);
void inew_cfunc(interpreter *, const char *, func_t);
7 years ago
int idoline(interpreter *, const char *);
7 years ago
variable *igetarg(interpreter *, uint32_t);
char *igetarg_string(interpreter *, uint32_t);
int igetarg_integer(interpreter *, uint32_t);
float igetarg_float(interpreter *, uint32_t);
7 years ago
char *iget_string(interpreter *, const char *);
int iget_integer(interpreter *, const char *);
float iget_float(interpreter *, const char *);
7 years ago
#endif // PARSER_H_