From 5c1f937a7eb7a9cc9cd86cb69b3263f41f24408f Mon Sep 17 00:00:00 2001 From: Cori Barker Date: Sun, 22 Feb 2026 22:24:27 +0000 Subject: Partially completed lots of changes, refactoring most of the files --- include/semantic/semantic_analyzer.hpp | 46 ---------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 include/semantic/semantic_analyzer.hpp (limited to 'include/semantic/semantic_analyzer.hpp') diff --git a/include/semantic/semantic_analyzer.hpp b/include/semantic/semantic_analyzer.hpp deleted file mode 100644 index 0d56599..0000000 --- a/include/semantic/semantic_analyzer.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -class SemanticAnalyzer { -public: - explicit SemanticAnalyzer(); - bool analyze(ASTNode* ast); - std::vector getErrors(); - std::vector getWarnings(); - bool hasErrors(); - - // Main visitor method - std::string visit(ASTNode* ast); - - // Visitor methods for program structure - std::string visitProgram(ProgramNode* node); - std::string visitFunctionDecl(FunctionDeclNode* node); - std::string visitParameter(ParameterNode*); - - // Visitor methods for statements - std::string visitVarDeclaration(VarDeclNode* node); - std::string visitAssignment(AssignmentNode* node); - std::string visitIfStatement(IfStatementNode* node); - std::string visitWhileStatement(WhileStatementNode* node); - std::string visitForStatement(ForStatementNode* node); - std::string visitReturnStatement(ReturnStatementNode* node); - std::String visitExpressionStatement(ExpressionStatementNode* node); - - // Visitor methods for expressions - std::string visitBinaryExpression(BinaryExprNode* node); - std::string visitUnaryExpression(UnaryExprNode* node); - std::string visitFunctionCall(FunctionCallNode* node); - std::string visitIdentifier(IdentifierNode* node); - std::string visitLiteral(LiteralNode* node); - - // Type checking helper methods - bool checkTypeCompatibility(std::string target, std::string source); - std::string inferBinaryOpType(std::string op, std::string left, std::string right); - -private: - SymbolTable symbol_table; - std::vector errors; - std::vector warnings; - FunctionDeclNode* current_function; - std::string current_function_return_type; - bool has_main_function; -}; -- cgit v1.2.3