diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-02-05 09:32:20 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-02-05 09:32:20 +0000 |
| commit | ddedc416185954051ff2a826c24fc1cc608204f1 (patch) | |
| tree | 4dca1a13fc43ab9eb8c415aa116c02c8c543d074 /include/semantic/symbol.h | |
| parent | 44eb8234648bfd6c4607d4fd0d804bbfb9168589 (diff) | |
Written some class declarations for the semantics, updated README
Diffstat (limited to 'include/semantic/symbol.h')
| -rw-r--r-- | include/semantic/symbol.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/semantic/symbol.h b/include/semantic/symbol.h new file mode 100644 index 0000000..3cb4290 --- /dev/null +++ b/include/semantic/symbol.h @@ -0,0 +1,38 @@ +#pragma once + +#include <string> +#include <vector> + +#include "types.h" + +class Symbol { +public: + explicit Symbol(std::string name, SymbolType type, std::string data_type, int scope); + std::string getName(); + SymbolType getSymbolType(); + std::string getDataType(); + int getScopeLevel(); + bool isInitialized(); + void setInitialized(bool init); + bool isParameter(); + void setParameter(bool is_param); + std::vector<std::string> getParameterTypes(); + void setParameterTypes(std::vector<std::string> types); + std::string getReturnType(); + void setReturnType(std::string type); + int getLineDeclared(); + void setLineDeclared(int line); + std::string toString(); + +private: + std::string name; + SymbolType symbol_type + std::string data_type + int scope_level + bool is_initialized + bool is_parameter + std::vector<std::string> parameter_types + std::string return_type + int line_declared + int column_declared +}; |
