Share via


CommonRegexLexer class

Extends

Lexer

建構函式

CommonRegexLexer(CharStream)

屬性

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

繼承的屬性

atn

serializedATN取得辨識器用於預測的 。

channel
charIndex

目前外觀字元的索引為何?

charPositionInLine
DEFAULT_MODE
DEFAULT_TOKEN_CHANNEL
EOF
HIDDEN
inputStream

設定 char 資料流程並重設語彙器

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)

呼叫以在最外層語彙規則上自動發出權杖的標準方法。 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()

從這個來源傳回權杖;亦即,比對 char 資料流程上的權杖。

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=,它會為您建立一個權杖併發出它。

建構函式詳細資料

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

目前外觀字元的索引為何?

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

設定 char 資料流程並重設語彙器

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)

呼叫以在最外層語彙規則上自動發出權杖的標準方法。 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()

從這個來源傳回權杖;亦即,比對 char 資料流程上的權杖。

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=,它會為您建立一個權杖併發出它。

function skip()

繼承自 Lexer.skip