MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
pascal::CompoundStmtNode Class Reference

AST node for a compound statement (begin ... end). More...

#include <ast.hpp>

Inheritance diagram for pascal::CompoundStmtNode:

Public Member Functions

 CompoundStmtNode (std::vector< std::unique_ptr< ASTNode > > stmts)
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 > > statements
 ordered list of statements

Detailed Description

AST node for a compound statement (begin ... end).

Definition at line 237 of file ast.hpp.

Constructor & Destructor Documentation

◆ CompoundStmtNode()

pascal::CompoundStmtNode::CompoundStmtNode ( std::vector< std::unique_ptr< ASTNode > > stmts)
inline

Definition at line 241 of file ast.hpp.

References statements.

Member Function Documentation

◆ accept()

void pascal::CompoundStmtNode::accept ( ASTVisitor & visitor)
overridevirtual

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 109 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

std::string pascal::CompoundStmtNode::toString ( ) const
overridevirtual

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 113 of file ast.cpp.

References statements.

Member Data Documentation

◆ statements

std::vector<std::unique_ptr<ASTNode> > pascal::CompoundStmtNode::statements

ordered list of statements

Definition at line 239 of file ast.hpp.

Referenced by CompoundStmtNode(), toString(), and pascal::CodeGenVisitor::visit().


The documentation for this class was generated from the following files: