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

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Transformation
          extended by edu.ksu.cis.projects.bogor.ast.BlockTransformation
All Implemented Interfaces:
IActionParent, IExpParent, INextStateParent, Disposable, Serializable, Cloneable

public final class BlockTransformation
extends Transformation
implements IActionParent

Block transformation AST.

Version:
CVS $Revision: 1.9 $ $Date: 2005/05/09 01:18:25 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
BlockTransformation(boolean invisible, boolean visible, List<? extends Action> actions, NextState nextState)
          Default constructor.
BlockTransformation(Exp exp, boolean invisible, boolean visible, List<? extends Action> actions, NextState nextState)
          Constructor with expression.
 
Method Summary
 BlockTransformation clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes references to parent, and disposes exp, actions, and nextState.
 Action getAction(int index)
          Gets an action at a specified index.
 int getActionCount()
          Gets the number of actions.
 void setActions(List<? extends Action> newActions)
          Sets the actions.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Transformation
getInvisible, getNextState, getOptionalExp, getParent, getVisible, setExp, setInvisible, setNextState, setParent, setVisible
 
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

BlockTransformation

public BlockTransformation(boolean invisible,
                           boolean visible,
                           List<? extends Action> actions,
                           NextState nextState)
Default constructor. Sets this object as each action's, and the next state's parent.

Parameters:
invisible - The invisible.
visible - The visible.
actions - The actions. Must be non-null. Each element must be instance of Action.
nextState - The nextstate. Must be non-null.

BlockTransformation

public BlockTransformation(Exp exp,
                           boolean invisible,
                           boolean visible,
                           List<? extends Action> actions,
                           NextState nextState)
Constructor with expression. Sets this object as the exp's, each action's, and the next state's parent.

Parameters:
exp - The exp. Must be non-null.
invisible - The invisible.
visible - The visible.
actions - The actions. Must be non-null. Each element must be instance of Action.
nextState - The nextstate. Must be non-null.
Method Detail

getAction

public Action getAction(int index)
Gets an action at a specified index.

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

getActionCount

public int getActionCount()
Gets the number of actions.

Returns:
The number of actions.

setActions

public void setActions(List<? extends Action> newActions)
Sets the actions. Sets this object as each action's parent.

Parameters:
newActions - The new actions. Must be non-null. Each element must be instance of Action.

clone

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

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

dispose

public void dispose()
Removes references to parent, and disposes exp, actions, and nextState. Once called, avoid using this object.

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

toString

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

Specified by:
toString in class Node
Returns:
 
  
   
    
     
        "            [ when exp ] do [ invisible ]\n"
        + "            {\n"
        + "                ( actions )*"
        + "            }\n"
        + "            nextState;".
        
     
    
   
  
 

visit

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