public final class Program extends java.lang.Object implements Traversable
| Constructor and Description |
|---|
Program()
Make an empty program.
|
Program(java.util.List<java.lang.String> files)
Make a program from a group of source files.
|
Program(java.lang.String[] files)
Make a program from a group of source files.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTranslationUnit(TranslationUnit tunit)
Adds a translation unit to the program.
|
void |
createNewDDGraph()
Adds a Data Dependence Graph Object to this program, created by DDTDriver
|
static void |
defaultPrint(Program p,
java.io.PrintWriter o)
Prints the entire program to a stream.
|
java.util.List<Traversable> |
getChildren()
Provides access to the children of this object as a list.
|
DDGraph |
getDDGraph()
Return program data dependence graph
|
Traversable |
getParent()
Provides access to the parent of this object.
|
void |
print()
Write all translation units to their respective files.
|
void |
print(java.io.PrintWriter o)
Print the code for the IR represented by the object.
|
void |
removeChild(Traversable child)
Removes the specified child.
|
void |
setChild(int index,
Traversable t)
Sets the indexth child of this object to t.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setParent(Traversable t)
Unsupported - the parent of a program is null and may not be changed.
|
void |
setPrintMethod(java.lang.reflect.Method m)
Overrides the print method for this object only.
|
java.lang.String |
toString() |
public Program()
public Program(java.util.List<java.lang.String> files)
files - A list of strings that are source file names.public Program(java.lang.String[] files)
files - An array of strings that are source file names.public void addTranslationUnit(TranslationUnit tunit)
tunit - The translation unit to add. Its parent
will be set to this program.public static void defaultPrint(Program p, java.io.PrintWriter o)
p - The program to print.o - The writer for the prorgram to be printed on.public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<Traversable> getChildren()
TraversablegetChildren in interface Traversablepublic Traversable getParent()
TraversablegetParent in interface Traversablepublic void print()
throws java.io.IOException
java.io.FileNotFoundException - if a file could not be opened.java.io.IOExceptionpublic void print(java.io.PrintWriter o)
Printablepublic void removeChild(Traversable child)
TraversableremoveChild in interface Traversablechild - a reference to a child object that must match with ==.public void setChild(int index,
Traversable t)
TraversablesetChild in interface Traversablepublic static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setParent(Traversable t)
setParent in interface Traversablepublic void setPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void createNewDDGraph()
public DDGraph getDDGraph()