From ddedc416185954051ff2a826c24fc1cc608204f1 Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Thu, 5 Feb 2026 09:32:20 +0000 Subject: Written some class declarations for the semantics, updated README --- include/semantic/scope.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/semantic/scope.h (limited to 'include/semantic/scope.h') diff --git a/include/semantic/scope.h b/include/semantic/scope.h new file mode 100644 index 0000000..aa13fe3 --- /dev/null +++ b/include/semantic/scope.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include + +class Scope { +public: + explicit Scope(std::string name, int level, std::unique_ptr parent); + std::string getScopeName(); + int getScopeLevel(); + std::unique_ptr getParentScope(); + void define(Symbol symbol); + std::unique_ptr lookup(std::string name); + bool isDeclared(std::string name); + std::unordered_map getAllSymbols(); + std::string toString(); + +private: + std::string scope_name; + int scope_level + std::unique_ptr parent_scope; + std::unordered_map; +}; -- cgit v1.2.3