CommonRegexLexer class

扩展

Lexer

继承属性

atn

获取识别器用于预测的 serializedATN。

channel
charIndex

lookahead 当前字符的索引是什么?

charPositionInLine
DEFAULT_MODE
DEFAULT_TOKEN_CHANNEL
EOF
HIDDEN
inputStream

设置字符流并重置词法器

interpreter

设置识别器用于预测的 ATN 解释器。

line
MAX_CHAR_VALUE
MIN_CHAR_VALUE
MORE
parseInfo

如果在分析/词法期间进行分析,这将返回 ParseInfo 对象中识别器中每个决策的 DecisionInfo 记录。

SKIP
sourceName
state

指示识别器已更改与传入的 ATN 状态一致的内部状态。 这样,我们总是知道我们在 ATN 中的位置,因为分析器一直在。 规则上下文对象构成一个堆栈,用于查看调用规则的堆栈。 结合这一点,我们已获得完整的 ATN 配置信息。

text

设置此令牌的完整文本;它会擦除以前对文本所做的任何更改。

token

如果发出多个令牌,则重写。

tokenFactory
type

继承的方法

action(RuleContext | undefined, number, number)
addErrorListener(ANTLRErrorListener<number>)
emit()

默认情况下,由于效率原因,每个 nextToken 调用不支持多个发出。 子类并重写此方法、nextToken 和 getToken(将令牌推送到列表中并从该列表中拉取,而不是像此实现那样的单个变量)。

emit(Token)

调用的标准方法会在最外层的词法规则中自动发出令牌。 标记对象应指向 char 缓冲区 start。。停。 如果“text”中有文本替代,请使用该替代来设置令牌的文本。 重写此方法以发出自定义令牌对象或提供新工厂。

emitEOF()
getAllTokens()

返回输入字符流中所有 Token 对象的列表。 强制加载所有令牌。 不包括 EOF 令牌。

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

错误标头是什么,通常是行/字符位置信息?

getErrorListenerDispatch()
getErrorListeners()
getRuleIndexMap()

从规则名称到规则索引获取映射。 用于 XPath 和树模式编译。

getTokenType(string)
getTokenTypeMap()

从令牌名称到令牌类型获取映射。 用于 XPath 和树模式编译。

mode(number)
more()
nextToken()

从此源返回令牌;即,匹配字符流上的令牌。

notifyListeners(LexerNoViableAltException)
popMode()
precpred(RuleContext | undefined, number)
pushMode(number)
recover(LexerNoViableAltException)
recover(RecognitionException)

词法师在匹配令牌后,通常可以匹配其词汇中的任何字符,所以做容易的事情,只是杀死一个角色,并希望它一切都能正常工作。如果处于片段规则中,则可以改用规则调用堆栈执行复杂的错误恢复。

removeErrorListener(ANTLRErrorListener<number>)
removeErrorListeners()
reset()
reset(boolean)
sempred(RuleContext | undefined, number, number)
skip()

指示词法器跳过为当前词法器规则创建令牌并查找另一个令牌。 nextToken() 知道,当词法器规则完成时,令牌设置为SKIP_TOKEN。 回想一下,如果 token==undefined 位于任何令牌规则的末尾,它将为你创建一个令牌并发出它。

构造函数详细信息

CommonRegexLexer(CharStream)

new CommonRegexLexer(input: CharStream)

参数

input

CharStream

属性详细信息

ALC

public static ALC: 44 = 44

属性值

44

Ampersand

public static Ampersand: 43 = 43

属性值

43

AUC

public static AUC: 70 = 70

属性值

70

Backslash

public static Backslash: 10 = 10

属性值

10

BellChar

public static BellChar: 3 = 3

属性值

3

BLC

public static BLC: 45 = 45

属性值

45

BlockQuoted

public static BlockQuoted: 2 = 2

属性值

2

BUC

public static BUC: 71 = 71

属性值

71

Caret

public static Caret: 23 = 23

属性值

23

CarriageReturn

public static CarriageReturn: 8 = 8

属性值

8

channelNames

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

属性值

string[]

channelNames

string[] channelNames

属性值

string[]

CharacterClassEnd

public static CharacterClassEnd: 22 = 22

属性值

22

CharacterClassStart

public static CharacterClassStart: 21 = 21

属性值

21

CharWithoutProperty

public static CharWithoutProperty: 16 = 16

属性值

16

CharWithProperty

public static CharWithProperty: 15 = 15

属性值

15

CLC

public static CLC: 46 = 46

属性值

46

CloseBrace

public static CloseBrace: 29 = 29

属性值

29

CloseParen

public static CloseParen: 34 = 34

属性值

34

Colon

public static Colon: 39 = 39

属性值

39

Comma

