1 32 package org.jruby.ast; 33 34 import java.io.IOException ; 35 import java.util.List ; 36 37 import org.jruby.ast.types.IArityNode; 38 import org.jruby.ast.types.INameNode; 39 import org.jruby.ast.visitor.NodeVisitor; 40 import org.jruby.evaluator.Instruction; 41 import org.jruby.lexer.yacc.ISourcePosition; 42 import org.jruby.runtime.Arity; 43 44 47 public class InstVarNode extends Node implements IArityNode, INameNode { 48 static final long serialVersionUID = 6839063763576230282L; 49 50 private String name; 51 52 public InstVarNode(ISourcePosition position, String name) { 53 super(position, NodeTypes.INSTVARNODE); 54 this.name = name.intern(); 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 iVisitor) { 69 return iVisitor.visitInstVarNode(this); 70 } 71 72 75 public Arity getArity() { 76 return Arity.noArguments(); 77 } 78 79 83 public String getName() { 84 return name; 85 } 86 87 public List childNodes() { 88 return EMPTY_LIST; 89 } 90 91 public void setName(String name){ 92 this.name = name; 93 } 94 95 } 96 | Popular Tags |