类 ClassicToken
- java.lang.Object
-
- org.antlr.runtime.ClassicToken
-
- 所有已实现的接口:
Token
public class ClassicToken extends java.lang.Object implements Token
A Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object. These objects are needed for imaginary tree nodes that have payload objects. We need to create a Token object that has a string; the tree node will point at this token. CommonToken has indexes into a char stream and hence cannot be used to introduce new strings.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected intchannelprotected intcharPositionInLineprotected intindexWhat token number is this from 0..n-1 tokensprotected intlineprotected java.lang.Stringtextprotected inttype-
从接口继承的字段 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
-
-
构造器概要
构造器 构造器 说明 ClassicToken(int type)ClassicToken(int type, java.lang.String text)ClassicToken(int type, java.lang.String text, int channel)ClassicToken(Token oldToken)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intgetChannel()intgetCharPositionInLine()The index of the first character relative to the beginning of the line 0..n-1CharStreamgetInputStream()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...intgetLine()The line number on which this token was matched; line=1..njava.lang.StringgetText()Get the text of the tokenintgetTokenIndex()An index from 0..n-1 of the token object in the input stream.intgetType()voidsetChannel(int channel)voidsetCharPositionInLine(int charPositionInLine)voidsetInputStream(CharStream input)voidsetLine(int line)voidsetText(java.lang.String text)voidsetTokenIndex(int index)voidsetType(int type)java.lang.StringtoString()
-
-
-
构造器详细资料
-
ClassicToken
public ClassicToken(int type)
-
ClassicToken
public ClassicToken(Token oldToken)
-
ClassicToken
public ClassicToken(int type, java.lang.String text)
-
ClassicToken
public ClassicToken(int type, java.lang.String text, int channel)
-
-
方法详细资料
-
getText
public java.lang.String getText()
从接口复制的说明:TokenGet the text of the token
-
getLine
public int getLine()
从接口复制的说明:TokenThe line number on which this token was matched; line=1..n
-
getCharPositionInLine
public int getCharPositionInLine()
从接口复制的说明:TokenThe 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
-
getTokenIndex
public int getTokenIndex()
从接口复制的说明:TokenAn 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()
从接口复制的说明:TokenFrom 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
-
-