class 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
Public Class Methods
Source
# File lib/racc/grammar.rb, line 891 def initialize(rule, i, sym) @rule = rule @index = i @symbol = sym @ident = @rule.hash + i @reduce = sym.nil? end
Public Instance Methods
Source
# File lib/racc/grammar.rb, line 933 def before(len) @rule.ptrs[@index - len] or ptr_bug! end
Source
# File lib/racc/grammar.rb, line 927 def next @rule.ptrs[@index + 1] or ptr_bug! end
Also aliased as: increment
Private Instance Methods
Source
# File lib/racc/grammar.rb, line 939 def ptr_bug! raise "racc: fatal: pointer not exist: self: #{to_s}" end