ExpressionAntlrLexer class
- Extends
-
Lexer
Constructors
Expression |
Properties
Inherited Properties
atn | Get the serializedATN used by the recognizer for prediction. |
channel | |
char |
What is the index of the current character of lookahead? |
char |
|
DEFAULT_MODE | |
DEFAULT_TOKEN_CHANNEL | |
EOF | |
HIDDEN | |
input |
Set the char stream and reset the lexer |
interpreter | Set the ATN interpreter used by the recognizer for prediction. |
line | |
MAX_CHAR_VALUE | |
MIN_CHAR_VALUE | |
MORE | |
parse |
If profiling during the parse/lex, this will return DecisionInfo records for each decision in recognizer in a ParseInfo object. |
SKIP | |
source |
|
state | 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. |
text | Set the complete text of this token; it wipes any previous changes to the text. |
token | Override if emitting multiple tokens. |
token |
|
type |
Methods
action(Rule |
|
sempred(Rule |
Inherited Methods
add |
|
emit() | 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) | 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() | |
get |
Return a list of all Token objects in input char stream. Forces load of all tokens. Does not include EOF token. |
get |
|
get |
|
get |
What is the error header, normally line/character position information? |
get |
|
get |
|
get |
Get a map from rule names to rule indexes. Used for XPath and tree pattern compilation. |
get |
|
get |
Get a map from token names to token types. Used for XPath and tree pattern compilation. |
mode(number) | |
more() | |
next |
Return a token from this source; i.e., match a token on the char stream. |
notify |
|
pop |
|
precpred(Rule |
|
push |
|
recover(Lexer |
|
recover(Recognition |
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. |
remove |
|
remove |
|
reset() | |
reset(boolean) | |
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==undefined at end of any token rule, it creates one for you and emits it. |
Constructor Details
ExpressionAntlrLexer(CharStream)
new ExpressionAntlrLexer(input: CharStream)
Parameters
- input
-
CharStream
Property Details
ARROW
public static ARROW: 27 = 27
Property Value
27
ASTERISK
public static ASTERISK: 6 = 6
Property Value
6
channelNames
public static channelNames: string[] = [
"DEFAULT_TOKEN_CHANNEL", "HIDDEN",
]
Property Value
string[]
channelNames
string[] channelNames
Property Value
string[]
CLOSE_BRACKET
public static CLOSE_BRACKET: 19 = 19
Property Value
19
CLOSE_CURLY_BRACKET
public static CLOSE_CURLY_BRACKET: 24 = 24
Property Value
24
CLOSE_SQUARE_BRACKET
public static CLOSE_SQUARE_BRACKET: 22 = 22
Property Value
22
COLON
public static COLON: 26 = 26
Property Value
26
COMMA
public static COMMA: 25 = 25
Property Value
25
DOT
public static DOT: 20 = 20
Property Value
20
DOUBLE_AND
public static DOUBLE_AND: 12 = 12
Property Value
12
DOUBLE_EQUAL
public static DOUBLE_EQUAL: 9 = 9
Property Value
9
DOUBLE_VERTICAL_CYLINDER
public static DOUBLE_VERTICAL_CYLINDER: 13 = 13
Property Value
13
ESCAPE_CHARACTER
public static ESCAPE_CHARACTER: 37 = 37
Property Value
37
grammarFileName
string grammarFileName
Property Value
string
IDENTIFIER
public static IDENTIFIER: 32 = 32
Property Value
32
ignoreWS
ignoreWS: boolean = true
Property Value
boolean
INVALID_TOKEN_DEFAULT_MODE
public static INVALID_TOKEN_DEFAULT_MODE: 35 = 35
Property Value
35
LESS_OR_EQUAl
public static LESS_OR_EQUAl: 16 = 16
Property Value
16
LESS_THAN
public static LESS_THAN: 14 = 14
Property Value
14
modeNames
public static modeNames: string[] = [
"DEFAULT_MODE", "STRING_INTERPOLATION_MODE",
]
Property Value
string[]
modeNames
string[] modeNames
Property Value
string[]
MORE_OR_EQUAL
public static MORE_OR_EQUAL: 17 = 17
Property Value
17
MORE_THAN
public static MORE_THAN: 15 = 15
Property Value
15
NEWLINE
public static NEWLINE: 33 = 33
Property Value
33
NON
public static NON: 4 = 4
Property Value
4
NOT_EQUAL
public static NOT_EQUAL: 10 = 10
Property Value
10
NULL_COALESCE
public static NULL_COALESCE: 28 = 28
Property Value
28
NUMBER
public static NUMBER: 30 = 30
Property Value
30
OPEN_BRACKET
public static OPEN_BRACKET: 18 = 18
Property Value
18
OPEN_CURLY_BRACKET
public static OPEN_CURLY_BRACKET: 23 = 23
Property Value
23
OPEN_SQUARE_BRACKET
public static OPEN_SQUARE_BRACKET: 21 = 21
Property Value
21
PERCENT
public static PERCENT: 8 = 8
Property Value
8
PLUS
public static PLUS: 2 = 2
Property Value
2
QUESTION_MARK
public static QUESTION_MARK: 29 = 29
Property Value
29
ruleNames
public static ruleNames: string[] = [
"LETTER", "DIGIT", "OBJECT_DEFINITION", "STRING_INTERPOLATION_START",
"PLUS", "SUBSTRACT", "NON", "XOR", "ASTERISK", "SLASH", "PERCENT", "DOUBLE_EQUAL",
"NOT_EQUAL", "SINGLE_AND", "DOUBLE_AND", "DOUBLE_VERTICAL_CYLINDER", "LESS_THAN",
"MORE_THAN", "LESS_OR_EQUAl", "MORE_OR_EQUAL", "OPEN_BRACKET", "CLOSE_BRACKET",
"DOT", "OPEN_SQUARE_BRACKET", "CLOSE_SQUARE_BRACKET", "OPEN_CURLY_BRACKET",
"CLOSE_CURLY_BRACKET", "COMMA", "COLON", "ARROW", "NULL_COALESCE", "QUESTION_MARK",
"NUMBER", "WHITESPACE", "IDENTIFIER", "NEWLINE", "STRING", "INVALID_TOKEN_DEFAULT_MODE",
"STRING_INTERPOLATION_END", "TEMPLATE", "ESCAPE_CHARACTER", "TEXT_CONTENT",
]
Property Value
string[]
ruleNames
string[] ruleNames
Property Value
string[]
serializedATN
string serializedATN
Property Value
string
SINGLE_AND
public static SINGLE_AND: 11 = 11
Property Value
11
SLASH
public static SLASH: 7 = 7
Property Value
7
STRING
public static STRING: 34 = 34
Property Value
34
STRING_INTERPOLATION_MODE
public static STRING_INTERPOLATION_MODE: 1 = 1
Property Value
1
STRING_INTERPOLATION_START
public static STRING_INTERPOLATION_START: 1 = 1
Property Value
1
SUBSTRACT
public static SUBSTRACT: 3 = 3
Property Value
3
TEMPLATE
public static TEMPLATE: 36 = 36
Property Value
36
TEXT_CONTENT
public static TEXT_CONTENT: 38 = 38
Property Value
38
VOCABULARY
public static VOCABULARY: Vocabulary = new VocabularyImpl(ExpressionAntlrLexer._LITERAL_NAMES, ExpressionAntlrLexer._SYMBOLIC_NAMES, [])
Property Value
Vocabulary
vocabulary
Vocabulary vocabulary
Property Value
Vocabulary
WHITESPACE
public static WHITESPACE: 31 = 31
Property Value
31
XOR
public static XOR: 5 = 5
Property Value
5
Inherited Property Details
atn
Get the serializedATN used by the recognizer for prediction.
atn: ATN
Property Value
ATN
Inherited From Recognizer.atn
channel
channel: number
Property Value
number
Inherited From Lexer.channel
charIndex
What is the index of the current character of lookahead?
charIndex: number
Property Value
number
Inherited From Lexer.charIndex
charPositionInLine
charPositionInLine: number
Property Value
number
Inherited From Lexer.charPositionInLine
DEFAULT_MODE
static DEFAULT_MODE: number
Property Value
number
Inherited From Lexer.DEFAULT_MODE
DEFAULT_TOKEN_CHANNEL
static DEFAULT_TOKEN_CHANNEL: number
Property Value
number
Inherited From Lexer.DEFAULT_TOKEN_CHANNEL
EOF
static EOF: number
Property Value
number
Inherited From Recognizer.EOF
HIDDEN
static HIDDEN: number
Property Value
number
Inherited From Lexer.HIDDEN
inputStream
Set the char stream and reset the lexer
inputStream: CharStream
Property Value
CharStream
Inherited From Lexer.inputStream
interpreter
Set the ATN interpreter used by the recognizer for prediction.
interpreter: LexerATNSimulator
Property Value
LexerATNSimulator
Inherited From Recognizer.interpreter
line
line: number
Property Value
number
Inherited From Lexer.line
MAX_CHAR_VALUE
static MAX_CHAR_VALUE: number
Property Value
number
Inherited From Lexer.MAX_CHAR_VALUE
MIN_CHAR_VALUE
static MIN_CHAR_VALUE: number
Property Value
number
Inherited From Lexer.MIN_CHAR_VALUE
MORE
static MORE: number
Property Value
number
Inherited From Lexer.MORE
parseInfo
If profiling during the parse/lex, this will return DecisionInfo records for each decision in recognizer in a ParseInfo object.
parseInfo: Promise<ParseInfo | undefined>
Property Value
Promise<ParseInfo | undefined>
Inherited From Recognizer.parseInfo
SKIP
static SKIP: number
Property Value
number
Inherited From Lexer.SKIP
sourceName
sourceName: string
Property Value
string
Inherited From Lexer.sourceName
state
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.
state: number
Property Value
number
Inherited From Recognizer.state
text
Set the complete text of this token; it wipes any previous changes to the text.
text: string
Property Value
string
Inherited From Lexer.text
token
Override if emitting multiple tokens.
token: Token | undefined
Property Value
Token | undefined
Inherited From Lexer.token
tokenFactory
tokenFactory: TokenFactory
Property Value
TokenFactory
Inherited From Lexer.tokenFactory
type
type: number
Property Value
number
Inherited From Lexer.type
Method Details
action(RuleContext, number, number)
function action(_localctx: RuleContext, ruleIndex: number, actionIndex: number)
Parameters
- _localctx
-
RuleContext
- ruleIndex
-
number
- actionIndex
-
number
sempred(RuleContext, number, number)
function sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean
Parameters
- _localctx
-
RuleContext
- ruleIndex
-
number
- predIndex
-
number
Returns
boolean
Inherited Method Details
addErrorListener(ANTLRErrorListener<number>)
function addErrorListener(listener: ANTLRErrorListener<number>)
Parameters
- listener
-
ANTLRErrorListener<number>
Inherited From Recognizer.addErrorListener
emit()
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).
function emit(): Token
Returns
Token
Inherited From Lexer.emit
emit(Token)
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.
function emit(token: Token): Token
Parameters
- token
-
Token
Returns
Token
Inherited From Lexer.emit
emitEOF()
function emitEOF(): Token
Returns
Token
Inherited From Lexer.emitEOF
getAllTokens()
Return a list of all Token objects in input char stream. Forces load of all tokens. Does not include EOF token.
function getAllTokens(): Token[]
Returns
Token[]
Inherited From Lexer.getAllTokens
getCharErrorDisplay(number)
function getCharErrorDisplay(c: number): string
Parameters
- c
-
number
Returns
string
Inherited From Lexer.getCharErrorDisplay
getErrorDisplay(string | number)
function getErrorDisplay(s: string | number): string
Parameters
- s
-
string | number
Returns
string
Inherited From Lexer.getErrorDisplay
getErrorHeader(RecognitionException)
What is the error header, normally line/character position information?
function getErrorHeader(e: RecognitionException): string
Parameters
- e
-
RecognitionException
Returns
string
Inherited From Recognizer.getErrorHeader
getErrorListenerDispatch()
function getErrorListenerDispatch(): ANTLRErrorListener<number>
Returns
ANTLRErrorListener<number>
Inherited From Recognizer.getErrorListenerDispatch
getErrorListeners()
function getErrorListeners(): Array<ANTLRErrorListener<number>>
Returns
Array<ANTLRErrorListener<number>>
Inherited From Recognizer.getErrorListeners
getRuleIndexMap()
Get a map from rule names to rule indexes. Used for XPath and tree pattern compilation.
function getRuleIndexMap(): ReadonlyMap<string, number>
Returns
ReadonlyMap<string, number>
Inherited From Recognizer.getRuleIndexMap
getTokenType(string)
function getTokenType(tokenName: string): number
Parameters
- tokenName
-
string
Returns
number
Inherited From Recognizer.getTokenType
getTokenTypeMap()
Get a map from token names to token types. Used for XPath and tree pattern compilation.
function getTokenTypeMap(): ReadonlyMap<string, number>
Returns
ReadonlyMap<string, number>
Inherited From Recognizer.getTokenTypeMap
mode(number)
function mode(m: number)
Parameters
- m
-
number
Inherited From Lexer.mode
more()
function more()
Inherited From Lexer.more
nextToken()
Return a token from this source; i.e., match a token on the char stream.
function nextToken(): Token
Returns
Token
Inherited From Lexer.nextToken
notifyListeners(LexerNoViableAltException)
function notifyListeners(e: LexerNoViableAltException)
Parameters
- e
-
LexerNoViableAltException
Inherited From Lexer.notifyListeners
popMode()
function popMode(): number
Returns
number
Inherited From Lexer.popMode
precpred(RuleContext | undefined, number)
function precpred(localctx: RuleContext | undefined, precedence: number): boolean
Parameters
- localctx
-
RuleContext | undefined
- precedence
-
number
Returns
boolean
Inherited From Recognizer.precpred
pushMode(number)
function pushMode(m: number)
Parameters
- m
-
number
Inherited From Lexer.pushMode
recover(LexerNoViableAltException)
function recover(re: LexerNoViableAltException)
Parameters
- re
-
LexerNoViableAltException
Inherited From Lexer.recover
recover(RecognitionException)
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.
function recover(re: RecognitionException)
Parameters
- re
-
RecognitionException
Inherited From Lexer.recover
removeErrorListener(ANTLRErrorListener<number>)
function removeErrorListener(listener: ANTLRErrorListener<number>)
Parameters
- listener
-
ANTLRErrorListener<number>
Inherited From Recognizer.removeErrorListener
removeErrorListeners()
function removeErrorListeners()
Inherited From Recognizer.removeErrorListeners
reset()
function reset()
Inherited From Lexer.reset
reset(boolean)
function reset(resetInput: boolean)
Parameters
- resetInput
-
boolean
Inherited From Lexer.reset
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==undefined at end of any token rule, it creates one for you and emits it.
function skip()
Inherited From Lexer.skip