ag: symtable renamed
[uebersetzerbau-ss10.git] / ag / symtable.h
diff --git a/ag/symtable.h b/ag/symtable.h
new file mode 100755 (executable)
index 0000000..92bfc86
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef SYMTABLE_H
+#define SYMTABLE_H
+
+#define S_FIELD 0
+#define S_VAR 1
+
+#define SYMNULL (struct symbol *)NULL
+
+struct symbol {
+       char *ident;
+       struct symbol *next;
+       short type;
+};
+
+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