aboutsummaryrefslogtreecommitdiff
path: root/sem1/osc/mm11/regn/symtab.h
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2019-10-24 07:51:51 +0200
committerJulian T <julian@jtle.dk>2019-10-24 07:53:12 +0200
commitad2bc056ae684f8de57f2ff880e51440d07ee04a (patch)
tree01b81c1da9e12da3ae8d559c6de032bb41fffe49 /sem1/osc/mm11/regn/symtab.h
parent7c77ee39d5e3a41d5d74d32a3c3388f92998ae32 (diff)
Simple calculator assignment
Diffstat (limited to 'sem1/osc/mm11/regn/symtab.h')
-rw-r--r--sem1/osc/mm11/regn/symtab.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sem1/osc/mm11/regn/symtab.h b/sem1/osc/mm11/regn/symtab.h
new file mode 100644
index 0000000..c61f3a8
--- /dev/null
+++ b/sem1/osc/mm11/regn/symtab.h
@@ -0,0 +1,20 @@
+#include <stdint.h>
+#define HASHSIZE 100
+
+typedef struct symnode_struct {
+ char *name;
+ struct symnode_struct *next;
+ double value;
+} symnode_t;
+
+symnode_t *sym_insert(char *var);
+symnode_t *sym_lookup(char *var);
+
+struct symnode {
+ struct symnode *next;
+ char *name;
+ int type;
+ double value;
+};
+
+symnode_t *symbolarray[HASHSIZE];