|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for a function declaration. More...
#include <ast.hpp>

Public Member Functions | |
| FuncDeclNode (const std::string &n, std::vector< std::unique_ptr< ASTNode > > p, const std::string &rt, std::unique_ptr< ASTNode > b) | |
| void | accept (ASTVisitor &visitor) override |
| Accept an ASTVisitor (double-dispatch). | |
| std::string | toString () const override |
| Return a human-readable description of this node. | |
| Public Member Functions inherited from pascal::ASTNode | |
| virtual | ~ASTNode ()=default |
| virtual void | print (std::ostream &out, int indent=0) const |
| Pretty-print this node to a stream with indentation. | |
| void | setLineNumber (int line) |
| Set the originating source line number. | |
| int | getLineNumber () const |
| Get the originating source line number. | |
Public Attributes | |
| std::string | name |
| function name | |
| std::vector< std::unique_ptr< ASTNode > > | parameters |
| formal parameters | |
| std::string | returnType |
| return type name | |
| std::shared_ptr< ASTNode > | block |
| function body block | |
|
inline |
Definition at line 201 of file ast.hpp.
References block, name, parameters, and returnType.
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 83 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 87 of file ast.cpp.
References name, and returnType.
| std::shared_ptr<ASTNode> pascal::FuncDeclNode::block |
function body block
Definition at line 199 of file ast.hpp.
Referenced by FuncDeclNode(), and pascal::CodeGenVisitor::visit().
| std::string pascal::FuncDeclNode::name |
function name
Definition at line 196 of file ast.hpp.
Referenced by FuncDeclNode(), toString(), and pascal::CodeGenVisitor::visit().
| std::vector<std::unique_ptr<ASTNode> > pascal::FuncDeclNode::parameters |
formal parameters
Definition at line 197 of file ast.hpp.
Referenced by FuncDeclNode(), and pascal::CodeGenVisitor::visit().
| std::string pascal::FuncDeclNode::returnType |
return type name
Definition at line 198 of file ast.hpp.
Referenced by FuncDeclNode(), toString(), and pascal::CodeGenVisitor::visit().