diff options
Diffstat (limited to 'include/semantic/scope.hpp')
| -rw-r--r-- | include/semantic/scope.hpp | 23 |
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; +}; |
