Class: Baba::Stmt::While
- Inherits:
-
Object
- Object
- Baba::Stmt::While
- Defined in:
- lib/baba/stmt.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(condition, body) ⇒ While
constructor
A new instance of While.
Constructor Details
#initialize(condition, body) ⇒ While
Returns a new instance of While.
114 115 116 |
# File 'lib/baba/stmt.rb', line 114 def initialize(condition, body) @condition = condition; @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
112 113 114 |
# File 'lib/baba/stmt.rb', line 112 def body @body end |
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
112 113 114 |
# File 'lib/baba/stmt.rb', line 112 def condition @condition end |
Instance Method Details
#accept(visitor) ⇒ Object
118 119 120 |
# File 'lib/baba/stmt.rb', line 118 def accept(visitor) visitor.visit_while_stmt(self) end |