String objects.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final String | |
| private boolean | |
| private final Reader | |
| private static final Set | |
| private static final Set | |
| private int | |
| private int | |
| private int | |
| private int | |
| private final StringBuilder | sb
Holds the characters of the currently scanned token. |
| public static final String | SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR
If the source code is not read from a file, debuggers have a hard time locating the source file for source-level debugging. |
| public static final String | SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE
Setting this system property to 'true' enables source-level debugging. |
| public static final String | SYSTEM_PROPERTY_SOURCE_DEBUGGING_KEEP
If set to "true", then the temporary source code files are not deleted on exit. |
| private int | tokenColumnNumber
Column number of the first character of the previously produced token (1 if token is immediately preceded by a line break). |
| private int | tokenLineNumber
Line number of the previously produced token (typically starting at one). |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | Scanner(String fileName, InputStream is)
Sets up a scanner that reads tokens from the given |
| public | Scanner(String fileName, InputStream is, String encoding)
Sets up a scanner that reads tokens from the given |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Deprecated
This method is deprecated, because the concept described above is confusing.
Closes the character source (file, InputStream, Reader) associated with this object.
|
| public String | |
| private int | |
| private static boolean | |
| private static boolean | isDecimalDigit(int c)
To comply with the JLS, this method does not allow for non-latin digit (like |
| private static boolean | isHexDigit(int c)
To comply with the JLS, this method does not allow for non-latin digit (like |
| private static boolean | |
| public Location | |
| private int | Returns: -1 iff there is no next character, i.e the input stream is at end-of-inputReturns the next character, but does not consume it. |
| private boolean | |
| private int | |
| private boolean | Returns: Whether the next character equalled the expected characterConsumes the next character iff it equals the expected character. |
| private boolean | |
| public Token | |
| private char | |
| private TokenType | |
| private void | |
| private TokenType | |
| public void | setIgnoreWhiteSpace(boolean value)
If value is |
| private Token |
| crLfPending | back to summary |
|---|---|
| private boolean crLfPending | |
| fileName | back to summary |
|---|---|
| private final String fileName
| |
| ignoreWhiteSpace | back to summary |
|---|---|
| private boolean ignoreWhiteSpace | |
| in | back to summary |
|---|---|
| private final Reader in | |
| JAVA_KEYWORDS | back to summary |
|---|---|
| private static final Set<String> JAVA_KEYWORDS | |
| JAVA_OPERATORS | back to summary |
|---|---|
| private static final Set<String> JAVA_OPERATORS | |
| nextButOneChar | back to summary |
|---|---|
| private int nextButOneChar | |
| nextChar | back to summary |
|---|---|
| private int nextChar | |
| nextCharColumnNumber | back to summary |
|---|---|
| private int nextCharColumnNumber | |
| nextCharLineNumber | back to summary |
|---|---|
| private int nextCharLineNumber | |
| sb | back to summary |
|---|---|
| private final StringBuilder sb Holds the characters of the currently scanned token. | |
| SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR | back to summary |
|---|---|
| public static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR If the source code is not read from a file, debuggers have a hard time locating the source file for source-level debugging. As a workaround, a copy of the source code is written to a temporary file, which must be included in the debugger's source path. If this system property is set, the temporary source file is created in that directory, otherwise in the default temporary-file directory. | |
| SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE | back to summary |
|---|---|
| public static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE Setting this system property to 'true' enables source-level debugging. Typically, this means that compilation
is executed with " | |
| SYSTEM_PROPERTY_SOURCE_DEBUGGING_KEEP | back to summary |
|---|---|
| public static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_KEEP If set to "true", then the temporary source code files are not deleted on exit. That may be useful to interpret stack traces offline. | |
| tokenColumnNumber | back to summary |
|---|---|
| private int tokenColumnNumber Column number of the first character of the previously produced token (1 if token is immediately preceded by a line break). | |
| tokenLineNumber | back to summary |
|---|---|
| private int tokenLineNumber Line number of the previously produced token (typically starting at one). | |
| Scanner | back to summary |
|---|---|
| public Scanner(String fileName) throws IOException
Deprecated This method is deprecated because it leaves the input file open
| |
| Scanner | back to summary |
|---|---|
| public Scanner(String fileName, String encoding) throws IOException
Deprecated This method is deprecated because it leaves the input file open
| |
| Scanner | back to summary |
|---|---|
| public Scanner(File file) throws IOException
Deprecated This method is deprecated because it leaves the input file open
| |
| Scanner | back to summary |
|---|---|
| public Scanner(File file, String encoding) throws IOException
Deprecated This method is deprecated because it leaves the input file open
| |
| Scanner | back to summary |
|---|---|
| public Scanner(String fileName, InputStream is) throws IOException Sets up a scanner that reads tokens from the given The fileName is solely used for reporting in thrown exceptions. | |
| Scanner | back to summary |
|---|---|
| public Scanner(String fileName, InputStream is, String encoding) throws IOException Sets up a scanner that reads tokens from the given
The fileName is used for reporting errors during compilation and for source level
debugging, and should name an existing file. If | |
| Scanner | back to summary |
|---|---|
| public Scanner(String fileName, Reader in) throws IOException Sets up a scanner that reads tokens from the given
The fileName is used for reporting errors during compilation and for source level
debugging, and should name an existing file. If | |
| Scanner | back to summary |
|---|---|
| public Scanner(String fileName, Reader in, int initialLineNumber, int initialColumnNumber) throws IOException Creates a | |
| close | back to summary |
|---|---|
| public void close() throws IOException
Deprecated This method is deprecated, because the concept described above is confusing. An application should
close the underlying Closes the character source (file,
| |
| getFileName | back to summary |
|---|---|
| public String getFileName() | |
| internalRead | back to summary |
|---|---|
private int internalRead() throws IOException, CompileException
| |
| isBinaryDigit | back to summary |
|---|---|
| private static boolean isBinaryDigit(int c) | |
| isDecimalDigit | back to summary |
|---|---|
| private static boolean isDecimalDigit(int c) To comply with the JLS, this method does not allow for non-latin digit (like | |
| isHexDigit | back to summary |
|---|---|
| private static boolean isHexDigit(int c) To comply with the JLS, this method does not allow for non-latin digit (like | |
| isOctalDigit | back to summary |
|---|---|
| private static boolean isOctalDigit(int c) | |
| location | back to summary |
|---|---|
| public Location location() | |
| peek | back to summary |
|---|---|
| private int peek() throws CompileException, IOException Returns the next character, but does not consume it.
| |
| peek | back to summary |
|---|---|
| private boolean peek(String expectedCharacters) throws CompileException, IOException Checks whether the next character is one of the expectedCharacters.
It is not possible to peek exactly for "end-of-input"; use | |
| peekButOne | back to summary |
|---|---|
| private int peekButOne() throws CompileException, IOException Returns the next-but-one character, but does not consume any characters. | |
| peekRead | back to summary |
|---|---|
| private boolean peekRead(int expected) throws CompileException, IOException Consumes the next character iff it equals the expected character.
| |
| peekRead | back to summary |
|---|---|
| private boolean peekRead(String expectedCharacters) throws CompileException, IOException Consumes the next character iff it is one of the expectedCharacters
| |
| produce | back to summary |
|---|---|
| public Token produce() throws CompileException, IOException Produces and returns the next token. Notice that end-of-input is not signalized with a | |
| read | back to summary |
|---|---|
| private char read() throws CompileException, IOException Consumes and returns the next character.
| |
| scan | back to summary |
|---|---|
| private TokenType scan() throws CompileException, IOException | |
| scanLiteralCharacter | back to summary |
|---|---|
| private void scanLiteralCharacter() throws CompileException, IOException Scans the next literal character into a | |
| scanNumericLiteral | back to summary |
|---|---|
| private TokenType scanNumericLiteral() throws CompileException, IOException | |
| setIgnoreWhiteSpace | back to summary |
|---|---|
| public void setIgnoreWhiteSpace(boolean value) If value is | |
| token | back to summary |
|---|---|
| private Token token(TokenType type, String value) | |