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
ConstructorsConstructorDescriptionCodeUnitToken(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.CodeUnitToken(CodeUnitToken oldToken) Creates a copy of an existing CodeUnitToken. -
Method Summary
Modifier and TypeMethodDescriptionintintintvoidsetCodeUnitPositionInLine(int codeUnitPositionInLine) voidsetCodeUnitStart(int codeUnitStart) voidsetCodeUnitStop(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
-
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 streamtype- the token typechannel- the token channelstart- the start index in the input streamstop- the stop index in the input streamcodeUnitStart- the start position in code unitscodeUnitStop- the end position in code unitscodeUnitPositionInLine- the character position in line (in code units)
-
CodeUnitToken
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)
-