クラス TopLevelClass.Default.Token

java.lang.Object
  上位を拡張 TopLevelClass.Default.Node
      上位を拡張 TopLevelClass.Default.Token
すべての実装されたインタフェース:
TopLevelClass.Node, TopLevelClass.Token
含まれているインタフェース:
TopLevelClass.Default

public static class TopLevelClass.Default.Token
extends TopLevelClass.Default.Node
implements TopLevelClass.Token

Provides a simple implementation of TopLevelClass.Token.

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

コンストラクタの概要
TopLevelClass.Default.Token(int symbolID, java.lang.String image)
          Constructs a token.
TopLevelClass.Default.Token(int symbolID, java.lang.String image, java.lang.String originalImage, java.lang.String sourceName, int index, int line, int column)
          Constructs a token.
TopLevelClass.Default.Token(int symbolID, java.lang.String image, java.lang.String originalImage, TopLevelClass.Token token)
          Constructs a token.
 
メソッドの概要
 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.Default.Node から継承されたメソッド
getChildNodes, replaceChild
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース TopLevelClass.Node から継承されたメソッド
getChildNodes
 

コンストラクタの詳細

TopLevelClass.Default.Token

public TopLevelClass.Default.Token(int symbolID,
                                   java.lang.String image)
Constructs a token.

パラメータ:
symbolID - the symbol ID of the token, returned by getSymbolID.
image - the image string, returned by getImage and getOriginalImage.
導入されたバージョン:
notavaCC 1.0

TopLevelClass.Default.Token

public TopLevelClass.Default.Token(int symbolID,
                                   java.lang.String image,
                                   java.lang.String originalImage,
                                   java.lang.String sourceName,
                                   int index,
                                   int line,
                                   int column)
Constructs a token.

パラメータ:
symbolID - the symbol ID of the token, returned by getSymbolID.
image - the image string, returned by getImage.
originalImage - the image string, returned by getOriginalImage.
sourceName - the source name returned by getSourceName, or null if not supported.
index - the index returned by getIndex, or -1 if not supported.
line - the line number returned by getLine, or -1 if not supported.
column - the column number returned by getColumn, or -1 if not supported.
導入されたバージョン:
notavaCC 1.0

TopLevelClass.Default.Token

public TopLevelClass.Default.Token(int symbolID,
                                   java.lang.String image,
                                   java.lang.String originalImage,
                                   TopLevelClass.Token token)
Constructs a token.

パラメータ:
symbolID - the symbol ID of the token, returned by getSymbolID.
image - the image string, returned by getImage.
originalImage - the image string, returned by getOriginalImage.
token - a token that gives the returned value of getSourceName, getIndex, getLine and getColumn.
導入されたバージョン:
notavaCC 1.0
メソッドの詳細

getSymbolID

public int getSymbolID()
インタフェース TopLevelClass.Token の記述:
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

定義:
インタフェース TopLevelClass.Token 内の getSymbolID
戻り値:
the kind of this token.

isWhite

public boolean isWhite()
インタフェース TopLevelClass.Token の記述:
Returnds true if this is a white token.

定義:
インタフェース TopLevelClass.Token 内の isWhite
戻り値:
true if this is a while token.

getImage

public java.lang.String getImage()
インタフェース TopLevelClass.Token の記述:
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 TopLevelClass.Token.getOriginalImage().

定義:
インタフェース TopLevelClass.Token 内の getImage
戻り値:
the string this token corresponds to.
関連項目:
TopLevelClass.Token.getOriginalImage()

getOriginalImage

public java.lang.String getOriginalImage()
インタフェース TopLevelClass.Token の記述:
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 TopLevelClass.Token.getImage().

定義:
インタフェース TopLevelClass.Token 内の getOriginalImage
戻り値:
the string this token corresponds to.
関連項目:
TopLevelClass.Token.getImage()

getSourceName

public java.lang.String getSourceName()
                               throws java.lang.UnsupportedOperationException
インタフェース TopLevelClass.Token の記述:
Returns the source name this token coressponds to.

定義:
インタフェース TopLevelClass.Token 内の getSourceName
戻り値:
the source name this token coressponds to.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.

getIndex

public int getIndex()
             throws java.lang.UnsupportedOperationException
インタフェース TopLevelClass.Token の記述:
Returns the zero-based index number in the source where this token begins.

定義:
インタフェース TopLevelClass.Token 内の getIndex
戻り値:
the index number in the source where this token begins.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.

getLine

public int getLine()
            throws java.lang.UnsupportedOperationException
インタフェース TopLevelClass.Token の記述:
Returns the one-based line number in the source where this token begins.

定義:
インタフェース TopLevelClass.Token 内の getLine
戻り値:
the line number in the source where this token begins.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.

getColumn

public int getColumn()
              throws java.lang.UnsupportedOperationException
インタフェース TopLevelClass.Token の記述:
Returns the one-based column number in the source where this token begins.

定義:
インタフェース TopLevelClass.Token 内の getColumn
戻り値:
the column number in the source where this token begins.
例外:
java.lang.UnsupportedOperationException - if the method is not suported.

toString

public java.lang.String toString()
インタフェース TopLevelClass.Token の記述:
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.

定義:
インタフェース TopLevelClass.Token 内の toString
オーバーライド:
クラス TopLevelClass.Default.Node 内の toString
戻り値:
the image and the parenthesized position of this token.