X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=ag%2Fsymtable.c;fp=ag%2Fsymtable.c;h=9c53557159fd9caf515e3167e51007db84bb9ec5;hb=394a3c955a5b9a544355c52a0243f0da61998c83;hp=590077d71cfc8321bdeca31b56eb9d265093b8dd;hpb=588c1a4b6c3dcb882fef71db6813d82f401804e5;p=uebersetzerbau-ss10.git diff --git a/ag/symtable.c b/ag/symtable.c index 590077d..9c53557 100755 --- a/ag/symtable.c +++ b/ag/symtable.c @@ -5,8 +5,6 @@ #define DD -static void check_gen(struct symbol *tab, char *ident, short type); - struct symbol *new_tab(void) { return SYMNULL; @@ -122,22 +120,21 @@ struct symbol *tab_remove_symbol(struct symbol *tab, char *ident, short type) return tab; } -void check_variable(struct symbol *tab, char *ident) -{ - check_gen(tab, ident, S_VAR); -} - -void check_field(struct symbol *tab, char *ident) -{ - check_gen(tab, ident, S_FIELD); -} - -static void check_gen(struct symbol *tab, char *ident, short type) +void check(struct symbol *tab, char *ident, short type) { - struct symbol *elm = tab_lookup(tab, ident, type); + struct symbol *elm; #ifdef DD printf("check_variable: tab(%08X), ident(%s), type(%i), elm(%08X)\n", tab, ident, type, elm); #endif + + if(type == S_VAR) { + elm = tab_lookup(tab, ident, type); + if(elm != SYMNULL) { + return; + } + } + + elm = tab_lookup(tab, ident, S_FIELD); if(elm == SYMNULL) { fprintf(stderr, "Unbekannter Identifier: \"%s\"\n", ident); exit(3);