| |
|
| java.lang.Object persistence.antlr.Parser persistence.antlr.LLkParser persistence.antlr.debug.ParseTreeDebugParser
ParseTreeDebugParser | public class ParseTreeDebugParser extends LLkParser (Code) | | Override the standard matching and rule entry/exit routines
to build parse trees. This class is useful for 2.7.3 where
you can specify a superclass like
class TinyCParser extends Parser(ParseTreeDebugParser);
|
currentParseTreeRoot | protected Stack currentParseTreeRoot(Code) | | Each new rule invocation must have it's own subtree. Tokens
are added to the current root so we must have a stack of subtree roots.
|
mostRecentParseTreeRoot | protected ParseTreeRule mostRecentParseTreeRoot(Code) | | Track most recently created parse subtree so that when parsing
is finished, we can get to the root.
|
numberOfDerivationSteps | protected int numberOfDerivationSteps(Code) | | For every rule replacement with a production, we bump up count.
|
ParseTreeDebugParser | public ParseTreeDebugParser(int k_)(Code) | | |
addCurrentTokenToParseTree | protected void addCurrentTokenToParseTree() throws TokenStreamException(Code) | | This adds LT(1) to the current parse subtree. Note that the match()
routines add the node before checking for correct match. This means
that, upon mismatched token, there will a token node in the tree
corresponding to where that token was expected. For no viable
alternative errors, no node will be in the tree as nothing was
matched() (the lookahead failed to predict an alternative).
|
getNumberOfDerivationSteps | public int getNumberOfDerivationSteps()(Code) | | |
|
|
|