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 Summary
FieldsFields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline -
Constructor Summary
ConstructorsConstructorDescriptionCallNode(int line, Node receiverNode, RubySymbol name, Node argsNode, Node iterNode, boolean isLazy) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(NodeVisitor<T> iVisitor) Accept for the visitor pattern.Gets the argsNode representing the method's arguments' value for this call.getName()Gets the name.Gets the receiverNode.booleanisLazy()Is this call lazily execute because it was on right hand side of the lonely (&.) operator?setArgsNode(Node argsNode) Set the argsNode.setIterNode(Node iterNode) protected StringOverridden by nodes that have additional internal state to be displated in toString.Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, isNil, needsDefinitionCheck, setLine, setNewline, toString, toString, toStringExtraInfo, unsetNewline
-
Field Details
-
iterNode
-
-
Constructor Details
-
CallNode
public CallNode(int line, Node receiverNode, RubySymbol name, Node argsNode, Node iterNode, boolean isLazy)
-
-
Method Details
-
getNodeType
- Specified by:
getNodeTypein classNode- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getIterNode
- Specified by:
getIterNodein interfaceBlockAcceptingNode
-
setIterNode
- Specified by:
setIterNodein interfaceBlockAcceptingNode
-
getArgsNode
Gets the argsNode representing the method's arguments' value for this call.- Specified by:
getArgsNodein interfaceIArgumentNode- Returns:
- argsNode
-
setArgsNode
Set the argsNode. This is for re-writer and not general interpretation.- Specified by:
setArgsNodein interfaceIArgumentNode- Parameters:
argsNode- set the arguments for this node.
-
getName
Gets the name. name is the name of the method called -
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
- Specified by:
childNodesin classNode
-
toStringInternal
Description copied from class:NodeOverridden 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:
toStringInternalin classNode- Returns:
- A string representing internal node state, or null if none.
-