edu.rice.cs.util.sexp
Class Lexer

java.lang.Object
  extended by java.io.StreamTokenizer
      extended by edu.rice.cs.util.sexp.Lexer

 class Lexer
extends StreamTokenizer


Field Summary
private  Tokens.SExpToken buffer
           
 HashMap<String,Tokens.SExpToken> wordTable
           
 
Fields inherited from class java.io.StreamTokenizer
nval, sval, TT_EOF, TT_EOL, TT_NUMBER, TT_WORD, ttype
 
Constructor Summary
Lexer(File file)
           
Lexer(Reader reader)
           
 
Method Summary
 void flush()
          Skips through the input stream until an EOL is encountered
private  int getToken()
          Performs a nextToken() operation from StreamTokenizer except for throwing an unchecked LexingException instead of a checked IOException
private  void initLexer()
           
private  void initWordTable()
          Initialize the word table used by the lexer to classify Tokens
 Tokens.SExpToken peek()
          Returns the next Tokens.SExpToken without consuming it
 Tokens.SExpToken readToken()
          Reads the next Tokens.SExpToken from the input stream and consumes it.
 
Methods inherited from class java.io.StreamTokenizer
commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wordTable

public HashMap<String,Tokens.SExpToken> wordTable

buffer

private Tokens.SExpToken buffer
Constructor Detail

Lexer

public Lexer(File file)
      throws FileNotFoundException
Throws:
FileNotFoundException

Lexer

public Lexer(Reader reader)
Method Detail

initLexer

private void initLexer()

flush

public void flush()
           throws IOException
Skips through the input stream until an EOL is encountered

Throws:
IOException

getToken

private int getToken()
Performs a nextToken() operation from StreamTokenizer except for throwing an unchecked LexingException instead of a checked IOException


peek

public Tokens.SExpToken peek()
Returns the next Tokens.SExpToken without consuming it


readToken

public Tokens.SExpToken readToken()
Reads the next Tokens.SExpToken from the input stream and consumes it.

Returns:
the Tokens.SExpToken object representing this Tokens.SExpToken

initWordTable

private void initWordTable()
Initialize the word table used by the lexer to classify Tokens