parser
Interface ExpressionParser.Node

All Known Subinterfaces:
ExpressionParser.Addition, ExpressionParser.Division, ExpressionParser.Expression, ExpressionParser.Multiplication, ExpressionParser.Number, ExpressionParser.Root, ExpressionParser.Subtraction, ExpressionParser.Token
All Known Implementing Classes:
ExpressionParser.Default.Addition, ExpressionParser.Default.Division, ExpressionParser.Default.Multiplication, ExpressionParser.Default.Node, ExpressionParser.Default.Number, ExpressionParser.Default.Root, ExpressionParser.Default.Subtraction, ExpressionParser.Default.Token
Enclosing interface:
ExpressionParser

public static interface ExpressionParser.Node

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

Since:
notavaCC 1.0

Method Summary
 void accept(ExpressionParser.Visitor visitor)
          Traverses the (sub-)tree whose root is this node.
 List getChildNodes()
          Returns the list of the child nodes of this.
 ExpressionParser.Node getParentNode()
          Returns the parent node of this, or null if and only if this node is the root of the tree.
 void setParentNode(ExpressionParser.Node parentNode)
          Sets the result of getParentNode().
 

Method Detail

getChildNodes

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

The list may or may not be modifiable (It is specified by the subclasses). The order of nodes is specified by the subclasses.

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

accept

public void accept(ExpressionParser.Visitor visitor)
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 ExpressionParser.Node getParentNode()
Returns the parent node of this, or null if and only if this node is the root of the tree.

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

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

setParentNode

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

Since:
notavaCC 1.0