avrora
Class Main

java.lang.Object
  extended byavrora.Main

public class Main
extends java.lang.Object

This is the main entrypoint to Avrora.


Nested Class Summary
static class Main.Location
          The Location class encapsulates a location within a program that is specified on the command line.
static class Main.ProgramReader
          The ProgramReader class represents an object capable of reading a program given the special command line arguments.
 
Field Summary
static Option.Str ACTION
           
static Option.Bool BANNER
           
static Option.Bool COLORS
           
static Option.Str FOREGROUND
           
static Option.Bool HELP
           
static Option.Bool HTML
           
static Option.List INDIRECT_EDGES
           
static Option.Str INPUT
           
static Option.Bool LICENSE
           
static Option.Bool LIGHT_BACKGROUND
           
static Option.List VERBOSE
           
 
Constructor Summary
Main()
           
 
Method Summary
static java.util.List getLocationList(Program program, java.util.List v)
          The getLocationList() method is to used to parse a list of program locations and turn them into a list of Main.Location instances.
static Main.Location getProgramLocation(java.lang.String val, Program program)
           
static Main.ProgramReader getProgramReader()
           
static Main.ProgramReader getProgramReader(java.lang.String format)
           
static void main(java.lang.String[] args)
          The main() method is the entrypoint into Avrora.
static void parseOptions(java.lang.String[] args)
          The parseOptions() method takes an array of strings and parses it, extracting the options and storing the option values in the internal state of main.
static Program readProgram(java.lang.String[] args)
          The readProgram() method reads a program from the command line arguments given the format specified at the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT

public static final Option.Str INPUT

ACTION

public static final Option.Str ACTION

COLORS

public static final Option.Bool COLORS

BANNER

public static final Option.Bool BANNER

VERBOSE

public static final Option.List VERBOSE

HELP

public static final Option.Bool HELP

LICENSE

public static final Option.Bool LICENSE

HTML

public static final Option.Bool HTML

INDIRECT_EDGES

public static final Option.List INDIRECT_EDGES

LIGHT_BACKGROUND

public static final Option.Bool LIGHT_BACKGROUND

FOREGROUND

public static final Option.Str FOREGROUND
Constructor Detail

Main

public Main()
Method Detail

getProgramReader

public static Main.ProgramReader getProgramReader()

getProgramReader

public static Main.ProgramReader getProgramReader(java.lang.String format)

main

public static void main(java.lang.String[] args)
The main() method is the entrypoint into Avrora. It processes the command line options, looks up the action, and prints help (if there are no arguments or the -help option is specified.

Parameters:
args - an array of strings representing the command line arguments passed by the user

getLocationList

public static java.util.List getLocationList(Program program,
                                             java.util.List v)
The getLocationList() method is to used to parse a list of program locations and turn them into a list of Main.Location instances.

Parameters:
program - the program to look up labels in
v - the list of strings that are program locations
Returns:
a list of program locations

getProgramLocation

public static Main.Location getProgramLocation(java.lang.String val,
                                               Program program)

parseOptions

public static void parseOptions(java.lang.String[] args)
The parseOptions() method takes an array of strings and parses it, extracting the options and storing the option values in the internal state of main.

Parameters:
args - the array of strings to parse into options

readProgram

public static Program readProgram(java.lang.String[] args)
                           throws java.lang.Exception
The readProgram() method reads a program from the command line arguments given the format specified at the command line. It will also process the indirect call edge information and add it to the Program instance returned. This method is primarily used by actions that manipulate programs.

Parameters:
args - an array of strings representing command line arguments with the options removed
Returns:
an instance of the Program class if the program can be loaded correctly
Throws:
java.lang.Exception - if there is an error loading the program, such as a file not found exception, parse error, etc