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 47 public class CaseNode extends Node { 48 static final long serialVersionUID = -2824917272720800901L; 49 50 53 private final Node caseNode; 54 57 private final Node caseBody; 58 59 public CaseNode(ISourcePosition position, Node caseNode, Node caseBody) { 60 super(position, NodeTypes.CASENODE); 61 this.caseNode = caseNode; 62 this.caseBody = caseBody; 63 } 64 65 69 public Instruction accept(NodeVisitor iVisitor) { 70 return iVisitor.visitCaseNode(this); 71 } 72 73 78 public Node getCaseNode() { 79 return caseNode; 80 } 81 82 87 public Node getFirstWhenNode() { 88 return caseBody; 89 } 90 91 public List childNodes() { 92 return Node.createList(caseNode, caseBody); 93 } 94 95 } 96 | Popular Tags |