Package jminusminus
Class Scanner
java.lang.Object
jminusminus.Scanner
A lexical analyzer for j--, that has no backtracking mechanism.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if an error has occurred, and false otherwise.fileName()
Returns the name of the source file.Scans and returns the next token from input.
-
Field Details
-
EOFCH
public static final char EOFCH- See Also:
-
-
Constructor Details
-
Scanner
Constructs a Scanner from a file name.- Parameters:
fileName
- name of the source file.- Throws:
FileNotFoundException
- when the named file cannot be found.
-
-
Method Details
-
getNextToken
Scans and returns the next token from input.- Returns:
- the next scanned token.
-
errorHasOccurred
public boolean errorHasOccurred()Returns true if an error has occurred, and false otherwise.- Returns:
- true if an error has occurred, and false otherwise.
-
fileName
Returns the name of the source file.- Returns:
- the name of the source file.
-