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

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

public final class LetExp
extends Exp
implements ITypeParent

Let exp AST.

Version:
CVS $Revision: 1.10 $ $Date: 2005/05/06 17:25:18 $
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
LetExp(List<? extends ASTType> bindingTypes, List<String> bindingIds, List<? extends Exp> bindingExps, Exp exp)
          Default constructor.
 
Method Summary
 LetExp clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to id, and disposes args.
 int getBindingCount()
          Gets the number of bindings.
 Exp getBindingExp(int index)
          Gets a binding exp at a specified index.
 String getBindingId(int index)
          Gets a binding id at a specified index.
 ASTType getBindingType(int index)
          Gets a binding type at a specified index.
 Exp getExp()
          Gets the exp.
 void setBindingExps(List<? extends Exp> newBindingExps)
          Sets the binding exps.
 void setBindingIds(List<String> newBindingIds)
          Sets the binding ids.
 void setBindingTypes(List<? extends ASTType> newBindingTypes)
          Sets the binding types.
 void setExp(Exp newExp)
          Sets the exp.
 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

LetExp

public LetExp(List<? extends ASTType> bindingTypes,
              List<String> bindingIds,
              List<? extends Exp> bindingExps,
              Exp exp)
Default constructor. Sets this object as each binding type's parent, each binding exp's parent, and the exp's parent. The number of binding types, binding ids, and binding exps must be equal.

Parameters:
bindingTypes - The types. Must be non-null. Each element must be instance of ASTType.
bindingIds - The ids. Must be non-null. Each element must be instance of String.
bindingExps - The arguments. Must be non-null. Each element must be instance of Exp.
exp - The exp. Must be non-null.
Method Detail

getBindingCount

public int getBindingCount()
Gets the number of bindings.

Returns:
The number of bindings.

getBindingExp

public Exp getBindingExp(int index)
Gets a binding exp at a specified index.

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

setBindingExps

public void setBindingExps(List<? extends Exp> newBindingExps)
Sets the binding exps. Sets this object as each binding exp's parent.

Parameters:
newBindingExps - The new binding exps. Must be non-null. Each element must be instance of Exp.

getBindingId

public String getBindingId(int index)
Gets a binding id at a specified index.

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

setBindingIds

public void setBindingIds(List<String> newBindingIds)
Sets the binding ids.

Parameters:
newBindingIds - The new binding ids. Must be non-null. Each element must be instance of Id.

getBindingType

public ASTType getBindingType(int index)
Gets a binding type at a specified index.

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

setBindingTypes

public void setBindingTypes(List<? extends ASTType> newBindingTypes)
Sets the binding types. Sets this object as each binding type's parent.

Parameters:
newBindingTypes - The new binding types. Must be non-null. Each element must be instance of ASTType.

setExp

public void setExp(Exp newExp)
Sets the exp.

Parameters:
newExp - The new exp. Must be non-null.

getExp

public Exp getExp()
Gets the exp.

Returns:
The exp. Non-null.

clone

public LetExp 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:
"let ( bindingTypes bindingIds = bindingExps )+ in exp".

visit

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