org.ourgrid.common.spec.lexical
Interface LexicalAnalyzer

All Known Implementing Classes:
CommonLexicalAnalyzer

public interface LexicalAnalyzer


Method Summary
 Token getToken()
          This is the main function of the lexical analyzer.
 Token getToken(TokenDelimiter delimiters)
          It will read the next string from source and return the token it represents.
 

Method Detail

getToken

Token getToken()
               throws LexicalException
This is the main function of the lexical analyzer. It will read the next string from source and return the token it represents ( the string, the code it has and the line it was found ).

Returns:
The next valid token object and null if the source finished
Throws:
LexicalException

getToken

Token getToken(TokenDelimiter delimiters)
               throws LexicalException
It will read the next string from source and return the token it represents. This method uses the given set of delimiters to know where the token stops.

Parameters:
delimiters - the set of delimiters that determines the end of token.
Returns:
A token where the token's symbol is the string read.
Throws:
LexicalException - if a I/O problem ocurres at the reader