edu.ksu.cis.projects.bogor.ast
Class InvokeExp

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Exp
          extended by edu.ksu.cis.projects.bogor.ast.InvokeExp
All Implemented Interfaces:
IExpParent, Disposable, Serializable, Cloneable

public final class InvokeExp
extends Exp

Invoke exp AST.

Version:
CVS $Revision: 1.8 $ $Date: 2005/05/06 17:25:17 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Exp
TYPE
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
InvokeExp(String id, boolean virtual, List<? extends Exp> args)
          Default constructor.
 
Method Summary
 InvokeExp clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to id, and disposes args.
 Exp getArg(int index)
          Gets an argument at a specified index.
 int getArgCount()
          Gets the number of arguments.
 String getId()
          Gets the id.
 boolean getVirtual()
          Gets the virtual.
 void setArgs(List<? extends Exp> newArgs)
          Sets the arguments.
 void setId(String newId)
          Sets the id.
 void setVirtual(boolean newVirtual)
          Sets the virtual.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Exp
getParent, setParent
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvokeExp

public InvokeExp(String id,
                 boolean virtual,
                 List<? extends Exp> args)
Default constructor. Sets this object as each argument's parent.

Parameters:
id - The id. Must be non-null.
virtual - The virtual.
args - The arguments. Must be non-null. Each element must be instance of Exp. The number of elements must be greater than zero if virtual.
Method Detail

getArg

public Exp getArg(int index)
Gets an argument at a specified index.

Parameters:
index - The index of the argument. Must be between 0 and getArgCount() - 1, inclusive.
Returns:
The argument at the specified index. Non-null.

getArgCount

public int getArgCount()
Gets the number of arguments.

Returns:
The number of arguments.

setArgs

public void setArgs(List<? extends Exp> newArgs)
Sets the arguments. Sets this object as each argument's parent.

Parameters:
newArgs - The new arguments. Must be non-null. Each element must be instance of Exp.

setId

public void setId(String newId)
Sets the id.

Parameters:
newId - The new id. Must be non-null.

getId

public String getId()
Gets the id.

Returns:
The id. Non-null.

setVirtual

public void setVirtual(boolean newVirtual)
Sets the virtual.

Parameters:
newVirtual -

getVirtual

public boolean getVirtual()
Gets the virtual.

Returns:
True, if virtual invocation. False, otherwise.

clone

public InvokeExp clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class Exp
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Removes reference to id, and disposes args. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class Exp

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
"invoke [ virtual ] id ( ( , args )* )".

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node