Lines Matching refs:Grammar
14 A rake task-generating utility concerning ANTLR grammar file
163 for grammar in @grammars
165 if vocab = grammar.token_vocab and
166 tfile = find_tokens_file( vocab, grammar )
170 grammar.define_tasks( deps )
175 for grammar in @grammars
176 grammar.clean
183 def find_tokens_file( vocab, grammar )
188 | unable to locate .tokens file `#{ vocab }' referenced in #{ grammar.path }
201 def compile( grammar )
204 sh( build_command( grammar ) )
207 def build_command( grammar )
215 parts << grammar.path
335 for grammar in @imported_grammars
336 targets.concat( grammar.target_files )
349 for grammar in @imported_grammars
350 imported_files.push( grammar.path, *grammar.all_imported_files )
364 for grammar in @imported_grammars
365 deleted.concat( grammar.clean )
394 | #{ @path }: unable to locate imported grammar file #{ imp }.g
404 @source =~ /^\s*(lexer|parser|tree)?\s*grammar\s*(\S+)\s*;/ or
405 raise Grammar::FormatError[ @source, @path ]
413 raise( Grammar::FormatError, "Unknown ANTLR target language: %p" % @language )
424 end # class Grammar
468 message << "bad inline grammar source:\n"
473 message << "could not locate a grammar name and type declaration matching\n"
474 message << "/^\s*(lexer|parser|tree)?\s*grammar\s*(\S+)\s*;/"
476 message << 'bad grammar source in file %p\n' % @file
481 message << "could not locate a grammar name and type declaration matching\n"
482 message << "/^\s*(lexer|parser|tree)?\s*grammar\s*(\S+)\s*;/"
486 end # error Grammar::FormatError