genBitsets(Vector bitsetList,
int maxVocabulary)
Generate all the bitsets to be used in the parser or lexer
Generate the raw bitset data like "long _tokenSet1_data[] = {...};"
and the BitSet object declarations like "BitSet _tokenSet1 = new BitSet(_tokenSet1_data);"
Note that most languages do not support object initialization inside a
class definition, so other code-generators may have to separate the
bitset declarations from the initializations (e.g., put the initializations
in the generated constructor instead).

private void

genBlockFinish(JavaBlockFinishingInfo howToFinish,
String noViableAction)
Generate the finish of a block, using a combination of the info
returned from genCommonBlock() and the action to perform when
no alts were taken

addSemPred

Adds a semantic predicate string to the sem pred vector
These strings will be used to build an array of sem pred names
when building a debugging parser. This method should only be
called when the debug option is specified

genBitsets

Generate all the bitsets to be used in the parser or lexer
Generate the raw bitset data like "long _tokenSet1_data[] = {...};"
and the BitSet object declarations like "BitSet _tokenSet1 = new BitSet(_tokenSet1_data);"
Note that most languages do not support object initialization inside a
class definition, so other code-generators may have to separate the
bitset declarations from the initializations (e.g., put the initializations
in the generated constructor instead).

Parameters:

bitsetList - The list of bitsets to generate.

maxVocabulary - Ensure that each generated bitset can contain at least this value.

genCommonBlock

Enabled: Generate common code for a block of alternatives; return a
postscript that needs to be generated at the end of the
block. Other routines may append else-clauses and such for
error checking before the postfix is generated. If the
grammar is a lexer, then generate alternatives in an order
where alternatives requiring deeper lookahead are generated
first, and EOF in the lookahead set reduces the depth of
the lookahead. @param blk The block to generate @param
noTestForSingle If true, then it does not generate a test
for a single alternative.

genRule

Enabled: Gen a named rule block.
ASTs are generated for each element of an alternative unless
the rule or the alternative have a '!' modifier.
If an alternative defeats the default tree construction, it
must set _AST to the root of the returned AST.
Each alternative that does automatic tree construction, builds
up root and child list pointers in an ASTPair structure.
A rule finishes by setting the returnAST variable from the
ASTPair.

Parameters:

startSymbol - true if the rule is a start symbol (i.e., not referenced elsewhere)

genSynPred

genTokenStrings

public void genTokenStrings()

Enabled: Generate a static array containing the names of the tokens,
indexed by the token type values. This static array is used
to format error messages so that the token identifers or literal
strings are displayed instead of the token numbers.
If a lexical rule has a paraphrase, use it rather than the
token label.

getLookaheadTestTerm

Generate a depth==1 lookahead test expression given the BitSet.
This may be one of:
1) a series of 'x==X||' tests
2) a range test using >= && <= where possible,
3) a bitset membership test for complex comparisons

lookaheadString

mangleLiteral

Mangle a string literal into a meaningful token name. This is
only possible for literals that are all characters. The resulting
mangled literal name is literalsPrefix with the text of the literal
appended.