diff options
Diffstat (limited to 'src/symboltable.h')
-rw-r--r-- | src/symboltable.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/symboltable.h b/src/symboltable.h new file mode 100644 index 0000000..cc828fa --- /dev/null +++ b/src/symboltable.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef __SYMBOLTABLE_H__ | ||
2 | |||
3 | #include <stdio.h> | ||
4 | #include <stdlib.h> | ||
5 | #include <string.h> | ||
6 | |||
7 | #define MAXNAME 32 | ||
8 | #define INT 0 | ||
9 | #define CHAR 1 | ||
10 | #define MAXSYMBOLS 256 | ||
11 | |||
12 | |||
13 | typedef struct { | ||
14 | char name[MAXNAME]; | ||
15 | int type; | ||
16 | } STentry; | ||
17 | |||
18 | |||
19 | typedef struct { | ||
20 | STentry entries[MAXSYMBOLS]; | ||
21 | int maxsize; | ||
22 | int size; | ||
23 | } SymbolTable; | ||
24 | |||
25 | |||
26 | void addVar(const char name[], int type); | ||
27 | void lookup(const char name[]); | ||
28 | void display_table(); | ||
29 | |||
30 | #endif \ No newline at end of file | ||