public class FunctionCall extends Expression
| Constructor and Description |
|---|
FunctionCall(Expression function,
Expression... args)
Creates a function call having no arguments.
|
FunctionCall(Expression function,
java.util.List args)
Creates a function call having a list of arguments.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArgument(Expression expr)
Inserts the specified expression at the end of the argument list.
|
FunctionCall |
clone()
Creates and returns a deep copy of this expression.
|
static void |
defaultPrint(FunctionCall c,
java.io.PrintWriter o)
Prints a function call to a stream.
|
Expression |
getArgument(int n)
Returns the specified argument
|
java.util.List<Expression> |
getArguments()
Returns the list of arguments of the function call.
|
Expression |
getName()
Returns the name of the function call.
|
int |
getNumArguments()
Returns the number of arguments being passed to this function call.
|
Procedure |
getProcedure()
Returns the Procedure object for the function that is being called.
|
java.util.List |
getReturnType()
Returns the list of specifiers that define the return type of the function
call.
|
void |
setArgument(int n,
Expression expr)
Sets the argument at the specified position with the given new expression.
|
void |
setArguments(java.util.List args)
Sets the argument list with the specified list of new arguments.
|
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 |
setFunction(Expression expr)
Sets the name of the function call with the specified new expression.
|
java.lang.String |
toString()
Returns a string representation of the function call.
|
compareTo, equals, findExpression, getChildren, getParent, getStatement, hashCode, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verifypublic FunctionCall(Expression function, Expression... args)
function - An expression that evaluates to a function.args - Argumentsjava.lang.IllegalArgumentException - if function is invalid.NotAnOrphanException - if function has a parent object.public FunctionCall(Expression function, java.util.List args)
function - An expression that evaluates to a function.args - A list of arguments to the function.java.lang.IllegalArgumentException - if function or an element of
args is invalid.NotAnOrphanException - if function or an element of
args has a parent object.public void addArgument(Expression expr)
expr - the new argument to be inserted.java.lang.IllegalArgumentException - if expr is invalid.NotAnOrphanException - if expr has a parent object.public static void defaultPrint(FunctionCall c, java.io.PrintWriter o)
c - The call to print.o - The writer on which to print the call.public java.lang.String toString()
defaultPrint(cetus.hir.FunctionCall, java.io.PrintWriter).toString in class Expressionpublic Expression getArgument(int n)
n - - index of required argument (first argument has index zero)java.lang.IllegalArgumentException - if n is out of range.public java.util.List<Expression> getArguments()
public Expression getName()
public int getNumArguments()
public Procedure getProcedure()
public java.util.List getReturnType()
public void setArgument(int n,
Expression expr)
n - the position of the arugment.expr - the new argument.java.lang.IllegalArgumentException - if n or expr is invalid.NotAnOrphanException - if expr has a parent object.public void setArguments(java.util.List args)
args - the list of new arguments.java.lang.IllegalArgumentException - if an element of args is invalid.NotAnOrphanException - if an element of args has a parent
object.public static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setFunction(Expression expr)
expr - the expression to be used as a new name.java.lang.IllegalArgumentException - if expr is invalid.NotAnOrphanException - if expr has a parent object.public FunctionCall clone()
Expressionclone in class Expression