X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=ag%2Fsymbol_table.h;h=63626b07c3a39b35fac2d065915f3945e524f0a9;hb=36858486cf0a6feba95d3b8963ee45a751fe761a;hp=e160c83e1d59a2c5e39e8abbaae047410417b1b5;hpb=dae5aa5459c21e2346cfd61ab98dcbe669643092;p=uebersetzerbau-ss10.git diff --git a/ag/symbol_table.h b/ag/symbol_table.h index e160c83..63626b0 100755 --- a/ag/symbol_table.h +++ b/ag/symbol_table.h @@ -1,23 +1,24 @@ #ifndef SYMBOL_TABLE_H #define SYMBOL_TABLE_H -#define SYMBOL_TYPE_FIELD 1 -#define SYMBOL_TYPE_VAR 2 +#define S_FIELD 0 +#define S_VAR 1 -struct symbol_t { - char *identifier; - struct symbol_t *next; +#define SYMNULL (struct symbol *)NULL + +struct symbol { + char *ident; + struct symbol *next; short type; }; -struct symbol_t *clone_table(struct symbol_t *table); -struct symbol_t *new_table(void); -struct symbol_t *table_add_symbol(struct symbol_t *table, char *identifier, short type, short check); -struct symbol_t *table_lookup(struct symbol_t *table, char *identifier); -struct symbol_t *table_remove_symbol(struct symbol_t *table, char *identifier); -struct symbol_t *table_merge(struct symbol_t *table, struct symbol_t *to_add, short check); -void check_variable(struct symbol_t *table, char *identifier); -void check_field(struct symbol_t *table, char *identifier); - -#endif /* SYMBOL_TABLE_H */ +struct symbol *clone_tab(struct symbol *tab); +struct symbol *new_tab(void); +struct symbol *tab_add_symbol(struct symbol *tab, char *ident, short type, short check); +struct symbol *tab_lookup(struct symbol *tab, char *ident); +struct symbol *tab_remove_symbol(struct symbol *tab, char *ident); +struct symbol *tab_merge(struct symbol *tab, struct symbol *to_add, short check); +void check_variable(struct symbol *tab, char *ident); +void check_field(struct symbol *tab, char *ident); +#endif