From fad8df848092d7f35e95c3b70b5917593df84952 Mon Sep 17 00:00:00 2001 From: kartofen Date: Wed, 3 Jan 2024 00:08:27 +0200 Subject: hashtable and symtable things --- src/eval.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/eval.h') diff --git a/src/eval.h b/src/eval.h index fc7b8ad..8b70a06 100644 --- a/src/eval.h +++ b/src/eval.h @@ -2,17 +2,38 @@ #define EVAL_H #include "parser.h" +#include "hashtbl.h" typedef struct eval *eval_t; +// struct symdata { +// enum symbol_type { +// SYMBOL_VALUE, +// SYMBOL_FUNC, +// SYMBOL_FUNC_BUILTIN +// } type; +// +// union { +// value_t value; +// ast_t func; +// builtin_func_t builtin; +// }; +// }; +// +// struct symtbl { +// hashtbl_t table; +// struct symtbl *parent; +// }; + struct eval { - // symtbl_t root; - // symtbl_t *cur; + // struct symtbl root; + // struct symtbl *cur; + // ... }; // TODO: add options for the evaluation eval_t eval_create(); void eval_destroy(eval_t eval); -int eval_ast(eval_t eval, parser_t ast); +int eval_ast(eval_t eval, ast_t *ast); #endif -- cgit v1.2.3