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

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.LValueExp
              extended by edu.ksu.cis.projects.bogor.ast.IdExp
All Implemented Interfaces:
IExpParent, Disposable, Serializable, Cloneable

public final class IdExp
extends LValueExp

Id exp AST.

Version:
CVS $Revision: 1.5 $ $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
IdExp(String id)
          Default constructor.
 
Method Summary
 IdExp clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to id.
 String getId()
          Gets the id.
 int getIndex()
          Gets the index of global or local.
 boolean isFun()
          Determine whether a fun.
 boolean isGlobal()
          Determine whether a global.
 boolean isLocal()
          Determine whether a local ref.
 void setFun()
          Sets to indicate a fun ref.
 void setGlobal()
          Sets to indicate a global ref.
 void setId(String newId)
          Sets the id.
 void setIndex(int newIndex)
          Sets the index of global or local.
 void setLocal()
          Sets to indicate a local ref.
 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

IdExp

public IdExp(String id)
Default constructor.

Parameters:
id - The id. Must be non-null.
Method Detail

setFun

public void setFun()
Sets to indicate a fun ref.


isFun

public boolean isFun()
Determine whether a fun.

Returns:
True, if fun ref. False, otherwise.

setGlobal

public void setGlobal()
Sets to indicate a global ref.


isGlobal

public boolean isGlobal()
Determine whether a global.

Returns:
True, if global ref. False, otherwise.

setId

public void setId(String newId)
Sets the id.

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

getId

public String getId()
Gets the id.

Returns:
The id. Non-null.

setIndex

public void setIndex(int newIndex)
Sets the index of global or local.

Parameters:
newIndex - The new index of global or local. Must be greater than or equal to zero.

getIndex

public int getIndex()
Gets the index of global or local.

Returns:
The index of global or local. Greater than or equal to zero.

setLocal

public void setLocal()
Sets to indicate a local ref.


isLocal

public boolean isLocal()
Determine whether a local ref.

Returns:
True, if local ref. False, otherwise.

clone

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

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

dispose

public void dispose()
Removes reference to id. 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:
"id".

visit

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