ConForM.CoopnTools.CoKer
Class LexicalToken

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.LexicalToken
Direct Known Subclasses:
LexicalAspectFileToken, LexicalCoalaFileToken, LexicalCocoFileToken, LexicalConsFileToken, LexicalCoopnFileToken, LexicalPackageFileToken, LexicalScenarioFileToken, LexicalSpecFileToken

public class LexicalToken
extends java.lang.Object

A lexical token for a CoopnTools lexical reader.


Field Summary
static int COMMENT
          Comment tag.
static int IDENTIFIER
          Identifier tag.
static int KEYWORD
          Reserved word tag.
static int NEWLINE
          Newline tag.
static int SPACE
          Space tag.
static int SYMBOL
          Symbol tag.
 
Constructor Summary
LexicalToken(int kind, java.lang.String image)
          Simple constructor.
 
Method Summary
 java.lang.String image()
          Retrieve the token image.
 int kind()
          Retrieve the token kind.
 java.lang.String prettyImage()
          Retrieve the pretty token image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACE

public static final int SPACE
Space tag.

NEWLINE

public static final int NEWLINE
Newline tag.

COMMENT

public static final int COMMENT
Comment tag.

SYMBOL

public static final int SYMBOL
Symbol tag.

KEYWORD

public static final int KEYWORD
Reserved word tag.

IDENTIFIER

public static final int IDENTIFIER
Identifier tag.
Constructor Detail

LexicalToken

public LexicalToken(int kind,
                    java.lang.String image)
Simple constructor.
Parameters:
kind - the token tag
image - a tring representing the image of the token
Method Detail

kind

public int kind()
Retrieve the token kind.
Returns:
the token tag

image

public java.lang.String image()
Retrieve the token image.
Returns:
the token image

prettyImage

public java.lang.String prettyImage()
Retrieve the pretty token image. The pretty image is the image of the token modified in the "normal form" according to the recommendations of the ConForM group for writting pretty CO-OPN sources.
Returns:
the token image, if possible, or else the image