cetus.hir
Class NestedDeclarator

java.lang.Object
  extended by cetus.hir.Declarator
      extended by cetus.hir.NestedDeclarator
All Implemented Interfaces:
Printable, Symbol, Traversable, java.lang.Cloneable

public class NestedDeclarator
extends Declarator
implements Symbol

Represents a nested declarator that may appear as part of another declarator.


Field Summary
 
Fields inherited from class cetus.hir.Declarator
children, leading_specs, object_print_method, parent, trailing_specs
 
Constructor Summary
NestedDeclarator(Declarator nested_decl)
           
NestedDeclarator(Declarator nested_decl, java.util.List params)
           
NestedDeclarator(java.util.List leading_specs, Declarator nested_decl, java.util.List params)
           
NestedDeclarator(java.util.List leading_specs, Declarator nested_decl, java.util.List params, java.util.List trailing_specs)
           
NestedDeclarator(Specifier spec, Declarator nested_decl, java.util.List params)
           
 
Method Summary
 void addParameter(Declaration decl)
           
 void addParameterAfter(Declaration ref, Declaration decl)
           
 void addParameterBefore(Declaration ref, Declaration decl)
           
 java.lang.Object clone()
           
static void defaultPrint(NestedDeclarator dec, java.io.OutputStream stream)
          Prints a nested declarator to a stream.
 java.util.List getArraySpecifiers()
          Returns a List of ArraySpecifier
 Declarator getDeclarator()
           
 Initializer getInitializer()
           
 java.util.List getParameters()
          Returns a List of Function Parameter
 IDExpression getSymbol()
          Returns the symbol declared by this declarator.
 java.lang.String getSymbolName()
          Returns the name of the symbol.
 java.util.List getTypeSpecifiers()
          Returns a list of type specifiers.
 boolean isProcedure()
           
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 setInitializer(Initializer init)
          Sets the initial value of the variable.
 java.lang.String toString()
           
 
Methods inherited from class cetus.hir.Declarator
addTrailingSpecifier, defaultPrint, getChildren, getParent, getSpecifiers, print, removeChild, setChild, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NestedDeclarator

public NestedDeclarator(Declarator nested_decl)

NestedDeclarator

public NestedDeclarator(Declarator nested_decl,
                        java.util.List params)

NestedDeclarator

public NestedDeclarator(java.util.List leading_specs,
                        Declarator nested_decl,
                        java.util.List params)

NestedDeclarator

public NestedDeclarator(Specifier spec,
                        Declarator nested_decl,
                        java.util.List params)

NestedDeclarator

public NestedDeclarator(java.util.List leading_specs,
                        Declarator nested_decl,
                        java.util.List params,
                        java.util.List trailing_specs)
Method Detail

addParameter

public void addParameter(Declaration decl)
Overrides:
addParameter in class Declarator

addParameterBefore

public void addParameterBefore(Declaration ref,
                               Declaration decl)
Overrides:
addParameterBefore in class Declarator

addParameterAfter

public void addParameterAfter(Declaration ref,
                              Declaration decl)
Overrides:
addParameterAfter in class Declarator

clone

public java.lang.Object clone()
Overrides:
clone in class Declarator

defaultPrint

public static void defaultPrint(NestedDeclarator dec,
                                java.io.OutputStream stream)
Prints a nested declarator to a stream.

Parameters:
dec - The declarator to print.
stream - The stream on which to print the declarator.

toString

public java.lang.String toString()
Overrides:
toString in class Declarator

getDeclarator

public Declarator getDeclarator()

getParameters

public java.util.List getParameters()
Description copied from class: Declarator
Returns a List of Function Parameter

Overrides:
getParameters in class Declarator
Returns:
List null is returned when there is no Function Parameter in the Declarator

getSymbol

public IDExpression getSymbol()
Returns the symbol declared by this declarator.

Overrides:
getSymbol in class Declarator

setClassPrintMethod

public static void setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently created objects will use the supplied method.

Parameters:
m - The new print method.

getInitializer

public Initializer getInitializer()
Overrides:
getInitializer in class Declarator

setInitializer

public void setInitializer(Initializer init)
Description copied from class: Declarator
Sets the initial value of the variable. The initial value cannot be set in the constructor, for the purpose of limiting the number of constructors.

Overrides:
setInitializer in class Declarator
Parameters:
init - An initial value for the variable.

getSymbolName

public java.lang.String getSymbolName()
Description copied from interface: Symbol
Returns the name of the symbol.

Specified by:
getSymbolName in interface Symbol
Returns:
the name of the symbol.

getTypeSpecifiers

public java.util.List getTypeSpecifiers()
Description copied from interface: Symbol
Returns a list of type specifiers.

Specified by:
getTypeSpecifiers in interface Symbol
Returns:
the list of type specifiers.

getArraySpecifiers

public java.util.List getArraySpecifiers()
Description copied from class: Declarator
Returns a List of ArraySpecifier

Specified by:
getArraySpecifiers in interface Symbol
Overrides:
getArraySpecifiers in class Declarator
Returns:
An empty list if there is no ArraySpecifier for this Declarator.

isProcedure

public boolean isProcedure()