In Files

  • racc/grammarfileparser.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

Racc::GrammarFileScanner

Attributes

debug[RW]
epilogue[R]

Public Class Methods

new(str, filename = '-') click to toggle source
 
               # File racc/grammarfileparser.rb, line 298
def initialize(str, filename = '-')
  @lines  = str.b.split(/\n|\r\n|\r/)
  @filename = filename
  @lineno = -1
  @line_head   = true
  @in_rule_blk = false
  @in_conv_blk = false
  @in_block = nil
  @epilogue = ''
  @debug = false
  next_line
end
            

Public Instance Methods

lineno() click to toggle source
 
               # File racc/grammarfileparser.rb, line 313
def lineno
  @lineno + 1
end
            
yylex(&block) click to toggle source
 
               # File racc/grammarfileparser.rb, line 319
def yylex(&block)
  unless @debug
    yylex0(&block)
  else
    yylex0 do |sym, tok|
      $stderr.printf "%7d %-10s %s\n", lineno(), sym.inspect, tok.inspect
      yield [sym, tok]
    end
  end
end