Class: Loxxy::Ast::LoxForStmt
- Inherits:
-
LoxCompoundExpr
- Object
- LoxNode
- LoxCompoundExpr
- Loxxy::Ast::LoxForStmt
- Defined in:
- lib/loxxy/ast/lox_for_stmt.rb
Instance Attribute Summary collapse
-
#body_stmt ⇒ LoxNode
Body statement.
-
#test_expr ⇒ LoxNode
readonly
Test expression.
-
#update_expr ⇒ LoxNode
readonly
Update expression.
Attributes inherited from LoxCompoundExpr
Attributes inherited from LoxNode
Instance Method Summary collapse
-
#condition ⇒ LoxNode
Accessor to the condition expression.
-
#initialize(aPosition, initialization, testExpr, updateExpr) ⇒ LoxForStmt
constructor
A new instance of LoxForStmt.
Methods inherited from LoxCompoundExpr
Methods inherited from LoxNode
Methods included from ASTVisitee
Constructor Details
#initialize(aPosition, initialization, testExpr, updateExpr) ⇒ LoxForStmt
21 22 23 24 25 26 |
# File 'lib/loxxy/ast/lox_for_stmt.rb', line 21 def initialize(aPosition, initialization, testExpr, updateExpr) child = initialization ? [initialization] : [] super(aPosition, child) @test_expr = testExpr @update_expr = updateExpr end |
Instance Attribute Details
#body_stmt ⇒ LoxNode
15 16 17 |
# File 'lib/loxxy/ast/lox_for_stmt.rb', line 15 def body_stmt @body_stmt end |
#test_expr ⇒ LoxNode (readonly)
9 10 11 |
# File 'lib/loxxy/ast/lox_for_stmt.rb', line 9 def test_expr @test_expr end |
#update_expr ⇒ LoxNode (readonly)
12 13 14 |
# File 'lib/loxxy/ast/lox_for_stmt.rb', line 12 def update_expr @update_expr end |
Instance Method Details
#condition ⇒ LoxNode
Accessor to the condition expression
30 31 32 |
# File 'lib/loxxy/ast/lox_for_stmt.rb', line 30 def condition subnodes[0] end |