Class: Racc::Goto

Inherits:
Object show all
Defined in:
lib/racc/state.rb

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

Instance Method Summary collapse

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_stateObject (readonly)

Returns the value of attribute from_state


776
777
778
# File 'lib/racc/state.rb', line 776

def from_state
  @from_state
end

#identObject (readonly)

Returns the value of attribute ident


774
775
776
# File 'lib/racc/state.rb', line 774

def ident
  @ident
end

#symbolObject (readonly)

Returns the value of attribute symbol


775
776
777
# File 'lib/racc/state.rb', line 775

def symbol
  @symbol
end

#to_stateObject (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

#inspectObject


779
780
781
# File 'lib/racc/state.rb', line 779

def inspect
  "(#{@from_state.ident}-#{@symbol}->#{@to_state.ident})"
end