9 std::shared_ptr<ASTExpr> INIT;
12 std::vector<std::shared_ptr<ASTNode>>
getChildren()
override;
13 ASTFieldExpr(
const std::string &FIELD, std::shared_ptr<ASTExpr> INIT)
14 : FIELD(FIELD), INIT(INIT) {}
18 llvm::Value *
codegen()
override;
21 std::ostream &
print(std::ostream &out)
const override;
Abstract class for all expression subtypes.
Definition: ASTExpr.h:7
Class for the field of a record.
Definition: ASTFieldExpr.h:7
std::ostream & print(std::ostream &out) const override
Definition: ASTFieldExpr.cpp:11
ASTFieldExpr(const std::string &FIELD, std::shared_ptr< ASTExpr > INIT)
Definition: ASTFieldExpr.h:13
std::string getField() const
Definition: ASTFieldExpr.h:15
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTFieldExpr.cpp:16
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTFieldExpr.cpp:4
ASTExpr * getInitializer() const
Definition: ASTFieldExpr.h:16
llvm::Value * codegen() override
Perform code generation and return an LLVM value the code.
Definition: CodeGenFunctions.cpp:724
Base class for AST visitors.
Definition: ASTVisitor.h:23