Class 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:

    • Look for a method with tokens as supplied by PtParser.
    • If that fails, convert all instances of ArrayToken to Token[] and look again, element-by-element.
    • If that fails, convert all method arguments to their underlying java types and try again.
    • Finally, if the above fails, convert the method object Token to its underlying java type and try again.

    Since:
    Ptolemy II 0.2
    Version:
    $Id$
    Author:
    Neil Smyth, University of California;, Zoltan Kemenczy, Research in Motion Limited
    See Also:
    ASTPtRootNode, PtParser, Token
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (nsmyth)
    • 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.
        Returns:
        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