Class: Racc::Goto
Overview
Represents a transition on the grammar. “Real goto” means a transition by nonterminal, but this class treats also terminal’s. If one is a terminal transition, .ident returns nil.
Instance Attribute Summary collapse
-
#from_state ⇒ Object
readonly
Returns the value of attribute from_state.
-
#ident ⇒ Object
readonly
Returns the value of attribute ident.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#to_state ⇒ Object
readonly
Returns the value of attribute to_state.
Instance Method Summary collapse
-
#initialize(ident, sym, from, to) ⇒ Goto
constructor
A new instance of Goto.
- #inspect ⇒ Object
Constructor Details
#initialize(ident, sym, from, to) ⇒ Goto
Returns a new instance of Goto.
767 768 769 770 771 772 |
# File 'lib/racc/state.rb', line 767 def initialize(ident, sym, from, to) @ident = ident @symbol = sym @from_state = from @to_state = to end |
Instance Attribute Details
#from_state ⇒ Object (readonly)
Returns the value of attribute from_state.
776 777 778 |
# File 'lib/racc/state.rb', line 776 def from_state @from_state end |
#ident ⇒ Object (readonly)
Returns the value of attribute ident.
774 775 776 |
# File 'lib/racc/state.rb', line 774 def ident @ident end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
775 776 777 |
# File 'lib/racc/state.rb', line 775 def symbol @symbol end |
#to_state ⇒ Object (readonly)
Returns the value of attribute to_state.
777 778 779 |
# File 'lib/racc/state.rb', line 777 def to_state @to_state end |
Instance Method Details
#inspect ⇒ Object
779 780 781 |
# File 'lib/racc/state.rb', line 779 def inspect "(#{@from_state.ident}-#{@symbol}->#{@to_state.ident})" end |