harpoon.IR.Tree
Class INVOCATION

java.lang.Object
  extended by harpoon.IR.Tree.Tree
      extended by harpoon.IR.Tree.Stm
          extended by harpoon.IR.Tree.INVOCATION
All Implemented Interfaces:
HCodeElement
Direct Known Subclasses:
CALL, NATIVECALL

public abstract class INVOCATION
extends Stm

INVOCATION objects are statements which stand for procedure calls. The return value of the CALL is stored in retval. If the call throws an exception, the exception object will be placed in retex. The retval field will be null if the called procedure has void return type.

Version:
$Id: INVOCATION.java,v 1.4 2002/04/10 03:05:45 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.edu>, based on Modern Compiler Implementation in Java by Andrew Appel.
See Also:
CALL, CALL, NATIVECALL

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.IR.Tree.Tree
Tree.CloneCallback
 
Field Summary
 
Fields inherited from class harpoon.IR.Tree.Tree
arrayFactory, child
 
Constructor Summary
protected INVOCATION(TreeFactory tf, HCodeElement source, TEMP retval, Exp func, ExpList args, int addlArgs)
          Constructor.
 
Method Summary
abstract  void accept(TreeVisitor v)
          Accept a visitor.
 ExpList getArgs()
          Returns a list of subexpressions for the function arguments.
 Exp getFunc()
          Returns an expression for the function reference to invoke.
 TEMP getRetval()
          Returns the expression indicating the destination of the return value.
abstract  boolean isNative()
           
 ExpList kids()
          Return a list of subexpressions of this Tree.
 void setArgs(ExpList args)
          Sets the function argument list.
 void setFunc(Exp func)
          Sets the function reference expression.
 void setRetval(TEMP retval)
          Sets the expression indicating the destination of the return value.
 
Methods inherited from class harpoon.IR.Tree.Stm
build, build, isNop, linearize, toStm
 
Methods inherited from class harpoon.IR.Tree.Tree
clone, clone, getChild, getFactory, getFirstChild, getID, getLineNumber, getParent, getSibling, getSourceFile, hashCode, kind, rename, rename, replace, setChild, unlink
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

INVOCATION

protected INVOCATION(TreeFactory tf,
                     HCodeElement source,
                     TEMP retval,
                     Exp func,
                     ExpList args,
                     int addlArgs)
Constructor.

Parameters:
retval - Expression indicating the destination of the return value. The retval is null for void functions.
func - A subexpression which evaluates to the function reference to invoke.
args - Subexpressions for the arguments to the function.
Method Detail

getRetval

public TEMP getRetval()
Returns the expression indicating the destination of the return value. Returns null for void functions.


getFunc

public Exp getFunc()
Returns an expression for the function reference to invoke.


getArgs

public ExpList getArgs()
Returns a list of subexpressions for the function arguments.


kids

public ExpList kids()
Description copied from class: Tree
Return a list of subexpressions of this Tree.

Overrides:
kids in class Tree

setRetval

public void setRetval(TEMP retval)
Sets the expression indicating the destination of the return value.

Parameters:
retval - null for void functions, non-null otherwise.

setFunc

public void setFunc(Exp func)
Sets the function reference expression.


setArgs

public void setArgs(ExpList args)
Sets the function argument list.


isNative

public abstract boolean isNative()

accept

public abstract void accept(TreeVisitor v)
Description copied from class: Tree
Accept a visitor.

Specified by:
accept in class Tree