g.loadImportedGrammars();
GrammarTransformPipeline transform = new GrammarTransformPipeline(g, this);
transform.process();
LexerGrammar lexerg;
GrammarRootAST lexerAST;
if ( g.ast!=null && g.ast.grammarType== ANTLRParser.COMBINED &&
!g.ast.hasErrors )
{
lexerAST = transform.extractImplicitLexer(g); // alters g.ast
if ( lexerAST!=null ) {
if (grammarOptions != null) {
lexerAST.cmdLineOptions = grammarOptions;
}
lexerg = new LexerGrammar(this, lexerAST);
lexerg.fileName = g.fileName;
lexerg.originalGrammar = g;
g.implicitLexer = lexerg;
lexerg.implicitLexerOwner = g;
processNonCombinedGrammar(lexerg, gencode);