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.
765 766 767 768 769 770 |
# File 'lib/racc/state.rb', line 765 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.
774 775 776 |
# File 'lib/racc/state.rb', line 774 def from_state @from_state end |
#ident ⇒ Object (readonly)
Returns the value of attribute ident.
772 773 774 |
# File 'lib/racc/state.rb', line 772 def ident @ident end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
773 774 775 |
# File 'lib/racc/state.rb', line 773 def symbol @symbol end |
#to_state ⇒ Object (readonly)
Returns the value of attribute to_state.
775 776 777 |
# File 'lib/racc/state.rb', line 775 def to_state @to_state end |
Instance Method Details
#inspect ⇒ Object
777 778 779 |
# File 'lib/racc/state.rb', line 777 def inspect "(#{@from_state.ident}-#{@symbol}->#{@to_state.ident})" end |