1 31 package org.jruby.ast; 32 33 import java.io.IOException ; 34 import java.util.List ; 35 36 import org.jruby.ast.types.INameNode; 37 import org.jruby.ast.visitor.NodeVisitor; 38 import org.jruby.evaluator.Instruction; 39 import org.jruby.lexer.yacc.ISourcePosition; 40 41 46 public class ConstNode extends Node implements INameNode { 47 static final long serialVersionUID = -5190161028130457944L; 48 49 private String name; 50 51 public ConstNode(ISourcePosition position, String name) { 52 super(position, NodeTypes.CONSTNODE); 53 this.name = name.intern(); 54 } 55 56 private void readObject(java.io.ObjectInputStream in) throws IOException , ClassNotFoundException { 57 in.defaultReadObject(); 58 59 name = name.intern(); 61 } 62 63 67 public Instruction accept(NodeVisitor iVisitor) { 68 return iVisitor.visitConstNode(this); 69 } 70 71 75 public String getName() { 76 return name; 77 } 78 79 public List childNodes() { 80 return EMPTY_LIST; 81 } 82 83 public String toString() { 84 return "ConstNode [" + name + "]"; 85 } 86 87 public void setName(String name) { 88 this.name = name; 89 } 90 91 } 92 | Popular Tags |