tipc
A TIP to LLVM compiler
|
Class for a program which is a name and a list of functions. More...
#include <ASTProgram.h>
Public Member Functions | |
std::vector< std::shared_ptr< ASTNode > > | getChildren () override |
Return all of the children for the node. More... | |
ASTProgram (std::vector< std::shared_ptr< ASTFunction >> FUNCTIONS) | |
void | setName (std::string n) |
std::string | getName () const |
std::vector< ASTFunction * > | getFunctions () const |
ASTFunction * | findFunctionByName (std::string) |
void | accept (ASTVisitor *visitor) override |
Visit the children of this node and apply the visitor. More... | |
std::shared_ptr< llvm::Module > | codegen (SemanticAnalysis *st, const std::string &name) |
![]() | |
virtual | ~ASTNode ()=default |
void | setLocation (int l, int c) |
int | getLine () |
int | getColumn () |
Protected Member Functions | |
std::ostream & | print (std::ostream &out) const override |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ASTProgram &obj) |
Class for a program which is a name and a list of functions.
ASTProgram::ASTProgram | ( | std::vector< std::shared_ptr< ASTFunction >> | FUNCTIONS | ) |
|
overridevirtual |
Visit the children of this node and apply the visitor.
This virtual function is overridden by each ASTNode subtype in order to visit each of its child nodes, by calling their accept methods. The visitor parameter defines the operations that are applied to each node that is visited; a subtype of ASTVisitor defines those operations.
visitor | The subtype of ASTVisitor that carries out per-ASTNode work. |
Implements ASTNode.
std::shared_ptr< llvm::Module > ASTProgram::codegen | ( | SemanticAnalysis * | st, |
const std::string & | name | ||
) |
ASTFunction * ASTProgram::findFunctionByName | ( | std::string | name | ) |
|
overridevirtual |
Return all of the children for the node.
This is not a pure virtual function so subclasses can selectively override it.
Reimplemented from ASTNode.
std::vector< ASTFunction * > ASTProgram::getFunctions | ( | ) | const |
|
inline |
|
overrideprotectedvirtual |
Implements ASTNode.
|
inline |
|
friend |