CommonRegexLexer class

Extends

Lexer

Constructors

CommonRegexLexer(CharStream)

Properties

ALC
Ampersand
AUC
Backslash
BellChar
BLC
BlockQuoted
BUC
Caret
CarriageReturn
channelNames
channelNames
CharacterClassEnd
CharacterClassStart
CharWithoutProperty
CharWithProperty
CLC
CloseBrace
CloseParen
Colon
Comma
ControlChar
CUC
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DecimalDigit
DLC
Dot
DUC
ELC
EndOfSubject
Equals
EscapeChar
EUC
Exclamation
FLC
FormFeed
FUC
GLC
grammarFileName
GreaterThan
GUC
Hash
HexChar
HLC
HUC
Hyphen
ILC
IUC
JLC
JUC
KLC
KUC
LessThan
LLC
LUC
MLC
modeNames
modeNames
MUC
NewLine
NLC
NotDecimalDigit
NotWhiteSpace
NotWordChar
NUC
OLC
OpenBrace
OpenParen
OtherChar
OUC
Pipe
PLC
Plus
PUC
QLC
QUC
QuestionMark
Quoted
RLC
RUC
ruleNames
ruleNames
serializedATN
SingleQuote
SLC
Star
SUC
Tab
TLC
TUC
ULC
Underscore
UUC
VLC
VOCABULARY
vocabulary
VUC
WhiteSpace
WLC
WordChar
WUC
XLC
XUC
YLC
YUC
ZLC
ZUC

Inherited Properties

atn

Get the serializedATN used by the recognizer for prediction.

channel
charIndex

What is the index of the current character of lookahead?

charPositionInLine
DEFAULT_MODE
DEFAULT_TOKEN_CHANNEL
EOF
HIDDEN
inputStream

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
parseInfo

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

SKIP
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.

text

Set the complete text of this token; it wipes any previous changes to the text.

token

Override if emitting multiple tokens.

tokenFactory
type

Inherited Methods

action(RuleContext | undefined, number, number)
addErrorListener(ANTLRErrorListener<number>)
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()
getAllTokens()

Return a list of all Token objects in input char stream. Forces load of all tokens. Does not include EOF token.

getCharErrorDisplay(number)
getErrorDisplay(string | number)
getErrorHeader(RecognitionException)

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

getErrorListenerDispatch()
getErrorListeners()
getRuleIndexMap()

Get a map from rule names to rule indexes. Used for XPath and tree pattern compilation.

getTokenType(string)
getTokenTypeMap()

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

mode(number)
more()
nextToken()

Return a token from this source; i.e., match a token on the char stream.

notifyListeners(LexerNoViableAltException)
popMode()
precpred(RuleContext | undefined, number)
pushMode(number)
recover(LexerNoViableAltException)
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.

removeErrorListener(ANTLRErrorListener<number>)
removeErrorListeners()
reset()
reset(boolean)
sempred(RuleContext | undefined, number, number)
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

CommonRegexLexer(CharStream)

new CommonRegexLexer(input: CharStream)

Parameters

input

CharStream

Property Details

ALC

public static ALC: 44 = 44

Property Value

44

Ampersand

public static Ampersand: 43 = 43

Property Value

43

AUC

public static AUC: 70 = 70

Property Value

70

Backslash

public static Backslash: 10 = 10

Property Value

10

BellChar

public static BellChar: 3 = 3

Property Value

3

BLC

public static BLC: 45 = 45

Property Value

45

BlockQuoted

public static BlockQuoted: 2 = 2

Property Value

2

BUC

public static BUC: 71 = 71

Property Value

71

Caret

public static Caret: 23 = 23

Property Value

23

CarriageReturn

public static CarriageReturn: 8 = 8

Property Value

8

channelNames

public static channelNames: string[] = [
		"DEFAULT_TOKEN_CHANNEL", "HIDDEN",
	]

Property Value

string[]

channelNames

string[] channelNames

Property Value

string[]

CharacterClassEnd

public static CharacterClassEnd: 22 = 22

Property Value

22

CharacterClassStart

public static CharacterClassStart: 21 = 21

Property Value

21

CharWithoutProperty

public static CharWithoutProperty: 16 = 16

Property Value

16

CharWithProperty

public static CharWithProperty: 15 = 15

Property Value

15

CLC

public static CLC: 46 = 46

Property Value

46

CloseBrace

public static CloseBrace: 29 = 29

Property Value

29

