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

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

public class ExpExtension
extends Extension
implements ITypeParent, ITypedIdParent

Represents an exp extension.

Version:
CVS $Revision: 1.11 $ $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
ExpExtension(ASTType expType, String id, List<String> typeVarIds, List<TypedId> params, BitSet paramLazyModifiers, boolean variableParameterLength)
          Default constructor.
 
Method Summary
 ExpExtension clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes references.
 ASTType getExpType()
          Gets the exp type of this exp extension.
 String getId()
          Gets the exp 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 exp extension supports variable length parameters.
 void setExpType(ASTType newExpType)
          Sets the return type of this exp extension.
 void setId(String newId)
          Sets the exp extension id.
 void setParameterLazyModifiers(BitSet newParameterLazyModifiers)
          Sets the parameter type lazy modifiers.
 void setParameters(List<TypedId> newParameters)
          Sets the parameter types.
 void setTypeVarIds(List<String> newTypeVarIds)
          Sets the type var ids.
 void setVariableParameterLength(boolean newVariableParameterLength)
          Sets whether this exp 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

ExpExtension

public ExpExtension(ASTType expType,
                    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:
expType - The exp type of this exp extension.
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 type extension supports variable length parameters.
Method Detail

setExpType

public void setExpType(ASTType newExpType)
Sets the return type of this exp extension. Sets this object as the return type's parent.

Parameters:
newExpType - The new exp type of this exp extension. Must be non-null.

getExpType

public ASTType getExpType()
Gets the exp type of this exp extension.

Returns:
The exp type of this exp extension. 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.

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 types. 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 exp extension supports variable length parameters

Parameters:
newVariableParameterLength - The new variable parameter length.

getVariableParameterLength

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

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

clone

public ExpExtension 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:
"exp [ intern ] returnType id[ ( <typevarid (, typevarid)* [ , ... ]> | ...) ]([ type (, type)* [ ... ] ]);".

visit

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