Class TreeNodeList

java.lang.Object
  extended byTreeNode
      extended byTreeNodeList

public class TreeNodeList
extends TreeNode

TreeNodeList extends TreeNode by adding a node component and a siblings component. The node is a reference to a single TreeNode. The siblings component is a reference to a TreeNodeList, which may contain zero or more additional TreeNodes. Hence, TreeNodeList is used to represent list constructs in a parse tree. It can equivalently be viewed as a way to represent n-ary constructs.


Field Summary
 TreeNode node
          Reference to the first node of this (sub)list.
 TreeNodeList siblings
          Reference to the rest of this (sub)list
 
Fields inherited from class TreeNode
id
 
Constructor Summary
TreeNodeList(TreeNode node, TreeNodeList siblings)
          Construct this with the given id and child TreeNode references.
 
Method Summary
 java.lang.String toString(int level)
          Return the String representation of this subtree, which is the recursive toString of each of its nodes, separated by a ';' on a new line plus another blank line.
 
Methods inherited from class TreeNode
symPrint, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

node

public TreeNode node
Reference to the first node of this (sub)list.


siblings

public TreeNodeList siblings
Reference to the rest of this (sub)list

Constructor Detail

TreeNodeList

public TreeNodeList(TreeNode node,
                    TreeNodeList siblings)
Construct this with the given id and child TreeNode references.

Method Detail

toString

public java.lang.String toString(int level)
Return the String representation of this subtree, which is the recursive toString of each of its nodes, separated by a ';' on a new line plus another blank line. See the documentation for TreeNode.toString() for a general description the way trees are represented as strings.

Specified by:
toString in class TreeNode