CloseParen

public static CloseParen: 34 = 34

Property Value

34

Colon

public static Colon: 39 = 39

Property Value

39

Comma

public static Comma: 30 = 30

Property Value

30

ControlChar

public static ControlChar: 4 = 4

Property Value

4

CUC

public static CUC: 72 = 72

Property Value

72

D0

public static D0: 105 = 105

Property Value

105

D1

public static D1: 96 = 96

Property Value

96

D2

public static D2: 97 = 97

Property Value

97

D3

public static D3: 98 = 98

Property Value

98

D4

public static D4: 99 = 99

Property Value

99

D5

public static D5: 100 = 100

Property Value

100

D6

public static D6: 101 = 101

Property Value

101

D7

public static D7: 102 = 102

Property Value

102

D8

public static D8: 103 = 103

Property Value

103

D9

public static D9: 104 = 104

Property Value

104

DecimalDigit

public static DecimalDigit: 13 = 13

Property Value

13

DLC

public static DLC: 47 = 47

Property Value

47

Dot

public static Dot: 12 = 12

Property Value

12

DUC

public static DUC: 73 = 73

Property Value

73

ELC

public static ELC: 48 = 48

Property Value

48

EndOfSubject

public static EndOfSubject: 31 = 31

Property Value

31

Equals

public static Equals: 41 = 41

Property Value

41

EscapeChar

public static EscapeChar: 5 = 5

Property Value

5

EUC

public static EUC: 74 = 74

Property Value

74

Exclamation

public static Exclamation: 42 = 42

Property Value

42

FLC

public static FLC: 49 = 49

Property Value

49

FormFeed

public static FormFeed: 6 = 6

Property Value

6

FUC

public static FUC: 75 = 75

Property Value

75

GLC

public static GLC: 50 = 50

Property Value

50

grammarFileName

string grammarFileName

Property Value

string

GreaterThan

public static GreaterThan: 36 = 36

Property Value

36

GUC

public static GUC: 76 = 76

Property Value

76

Hash

public static Hash: 40 = 40

Property Value

40

HexChar

public static HexChar: 11 = 11

Property Value

11

HLC

public static HLC: 51 = 51

Property Value

51

HUC

public static HUC: 77 = 77

Property Value

77

Hyphen

public static Hyphen: 24 = 24

Property Value

24

ILC

public static ILC: 52 = 52

Property Value

52

IUC

public static IUC: 78 = 78

Property Value

78

JLC

public static JLC: 53 = 53

Property Value

53

JUC

public static JUC: 79 = 79

Property Value

79

KLC

public static KLC: 54 = 54

Property Value

54

KUC

public static KUC: 80 = 80

Property Value

80

LessThan

public static LessThan: 35 = 35

Property Value

35

LLC

public static LLC: 55 = 55

Property Value

55

LUC

public static LUC: 81 = 81

Property Value

81

MLC

public static MLC: 56 = 56

Property Value

56

modeNames

public static modeNames: string[] = [
		"DEFAULT_MODE",
	]

Property Value

string[]

modeNames

string[] modeNames

Property Value

string[]

MUC

public static MUC: 82 = 82

Property Value

82

NewLine

public static NewLine: 7 = 7

Property Value

7

NLC

public static NLC: 57 = 57

Property Value

57

NotDecimalDigit

public static NotDecimalDigit: 14 = 14

Property Value

14

NotWhiteSpace

public static NotWhiteSpace: 18 = 18

Property Value

18

NotWordChar

public static NotWordChar: 20 = 20

Property Value

20

NUC

public static NUC: 83 = 83

Property Value

83

OLC

public static OLC: 58 = 58

Property Value

58

OpenBrace

public static OpenBrace: 28 = 28

Property Value

28

OpenParen

public static OpenParen: 33 = 33

Property Value

33

OtherChar

public static OtherChar: 106 = 106

Property Value

106

OUC

public static OUC: 84 = 84

Property Value

84

Pipe

public static Pipe: 32 = 32

Property Value

32

PLC

public static PLC: 59 = 59

Property Value

59

Plus

public static Plus: 26 = 26

Property Value

26

PUC

public static PUC: 85 = 85

Property Value

85

QLC

public static QLC: 60 = 60

Property Value

60

QUC

public static QUC: 86 = 86

Property Value

86

QuestionMark

public static QuestionMark: 25 = 25

Property Value

25

Quoted

public static Quoted: 1 = 1

Property Value

1

