Class: Crokus::CommaStmt
Instance Attribute Summary collapse
-
#lhs ⇒ Object
Returns the value of attribute lhs.
-
#rhs ⇒ Object
Returns the value of attribute rhs.
Instance Method Summary collapse
-
#initialize(lhs, rhs) ⇒ CommaStmt
constructor
A new instance of CommaStmt.
- #to_list ⇒ Object
- #to_list_rec(e) ⇒ Object
Methods inherited from Ast
Constructor Details
#initialize(lhs, rhs) ⇒ CommaStmt
Returns a new instance of CommaStmt.
215 216 217 |
# File 'lib/crokus/ast.rb', line 215 def initialize lhs,rhs @lhs,@rhs=lhs,rhs end |
Instance Attribute Details
#lhs ⇒ Object
Returns the value of attribute lhs.
214 215 216 |
# File 'lib/crokus/ast.rb', line 214 def lhs @lhs end |
#rhs ⇒ Object
Returns the value of attribute rhs.
214 215 216 |
# File 'lib/crokus/ast.rb', line 214 def rhs @rhs end |
Instance Method Details
#to_list ⇒ Object
219 220 221 222 223 224 |
# File 'lib/crokus/ast.rb', line 219 def to_list list=[] list << to_list_rec(@lhs) list << to_list_rec(@rhs) list.flatten end |
#to_list_rec(e) ⇒ Object
226 227 228 229 230 231 232 233 234 |
# File 'lib/crokus/ast.rb', line 226 def to_list_rec e ret=[] if e.is_a? CommaStmt ret << e.to_list else ret << e end ret end |