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 WhenNode extends Node { 44 static final long serialVersionUID = 9099987602002276708L; 45 46 private final Node expressionNodes; 47 private final Node bodyNode; 48 private final Node nextCase; 49 50 public WhenNode(ISourcePosition position, Node expressionNodes, Node bodyNode, Node nextCase) { 51 super(position, NodeTypes.WHENNODE); 52 this.expressionNodes = expressionNodes; 53 this.bodyNode = bodyNode; 54 this.nextCase = nextCase; 55 } 56 57 61 public Instruction accept(NodeVisitor iVisitor) { 62 return iVisitor.visitWhenNode(this); 63 } 64 65 69 public Node getBodyNode() { 70 return bodyNode; 71 } 72 73 76 public Node getNextCase() { 77 return nextCase; 78 } 79 80 83 public Node getExpressionNodes() { 84 return expressionNodes; 85 } 86 87 public List childNodes() { 88 return Node.createList(expressionNodes, bodyNode, nextCase); 89 } 90 } 91 | Popular Tags |