|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.runtime.CommonToken
public class CommonToken
Field Summary | |
---|---|
protected int |
channel
|
protected int |
charPositionInLine
|
protected int |
index
What token number is this from 0..n-1 tokens; < 0 implies invalid index |
protected CharStream |
input
|
protected int |
line
|
protected int |
start
The char position into the input buffer where this token starts |
protected int |
stop
The char position into the input buffer where this token stops |
protected java.lang.String |
text
We need to be able to change the text once in a while. |
protected int |
type
|
Fields inherited from interface org.antlr.runtime.Token |
---|
DEFAULT_CHANNEL, DOWN, EOF, EOF_TOKEN, EOR_TOKEN_TYPE, HIDDEN_CHANNEL, INVALID_TOKEN, INVALID_TOKEN_TYPE, MIN_TOKEN_TYPE, SKIP_TOKEN, UP |
Constructor Summary | |
---|---|
CommonToken(CharStream input,
int type,
int channel,
int start,
int stop)
|
|
CommonToken(int type)
|
|
CommonToken(int type,
java.lang.String text)
|
|
CommonToken(Token oldToken)
|
Method Summary | |
---|---|
int |
getChannel()
|
int |
getCharPositionInLine()
The index of the first character relative to the beginning of the line 0..n-1 |
CharStream |
getInputStream()
From what character stream was this token created? You don't have to implement but it's nice to know where a Token comes from if you have include files etc... |
int |
getLine()
The line number on which this token was matched; line=1..n |
int |
getStartIndex()
|
int |
getStopIndex()
|
java.lang.String |
getText()
Get the text of the token |
int |
getTokenIndex()
An index from 0..n-1 of the token object in the input stream. |
int |
getType()
|
void |
setChannel(int channel)
|
void |
setCharPositionInLine(int charPositionInLine)
|
void |
setInputStream(CharStream input)
|
void |
setLine(int line)
|
void |
setStartIndex(int start)
|
void |
setStopIndex(int stop)
|
void |
setText(java.lang.String text)
Override the text for this token. |
void |
setTokenIndex(int index)
|
void |
setType(int type)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int type
protected int line
protected int charPositionInLine
protected int channel
protected transient CharStream input
protected java.lang.String text
protected int index
protected int start
protected int stop
Constructor Detail |
---|
public CommonToken(int type)
public CommonToken(CharStream input, int type, int channel, int start, int stop)
public CommonToken(int type, java.lang.String text)
public CommonToken(Token oldToken)
Method Detail |
---|
public int getType()
getType
in interface Token
public void setLine(int line)
setLine
in interface Token
public java.lang.String getText()
Token
getText
in interface Token
public void setText(java.lang.String text)
setText
in interface Token
public int getLine()
Token
getLine
in interface Token
public int getCharPositionInLine()
Token
getCharPositionInLine
in interface Token
public void setCharPositionInLine(int charPositionInLine)
setCharPositionInLine
in interface Token
public int getChannel()
getChannel
in interface Token
public void setChannel(int channel)
setChannel
in interface Token
public void setType(int type)
setType
in interface Token
public int getStartIndex()
public void setStartIndex(int start)
public int getStopIndex()
public void setStopIndex(int stop)
public int getTokenIndex()
Token
getTokenIndex
in interface Token
public void setTokenIndex(int index)
setTokenIndex
in interface Token
public CharStream getInputStream()
Token
getInputStream
in interface Token
public void setInputStream(CharStream input)
setInputStream
in interface Token
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |