Class FunctionCall

    • Constructor Detail

      • FunctionCall

        public FunctionCall()
      • FunctionCall

        public FunctionCall​(int pos)
      • FunctionCall

        public FunctionCall​(int pos,
                            int len)
    • Method Detail

      • getTarget

        public AstNode getTarget()
        Returns node evaluating to the function to call
      • setTarget

        public void setTarget​(AstNode target)
        Sets node evaluating to the function to call, and sets its parent to this node.
        target - node evaluating to the function to call.
        IllegalArgumentException - } if target is null
      • getArguments

        public List<AstNode> getArguments()
        Returns function argument list
        function argument list, or an empty immutable list if there are no arguments.
      • setArguments

        public void setArguments​(List<AstNode> arguments)
        Sets function argument list
        arguments - function argument list. Can be null, in which case any existing args are removed.
      • addArgument

        public void addArgument​(AstNode arg)
        Adds an argument to the list, and sets its parent to this node.
        arg - the argument node to add to the list
        IllegalArgumentException - } if arg is null
      • getLp

        public int getLp()
        Returns left paren position, -1 if missing
      • setLp

        public void setLp​(int lp)
        Sets left paren position
        lp - left paren position
      • getRp

        public int getRp()
        Returns right paren position, -1 if missing
      • setRp

        public void setRp​(int rp)
        Sets right paren position
      • setParens

        public void setParens​(int lp,
                              int rp)
        Sets both paren positions
      • toSource

        public String toSource​(int depth)
        Description copied from class: AstNode
        Emits source code for this node. Callee is responsible for calling this function recursively on children, incrementing indent as appropriate.

        Note: if the parser was in error-recovery mode, some AST nodes may have null children that are expected to be non-null when no errors are present. In this situation, the behavior of the toSource method is undefined: toSource implementations may assume that the AST node is error-free, since it is intended to be invoked only at runtime after a successful parse.

        Specified by:
        toSource in class AstNode
        depth - the current recursion depth, typically beginning at 0 when called on the root node.
      • visit

        public void visit​(NodeVisitor v)
        Visits this node, the target object, and the arguments.
        Specified by:
        visit in class AstNode
        v - the object to call with this node and its children