Package one.gfw.antlr4.js.typescript
Class TypeScriptLexerBase
- java.lang.Object
-
- org.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
- org.antlr.v4.runtime.Lexer
-
- one.gfw.antlr4.js.typescript.TypeScriptLexerBase
-
- All Implemented Interfaces:
org.antlr.v4.runtime.TokenSource
- Direct Known Subclasses:
TypeScriptLexer
public abstract class TypeScriptLexerBase extends org.antlr.v4.runtime.LexerAll lexer methods that used in grammar (IsStrictMode) should start with Upper Case Char similar to Lexer rules.
-
-
Field Summary
-
Fields inherited from class org.antlr.v4.runtime.Lexer
_channel, _factory, _hitEOF, _input, _mode, _modeStack, _text, _token, _tokenFactorySourcePair, _tokenStartCharIndex, _tokenStartCharPositionInLine, _tokenStartLine, _type, DEFAULT_MODE, DEFAULT_TOKEN_CHANNEL, HIDDEN, MAX_CHAR_VALUE, MIN_CHAR_VALUE, MORE, SKIP
-
-
Constructor Summary
Constructors Constructor Description TypeScriptLexerBase(org.antlr.v4.runtime.CharStream input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidDecreaseTemplateDepth()booleangetStrictDefault()protected voidIncreaseTemplateDepth()booleanIsInTemplateString()protected booleanIsRegexPossible()Returnstrueif the lexer can match a regex literal.booleanIsStrictMode()org.antlr.v4.runtime.TokennextToken()Return the next token from the character stream and records this last token in case it resides on the default channel.protected voidProcessCloseBrace()protected voidProcessOpenBrace()protected voidProcessStringLiteral()voidsetUseStrictDefault(boolean value)-
Methods inherited from class org.antlr.v4.runtime.Lexer
emit, emit, emitEOF, getAllTokens, getChannel, getChannelNames, getCharErrorDisplay, getCharIndex, getCharPositionInLine, getErrorDisplay, getErrorDisplay, getInputStream, getLine, getModeNames, getSourceName, getText, getToken, getTokenFactory, getTokenNames, getType, mode, more, notifyListeners, popMode, pushMode, recover, recover, reset, setChannel, setCharPositionInLine, setInputStream, setLine, setText, setToken, setTokenFactory, setType, skip
-
Methods inherited from class org.antlr.v4.runtime.Recognizer
action, addErrorListener, getATN, getErrorHeader, getErrorListenerDispatch, getErrorListeners, getGrammarFileName, getInterpreter, getParseInfo, getRuleIndexMap, getRuleNames, getSerializedATN, getState, getTokenErrorDisplay, getTokenType, getTokenTypeMap, getVocabulary, precpred, removeErrorListener, removeErrorListeners, sempred, setInterpreter, setState
-
-
-
-
Method Detail
-
getStrictDefault
public boolean getStrictDefault()
-
setUseStrictDefault
public void setUseStrictDefault(boolean value)
-
IsStrictMode
public boolean IsStrictMode()
-
IsInTemplateString
public boolean IsInTemplateString()
-
nextToken
public org.antlr.v4.runtime.Token nextToken()
Return the next token from the character stream and records this last token in case it resides on the default channel. This recorded token is used to determine when the lexer could possibly match a regex literal. Also changes scopeStrictModes stack if tokenize special string 'use strict';- Specified by:
nextTokenin interfaceorg.antlr.v4.runtime.TokenSource- Overrides:
nextTokenin classorg.antlr.v4.runtime.Lexer- Returns:
- the next token from the character stream.
-
ProcessOpenBrace
protected void ProcessOpenBrace()
-
ProcessCloseBrace
protected void ProcessCloseBrace()
-
ProcessStringLiteral
protected void ProcessStringLiteral()
-
IncreaseTemplateDepth
protected void IncreaseTemplateDepth()
-
DecreaseTemplateDepth
protected void DecreaseTemplateDepth()
-
IsRegexPossible
protected boolean IsRegexPossible()
Returnstrueif the lexer can match a regex literal.
-
-