println("");
for (int i = 0; i < bitsetList.size(); i++)
{
BitSet p = (BitSet)bitsetList.elementAt(i);
// Ensure that generated BitSet is large enough for vocabulary
p.growToInclude(maxVocabulary);
// initialization data
println(
"const unsigned long " + prefix + getBitsetName(i) + "_data_" + "[] = { " +
p.toStringOfHalfWords() +
" };"
);
// Dump the contents of the bitset in readable format...
String t = "// ";
for( int j = 0; j < tm.getVocabulary().size(); j++ )
{
if ( p.member( j ) )
{
if ( (grammar instanceof LexerGrammar) )
{
// only dump out for pure printable ascii.
if( ( 0x20 <= j ) && ( j < 0x7F ) && (j != '\\') )
t += charFormatter.escapeChar(j,true)+" ";
else
t += "0x"+Integer.toString(j,16)+" ";
}
else
t += tm.getTokenStringAt(j)+" ";
if( t.length() > 70 )
{
println(t);
t = "// ";
}
}
}
if ( t != "// " )
println(t);
// BitSet object
println(
"const "+namespaceAntlr+"BitSet " + prefix + getBitsetName(i) + "(" +
getBitsetName(i) + "_data_," + p.size()/32 +
");"
);
}
}