1 28 package org.jruby.ast; 29 30 import java.io.IOException ; 31 import java.util.List ; 32 33 import org.jruby.ast.types.INameNode; 34 import org.jruby.ast.visitor.NodeVisitor; 35 import org.jruby.evaluator.Instruction; 36 import org.jruby.lexer.yacc.ISourcePosition; 37 38 42 public class AttrAssignNode extends Node implements INameNode, IArgumentNode { 43 private static final long serialVersionUID = 4182783536358350118L; 44 45 private final Node receiverNode; 46 private String name; 47 private Node argsNode; 48 49 public AttrAssignNode(ISourcePosition position, Node receiverNode, String name, Node argsNode) { 50 super(position, NodeTypes.ATTRASSIGNNODE); 51 52 this.receiverNode = receiverNode; 53 this.name = name.intern(); 54 this.argsNode = argsNode; 55 } 56 57 private void readObject(java.io.ObjectInputStream in) throws IOException , ClassNotFoundException { 58 in.defaultReadObject(); 59 60 name = name.intern(); 62 } 63 64 68 public Instruction accept(NodeVisitor visitor) { 69 return visitor.visitAttrAssignNode(this); 70 } 71 72 77 public String getName() { 78 return name; 79 } 80 81 86 public Node getReceiverNode() { 87 return receiverNode; 88 } 89 90 95 public Node getArgsNode() { 96 return argsNode; 97 } 98 99 104 public void setArgsNode(Node argsNode) { 105 this.argsNode = argsNode; 106 } 107 108 public List childNodes() { 109 return Node.createList(receiverNode, argsNode); 110 } 111 } 112 | Popular Tags |