public static Comma: 30 = 30

属性值

30

ControlChar

public static ControlChar: 4 = 4

属性值

4

CUC

public static CUC: 72 = 72

属性值

72

D0

public static D0: 105 = 105

属性值

105

D1

public static D1: 96 = 96

属性值

96

D2

public static D2: 97 = 97

属性值

97

D3

public static D3: 98 = 98

属性值

98

D4

public static D4: 99 = 99

属性值

99

D5

public static D5: 100 = 100

属性值

100

D6

public static D6: 101 = 101

属性值

101

D7

public static D7: 102 = 102

属性值

102

D8

public static D8: 103 = 103

属性值

103

D9

public static D9: 104 = 104

属性值

104

DecimalDigit

public static DecimalDigit: 13 = 13

属性值

13

DLC

public static DLC: 47 = 47

属性值

47

Dot

public static Dot: 12 = 12

属性值

12

DUC

public static DUC: 73 = 73

属性值

73

ELC

public static ELC: 48 = 48

属性值

48

EndOfSubject

public static EndOfSubject: 31 = 31

属性值

31

Equals

public static Equals: 41 = 41

属性值

41

EscapeChar

public static EscapeChar: 5 = 5

属性值

5

EUC

public static EUC: 74 = 74

属性值

74

Exclamation

public static Exclamation: 42 = 42

属性值

42

FLC

public static FLC: 49 = 49

属性值

49

FormFeed

public static FormFeed: 6 = 6

属性值

6

FUC

public static FUC: 75 = 75

属性值

75

GLC

public static GLC: 50 = 50

属性值

50

grammarFileName

string grammarFileName

属性值

string

GreaterThan

public static GreaterThan: 36 = 36

属性值

36

GUC

public static GUC: 76 = 76

属性值

76

Hash

public static Hash: 40 = 40

属性值

40

HexChar

public static HexChar: 11 = 11

属性值

11

HLC

public static HLC: 51 = 51

属性值

51

HUC

public static HUC: 77 = 77

属性值

77

Hyphen

public static Hyphen: 24 = 24

属性值

24

ILC

public static ILC: 52 = 52

属性值

52

IUC

public static IUC: 78 = 78

属性值

78

JLC

public static JLC: 53 = 53

属性值

53

JUC

public static JUC: 79 = 79

属性值

79

KLC

public static KLC: 54 = 54

属性值

54

KUC

public static KUC: 80 = 80

属性值

80

LessThan

public static LessThan: 35 = 35

属性值

35

LLC

public static LLC: 55 = 55

属性值

55

LUC

public static LUC: 81 = 81

属性值

81

MLC

public static MLC: 56 = 56

属性值

56

modeNames

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

属性值

string[]

modeNames

string[] modeNames

属性值

string[]

MUC

public static MUC: 82 = 82

属性值

82

NewLine

public static NewLine: 7 = 7

属性值

7

NLC

public static NLC: 57 = 57

属性值

57

NotDecimalDigit

public static NotDecimalDigit: 14 = 14

属性值

14

NotWhiteSpace

public static NotWhiteSpace: 18 = 18

属性值

18

NotWordChar

public static NotWordChar: 20 = 20

属性值

20

NUC

public static NUC: 83 = 83

属性值

83

OLC

public static OLC: 58 = 58

属性值

58

OpenBrace

public static OpenBrace: 28 = 28

属性值

28

OpenParen

public static OpenParen: 33 = 33

属性值

33

OtherChar

public static OtherChar: 106 = 106

属性值

106

OUC

public static OUC: 84 = 84

属性值

84

Pipe

public static Pipe: 32 = 32

属性值

32

PLC

public static PLC: 59 = 59

属性值

59

Plus

public static Plus: 26 = 26

属性值

26

PUC

public static PUC: 85 = 85

属性值

85

QLC

public static QLC: 60 = 60

属性值

60

QUC

public static QUC: 86 = 86

属性值

86

QuestionMark

public static QuestionMark: 25 = 25

属性值

25

Quoted

public static Quoted: 1 = 1

属性值

1

RLC

public static RLC: 61 = 61

属性值

61

RUC

public static RUC: 87 = 87

属性值

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",
	]

属性值

string[]

ruleNames

string[] ruleNames

属性值

string[]

serializedATN

string serializedATN

属性值

string

SingleQuote

public static SingleQuote: 37 = 37

属性值

37

SLC

public static SLC: 62 = 62

属性值

62

Star

public static Star: 27 = 27

属性值

27

SUC

public static SUC: 88 = 88

属性值

88

Tab

public static Tab: 9 = 9

属性值

9

TLC

public static TLC: 63 = 63

属性值

63

TUC

public static TUC: 89 = 89

属性值

