e160c83e1d59a2c5e39e8abbaae047410417b1b5
[uebersetzerbau-ss10.git] / ag / symbol_table.h
1 #ifndef SYMBOL_TABLE_H
2 #define SYMBOL_TABLE_H
3
4 #define SYMBOL_TYPE_FIELD 1
5 #define SYMBOL_TYPE_VAR 2
6
7 struct symbol_t {
8         char *identifier;
9         struct symbol_t *next;
10         short type;
11 };
12
13 struct symbol_t *clone_table(struct symbol_t *table);
14 struct symbol_t *new_table(void);
15 struct symbol_t *table_add_symbol(struct symbol_t *table, char *identifier, short type, short check);
16 struct symbol_t *table_lookup(struct symbol_t *table, char *identifier);
17 struct symbol_t *table_remove_symbol(struct symbol_t *table, char *identifier);
18 struct symbol_t *table_merge(struct symbol_t *table, struct symbol_t *to_add, short check);
19 void check_variable(struct symbol_t *table, char *identifier);
20 void check_field(struct symbol_t *table, char *identifier);
21
22 #endif /* SYMBOL_TABLE_H */
23