From b8f7e7b6843c2bff778ce3c74e355a03e7565499 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Sun, 3 Jun 2018 15:30:53 +0200 Subject: Functions tables + void functions working (need to work on returns and parameters cause all functions are void here) --- src/symbol_table.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/symbol_table.h') diff --git a/src/symbol_table.h b/src/symbol_table.h index fe0e35c..917e4f9 100644 --- a/src/symbol_table.h +++ b/src/symbol_table.h @@ -12,6 +12,7 @@ #define MAXNAME 32 #define MAXSYMBOLS 256 +#define MAXFUNCTIONS 256 typedef enum type { INT, @@ -30,6 +31,21 @@ typedef struct { int size; } SymbolTable; +typedef struct { + char name[MAXNAME]; + int return_type; + int nb_parameters; +} FTentry; + +typedef struct { + FTentry entries[MAXFUNCTIONS]; + int maxsize; + int size; +} FunctionTable; + +void fun_add(const char name[], int rt_type, int nb_par); +void fun_display_table(); +int fun_lookup(const char name[], int nb_param); void glo_addVar(const char name[], int type); int glo_lookup(const char name[]); int glo_get_addr(const char name[]); -- cgit v1.2.3