Modifier and Type | Field and Description |
---|---|
static 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.
|
static String |
SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE
Setting this system property to 'true' enables source-level debugging.
|
static String |
SYSTEM_PROPERTY_SOURCE_DEBUGGING_KEEP
If set to "true", then the temporary source code files are not deleted on exit.
|
Constructor and Description |
---|
Scanner(File file)
Deprecated.
This method is deprecated because it leaves the input file open
|
Scanner(File file,
String encoding)
Deprecated.
This method is deprecated because it leaves the input file open
|
Scanner(String fileName)
Deprecated.
This method is deprecated because it leaves the input file open
|
Scanner(String fileName,
InputStream is)
Sets up a scanner that reads tokens from the given
InputStream in the platform default encoding. |
Scanner(String fileName,
InputStream is,
String encoding)
Sets up a scanner that reads tokens from the given
InputStream with the given
encoding (null means platform default encoding). |
Scanner(String fileName,
Reader in)
Sets up a scanner that reads tokens from the given
Reader . |
Scanner(String fileName,
Reader in,
int initialLineNumber,
int initialColumnNumber)
Creates a
Scanner that counts lines and columns from non-default initial values. |
Scanner(String fileName,
String encoding)
Deprecated.
This method is deprecated because it leaves the input file open
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
This method is deprecated, because the concept described above is confusing. An application should
close the underlying
InputStream or Reader itself |
String |
getFileName() |
Location |
location() |
Token |
produce()
Produces and returns the next token.
|
void |
setIgnoreWhiteSpace(boolean value)
If value is
true , then white space in the input stream is ignored, rather than
scanned as a TokenType.WHITE_SPACE token. |
public static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_ENABLE
-g:all
" instead of "-g:none
".public static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_DIR
public static final String SYSTEM_PROPERTY_SOURCE_DEBUGGING_KEEP
@Deprecated public Scanner(String fileName) throws IOException
IOException
@Deprecated public Scanner(String fileName, String encoding) throws IOException
IOException
@Deprecated public Scanner(File file) throws IOException
IOException
@Deprecated public Scanner(File file, @Nullable String encoding) throws IOException
IOException
public Scanner(@Nullable String fileName, InputStream is) throws IOException
InputStream
in the platform default encoding.
The fileName is solely used for reporting in thrown exceptions.
IOException
public Scanner(@Nullable String fileName, InputStream is, @Nullable String encoding) throws IOException
InputStream
with the given
encoding (null
means platform default encoding).
The fileName is used for reporting errors during compilation and for source level
debugging, and should name an existing file. If null
is passed, and the system property
org.codehaus.janino.source_debugging.enable
is set to "true", then a temporary file in
org.codehaus.janino.source_debugging.dir
or the system's default temp dir is created in order to
make the source code available to a debugger.
IOException
public Scanner(@Nullable String fileName, Reader in) throws IOException
Reader
.
The fileName is used for reporting errors during compilation and for source level
debugging, and should name an existing file. If null
is passed, and the system property org.codehaus.janino.source_debugging.enable
is set to "true", then a temporary file in org.codehaus.janino.source_debugging.dir
or the system's default temp dir is created in order to make the
source code available to a debugger.
IOException
public Scanner(@Nullable String fileName, Reader in, int initialLineNumber, int initialColumnNumber) throws IOException
Scanner
that counts lines and columns from non-default initial values.IOException
public void setIgnoreWhiteSpace(boolean value)
true
, then white space in the input stream is ignored, rather than
scanned as a TokenType.WHITE_SPACE
token. Since white space is typically quite numerous, this
optimization may save considerable overhead.@Nullable public String getFileName()
@Deprecated public void close() throws IOException
InputStream
or Reader
itselfInputStream
, Reader
) associated with this object. The results
of future calls to produce()
are undefined.IOException
public Token produce() throws CompileException, IOException
null
product, but by an TokenType.END_OF_INPUT
-type token.CompileException
IOException
Copyright © 2021. All rights reserved.