coins.driver
クラス CommandLine

java.lang.Object
  |
  +--coins.driver.CommandLine
すべての実装インタフェース:
CompileSpecification, java.io.Serializable

public class CommandLine
extends java.lang.Object
implements CompileSpecification, java.io.Serializable

Abstraction of a COINS compiler command line.
This class is used when the compiler is invoked from command line. A COINS compiler command line is in the form:

java driver [{option | file }] ...
`option' is a string starting with a `-'. As for compile options, see CompileSpecification in more detail.

関連項目:
CompileSpecification, 直列化された形式

フィールドの概要
static java.lang.String COINS_DEFAULT_TARGET_CONVENTION
           
static java.lang.String COINS_DEFAULT_TARGET_NAME
           
static java.lang.String COINS_TARGET_CONVENTION_OPTION
           
static java.lang.String COINS_TARGET_NAME_OPTION
           
static java.lang.String COINS_TARGET_OPTION
           
 
インタフェース coins.driver.CompileSpecification から継承したフィールド
ARCHIVE_TO_LINK, ASSEMBLE_ONLY, COINS, COMPILE_ONLY, DEFINE_MACRO, DYNAMIC_LINKAGE, HELP, INCLUDE_PATH, INHIBIT_NUMBER_LINE, LINK_PATH, OPTIMIZE_LEVEL, OUTPUT_FILE, PERFORMANCE_MONITOR, PIPE, PREPROCESS_ONLY, PRESERVE_COMMENTS, PRESERVE_SYMBOLS, STATIC_LINKAGE, TARGET_ARCHITECTURE, UNDEFINE_MACRO, VERBOSE, WARNING_CATEGORY
 
コンストラクタの概要
CommandLine()
          Constructs a CommandLine object representing an empty command line string.
CommandLine(java.lang.String[] args)
          Constructs a CommandLine object representing a command line string.
 
メソッドの概要
 java.util.Map commandLineOptions()
           
 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()
          Return 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.
 java.lang.String toString()
          Returns a String representation of this command line.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

COINS_TARGET_OPTION

public static final java.lang.String COINS_TARGET_OPTION
関連項目:
定数フィールド値

COINS_DEFAULT_TARGET_NAME

public static final java.lang.String COINS_DEFAULT_TARGET_NAME
関連項目:
定数フィールド値

COINS_TARGET_NAME_OPTION

public static final java.lang.String COINS_TARGET_NAME_OPTION
関連項目:
定数フィールド値

COINS_TARGET_CONVENTION_OPTION

public static final java.lang.String COINS_TARGET_CONVENTION_OPTION
関連項目:
定数フィールド値

COINS_DEFAULT_TARGET_CONVENTION

public static final java.lang.String COINS_DEFAULT_TARGET_CONVENTION
関連項目:
定数フィールド値
コンストラクタの詳細

CommandLine

public CommandLine()
Constructs a CommandLine object representing an empty command line string.


CommandLine

public CommandLine(java.lang.String[] args)
            throws java.text.ParseException
Constructs a CommandLine object representing a command line string.

パラメータ:
args - The command line string.
例外:
java.text.ParseException - error(s) in the command line.
メソッドの詳細

showHelp

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

定義:
インタフェース CompileSpecification 内の showHelp
パラメータ:
out - A PrintStream to which the help messages are written.
driver - A driver object which has the method `main'.

getCoinsOptions

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

定義:
インタフェース CompileSpecification 内の getCoinsOptions
戻り値:
a CoinsOptions object.

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.

定義:
インタフェース CompileSpecification 内の setObjectFile
パラメータ:
sourceFile - the source file name
objectFile - the object file name

getTrace

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

定義:
インタフェース CompileSpecification 内の getTrace
戻り値:
a Trace object.

getWarning

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

定義:
インタフェース CompileSpecification 内の getWarning
戻り値:
a Warning object.

isSet

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

定義:
インタフェース CompileSpecification 内の isSet
パラメータ:
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.

定義:
インタフェース CompileSpecification 内の getArg
パラメータ:
option - the option string, including leading `-'.
戻り値:
the argument of option.

getSourceFiles

public java.util.List getSourceFiles()
Return a List of source file names listed in this command line.

定義:
インタフェース CompileSpecification 内の getSourceFiles
戻り値:
the List of source files names.

toString

public java.lang.String toString()
Returns a String representation of this command line.

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
the String representation of this command line.

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.

定義:
インタフェース CompileSpecification 内の isPreprocessorOption
パラメータ:
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.

定義:
インタフェース CompileSpecification 内の getPreprocessorOptions
戻り値:
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.

定義:
インタフェース CompileSpecification 内の isCompilerOption
パラメータ:
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.

定義:
インタフェース CompileSpecification 内の getCompilerOptions
戻り値:
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.

定義:
インタフェース CompileSpecification 内の isAssemblerOption
パラメータ:
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.

定義:
インタフェース CompileSpecification 内の getAssemblerOptions
戻り値:
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.

定義:
インタフェース CompileSpecification 内の isLinkerOption
パラメータ:
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.

定義:
インタフェース CompileSpecification 内の getLinkerOptions
戻り値:
linker options

commandLineOptions

public java.util.Map commandLineOptions()