1 33 package org.jruby.ast; 34 35 import java.io.IOException ; 36 import java.util.List ; 37 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 43 48 public class GlobalAsgnNode extends AssignableNode implements INameNode { 49 static final long serialVersionUID = 2278414591762936906L; 50 51 private String name; 52 53 public GlobalAsgnNode(ISourcePosition position, String name, Node valueNode) { 54 super(position, NodeTypes.GLOBALASGNNODE); 55 56 this.name = name.intern(); 57 setValueNode(valueNode); 58 } 59 60 private void readObject(java.io.ObjectInputStream in) throws IOException , ClassNotFoundException { 61 in.defaultReadObject(); 62 63 name = name.intern(); 65 } 66 67 72 public Instruction accept(NodeVisitor iVisitor) { 73 return iVisitor.visitGlobalAsgnNode(this); 74 } 75 79 public String getName() { 80 return name; 81 } 82 83 public List childNodes() { 84 return createList(getValueNode()); 85 } 86 87 } 88 | Popular Tags |