aboutsummaryrefslogtreecommitdiff
path: root/include/scope.hpp
diff options
context:
space:
mode:
authorCori Barker <coribarker2@gmail.com>2026-02-22 22:24:27 +0000
committerCori Barker <coribarker2@gmail.com>2026-02-22 22:24:27 +0000
commit5c1f937a7eb7a9cc9cd86cb69b3263f41f24408f (patch)
tree46154166a56f9a074c5b75dbb1a1b9560908b8f1 /include/scope.hpp
parent2cfc45ff22cd9b6166de3cf963aceede21b358aa (diff)
Partially completed lots of changes, refactoring most of the files
Diffstat (limited to 'include/scope.hpp')
-rw-r--r--include/scope.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/scope.hpp b/include/scope.hpp
new file mode 100644
index 0000000..ff20542
--- /dev/null
+++ b/include/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;
+};