インタフェース TopLevelClass.Token

すべてのスーパーインタフェース:
TopLevelClass.Node
既知の実装クラスの一覧:
TopLevelClass.Default.Token
含まれているクラス:
TopLevelClass

public static interface TopLevelClass.Token
extends TopLevelClass.Node

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.LexicalAnalyzers. 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., LexicalAnalyzers. Also, these methods may be unsuported and may throw UnsupportedOperationException.

導入されたバージョン:
notavaCC 1.0

メソッドの概要
 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
 

メソッドの詳細

getSymbolID

int getSymbolID()
Returns the kind of this token.

The result value should be one of the following:

valuedescribed token
TopLevelClass.EOF_TOKEN <EOF>
TopLevelClass.TOKEN_TERMINAL TERMINAL
others an instance of a terminal defined by STRING

戻り値:
the kind of this token.
導入されたバージョン:
notavaCC 1.0

isWhite

boolean isWhite()
Returnds true if this is a white token.

戻り値:
true if this is a while token.
導入されたバージョン:
notavaCC 1.0

getImage

java.lang.String getImage()
Returns the string 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().

戻り値:
the string this token corresponds to.
導入されたバージョン:
notavaCC 1.0
関連項目:
getOriginalImage()

getOriginalImage

java.lang.String getOriginalImage()
Returns the string 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().

戻り値:
the string this token corresponds to.
導入されたバージョン:
notavaCC 1.0
関連項目:
getImage()

getSourceName

java.lang.String getSourceName()
                               throws java.lang.UnsupportedOperationException
Returns the source name this token coressponds to.

戻り値:
the source name this token coressponds to.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.
導入されたバージョン:
notavaCC 1.0

getIndex

int getIndex()
             throws java.lang.UnsupportedOperationException
Returns the zero-based index number in the source where this token begins.

戻り値:
the index number in the source where this token begins.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.
導入されたバージョン:
notavaCC 1.0

getLine

int getLine()
            throws java.lang.UnsupportedOperationException
Returns the one-based line number in the source where this token begins.

戻り値:
the line number in the source where this token begins.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.
導入されたバージョン:
notavaCC 1.0

getColumn

int getColumn()
              throws java.lang.UnsupportedOperationException
Returns the one-based column number in the source where this token begins.

戻り値:
the column number in the source where this token begins.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.
導入されたバージョン:
notavaCC 1.0

toString

java.lang.String toString()
Returns the image and the position of this token if supported. For instance, `identifier' (line 2, column 3) or `identifier'. The format is not specified strictly.

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
the image and the parenthesized position of this token.
導入されたバージョン:
notavaCC 1.0