X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=aus_sammelwut%2Fpaulchen%2Fublu%2Fss08%2Fabgabe%2Fcodeb%2Fsymbol_table.h;fp=aus_sammelwut%2Fpaulchen%2Fublu%2Fss08%2Fabgabe%2Fcodeb%2Fsymbol_table.h;h=f8f3687bfba919c135b7f70d2e8a6619ff901c10;hb=f6171150f9e60240b256808fc31613530b21db6c;hp=0000000000000000000000000000000000000000;hpb=b82da83a0ad2014c11113818eee6bd5fb5f3445c;p=uebersetzerbau-ss10.git diff --git a/aus_sammelwut/paulchen/ublu/ss08/abgabe/codeb/symbol_table.h b/aus_sammelwut/paulchen/ublu/ss08/abgabe/codeb/symbol_table.h new file mode 100755 index 0000000..f8f3687 --- /dev/null +++ b/aus_sammelwut/paulchen/ublu/ss08/abgabe/codeb/symbol_table.h @@ -0,0 +1,27 @@ +#ifndef SYMBOL_TABLE_H +#define SYMBOL_TABLE_H + +#define SYMBOL_TYPE_FIELD 1 +#define SYMBOL_TYPE_VAR 2 +#define SYMBOL_TYPE_PARAM 3 + +struct symbol_t { + char *identifier; + struct symbol_t *next; + short type; + int stack_offset; + int param_index; /* -1 if not a parameter */ +}; + +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, int stack_offset); +struct symbol_t *table_add_param(struct symbol_t *table, char *identifier, int param_index); +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 */ +