aboutsummaryrefslogtreecommitdiff
path: root/include/semantic/scope.hpp
diff options
context:
space:
mode:
authorCori Barker <coribarker2@gmail.com>2026-02-09 11:59:14 +0000
committerCori Barker <coribarker2@gmail.com>2026-02-09 11:59:14 +0000
commitb3f83360282bfe327c0ccbeecab706e0e7d2c050 (patch)
tree1ab29e9ebbf3d3f2fb66f59cbbc687451f8da62e /include/semantic/scope.hpp
parent26738e6c932038ea309a5dbaa9e941fc1ce144b8 (diff)
Changed .h to .hpp
Diffstat (limited to 'include/semantic/scope.hpp')
-rw-r--r--include/semantic/scope.hpp23
1 files changed, 23 insertions, 0 deletions
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 <string>
+#include <memory>
+
+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<std::string, Symbol> getAllSymbols();
+ std::string toString();
+
+private:
+ std::string scope_name;
+ int scope_level
+ *Scope parent_scope;
+ std::unordered_map<std::string, Symbol> symbols;
+};