1 31 package org.jruby.ast; 32 33 import java.util.List ; 34 35 import org.jruby.ast.visitor.NodeVisitor; 36 import org.jruby.evaluator.Instruction; 37 import org.jruby.lexer.yacc.ISourcePosition; 38 39 43 public class ReturnNode extends Node { 44 static final long serialVersionUID = -6549592319167820636L; 45 46 private final Node valueNode; 47 private Object target; 48 49 public ReturnNode(ISourcePosition position, Node valueNode) { 50 super(position, NodeTypes.RETURNNODE); 51 this.valueNode = valueNode; 52 } 53 54 58 public Instruction accept(NodeVisitor iVisitor) { 59 return iVisitor.visitReturnNode(this); 60 } 61 62 public Node getValueNode() { 63 return valueNode; 64 } 65 66 public Object getTarget() { 67 return target; 68 } 69 70 public void setTarget(Object target) { 71 this.target = target; 72 } 73 74 public List childNodes() { 75 return createList(valueNode); 76 } 77 78 } 79 | Popular Tags |