| Modifier and Type | Field and Description |
|---|---|
| protected int | channel
This is the backing field for |
| protected int | charPositionInLine
This is the backing field for |
| protected static final Tuple2 | EMPTY_SOURCE
An empty |
| protected int | index
This is the backing field for |
| protected int | |
| private static final long | |
| protected Tuple2 | source
This is the backing field for |
| protected int | start
This is the backing field for |
| protected int | stop
This is the backing field for |
| protected String | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CommonToken(Tuple2<? extends TokenSource, CharStream> source, int type, int channel, int start, int stop)
|
| public | CommonToken(int
The token type. type, String The text of the token. text)Constructs a new |
| public | CommonToken(Token
The token to copy. oldToken)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | getCharPositionInLine()
Implements org. |
| public CharStream | getInputStream()
Implements org. CharStream from which this token was derived.
|
| public int | getLine()
Implements org. |
| public int | getStartIndex()
Implements org. |
| public int | getStopIndex()
Implements org. |
| public String | |
| public int | getTokenIndex()
Implements org. |
| public TokenSource | getTokenSource()
Implements org. TokenSource which created this token.
|
| public int | |
| public void | |
| public void | setCharPositionInLine(int charPositionInLine)
Implements org. |
| public void | |
| public void | |
| public void | |
| public void | setText(String
The explicit text of the token, or text)null if the text
should be obtained from the input along with the start and stop indexes
of the token.Implements org. |
| public void | |
| public void | |
| public String | |
| public String |
| channel | back to summary |
|---|---|
| protected int channel This is the backing field for | |
| charPositionInLine | back to summary |
|---|---|
| protected int charPositionInLine This is the backing field for | |
| EMPTY_SOURCE | back to summary |
|---|---|
| protected static final Tuple2<TokenSource, CharStream> EMPTY_SOURCE An empty | |
| index | back to summary |
|---|---|
| protected int index This is the backing field for | |
| line | back to summary |
|---|---|
| protected int line | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| source | back to summary |
|---|---|
| protected Tuple2<? extends TokenSource, CharStream> source This is the backing field for
These properties share a field to reduce the memory footprint of
| |
| start | back to summary |
|---|---|
| protected int start This is the backing field for | |
| stop | back to summary |
|---|---|
| protected int stop This is the backing field for | |
| text | back to summary |
|---|---|
| protected String text This is the backing field for
| |
| type | back to summary |
|---|---|
| protected int type | |
| CommonToken | back to summary |
|---|---|
| public CommonToken(int type) Constructs a new
| |
| CommonToken | back to summary |
|---|---|
| public CommonToken(Tuple2<? extends TokenSource, CharStream> source, int type, int channel, int start, int stop) | |
| CommonToken | back to summary |
|---|---|
| public CommonToken(int type, String text) Constructs a new
| |
| CommonToken | back to summary |
|---|---|
| public CommonToken(Token oldToken) Constructs a new
If
| |
| getChannel | back to summary |
|---|---|
| public int getChannel() Implements org. Doc from org. Return the channel this token. Each token can arrive at the parser on a different channel, but the parser only "tunes" to a single channel. The parser ignores everything not on DEFAULT_CHANNEL.
| |
| getCharPositionInLine | back to summary |
|---|---|
| public int getCharPositionInLine() Implements org. Doc from org. The index of the first character of this token relative to the beginning of the line at which it occurs, 0..n-1
| |
| getInputStream | back to summary |
|---|---|
| public CharStream getInputStream() Implements org. Doc from org. Gets the
| |
| getLine | back to summary |
|---|---|
| public int getLine() Implements org. Doc from org. The line number on which the 1st character of this token was matched, line=1..n
| |
| getStartIndex | back to summary |
|---|---|
| public int getStartIndex() Implements org. Doc from org. The starting character index of the token This method is optional; return -1 if not implemented.
| |
| getStopIndex | back to summary |
|---|---|
| public int getStopIndex() Implements org. Doc from org. The last character index of the token. This method is optional; return -1 if not implemented.
| |
| getText | back to summary |
|---|---|
| public String getText() Implements org. Doc from org. Get the text of the token.
| |
| getTokenIndex | back to summary |
|---|---|
| public int getTokenIndex() Implements org. Doc from org. An index from 0..n-1 of the token object in the input stream. This must be valid in order to print token streams and use TokenRewriteStream. Return -1 to indicate that this token was conjured up since it doesn't have a valid index.
| |
| getTokenSource | back to summary |
|---|---|
| public TokenSource getTokenSource() Implements org. Doc from org. Gets the
| |
| getType | back to summary |
|---|---|
| public int getType() Implements org. Doc from org. Get the token type of the token
| |
| setChannel | back to summary |
|---|---|
| public void setChannel(int channel) Implements org.
| |
| setCharPositionInLine | back to summary |
|---|---|
| public void setCharPositionInLine(int charPositionInLine) Implements org.
| |
| setLine | back to summary |
|---|---|
| public void setLine(int line) Implements org.
| |
| setStartIndex | back to summary |
|---|---|
| public void setStartIndex(int start) | |
| setStopIndex | back to summary |
|---|---|
| public void setStopIndex(int stop) | |
| setText | back to summary |
|---|---|
| public void setText(String text) Implements org. Explicitly set the text for this token. If {code text} is not
| |
| setTokenIndex | back to summary |
|---|---|
| public void setTokenIndex(int index) Implements org.
| |
| setType | back to summary |
|---|---|
| public void setType(int type) Implements org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| toString | back to summary |
|---|---|
| public String toString(Recognizer<?, ?> r) | |