9 std::shared_ptr<ASTExpr> LEFT, RIGHT;
12 std::vector<std::shared_ptr<ASTNode>>
getChildren()
override;
14 std::shared_ptr<ASTExpr> RIGHT)
15 : OP(OP), LEFT(LEFT), RIGHT(RIGHT) {}
16 std::string
getOp()
const {
return OP; }
20 llvm::Value *
codegen()
override;
23 std::ostream &
print(std::ostream &out)
const override;
Class for a binary operator.
Definition: ASTBinaryExpr.h:7
ASTBinaryExpr(const std::string &OP, std::shared_ptr< ASTExpr > LEFT, std::shared_ptr< ASTExpr > RIGHT)
Definition: ASTBinaryExpr.h:13
std::string getOp() const
Definition: ASTBinaryExpr.h:16
ASTExpr * getRight() const
Definition: ASTBinaryExpr.h:18
std::ostream & print(std::ostream &out) const override
Definition: ASTBinaryExpr.cpp:12
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTBinaryExpr.cpp:17
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTBinaryExpr.cpp:4
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:426
ASTExpr * getLeft() const
Definition: ASTBinaryExpr.h:17
Abstract class for all expression subtypes.
Definition: ASTExpr.h:7
Base class for AST visitors.
Definition: ASTVisitor.h:23