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 EnsureNode extends Node { 44 static final long serialVersionUID = -409805241533215981L; 45 46 private final Node bodyNode; 47 private final Node ensureNode; 48 49 public EnsureNode(ISourcePosition position, Node bodyNode, Node ensureNode) { 50 super(position, NodeTypes.ENSURENODE); 51 this.bodyNode = bodyNode; 52 this.ensureNode = ensureNode; 53 } 54 55 59 public Instruction accept(NodeVisitor iVisitor) { 60 return iVisitor.visitEnsureNode(this); 61 } 62 63 67 public Node getBodyNode() { 68 return bodyNode; 69 } 70 71 75 public Node getEnsureNode() { 76 return ensureNode; 77 } 78 79 public List childNodes() { 80 return Node.createList(bodyNode, ensureNode); 81 } 82 } 83 | Popular Tags |