aboutsummaryrefslogtreecommitdiff
path: root/include/interpreter.h
blob: 09f1e1834cf45775b2d93787a79c0fe51abf87d8 (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
#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);

int print_ast_file (const char *path);


#endif