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

AST node for a label definition (label: statement). More...

#include <ast.hpp>

Inheritance diagram for pascal::LabelStmtNode:

Public Member Functions

 LabelStmtNode (const std::string &lbl, std::unique_ptr< ASTNode > stmt)
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 label
 the label (numeric string)
std::unique_ptr< ASTNodestatement
 labeled statement

Detailed Description

AST node for a label definition (label: statement).

Definition at line 692 of file ast.hpp.

Constructor & Destructor Documentation

◆ LabelStmtNode()

pascal::LabelStmtNode::LabelStmtNode ( const std::string & lbl,
std::unique_ptr< ASTNode > stmt )
inline

Definition at line 697 of file ast.hpp.

References label, and statement.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 450 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

std::string pascal::LabelStmtNode::toString ( ) const
inlineoverridevirtual

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 701 of file ast.hpp.

References label.

Member Data Documentation

◆ label

std::string pascal::LabelStmtNode::label

the label (numeric string)

Definition at line 694 of file ast.hpp.

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

◆ statement

std::unique_ptr<ASTNode> pascal::LabelStmtNode::statement

labeled statement

Definition at line 695 of file ast.hpp.

Referenced by LabelStmtNode(), and pascal::CodeGenVisitor::visit().


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