coins.driver
Class CheckOptions

java.lang.Object
  extended bycoins.driver.CheckOptions

public class CheckOptions
extends java.lang.Object

Verify command line options whether they are listed in Registry or not. In case of adding new options or new option-items, record them in Registry.java, and if they take suboptions or option-items, add such statement as lIsCorrect &= checkCoinsOptions("hirOpt", Registry.HIR_OPT); or lIsCorrect &= checkOptions("target", Registry.ARCH, ',', '='); to isCoinsOptionsAreCorrect. The method checkCoinsOptions is used for options having delimiter '/' in such way as hirOpt=cf/cpf/cse and the method checkOptions is used for options that do not include delimiter '/', for example target=sparc-v8.


Field Summary
protected  java.util.List fAssemblerOptions
           
protected  CoinsOptions fCoinsOptions
           
protected  java.util.List fCompilerOptions
           
protected  CompileSpecification fCompileSpecification
           
protected  int fDbgLevel
           
protected  java.util.List fLinkerOptions
           
protected  java.util.List fPreprocessorOptions
           
 IoRoot ioRoot
           
 
Constructor Summary
CheckOptions(CompileSpecification pCompileSpecification, IoRoot pIoRoot)
           
 
Method Summary
protected  boolean checkCoinsOptions(java.lang.String pItemName, java.lang.String[] pValueList)
           
protected  boolean checkOptions(java.lang.String pItemName, java.lang.String[] pValueList, char pOptionDelimiter, char pValueDelimiter)
           
 boolean isCoinsOptionsAreCorrect()
          Check options specified in -coins:....
 boolean isListed(java.lang.String pItemValue, java.lang.String[] pItemValueList)
           
 boolean isOptionsAreCorrect()
          Check command line options assuming that they take one of the forms -optionName -optionName:subOption1,subOptions,...
 boolean isPrefixListed(java.lang.String pItemValue, java.lang.String[] pItemValueList)
           
 java.util.List separateByDelimiter(java.lang.String pText, java.lang.String pDelimiter)
          Get the set of substrings contained in pText where each substring is separated by the delimiting string pDelimiter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ioRoot

public final IoRoot ioRoot

fCompileSpecification

protected CompileSpecification fCompileSpecification

fCoinsOptions

protected CoinsOptions fCoinsOptions

fCompilerOptions

protected java.util.List fCompilerOptions

fPreprocessorOptions

protected java.util.List fPreprocessorOptions

fAssemblerOptions

protected java.util.List fAssemblerOptions

fLinkerOptions

protected java.util.List fLinkerOptions

fDbgLevel

protected int fDbgLevel
Constructor Detail

CheckOptions

public CheckOptions(CompileSpecification pCompileSpecification,
                    IoRoot pIoRoot)
Method Detail

isOptionsAreCorrect

public boolean isOptionsAreCorrect()
Check command line options assuming that they take one of the forms -optionName -optionName:subOption1,subOptions,... -optionName:subOption=item1/item2/...,subOption2=item3/item4.... return true if option name and corresponding item name are listed in Registry.java.

Returns:
true if options are listed in Registry, return false if there is some option/item not listed in Registry.

isCoinsOptionsAreCorrect

public boolean isCoinsOptionsAreCorrect()
Check options specified in -coins:....

Returns:
true if no undefined one is found.

checkCoinsOptions

protected boolean checkCoinsOptions(java.lang.String pItemName,
                                    java.lang.String[] pValueList)

checkOptions

protected boolean checkOptions(java.lang.String pItemName,
                               java.lang.String[] pValueList,
                               char pOptionDelimiter,
                               char pValueDelimiter)

isListed

public boolean isListed(java.lang.String pItemValue,
                        java.lang.String[] pItemValueList)

isPrefixListed

public boolean isPrefixListed(java.lang.String pItemValue,
                              java.lang.String[] pItemValueList)

separateByDelimiter

public java.util.List separateByDelimiter(java.lang.String pText,
                                          java.lang.String pDelimiter)
Get the set of substrings contained in pText where each substring is separated by the delimiting string pDelimiter. e.g. separateByDelimiter("coins.backend.sched.Schedule/RegPromote", "/") will return {"coins.backend.sched.Schedule", "RegPromote"} This can be made static method by erazing debug statement ioRoot.dbgControl.print( ... );

Parameters:
pText - text to be divided into substrings.
Returns:
the set of substrings.