|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcetus.hir.Declarator
public abstract class Declarator
Represents the part of a declaration that is the name of the symbol, some type information, and initial values. This class actually is more similar to what the C++ grammar calls an init-declarator. Many different constructors are provided because Java does not have default arguments.
| Field Summary | |
|---|---|
protected java.util.LinkedList<Traversable> |
children
|
protected java.util.List<Specifier> |
leading_specs
|
protected java.lang.reflect.Method |
object_print_method
|
protected Traversable |
parent
|
protected java.util.List<Specifier> |
trailing_specs
|
| Constructor Summary | |
|---|---|
protected |
Declarator()
|
protected |
Declarator(int size)
|
| Method Summary | |
|---|---|
void |
addParameter(Declaration decl)
|
void |
addParameterAfter(Declaration ref,
Declaration decl)
|
void |
addParameterBefore(Declaration ref,
Declaration decl)
|
void |
addTrailingSpecifier(Specifier spec)
|
java.lang.Object |
clone()
|
static void |
defaultPrint(Declarator decl,
java.io.OutputStream stream)
Prints a declarator to a stream. |
java.util.List<Specifier> |
getArraySpecifiers()
Returns a List of ArraySpecifier |
java.util.List<Traversable> |
getChildren()
Provides access to the children of this object as a list. |
Initializer |
getInitializer()
|
java.util.List |
getParameters()
Returns a List of Function Parameter |
Traversable |
getParent()
Provides access to the parent of this object. |
java.util.List<Specifier> |
getSpecifiers()
|
IDExpression |
getSymbol()
Returns the symbol declared by this declarator. |
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 |
setInitializer(Initializer init)
Sets the initial value of the variable. |
void |
setParent(Traversable t)
Sets the parent of this object. |
java.lang.String |
toString()
|
| 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.LinkedList<Traversable> children
protected java.util.List<Specifier> leading_specs
protected java.util.List<Specifier> trailing_specs
| Constructor Detail |
|---|
protected Declarator()
protected Declarator(int size)
| Method Detail |
|---|
public void addParameter(Declaration decl)
public void addParameterBefore(Declaration ref,
Declaration decl)
public void addParameterAfter(Declaration ref,
Declaration decl)
public void addTrailingSpecifier(Specifier spec)
public java.lang.Object clone()
clone in class java.lang.Object
public static void defaultPrint(Declarator decl,
java.io.OutputStream stream)
decl - The declarator to print.stream - The stream on which to print the declarator.public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<Traversable> getChildren()
Traversable
getChildren in interface Traversablepublic Initializer getInitializer()
public java.util.List getParameters()
public Traversable getParent()
Traversable
getParent in interface Traversablepublic java.util.List<Specifier> getArraySpecifiers()
public java.util.List<Specifier> getSpecifiers()
public IDExpression getSymbol()
public void print(java.io.OutputStream stream)
Printable
print in interface Printablestream - The stream on which to print the data.public 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 setInitializer(Initializer init)
init - An initial value for the variable.public void setParent(Traversable t)
Traversable
setParent in interface Traversable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||