From ca44ea33919127b66b3ea9f8714ff0c30be61fee Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Tue, 10 Mar 2026 15:14:01 +0000 Subject: refactored symbol and symbol_table --- include/symbol.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'include/symbol.hpp') diff --git a/include/symbol.hpp b/include/symbol.hpp index a388f04..d7be206 100644 --- a/include/symbol.hpp +++ b/include/symbol.hpp @@ -4,15 +4,27 @@ #include "type.hpp" #include +#include #include class Symbol { public: - explicit Symbol(); - -private: std::string identifier; + int line; + int column; + + virtual ~Symbol() = default; +}; + +class FunctionDeclarationSymbol : public Symbol { + Type return_type; + std::vector parameters; + + FunctionDeclarationSymbol(std::string identifier, Type return_type, std::vector parameters, int line, int column) : identifier(identifier), return_type(return_type), parameters(parameters), line(line), column(column) { } +}; + +class VariableDeclarationSymbol : public Symbol { + Type type; - SymbolType symbol_type; - std::variant value; + VariableDeclarationSymbol }; -- cgit v1.2.3