From 6761fdd434a7e54551fe28398361f9eed5268406 Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Sat, 7 Mar 2026 17:46:38 +0000 Subject: code is a complete mess, simplified some classes as they are way too complex will expand in future but too complicated for now since its the first version. --- include/symbol.hpp | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'include/symbol.hpp') diff --git a/include/symbol.hpp b/include/symbol.hpp index 4bee45d..c3c7ef4 100644 --- a/include/symbol.hpp +++ b/include/symbol.hpp @@ -1,38 +1,13 @@ #pragma once -#include -#include - -#include "symbol_type.hpp" - class Symbol { public: - explicit Symbol(std::string name, SymbolType type, std::string data_type, int scope_level); - 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 getParameterTypes(); - void setParameterTypes(std::vector types); - std::string getReturnType(); - void setReturnType(std::string type); - int getLineDeclared(); - void setLineDeclared(int line); - std::string toString(); + explicit Symbol(); private: - std::string symbol_name; - SymbolType symbol_type; - std::string data_type; - int scope_level; - bool is_initialized; - bool is_parameter; - std::vector parameter_types; - std::string return_type; - int line_declared; - int column_declared; + std::string identifier; + Type type; + std::variant value; }; + +Symbol::Symbol(std::string identifier, Type type, std::variant value) : identifier(identifier), type(type), value(value) { } -- cgit v1.2.3