aboutsummaryrefslogtreecommitdiff
path: root/include/interpreter.h
blob: b21e54888208204be31b0235ffbf0260c2f5284e (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
#ifndef INTERPRETER_H
#define INTERPRETER_H


#include "ast.h"


typedef struct Context *context_t;


context_t context_create(void);
void context_free(context_t context);

int context_get_var(context_t context, const char *name);
void context_set_var(context_t context, const char *name, int value);
void context_print_var_table(context_t context);
void context_print_proc_table(context_t context);

int interp_ast(context_t context, ASTNode *node);
int interp_file (context_t context, const char *path);
int interp_str (context_t context, const char *str);


#endif