Class: Loxxy::Ast::LoxWhileStmt
- Inherits:
-
LoxCompoundExpr
- Object
- LoxNode
- LoxCompoundExpr
- Loxxy::Ast::LoxWhileStmt
- Defined in:
- lib/loxxy/ast/lox_while_stmt.rb
Instance Attribute Summary collapse
-
#body ⇒ LoxNode
readonly
Body of the while loop (as a statement).
Attributes inherited from LoxCompoundExpr
Attributes inherited from LoxNode
Instance Method Summary collapse
-
#condition ⇒ LoxNode
Accessor to the condition expression.
-
#initialize(aPosition, condExpr, theBody) ⇒ LoxWhileStmt
constructor
A new instance of LoxWhileStmt.
Methods inherited from LoxCompoundExpr
Methods inherited from LoxNode
Methods included from ASTVisitee
Constructor Details
#initialize(aPosition, condExpr, theBody) ⇒ LoxWhileStmt
Returns a new instance of LoxWhileStmt.
14 15 16 17 |
# File 'lib/loxxy/ast/lox_while_stmt.rb', line 14 def initialize(aPosition, condExpr, theBody) super(aPosition, [condExpr]) @body = theBody end |
Instance Attribute Details
#body ⇒ LoxNode (readonly)
Returns body of the while loop (as a statement).
9 10 11 |
# File 'lib/loxxy/ast/lox_while_stmt.rb', line 9 def body @body end |
Instance Method Details
#condition ⇒ LoxNode
Accessor to the condition expression
21 22 23 |
# File 'lib/loxxy/ast/lox_while_stmt.rb', line 21 def condition subnodes[0] end |