pnuts.lang
Class SimpleNode

java.lang.Object
  extended by pnuts.lang.SimpleNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SimpleNode
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class respresents a node of AST.

See Also:
Serialized Form

Field Summary
 int beginColumn
           
 int beginLine
           
protected  SimpleNode[] children
           
 int endLine
           
 int id
           
 java.lang.Object info
           
protected  SimpleNode parent
           
 java.lang.String str
           
 
Constructor Summary
SimpleNode(int i)
           
 
Method Summary
 java.lang.Object accept(Visitor visitor, Context context)
          dispatch the instance to a Visitor
 java.lang.Object clone()
           
 void dump(java.lang.String prefix)
           
 java.lang.Object getAttribute(java.lang.String key)
          Gets an attribute value
 void jjtAddChild(SimpleNode n, int i)
           
 SimpleNode jjtGetChild(int i)
           
 int jjtGetNumChildren()
           
 SimpleNode jjtGetParent()
           
 void jjtSetParent(SimpleNode n)
          public void jjtOpen() { } public void jjtClose() { }
 void setAttribute(java.lang.String key, java.lang.Object value)
          Sets an attribute value for the specified key
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String prefix)
           
 java.lang.String unparse()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected SimpleNode parent

children

protected SimpleNode[] children

id

public int id

str

public java.lang.String str

beginLine

public int beginLine

beginColumn

public int beginColumn

endLine

public int endLine

info

public java.lang.Object info
Constructor Detail

SimpleNode

public SimpleNode(int i)
Method Detail

jjtSetParent

public void jjtSetParent(SimpleNode n)
public void jjtOpen() { } public void jjtClose() { }


jjtGetParent

public SimpleNode jjtGetParent()

jjtAddChild

public void jjtAddChild(SimpleNode n,
                        int i)

jjtGetChild

public final SimpleNode jjtGetChild(int i)

jjtGetNumChildren

public final int jjtGetNumChildren()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String prefix)

dump

public void dump(java.lang.String prefix)

unparse

public java.lang.String unparse()

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Gets an attribute value

Parameters:
key - the attribute name
Returns:
the attribute value

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Sets an attribute value for the specified key

Parameters:
key - the attribute name
value - the value

accept

public java.lang.Object accept(Visitor visitor,
                               Context context)
dispatch the instance to a Visitor


clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object