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

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.ExtExp
All Implemented Interfaces:
IExpParent, ITypeParent, Disposable, Serializable, Cloneable

public class ExtExp
extends Exp
implements ITypeParent

Represents an action or an exp extension usage.

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

Field Summary
static int TYPE_VAR_ARGS_KEY
          Holds the property key for type variable arguments of this node.
 
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
ExtExp(String extId, String id, List<? extends ASTType> typeVarArgs, List<? extends Exp> args)
          Default constructor.
 
Method Summary
 ExtExp clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes references.
 Exp getArg(int index)
          Gets the argat a particular index.
 int getArgCount()
          Gets the number of args.
 String getExtId()
          Gets the extension id.
 String getId()
          Gets the exp extension id.
 ASTType getTypeVariableArg(int index)
          Gets the fixed type variable at a particular index.
 int getTypeVariableArgCount()
          Gets the number of arguments for type variables.
 void setArgs(List<? extends Exp> newArgs)
          Sets the arguments.
 void setExtId(String newExtId)
          Sets the extension id.
 void setId(String newId)
          Sets the exp extension id.
 void setTypeVarArgs(List<? extends ASTType> newTypeVarArgs)
          Sets the arguments for the type vars.
 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
 

Field Detail

TYPE_VAR_ARGS_KEY

public static final int TYPE_VAR_ARGS_KEY
Holds the property key for type variable arguments of this node.

See Also:
Constant Field Values
Constructor Detail

ExtExp

public ExtExp(String extId,
              String id,
              List<? extends ASTType> typeVarArgs,
              List<? extends Exp> args)
Default constructor. Sets this object as each type var arg's parent. Sets this object as each parameter type's parent.

Parameters:
extId - The extension id. Must be non-null.
id - The exp extension id. Must be non-null.
typeVarArgs - The arguments for the type vars. Must be non-null. Each element must be instance of ASTType.
args - The arguments. Must be non-null. Each element must be instance of Exp.
Method Detail

getArg

public Exp getArg(int index)
Gets the argat a particular index.

Parameters:
index - The index of the arg. Must be at least zero and at most less than the number of args.
Returns:
The arg at the given index.

getArgCount

public int getArgCount()
Gets the number of args.

Returns:
The number of args. At least zero.

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.

setExtId

public void setExtId(String newExtId)
Sets the extension id.

Parameters:
newExtId - The new exp extension id. Must be non-null.

getExtId

public String getExtId()
Gets the extension id.

Returns:
The extension id. Non-null.

setId

public void setId(String newId)
Sets the exp extension id.

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

getId

public String getId()
Gets the exp extension id.

Returns:
The extension type id. Non-null.

setTypeVarArgs

public void setTypeVarArgs(List<? extends ASTType> newTypeVarArgs)
Sets the arguments for the type vars. Sets this object as each type var arg's parent.

Parameters:
newTypeVarArgs - The new arguments for the type vars. Must be non-null. Each element must be instance of ASTType.

getTypeVariableArg

public ASTType getTypeVariableArg(int index)
Gets the fixed type variable at a particular index.

Parameters:
index - The index of the type variable. Must be at least zero and at most less than the number of fixed type variables.
Returns:
The fixed type variable at the given index.

getTypeVariableArgCount

public int getTypeVariableArgCount()
Gets the number of arguments for type variables.

Returns:
The number of arguments for type variables. At least zero.

clone

public ExtExp 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 references. 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:
"extId.id[ ( <type (, type)*> ]([ exp (, exp)* ])".

visit

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