From 0f4b1600983f8afda41a02fec07424338785d81d Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 5 Jun 2018 22:41:15 +0200 Subject: Prevent assigning to const --- src/symbol_table.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/symbol_table.h') 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 @@ #define MAXSYMBOLS 256 #define MAXFUNCTIONS 256 +typedef enum scope { + GLOBAL, + LOCAL +} Scope; + typedef enum type { INT, CHAR, @@ -54,12 +59,15 @@ void glo_addConst(const char name[]); int glo_lookup(const char name[]); int glo_get_addr(const char name[]); void glo_display_table(); + void loc_addVar(const char name[], int type); void loc_addConst(const char name[]); int loc_lookup(const char name[]); int loc_get_addr(const char name[]); void loc_display_table(); void loc_clean_table(); + void check_expected_type(int type_to_check, int type_expected); +bool is_read_only(const char name[], Scope scope); #endif -- cgit v1.2.3