Package org.antlr.v4.runtime.tree.xpath
Class XPathLexer
- java.lang.Object
-
- org.antlr.v4.runtime.Recognizer<java.lang.Integer,LexerATNSimulator>
-
- org.antlr.v4.runtime.Lexer
-
- org.antlr.v4.runtime.tree.xpath.XPathLexer
-
- All Implemented Interfaces:
TokenSource
public class XPathLexer extends Lexer
Mimic the old XPathLexer from .g4 file
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
_LITERAL_NAMES
private static java.lang.String[]
_SYMBOLIC_NAMES
static int
ANYWHERE
static int
BANG
protected int
charPositionInLine
static int
ID
protected int
line
static java.lang.String[]
modeNames
static int
ROOT
static int
RULE_REF
static java.lang.String[]
ruleNames
static int
STRING
static int
TOKEN_REF
static java.lang.String[]
tokenNames
Deprecated.UseVOCABULARY
instead.static Vocabulary
VOCABULARY
static int
WILDCARD
-
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
-
Fields inherited from class org.antlr.v4.runtime.Recognizer
_interp, EOF
-
-
Constructor Summary
Constructors Constructor Description XPathLexer(CharStream input)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
consume()
ATN
getATN()
Get theATN
used by the recognizer for prediction.int
getCharPositionInLine()
Get the index into the current line for the current position in the input stream.java.lang.String
getGrammarFileName()
For debugging and other purposes, might want the grammar name.java.lang.String[]
getModeNames()
java.lang.String[]
getRuleNames()
java.lang.String[]
getTokenNames()
Deprecated.Vocabulary
getVocabulary()
Get the vocabulary used by the recognizer.boolean
isNameChar(int c)
boolean
isNameStartChar(int c)
java.lang.String
matchID()
java.lang.String
matchString()
Token
nextToken()
Return a token from this source; i.e., match a token on the char stream.-
Methods inherited from class org.antlr.v4.runtime.Lexer
emit, emit, emitEOF, getAllTokens, getChannel, getChannelNames, getCharErrorDisplay, getCharIndex, 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
action, addErrorListener, getErrorHeader, getErrorListenerDispatch, getErrorListeners, getInterpreter, getParseInfo, getRuleIndexMap, getSerializedATN, getState, getTokenErrorDisplay, getTokenType, getTokenTypeMap, precpred, removeErrorListener, removeErrorListeners, sempred, setInterpreter, setState
-
-
-
-
Field Detail
-
TOKEN_REF
public static final int TOKEN_REF
- See Also:
- Constant Field Values
-
RULE_REF
public static final int RULE_REF
- See Also:
- Constant Field Values
-
ANYWHERE
public static final int ANYWHERE
- See Also:
- Constant Field Values
-
ROOT
public static final int ROOT
- See Also:
- Constant Field Values
-
WILDCARD
public static final int WILDCARD
- See Also:
- Constant Field Values
-
BANG
public static final int BANG
- See Also:
- Constant Field Values
-
ID
public static final int ID
- See Also:
- Constant Field Values
-
STRING
public static final int STRING
- See Also:
- Constant Field Values
-
modeNames
public static java.lang.String[] modeNames
-
ruleNames
public static final java.lang.String[] ruleNames
-
_LITERAL_NAMES
private static final java.lang.String[] _LITERAL_NAMES
-
_SYMBOLIC_NAMES
private static final java.lang.String[] _SYMBOLIC_NAMES
-
VOCABULARY
public static final Vocabulary VOCABULARY
-
tokenNames
@Deprecated public static final java.lang.String[] tokenNames
Deprecated.UseVOCABULARY
instead.
-
line
protected int line
-
charPositionInLine
protected int charPositionInLine
-
-
Constructor Detail
-
XPathLexer
public XPathLexer(CharStream input)
-
-
Method Detail
-
getGrammarFileName
public java.lang.String getGrammarFileName()
Description copied from class:Recognizer
For debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.- Specified by:
getGrammarFileName
in classRecognizer<java.lang.Integer,LexerATNSimulator>
-
getRuleNames
public java.lang.String[] getRuleNames()
- Specified by:
getRuleNames
in classRecognizer<java.lang.Integer,LexerATNSimulator>
-
getModeNames
public java.lang.String[] getModeNames()
- Overrides:
getModeNames
in classLexer
-
getTokenNames
@Deprecated public java.lang.String[] getTokenNames()
Deprecated.Description copied from class:Lexer
Used to print out token names like ID during debugging and error reporting. The generated parsers implement a method that overrides this to point to their String[] tokenNames.- Overrides:
getTokenNames
in classLexer
-
getVocabulary
public Vocabulary getVocabulary()
Description copied from class:Recognizer
Get the vocabulary used by the recognizer.- Overrides:
getVocabulary
in classRecognizer<java.lang.Integer,LexerATNSimulator>
- Returns:
- A
Vocabulary
instance providing information about the vocabulary used by the grammar.
-
getATN
public ATN getATN()
Description copied from class:Recognizer
Get theATN
used by the recognizer for prediction.- Specified by:
getATN
in classRecognizer<java.lang.Integer,LexerATNSimulator>
- Returns:
- The
ATN
used by the recognizer for prediction.
-
nextToken
public Token nextToken()
Description copied from class:Lexer
Return a token from this source; i.e., match a token on the char stream.- Specified by:
nextToken
in interfaceTokenSource
- Overrides:
nextToken
in classLexer
-
consume
public void consume()
-
getCharPositionInLine
public int getCharPositionInLine()
Description copied from interface:TokenSource
Get the index into the current line for the current position in the input stream. The first character on a line has position 0.- Specified by:
getCharPositionInLine
in interfaceTokenSource
- Overrides:
getCharPositionInLine
in classLexer
- Returns:
- The line number for the current position in the input stream, or -1 if the current token source does not track character positions.
-
matchID
public java.lang.String matchID()
-
matchString
public java.lang.String matchString()
-
isNameChar
public boolean isNameChar(int c)
-
isNameStartChar
public boolean isNameStartChar(int c)
-
-