Class GrammarToken

  • All Implemented Interfaces:
    Serializable, org.antlr.runtime.Token

    public class GrammarToken
    extends org.antlr.runtime.CommonToken
    A CommonToken that can also track it's original location, derived from options on the element ref like BEGIN<line=34,...>.
    See Also:
    Serialized Form
    • Field Detail

      • originalTokenIndex

        public int originalTokenIndex
    • Constructor Detail

      • GrammarToken

        public GrammarToken​(Grammar g,
                            org.antlr.runtime.Token oldToken)
    • Method Detail

      • getCharPositionInLine

        public int getCharPositionInLine()
        Specified by:
        getCharPositionInLine in interface org.antlr.runtime.Token
        Overrides:
        getCharPositionInLine in class org.antlr.runtime.CommonToken
      • getLine

        public int getLine()
        Specified by:
        getLine in interface org.antlr.runtime.Token
        Overrides:
        getLine in class org.antlr.runtime.CommonToken
      • getTokenIndex

        public int getTokenIndex()
        Specified by:
        getTokenIndex in interface org.antlr.runtime.Token
        Overrides:
        getTokenIndex in class org.antlr.runtime.CommonToken
      • getStartIndex

        public int getStartIndex()
        Overrides:
        getStartIndex in class org.antlr.runtime.CommonToken
      • getStopIndex

        public int getStopIndex()
        Overrides:
        getStopIndex in class org.antlr.runtime.CommonToken
      • toString

        public String toString()
        Overrides:
        toString in class org.antlr.runtime.CommonToken