1 31 package org.jruby.ast; 32 33 import java.io.IOException ; 34 import java.util.List ; 35 36 import org.jruby.ast.visitor.NodeVisitor; 37 import org.jruby.evaluator.Instruction; 38 import org.jruby.lexer.yacc.ISourcePosition; 39 40 45 public class AliasNode extends Node { 46 static final long serialVersionUID = -498707070925086399L; 47 48 private String oldName; 49 private String newName; 50 51 public AliasNode(ISourcePosition position, String newName, String oldName) { 52 super(position, NodeTypes.ALIASNODE); 53 this.oldName = oldName.intern(); 54 this.newName = newName.intern(); 55 } 56 57 private void readObject(java.io.ObjectInputStream in) throws IOException , ClassNotFoundException { 58 in.defaultReadObject(); 59 60 oldName = oldName.intern(); 62 newName = newName.intern(); 63 } 64 65 69 public Instruction accept(NodeVisitor iVisitor) { 70 return iVisitor.visitAliasNode(this); 71 } 72 73 77 public String getNewName() { 78 return newName; 79 } 80 81 85 public String getOldName() { 86 return oldName; 87 } 88 89 public List childNodes() { 90 return EMPTY_LIST; 91 } 92 93 } 94 | Popular Tags |