Interface TopLevelClass.Node

All Known Subinterfaces:
TopLevelClass.Token, TopLevelClass.Type
All Known Implementing Classes:
TopLevelClass.Default.Node, TopLevelClass.Default.Token, TopLevelClass.Default.Type
Enclosing interface:
TopLevelClass

public static interface TopLevelClass.Node

A node of the abstract syntax tree that is the result of parsing.

Since:
notavaCC 1.0
See Also:
TopLevelClass.Type, TopLevelClass.Token, TopLevelClass.parseType(java.io.File)

Method Summary
 void accept(TopLevelClass.Visitor visitor)
          Deprecated. This method will be replaced by TopLevelClass.Visitor.visitAll(TopLevelClass.Node).
 List getChildNodes()
          Returns the list of the child nodes of this.
 TopLevelClass.Node getParentNode()
          Returns the parent node of this, or null if this node is the root of the tree.
 void setParentNode(TopLevelClass.Node parentNode)
          Sets the result of getParentNode().
 

Method Detail

getChildNodes

public List getChildNodes()
Returns the list of the child nodes of this.

For a Node created by the program generated by ¬<><∪∪, the list should be modifiable and the nodes should be ordered by its position in the parsed text. However, the nodes constructed by the users of ¬<><∪∪ are not required to satisfy it.

Returns:
the list of the child nodes of this.
Since:
notavaCC 1.0

accept

public void accept(TopLevelClass.Visitor visitor)
Deprecated. This method will be replaced by TopLevelClass.Visitor.visitAll(TopLevelClass.Node).

Traverses the (sub-)tree whose root is this node.

this node is passed to the visitor, then the child nodes are traversed recursively (preorder traversal). A node is passed to the methods of the visitor, using reflection, that is public, whose name is visit, that have only one argument whose type is compatible with this node, and that have no throws clause.

Parameters:
visitor - a visitor.
Since:
notavacc 1.0

getParentNode

public TopLevelClass.Node getParentNode()
Returns the parent node of this, or null if this node is the root of the tree.

This method simply returns the value the method setParentNode(TopLevelClass.Node) set, so the above specification should be maintained by the users of this object.

Returns:
the parent node of this, or null if and only if this node is the root of the tree.
Since:
notavaCC 1.0

setParentNode

public void setParentNode(TopLevelClass.Node parentNode)
Sets the result of getParentNode().

Parameters:
parentNode - the value getParentNode() returns.
Since:
notavaCC 1.0