|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
public static interface TopLevelClass.Token
A token, which is a fragment of a parsed text.
A token is a fragment of a parsed text (a source). Tokens are usually constructed by TopLevelClass.LexicalAnalyzer
s. This class introduces the methods that represent what is the source of the token and where the token is placed in the source (getSourceName()
, getIndex()
, getLine()
, getColumn()
), however, the strict specification of the returned value is defined by the generator of the token, e.g., LexicalAnalyzer
s. Also, these methods may be unsuported and may throw UnsupportedOperationException
.
メソッドの概要 | |
---|---|
int |
getColumn()
Returns the one-based column number in the source where this token begins. |
java.lang.String |
getImage()
Returns the string this token corresponds to. |
int |
getIndex()
Returns the zero-based index number in the source where this token begins. |
int |
getLine()
Returns the one-based line number in the source where this token begins. |
java.lang.String |
getOriginalImage()
Returns the string this token corresponds to. |
java.lang.String |
getSourceName()
Returns the source name this token coressponds to. |
int |
getSymbolID()
Returns the kind of this token. |
boolean |
isWhite()
Returnds true if this is a white token. |
java.lang.String |
toString()
Returns the image and the position of this token if supported. |
インタフェース TopLevelClass.Node から継承されたメソッド |
---|
getChildNodes |
メソッドの詳細 |
---|
int getSymbolID()
this
token.
The result value should be one of the following:
value | described token |
---|---|
TopLevelClass.EOF_TOKEN |
<EOF> |
TopLevelClass.TOKEN_TERMINAL |
TERMINAL |
others | an instance of a terminal defined by STRING |
this
token.boolean isWhite()
true
if this
is a white token.
true
if this
is a while token.java.lang.String getImage()
this
token corresponds to.
If the string contains some meta notation like Unicode escapes, the returned value is the represented string (e.g., A) rather than the representation (e.g., \u0041). If not, the returned value is the same as getOriginalImage()
.
this
token corresponds to.getOriginalImage()
java.lang.String getOriginalImage()
this
token corresponds to.
If the string contains some meta notation like Unicode escapes, the returned value is the representation (e.g., \u0041) rather than the represented string (e.g., A). If not, the returned value is the same as getImage()
.
this
token corresponds to.getImage()
java.lang.String getSourceName() throws java.lang.UnsupportedOperationException
this
token coressponds to.
this
token coressponds to.
java.lang.UnsupportedOperationException
- if the method is not suported.int getIndex() throws java.lang.UnsupportedOperationException
this
token begins.
this
token begins.
java.lang.UnsupportedOperationException
- if the method is not suported.int getLine() throws java.lang.UnsupportedOperationException
this
token begins.
this
token begins.
java.lang.UnsupportedOperationException
- if the method is not suported.int getColumn() throws java.lang.UnsupportedOperationException
this
token begins.
this
token begins.
java.lang.UnsupportedOperationException
- if the method is not suported.java.lang.String toString()
this
token if supported.
For instance, `identifier' (line 2, column 3)
or `identifier'
.
The format is not specified strictly.
java.lang.Object
内の toString
this
token.
|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |