From b3f83360282bfe327c0ccbeecab706e0e7d2c050 Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Mon, 9 Feb 2026 11:59:14 +0000 Subject: Changed .h to .hpp --- include/semantic/scope.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/semantic/scope.hpp (limited to 'include/semantic/scope.hpp') diff --git a/include/semantic/scope.hpp b/include/semantic/scope.hpp new file mode 100644 index 0000000..ff20542 --- /dev/null +++ b/include/semantic/scope.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +class Scope { +public: + explicit Scope(std::string name, int level, *Scope parent); + std::string getScopeName(); + int getScopeLevel(); + *Scope getParentScope(); + void define(Symbol symbol); + *Symbol lookup(std::string name); + bool isDeclared(std::string name); + std::unordered_map getAllSymbols(); + std::string toString(); + +private: + std::string scope_name; + int scope_level + *Scope parent_scope; + std::unordered_map symbols; +}; -- cgit v1.2.3