9 std::shared_ptr<ASTExpr> COND;
10 std::shared_ptr<ASTStmt> THEN, ELSE;
13 std::vector<std::shared_ptr<ASTNode>>
getChildren()
override;
14 ASTIfStmt(std::shared_ptr<ASTExpr> COND, std::shared_ptr<ASTStmt> THEN,
15 std::shared_ptr<ASTStmt> ELSE)
16 : COND(COND), THEN(THEN), ELSE(ELSE) {}
25 llvm::Value *
codegen()
override;
28 std::ostream &
print(std::ostream &out)
const override;
Abstract class for all expression subtypes.
Definition: ASTExpr.h:7
Class for if-then-else.
Definition: ASTIfStmt.h:8
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTIfStmt.cpp:24
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:931
std::ostream & print(std::ostream &out) const override
Definition: ASTIfStmt.cpp:15
ASTExpr * getCondition() const
Definition: ASTIfStmt.h:17
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTIfStmt.cpp:4
ASTStmt * getElse() const
Definition: ASTIfStmt.h:23
ASTStmt * getThen() const
Definition: ASTIfStmt.h:18
ASTIfStmt(std::shared_ptr< ASTExpr > COND, std::shared_ptr< ASTStmt > THEN, std::shared_ptr< ASTStmt > ELSE)
Definition: ASTIfStmt.h:14
Base class for all statement nodes.
Definition: ASTStmt.h:7
Base class for AST visitors.
Definition: ASTVisitor.h:23