类 CommonToken
- java.lang.Object
-
- org.antlr.runtime.CommonToken
-
-
字段概要
字段 修饰符和类型 字段 说明 protected int
channel
protected int
charPositionInLine
protected int
index
What token number is this from 0..n-1 tokens; < 0 implies invalid indexprotected CharStream
input
protected int
line
protected int
start
The char position into the input buffer where this token startsprotected int
stop
The char position into the input buffer where this token stopsprotected java.lang.String
text
We need to be able to change the text once in a while.protected int
type
-
从接口继承的字段 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
-
-
构造器概要
构造器 构造器 说明 CommonToken(int type)
CommonToken(int type, java.lang.String text)
CommonToken(CharStream input, int type, int channel, int start, int stop)
CommonToken(Token oldToken)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
getChannel()
int
getCharPositionInLine()
The index of the first character relative to the beginning of the line 0..n-1CharStream
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..nint
getStartIndex()
int
getStopIndex()
java.lang.String
getText()
Get the text of the tokenint
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()
-
-
-
字段详细资料
-
type
protected int type
-
line
protected int line
-
charPositionInLine
protected int charPositionInLine
-
channel
protected int channel
-
input
protected transient CharStream input
-
text
protected java.lang.String text
We need to be able to change the text once in a while. If this is non-null, then getText should return this. Note that start/stop are not affected by changing this.
-
index
protected int index
What token number is this from 0..n-1 tokens; < 0 implies invalid index
-
start
protected int start
The char position into the input buffer where this token starts
-
stop
protected int stop
The char position into the input buffer where this token stops
-
-
构造器详细资料
-
CommonToken
public CommonToken(int type)
-
CommonToken
public CommonToken(CharStream input, int type, int channel, int start, int stop)
-
CommonToken
public CommonToken(int type, java.lang.String text)
-
CommonToken
public CommonToken(Token oldToken)
-
-
方法详细资料
-
getText
public java.lang.String getText()
从接口复制的说明:Token
Get the text of the token
-
setText
public void setText(java.lang.String text)
Override the text for this token. getText() will return this text rather than pulling from the buffer. Note that this does not mean that start/stop indexes are not valid. It means that that input was converted to a new string in the token object.
-
getLine
public int getLine()
从接口复制的说明:Token
The line number on which this token was matched; line=1..n
-
getCharPositionInLine
public int getCharPositionInLine()
从接口复制的说明:Token
The index of the first character relative to the beginning of the line 0..n-1- 指定者:
getCharPositionInLine
在接口中Token
-
setCharPositionInLine
public void setCharPositionInLine(int charPositionInLine)
- 指定者:
setCharPositionInLine
在接口中Token
-
getChannel
public int getChannel()
- 指定者:
getChannel
在接口中Token
-
setChannel
public void setChannel(int channel)
- 指定者:
setChannel
在接口中Token
-
getStartIndex
public int getStartIndex()
-
setStartIndex
public void setStartIndex(int start)
-
getStopIndex
public int getStopIndex()
-
setStopIndex
public void setStopIndex(int stop)
-
getTokenIndex
public int getTokenIndex()
从接口复制的说明:Token
An index from 0..n-1 of the token object in the input stream. This must be valid in order to use the ANTLRWorks debugger.- 指定者:
getTokenIndex
在接口中Token
-
setTokenIndex
public void setTokenIndex(int index)
- 指定者:
setTokenIndex
在接口中Token
-
getInputStream
public CharStream getInputStream()
从接口复制的说明:Token
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... on the input.- 指定者:
getInputStream
在接口中Token
-
setInputStream
public void setInputStream(CharStream input)
- 指定者:
setInputStream
在接口中Token
-
toString
public java.lang.String toString()
- 覆盖:
toString
在类中java.lang.Object
-
-