edu.rice.cs.util.sexp
Class Lexer
java.lang.Object
java.io.StreamTokenizer
edu.rice.cs.util.sexp.Lexer
class Lexer
- extends StreamTokenizer
|
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 |
wordTable
public HashMap<String,Tokens.SExpToken> wordTable
buffer
private Tokens.SExpToken buffer
Lexer
public Lexer(File file)
throws FileNotFoundException
- Throws:
FileNotFoundException
Lexer
public Lexer(Reader reader)
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