coins.driver
クラス CoinsOptions

java.lang.Object
  |
  +--coins.driver.CoinsOptions

public class CoinsOptions
extends java.lang.Object

An abstraction of COINS options at a command line.
Standard COINS options (which means the options that affects driver API objects) are listed below:

More than one COINS options can be specifed by delimiting them by `,'s, e.g. -coins:debug,trace=Driver.8/2,suffix=/tmp/mysuffixes.
Although standard COINS options have an constant representation in this class, users can define and use any option and argument of it.


フィールドの概要
static java.lang.String DEBUG
          The option string to tell that the compiler is under debugging.
static java.lang.String DEFAULT_LIBDIR
          The default library directory path when a directory `coins' doesn't exist at a user home directory.
static java.lang.String DEFAULT_LIBDIR_NAME_AT_HOME
          The default library directory name at a user home directory.
static java.lang.String DEFAULT_PROPERTY_FILENAME
          The default property file name.
protected  java.lang.String fArgumentString
           
static java.lang.String LIBDIR
          The "library directory" option string.
static java.lang.String PRESERVE_FILES
          The option string to preserve temporary files.
static java.lang.String PROPERTY_FILE
          The "property file path" option string.
static java.lang.String SUFFIX_FILE_PATH
          The "suffix database file path" option string.
static java.lang.String SUFFIX_OPTION
          The "suffix option" option string.
static java.lang.String TRACE
          The "trace" option string.
 
コンストラクタの概要
CoinsOptions(java.lang.String argumentString)
          Constructs a CoinsOptions object from an argument string of a -coins option.
 
メソッドの概要
 java.lang.String getArg(java.lang.String pOption)
          Returns the argument of an option in this COINS option.
 java.io.File getLibDir()
          Returns library directory path.
 java.util.Set getOptionKeys()
           
 boolean isSet(java.lang.String pOption)
          Tests if an option is set or not in this COINS option.
 java.util.Map parseArgument(java.lang.String pArgument, char pCategoryDelimiter, char pValueDelimiter)
          parseArgument Get option categories doing division of pArgument by pCategoryDelimiter and then record option items and corresponding option values doing division of each option category by pValueDelimiter.
 void readPropertyFile(Warning pWarning)
          Reads a property file if it exists and merges its contents to the option table when they don't exist.
 void set(java.lang.String pOption)
          Sets a COINS option without argument.
 void set(java.lang.String pOption, java.lang.String pArg)
          Sets a COINS option with an argument.
 java.lang.String toString()
           
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

DEFAULT_LIBDIR_NAME_AT_HOME

public static final java.lang.String DEFAULT_LIBDIR_NAME_AT_HOME
The default library directory name at a user home directory.

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

DEFAULT_LIBDIR

public static final java.lang.String DEFAULT_LIBDIR
The default library directory path when a directory `coins' doesn't exist at a user home directory.

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

DEFAULT_PROPERTY_FILENAME

public static final java.lang.String DEFAULT_PROPERTY_FILENAME
The default property file name.

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

DEBUG

public static final java.lang.String DEBUG
The option string to tell that the compiler is under debugging.

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

PRESERVE_FILES

public static final java.lang.String PRESERVE_FILES
The option string to preserve temporary files.

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

LIBDIR

public static final java.lang.String LIBDIR
The "library directory" option string.

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

PROPERTY_FILE

public static final java.lang.String PROPERTY_FILE
The "property file path" option string.

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

SUFFIX_FILE_PATH

public static final java.lang.String SUFFIX_FILE_PATH
The "suffix database file path" option string.

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

SUFFIX_OPTION

public static final java.lang.String SUFFIX_OPTION
The "suffix option" option string.

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

TRACE

public static final java.lang.String TRACE
The "trace" option string.

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

fArgumentString

protected java.lang.String fArgumentString
コンストラクタの詳細

CoinsOptions

public CoinsOptions(java.lang.String argumentString)
Constructs a CoinsOptions object from an argument string of a -coins option. Argument string is a comma separated option list excluding the leading -coins:.

パラメータ:
argumentString - an argument string.
メソッドの詳細

readPropertyFile

public void readPropertyFile(Warning pWarning)
Reads a property file if it exists and merges its contents to the option table when they don't exist.

パラメータ:
pWarning - warning message controler.

isSet

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

パラメータ:
pOption - the option string (left side of a delimiting equal sign).
戻り値:
true if the option is set, false otherwise.

getArg

public java.lang.String getArg(java.lang.String pOption)
Returns the argument of an option in this COINS option. When the option is not set, a null is returned. When the option is set but no argument is specified (i.e., no delimiting equal sign exists or no string exists at right side of delimiting equal sign), a "" is returned.

パラメータ:
pOption - the option string (left side of a delimitin equal sign).
戻り値:
the argument of option or null.

set

public void set(java.lang.String pOption)
Sets a COINS option without argument.

パラメータ:
pOption - an option to be set.

set

public void set(java.lang.String pOption,
                java.lang.String pArg)
Sets a COINS option with an argument.

パラメータ:
pOption - an option to be set.
pArg - an argument of the option.

getLibDir

public java.io.File getLibDir()
Returns library directory path. It is searched from the following sources in this order:
  1. COINS options
  2. property file (specified by "property=path" way)
  3. default value (i.e., ".");

戻り値:
library directory path.

toString

public java.lang.String toString()
オーバーライド:
クラス java.lang.Object 内の toString

parseArgument

public java.util.Map parseArgument(java.lang.String pArgument,
                                   char pCategoryDelimiter,
                                   char pValueDelimiter)
parseArgument Get option categories doing division of pArgument by pCategoryDelimiter and then record option items and corresponding option values doing division of each option category by pValueDelimiter. The return value also contains the list of option categories which can be get by get("item_key_list"). The list is ordered in the same sequence as given in pArgument. Example For compiler option -coins:hirOpt=loopexp.4/cpf/pre,trace=HIR.1 by coding CoinsOptions lOptions = ioRoot.getCompileSpecification().getCoinsOptions(); lOption will represent information specified by hirOpt=loopexp.4/cpf/pre,trace=HIR.1 and by coding String lOptArg = lOptions.getArg("hirOpt"); lOptArg will represent "loopexp.4/cpf/pre,trace=HIR.1" and by coding Map lHirOptionItems = parseArgument(lOptArg, '/', '.'); lHirOptionImems will contain key-value correspondence { ("loopexp", "4"), ("cpf", ""), ("pre", ""), ("item_key_list", ("loopexp", "cpf", "pre")) } The coding of this method is similar to parseArgument of Trace class.

パラメータ:
pArgument - is a character string showing options.
戻り値:
the Map showing option item and option value correspondence.

getOptionKeys

public java.util.Set getOptionKeys()