Object
# File racc/grammar.rb, line 901
def delete(sym)
@symbols.delete sym
@cache.delete sym.value
end
# File racc/grammar.rb, line 912
def each(&block)
@symbols.each(&block)
end
# File racc/grammar.rb, line 928
def each_nonterminal(&block)
@nterms.each(&block)
end
# File racc/grammar.rb, line 920
def each_terminal(&block)
@terms.each(&block)
end
# File racc/grammar.rb, line 932
def fix
terms, nterms = @symbols.partition {|s| s.terminal? }
@symbols = terms + nterms
@terms = terms
@nterms = nterms
@nt_base = terms.size
fix_ident
check_terminals
end
# File racc/grammar.rb, line 889
def intern(val, dummy = false)
@cache[val] ||=
begin
sym = Sym.new(val, dummy)
@symbols.push sym
sym
end
end