Package ptolemy.data.expr
Class ASTPtLeafNode
- java.lang.Object
- 
- ptolemy.data.expr.ASTPtRootNode
- 
- ptolemy.data.expr.ASTPtLeafNode
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- Node
 
 public class ASTPtLeafNode extends ASTPtRootNode The parse tree created from the expression string consists of a hierarchy of node objects. This class represents the leaf nodes of the tree.- Since:
- Ptolemy II 0.2
- Version:
- $Id$
- Author:
- Neil Smyth
- See Also:
- ASTPtRootNode,- PtParser,- Token
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Yellow (nsmyth)
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.String_nameThe identifier that this leaf node refers to.- 
Fields inherited from class ptolemy.data.expr.ASTPtRootNode_children, _id, _isConstant, _parent, _ptToken, _ptType
 
- 
 - 
Constructor SummaryConstructors Constructor Description ASTPtLeafNode(int id)ASTPtLeafNode(PtParser p, int id)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Return the name that this node refers to.booleanisCongruent(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.booleanisIdentifier()Return true if the leaf is an identifier that must be evaluated in scope.java.lang.StringtoString()Return a string representationvoidvisit(ParseTreeVisitor visitor)Traverse this node with the given visitor.- 
Methods inherited from class ptolemy.data.expr.ASTPtRootNodeclone, displayParseTree, evaluateParseTree, getToken, getType, isConstant, isEvaluated, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, setConstant, setToken, setType, toString
 
- 
 
- 
- 
- 
Constructor Detail- 
ASTPtLeafNodepublic ASTPtLeafNode(int id) 
 - 
ASTPtLeafNodepublic ASTPtLeafNode(PtParser p, int id) 
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String getName() Return the name that this node refers to. This may be a literal value, such as "5", or a reference to another object, such as the name of a variable in scope.- Returns:
- The name to which this node refers.
 
 - 
isCongruentpublic 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:
- isCongruentin 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.
- Returns:
- True if the node is congruent.
 
 - 
isIdentifierpublic boolean isIdentifier() Return true if the leaf is an identifier that must be evaluated in scope.- Returns:
- true if the leaf is not a constant.
 
 - 
toStringpublic java.lang.String toString() Return a string representation- Overrides:
- toStringin class- ASTPtRootNode
- Returns:
- The string value of this node.
 
 - 
visitpublic void visit(ParseTreeVisitor visitor) throws IllegalActionException Traverse this node with the given visitor.- Overrides:
- visitin class- ASTPtRootNode
- Parameters:
- visitor- The visitor.
- Throws:
- IllegalActionException- Always thrown in this base class the visit() method is not implemented here.
 
 
- 
 
-