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

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Extension
          extended by edu.ksu.cis.projects.bogor.ast.ActionExtension
All Implemented Interfaces:
ITypedIdParent, Disposable, Serializable, Cloneable

public class ActionExtension
extends Extension
implements ITypedIdParent

Represents an action extension.

Version:
CVS $Revision: 1.12 $ $Date: 2005/05/06 17:25:17 $
Author:
Robby , Matt Hoosier
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
ActionExtension(String id, List<String> typeVarIds, List<TypedId> params, BitSet paramLazyModifiers, boolean variableParameterLength)
          Default constructor.
 
Method Summary
 ActionExtension clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes references.
 String getId()
          Gets the action extension id.
 TypedId getParameter(int index)
          Gets the fixed parameter type at a particular index.
 int getParameterCount()
          Gets the number of fixed parameter types.
 boolean getParameterLazyModifier(int index)
          Gets the parameter lazy modifier at a particular index.
 String getTypeVariableId(int index)
          Gets the fixed type variable at a particular index.
 int getTypeVariableIdCount()
          Gets the number of fixed type variables.
 boolean getVariableParameterLength()
          Determines whether this action extension supports variable length parameters.
 void setId(String newId)
          Sets the action extension id.
 void setParameterLazyModifiers(BitSet newParameterLazyModifiers)
          Sets the parameter type lazy modifiers.
 void setParameters(List<TypedId> newParameters)
          Sets the parameter typess.
 void setTypeVarIds(List<String> newTypeVarIds)
          Sets the type var ids.
 void setVariableParameterLength(boolean newVariableParameterLength)
          Sets whether this action extension supports variable length parameters
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Extension
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

ActionExtension

public ActionExtension(String id,
                       List<String> typeVarIds,
                       List<TypedId> params,
                       BitSet paramLazyModifiers,
                       boolean variableParameterLength)
Default constructor. Sets this object as the return type's parent. Sets this object as each parameter type's parent.

Parameters:
id - The exp extension id. Must be non-null.
typeVarIds - The fixed type variable ids. Must be non-null. Each element must be instance of String. Each element must be distinct.
params - The fixed parameter types. Must be non-null.
paramLazyModifiers - The parameter type lazy modifiers. Must be non-null.
variableParameterLength - Indicates whether this action extension supports variable length parameters.
Method Detail

setId

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

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

getId

public String getId()
Gets the action extension id.

Returns:
The action extension id. Non-null.

getParameterLazyModifier

public boolean getParameterLazyModifier(int index)
Gets the parameter lazy modifier at a particular index.

Parameters:
index - The index of the parameter type. Must be at least zero and at most less than the number of fixed parameter types.
Returns:
boolean True, if the parameter is lazy. False, otherwise.

setParameterLazyModifiers

public void setParameterLazyModifiers(BitSet newParameterLazyModifiers)
Sets the parameter type lazy modifiers.

Parameters:
newParameterLazyModifiers - The new parameter type lazy modifiers. Must be non-null.

getParameter

public TypedId getParameter(int index)
Gets the fixed parameter type at a particular index.

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

getParameterCount

public int getParameterCount()
Gets the number of fixed parameter types.

Returns:
The number of fixed parameter types. At least zero.

setParameters

public void setParameters(List<TypedId> newParameters)
Sets the parameter typess. Sets this object as each parameter type's parent.

Parameters:
newParameters - The new fixed parameter types. Must be non-null.

setTypeVarIds

public void setTypeVarIds(List<String> newTypeVarIds)
Sets the type var ids.

Parameters:
newTypeVarIds - The fixed type variable ids. Must be non-null. Each element must be instance of String. Each element must be distinct.

getTypeVariableId

public String getTypeVariableId(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.

getTypeVariableIdCount

public int getTypeVariableIdCount()
Gets the number of fixed type variables.

Returns:
The number of fixed type variables. At least zero.

setVariableParameterLength

public void setVariableParameterLength(boolean newVariableParameterLength)
Sets whether this action extension supports variable length parameters

Parameters:
newVariableParameterLength - The new variable parameter length.

getVariableParameterLength

public boolean getVariableParameterLength()
Determines whether this action extension supports variable length parameters.

Returns:
True, if this action extension supports variable length parameters. False, otherwise.

clone

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

Specified by:
clone in class Extension
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 Extension

toString

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

Specified by:
toString in class Node
Returns:
"action [ intern ] id[ ( <typevarid (, typevarid)* [ , ... ]> | ...) ]([ type (, type)* [ ... ] ]);".

visit

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