cetus.hir
Class FunctionCall

java.lang.Object
  extended by cetus.hir.Expression
      extended by cetus.hir.FunctionCall
All Implemented Interfaces:
Printable, Traversable, java.lang.Cloneable, java.lang.Comparable<Expression>

public class FunctionCall
extends Expression

Represents a function or method call.


Field Summary
 
Fields inherited from class cetus.hir.Expression
children, needs_parens, object_print_method, parent
 
Constructor Summary
FunctionCall(Expression function)
          Creates a function call.
FunctionCall(Expression function, java.util.List args)
          Creates a function call.
 
Method Summary
 void addArgument(Expression expr)
           
static void defaultPrint(FunctionCall call, java.io.OutputStream stream)
          Prints a function call to a stream.
 Expression getArgument(int n)
           
 java.util.List getArguments()
           
 Expression getName()
           
 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()
           
 void setArgument(int n, Expression expr)
           
 void setArguments(java.util.List args)
           
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)
           
 java.lang.String toString()
          Every expression class should override toString method.
 
Methods inherited from class cetus.hir.Expression
clone, compareTo, equals, equals2, findExpression, getChildren, getParent, getStatement, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verify
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunctionCall

public FunctionCall(Expression function)
Creates a function call.

Parameters:
function - An expression that evaluates to a function.

FunctionCall

public FunctionCall(Expression function,
                    java.util.List args)
Creates a function call.

Parameters:
function - An expression that evaluates to a function.
args - A list of arguments to the function.
Method Detail

addArgument

public void addArgument(Expression expr)

defaultPrint

public static void defaultPrint(FunctionCall call,
                                java.io.OutputStream stream)
Prints a function call to a stream.

Parameters:
call - The call to print.
stream - The stream on which to print the call.

toString

public java.lang.String toString()
Description copied from class: Expression
Every expression class should override toString method.

Overrides:
toString in class Expression

getArgument

public Expression getArgument(int n)

getArguments

public java.util.List getArguments()

getName

public Expression getName()

getNumArguments

public int getNumArguments()
Returns the number of arguments being passed to this function call.

Returns:
the number of arguments being passed to this function call.

getProcedure

public Procedure getProcedure()
Returns the Procedure object for the function that is being called.

Returns:
the Procedure object for the function that is being called.

getReturnType

public java.util.List getReturnType()

setArgument

public void setArgument(int n,
                        Expression expr)

setArguments

public void setArguments(java.util.List args)

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.

setFunction

public void setFunction(Expression expr)