ptolemy.data.expr
Class ASTPtProductNode

java.lang.Object
  extended by ptolemy.data.expr.ASTPtRootNode
      extended by ptolemy.data.expr.ASTPtProductNode
All Implemented Interfaces:
java.lang.Cloneable, Node

public class ASTPtProductNode
extends ASTPtRootNode

The parse tree created from the expression string consists of a hierarchy of node objects. This class represents product(*,/,%) nodes in the parse tree.

Since:
Ptolemy II 0.2
Version:
$Id: ASTPtProductNode.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Neil Smyth, Bart Kienhuis, Steve Neuendorffer
See Also:
ASTPtRootNode, PtParser, Token
Accepted Rating:
Red (cxh)
Proposed Rating:
Yellow (nsmyth)

Field Summary
protected  java.util.ArrayList _lexicalTokens
           
 
Fields inherited from class ptolemy.data.expr.ASTPtRootNode
_children, _id, _isConstant, _parent, _ptToken, _ptType
 
Constructor Summary
ASTPtProductNode(int id)
           
ASTPtProductNode(PtParser p, int id)
           
 
Method Summary
 java.lang.Object clone()
          Clone the parse tree node by invoking the clone() method of the base class.
 java.util.List getLexicalTokenList()
          Return the list of lexical tokens that were used to make this node.
 boolean isCongruent(ASTPtRootNode node, java.util.Map renaming)
          Return true if this node is (hierarchically) congruent to the given node, under the given renaming of bound identifiers.
 void jjtClose()
          Close this node.
 void visit(ParseTreeVisitor visitor)
          Traverse this node with the given visitor.
 
Methods inherited from class ptolemy.data.expr.ASTPtRootNode
displayParseTree, evaluateParseTree, getToken, getType, isConstant, isEvaluated, jjtAddChild, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, setConstant, setToken, setType, toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_lexicalTokens

protected java.util.ArrayList _lexicalTokens
Constructor Detail

ASTPtProductNode

public ASTPtProductNode(int id)

ASTPtProductNode

public ASTPtProductNode(PtParser p,
                        int id)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone the parse tree node by invoking the clone() method of the base class. The new node copies the list of operators (*, /) represented by this node.

Overrides:
clone in class ASTPtRootNode
Returns:
A new parse tree node.
Throws:
java.lang.CloneNotSupportedException - If the superclass clone() method throws it.

getLexicalTokenList

public java.util.List getLexicalTokenList()
Return the list of lexical tokens that were used to make this node.


isCongruent

public boolean isCongruent(ASTPtRootNode node,
                           java.util.Map renaming)
Return true if this node is (hierarchically) congruent to the given node, under the given renaming of bound identifiers. Derived classes should extend this method to add additional necessary congruency checks.

Overrides:
isCongruent in class ASTPtRootNode
Parameters:
node - The node to compare to.
renaming - A map from String to String that gives a renaming from identifiers in this node to identifiers in the given node.

jjtClose

public void jjtClose()
Close this node.

Specified by:
jjtClose in interface Node
Overrides:
jjtClose in class ASTPtRootNode

visit

public void visit(ParseTreeVisitor visitor)
           throws IllegalActionException
Traverse this node with the given visitor.

Overrides:
visit in class ASTPtRootNode
Throws:
IllegalActionException