9 std::shared_ptr<ASTExpr> COND;
10 std::shared_ptr<ASTStmt> BODY;
13 std::vector<std::shared_ptr<ASTNode>>
getChildren()
override;
14 ASTWhileStmt(std::shared_ptr<ASTExpr> COND, std::shared_ptr<ASTStmt> BODY)
15 : COND(COND), BODY(BODY) {}
19 llvm::Value *
codegen()
override;
22 std::ostream &
print(std::ostream &out)
const override;
Abstract class for all expression subtypes.
Definition: ASTExpr.h:7
Base class for all statement nodes.
Definition: ASTStmt.h:7
Base class for AST visitors.
Definition: ASTVisitor.h:23
Class for a while loop.
Definition: ASTWhileStmt.h:8
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTWhileStmt.cpp:17
ASTExpr * getCondition() const
Definition: ASTWhileStmt.h:16
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:854
ASTStmt * getBody() const
Definition: ASTWhileStmt.h:17
std::ostream & print(std::ostream &out) const override
Definition: ASTWhileStmt.cpp:12
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTWhileStmt.cpp:4
ASTWhileStmt(std::shared_ptr< ASTExpr > COND, std::shared_ptr< ASTStmt > BODY)
Definition: ASTWhileStmt.h:14