aboutsummaryrefslogtreecommitdiffstats
path: root/parser.h
blob: c2efba37fc752d70af0a726e3a72e4a9aa3b6ba9 (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
31
32
33
34
#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;
} interpreter;

typedef void (*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 *);

char *igetarg_string(interpreter *, uint32_t);
int igetarg_integer(interpreter *, uint32_t); 
float igetarg_float(interpreter *, uint32_t);

char *iget_string(interpreter *, const char *);
int iget_integer(interpreter *, const char *);
float iget_float(interpreter *, const char *);

#endif // PARSER_H_