Class: Racc::SRconflict

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sid, shift, reduce) ⇒ SRconflict

Returns a new instance of SRconflict.



941
942
943
944
945
# File 'lib/racc/state.rb', line 941

def initialize(sid, shift, reduce)
  @stateid = sid
  @shift   = shift
  @reduce  = reduce
end

Instance Attribute Details

#reduceObject (readonly)

Returns the value of attribute reduce.



949
950
951
# File 'lib/racc/state.rb', line 949

def reduce
  @reduce
end

#shiftObject (readonly)

Returns the value of attribute shift.



948
949
950
# File 'lib/racc/state.rb', line 948

def shift
  @shift
end

#stateidObject (readonly)

Returns the value of attribute stateid.



947
948
949
# File 'lib/racc/state.rb', line 947

def stateid
  @stateid
end

Instance Method Details

#to_sObject



951
952
953
954
# File 'lib/racc/state.rb', line 951

def to_s
  sprintf('state %d: S/R conflict rule %d reduce and shift %s',
          @stateid, @reduce.ruleid, @shift.to_s)
end