coins.driver
インタフェース CompileSpecification

既知の実装クラスの一覧:
CommandLine

public interface CompileSpecification

Abstraction of a specification of compilation, i.e., specification of options, arguments and source files.
Objects that implements this interface provide accesses to a compile specification through this interface. It may be generated by parsing command line, may be by asking to an operator through GUI, or may be generated from some database record automatically.
option may be one of:

Any other options are invalid and should be warned.


フィールドの概要
static java.lang.String ARCHIVE_TO_LINK
          Option to speficy an archive to link.
static java.lang.String ASSEMBLE_ONLY
          Switch not to link.
static java.lang.String COINS
          Option header of COINS options.
static java.lang.String COMPILE_ONLY
          Switch to stop after assembly code generation and leave it.
static java.lang.String DEFINE_MACRO
          Option header to define a preprocessor macro.
static java.lang.String DYNAMIC_LINKAGE
          Option to use dynamic linkage.
static java.lang.String HELP
          Switch to show help.
static java.lang.String INCLUDE_PATH
          Option header to specify an include path.
static java.lang.String INHIBIT_NUMBER_LINE
          Option header not to output #line directives.
static java.lang.String LINK_PATH
          Option to specify an archive search path.
static java.lang.String OPTIMIZE_LEVEL
          Option header to set optimization level.
static java.lang.String OUTPUT_FILE
          Option to specify an output file.
static java.lang.String PERFORMANCE_MONITOR
          Option to use performance monitor.
static java.lang.String PIPE
          Switch to use pipe rather than temporary files to communicate between passes.
static java.lang.String PREPROCESS_ONLY
          Switch to stop after preprocessing and leave a preprocessed source code.
static java.lang.String PRESERVE_COMMENTS
          Switch to preserve comments in output file.
static java.lang.String PRESERVE_SYMBOLS
          Option to preserve all symbols.
static java.lang.String STATIC_LINKAGE
          Option to use static linkage.
static java.lang.String TARGET_ARCHITECTURE
          Option to specify a target architecture.
static java.lang.String UNDEFINE_MACRO
          Option header to undefine a preprocessor macro.
static java.lang.String VERBOSE
          Verbose option.
static java.lang.String WARNING_CATEGORY
          Option header to show warning messages of a category.
 
メソッドの概要
 java.lang.Object getArg(java.lang.String option)
          Returns an argument of an option in this command line.
 java.util.List getAssemblerOptions()
          Returns a List of Strings containing all assembler options specified in this command line.
 CoinsOptions getCoinsOptions()
          Returns an CoinsOptions object which represents -coins options included in this command line.
 java.util.List getCompilerOptions()
          Returns a List of Strings containing all compiler options specified in this command line.
 java.util.List getLinkerOptions()
          Returns a List of Strings containing all linker options specified in this command line.
 java.util.List getPreprocessorOptions()
          Returns a List of Strings containing all preprocessor options specified in this command line.
 java.util.List getSourceFiles()
          Returns a List of source file names listed in this command line.
 Trace getTrace()
          Returns a Trace object which filters trace messages in a manner specified in this command line.
 Warning getWarning()
          Returns a Warning object which filters warning messages in a manner specified in this command line.
 boolean isAssemblerOption(java.lang.String arg)
          Tests if the argument string is one of assembler options.
 boolean isCompilerOption(java.lang.String arg)
          Tests if the argument string is one of compiler options.
 boolean isLinkerOption(java.lang.String arg)
          Tests if the argument string is one of linker options.
 boolean isPreprocessorOption(java.lang.String arg)
          Tests if the argument string is one of preprocessor options.
 boolean isSet(java.lang.String option)
          Tests if an option is set or not in this command line.
 void setObjectFile(java.lang.String sourceFile, java.lang.String objectFile)
          Registers a file as an object file of a specified source file.
 void showHelp(java.io.PrintStream out, CompilerImplementation driver)
          Shows help messages.
 

フィールドの詳細

PREPROCESS_ONLY

public static final java.lang.String PREPROCESS_ONLY
Switch to stop after preprocessing and leave a preprocessed source code. A driver control option.

関連項目:
定数フィールド値

COMPILE_ONLY

public static final java.lang.String COMPILE_ONLY
Switch to stop after assembly code generation and leave it. A driver control option.

関連項目:
定数フィールド値

ASSEMBLE_ONLY

public static final java.lang.String ASSEMBLE_ONLY
Switch not to link. A driver control option.

関連項目:
定数フィールド値

HELP

public static final java.lang.String HELP
Switch to show help. A driver control option.

関連項目:
定数フィールド値

OUTPUT_FILE

public static final java.lang.String OUTPUT_FILE
Option to specify an output file. Takes an argument. A driver control option.

関連項目:
定数フィールド値

TARGET_ARCHITECTURE

public static final java.lang.String TARGET_ARCHITECTURE
Option to specify a target architecture. May take an argument. A driver control option.

関連項目:
定数フィールド値

VERBOSE

public static final java.lang.String VERBOSE
Verbose option.

関連項目:
定数フィールド値

PIPE

public static final java.lang.String PIPE
Switch to use pipe rather than temporary files to communicate between passes. A driver control option.

関連項目:
定数フィールド値

WARNING_CATEGORY

public static final java.lang.String WARNING_CATEGORY
Option header to show warning messages of a category. An overall option which is passed to all passes.

関連項目:
定数フィールド値

PRESERVE_COMMENTS

public static final java.lang.String PRESERVE_COMMENTS
Switch to preserve comments in output file. A preprocessor option.

関連項目:
定数フィールド値

DEFINE_MACRO

public static final java.lang.String DEFINE_MACRO
Option header to define a preprocessor macro. A preprocessor option.

