CommonRegexLexer class

Extends

Lexer

繼承的屬性

atn

取得辨識器用於預測的 serializedATN

channel
charIndex

lookahead 目前字元的索引為何?

charPositionInLine
DEFAULT_MODE
DEFAULT_TOKEN_CHANNEL
EOF
HIDDEN
inputStream

設定 char 數據流並重設 lexer

interpreter

設定辨識器用於預測的 ATN 解釋器。

line
MAX_CHAR_VALUE
MIN_CHAR_VALUE
MORE
parseInfo

如果在剖析/lex 期間進行分析,這會傳回 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' 中有文字覆寫,請使用它來設定令牌的文字。 覆寫此方法以發出自定義 Token 物件或提供新的處理站。

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)

Lexers 在比對令牌之後,通常可以比對任何字元的詞彙,所以做容易的事情,只是殺死一個角色,並希望這一切都能奏效。如果您位於片段規則中,您可以改用規則調用堆疊來執行複雜的錯誤復原。

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

指示語匯器略過建立目前語匯器規則的令牌,並尋找另一個令牌。 nextToken() 知道當 lexer 規則完成時,令牌設定為 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

繼承自 辨識器.EOF

HIDDEN

static HIDDEN: number

屬性值

number

繼承自 Lexer.HIDDEN

inputStream

設定 char 數據流並重設 lexer

inputStream: CharStream

屬性值

CharStream

繼承自 Lexer.inputStream

interpreter

設定辨識器用於預測的 ATN 解釋器。

interpreter: LexerATNSimulator

屬性值

LexerATNSimulator

繼承自 Recognizer.解釋器

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

如果在剖析/lex 期間進行分析,這會傳回 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' 中有文字覆寫,請使用它來設定令牌的文字。 覆寫此方法以發出自定義 Token 物件或提供新的處理站。

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)

Lexers 在比對令牌之後,通常可以比對任何字元的詞彙,所以做容易的事情,只是殺死一個角色,並希望這一切都能奏效。如果您位於片段規則中,您可以改用規則調用堆疊來執行複雜的錯誤復原。

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() 知道當 lexer 規則完成時,令牌設定為 SKIP_TOKEN。 回想一下,如果 token==undefined 在任何令牌規則結束時,它會為您建立一個令牌,併發出它。

function skip()

繼承自 Lexer.skip