LPEX
4.4.0

com.ibm.lpex.cc
Class Token

java.lang.Object
  extended by com.ibm.lpex.cc.Token

public class Token
extends Object

Describes the input token stream.


Field Summary
 int beginColumn
          ONE-based position of the first character of this token.
 int beginLine
          Start element of this token.
 int endColumn
          ONE-based position of the last character of this token.
 int endLine
          End element of this token.
 String image
          The string image of the token, if generated.
 int kind
          An integer that describes the kind of this token.
 Token next
          Reference to the next regular (non-special) token from the input stream.
 Token specialToken
          Reference to special tokens that occur prior to this token, but after the immediately preceding regular (non-special) token.
 
Constructor Summary
Token()
           
 
Method Summary
static Token newToken(int ofKind)
          Returns a Token.
 String toString()
          Returns the image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

public int kind
An integer that describes the kind of this token. The numbering scheme is determined by the token-manager generator, and all token kinds are stored in the file ...Constants.java.


beginLine

public int beginLine
Start element of this token.


beginColumn

public int beginColumn
ONE-based position of the first character of this token.


endLine

public int endLine
End element of this token.


endColumn

public int endColumn
ONE-based position of the last character of this token.


image

public String image
The string image of the token, if generated.


next

public Token next
Reference to the next regular (non-special) token from the input stream.

The default implementation of method nextToken() in LPEX always returns the same static token, so this field is normally null.


specialToken

public Token specialToken
Reference to special tokens that occur prior to this token, but after the immediately preceding regular (non-special) token.

The implementation of this class in LPEX always returns the same static token, so this field is normally null.

Constructor Detail

Token

public Token()
Method Detail

toString

public final String toString()
Returns the image.

Overrides:
toString in class Object

newToken

public static final Token newToken(int ofKind)
Returns a Token. The implementation of this method in LPEX always returns one same static token (singleton).


LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.