RLC

public static RLC: 61 = 61

Property Value

61

RUC

public static RUC: 87 = 87

Property Value

87

ruleNames

public static ruleNames: string[] = [
		"Quoted", "BlockQuoted", "BellChar", "ControlChar", "EscapeChar", "FormFeed", 
		"NewLine", "CarriageReturn", "Tab", "Backslash", "HexChar", "Dot", "DecimalDigit", 
		"NotDecimalDigit", "CharWithProperty", "CharWithoutProperty", "WhiteSpace", 
		"NotWhiteSpace", "WordChar", "NotWordChar", "CharacterClassStart", "CharacterClassEnd", 
		"Caret", "Hyphen", "QuestionMark", "Plus", "Star", "OpenBrace", "CloseBrace", 
		"Comma", "EndOfSubject", "Pipe", "OpenParen", "CloseParen", "LessThan", 
		"GreaterThan", "SingleQuote", "Underscore", "Colon", "Hash", "Equals", 
		"Exclamation", "Ampersand", "ALC", "BLC", "CLC", "DLC", "ELC", "FLC", 
		"GLC", "HLC", "ILC", "JLC", "KLC", "LLC", "MLC", "NLC", "OLC", "PLC", 
		"QLC", "RLC", "SLC", "TLC", "ULC", "VLC", "WLC", "XLC", "YLC", "ZLC", 
		"AUC", "BUC", "CUC", "DUC", "EUC", "FUC", "GUC", "HUC", "IUC", "JUC", 
		"KUC", "LUC", "MUC", "NUC", "OUC", "PUC", "QUC", "RUC", "SUC", "TUC", 
		"UUC", "VUC", "WUC", "XUC", "YUC", "ZUC", "D1", "D2", "D3", "D4", "D5", 
		"D6", "D7", "D8", "D9", "D0", "OtherChar", "UnderscoreAlphaNumerics", 
		"AlphaNumerics", "AlphaNumeric", "NonAlphaNumeric", "HexDigit", "ASCII",
	]

Property Value

string[]

ruleNames

string[] ruleNames

Property Value

string[]

serializedATN

string serializedATN

Property Value

string

SingleQuote

public static SingleQuote: 37 = 37

Property Value

37

SLC

public static SLC: 62 = 62

Property Value

62

Star

public static Star: 27 = 27

Property Value

27

SUC

public static SUC: 88 = 88

Property Value

88

Tab

public static Tab: 9 = 9

Property Value

9

TLC

public static TLC: 63 = 63

Property Value

63

TUC

public static TUC: 89 = 89

Property Value

89

ULC

public static ULC: 64 = 64

Property Value

64

Underscore

public static Underscore: 38 = 38

Property Value

38

UUC

public static UUC: 90 = 90

Property Value

90

VLC

public static VLC: 65 = 65

Property Value

65

VOCABULARY

public static VOCABULARY: Vocabulary = new VocabularyImpl(CommonRegexLexer._LITERAL_NAMES, CommonRegexLexer._SYMBOLIC_NAMES, [])

Property Value

Vocabulary

vocabulary

Vocabulary vocabulary

Property Value

Vocabulary

VUC

public static VUC: 91 = 91

Property Value

91

WhiteSpace

public static WhiteSpace: 17 = 17

Property Value

17

WLC

public static WLC: 66 = 66

Property Value

66

WordChar

public static WordChar: 19 = 19

Property Value

19

WUC

public static WUC: 92 = 92

Property Value

92

XLC

public static XLC: 67 = 67

Property Value

67

XUC

public static XUC: 93 = 93

Property Value

93

YLC

public static YLC: 68 = 68

Property Value

68

YUC

public static YUC: 94 = 94

Property Value

94

ZLC

public static ZLC: 69 = 69

Property Value

69

ZUC

public static ZUC: 95 = 95

Property Value

95

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

Inherited Method Details

action(RuleContext | undefined, number, number)

function action(_localctx: RuleContext | undefined, ruleIndex: number, actionIndex: number)

Parameters

_localctx

RuleContext | undefined

ruleIndex

number

actionIndex

number

Inherited From Recognizer.action

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

sempred(RuleContext | undefined, number, number)

function sempred(_localctx: RuleContext | undefined, ruleIndex: number, actionIndex: number): boolean

Parameters

_localctx

RuleContext | undefined

ruleIndex

number

actionIndex

number

Returns

boolean

Inherited From Recognizer.sempred

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