- action
void action(InterfaceRuleContext _localctx, int ruleIndex, int actionIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
- getATN
ATN getATN()
Undocumented in source. Be warned that the author may not have intended to support it.
- getChannelNames
string[] getChannelNames()
Undocumented in source. Be warned that the author may not have intended to support it.
- getGrammarFileName
string getGrammarFileName()
Undocumented in source. Be warned that the author may not have intended to support it.
- getModeNames
string[] getModeNames()
Undocumented in source. Be warned that the author may not have intended to support it.
- getRuleNames
string[] getRuleNames()
Undocumented in source. Be warned that the author may not have intended to support it.
- getSerializedATN
wstring getSerializedATN()
Undocumented in source. Be warned that the author may not have intended to support it.
- getTokenNames
string[] getTokenNames()
Undocumented in source. Be warned that the author may not have intended to support it.
- getVocabulary
Vocabulary getVocabulary()
- ANYWHERE
int ANYWHERE;
- BANG
int BANG;
- ID
int ID;
- ROOT
int ROOT;
- RULE_REF
int RULE_REF;
- STRING
int STRING;
Undocumented in source. Be warned that the author may not have intended to support it.
- DEFAULT_MODE
int DEFAULT_MODE;
Undocumented in source.
- MORE
int MORE;
Undocumented in source.
- SKIP
int SKIP;
Undocumented in source.
- DEFAULT_TOKEN_CHANNEL
int DEFAULT_TOKEN_CHANNEL;
Undocumented in source.
- HIDDEN
int HIDDEN;
Undocumented in source.
- MIN_CHAR_VALUE
int MIN_CHAR_VALUE;
Undocumented in source.
- MAX_CHAR_VALUE
int MAX_CHAR_VALUE;
Undocumented in source.
- _input
CharStream _input;
Undocumented in source.
- _tokenFactorySourcePair
TokenFactorySourcePair _tokenFactorySourcePair;
Undocumented in source.
- tokenFactory_
TokenFactory!CommonToken tokenFactory_;
How to create token objects
@uml
@read
@write
@override
- _token
Token _token;
The goal of all lexer rules/methods is to create a token object.
This is an instance variable as multiple rules may collaborate to
create a single token. nextToken will return this object after
matching lexer rule(s). If you subclass to allow multiple token
emissions, then set this to the last token to be matched or
something nonnull so that the auto token emit mechanism will not
emit another token.
- _modeStack
IntegerStack _modeStack;
Undocumented in source.
- _tokenStartCharIndex
int _tokenStartCharIndex;
What character index in the stream did the current token start at?
Needed, for example, to get the text for current token. Set at
the start of nextToken.
- _tokenStartLine
int _tokenStartLine;
The line on which the first character of the token resides
- _tokenStartCharPositionInLine
int _tokenStartCharPositionInLine;
The character position of first character within the line
- _hitEOF
bool _hitEOF;
Undocumented in source.
- _channel
int _channel;
The channel number for the current token
- _type
int _type;
The token type for the current token
- _mode
int _mode;
Undocumented in source.
- _text
Variant _text;
You can set the text for the current token to override what is in
the input char buffer. Use setText() or can set this instance var.
- reset
void reset()
Undocumented in source. Be warned that the author may not have intended to support it.
- nextToken
Token nextToken()
Return a token from this source; i.e., match a token on the char
stream.
- skip
void skip()
Instruct the lexer to skip creating a token for current lexer rule
and look for another token. nextToken() knows to keep looking when
a lexer rule finishes with token set to SKIP_TOKEN. Recall that
if token==null at end of any token rule, it creates one for you
and emits it.
- more
void more()
Undocumented in source. Be warned that the author may not have intended to support it.
- mode
void mode(int m)
Undocumented in source. Be warned that the author may not have intended to support it.
- pushMode
void pushMode(int m)
Undocumented in source. Be warned that the author may not have intended to support it.
- popMode
int popMode()
Undocumented in source. Be warned that the author may not have intended to support it.
- setInputStream
void setInputStream(IntStream input)
Set the char stream and reset the lexer
@uml
@override
- getSourceName
string getSourceName()
Undocumented in source. Be warned that the author may not have intended to support it.
- getInputStream
CharStream getInputStream()
- emit
void emit(Token token)
By default does not support multiple emits per nextToken invocation
for efficiency reasons. Subclass and override this method, nextToken,
and getToken (to push tokens into a list and pull from that list
rather than a single variable as this implementation does).
- emit
Token emit()
The standard method called to automatically emit a token at the
outermost lexical rule. The token object should point into the
char buffer start..stop. If there is a text override in 'text',
use that to set the token's text. Override this method to emit
custom Token objects or provide a new factory.
- emitEOF
Token emitEOF()
Undocumented in source. Be warned that the author may not have intended to support it.
- getLine
int getLine()
Undocumented in source. Be warned that the author may not have intended to support it.
- getCharPositionInLine
int getCharPositionInLine()
Undocumented in source. Be warned that the author may not have intended to support it.
- setLine
void setLine(int line)
Undocumented in source. Be warned that the author may not have intended to support it.
- setCharPositionInLine
void setCharPositionInLine(int charPositionInLine)
Undocumented in source. Be warned that the author may not have intended to support it.
- getCharIndex
int getCharIndex()
What is the index of the current character of lookahead?
- getText
Variant getText()
Return the text matched so far for the current token or any
text override.
- setText
void setText(Variant text)
Set the complete text of this token; it wipes any previous
changes to the text.
- getToken
Token getToken()
Override if emitting multiple tokens.
- setToken
void setToken(Token token)
Undocumented in source. Be warned that the author may not have intended to support it.
- setType
void setType(int ttype)
Undocumented in source. Be warned that the author may not have intended to support it.
- getType
int getType()
Undocumented in source. Be warned that the author may not have intended to support it.
- setChannel
void setChannel(int channel)
Undocumented in source. Be warned that the author may not have intended to support it.
- getChannel
int getChannel()
Undocumented in source. Be warned that the author may not have intended to support it.
- getChannelNames
string[] getChannelNames()
Undocumented in source. Be warned that the author may not have intended to support it.
- getModeNames
string[] getModeNames()
Undocumented in source. Be warned that the author may not have intended to support it.
- 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
@uml
@override
- getAllTokens
Token[] getAllTokens()
Return a list of all Token objects in input char stream.
Forces load of all tokens. Does not include EOF token.
- recover
void recover(LexerNoViableAltException e)
Undocumented in source. Be warned that the author may not have intended to support it.
- notifyListeners
void notifyListeners(LexerNoViableAltException e)
Undocumented in source. Be warned that the author may not have intended to support it.
- getErrorDisplay
string getErrorDisplay(string s)
Undocumented in source. Be warned that the author may not have intended to support it.
- getErrorDisplay
string getErrorDisplay(int c)
Undocumented in source. Be warned that the author may not have intended to support it.
- getCharErrorDisplay
string getCharErrorDisplay(int c)
Undocumented in source. Be warned that the author may not have intended to support it.
- recover
void recover(RecognitionException re)
Lexers can normally match any char in it's vocabulary after matching
a token, so do the easy thing and just kill a character and hope
it all works out. You can instead use the rule invocation stack
to do sophisticated error recovery if you are in a fragment rule.
- action
void action(InterfaceRuleContext interfaceRuleContext, int ruleIndex, int actionIndex)
- tokenFactory
TokenFactory!CommonToken tokenFactory()
Undocumented in source. Be warned that the author may not have intended to support it.
- tokenFactory
void tokenFactory(TokenFactory!CommonToken tokenFactory)
Undocumented in source. Be warned that the author may not have intended to support it.