aboutsummaryrefslogtreecommitdiff
path: root/src/symbol_table.h
diff options
context:
space:
mode:
authorAdam NAILI2018-06-05 23:03:29 +0200
committerAdam NAILI2018-06-05 23:03:29 +0200
commita037a641ca537f012865b2655917207af683ea1f (patch)
tree2cc15c0e2df751e635fe766cb89c534592944ec3 /src/symbol_table.h
parent4cc53658a9503191f41945914e6223ccc5a95717 (diff)
parent1c1ba0e8cd1f7cb17b04626b7ef3cf9fcbe520ab (diff)
downloadtpc-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.h8
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
18typedef enum scope {
19 GLOBAL,
20 LOCAL
21} Scope;
22
18typedef enum type { 23typedef enum type {
19 INT, 24 INT,
20 CHAR, 25 CHAR,
@@ -54,12 +59,15 @@ void glo_addConst(const char name[]);
54int glo_lookup(const char name[]); 59int glo_lookup(const char name[]);
55int glo_get_addr(const char name[]); 60int glo_get_addr(const char name[]);
56void glo_display_table(); 61void glo_display_table();
62
57void loc_addVar(const char name[], int type); 63void loc_addVar(const char name[], int type);
58void loc_addConst(const char name[]); 64void loc_addConst(const char name[]);
59int loc_lookup(const char name[]); 65int loc_lookup(const char name[]);
60int loc_get_addr(const char name[]); 66int loc_get_addr(const char name[]);
61void loc_display_table(); 67void loc_display_table();
62void loc_clean_table(); 68void loc_clean_table();
69
63void check_expected_type(int type_to_check, int type_expected); 70void check_expected_type(int type_to_check, int type_expected);
71bool is_read_only(const char name[], Scope scope);
64 72
65#endif 73#endif