interpreter/parser.h

31 lines
603 B
C
Raw Normal View History

2018-01-23 08:17:07 -05:00
#ifndef PARSER_H_
#define PARSER_H_
#include <variable.h>
2018-01-29 20:19:22 -05:00
typedef variable *stack_t;
2018-01-23 08:17:07 -05:00
typedef struct {
variable *vars;
2018-01-29 20:19:22 -05:00
char **vnames;
2018-01-23 08:17:07 -05:00
stack_t *stack;
2018-01-29 20:19:22 -05:00
uint32_t stidx;
2018-02-01 12:01:25 -05:00
char **lines;
uint32_t lnidx;
uint8_t indent;
2018-02-07 09:26:36 -05:00
variable *ret;
2018-01-23 08:17:07 -05:00
} interpreter;
2018-02-05 11:28:24 -05:00
typedef int (*func_t)(interpreter *);
2018-01-23 08:17:07 -05:00
2018-01-29 20:19:22 -05:00
void iinit(interpreter *);
2018-01-23 08:17:07 -05:00
2018-01-29 20:19:22 -05:00
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);
2018-01-23 08:17:07 -05:00
2018-01-29 20:19:22 -05:00
int idoline(interpreter *, const char *);
2018-01-23 08:17:07 -05:00
#endif // PARSER_H_