89

ULC

public static ULC: 64 = 64

属性值

64

Underscore

public static Underscore: 38 = 38

属性值

38

UUC

public static UUC: 90 = 90

属性值

90

VLC

public static VLC: 65 = 65

属性值

65

VOCABULARY

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

属性值

Vocabulary

vocabulary

Vocabulary vocabulary

属性值

Vocabulary

VUC

public static VUC: 91 = 91

属性值

91

WhiteSpace

public static WhiteSpace: 17 = 17

属性值

17

WLC

public static WLC: 66 = 66

属性值

66

WordChar

public static WordChar: 19 = 19

属性值

19

WUC

public static WUC: 92 = 92

属性值

92

XLC

public static XLC: 67 = 67

属性值

67

XUC

public static XUC: 93 = 93

属性值

93

YLC

public static YLC: 68 = 68

属性值

68

YUC

public static YUC: 94 = 94

属性值

94

ZLC

public static ZLC: 69 = 69

属性值

69

ZUC

public static ZUC: 95 = 95

属性值

95

继承属性详细信息

atn

获取识别器用于预测的 serializedATN。

atn: ATN

属性值

ATN

继承自 Recognizer.atn

channel

channel: number

属性值

number

继承自 Lexer.channel

charIndex

lookahead 当前字符的索引是什么?

charIndex: number

属性值

number

继承自 Lexer.charIndex

charPositionInLine

charPositionInLine: number

属性值

number

继承自 Lexer.charPositionInLine

DEFAULT_MODE

static DEFAULT_MODE: number

属性值

number

继承自 Lexer.DEFAULT_MODE 的

DEFAULT_TOKEN_CHANNEL

static DEFAULT_TOKEN_CHANNEL: number

属性值

number

继承自 Lexer.DEFAULT_TOKEN_CHANNEL 的

EOF

static EOF: number

属性值

number

继承自 Recognizer.EOF 的

HIDDEN

static HIDDEN: number

属性值

number

继承自 Lexer.HIDDEN

inputStream

设置字符流并重置词法器

inputStream: CharStream

属性值

CharStream

继承自 Lexer.inputStream

interpreter

设置识别器用于预测的 ATN 解释器。

interpreter: LexerATNSimulator

属性值

LexerATNSimulator

继承自 Recognizer.interpreter

line

line: number

属性值

number

继承自 Lexer.line

MAX_CHAR_VALUE

static MAX_CHAR_VALUE: number

属性值

number

继承自 Lexer.MAX_CHAR_VALUE

MIN_CHAR_VALUE

static MIN_CHAR_VALUE: number

属性值

number

继承自 Lexer.MIN_CHAR_VALUE 的

MORE

static MORE: number

属性值

number

继承自 Lexer.MORE 的

parseInfo

如果在分析/词法期间进行分析,这将返回 ParseInfo 对象中识别器中每个决策的 DecisionInfo 记录。

parseInfo: Promise<ParseInfo | undefined>

属性值

Promise<ParseInfo | undefined>

继承自 Recognizer.parseInfo

SKIP

static SKIP: number

属性值

number

继承自 Lexer.SKIP 的

sourceName

sourceName: string

属性值

string

继承自 Lexer.sourceName

state

指示识别器已更改与传入的 ATN 状态一致的内部状态。 这样,我们总是知道我们在 ATN 中的位置,因为分析器一直在。 规则上下文对象构成一个堆栈,用于查看调用规则的堆栈。 结合这一点,我们已获得完整的 ATN 配置信息。

state: number

属性值

number

继承自 Recognizer.state

text

设置此令牌的完整文本;它会擦除以前对文本所做的任何更改。

text: string

属性值

string

继承自 Lexer.text

token

如果发出多个令牌,则重写。

token: Token | undefined

属性值

Token | undefined

继承自 Lexer.token

tokenFactory

tokenFactory: TokenFactory

属性值

TokenFactory

继承自 Lexer.tokenFactory

type

type: number

属性值

number

继承自 Lexer.type

继承的方法详细信息

action(RuleContext | undefined, number, number)

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

参数

_localctx

RuleContext | undefined

ruleIndex

number

actionIndex

number

继承自 Recognizer.action

addErrorListener(ANTLRErrorListener<number>)

function addErrorListener(listener: ANTLRErrorListener<number>)

参数

listener

ANTLRErrorListener<number>

继承自 Recognizer.addErrorListener

emit()

默认情况下,由于效率原因,每个 nextToken 调用不支持多个发出。 子类并重写此方法、nextToken 和 getToken(将令牌推送到列表中并从该列表中拉取,而不是像此实现那样的单个变量)。

function emit(): Token

返回

Token

继承自 Lexer.emit

emit(Token)

