#ifndef STATEMENT_ASTNODE_H #define STATEMENT_ASTNODE_H #include #include "astnode.h" #include "expr_astnode.h" class Statement_ASTNode : public ASTNodeBase { public: virtual ~Statement_ASTNode() = default; }; class EmptyStatement_ASTNode : public Statement_ASTNode { friend Visitor; }; class DefinitionStatement_ASTNode : public Statement_ASTNode { friend Visitor; ExprTypeInfo var_type; std::vector>> vars; }; class ExprStatement_ASTNode : public Statement_ASTNode { friend Visitor; std::shared_ptr expr; }; class IfStatement_ASTNode : public Statement_ASTNode { friend Visitor; bool has_else_clause; std::shared_ptr condition; std::shared_ptr if_clause; std::shared_ptr else_clause; }; class WhileStatement_ASTNode : public Statement_ASTNode { friend Visitor; std::shared_ptr condition; std::shared_ptr loop_body; }; class ForStatement_ASTNode : public Statement_ASTNode { friend Visitor; std::shared_ptr initial; std::shared_ptr condition; std::shared_ptr update; std::shared_ptr loop_body; }; class JmpStatement_ASTNode : public Statement_ASTNode { friend Visitor; uint8_t jmp_type; // 0: return, 1: break, 2: continue std::shared_ptr return_value; }; class SuiteStatement_ASTNode : public Statement_ASTNode { friend Visitor; std::vector> statements; }; #endif // STATEMENT_ASTNODE_H