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

AST node for a repeat..until loop. More...

#include <ast.hpp>

Inheritance diagram for pascal::RepeatStmtNode:

Public Member Functions

 RepeatStmtNode (std::vector< std::unique_ptr< ASTNode > > stmts, std::unique_ptr< ASTNode > cond)
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
 loop body statements
std::unique_ptr< ASTNodecondition
 termination condition

Detailed Description

AST node for a repeat..until loop.

Definition at line 611 of file ast.hpp.

Constructor & Destructor Documentation

◆ RepeatStmtNode()

pascal::RepeatStmtNode::RepeatStmtNode ( std::vector< std::unique_ptr< ASTNode > > stmts,
std::unique_ptr< ASTNode > cond )
inline

Definition at line 616 of file ast.hpp.

References condition, and statements.

Member Function Documentation

◆ accept()

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

Accept an ASTVisitor (double-dispatch).

Implements pascal::ASTNode.

Definition at line 153 of file ast.cpp.

References pascal::ASTVisitor::visit().

◆ toString()

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

Return a human-readable description of this node.

Implements pascal::ASTNode.

Definition at line 621 of file ast.hpp.

Member Data Documentation

◆ condition

std::unique_ptr<ASTNode> pascal::RepeatStmtNode::condition

termination condition

Definition at line 614 of file ast.hpp.

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

◆ statements

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

loop body statements

Definition at line 613 of file ast.hpp.

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


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