|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for a Pascal unit (separately compiled module). More...
#include <ast.hpp>

Public Member Functions | |
| UnitNode (const std::string &name) | |
| 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 |
| unit identifier | |
| std::vector< std::string > | uses |
| modules/units imported via 'uses' clause | |
| std::vector< std::unique_ptr< ASTNode > > | interfaceDecls |
| exported procedure/function forward declarations | |
| std::vector< std::unique_ptr< ASTNode > > | implDecls |
| implementation declarations (proc/func/var/const/type) | |
AST node for a Pascal unit (separately compiled module).
A unit has an interface section (exported forward declarations) and an implementation section (actual code). Compiles to an MXVM object.
|
inline |
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 31 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 35 of file ast.cpp.
References name.
| std::vector<std::unique_ptr<ASTNode> > pascal::UnitNode::implDecls |
implementation declarations (proc/func/var/const/type)
Definition at line 121 of file ast.hpp.
Referenced by pascal::CodeGenVisitor::visit().
| std::vector<std::unique_ptr<ASTNode> > pascal::UnitNode::interfaceDecls |
exported procedure/function forward declarations
Definition at line 120 of file ast.hpp.
Referenced by pascal::CodeGenVisitor::visit().
| std::string pascal::UnitNode::name |
unit identifier
Definition at line 118 of file ast.hpp.
Referenced by UnitNode(), toString(), and pascal::CodeGenVisitor::visit().
| std::vector<std::string> pascal::UnitNode::uses |
modules/units imported via 'uses' clause
Definition at line 119 of file ast.hpp.
Referenced by pascal::CodeGenVisitor::visit().