Parent

Racc::LocationPointer

A set of rule and position in it’s RHS. Note that the number of pointers is more than rule’s RHS array, because pointer points right edge of the final symbol when reducing.

Attributes

rule[R]
index[R]
symbol[R]
ident[R]
reduce[R]

Public Class Methods

new(rule, i, sym) click to toggle source
     # File lib/racc/grammar.rb, line 811
811:     def initialize(rule, i, sym)
812:       @rule   = rule
813:       @index  = i
814:       @symbol = sym
815:       @ident  = @rule.hash + i
816:       @reduce = sym.nil?
817:     end

Public Instance Methods

==(ot) click to toggle source
Alias for: eql?
before(len) click to toggle source
     # File lib/racc/grammar.rb, line 853
853:     def before(len)
854:       @rule.ptrs[@index - len] or ptr_bug!
855:     end
eql?(ot) click to toggle source
     # File lib/racc/grammar.rb, line 837
837:     def eql?(ot)
838:       @hash == ot.hash
839:     end
Also aliased as: ==
head?() click to toggle source
     # File lib/racc/grammar.rb, line 843
843:     def head?
844:       @index == 0
845:     end
increment() click to toggle source
Alias for: next
inspect() click to toggle source
Alias for: to_s
next() click to toggle source
     # File lib/racc/grammar.rb, line 847
847:     def next
848:       @rule.ptrs[@index + 1] or ptr_bug!
849:     end
Also aliased as: increment
to_s() click to toggle source
     # File lib/racc/grammar.rb, line 830
830:     def to_s
831:       sprintf('(%d,%d %s)',
832:               @rule.ident, @index, (reduce?() ? '#' : @symbol.to_s))
833:     end
Also aliased as: inspect

Private Instance Methods

ptr_bug!() click to toggle source
     # File lib/racc/grammar.rb, line 859
859:     def ptr_bug!
860:       raise "racc: fatal: pointer not exist: self: #{to_s}"
861:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.