blob: 6af052b2e8fe8f49481db160ebbf84cc7b58c172 (
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 VISITOR_H
#define VISITOR_H
#include "./ast.h"
#include "./hash_table.h"
#include "./stack.h"
typedef struct {
hash_table_t *symbol_table;
stack_t *stack_frame;
ast_t *root;
} visitor_t;
void eval_error(visitor_t *v, ast_t *e);
visitor_t *init_visitor(ast_t *root);
bool is_self_evaluating(ast_t *e);
ast_t *eval_symbol(visitor_t *v, ast_t *e);
ast_t *eval_list(visitor_t *v, ast_t *e);
ast_t *eval_expr(visitor_t *v, ast_t *e);
ast_t *eval(visitor_t *v);
#endif
|