Class TypeScriptLexer
- java.lang.Object
-
- org.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
- org.antlr.v4.runtime.Lexer
-
- net.sourceforge.pmd.lang.typescript.ast.TypeScriptLexer
-
- All Implemented Interfaces:
org.antlr.v4.runtime.TokenSource
public class TypeScriptLexer extends org.antlr.v4.runtime.Lexer
-
-
Field Summary
Fields Modifier and Type Field Description static org.antlr.v4.runtime.atn.ATN
_ATN
protected static org.antlr.v4.runtime.dfa.DFA[]
_decisionToDFA
static String
_serializedATN
protected static org.antlr.v4.runtime.atn.PredictionContextCache
_sharedContextCache
static int
Abstract
static int
And
static int
Any
static int
ARROW
static int
As
static int
Assign
static int
Async
static int
At
static int
BackTick
static int
BinaryIntegerLiteral
static int
BitAnd
static int
BitAndAssign
static int
BitNot
static int
BitOr
static int
BitOrAssign
static int
BitXOr
static int
BitXorAssign
static int
Boolean
static int
BooleanLiteral
static int
Break
static int
Case
static int
Catch
static int
CDataComment
static String[]
channelNames
static int
Class
static int
CloseBrace
static int
CloseBracket
static int
CloseParen
static int
Colon
static int
Comma
static int
Const
static int
Constructor
static int
Continue
static int
Debugger
static int
DecimalLiteral
static int
Declare
static int
Default
static int
Delete
static int
Divide
static int
DivideAssign
static int
Do
static int
Dot
static int
Ellipsis
static int
Else
static int
Enum
static int
Equals_
static int
ERROR
static int
Export
static int
Extends
static int
Finally
static int
For
static int
From
static int
Function_
static int
Get
static int
GreaterThanEquals
static int
HexIntegerLiteral
static int
HtmlComment
static int
Identifier
static int
IdentityEquals
static int
IdentityNotEquals
static int
If
static int
Implements
static int
Import
static int
In
static int
Instanceof
static int
Interface
static int
Is
static int
LeftShiftArithmetic
static int
LeftShiftArithmeticAssign
static int
LessThan
static int
LessThanEquals
static int
Let
static int
LineTerminator
static int
Minus
static int
MinusAssign
static int
MinusMinus
static String[]
modeNames
static int
Module
static int
Modulus
static int
ModulusAssign
static int
MoreThan
static int
MultiLineComment
static int
Multiply
static int
MultiplyAssign
static int
Namespace
static int
New
static int
Not
static int
NotEquals
static int
NullLiteral
static int
Number
static int
OctalIntegerLiteral
static int
OctalIntegerLiteral2
static int
OpenBrace
static int
OpenBracket
static int
OpenParen
static int
Or
static int
Package
static int
Plus
static int
PlusAssign
static int
PlusPlus
static int
Private
static int
Protected
static int
Public
static int
QuestionMark
static int
ReadOnly
static int
RegularExpressionLiteral
static int
Require
static int
Return
static int
RightShiftArithmetic
static int
RightShiftArithmeticAssign
static int
RightShiftLogical
static int
RightShiftLogicalAssign
static String[]
ruleNames
static int
SemiColon
static int
Set
static int
SingleLineComment
static int
Static
static int
String
static int
StringLiteral
static int
Super
static int
Switch
static int
Symbol
static int
TEMPLATE
static int
TemplateCloseBrace
static int
TemplateStringAtom
static int
TemplateStringEscapeAtom
static int
TemplateStringStartExpression
static int
This
static int
Throw
static String[]
tokenNames
Deprecated.UseVOCABULARY
instead.static int
Try
static int
TypeAlias
static int
Typeof
static int
UnexpectedCharacter
static int
Var
static org.antlr.v4.runtime.Vocabulary
VOCABULARY
static int
Void
static int
While
static int
WhiteSpaces
static int
With
static int
Yield
-
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 TypeScriptLexer(org.antlr.v4.runtime.CharStream input)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
action(org.antlr.v4.runtime.RuleContext _localctx, int ruleIndex, int actionIndex)
protected void
DecreaseTemplateDepth()
org.antlr.v4.runtime.atn.ATN
getATN()
String[]
getChannelNames()
String
getGrammarFileName()
String[]
getModeNames()
String[]
getRuleNames()
String
getSerializedATN()
boolean
getStrictDefault()
String[]
getTokenNames()
Deprecated.org.antlr.v4.runtime.Vocabulary
getVocabulary()
protected void
IncreaseTemplateDepth()
boolean
IsInTemplateString()
protected boolean
IsRegexPossible()
Returnstrue
if the lexer can match a regex literal.boolean
IsStrictMode()
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.protected void
ProcessCloseBrace()
protected void
ProcessOpenBrace()
protected void
ProcessStringLiteral()
boolean
sempred(org.antlr.v4.runtime.RuleContext _localctx, int ruleIndex, int predIndex)
void
setUseStrictDefault(boolean value)
void
StartTemplateString()
-
Methods inherited from class org.antlr.v4.runtime.Lexer
emit, emit, emitEOF, getAllTokens, getChannel, getCharErrorDisplay, getCharIndex, getCharPositionInLine, getErrorDisplay, getErrorDisplay, getInputStream, getLine, getSourceName, getText, getToken, getTokenFactory, 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
addErrorListener, getErrorHeader, getErrorListenerDispatch, getErrorListeners, getInterpreter, getParseInfo, getRuleIndexMap, getState, getTokenErrorDisplay, getTokenType, getTokenTypeMap, precpred, removeErrorListener, removeErrorListeners, setInterpreter, setState
-
-
-
-
Field Detail
-
_decisionToDFA
protected static final org.antlr.v4.runtime.dfa.DFA[] _decisionToDFA
-
_sharedContextCache
protected static final org.antlr.v4.runtime.atn.PredictionContextCache _sharedContextCache
-
MultiLineComment
public static final int MultiLineComment
- See Also:
- Constant Field Values
-
SingleLineComment
public static final int SingleLineComment
- See Also:
- Constant Field Values
-
RegularExpressionLiteral
public static final int RegularExpressionLiteral
- See Also:
- Constant Field Values
-
OpenBracket
public static final int OpenBracket
- See Also:
- Constant Field Values
-
CloseBracket
public static final int CloseBracket
- See Also:
- Constant Field Values
-
OpenParen
public static final int OpenParen
- See Also:
- Constant Field Values
-
CloseParen
public static final int CloseParen
- See Also:
- Constant Field Values
-
OpenBrace
public static final int OpenBrace
- See Also:
- Constant Field Values
-
TemplateCloseBrace
public static final int TemplateCloseBrace
- See Also:
- Constant Field Values
-
CloseBrace
public static final int CloseBrace
- See Also:
- Constant Field Values
-
SemiColon
public static final int SemiColon
- See Also:
- Constant Field Values
-
Comma
public static final int Comma
- See Also:
- Constant Field Values
-
Assign
public static final int Assign
- See Also:
- Constant Field Values
-
QuestionMark
public static final int QuestionMark
- See Also:
- Constant Field Values
-
Colon
public static final int Colon
- See Also:
- Constant Field Values
-
Ellipsis
public static final int Ellipsis
- See Also:
- Constant Field Values
-
Dot
public static final int Dot
- See Also:
- Constant Field Values
-
PlusPlus
public static final int PlusPlus
- See Also:
- Constant Field Values
-
MinusMinus
public static final int MinusMinus
- See Also:
- Constant Field Values
-
Plus
public static final int Plus
- See Also:
- Constant Field Values
-
Minus
public static final int Minus
- See Also:
- Constant Field Values
-
BitNot
public static final int BitNot
- See Also:
- Constant Field Values
-
Not
public static final int Not
- See Also:
- Constant Field Values
-
Multiply
public static final int Multiply
- See Also:
- Constant Field Values
-
Divide
public static final int Divide
- See Also:
- Constant Field Values
-
Modulus
public static final int Modulus
- See Also:
- Constant Field Values
-
RightShiftArithmetic
public static final int RightShiftArithmetic
- See Also:
- Constant Field Values
-
LeftShiftArithmetic
public static final int LeftShiftArithmetic
- See Also:
- Constant Field Values
-
RightShiftLogical
public static final int RightShiftLogical
- See Also:
- Constant Field Values
-
LessThan
public static final int LessThan
- See Also:
- Constant Field Values
-
MoreThan
public static final int MoreThan
- See Also:
- Constant Field Values
-
LessThanEquals
public static final int LessThanEquals
- See Also:
- Constant Field Values
-
GreaterThanEquals
public static final int GreaterThanEquals
- See Also:
- Constant Field Values
-
Equals_
public static final int Equals_
- See Also:
- Constant Field Values
-
NotEquals
public static final int NotEquals
- See Also:
- Constant Field Values
-
IdentityEquals
public static final int IdentityEquals
- See Also:
- Constant Field Values
-
IdentityNotEquals
public static final int IdentityNotEquals
- See Also:
- Constant Field Values
-
BitAnd
public static final int BitAnd
- See Also:
- Constant Field Values
-
BitXOr
public static final int BitXOr
- See Also:
- Constant Field Values
-
BitOr
public static final int BitOr
- See Also:
- Constant Field Values
-
And
public static final int And
- See Also:
- Constant Field Values
-
Or
public static final int Or
- See Also:
- Constant Field Values
-
MultiplyAssign
public static final int MultiplyAssign
- See Also:
- Constant Field Values
-
DivideAssign
public static final int DivideAssign
- See Also:
- Constant Field Values
-
ModulusAssign
public static final int ModulusAssign
- See Also:
- Constant Field Values
-
PlusAssign
public static final int PlusAssign
- See Also:
- Constant Field Values
-
MinusAssign
public static final int MinusAssign
- See Also:
- Constant Field Values
-
LeftShiftArithmeticAssign
public static final int LeftShiftArithmeticAssign
- See Also:
- Constant Field Values
-
RightShiftArithmeticAssign
public static final int RightShiftArithmeticAssign
- See Also:
- Constant Field Values
-
RightShiftLogicalAssign
public static final int RightShiftLogicalAssign
- See Also:
- Constant Field Values
-
BitAndAssign
public static final int BitAndAssign
- See Also:
- Constant Field Values
-
BitXorAssign
public static final int BitXorAssign
- See Also:
- Constant Field Values
-
BitOrAssign
public static final int BitOrAssign
- See Also:
- Constant Field Values
-
ARROW
public static final int ARROW
- See Also:
- Constant Field Values
-
NullLiteral
public static final int NullLiteral
- See Also:
- Constant Field Values
-
BooleanLiteral
public static final int BooleanLiteral
- See Also:
- Constant Field Values
-
DecimalLiteral
public static final int DecimalLiteral
- See Also:
- Constant Field Values
-
HexIntegerLiteral
public static final int HexIntegerLiteral
- See Also:
- Constant Field Values
-
OctalIntegerLiteral
public static final int OctalIntegerLiteral
- See Also:
- Constant Field Values
-
OctalIntegerLiteral2
public static final int OctalIntegerLiteral2
- See Also:
- Constant Field Values
-
BinaryIntegerLiteral
public static final int BinaryIntegerLiteral
- See Also:
- Constant Field Values
-
Break
public static final int Break
- See Also:
- Constant Field Values
-
Do
public static final int Do
- See Also:
- Constant Field Values
-
Instanceof
public static final int Instanceof
- See Also:
- Constant Field Values
-
Typeof
public static final int Typeof
- See Also:
- Constant Field Values
-
Case
public static final int Case
- See Also:
- Constant Field Values
-
Else
public static final int Else
- See Also:
- Constant Field Values
-
New
public static final int New
- See Also:
- Constant Field Values
-
Var
public static final int Var
- See Also:
- Constant Field Values
-
Catch
public static final int Catch
- See Also:
- Constant Field Values
-
Finally
public static final int Finally
- See Also:
- Constant Field Values
-
Return
public static final int Return
- See Also:
- Constant Field Values
-
Void
public static final int Void
- See Also:
- Constant Field Values
-
Continue
public static final int Continue
- See Also:
- Constant Field Values
-
For
public static final int For
- See Also:
- Constant Field Values
-
Switch
public static final int Switch
- See Also:
- Constant Field Values
-
While
public static final int While
- See Also:
- Constant Field Values
-
Debugger
public static final int Debugger
- See Also:
- Constant Field Values
-
Function_
public static final int Function_
- See Also:
- Constant Field Values
-
This
public static final int This
- See Also:
- Constant Field Values
-
With
public static final int With
- See Also:
- Constant Field Values
-
Default
public static final int Default
- See Also:
- Constant Field Values
-
If
public static final int If
- See Also:
- Constant Field Values
-
Throw
public static final int Throw
- See Also:
- Constant Field Values
-
Delete
public static final int Delete
- See Also:
- Constant Field Values
-
In
public static final int In
- See Also:
- Constant Field Values
-
Try
public static final int Try
- See Also:
- Constant Field Values
-
As
public static final int As
- See Also:
- Constant Field Values
-
From
public static final int From
- See Also:
- Constant Field Values
-
ReadOnly
public static final int ReadOnly
- See Also:
- Constant Field Values
-
Async
public static final int Async
- See Also:
- Constant Field Values
-
Class
public static final int Class
- See Also:
- Constant Field Values
-
Enum
public static final int Enum
- See Also:
- Constant Field Values
-
Extends
public static final int Extends
- See Also:
- Constant Field Values
-
Super
public static final int Super
- See Also:
- Constant Field Values
-
Const
public static final int Const
- See Also:
- Constant Field Values
-
Export
public static final int Export
- See Also:
- Constant Field Values
-
Import
public static final int Import
- See Also:
- Constant Field Values
-
Implements
public static final int Implements
- See Also:
- Constant Field Values
-
Let
public static final int Let
- See Also:
- Constant Field Values
-
Private
public static final int Private
- See Also:
- Constant Field Values
-
Public
public static final int Public
- See Also:
- Constant Field Values
-
Interface
public static final int Interface
- See Also:
- Constant Field Values
-
Package
public static final int Package
- See Also:
- Constant Field Values
-
Protected
public static final int Protected
- See Also:
- Constant Field Values
-
Static
public static final int Static
- See Also:
- Constant Field Values
-
Yield
public static final int Yield
- See Also:
- Constant Field Values
-
Any
public static final int Any
- See Also:
- Constant Field Values
-
Number
public static final int Number
- See Also:
- Constant Field Values
-
Boolean
public static final int Boolean
- See Also:
- Constant Field Values
-
String
public static final int String
- See Also:
- Constant Field Values
-
Symbol
public static final int Symbol
- See Also:
- Constant Field Values
-
TypeAlias
public static final int TypeAlias
- See Also:
- Constant Field Values
-
Get
public static final int Get
- See Also:
- Constant Field Values
-
Set
public static final int Set
- See Also:
- Constant Field Values
-
Constructor
public static final int Constructor
- See Also:
- Constant Field Values
-
Namespace
public static final int Namespace
- See Also:
- Constant Field Values
-
Require
public static final int Require
- See Also:
- Constant Field Values
-
Module
public static final int Module
- See Also:
- Constant Field Values
-
Declare
public static final int Declare
- See Also:
- Constant Field Values
-
Abstract
public static final int Abstract
- See Also:
- Constant Field Values
-
Is
public static final int Is
- See Also:
- Constant Field Values
-
At
public static final int At
- See Also:
- Constant Field Values
-
Identifier
public static final int Identifier
- See Also:
- Constant Field Values
-
StringLiteral
public static final int StringLiteral
- See Also:
- Constant Field Values
-
BackTick
public static final int BackTick
- See Also:
- Constant Field Values
-
WhiteSpaces
public static final int WhiteSpaces
- See Also:
- Constant Field Values
-
LineTerminator
public static final int LineTerminator
- See Also:
- Constant Field Values
-
HtmlComment
public static final int HtmlComment
- See Also:
- Constant Field Values
-
CDataComment
public static final int CDataComment
- See Also:
- Constant Field Values
-
UnexpectedCharacter
public static final int UnexpectedCharacter
- See Also:
- Constant Field Values
-
TemplateStringEscapeAtom
public static final int TemplateStringEscapeAtom
- See Also:
- Constant Field Values
-
TemplateStringStartExpression
public static final int TemplateStringStartExpression
- See Also:
- Constant Field Values
-
TemplateStringAtom
public static final int TemplateStringAtom
- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
- See Also:
- Constant Field Values
-
TEMPLATE
public static final int TEMPLATE
- See Also:
- Constant Field Values
-
channelNames
public static String[] channelNames
-
modeNames
public static String[] modeNames
-
ruleNames
public static final String[] ruleNames
-
VOCABULARY
public static final org.antlr.v4.runtime.Vocabulary VOCABULARY
-
tokenNames
@Deprecated public static final String[] tokenNames
Deprecated.UseVOCABULARY
instead.
-
_serializedATN
public static final String _serializedATN
- See Also:
- Constant Field Values
-
_ATN
public static final org.antlr.v4.runtime.atn.ATN _ATN
-
-
Method Detail
-
getTokenNames
@Deprecated public String[] getTokenNames()
Deprecated.- Overrides:
getTokenNames
in classorg.antlr.v4.runtime.Lexer
-
getVocabulary
public org.antlr.v4.runtime.Vocabulary getVocabulary()
- Overrides:
getVocabulary
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
getGrammarFileName
public String getGrammarFileName()
- Specified by:
getGrammarFileName
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
getRuleNames
public String[] getRuleNames()
- Specified by:
getRuleNames
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
getSerializedATN
public String getSerializedATN()
- Overrides:
getSerializedATN
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
getChannelNames
public String[] getChannelNames()
- Overrides:
getChannelNames
in classorg.antlr.v4.runtime.Lexer
-
getModeNames
public String[] getModeNames()
- Overrides:
getModeNames
in classorg.antlr.v4.runtime.Lexer
-
getATN
public org.antlr.v4.runtime.atn.ATN getATN()
- Specified by:
getATN
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
action
public void action(org.antlr.v4.runtime.RuleContext _localctx, int ruleIndex, int actionIndex)
- Overrides:
action
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
sempred
public boolean sempred(org.antlr.v4.runtime.RuleContext _localctx, int ruleIndex, int predIndex)
- Overrides:
sempred
in classorg.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
-
getStrictDefault
public boolean getStrictDefault()
-
setUseStrictDefault
public void setUseStrictDefault(boolean value)
-
IsStrictMode
public boolean IsStrictMode()
-
StartTemplateString
public void StartTemplateString()
-
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:
nextToken
in interfaceorg.antlr.v4.runtime.TokenSource
- Overrides:
nextToken
in 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()
Returnstrue
if the lexer can match a regex literal.
-
-