Class: Dhaka::ShiftAction
Overview
:nodoc:
Instance Attribute Summary collapse
-
#destination_state ⇒ Object
readonly
Returns the value of attribute destination_state.
Attributes inherited from Action
Instance Method Summary collapse
- #compile_to_ruby_source ⇒ Object
-
#initialize(destination_state) ⇒ ShiftAction
constructor
A new instance of ShiftAction.
- #to_s ⇒ Object
Constructor Details
#initialize(destination_state) ⇒ ShiftAction
Returns a new instance of ShiftAction.
9 10 11 12 13 14 15 |
# File 'lib/parser/action.rb', line 9 def initialize destination_state @destination_state = destination_state @action_code = Proc.new do state_stack << destination_state [] end end |
Instance Attribute Details
#destination_state ⇒ Object (readonly)
Returns the value of attribute destination_state.
8 9 10 |
# File 'lib/parser/action.rb', line 8 def destination_state @destination_state end |
Instance Method Details
#compile_to_ruby_source ⇒ Object
16 17 18 |
# File 'lib/parser/action.rb', line 16 def compile_to_ruby_source "shift_to #{@destination_state.id}" end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/parser/action.rb', line 19 def to_s "Shift to #{@destination_state}" end |