1 32 package org.jruby.ast; 33 34 import java.io.IOException ; 35 import java.util.List ; 36 37 import org.jruby.ast.types.INameNode; 38 import org.jruby.ast.visitor.NodeVisitor; 39 import org.jruby.evaluator.Instruction; 40 import org.jruby.lexer.yacc.ISourcePosition; 41 42 46 public class InstAsgnNode extends AssignableNode implements INameNode { 47 static final long serialVersionUID = 64498126883104604L; 48 49 private String name; 50 51 56 public InstAsgnNode(ISourcePosition position, String name, Node valueNode) { 57 super(position, NodeTypes.INSTASGNNODE); 58 this.name = name.intern(); 59 setValueNode(valueNode); 60 } 61 62 private void readObject(java.io.ObjectInputStream in) throws IOException , ClassNotFoundException { 63 in.defaultReadObject(); 64 65 name = name.intern(); 67 } 68 69 73 public Instruction accept(NodeVisitor iVisitor) { 74 return iVisitor.visitInstAsgnNode(this); 75 } 76 77 81 public String getName() { 82 return name; 83 } 84 85 public List childNodes() { 86 return createList(getValueNode()); 87 } 88 89 public void setName(String name) { 90 this.name = name; 91 } 92 93 } 94 | Popular Tags |