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

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
All Implemented Interfaces:
Disposable, Serializable, Cloneable
Direct Known Subclasses:
AbstractLocal, Action, ASTType, Catch, Constant, Exp, Extension, Field, InitialValue, Literal, LiveSet, Location, NextState, PrintArg, Statement, System, SystemMember, Transformation, TypedId

public abstract class Node
extends Object
implements Disposable, Cloneable, Serializable

Top level class for any AST class.

Version:
CVS $Revision: 1.8 $ $Date: 2005/05/06 16:19:47 $
Author:
Robby
See Also:
Serialized Form

Field Summary
static char ILLEGAL_LOCAL_ID_CHAR
          Character which no identifier admitted by the parser will contain.
 
Constructor Summary
Node()
          Default constructor.
 
Method Summary
abstract  Node clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Disposes locInfo.
 LocationInfo getLocationInfo()
          Gets the location information of this object.
 Object getProperty(int key)
          Gets a property on this node.
 void putProperty(int key, Object value)
          Puts a property on this node.
 void setLocationInfo(LocationInfo newLocInfo)
          Sets the location information of this object.
abstract  String toString()
           
abstract  void visit(ASTVisitor visitor)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ILLEGAL_LOCAL_ID_CHAR

public static final char ILLEGAL_LOCAL_ID_CHAR
Character which no identifier admitted by the parser will contain. This is used to "tag" generated constructs so that their pretty- printing will be suppressed.

See Also:
Constant Field Values
Constructor Detail

Node

public Node()
Default constructor. Set this object as locInfo's parent.

Method Detail

clone

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

Overrides:
clone in class Object
Returns:
The clone of this object.

setLocationInfo

public final void setLocationInfo(LocationInfo newLocInfo)
Sets the location information of this object. Sets this object as the new locInfo's parent.

Parameters:
newLocInfo - The new location info. Must be non-null.

getLocationInfo

public final LocationInfo getLocationInfo()
Gets the location information of this object.

Returns:
The location information of this object. Non-null.

getProperty

public Object getProperty(int key)
Gets a property on this node.

Parameters:
key - The key of the property.
Returns:
The value of the property.

dispose

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

Specified by:
dispose in interface Disposable

putProperty

public void putProperty(int key,
                        Object value)
Puts a property on this node.

Parameters:
key - The key of the property.
value - The value of the property. Must be non-null.

visit

public abstract void visit(ASTVisitor visitor)

toString

public abstract String toString()
Overrides:
toString in class Object