cetus.exec
Class Driver

java.lang.Object
  extended by cetus.exec.Driver

public class Driver
extends java.lang.Object

Implements the command line parser and controls pass ordering. Users may extend this class by overriding runPasses (which provides a default sequence of passes). The derived class should pass an instance of itself to the run method. Derived classes have access to a protected Program object.


Field Summary
protected  java.lang.String[] filenames
          The filenames supplied on the command line.
protected static CommandLineOptionSet options
          A mapping from option names to option values.
protected  Program program
          Override runPasses to do something with this object.
 
Constructor Summary
protected Driver()
          Constructor used by derived classes.
 
Method Summary
static java.lang.String getOptionValue(java.lang.String key)
          Returns the value of the given key or null if the value is not set.
static java.util.HashSet getSkipProcedureSet()
          Returns the set a procedure names that should be excluded from transformations.
static void main(java.lang.String[] args)
          Entry point for Cetus; creates a new Driver object, and calls run on it with args.
protected  void parseCommandLine(java.lang.String[] args)
          Parses command line options to Cetus.
protected  void parseFiles_old()
          Parses all of the files listed in filenames and creates a Program object.
protected  void parseFiles()
           
 void printUsage()
          Prints the list of options that Cetus accepts.
 void printVersion()
          Prints the compiler version.
 void run(java.lang.String[] args)
          Runs this driver with args as the command line.
 void runPasses()
          Runs analysis and optimization passes on the program.
protected static void setOptionValue(java.lang.String key, java.lang.String value)
          Sets the value of the option represented by key to value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

options

protected static CommandLineOptionSet options
A mapping from option names to option values.


program

protected Program program
Override runPasses to do something with this object. It will contain a valid program when runPasses is called.


filenames

protected java.lang.String[] filenames
The filenames supplied on the command line.

Constructor Detail

Driver

protected Driver()
Constructor used by derived classes.

Method Detail

getOptionValue

public static java.lang.String getOptionValue(java.lang.String key)
Returns the value of the given key or null if the value is not set. Key values are set on the command line as -option_name=value.

Returns:
the value of the given key or null if the value is not set.

getSkipProcedureSet

public static java.util.HashSet getSkipProcedureSet()
Returns the set a procedure names that should be excluded from transformations. These procedure names are specified with the skip-procedures command line option by providing a comma-separated list of names.


parseCommandLine

protected void parseCommandLine(java.lang.String[] args)
Parses command line options to Cetus.

Parameters:
args - The String array passed to main by the system.

parseFiles_old

protected void parseFiles_old()
Parses all of the files listed in filenames and creates a Program object.


parseFiles

protected void parseFiles()

printUsage

public void printUsage()
Prints the list of options that Cetus accepts.


printVersion

public void printVersion()
Prints the compiler version.


run

public void run(java.lang.String[] args)
Runs this driver with args as the command line.

Parameters:
args - The command line from main.

runPasses

public void runPasses()
Runs analysis and optimization passes on the program.


setOptionValue

protected static void setOptionValue(java.lang.String key,
                                     java.lang.String value)
Sets the value of the option represented by key to value.

Parameters:
key - The option name.
value - The option value.

main

public static void main(java.lang.String[] args)
Entry point for Cetus; creates a new Driver object, and calls run on it with args.

Parameters:
args - Command line options.