ConForM.CoopnTools.CoKer
Class LexicalReader

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.LexicalReader
Direct Known Subclasses:
LexicalAspectFileReader, LexicalCoalaFileReader, LexicalCocoFileReader, LexicalConsFileReader, LexicalCoopnFileReader, LexicalPackageFileReader, LexicalScenarioFileReader, LexicalSpecFileReader

public abstract class LexicalReader
extends java.lang.Object

Lexical Reader. This class defines an abstract lexical reader. A lexical reader decompose an input stream in lexical tokens. It is likely to be considered as a special kinf of enumeration, an enumeration of lexical tokens.

See Also:
LexicalToken

Field Summary
protected  CoopnEnv env
           
protected  java.io.Reader reader
           
 
Constructor Summary
LexicalReader(CoopnEnv env, java.io.Reader reader)
          Simple constructor.
 
Method Summary
abstract  LexicalToken consultNextToken()
          Consult the next token.
abstract  boolean hasMoreTokens()
          Test the reader of more tokens.
abstract  LexicalToken nextToken()
          Consult and consume the next token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected java.io.Reader reader

env

protected CoopnEnv env
Constructor Detail

LexicalReader

public LexicalReader(CoopnEnv env,
                     java.io.Reader reader)
Simple constructor.
Parameters:
reader - the input reader
env - the environment
Method Detail

hasMoreTokens

public abstract boolean hasMoreTokens()
Test the reader of more tokens.
Returns:
true if the reader has more tokens

nextToken

public abstract LexicalToken nextToken()
Consult and consume the next token.
Returns:
the next token, or null if hasMoreTokens() is false

consultNextToken

public abstract LexicalToken consultNextToken()
Consult the next token.
Returns:
the next token, or null if hasMoreTokens() is false