调用的标准方法会在最外层的词法规则中自动发出令牌。 标记对象应指向 char 缓冲区 start。。停。 如果“text”中有文本替代,请使用该替代来设置令牌的文本。 重写此方法以发出自定义令牌对象或提供新工厂。

function emit(token: Token): Token

参数

token

Token

返回

Token

继承自 Lexer.emit

emitEOF()

function emitEOF(): Token

返回

Token

继承自 Lexer.emitEOF

getAllTokens()

返回输入字符流中所有 Token 对象的列表。 强制加载所有令牌。 不包括 EOF 令牌。

function getAllTokens(): Token[]

返回

Token[]

继承自 Lexer.getAllTokens

getCharErrorDisplay(number)

function getCharErrorDisplay(c: number): string

参数

c

number

返回

string

继承自 Lexer.getCharErrorDisplay

getErrorDisplay(string | number)

function getErrorDisplay(s: string | number): string

参数

s

string | number

返回

string

继承自 Lexer.getErrorDisplay

getErrorHeader(RecognitionException)

错误标头是什么,通常是行/字符位置信息?

function getErrorHeader(e: RecognitionException): string

参数

e

RecognitionException

返回

string

继承自 Recognizer.getErrorHeader

getErrorListenerDispatch()

function getErrorListenerDispatch(): ANTLRErrorListener<number>

返回

ANTLRErrorListener<number>

继承自 Recognizer.getErrorListenerDispatch

getErrorListeners()

function getErrorListeners(): Array<ANTLRErrorListener<number>>

返回

Array<ANTLRErrorListener<number>>

继承自 Recognizer.getErrorListeners

getRuleIndexMap()

从规则名称到规则索引获取映射。 用于 XPath 和树模式编译。

function getRuleIndexMap(): ReadonlyMap<string, number>

返回

ReadonlyMap<string, number>

继承自 Recognizer.getRuleIndexMap

getTokenType(string)

function getTokenType(tokenName: string): number

参数

tokenName

string

返回

number

继承自 Recognizer.getTokenType

getTokenTypeMap()

从令牌名称到令牌类型获取映射。 用于 XPath 和树模式编译。

function getTokenTypeMap(): ReadonlyMap<string, number>

返回

ReadonlyMap<string, number>

继承自 Recognizer.getTokenTypeMap

mode(number)

function mode(m: number)

参数

m

number

继承自 Lexer.mode

more()

function more()

继承自 Lexer.more

nextToken()

从此源返回令牌;即,匹配字符流上的令牌。

function nextToken(): Token

返回

Token

继承自 Lexer.nextToken 的

notifyListeners(LexerNoViableAltException)

function notifyListeners(e: LexerNoViableAltException)

参数

e

LexerNoViableAltException

继承自 Lexer.notifyListeners

popMode()

function popMode(): number

返回

number

继承自 Lexer.popMode

precpred(RuleContext | undefined, number)

function precpred(localctx: RuleContext | undefined, precedence: number): boolean

参数

localctx

RuleContext | undefined

precedence

number

返回

boolean

继承自 Recognizer.precpred

pushMode(number)

function pushMode(m: number)

参数

m

number

继承自 Lexer.pushMode

recover(LexerNoViableAltException)

function recover(re: LexerNoViableAltException)

参数

re

LexerNoViableAltException

继承自 Lexer.recover

recover(RecognitionException)

词法师在匹配令牌后,通常可以匹配其词汇中的任何字符,所以做容易的事情,只是杀死一个角色,并希望它一切都能正常工作。如果处于片段规则中,则可以改用规则调用堆栈执行复杂的错误恢复。

function recover(re: RecognitionException)

参数

re

RecognitionException

继承自 Lexer.recover

removeErrorListener(ANTLRErrorListener<number>)

function removeErrorListener(listener: ANTLRErrorListener<number>)

参数

listener

ANTLRErrorListener<number>

继承自 Recognizer.removeErrorListener

removeErrorListeners()

function removeErrorListeners()

继承自 Recognizer.removeErrorListeners

reset()

function reset()

继承自 Lexer.reset

reset(boolean)

function reset(resetInput: boolean)

参数

resetInput

boolean

继承自 Lexer.reset

sempred(RuleContext | undefined, number, number)

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

参数

_localctx

RuleContext | undefined

ruleIndex

number

actionIndex

number

返回

boolean

继承自 Recognizer.sempred

skip()

指示词法器跳过为当前词法器规则创建令牌并查找另一个令牌。 nextToken() 知道,当词法器规则完成时,令牌设置为SKIP_TOKEN。 回想一下,如果 token==undefined 位于任何令牌规则的末尾,它将为你创建一个令牌并发出它。

function skip()

继承自 Lexer.skip