Method: Racc::LogFileGenerator#pointer_out

Defined in:
lib/racc/logfilegenerator.rb

#pointer_out(out, ptr) ⇒ Object



83
84
85
86
87
88
89
90
91
# File 'lib/racc/logfilegenerator.rb', line 83

def pointer_out(out, ptr)
  buf = sprintf("%4d) %s :", ptr.rule.ident, ptr.rule.target.to_s)
  ptr.rule.symbols.each_with_index do |tok, idx|
    buf << ' _' if idx == ptr.index
    buf << ' ' << tok.to_s
  end
  buf << ' _' if ptr.reduce?
  out.puts buf
end