|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
AST node for a for loop (for var := start to/downto end do stmt). More...
#include <ast.hpp>

Public Member Functions | |
| ForStmtNode (const std::string &var, std::unique_ptr< ASTNode > start, std::unique_ptr< ASTNode > end, bool downto, 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 | variable |
| loop variable name | |
| std::unique_ptr< ASTNode > | startValue |
| initial value expression | |
| std::unique_ptr< ASTNode > | endValue |
| final value expression | |
| bool | isDownto |
| true if downto, false if to | |
| std::unique_ptr< ASTNode > | statement |
| loop body | |
AST node for a for loop (for var := start to/downto end do stmt).
|
overridevirtual |
Accept an ASTVisitor (double-dispatch).
Implements pascal::ASTNode.
Definition at line 145 of file ast.cpp.
References pascal::ASTVisitor::visit().
|
overridevirtual |
Return a human-readable description of this node.
Implements pascal::ASTNode.
| std::unique_ptr<ASTNode> pascal::ForStmtNode::endValue |
final value expression
Definition at line 383 of file ast.hpp.
Referenced by ForStmtNode(), and pascal::CodeGenVisitor::visit().
| bool pascal::ForStmtNode::isDownto |
true if downto, false if to
Definition at line 384 of file ast.hpp.
Referenced by ForStmtNode(), toString(), and pascal::CodeGenVisitor::visit().
| std::unique_ptr<ASTNode> pascal::ForStmtNode::startValue |
initial value expression
Definition at line 382 of file ast.hpp.
Referenced by ForStmtNode(), and pascal::CodeGenVisitor::visit().
| std::unique_ptr<ASTNode> pascal::ForStmtNode::statement |
loop body
Definition at line 385 of file ast.hpp.
Referenced by ForStmtNode(), and pascal::CodeGenVisitor::visit().
| std::string pascal::ForStmtNode::variable |
loop variable name
Definition at line 381 of file ast.hpp.
Referenced by ForStmtNode(), toString(), and pascal::CodeGenVisitor::visit().