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

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.Action
          extended by edu.ksu.cis.projects.bogor.ast.AssignAction
All Implemented Interfaces:
IExpParent, Disposable, Serializable, Cloneable

public final class AssignAction
extends Action
implements IExpParent

Assign action AST.

Version:
CVS $Revision: 1.4 $ $Date: 2005/01/13 23:40:09 $
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
AssignAction(LValueExp lhs, Exp exp)
          Default constructor.
 
Method Summary
 AssignAction clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Disposes lhs and exp.
 Exp getExp()
          Gets the exp.
 LValueExp getLHS()
          Gets the lhs.
 void setExp(Exp newExp)
          Sets the exp.
 void setLHS(LValueExp newLHS)
          Sets the lhs.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Action
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

AssignAction

public AssignAction(LValueExp lhs,
                    Exp exp)
Default constructor. Sets this object as the lhs's and exp's parent.

Parameters:
lhs - The lhs. Must be non-null.
exp - The exp. Must be non-null.
Method Detail

setExp

public void setExp(Exp newExp)
Sets the exp. Sets this object as the exp's parent.

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

getExp

public Exp getExp()
Gets the exp.

Returns:
The exp. Non-null.

setLHS

public void setLHS(LValueExp newLHS)
Sets the lhs. Sets this object as the lhs's parent.

Parameters:
newLHS - The new lhs. Must be non-null.

getLHS

public LValueExp getLHS()
Gets the lhs.

Returns:
The lhs. Non-null.

clone

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

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

dispose

public void dispose()
Disposes lhs and exp. Can be called repeatedly. Once called, avoid using this object.

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

toString

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

Specified by:
toString in class Node
Returns:
"lhs := exp;".

visit

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