ptolemy.data.expr
Class ASTPtRecordConstructNode

java.lang.Object
  extended by ptolemy.data.expr.ASTPtRootNode
      extended by ptolemy.data.expr.ASTPtRecordConstructNode
All Implemented Interfaces:
java.lang.Cloneable, Node
Direct Known Subclasses:
ASTPtOrderedRecordConstructNode

public class ASTPtRecordConstructNode
extends ASTPtRootNode

The parse tree created from the expression string consists of a hierarchy of node objects. This class represents record construction using the following syntax: {foo = "abc", bar = 1}. The result of parsing and evaluating this expression is a record token with two fields: a field foo containing a StringToken of value "abc", and a field bar containing a IntToken of value 1.

Since:
Ptolemy II 1.0
Version:
$Id: ASTPtRecordConstructNode.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Xiaojun Liu, Steve Neuendorffer
See Also:
ASTPtRootNode, PtParser, Token
Accepted Rating:
Red (cxh)
Proposed Rating:
Yellow (liuxj)

Field Summary
protected  java.util.LinkedList _fieldNames
          The list of field names for the record.
 
Fields inherited from class ptolemy.data.expr.ASTPtRootNode
_children, _id, _isConstant, _parent, _ptToken, _ptType
 
Constructor Summary
ASTPtRecordConstructNode(int id)
           
ASTPtRecordConstructNode(PtParser p, int id)
           
 
Method Summary
 java.util.List getFieldNames()
          Return the list of field names for this record construct.
 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 visit(ParseTreeVisitor visitor)
          Traverse this node with the given visitor.
 
Methods inherited from class ptolemy.data.expr.ASTPtRootNode
clone, displayParseTree, evaluateParseTree, getToken, getType, isConstant, isEvaluated, jjtAddChild, jjtClose, 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

_fieldNames

protected java.util.LinkedList _fieldNames
The list of field names for the record.

Constructor Detail

ASTPtRecordConstructNode

public ASTPtRecordConstructNode(int id)

ASTPtRecordConstructNode

public ASTPtRecordConstructNode(PtParser p,
                                int id)
Method Detail

getFieldNames

public java.util.List getFieldNames()
Return the list of field names for this record construct. The order of the list is not meaningful.


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.

visit

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

Overrides:
visit in class ASTPtRootNode
Throws:
IllegalActionException