aboutsummaryrefslogtreecommitdiffstats
path: root/parser.h
blob: 4e4699e21810dab2f1d7bbe7f296b0cbe97f7b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef PARSER_H_
#define PARSER_H_

#include <variable.h>

typedef variable *stack_t;

typedef struct {
	variable *vars;
	char **vnames;
	stack_t *stack;
	uint32_t stidx;
	char **lines;
	uint32_t lnidx;
	uint8_t indent;
	variable *ret;
} interpreter;

typedef int (*func_t)(interpreter *);

void iinit(interpreter *);

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);

int idoline(interpreter *, const char *);

#endif // PARSER_H_