Interface LexicalAnalyzer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
hasNext()
Determines if a next token is available on the input at the current lexer position.default java.util.Iterator<Token>
iterator()
Token
next()
Parse next token.void
reset(java.io.InputStream input)
Reset this lexical analyzer with new input.void
reset(java.lang.String input)
Reset this lexical analyzer with new input.
-
-
-
Method Detail
-
next
Token next()
Parse next token.- Returns:
- next token, or Token.EOF if no token is available on the input
-
hasNext
boolean hasNext()
Determines if a next token is available on the input at the current lexer position.- Returns:
- true if the lexer has a next token to be parsed
-
reset
void reset(java.io.InputStream input) throws java.io.IOException
Reset this lexical analyzer with new input.- Parameters:
input
- new program source code- Throws:
java.io.IOException
- when input cannot be read
-
reset
void reset(java.lang.String input)
Reset this lexical analyzer with new input.- Parameters:
input
- new program source code
-
-