public class ProcedureDeclarator extends Declarator implements Symbol
| Constructor and Description |
|---|
ProcedureDeclarator(IDExpression direct_decl,
java.util.List params)
Constructs a new procedure declarator with the given ID and the list of
parameters.
|
ProcedureDeclarator(IDExpression direct_decl,
java.util.List params,
java.util.List trailing_specs)
Consturcts a new procedure declarator with the given ID, list of
parameters, and the trailing specifiers.
|
ProcedureDeclarator(java.util.List leading_specs,
IDExpression direct_decl,
java.util.List params)
Constructs a new procedure declarator with the given leading specifiers,
the ID, and the list of parameters.
|
ProcedureDeclarator(java.util.List leading_specs,
IDExpression direct_decl,
java.util.List params,
java.util.List trailing_specs,
ExceptionSpecification espec)
Constructs a new procedure declarator with the given leading specifiers,
the ID, the trailing specifiers, and the exception specification.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(Declaration decl)
Inserts a new parameter declaration at the end of the parameter list.
|
void |
addParameterAfter(Declaration ref,
Declaration decl)
Inserts a new parameter declaration after the specified reference
parameter declaration.
|
void |
addParameterBefore(Declaration ref,
Declaration decl)
Inserts a new parameter declaration before the specified reference
parameter declaration.
|
ProcedureDeclarator |
clone()
Returns a clone of the procedure declarator.
|
static void |
defaultPrint(ProcedureDeclarator d,
java.io.PrintWriter o)
Prints a procedure declarator to a stream.
|
java.util.List |
getArraySpecifiers()
Returns the list of specifiers trailing the declarator.
|
Declaration |
getDeclaration()
Returns the parent declaration of the procedure declarator if one exists.
|
IDExpression |
getID()
Returns the name ID of the procedure declarator.
|
java.util.List<Declaration> |
getParameters()
Returns the list of parameter declaration of the procedure declarator.
|
java.lang.String |
getSymbolName()
Returns the name of the symbol.
|
java.util.List |
getTypeSpecifiers()
Returns a list of type specifiers.
|
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 |
setName(java.lang.String name)
Modify the name of the symbol.
|
addTrailingSpecifier, defaultPrint, equals, getChildren, getInitializer, getParameter, getParent, getSpecifiers, hashCode, print, removeChild, setChild, setInitializer, setParent, toStringpublic ProcedureDeclarator(IDExpression direct_decl, java.util.List params)
direct_decl - the IDExpression used for this procedure name; it is
highly recommended to use NameID since this constructor internally
replaces the parameter with an equivalent NameID object.params - the list of function parameters.public ProcedureDeclarator(IDExpression direct_decl, java.util.List params, java.util.List trailing_specs)
direct_decl - the IDExpression used for this procedure name; it is
highly recommended to use NameID since this constructor internally
replaces the parameter with an equivalent NameID object.params - the list of function parameters.trailing_specs - the list of trailing specifiers.public ProcedureDeclarator(java.util.List leading_specs,
IDExpression direct_decl,
java.util.List params)
leading_specs - the list of leading specifiers.direct_decl - the IDExpression used for this procedure name; it is
highly recommended to use NameID since this constructor internally
replaces the parameter with an equivalent NameID object.params - the list of function parameters.public ProcedureDeclarator(java.util.List leading_specs,
IDExpression direct_decl,
java.util.List params,
java.util.List trailing_specs,
ExceptionSpecification espec)
leading_specs - the list of leading specifiers.direct_decl - the IDExpression used for this procedure name; it is
highly recommended to use NameID since this constructor internally
replaces the parameter with an equivalent NameID object.params - the list of function parameters.trailing_specs - the list of trailing specifiers.espec - the exception specification.public void addParameter(Declaration decl)
addParameter in class Declaratordecl - the new parameter declaration to be added.public void addParameterBefore(Declaration ref, Declaration decl)
addParameterBefore in class Declaratorref - the reference parameter declaration.decl - the new parameter declaration to be added.public void addParameterAfter(Declaration ref, Declaration decl)
addParameterAfter in class Declaratorref - the reference parameter declaration.decl - the new parameter declaration to be added.public ProcedureDeclarator clone()
clone in class Declaratorpublic static void defaultPrint(ProcedureDeclarator d, java.io.PrintWriter o)
d - The declarator to print.o - The writer on which to print the declarator.public IDExpression getID()
getID in class Declaratorpublic java.util.List<Declaration> getParameters()
getParameters in class Declaratorpublic static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public java.lang.String getSymbolName()
SymbolgetSymbolName in interface Symbolpublic java.util.List getTypeSpecifiers()
SymbolgetTypeSpecifiers in interface Symbolpublic java.util.List getArraySpecifiers()
DeclaratorgetArraySpecifiers in interface SymbolgetArraySpecifiers in class Declaratorpublic void setName(java.lang.String name)
Symbolextern variables and
procedure names are not automatically handled.public Declaration getDeclaration()
getDeclaration in interface Symbol