From 5c1f937a7eb7a9cc9cd86cb69b3263f41f24408f Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Sun, 22 Feb 2026 22:24:27 +0000 Subject: Partially completed lots of changes, refactoring most of the files --- include/symbol_table.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/symbol_table.hpp (limited to 'include/symbol_table.hpp') diff --git a/include/symbol_table.hpp b/include/symbol_table.hpp new file mode 100644 index 0000000..b2b8270 --- /dev/null +++ b/include/symbol_table.hpp @@ -0,0 +1,25 @@ +#pragma once + +class SymbolTable { +public: + explicit SymbolTable(); + ~SymbolTable() = default; + void enterScope(std::string scope_name); + void exitScope(); + Scope* getCurrentScope(); + Scope* getGlobalScope(); + int getScopeLevel(); + void insert(Symbol symbol); + Symbol* lookup(std::string name); + Symbol* lookupCurrentScope(std::string name); + bool isDeclared(std::string name); + bool isDeclaredInCurrentScope(std::string name); + void display(); + std::string toString(); + +private: + std::vector> scopes; + Scope* current_scope; + int scope_level; + Scope* global_scope; +}; -- cgit v1.2.3