Class: Grammar::Ruby::Code::Steps
- Inherits:
-
List
show all
- Defined in:
- lib/grammar/ruby/code.rb
Constant Summary
False, FalseTerminator, Implicit, Nil, Self, True
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from List
#_codes, #_lines, #_paren, #initialize
[], #_and, #_assign, #_classname, #_code_self, #_codes, #_data, #_def, #_dot, #_else, #_ensure, #_equal, #_immediate, #_inspect, #_lines, #_locals, #_or, #_question, #_rand, #_rcond, #_rescue, #_ror, #_splat, #_to_block, #_unless, #_until, #_while, #initialize, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Grammar::Ruby::Code
Class Method Details
.new(operands) ⇒ Object
608
609
610
|
# File 'lib/grammar/ruby/code.rb', line 608
def self.new(operands)
(operands.size==1) ? operands[0] : super
end
|
Instance Method Details
#_always ⇒ Object
617
618
619
|
# File 'lib/grammar/ruby/code.rb', line 617
def _always
@operands.last._always
end
|
#_mid(before) ⇒ Object
634
635
636
637
638
639
640
641
|
# File 'lib/grammar/ruby/code.rb', line 634
def _mid(before)
@operands.pop._mid(@operands)
if @operands.size==1
@operands.first._mid(before)
else
before << self
end
end
|
#_never ⇒ Object
620
621
622
|
# File 'lib/grammar/ruby/code.rb', line 620
def _never
@operands.last._never
end
|
#_not ⇒ Object
631
632
633
|
# File 'lib/grammar/ruby/code.rb', line 631
def _not
@operands[-1] = @operands[-1]._not
end
|
#_operator ⇒ Object
611
612
613
|
# File 'lib/grammar/ruby/code.rb', line 611
def _operator
nil
end
|
#_operator0 ⇒ Object
614
615
616
|
# File 'lib/grammar/ruby/code.rb', line 614
def _operator0
"; "
end
|
#_rstep(before) ⇒ Object
628
629
630
|
# File 'lib/grammar/ruby/code.rb', line 628
def _rstep(before)
before.concat(@operands)
end
|
#_step(after) ⇒ Object
623
624
625
626
627
|
# File 'lib/grammar/ruby/code.rb', line 623
def _step(after)
@operands.pop._mid(@operands)
after._rstep(@operands)
self
end
|