Class CodeUnitToken

java.lang.Object
org.antlr.v4.runtime.CommonToken
org.pgcodekeeper.core.database.base.parser.CodeUnitToken
All Implemented Interfaces:
Serializable, org.antlr.v4.runtime.Token, org.antlr.v4.runtime.WritableToken

public class CodeUnitToken extends org.antlr.v4.runtime.CommonToken
Extended token class that tracks additional position information for accurate source mapping in code units.
See Also:
  • Field Summary

    Fields inherited from interface org.antlr.v4.runtime.Token

    DEFAULT_CHANNEL, EOF, EPSILON, HIDDEN_CHANNEL, INVALID_TYPE, MIN_USER_CHANNEL_VALUE, MIN_USER_TOKEN_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    CodeUnitToken(org.antlr.v4.runtime.misc.Pair<org.antlr.v4.runtime.TokenSource,org.antlr.v4.runtime.CharStream> source, int type, int channel, int start, int stop, int codeUnitStart, int codeUnitStop, int codeUnitPositionInLine)
    Creates a new CodeUnitToken with detailed position information.
    Creates a copy of an existing CodeUnitToken.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    int
     
    int
     
    void
    setCodeUnitPositionInLine(int codeUnitPositionInLine)
     
    void
    setCodeUnitStart(int codeUnitStart)
     
    void
    setCodeUnitStop(int codeUnitStop)
     

    Methods inherited from class org.antlr.v4.runtime.CommonToken

    getChannel, getCharPositionInLine, getInputStream, getLine, getStartIndex, getStopIndex, getText, getTokenIndex, getTokenSource, getType, setChannel, setCharPositionInLine, setLine, setStartIndex, setStopIndex, setText, setTokenIndex, setType, toString, toString

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CodeUnitToken

      public CodeUnitToken(org.antlr.v4.runtime.misc.Pair<org.antlr.v4.runtime.TokenSource,org.antlr.v4.runtime.CharStream> source, int type, int channel, int start, int stop, int codeUnitStart, int codeUnitStop, int codeUnitPositionInLine)
      Creates a new CodeUnitToken with detailed position information.
      Parameters:
      source - the token source and input stream
      type - the token type
      channel - the token channel
      start - the start index in the input stream
      stop - the stop index in the input stream
      codeUnitStart - the start position in code units
      codeUnitStop - the end position in code units
      codeUnitPositionInLine - the character position in line (in code units)
    • CodeUnitToken

      public CodeUnitToken(CodeUnitToken oldToken)
      Creates a copy of an existing CodeUnitToken.
      Parameters:
      oldToken - the token to copy
  • Method Details

    • getCodeUnitStart

      public int getCodeUnitStart()
    • getCodeUnitStop

      public int getCodeUnitStop()
    • getCodeUnitPositionInLine

      public int getCodeUnitPositionInLine()
    • setCodeUnitStart

      public void setCodeUnitStart(int codeUnitStart)
    • setCodeUnitStop

      public void setCodeUnitStop(int codeUnitStop)
    • setCodeUnitPositionInLine

      public void setCodeUnitPositionInLine(int codeUnitPositionInLine)