public class ParseTreeDebugParser extends LLkParser
| Modifier and Type | Field and Description |
|---|---|
protected 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(String s)
Create a rule node, add to current tree, and make it current root
|
void |
traceOut(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, traceIndentprotected 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
Parsermatch in class ParserMismatchedTokenExceptionTokenStreamExceptionpublic void match(BitSet bitSet) throws MismatchedTokenException, TokenStreamException
Parsermatch in class ParserMismatchedTokenExceptionTokenStreamExceptionpublic void matchNot(int i)
throws MismatchedTokenException,
TokenStreamException
matchNot in class ParserMismatchedTokenExceptionTokenStreamExceptionprotected void addCurrentTokenToParseTree()
throws TokenStreamException
TokenStreamExceptionpublic void traceIn(String s) throws TokenStreamException
traceIn in class LLkParserTokenStreamExceptionpublic void traceOut(String s) throws TokenStreamException
traceOut in class LLkParserTokenStreamExceptionCopyright © 2017–2019 Eclipse Foundation. All rights reserved.