1 32 package org.jruby.ast; 33 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 44 public class RescueNode extends Node { 45 static final long serialVersionUID = -4757038578511808125L; 46 47 private final Node bodyNode; 48 private final RescueBodyNode rescueNode; 49 private final Node elseNode; 50 51 public RescueNode(ISourcePosition position, Node bodyNode, RescueBodyNode rescueNode, Node elseNode) { 52 super(position, NodeTypes.RESCUENODE); 53 this.bodyNode = bodyNode; 54 this.rescueNode = rescueNode; 55 this.elseNode = elseNode; 56 } 57 58 62 public Instruction accept(NodeVisitor iVisitor) { 63 return iVisitor.visitRescueNode(this); 64 } 65 66 70 public Node getBodyNode() { 71 return bodyNode; 72 } 73 74 78 public Node getElseNode() { 79 return elseNode; 80 } 81 82 86 public RescueBodyNode getRescueNode() { 87 return rescueNode; 88 } 89 90 public List childNodes() { 91 return Node.createList(rescueNode, bodyNode, elseNode); 92 } 93 94 } 95 | Popular Tags |