ag: symbol table refactor
[uebersetzerbau-ss10.git] / ag / symbol_table.h
1 #ifndef SYMBOL_TABLE_H
2 #define SYMBOL_TABLE_H
3
4 #define S_FIELD 0
5 #define S_VAR 1
6
7 #define SYMNULL (struct symbol *)NULL
8
9 struct symbol {
10         char *ident;
11         struct symbol *next;
12         short type;
13 };
14
15 struct symbol *clone_tab(struct symbol *tab);
16 struct symbol *new_tab(void);
17 struct symbol *tab_add_symbol(struct symbol *tab, char *ident, short type, short check);
18 struct symbol *tab_lookup(struct symbol *tab, char *ident);
19 struct symbol *tab_remove_symbol(struct symbol *tab, char *ident);
20 struct symbol *tab_merge(struct symbol *tab, struct symbol *to_add, short check);
21 void check_variable(struct symbol *tab, char *ident);
22 void check_field(struct symbol *tab, char *ident);
23
24 #endif