public class Options
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<OptFlag.Arg<?>> |
arguments |
boolean |
assertions |
javax.tools.JavaFileManager.Location |
bootclasspath |
boolean |
bootclasspath_given |
javax.tools.JavaFileManager.Location |
class_output |
javax.tools.JavaFileManager.Location |
classpath |
boolean |
classpath_given |
boolean |
compile_command_line_only |
java.util.Set<java.lang.String> |
disable_passes
Disable the following passes?
|
java.util.Set<java.lang.String> |
dump_ast
Dump the AST after the following passes?
|
int |
error_count |
ExtensionInfo |
extension
Back pointer to the extension that owns this options
|
protected java.util.Set<OptFlag<?>> |
flags |
boolean |
fully_qualified_names |
boolean |
generate_debugging_info |
static Options |
global
An annoying hack to allow objects to get their hands on the Options
object.
|
boolean |
ignore_mod_times
Ignore source and class file modification times when compiling; always
prefer the class file.
|
boolean |
keep_output_files
keep output files
|
boolean |
merge_strings
Parse "a" + "b" as "ab" to avoid very deep AST, e.g., for action tables,
and for serialization.
|
boolean |
noOutputToFS |
java.lang.String |
output_ext |
protected boolean |
output_source_only |
boolean |
output_stdout |
int |
output_width |
java.lang.String |
post_compiler |
java.lang.String |
post_compiler_opts |
boolean |
precise_compiler_generated_positions
Generate position information for compiler-generated code.
|
protected java.lang.Boolean |
print_args |
java.util.Set<java.lang.String> |
print_ast
Pretty-print the AST after the following passes?
|
boolean |
serialize_type_info
Inject type information in serialized form into output file?
|
java.lang.String[] |
source_ext |
javax.tools.JavaFileManager.Location |
source_output |
javax.tools.JavaFileManager.Location |
source_path |
java.util.List<java.io.File> |
sourcepath_directories |
protected int |
USAGE_FLAG_WIDTH
The number of spaces from the left that the descriptions for flags will
be displayed.
|
protected int |
USAGE_SCREEN_WIDTH
The maximum width of a line when printing usage information.
|
protected int |
USAGE_SUBSECTION_INDENT
The number of spaces to indent a subsection of usage information.
|
boolean |
use_simple_code_writer
Use SimpleCodeWriter instead of OptimalCodeWriter
|
Constructor and Description |
---|
Options(ExtensionInfo extension)
Constructor
|
Options(ExtensionInfo extension,
boolean checkFlags) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBootCP(java.util.List<java.io.File> value) |
protected void |
addDisablePass(java.lang.String value) |
protected void |
addDumpAST(java.lang.String value) |
protected void |
addPrintAST(java.lang.String value) |
protected void |
addReportTopic(java.lang.String topic,
java.lang.Integer level) |
protected void |
addSourceExtension(java.lang.String value) |
protected void |
applyArgs(java.util.Set<java.lang.String> source)
Iterates over arguments parsed from the command line and applies them to
this object.
|
java.util.List<OptFlag.Arg<?>> |
arguments() |
java.util.List<java.io.File> |
bootclasspathDirectories() |
java.io.File |
classOutputDirectory() |
javax.tools.JavaFileManager.Location |
classOutputLocation() |
java.util.List<java.io.File> |
classpathDirectories() |
java.lang.String |
constructPostCompilerClasspath()
Construct the classpath for the post-compiler.
|
java.util.List<java.io.File> |
defaultPlatformClasspath() |
java.util.List<OptFlag.Arg<?>> |
filterArgs(java.util.Set<OptFlag<?>> flags) |
java.util.Set<OptFlag<?>> |
flags() |
protected void |
handleArg(OptFlag.Arg<?> arg)
Process the option specified by
arg |
protected void |
handleSourceArg(OptFlag.Arg<?> arg,
java.util.Set<java.lang.String> source)
Process a source argument and add it to the source collection.
|
java.lang.String |
jvmbootclasspath() |
javax.tools.JavaFileManager.Location |
outputLocation() |
protected int |
parseCommand(java.lang.String[] args,
int index,
java.util.Set<java.lang.String> source)
Parse a command
|
void |
parseCommandLine(java.lang.String[] args,
java.util.Set<java.lang.String> source)
Parse the command line and process arguments.
|
protected int |
parseSourceArg(java.lang.String[] args,
int index) |
protected void |
populateFlags(java.util.Set<OptFlag<?>> flags) |
protected void |
postApplyArgs() |
void |
printCommandLine(java.io.PrintStream out)
Iterates over arguments parsed from the command line and applies them to
this object.
|
protected static void |
printSpaces(java.io.PrintStream out,
int n)
Utility method to print a number of spaces to a PrintStream.
|
void |
processArguments(java.util.List<OptFlag.Arg<?>> arguments,
java.util.Set<java.lang.String> source)
Process a list of arguments
|
protected <To extends java.util.Collection<Param>,Param> |
sccast(java.lang.Object in,
java.lang.Class<Param> clazz)
Performs a shallow checked cast of parameterized collections
|
protected void |
setAssertions(boolean value) |
protected void |
setBootclasspath(java.util.List<java.io.File> value) |
protected void |
setClassOutput(java.io.File f) |
protected void |
setClasspath(java.util.List<java.io.File> value) |
protected void |
setCommandLineOnly(boolean value) |
protected void |
setDebugPositions(boolean value) |
void |
setDefaultValues()
Deprecated.
|
protected void |
setErrorCount(java.lang.Integer value) |
protected void |
setFullyQualifiedNames(boolean value) |
protected void |
setGenerateDebugInfo(boolean value) |
protected void |
setIgnoreModTimes(boolean value) |
protected void |
setMergeStrings(boolean value) |
protected void |
setNoOutput(boolean value) |
protected void |
setNoSerializedTypes(boolean value) |
protected void |
setOutputExtension(java.lang.String value) |
protected void |
setOutputOnly(boolean value) |
protected void |
setOutputStdOut(boolean value) |
protected void |
setOutputWidth(java.lang.Integer value) |
protected void |
setPostCompiler(java.lang.String value) |
protected void |
setPostCompilerOpts(java.lang.String value) |
protected void |
setSimpleOutput(boolean value) |
protected void |
setSourceOutput(java.io.File f) |
protected void |
setSourcepath(java.util.List<java.io.File> value) |
protected void |
setVerbose(boolean value) |
java.io.File |
sourceOutputDirectory() |
void |
usage(java.io.PrintStream out)
Print usage information
|
void |
usage(java.io.PrintStream out,
boolean showSecretMenu) |
protected void |
usageForFlag(java.io.PrintStream out,
java.lang.String flag,
java.lang.String description)
Output a flag and a description of its usage in a nice format.
|
void |
usageHeader(java.io.PrintStream out) |
protected void |
usageSubsection(java.io.PrintStream out,
java.lang.String text)
Output a section of text for usage information.
|
protected void |
validateArgs()
Validates the arguments parsed from the command line.
|
public static Options global
public final ExtensionInfo extension
public int error_count
public final java.util.List<java.io.File> sourcepath_directories
public javax.tools.JavaFileManager.Location source_path
public javax.tools.JavaFileManager.Location source_output
public javax.tools.JavaFileManager.Location class_output
public javax.tools.JavaFileManager.Location classpath
public javax.tools.JavaFileManager.Location bootclasspath
public boolean noOutputToFS
public boolean assertions
public boolean generate_debugging_info
public boolean compile_command_line_only
public java.lang.String[] source_ext
public java.lang.String output_ext
public boolean output_stdout
public java.lang.String post_compiler
public java.lang.String post_compiler_opts
public int output_width
public boolean fully_qualified_names
public boolean serialize_type_info
public final java.util.Set<java.lang.String> dump_ast
public final java.util.Set<java.lang.String> print_ast
public final java.util.Set<java.lang.String> disable_passes
public boolean keep_output_files
public boolean precise_compiler_generated_positions
public boolean use_simple_code_writer
public boolean merge_strings
public boolean classpath_given
public boolean bootclasspath_given
protected final java.util.Set<OptFlag<?>> flags
protected final java.util.List<OptFlag.Arg<?>> arguments
protected boolean output_source_only
protected java.lang.Boolean print_args
protected int USAGE_SCREEN_WIDTH
usageForFlag
and usageSubsection
.protected int USAGE_FLAG_WIDTH
usageForFlag
.protected int USAGE_SUBSECTION_INDENT
usageSubsection
.public boolean ignore_mod_times
public Options(ExtensionInfo extension)
public Options(ExtensionInfo extension, boolean checkFlags)
public java.util.Set<OptFlag<?>> flags()
public java.util.List<OptFlag.Arg<?>> arguments()
public java.util.List<OptFlag.Arg<?>> filterArgs(java.util.Set<OptFlag<?>> flags)
protected void populateFlags(java.util.Set<OptFlag<?>> flags)
@Deprecated public void setDefaultValues()
public final void parseCommandLine(java.lang.String[] args, java.util.Set<java.lang.String> source) throws UsageError
UsageError
- if the usage is incorrect.public final void processArguments(java.util.List<OptFlag.Arg<?>> arguments, java.util.Set<java.lang.String> source) throws UsageError
UsageError
- if the usage is incorrect.protected void postApplyArgs()
protected void validateArgs() throws UsageError
UsageError
- if the arguments are invalid.protected final void applyArgs(java.util.Set<java.lang.String> source) throws UsageError
source
.source
- The set of source filenames provided on the command line.UsageError
public void printCommandLine(java.io.PrintStream out)
source
.source
- The set of source filenames provided on the command line.protected <To extends java.util.Collection<Param>,Param> To sccast(java.lang.Object in, java.lang.Class<Param> clazz)
in
- protected void handleArg(OptFlag.Arg<?> arg) throws UsageError
arg
UsageError
protected void handleSourceArg(OptFlag.Arg<?> arg, java.util.Set<java.lang.String> source)
source
- The set of filenames to compile.protected void setClassOutput(java.io.File f)
protected void setSourceOutput(java.io.File f)
protected void setClasspath(java.util.List<java.io.File> value)
protected void setBootclasspath(java.util.List<java.io.File> value)
protected void addBootCP(java.util.List<java.io.File> value)
protected void setSourcepath(java.util.List<java.io.File> value)
protected void setCommandLineOnly(boolean value)
protected void setIgnoreModTimes(boolean value)
protected void setAssertions(boolean value)
protected void setFullyQualifiedNames(boolean value)
protected void setGenerateDebugInfo(boolean value)
protected void setOutputOnly(boolean value)
protected void setErrorCount(java.lang.Integer value)
protected void setOutputWidth(java.lang.Integer value)
protected void setPostCompiler(java.lang.String value)
protected void setPostCompilerOpts(java.lang.String value)
protected void setOutputStdOut(boolean value)
protected void addSourceExtension(java.lang.String value)
protected void setOutputExtension(java.lang.String value)
protected void setNoSerializedTypes(boolean value)
protected void addDumpAST(java.lang.String value)
protected void addPrintAST(java.lang.String value)
protected void addDisablePass(java.lang.String value)
protected void setNoOutput(boolean value)
protected void addReportTopic(java.lang.String topic, java.lang.Integer level)
protected void setVerbose(boolean value)
protected void setDebugPositions(boolean value)
protected void setSimpleOutput(boolean value)
protected void setMergeStrings(boolean value)
protected int parseCommand(java.lang.String[] args, int index, java.util.Set<java.lang.String> source) throws UsageError, Main.TerminationException
UsageError
Main.TerminationException
protected int parseSourceArg(java.lang.String[] args, int index)
public javax.tools.JavaFileManager.Location outputLocation()
public javax.tools.JavaFileManager.Location classOutputLocation()
public java.io.File classOutputDirectory()
public void usageHeader(java.io.PrintStream out)
public void usage(java.io.PrintStream out, boolean showSecretMenu)
public void usage(java.io.PrintStream out)
protected void usageForFlag(java.io.PrintStream out, java.lang.String flag, java.lang.String description)
out
- output PrintStreamflag
- description
- description of the flag.protected void usageSubsection(java.io.PrintStream out, java.lang.String text)
USAGE_SUBSECTION_INDENT
out
- the output PrintStreamtext
- the text to output.protected static void printSpaces(java.io.PrintStream out, int n)
out
- output PrintStreamn
- number of spaces to print.public java.lang.String constructPostCompilerClasspath()
public java.lang.String jvmbootclasspath()
public java.util.List<java.io.File> defaultPlatformClasspath()
public java.util.List<java.io.File> classpathDirectories()
public java.util.List<java.io.File> bootclasspathDirectories()
public java.io.File sourceOutputDirectory()