|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node representing a block (declarations + compound statement). More...
#include <ast.hpp>

Public Member Functions | |
| BlockNode (std::vector< std::unique_ptr< ASTNode > > decls, std::unique_ptr< CompoundStmtNode > stmt) | |
| Construct a block node. | |
| 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::vector< std::unique_ptr< ASTNode > > | declarations |
| variable / type / const / procedure / function declarations | |
| std::unique_ptr< CompoundStmtNode > | compoundStatement |
| the begin..end compound statement | |
AST node representing a block (declarations + compound statement).
| pascal::BlockNode::BlockNode | ( | std::vector< std::unique_ptr< ASTNode > > | decls, |
| std::unique_ptr< CompoundStmtNode > | stmt ) |
Construct a block node.
| decls | List of declaration nodes |
| stmt | The compound statement body |
Definition at line 11 of file ast.cpp.
References compoundStatement, and declarations.
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 39 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
Definition at line 43 of file ast.cpp.
References declarations.
| std::unique_ptr<CompoundStmtNode> pascal::BlockNode::compoundStatement |
the begin..end compound statement
Definition at line 82 of file ast.hpp.
Referenced by BlockNode(), and pascal::CodeGenVisitor::visit().
| std::vector<std::unique_ptr<ASTNode> > pascal::BlockNode::declarations |
variable / type / const / procedure / function declarations
Definition at line 81 of file ast.hpp.
Referenced by BlockNode(), toString(), and pascal::CodeGenVisitor::visit().