関連項目:
定数フィールド値

INCLUDE_PATH

public static final java.lang.String INCLUDE_PATH
Option header to specify an include path. A preprocessor option.

関連項目:
定数フィールド値

INHIBIT_NUMBER_LINE

public static final java.lang.String INHIBIT_NUMBER_LINE
Option header not to output #line directives. A preprocessor option.

関連項目:
定数フィールド値

UNDEFINE_MACRO

public static final java.lang.String UNDEFINE_MACRO
Option header to undefine a preprocessor macro. A preprocessor option.

関連項目:
定数フィールド値

OPTIMIZE_LEVEL

public static final java.lang.String OPTIMIZE_LEVEL
Option header to set optimization level. A compiler option.

関連項目:
定数フィールド値

PRESERVE_SYMBOLS

public static final java.lang.String PRESERVE_SYMBOLS
Option to preserve all symbols. A compiler option.

関連項目:
定数フィールド値

PERFORMANCE_MONITOR

public static final java.lang.String PERFORMANCE_MONITOR
Option to use performance monitor. A compiler option.

関連項目:
定数フィールド値

LINK_PATH

public static final java.lang.String LINK_PATH
Option to specify an archive search path. A linker option.

関連項目:
定数フィールド値

DYNAMIC_LINKAGE

public static final java.lang.String DYNAMIC_LINKAGE
Option to use dynamic linkage. A linker option.

関連項目:
定数フィールド値

STATIC_LINKAGE

public static final java.lang.String STATIC_LINKAGE
Option to use static linkage. A linker option.

関連項目:
定数フィールド値

ARCHIVE_TO_LINK

public static final java.lang.String ARCHIVE_TO_LINK
Option to speficy an archive to link. Usually, specifying "-larchive" means to link archive file whose name is libarchive.a. A linker option.

関連項目:
定数フィールド値

COINS

public static final java.lang.String COINS
Option header of COINS options. Even if more than one COINS options are specified, they are interpreted as a single COINS option whose argument is arguments of the options concatenated with commas.

関連項目:
定数フィールド値
メソッドの詳細

isSet

public boolean isSet(java.lang.String option)
Tests if an option is set or not in this command line.

パラメータ:
option - the option string, including leading `-'.
戻り値:
true if the option is set, false otherwise.

getArg

public java.lang.Object getArg(java.lang.String option)
Returns an argument of an option in this command line. When the option is not set, a null is returned. The argument is a String for -o, a List of Strings for -D, -I, -L, -O, -U, -W and -l.

パラメータ:
option - the option string, including leading `-'.
戻り値:
the argument of option.

isPreprocessorOption

public boolean isPreprocessorOption(java.lang.String arg)
Tests if the argument string is one of preprocessor options. The argument string should start with `-' to be judged as a preprocessor option.

パラメータ:
arg - the argument string
戻り値:
true if `arg' is one of the preprocessor options; false otherwise.

getPreprocessorOptions

public java.util.List getPreprocessorOptions()
Returns a List of Strings containing all preprocessor options specified in this command line. One copy of the list is created per a call.

戻り値:
preprocessor options

isCompilerOption

public boolean isCompilerOption(java.lang.String arg)
Tests if the argument string is one of compiler options. The argument string should start with `-' to be judged as a compiler option.

パラメータ:
arg - the argument string
戻り値:
true if `arg' is one of the compiler options; false otherwise.

getCompilerOptions

public java.util.List getCompilerOptions()
Returns a List of Strings containing all compiler options specified in this command line. One copy of the list is created per a call.

戻り値:
compiler options

isAssemblerOption

public boolean isAssemblerOption(java.lang.String arg)
Tests if the argument string is one of assembler options. The argument string should start with `-' to be judged as a assembler option.

パラメータ:
arg - the argument string
戻り値:
true if `arg' is one of the assembler options; false otherwise.

getAssemblerOptions

public java.util.List getAssemblerOptions()
Returns a List of Strings containing all assembler options specified in this command line. One copy of the list is created per a call.

戻り値:
assembler options.

isLinkerOption

public boolean isLinkerOption(java.lang.String arg)
Tests if the argument string is one of linker options. The argument string should start with `-' to be judged as a linker option.

パラメータ:
arg - the argument string
戻り値:
true if `arg' is one of the linker options; false otherwise.

getLinkerOptions

public java.util.List getLinkerOptions()
Returns a List of Strings containing all linker options specified in this command line. One copy of the list is created per a call.

戻り値:
linker options

getCoinsOptions

public CoinsOptions getCoinsOptions()
Returns an CoinsOptions object which represents -coins options included in this command line.

戻り値:
a CoinsOptions object.

getSourceFiles

public java.util.List getSourceFiles()
Returns a List of source file names listed in this command line. One copy of the list is created per a call.

戻り値:
the List of source files names.

setObjectFile

public void setObjectFile(java.lang.String sourceFile,
                          java.lang.String objectFile)
Registers a file as an object file of a specified source file. Without calling this method, getLinkerOptions cannot return a correct command line arguments.

パラメータ:
sourceFile - the source file name
objectFile - the object file name
例外:
java.lang.Error - there is no source file sourceFile

getTrace

public Trace getTrace()
Returns a Trace object which filters trace messages in a manner specified in this command line.

戻り値:
a Trace object.

getWarning

public Warning getWarning()
Returns a Warning object which filters warning messages in a manner specified in this command line.

戻り値:
a Warning object.

showHelp

public void showHelp(java.io.PrintStream out,
                     CompilerImplementation driver)
Shows help messages.

パラメータ:
out - A PrintStream to which the help messages are written.
driver - A driver object which has the method `main'.