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)
          The accept method of the visitor design pattern.
 java.util.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 java.util.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)
The accept method of the visitor design pattern.

The visitor visits this node and the children using the preorder traversal method.

Parameters:
visitor - the 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