Class XPathLexer

All Implemented Interfaces:
TokenSource

public class XPathLexer extends Lexer
Mimic the old XPathLexer from .g4 file
  • Field Details

  • Constructor Details

    • XPathLexer

      public XPathLexer(CharStream input)
  • Method Details

    • getGrammarFileName

      public 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 class Recognizer<Integer,LexerATNSimulator>
    • getRuleNames

      public String[] getRuleNames()
      Specified by:
      getRuleNames in class Recognizer<Integer,LexerATNSimulator>
    • getModeNames

      public String[] getModeNames()
      Overrides:
      getModeNames in class Lexer
    • getTokenNames

      @Deprecated public 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 class Lexer
    • getVocabulary

      public Vocabulary getVocabulary()
      Description copied from class: Recognizer
      Get the vocabulary used by the recognizer.
      Overrides:
      getVocabulary in class Recognizer<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 the ATN used by the recognizer for prediction.
      Specified by:
      getATN in class Recognizer<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 interface TokenSource
      Overrides:
      nextToken in class Lexer
    • 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 interface TokenSource
      Overrides:
      getCharPositionInLine in class Lexer
      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 String matchID()
    • matchString

      public String matchString()
    • isNameChar

      public boolean isNameChar(int c)
    • isNameStartChar

      public boolean isNameStartChar(int c)