org.jruby.ast
Class AttrAssignNode

java.lang.Object
  extended by org.jruby.ast.Node
      extended by org.jruby.ast.AttrAssignNode
All Implemented Interfaces:
IArgumentNode, INameNode, ISourcePositionHolder
Direct Known Subclasses:
AttrAssignOneArgNode, AttrAssignThreeArgNode, AttrAssignTwoArgNode

public class AttrAssignNode
extends Node
implements INameNode, IArgumentNode

Node that represents an assignment of either an array element or attribute.


Field Summary
 CallSite normalCallAdapter
           
protected  Node receiverNode
           
 CallSite variableCallAdapter
           
 
Fields inherited from class org.jruby.ast.Node
EMPTY_COMMENT_LIST, INVALID_POSITION, nodeId
 
Constructor Summary
AttrAssignNode(ISourcePosition position, Node receiverNode, java.lang.String name, Node argsNode)
           
 
Method Summary
 Instruction accept(NodeVisitor visitor)
          Accept for the visitor pattern.
 IRubyObject assign(Ruby runtime, ThreadContext context, IRubyObject self, IRubyObject value, Block block, boolean checkArity)
           
 java.util.List<Node> childNodes()
           
 java.lang.String definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock)
           
 Node getArgsNode()
          Gets the argsNode.
 java.lang.String getName()
          Gets the name.
 Node getReceiverNode()
          Gets the receiverNode.
protected static boolean hasMetaClass(IRubyObject object)
           
 IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock)
           
protected  Node newAttrAssignNode(ArrayNode argsNode)
           
protected  Node newMutatedAttrAssignNode(ArrayNode argsNode)
           
protected static java.lang.String receiverClassName(IRubyObject object)
           
protected  CallSite selectCallSite(IRubyObject self, IRubyObject receiver)
           
 Node setArgsNode(Node argsNode)
          Set the argsNode
 
Methods inherited from class org.jruby.ast.Node
addComment, addComments, createList, getComments, getNodeName, getPosition, getPositionIncludingComments, hasComments, isInvisible, setPosition, toString, when
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

receiverNode

protected final Node receiverNode

variableCallAdapter

public CallSite variableCallAdapter

normalCallAdapter

public CallSite normalCallAdapter
Constructor Detail

AttrAssignNode

public AttrAssignNode(ISourcePosition position,
                      Node receiverNode,
                      java.lang.String name,
                      Node argsNode)
Method Detail

accept

public Instruction accept(NodeVisitor visitor)
Accept for the visitor pattern.

Specified by:
accept in class Node
Parameters:
visitor - the visitor

getName

public java.lang.String 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

getArgsNode

public Node getArgsNode()
Gets the argsNode. argsNode representing the method's arguments' value for this call.

Specified by:
getArgsNode in interface IArgumentNode
Returns:
argsNode

newAttrAssignNode

protected Node newAttrAssignNode(ArrayNode argsNode)

newMutatedAttrAssignNode

protected Node newMutatedAttrAssignNode(ArrayNode argsNode)

setArgsNode

public Node setArgsNode(Node argsNode)
Set the argsNode

Specified by:
setArgsNode in interface IArgumentNode
Parameters:
argsNode - set the arguments for this node.

childNodes

public java.util.List<Node> childNodes()
Specified by:
childNodes in class Node

interpret

public IRubyObject interpret(Ruby runtime,
                             ThreadContext context,
                             IRubyObject self,
                             Block aBlock)
Overrides:
interpret in class Node

hasMetaClass

protected static boolean hasMetaClass(IRubyObject object)

receiverClassName

protected static java.lang.String receiverClassName(IRubyObject object)

selectCallSite

protected CallSite selectCallSite(IRubyObject self,
                                  IRubyObject receiver)

assign

public IRubyObject assign(Ruby runtime,
                          ThreadContext context,
                          IRubyObject self,
                          IRubyObject value,
                          Block block,
                          boolean checkArity)
Overrides:
assign in class Node

definition

public java.lang.String definition(Ruby runtime,
                                   ThreadContext context,
                                   IRubyObject self,
                                   Block aBlock)
Overrides:
definition in class Node


Copyright © 2002-2007 JRuby Team. All Rights Reserved.