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

AST node for a with statement (with record do statement). More...

#include <ast.hpp>

Inheritance diagram for pascal::WithStmtNode:

Public Member Functions

 WithStmtNode (const std::string &recordVar, 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 recordVar
 record variable name
std::unique_ptr< ASTNode > statement
 body statement

Detailed Description

AST node for a with statement (with record do statement).

Definition at line 668 of file ast.hpp.

Constructor & Destructor Documentation

◆ WithStmtNode()

pascal::WithStmtNode::WithStmtNode ( const std::string & recordVar,
std::unique_ptr< ASTNode > stmt )
inline

Definition at line 673 of file ast.hpp.

References recordVar, and statement.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 442 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 677 of file ast.hpp.

References recordVar.

Member Data Documentation

◆ recordVar

std::string pascal::WithStmtNode::recordVar

record variable name

Definition at line 670 of file ast.hpp.

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

◆ statement

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

body statement

Definition at line 671 of file ast.hpp.

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


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