public class ParseTreeDebugParser extends LLkParser
Modifier and Type | Field and Description |
---|---|
protected java.util.Stack |
currentParseTreeRoot
Each new rule invocation must have it's own subtree.
|
protected ParseTreeRule |
mostRecentParseTreeRoot
Track most recently created parse subtree so that when parsing
is finished, we can get to the root.
|
protected int |
numberOfDerivationSteps
For every rule replacement with a production, we bump up count.
|
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
Constructor and Description |
---|
ParseTreeDebugParser(int k_) |
ParseTreeDebugParser(ParserSharedInputState state,
int k_) |
ParseTreeDebugParser(TokenBuffer tokenBuf,
int k_) |
ParseTreeDebugParser(TokenStream lexer,
int k_) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCurrentTokenToParseTree()
This adds LT(1) to the current parse subtree.
|
int |
getNumberOfDerivationSteps() |
ParseTree |
getParseTree() |
void |
match(BitSet bitSet)
Make sure current lookahead symbol matches the given set
Throw an exception upon mismatch, which is catch by either the
error handler or by the syntactic predicate.
|
void |
match(int i)
Make sure current lookahead symbol matches token type t.
|
void |
matchNot(int i) |
void |
traceIn(java.lang.String s)
Create a rule node, add to current tree, and make it current root
|
void |
traceOut(java.lang.String s)
Pop current root; back to adding to old root
|
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
protected java.util.Stack currentParseTreeRoot
protected ParseTreeRule mostRecentParseTreeRoot
protected int numberOfDerivationSteps
public ParseTreeDebugParser(int k_)
public ParseTreeDebugParser(ParserSharedInputState state, int k_)
public ParseTreeDebugParser(TokenBuffer tokenBuf, int k_)
public ParseTreeDebugParser(TokenStream lexer, int k_)
public ParseTree getParseTree()
public int getNumberOfDerivationSteps()
public void match(int i) throws MismatchedTokenException, TokenStreamException
Parser
match
in class Parser
MismatchedTokenException
TokenStreamException
public void match(BitSet bitSet) throws MismatchedTokenException, TokenStreamException
Parser
match
in class Parser
MismatchedTokenException
TokenStreamException
public void matchNot(int i) throws MismatchedTokenException, TokenStreamException
matchNot
in class Parser
MismatchedTokenException
TokenStreamException
protected void addCurrentTokenToParseTree() throws TokenStreamException
TokenStreamException
public void traceIn(java.lang.String s) throws TokenStreamException
traceIn
in class LLkParser
TokenStreamException
public void traceOut(java.lang.String s) throws TokenStreamException
traceOut
in class LLkParser
TokenStreamException