diff options
Diffstat (limited to 'src/symbol_table.h')
-rw-r--r-- | src/symbol_table.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/symbol_table.h b/src/symbol_table.h index b2c8879..23cd618 100644 --- a/src/symbol_table.h +++ b/src/symbol_table.h | |||
@@ -15,6 +15,11 @@ | |||
15 | #define MAXSYMBOLS 256 | 15 | #define MAXSYMBOLS 256 |
16 | #define MAXFUNCTIONS 256 | 16 | #define MAXFUNCTIONS 256 |
17 | 17 | ||
18 | typedef enum scope { | ||
19 | GLOBAL, | ||
20 | LOCAL | ||
21 | } Scope; | ||
22 | |||
18 | typedef enum type { | 23 | typedef enum type { |
19 | INT, | 24 | INT, |
20 | CHAR, | 25 | CHAR, |
@@ -54,12 +59,15 @@ void glo_addConst(const char name[]); | |||
54 | int glo_lookup(const char name[]); | 59 | int glo_lookup(const char name[]); |
55 | int glo_get_addr(const char name[]); | 60 | int glo_get_addr(const char name[]); |
56 | void glo_display_table(); | 61 | void glo_display_table(); |
62 | |||
57 | void loc_addVar(const char name[], int type); | 63 | void loc_addVar(const char name[], int type); |
58 | void loc_addConst(const char name[]); | 64 | void loc_addConst(const char name[]); |
59 | int loc_lookup(const char name[]); | 65 | int loc_lookup(const char name[]); |
60 | int loc_get_addr(const char name[]); | 66 | int loc_get_addr(const char name[]); |
61 | void loc_display_table(); | 67 | void loc_display_table(); |
62 | void loc_clean_table(); | 68 | void loc_clean_table(); |
69 | |||
63 | void check_expected_type(int type_to_check, int type_expected); | 70 | void check_expected_type(int type_to_check, int type_expected); |
71 | bool is_read_only(const char name[], Scope scope); | ||
64 | 72 | ||
65 | #endif | 73 | #endif |