1 32 package org.jruby.ast; 33 34 import java.io.IOException ; 35 import java.util.List ; 36 37 import org.jruby.ast.types.ILiteralNode; 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 47 public class SymbolNode extends Node implements ILiteralNode, INameNode { 48 static final long serialVersionUID = 3168450881711346709L; 49 50 private String name; 51 52 public SymbolNode(ISourcePosition position, String name) { 53 super(position, NodeTypes.SYMBOLNODE); 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 public Instruction accept(NodeVisitor iVisitor) { 65 return iVisitor.visitSymbolNode(this); 66 } 67 68 72 public String getName() { 73 return name; 74 } 75 76 public List childNodes() { 77 return EMPTY_LIST; 78 } 79 80 } 81 | Popular Tags |