Recognizer

Base for Lexer and Parser

Constructors

this
this()
Undocumented in source.

Members

Functions

action
void action(InterfaceRuleContext localctx, int ruleIndex, int actionIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
addErrorListener
void addErrorListener(ANTLRErrorListener!(U, V) listener)
Undocumented in source. Be warned that the author may not have intended to support it.
getATN
ATN getATN()

Get the {@link ATN} used by the recognizer for prediction.

getErrorHeader
string getErrorHeader(RecognitionException e)

What is the error header, normally line/character position information?

getErrorListenerDispatch
ANTLRErrorListener!(U, V) getErrorListenerDispatch()
Undocumented in source. Be warned that the author may not have intended to support it.
getErrorListeners
ANTLRErrorListener!(U, V)[] getErrorListeners()
Undocumented in source. Be warned that the author may not have intended to support it.
getGrammarFileName
string getGrammarFileName()

For debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.

getInputStream
IntStream getInputStream()
Undocumented in source.
getInterpreter
V getInterpreter()

Get the ATN interpreter used by the recognizer for prediction.

getParseInfo
ParseInfo getParseInfo()

If profiling during the parse/lex, this will return DecisionInfo records for each decision in recognizer in a ParseInfo object.

getRuleIndexMap
int[string] getRuleIndexMap()

Get a map from rule names to rule indexes.

getRuleNames
string[] getRuleNames()
Undocumented in source.
getSerializedATN
wstring getSerializedATN()

If this recognizer was generated, it will have a serialized ATN representation of the grammar.

getState
int getState()

@uml @final

getTokenErrorDisplay
string getTokenErrorDisplay(Token t)

How should a token be displayed in an error message? The default is to display just the text, but during development you might want to have a lot of information spit out. Override in that case to use t.toString() (which, for CommonToken, dumps everything about the token). This is better than forcing you to override a method in your token objects because you don't have to go modify your lexer so that it creates a new Java type.

getTokenNames
string[] getTokenNames()

Used to print out token names like ID during debugging and error reporting. The generated parsers implement a method that overrides this to point to their String[] tokenNames.

getTokenType
int getTokenType(string tokenName)
Undocumented in source. Be warned that the author may not have intended to support it.
getTokenTypeMap
int[string] getTokenTypeMap()

Get a map from token names to token types. <p>Used for XPath and tree pattern compilation.</p>

getVocabulary
Vocabulary getVocabulary()

Get the vocabulary used by the recognizer.

precpred
bool precpred(InterfaceRuleContext localctx, int precedence)
Undocumented in source. Be warned that the author may not have intended to support it.
removeErrorListener
void removeErrorListener(ANTLRErrorListener!(U, V) listener)
Undocumented in source. Be warned that the author may not have intended to support it.
removeErrorListeners
void removeErrorListeners()
Undocumented in source. Be warned that the author may not have intended to support it.
sempred
bool sempred(InterfaceRuleContext localctx, int ruleIndex, int actionIndex)

subclass needs to override these if there are sempreds or actions that the ATN interp needs to execute

setInputStream
void setInputStream(IntStream input)
Undocumented in source.
setInterpreter
void setInterpreter(V interpreter)
Undocumented in source. Be warned that the author may not have intended to support it.
setState
void setState(int atnState)

Indicate that the recognizer has changed internal state that is consistent with the ATN state passed in. This way we always know where we are in the ATN as the parser goes along. The rule context objects form a stack that lets us see the stack of invoking rules. Combine this and we have complete ATN configuration information. @uml @final

tokenFactory
TokenFactory!CommonToken tokenFactory()
Undocumented in source.
tokenFactory
void tokenFactory(TokenFactory!CommonToken input)
Undocumented in source.

Static variables

EOF
int EOF;
Undocumented in source.

Variables

_interp
V _interp;
Undocumented in source.
_listeners
ANTLRErrorListener!(U, V)[] _listeners;
Undocumented in source.
ruleIndexMapCache
int[string][string] ruleIndexMapCache;
Undocumented in source.
tokenTypeMapCache
int[string][Vocabulary] tokenTypeMapCache;
Undocumented in source.

Inherited Members

From InterfaceRecognizer

getVocabulary
Vocabulary getVocabulary()
Undocumented in source.
getRuleNames
string[] getRuleNames()
Undocumented in source.
getGrammarFileName
string getGrammarFileName()
Undocumented in source.
getATN
ATN getATN()
Undocumented in source.
getState
int getState()
Undocumented in source.
getInputStream
IntStream getInputStream()
Undocumented in source.
sempred
bool sempred(InterfaceRuleContext _localctx, int ruleIndex, int actionIndex)
Undocumented in source.
precpred
bool precpred(InterfaceRuleContext _localctx, int precedence)
Undocumented in source.

Meta