/** Generate the lexer C++ files */ public void gen(LexerGrammar g) throws IOException { // If debugging, create a new sempred vector for this grammar if (g.debuggingOutput) semPreds = new Vector(); if( g.charVocabulary.size() > 256 ) antlrTool.warning(g.getFilename()+": Vocabularies of this size still experimental in C++ mode (vocabulary size now: "+g.charVocabulary.size()+")"); setGrammar(g); if (!(grammar instanceof LexerGrammar)) { antlrTool.panic("Internal error generating lexer"); } genBody(g); genInclude(g); } /** Generate code for the given grammar element.
maxsize = ((LexerGrammar)grammar).charVocabulary.size() - 1; if( maxsize > 255 ) prefix= "L";
getBitsetName(i) + "_data_," + p.size()/32 + ");" );
genBitsets(bitsetsUsed, ((LexerGrammar)grammar).charVocabulary.size()); println("");
genBitsets(bitsetsUsed, ((LexerGrammar)grammar).charVocabulary.size(), grammar.getClassName() + "::" );
genBitsetsHeader(bitsetsUsed, ((LexerGrammar)grammar).charVocabulary.size());
genBitsets(bitsetsUsed, ((LexerGrammar)grammar).charVocabulary.size());
genBitsets(bitsetsUsed, ((LexerGrammar)grammar).charVocabulary.size());