6b295615e2b482214df3dafd96db2292bcb608ab
[uebersetzerbau-ss10.git] / codea / symtable.h
1 #ifndef SYMTABLE_H
2 #define SYMTABLE_H
3
4 #define S_FIELD (1<<0)
5 #define S_VAR (1<<1)
6 #define S_PARM (1<<2)
7
8 #define SYMNULL (struct symbol *)NULL
9
10 struct symbol {
11         char *ident;
12         struct symbol *next;
13         short type;
14 };
15
16 struct symbol *tab_clone(struct symbol *tab);
17 struct symbol *tab_new(void);
18 struct symbol *tab_add_symbol(struct symbol *tab, char *ident, short type, short check);
19 struct symbol *tab_lookup(struct symbol *tab, char *ident, short type);
20 struct symbol *tab_remove_symbol(struct symbol *tab, char *ident, short type);
21 struct symbol *tab_merge(struct symbol *tab, struct symbol *to_add, short check);
22 void check(struct symbol *tab, char *ident, short type);
23
24 #endif