Funcoes em pascal
[toypasc.git] / symbol_table.h
blob5c2bbc3ef2912c40b2736951c7e35eaa92e25803
1 #ifndef SYMBOL_TABLE_H
2 #define SYMBOL_TABLE_H
4 #include "base.h"
6 #define symbol_table_init() sym_table = NULL
8 typedef struct _symbol {
9 char *name;
10 Type type;
11 Value value;
12 //Scope
13 struct _symbol *next;
14 } Symbol;
16 static Symbol *sym_table;
18 Symbol *symbol_new(char const * name);
19 Symbol *symbol_insert(Symbol *table, char const *name);
20 Symbol *symbol_lookup(Symbol *table, char const *name);
21 //symbol_get_scope, parent_scope, etc....
23 void symbol_table_destroy(Symbol **table);
24 void symbol_table_dump(Symbol *table);
25 void symbol_print(Symbol *symbol);
27 #endif // SYMBOL_TABLE_H