Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)
|
ParseTreeDebugParser
antlr.debug
Class ParseTreeDebugParser
java.lang.Object
antlr.Parser
antlr.LLkParser
antlr.debug.ParseTreeDebugParser
- public class ParseTreeDebugParser
- extends LLkParser
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);
|
Method Summary |
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 |
| Methods inherited from class antlr.Parser |
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, panic, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParseTreeDebugParser
public ParseTreeDebugParser(int k_)
ParseTreeDebugParser
public ParseTreeDebugParser(ParserSharedInputState state,
int k_)
ParseTreeDebugParser
public ParseTreeDebugParser(TokenBuffer tokenBuf,
int k_)
ParseTreeDebugParser
public ParseTreeDebugParser(TokenStream lexer,
int k_)
getParseTree
public ParseTree getParseTree()
getNumberOfDerivationSteps
public int getNumberOfDerivationSteps()
match
public void match(int i)
throws MismatchedTokenException,
TokenStreamException
- Description copied from class:
Parser
- Make sure current lookahead symbol matches token type t.
Throw an exception upon mismatch, which is catch by either the
error handler or by the syntactic predicate.
- Overrides:
match in class Parser
- Throws:
MismatchedTokenException
TokenStreamException
match
public void match(BitSet bitSet)
throws MismatchedTokenException,
TokenStreamException
- Description copied from class:
Parser
- 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.
- Overrides:
match in class Parser
- Throws:
MismatchedTokenException
TokenStreamException
matchNot
public void matchNot(int i)
throws MismatchedTokenException,
TokenStreamException
- Overrides:
matchNot in class Parser
- Throws:
MismatchedTokenException
TokenStreamException
traceIn
public void traceIn(java.lang.String s)
throws TokenStreamException
- Create a rule node, add to current tree, and make it current root
- Overrides:
traceIn in class LLkParser
- Throws:
TokenStreamException
traceOut
public void traceOut(java.lang.String s)
throws TokenStreamException
- Pop current root; back to adding to old root
- Overrides:
traceOut in class LLkParser
- Throws:
TokenStreamException
|