class Scanner extends Object
Modifier and Type | Field and Description |
---|---|
static char |
EOFCH
End of file character.
|
Constructor and Description |
---|
Scanner(String fileName)
Construct a Scanner object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
errorHasOccurred()
Has an error occurred up to now in lexical analysis?
|
String |
fileName()
The name of the source file.
|
TokenInfo |
getNextToken()
Scan the next token from input.
|
public static final char EOFCH
public Scanner(String fileName) throws FileNotFoundException
fileName
- the name of the file containing the source.FileNotFoundException
- when the named file cannot be found.public TokenInfo getNextToken()
public boolean errorHasOccurred()
public String fileName()