Package | Description |
---|---|
org.antlr.v4.gui | |
org.antlr.v4.runtime | |
org.antlr.v4.runtime.atn | |
org.antlr.v4.runtime.tree | |
org.antlr.v4.runtime.tree.pattern | |
org.antlr.v4.runtime.tree.xpath | |
org.antlr.v4.tool |
Modifier and Type | Method | Description |
---|---|---|
static Future<JFrame> |
Trees.inspect(Tree t,
Parser parser) |
Call this method to view a parse tree in a dialog box visually.
|
protected void |
TestRig.process(Lexer lexer,
Class<? extends Parser> parserClass,
Parser parser,
InputStream is,
Reader r) |
|
static void |
Trees.save(Tree t,
Parser parser,
String fileName) |
Save this tree in a postscript file
|
static void |
Trees.save(Tree t,
Parser parser,
String fileName,
String fontName,
int fontSize) |
Save this tree in a postscript file using a particular font name and size
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
TestRig.process(Lexer lexer,
Class<? extends Parser> parserClass,
Parser parser,
InputStream is,
Reader r) |
Modifier and Type | Class | Description |
---|---|---|
class |
ParserInterpreter |
A parser simulator that mimics what ANTLR's generated
parser code does.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
DefaultErrorStrategy.beginErrorCondition(Parser recognizer) |
This method is called to enter error recovery mode when a recognition
exception is reported.
|
protected void |
DefaultErrorStrategy.consumeUntil(Parser recognizer,
IntervalSet set) |
Consume tokens until one matches the given token set.
|
protected void |
DefaultErrorStrategy.endErrorCondition(Parser recognizer) |
This method is called to leave error recovery mode after recovering from
a recognition exception.
|
protected String |
DiagnosticErrorListener.getDecisionDescription(Parser recognizer,
DFA dfa) |
|
protected IntervalSet |
DefaultErrorStrategy.getErrorRecoverySet(Parser recognizer) |
|
protected IntervalSet |
DefaultErrorStrategy.getExpectedTokens(Parser recognizer) |
|
protected Token |
DefaultErrorStrategy.getMissingSymbol(Parser recognizer) |
Conjure up a missing token during error recovery.
|
boolean |
ANTLRErrorStrategy.inErrorRecoveryMode(Parser recognizer) |
Tests whether or not
recognizer is in the process of recovering
from an error. |
boolean |
DefaultErrorStrategy.inErrorRecoveryMode(Parser recognizer) |
Tests whether or not
recognizer is in the process of recovering
from an error. |
void |
ANTLRErrorStrategy.recover(Parser recognizer,
RecognitionException e) |
This method is called to recover from exception
e . |
void |
BailErrorStrategy.recover(Parser recognizer,
RecognitionException e) |
Instead of recovering from exception
e , re-throw it wrapped
in a ParseCancellationException so it is not caught by the
rule function catches. |
void |
DefaultErrorStrategy.recover(Parser recognizer,
RecognitionException e) |
This method is called to recover from exception
e . |
Token |
ANTLRErrorStrategy.recoverInline(Parser recognizer) |
This method is called when an unexpected symbol is encountered during an
inline match operation, such as
match(int) . |
Token |
BailErrorStrategy.recoverInline(Parser recognizer) |
Make sure we don't attempt to recover inline; if the parser
successfully recovers, it won't throw an exception.
|
Token |
DefaultErrorStrategy.recoverInline(Parser recognizer) |
This method is called when an unexpected symbol is encountered during an
inline match operation, such as
match(int) . |
void |
ANTLRErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) |
This method is called by the parser when a full-context prediction
results in an ambiguity.
|
void |
BaseErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) |
|
void |
DiagnosticErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) |
|
void |
ProxyErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) |
|
void |
ANTLRErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
This method is called when an SLL conflict occurs and the parser is about
to use the full context information to make an LL decision.
|
void |
BaseErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
|
void |
DiagnosticErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
|
void |
ProxyErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
|
void |
ANTLRErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
This method is called by the parser when a full-context prediction has a
unique result.
|
void |
BaseErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
|
void |
DiagnosticErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
|
void |
ProxyErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
|
void |
ANTLRErrorStrategy.reportError(Parser recognizer,
RecognitionException e) |
Report any kind of
RecognitionException . |
void |
DefaultErrorStrategy.reportError(Parser recognizer,
RecognitionException e) |
Report any kind of
RecognitionException . |
protected void |
DefaultErrorStrategy.reportFailedPredicate(Parser recognizer,
FailedPredicateException e) |
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is a
FailedPredicateException . |
protected void |
DefaultErrorStrategy.reportInputMismatch(Parser recognizer,
InputMismatchException e) |
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is an
InputMismatchException . |
void |
ANTLRErrorStrategy.reportMatch(Parser recognizer) |
This method is called by when the parser successfully matches an input
symbol.
|
void |
DefaultErrorStrategy.reportMatch(Parser recognizer) |
This method is called by when the parser successfully matches an input
symbol.
|
protected void |
DefaultErrorStrategy.reportMissingToken(Parser recognizer) |
This method is called to report a syntax error which requires the
insertion of a missing token into the input stream.
|
protected void |
DefaultErrorStrategy.reportNoViableAlternative(Parser recognizer,
NoViableAltException e) |
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is a
NoViableAltException . |
protected void |
DefaultErrorStrategy.reportUnwantedToken(Parser recognizer) |
This method is called to report a syntax error which requires the removal
of a token from the input stream.
|
void |
ANTLRErrorStrategy.reset(Parser recognizer) |
Reset the error handler state for the specified
recognizer . |
void |
DefaultErrorStrategy.reset(Parser recognizer) |
Reset the error handler state for the specified
recognizer . |
protected Token |
DefaultErrorStrategy.singleTokenDeletion(Parser recognizer) |
This method implements the single-token deletion inline error recovery
strategy.
|
protected boolean |
DefaultErrorStrategy.singleTokenInsertion(Parser recognizer) |
This method implements the single-token insertion inline error recovery
strategy.
|
void |
ANTLRErrorStrategy.sync(Parser recognizer) |
This method provides the error handler with an opportunity to handle
syntactic or semantic errors in the input stream before they result in a
RecognitionException . |
void |
BailErrorStrategy.sync(Parser recognizer) |
Make sure we don't attempt to recover from problems in subrules.
|
void |
DefaultErrorStrategy.sync(Parser recognizer) |
The default implementation of
ANTLRErrorStrategy.sync(org.antlr.v4.runtime.Parser) makes sure
that the current lookahead symbol is consistent with what were expecting
at this point in the ATN. |
String |
ParserRuleContext.toInfoString(Parser recognizer) |
Used for rule context info debugging during parse-time, not so much for ATN debugging
|
String |
RuleContext.toStringTree(Parser recog) |
Print out a whole tree, not just a node, in LISP format
(root child1 ..
|
Constructor | Description |
---|---|
FailedPredicateException(Parser recognizer) |
|
FailedPredicateException(Parser recognizer,
String predicate) |
|
FailedPredicateException(Parser recognizer,
String predicate,
String message) |
|
InputMismatchException(Parser recognizer) |
|
NoViableAltException(Parser recognizer) |
|
NoViableAltException(Parser recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
Modifier and Type | Field | Description |
---|---|---|
protected Parser |
ParserATNSimulator.parser |
Modifier and Type | Method | Description |
---|---|---|
Parser |
ParserATNSimulator.getParser() |
Constructor | Description |
---|---|
ParserATNSimulator(Parser parser,
ATN atn,
DFA[] decisionToDFA,
PredictionContextCache sharedContextCache) |
|
ProfilingATNSimulator(Parser parser) |
Modifier and Type | Method | Description |
---|---|---|
static String |
Trees.getNodeText(Tree t,
Parser recog) |
|
String |
ParseTree.toStringTree(Parser parser) |
Specialize toStringTree so that it can print out more information
based upon the parser.
|
String |
TerminalNodeImpl.toStringTree(Parser parser) |
|
static String |
Trees.toStringTree(Tree t,
Parser recog) |
Print out a whole tree in LISP form.
|
Modifier and Type | Method | Description |
---|---|---|
Parser |
ParseTreePatternMatcher.getParser() |
Used to collect to the grammar file name, token names, rule names for
used to parse the pattern into a parse tree.
|
Constructor | Description |
---|---|
ParseTreePatternMatcher(Lexer lexer,
Parser parser) |
Modifier and Type | Field | Description |
---|---|---|
protected Parser |
XPath.parser |
Modifier and Type | Method | Description |
---|---|---|
static Collection<ParseTree> |
XPath.findAll(ParseTree tree,
String xpath,
Parser parser) |
Constructor | Description |
---|---|
XPath(Parser parser,
String path) |
Modifier and Type | Class | Description |
---|---|---|
class |
GrammarParserInterpreter |
A heavier weight
ParserInterpreter that creates parse trees
that track alternative numbers for subtree roots. |
Modifier and Type | Method | Description |
---|---|---|
static ParserInterpreter |
GrammarParserInterpreter.deriveTempParserInterpreter(Grammar g,
Parser originalParser,
TokenStream tokens) |
Derive a new parser from an old one that has knowledge of the grammar.
|
static List<ParserRuleContext> |
GrammarParserInterpreter.getAllPossibleParseTrees(Grammar g,
Parser originalParser,
TokenStream tokens,
int decision,
BitSet alts,
int startIndex,
int stopIndex,
int startRuleIndex) |
Given an ambiguous parse information, return the list of ambiguous parse trees.
|
void |
GrammarParserInterpreter.BailButConsumeErrorStrategy.recover(Parser recognizer,
RecognitionException e) |
|
Token |
GrammarParserInterpreter.BailButConsumeErrorStrategy.recoverInline(Parser recognizer) |
|
void |
GrammarParserInterpreter.BailButConsumeErrorStrategy.sync(Parser recognizer) |
Copyright © 1992–2018 ANTLR. All rights reserved.