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

AST node for an exit / halt statement. More...

#include <ast.hpp>

Inheritance diagram for pascal::ExitNode:

Public Member Functions

void accept (ASTVisitor &visitor) override
 Accept an ASTVisitor (double-dispatch).
std::string toString () const override
 Return a human-readable description of this node.
 ExitNode ()=default
 ExitNode (std::unique_ptr< ASTNode > e)
 Construct with an optional exit-code expression.
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::unique_ptr< ASTNode > expr
 optional exit-code expression

Detailed Description

AST node for an exit / halt statement.

Definition at line 44 of file ast.hpp.

Constructor & Destructor Documentation

◆ ExitNode() [1/2]

pascal::ExitNode::ExitNode ( )
default

◆ ExitNode() [2/2]

pascal::ExitNode::ExitNode ( std::unique_ptr< ASTNode > e)
inlineexplicit

Construct with an optional exit-code expression.

Definition at line 51 of file ast.hpp.

References expr.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 402 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 324 of file ast.cpp.

Member Data Documentation

◆ expr

std::unique_ptr<ASTNode> pascal::ExitNode::expr

optional exit-code expression

Definition at line 48 of file ast.hpp.

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


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