Class: Racc::GrammarFileParser
Overview
reopen
Defined Under Namespace
Classes: Result
Class Method Summary collapse
Instance Method Summary collapse
- 
  
    
      #initialize(debug_flags = DebugFlags.new)  ⇒ GrammarFileParser 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of GrammarFileParser.
 - #parse(src, filename = '-', lineno = 1) ⇒ Object
 
Constructor Details
#initialize(debug_flags = DebugFlags.new) ⇒ GrammarFileParser
Returns a new instance of GrammarFileParser.
      173 174 175  | 
    
      # File 'lib/racc/grammarfileparser.rb', line 173 def initialize(debug_flags = DebugFlags.new) @yydebug = debug_flags.parse end  | 
  
Class Method Details
.parse(src, filename = '-', lineno = 1) ⇒ Object
      169 170 171  | 
    
      # File 'lib/racc/grammarfileparser.rb', line 169 def GrammarFileParser.parse(src, filename = '-', lineno = 1) new().parse(src, filename, lineno) end  | 
  
.parse_file(filename) ⇒ Object
      165 166 167  | 
    
      # File 'lib/racc/grammarfileparser.rb', line 165 def GrammarFileParser.parse_file(filename) parse(File.read(filename), filename, 1) end  | 
  
Instance Method Details
#parse(src, filename = '-', lineno = 1) ⇒ Object
      177 178 179 180 181 182 183 184 185 186 187 188 189  | 
    
      # File 'lib/racc/grammarfileparser.rb', line 177 def parse(src, filename = '-', lineno = 1) @filename = filename @lineno = lineno @scanner = GrammarFileScanner.new(src, @filename) @scanner.debug = @yydebug @grammar = Grammar.new @result = Result.new(@grammar) @embedded_action_seq = 0 yyparse @scanner, :yylex parse_user_code @result.grammar.init @result end  |