|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for a complete program (program name + block). More...
#include <ast.hpp>

Public Member Functions | |
| ProgramNode (const std::string &name, std::unique_ptr< BlockNode > blk) | |
| 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 |
| program identifier | |
| std::unique_ptr< BlockNode > | block |
| the program body | |
| std::vector< std::string > | uses |
| modules imported via 'uses' clause | |
| pascal::ProgramNode::ProgramNode | ( | const std::string & | name, |
| std::unique_ptr< BlockNode > | blk ) |
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 23 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 27 of file ast.cpp.
References name.
| std::unique_ptr<BlockNode> pascal::ProgramNode::block |
the program body
Definition at line 101 of file ast.hpp.
Referenced by ProgramNode(), and pascal::CodeGenVisitor::visit().
| std::string pascal::ProgramNode::name |
program identifier
Definition at line 100 of file ast.hpp.
Referenced by ProgramNode(), toString(), and pascal::CodeGenVisitor::visit().
| std::vector<std::string> pascal::ProgramNode::uses |
modules imported via 'uses' clause
Definition at line 102 of file ast.hpp.
Referenced by pascal::CodeGenVisitor::visit().