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 RescueBodyNode extends Node { 44 static final long serialVersionUID = -6414517081810625663L; 45 46 private final Node exceptionNodes; 47 private final Node bodyNode; 48 private final RescueBodyNode optRescueNode; 49 50 public RescueBodyNode(ISourcePosition position, Node exceptionNodes, Node bodyNode, RescueBodyNode optRescueNode) { 51 super(position, NodeTypes.RESCUEBODYNODE); 52 this.exceptionNodes = exceptionNodes; 53 this.bodyNode = bodyNode; 54 this.optRescueNode = optRescueNode; 55 } 56 57 61 public Instruction accept(NodeVisitor iVisitor) { 62 return iVisitor.visitRescueBodyNode(this); 63 } 64 65 69 public Node getBodyNode() { 70 return bodyNode; 71 } 72 73 76 public RescueBodyNode getOptRescueNode() { 77 return optRescueNode; 78 } 79 80 84 public Node getExceptionNodes() { 85 return exceptionNodes; 86 } 87 88 public List childNodes() { 89 if (optRescueNode != null) 90 return Node.createList(exceptionNodes, bodyNode, optRescueNode); 91 return Node.createList(exceptionNodes, bodyNode); 92 93 } 94 } 95 | Popular Tags |