13 std::vector<std::shared_ptr<ASTFunction>> FUNCTIONS;
16 std::vector<std::shared_ptr<ASTNode>>
getChildren()
override;
17 ASTProgram(std::vector<std::shared_ptr<ASTFunction>> FUNCTIONS);
19 std::string
getName()
const {
return name; }
23 std::shared_ptr<llvm::Module> codegen(
SemanticAnalysis *st,
const std::string& name);
26 llvm::Value *codegen()
override;
34 std::ostream &
print(std::ostream &out)
const override;
Class for defining the signature, local declarations, and a body of a function.
Definition: ASTFunction.h:11
Abstract base class for all AST nodes.
Definition: ASTNode.h:34
Class for a program which is a name and a list of functions.
Definition: ASTProgram.h:11
std::ostream & print(std::ostream &out) const override
Definition: ASTProgram.cpp:34
friend std::ostream & operator<<(std::ostream &os, const ASTProgram &obj)
Definition: ASTProgram.h:29
std::string getName() const
Definition: ASTProgram.h:19
std::vector< std::shared_ptr< ASTNode > > getChildren() override
Return all of the children for the node.
Definition: ASTProgram.cpp:39
ASTProgram(std::vector< std::shared_ptr< ASTFunction >> FUNCTIONS)
Definition: ASTProgram.cpp:5
ASTFunction * findFunctionByName(std::string)
Definition: ASTProgram.cpp:16
void setName(std::string n)
Definition: ASTProgram.h:18
std::vector< ASTFunction * > getFunctions() const
Definition: ASTProgram.cpp:12
void accept(ASTVisitor *visitor) override
Visit the children of this node and apply the visitor.
Definition: ASTProgram.cpp:25
Base class for AST visitors.
Definition: ASTVisitor.h:23
Stores the results of semantic analysis passes.
Definition: SemanticAnalysis.h:18