ptolemy.data.expr
Class ASTPtMethodCallNode

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

public class ASTPtMethodCallNode
extends ASTPtRootNode

The parse tree created from the expression string consists of a hierarchy of node objects. This class represents method call nodes in the parse tree.

To allow extension of the parser capabilities without modifying the kernel code, method calls on Tokens are supported with the following syntax (token).methodName(comma separated arguments).

Method arguments are processed as described in ASTPtFunctionApplicationNode. However, to allow element-by-element method calls on ArrayTokens, the following sequence is followed here to find a method to execute:

Since:
Ptolemy II 0.2
Version:
$Id: ASTPtMethodCallNode.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Neil Smyth, University of California;, Zoltan Kemenczy, Research in Motion Limited
See Also:
ASTPtRootNode, PtParser, Token
Accepted Rating:
Red (cxh)
Proposed Rating:
Yellow (nsmyth)

Field Summary
protected  java.lang.String _methodName
          Need to store the method name of the method call.
 
Fields inherited from class ptolemy.data.expr.ASTPtRootNode
_children, _id, _isConstant, _parent, _ptToken, _ptType
 
Constructor Summary
ASTPtMethodCallNode(int id)
           
ASTPtMethodCallNode(PtParser p, int id)
           
 
Method Summary
 java.lang.String getMethodName()
          Return the name of the method invoked by this node.
 void jjtClose()
          This method is called after all the child nodes have been added.
 void visit(ParseTreeVisitor visitor)
          Traverse this node with the given visitor.
 
Methods inherited from class ptolemy.data.expr.ASTPtRootNode
clone, displayParseTree, evaluateParseTree, getToken, getType, isCongruent, 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

_methodName

protected java.lang.String _methodName
Need to store the method name of the method call.

Constructor Detail

ASTPtMethodCallNode

public ASTPtMethodCallNode(int id)

ASTPtMethodCallNode

public ASTPtMethodCallNode(PtParser p,
                           int id)
Method Detail

getMethodName

public java.lang.String getMethodName()
Return the name of the method invoked by this node.


jjtClose

public void jjtClose()
Description copied from interface: Node
This method is called after all the child nodes have been added.

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