ag: folgendes verhalten wurde implementiert:
[uebersetzerbau-ss10.git] / ag / symtable.c
index 590077d71cfc8321bdeca31b56eb9d265093b8dd..9c53557159fd9caf515e3167e51007db84bb9ec5 100755 (executable)
@@ -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);