CommonToken

TODO add class description

Constructors

this
this(int type)

Constructs a new {@link CommonToken} with the specified token type.

this
this(TokenFactorySourcePair source, int type, int channel, size_t start, size_t stop)
Undocumented in source.
this
this(int type, Variant text)

Constructs a new {@link CommonToken} with the specified token type and text.

this
this(Token oldToken)

Constructs a new {@link CommonToken} as a copy of another {@link Token}. * <p> If {@code oldToken} is also a {@link CommonToken} instance, the newly constructed token will share a reference to the {@link #text} field and the {@link Pair} stored in {@link #source}. Otherwise, {@link #text} will be assigned the result of calling {@link #getText}, and {@link #source} will be constructed from the result of {@link Token#getTokenSource} and {@link Token#getInputStream}.</p>

Members

Functions

getChannel
int getChannel()

@uml @override

getCharPositionInLine
int getCharPositionInLine()

@uml @override

getInputStream
CharStream getInputStream()

@uml @override

getLine
int getLine()

@uml @override

getText
Variant getText()

@uml @override

getTokenIndex
size_t getTokenIndex()

@uml @override

getTokenSource
TokenSource getTokenSource()

@uml @override

getType
int getType()
Undocumented in source. Be warned that the author may not have intended to support it.
setChannel
void setChannel(int channel)

@uml @override

setCharPositionInLine
void setCharPositionInLine(int charPositionInLine)
Undocumented in source. Be warned that the author may not have intended to support it.
setLine
void setLine(int line)
Undocumented in source. Be warned that the author may not have intended to support it.
setText
void setText(Variant text)

Explicitly set the text for this token. If {code text} is not {@code null}, then {@link #getText} will return this value rather than extracting the text from the input.

setTokenIndex
void setTokenIndex(size_t index)

@uml @override

setType
void setType(int type)

@uml @override

startIndex
void startIndex(size_t startIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
startIndex
size_t startIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
stopIndex
size_t stopIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
stopIndex
void stopIndex(size_t stopIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()

@uml @override

Static variables

EMPTY_SOURCE
TokenFactorySourcePair EMPTY_SOURCE;

An empty {@link Pair} which is used as the default value of {@link #source} for tokens that do not have a source.

Variables

channel
int channel;

This is the backing field for {@link #getChannel} and {@link #setChannel}.

charPositionInLine
int charPositionInLine;

This is the backing field for {@link #getCharPositionInLine} and {@link #setCharPositionInLine}.

index
size_t index;

This is the backing field for {@link #getTokenIndex} and {@link #setTokenIndex}.

line
int line;

This is the backing field for {@link #getLine} and {@link #setLine}.

source
TokenFactorySourcePair source;

This is the backing field for {@link #getTokenSource} and {@link #getInputStream}.

startIndex_
size_t startIndex_;

This is the backing field for {@link #getStartIndex} and {@link #setStartIndex}. @uml @read @write

stopIndex_
size_t stopIndex_;

This is the backing field for {@link #getStopIndex} and {@link #setStopIndex}. @uml @read @write

text
Variant text;

This is the backing field for {@link #getText} when the token text is explicitly set in the constructor or via {@link #setText}.

type
int type;

This is the backing field for {@link #getType} and {@link #setType}.

Inherited Members

From WritableToken

setText
void setText(Variant text)
Undocumented in source.
setType
void setType(int ttype)
Undocumented in source.
setLine
void setLine(int line)
Undocumented in source.
setCharPositionInLine
void setCharPositionInLine(int charPositionInLine)
Undocumented in source.
setChannel
void setChannel(int channel)
Undocumented in source.
setTokenIndex
void setTokenIndex(size_t index)
Undocumented in source.

Meta