From 3c35be76e515098431643155b66e61a1c64816ae Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 3 Jan 2023 13:19:58 -0800 Subject: done the parser in theory --- src/include/.ast.h.swp | Bin 0 -> 12288 bytes src/include/.visitor.h.swp | Bin 12288 -> 0 bytes src/include/visitor.h | 6 +++++- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/include/.ast.h.swp delete mode 100644 src/include/.visitor.h.swp (limited to 'src/include') diff --git a/src/include/.ast.h.swp b/src/include/.ast.h.swp new file mode 100644 index 0000000..c3e8ba3 Binary files /dev/null and b/src/include/.ast.h.swp differ diff --git a/src/include/.visitor.h.swp b/src/include/.visitor.h.swp deleted file mode 100644 index febe477..0000000 Binary files a/src/include/.visitor.h.swp and /dev/null differ diff --git a/src/include/visitor.h b/src/include/visitor.h index 6af052b..54f43f0 100644 --- a/src/include/visitor.h +++ b/src/include/visitor.h @@ -2,20 +2,24 @@ #define VISITOR_H #include "./ast.h" #include "./hash_table.h" +#include "./parser.h" #include "./stack.h" typedef struct { hash_table_t *symbol_table; + hash_table_t *eval_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); +visitor_t *init_visitor(parser_t *p); bool is_self_evaluating(ast_t *e); +bool is_built_in(ast_t *e); + ast_t *eval_symbol(visitor_t *v, ast_t *e); ast_t *eval_list(visitor_t *v, ast_t *e); -- cgit