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.
772 773 774 775 776 777 |
# File 'lib/racc/state.rb', line 772 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.
781 782 783 |
# File 'lib/racc/state.rb', line 781 def from_state @from_state end |
#ident ⇒ Object (readonly)
Returns the value of attribute ident.
779 780 781 |
# File 'lib/racc/state.rb', line 779 def ident @ident end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
780 781 782 |
# File 'lib/racc/state.rb', line 780 def symbol @symbol end |
#to_state ⇒ Object (readonly)
Returns the value of attribute to_state.
782 783 784 |
# File 'lib/racc/state.rb', line 782 def to_state @to_state end |
Instance Method Details
#inspect ⇒ Object
784 785 786 |
# File 'lib/racc/state.rb', line 784 def inspect "(#{@from_state.ident}-#{@symbol}->#{@to_state.ident})" end |