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.

38 lines
779 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;
variable ***lines;
uint32_t lnidx;
int8_t indent;
uint8_t sindent;
variable *ret;
7 years ago
} interpreter;
#define SKIP (1 << 7)
typedef int (*func_t)(interpreter *);
7 years ago
void iinit(interpreter *);
void iend(interpreter *it);
void iskip(interpreter *it);
7 years ago
variable *inew_string(interpreter *, const char *, char *);
variable *inew_integer(interpreter *, const char *, int32_t);
variable *inew_float(interpreter *, const char *, float);
void inew_cfunc(interpreter *, const char *, func_t);
7 years ago
int idoline(interpreter *, const char *);
variable *idoexpr(interpreter *interp, const char *line);
7 years ago
#endif // PARSER_H_