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 BreakNode extends Node { 44 static final long serialVersionUID = 1491046888629861035L; 45 46 private final Node valueNode; 47 48 public BreakNode(ISourcePosition position) { 49 super(position, NodeTypes.BREAKNODE); 50 valueNode = null; 51 } 52 53 public BreakNode(ISourcePosition position, Node valueNode) { 54 super(position, NodeTypes.BREAKNODE); 55 this.valueNode = valueNode; 56 } 57 58 62 public Instruction accept(NodeVisitor iVisitor) { 63 return iVisitor.visitBreakNode(this); 64 } 65 66 70 public Node getValueNode() { 71 return valueNode; 72 } 73 74 public List childNodes() { 75 return createList(valueNode); 76 } 77 } 78 | Popular Tags |