diff options
author | Adam NAILI | 2018-06-05 23:03:29 +0200 |
---|---|---|
committer | Adam NAILI | 2018-06-05 23:03:29 +0200 |
commit | a037a641ca537f012865b2655917207af683ea1f (patch) | |
tree | 2cc15c0e2df751e635fe766cb89c534592944ec3 /src/symbol_table.h | |
parent | 4cc53658a9503191f41945914e6223ccc5a95717 (diff) | |
parent | 1c1ba0e8cd1f7cb17b04626b7ef3cf9fcbe520ab (diff) | |
download | tpc-compiler-a037a641ca537f012865b2655917207af683ea1f.tar.gz |
Merge branch 'master' of https://github.com/pacien/upem-compil-tpc
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 |