doc: paulchen beispiele {code{a,b},gesamt} entpackt (jedes mal entpacken nervt langsa...
[uebersetzerbau-ss10.git] / aus_sammelwut / paulchen / ublu / ss08 / abgabe / gesamt / .svn / text-base / symbol_table.h.svn-base
diff --git a/aus_sammelwut/paulchen/ublu/ss08/abgabe/gesamt/.svn/text-base/symbol_table.h.svn-base b/aus_sammelwut/paulchen/ublu/ss08/abgabe/gesamt/.svn/text-base/symbol_table.h.svn-base
new file mode 100644 (file)
index 0000000..f8f3687
--- /dev/null
@@ -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 */
+