接口 Token
-
public interface Token
-
-
字段概要
字段 修饰符和类型 字段 说明 static int
DEFAULT_CHANNEL
All tokens go to the parser (unless skip() is called in that rule) on a particular "channel".static int
DOWN
imaginary tree navigation type; traverse "get child" linkstatic int
EOF
static Token
EOF_TOKEN
static int
EOR_TOKEN_TYPE
static int
HIDDEN_CHANNEL
Anything on different channel than DEFAULT_CHANNEL is not parsed by parser.static Token
INVALID_TOKEN
static int
INVALID_TOKEN_TYPE
static int
MIN_TOKEN_TYPE
static Token
SKIP_TOKEN
In an action, a lexer rule can set token to this SKIP_TOKEN and ANTLR will avoid creating a token for this symbol and try to fetch another.static int
UP
imaginary tree navigation type; finish with a child list
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 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..njava.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 pos)
void
setInputStream(CharStream input)
void
setLine(int line)
void
setText(java.lang.String text)
void
setTokenIndex(int index)
void
setType(int ttype)
-
-
-
字段详细资料
-
EOR_TOKEN_TYPE
static final int EOR_TOKEN_TYPE
- 另请参阅:
- 常量字段值
-
DOWN
static final int DOWN
imaginary tree navigation type; traverse "get child" link- 另请参阅:
- 常量字段值
-
UP
static final int UP
imaginary tree navigation type; finish with a child list- 另请参阅:
- 常量字段值
-
MIN_TOKEN_TYPE
static final int MIN_TOKEN_TYPE
- 另请参阅:
- 常量字段值
-
EOF
static final int EOF
- 另请参阅:
- 常量字段值
-
EOF_TOKEN
static final Token EOF_TOKEN
-
INVALID_TOKEN_TYPE
static final int INVALID_TOKEN_TYPE
- 另请参阅:
- 常量字段值
-
INVALID_TOKEN
static final Token INVALID_TOKEN
-
SKIP_TOKEN
static final Token SKIP_TOKEN
In an action, a lexer rule can set token to this SKIP_TOKEN and ANTLR will avoid creating a token for this symbol and try to fetch another.
-
DEFAULT_CHANNEL
static final int DEFAULT_CHANNEL
All tokens go to the parser (unless skip() is called in that rule) on a particular "channel". The parser tunes to a particular channel so that whitespace etc... can go to the parser on a "hidden" channel.- 另请参阅:
- 常量字段值
-
HIDDEN_CHANNEL
static final int HIDDEN_CHANNEL
Anything on different channel than DEFAULT_CHANNEL is not parsed by parser.- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
getText
java.lang.String getText()
Get the text of the token
-
setText
void setText(java.lang.String text)
-
getType
int getType()
-
setType
void setType(int ttype)
-
getLine
int getLine()
The line number on which this token was matched; line=1..n
-
setLine
void setLine(int line)
-
getCharPositionInLine
int getCharPositionInLine()
The index of the first character relative to the beginning of the line 0..n-1
-
setCharPositionInLine
void setCharPositionInLine(int pos)
-
getChannel
int getChannel()
-
setChannel
void setChannel(int channel)
-
getTokenIndex
int getTokenIndex()
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.
-
setTokenIndex
void setTokenIndex(int index)
-
getInputStream
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... on the input.
-
setInputStream
void setInputStream(CharStream input)
-
-