Package org.jruby.ast

Class CallNode

java.lang.Object
org.jruby.ast.Node
org.jruby.ast.CallNode
All Implemented Interfaces:
BlockAcceptingNode, CanRaise, IArgumentNode, INameNode
Direct Known Subclasses:
OperatorCallNode

public class CallNode extends Node implements INameNode, IArgumentNode, BlockAcceptingNode, CanRaise
A method or operator call.
  • Field Details

    • iterNode

      protected Node iterNode
  • Constructor Details

    • CallNode

      public CallNode(int line, Node receiverNode, RubySymbol name, Node argsNode, Node iterNode, boolean isLazy)
  • Method Details

    • getNodeType

      public NodeType getNodeType()
      Specified by:
      getNodeType in class Node
      Returns:
      the nodeId
    • accept

      public <T> T accept(NodeVisitor<T> iVisitor)
      Accept for the visitor pattern.
      Specified by:
      accept in class Node
      Parameters:
      iVisitor - the visitor
    • getIterNode

      public Node getIterNode()
      Specified by:
      getIterNode in interface BlockAcceptingNode
    • setIterNode

      public Node setIterNode(Node iterNode)
      Specified by:
      setIterNode in interface BlockAcceptingNode
    • getArgsNode

      public Node getArgsNode()
      Gets the argsNode representing the method's arguments' value for this call.
      Specified by:
      getArgsNode in interface IArgumentNode
      Returns:
      argsNode
    • setArgsNode

      public Node setArgsNode(Node argsNode)
      Set the argsNode. This is for re-writer and not general interpretation.
      Specified by:
      setArgsNode in interface IArgumentNode
      Parameters:
      argsNode - set the arguments for this node.
    • getName

      public RubySymbol getName()
      Gets the name. name is the name of the method called
      Specified by:
      getName in interface INameNode
      Returns:
      name
    • getReceiverNode

      public Node getReceiverNode()
      Gets the receiverNode. receiverNode is the object on which the method is being called
      Returns:
      receiverNode
    • isLazy

      public boolean isLazy()
      Is this call lazily execute because it was on right hand side of the lonely (&.) operator?
      Returns:
      true if so.
    • childNodes

      public List<Node> childNodes()
      Specified by:
      childNodes in class Node
    • toStringInternal

      protected String toStringInternal()
      Description copied from class: Node
      Overridden by nodes that have additional internal state to be displated in toString.

      For nodes that have it, name is handled separately, by implementing INameNode.

      Child nodes are handled via iterating #childNodes.

      Overrides:
      toStringInternal in class Node
      Returns:
      A string representing internal node state, or null if none.