at.dms.util
Class Options

java.lang.Object
  extended by at.dms.util.Options
Direct Known Subclasses:
BackendOptions, KjcOptions, OptgenOptions, OptimizeOptions

public abstract class Options
extends Object

This class implements the entry point of the Java compiler


Field Summary
 String[] nonOptions
          The array of non-option arguments.
 
Constructor Summary
Options(String name)
          Creates a new Option object.
 
Method Summary
protected  int getInt(Getopt g, int defaultValue)
          Processes an integer argument.
 LongOpt[] getLongOptions()
          Gets long options.
 String[] getOptions()
           
 String getShortOptions()
          Gets short options.
protected  String getString(Getopt g, String defaultValue)
          Processes a string argument.
protected abstract  void help()
          shows a help message.
 boolean parseCommandLine(String[] argv)
          Parses the command line and processes the arguments.
 void printOptions()
          Prints the available options.
 boolean processOption(int code, Getopt g)
           
protected abstract  void usage()
          Shows a usage message.
protected abstract  void version()
          Shows the version number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nonOptions

public String[] nonOptions
The array of non-option arguments.

Constructor Detail

Options

public Options(String name)
Creates a new Option object.

Parameters:
name - the command name to pass to getopt
Method Detail

parseCommandLine

public boolean parseCommandLine(String[] argv)
Parses the command line and processes the arguments.

Parameters:
argv - the command line arguments
Returns:
true iff the command line is valid

processOption

public boolean processOption(int code,
                             Getopt g)
Parameters:
code -
g -

getOptions

public String[] getOptions()

printOptions

public void printOptions()
Prints the available options.


help

protected abstract void help()
shows a help message.


version

protected abstract void version()
Shows the version number.


usage

protected abstract void usage()
Shows a usage message.


getInt

protected int getInt(Getopt g,
                     int defaultValue)
Processes an integer argument.


getString

protected String getString(Getopt g,
                           String defaultValue)
Processes a string argument.


getShortOptions

public String getShortOptions()
Gets short options.


getLongOptions

public LongOpt[] getLongOptions()
Gets long options.