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.
211 212 213 |
# File 'lib/crokus/ast.rb', line 211 def initialize lhs,rhs @lhs,@rhs=lhs,rhs end |
Instance Attribute Details
#lhs ⇒ Object
Returns the value of attribute lhs.
210 211 212 |
# File 'lib/crokus/ast.rb', line 210 def lhs @lhs end |
#rhs ⇒ Object
Returns the value of attribute rhs.
210 211 212 |
# File 'lib/crokus/ast.rb', line 210 def rhs @rhs end |
Instance Method Details
#to_list ⇒ Object
215 216 217 218 219 220 |
# File 'lib/crokus/ast.rb', line 215 def to_list list=[] list << to_list_rec(@lhs) list << to_list_rec(@rhs) list.flatten end |
#to_list_rec(e) ⇒ Object
222 223 224 225 226 227 228 229 230 |
# File 'lib/crokus/ast.rb', line 222 def to_list_rec e ret=[] if e.is_a? CommaStmt ret << e.to_list else ret << e end ret end |