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/dhaka/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/dhaka/parser/action.rb', line 8 def destination_state @destination_state end |
Instance Method Details
#compile_to_ruby_source ⇒ Object
17 18 19 |
# File 'lib/dhaka/parser/action.rb', line 17 def compile_to_ruby_source "shift_to #{destination_state.id}" end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/dhaka/parser/action.rb', line 21 def to_s "Shift" end |