ag: symbol table refactor
[uebersetzerbau-ss10.git] / ag / symbol_table.h
index e160c83e1d59a2c5e39e8abbaae047410417b1b5..63626b07c3a39b35fac2d065915f3945e524f0a9 100755 (executable)
@@ -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