|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcetus.hir.Declaration
public abstract class Declaration
Base class for all declarations (special objects that result in new symbol table entries when they are added to an instance of a class that implements SymbolTable).
| Field Summary | |
|---|---|
protected java.util.ArrayList<Traversable> |
children
|
protected java.lang.reflect.Method |
object_print_method
|
protected Traversable |
parent
|
| Constructor Summary | |
|---|---|
protected |
Declaration()
Base constructor for derived classes. |
protected |
Declaration(int size)
Base constructor for derived classes; sets an initial size for the list of children of this declaration. |
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Creates and returns a deep copy of this declaration. |
void |
detach()
Detaches this declaration from it's parent, if it has one. |
java.util.List<Traversable> |
getChildren()
Provides access to the children of this object as a list. |
abstract java.util.List |
getDeclaredSymbols()
Returns a list of IDExpressions that are the symbols introduced by this declaration. |
Traversable |
getParent()
Provides access to the parent of this object. |
void |
print(java.io.OutputStream stream)
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. |
void |
setParent(Traversable t)
Sets the parent of this object. |
void |
setPrintMethod(java.lang.reflect.Method m)
Overrides the print method for this object only. |
java.lang.String |
toString()
|
void |
verify()
Verifies three properties of this object: (1) All children are not null, (2) the parent object has this object as a child, (3) all children have this object as the parent. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.reflect.Method object_print_method
protected Traversable parent
protected java.util.ArrayList<Traversable> children
| Constructor Detail |
|---|
protected Declaration()
protected Declaration(int size)
size - The initial size for the child list.| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic void detach()
public java.util.List<Traversable> getChildren()
Traversable
getChildren in interface Traversablepublic abstract java.util.List getDeclaredSymbols()
public Traversable getParent()
Traversable
getParent in interface Traversablepublic void print(java.io.OutputStream stream)
Printable
print in interface Printablestream - The stream on which to print the data.
public java.lang.String toString()
throws java.lang.InternalError
toString in class java.lang.Objectjava.lang.InternalErrorpublic void removeChild(Traversable child)
Traversable
removeChild in interface Traversablechild - a reference to a child object that must match with ==.
public void setChild(int index,
Traversable t)
Traversable
setChild in interface Traversablepublic void setParent(Traversable t)
Traversable
setParent in interface Traversablepublic void setPrintMethod(java.lang.reflect.Method m)
m - The new print method.
public void verify()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if any of the properties are not true.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||