Class
Attributes
Read
No documentation available
Read
No documentation available
Class Methods
::
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 810
def initialize(rt, st)
@grammar = rt
@statetable = st
@reduce = []
@shift = []
@accept = nil
@error = nil
end
No documentation available
Instance Methods
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 848
def each_reduce(&block)
@reduce.each(&block)
end
No documentation available
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 867
def each_shift(&block)
@shift.each(&block)
end
No documentation available
#
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 820
def init
@grammar.each do |rule|
@reduce.push Reduce.new(rule)
end
@statetable.each do |state|
@shift.push Shift.new(state)
end
@accept = Accept.new
@error = Error.new
end
No documentation available
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 835
def reduce(i)
case i
when Rule then i = i.ident
when Integer then ;
else
raise "racc: fatal: wrong class #{i.class} for reduce"
end
r = @reduce[i] or raise "racc: fatal: reduce action #{i.inspect} not exist"
r.incref
r
end
No documentation available
#
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 831
def reduce_n
@reduce.size
end
No documentation available
#
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 856
def shift(i)
case i
when State then i = i.ident
when Integer then ;
else
raise "racc: fatal: wrong class #{i.class} for shift"
end
@shift[i] or raise "racc: fatal: shift action #{i} does not exist"
end
No documentation available
#
lib/racc/state.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/racc/state.rb, line 852
def shift_n
@shift.size
end
No documentation available