# File lib/racc/grammar.rb, line 684 def ==(other) other.kind_of?(Rule) and @ident == other.ident end
# File lib/racc/grammar.rb, line 704 def accept? if tok = @symbols[-1] tok.anchor? else false end end
# File lib/racc/grammar.rb, line 712 def each(&block) @symbols.each(&block) end
# File lib/racc/grammar.rb, line 633 def each_rule(&block) yield self @alternatives.each(&block) end
# File lib/racc/grammar.rb, line 643 def hash=(n) @hash = n ptrs = [] @symbols.each_with_index do |sym, idx| ptrs.push LocationPointer.new(self, idx, sym) end ptrs.push LocationPointer.new(self, @symbols.size, nil) @ptrs = ptrs end
# File lib/racc/grammar.rb, line 680 def inspect "#<Racc::Rule id=#{@ident} (#{@target})>" end
# File lib/racc/grammar.rb, line 661 def prec(sym, &block) @specified_prec = sym if block unless @action.empty? raise CompileError, 'both of rule action block and prec block given' end @action = UserAction.proc(block) end self end
# File lib/racc/grammar.rb, line 653 def precedence @specified_prec || @precedence end
# File lib/racc/grammar.rb, line 657 def precedence=(sym) @precedence ||= sym end
# File lib/racc/grammar.rb, line 716 def replace(src, dest) @target = dest @symbols = @symbols.map {|s| s == src ? dest : s } end
Generated with the Darkfish Rdoc Generator 2.