From 8b6acc85633520f109d348c5e46c8a89521b3932 Mon Sep 17 00:00:00 2001 From: Flavian Kaufmann Date: Wed, 21 May 2025 14:05:27 +0200 Subject: procedures --- include/interpreter.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'include/interpreter.h') diff --git a/include/interpreter.h b/include/interpreter.h index 6e60113..cb3ba75 100644 --- a/include/interpreter.h +++ b/include/interpreter.h @@ -3,17 +3,22 @@ #include "ast.h" -#include "hash_map.h" -void exec_stmt(hashmap_t context, ASTNode *node); -void context_print(hashmap_t context); +typedef struct Context *context_t; -void context_set(hashmap_t context, const char *name, int value); -int context_get(hashmap_t context, const char *name); -int exec_file (hashmap_t context, const char *path); -int exec_str (hashmap_t context, const char *str); +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); + +void 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 \ No newline at end of file -- cgit v1.2.3