123456789_123456789_123456789_123456789_123456789_

Class: Racc::Goto

Relationships & Source Files
Inherits: Object
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.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(ident, sym, from, to) ⇒ Goto

[ GitHub ]

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

[ GitHub ]

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

attr_reader :from_state

#ident (readonly)

[ GitHub ]

  
# File 'lib/racc/state.rb', line 772

attr_reader :ident

#symbol (readonly)

[ GitHub ]

  
# File 'lib/racc/state.rb', line 773

attr_reader :symbol

#to_state (readonly)

[ GitHub ]

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

attr_reader :to_state

Instance Method Details

#inspect

[ GitHub ]

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

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