1 32 package org.jruby.ast; 33 34 import java.util.List ; 35 36 import org.jruby.ast.visitor.NodeVisitor; 37 import org.jruby.evaluator.Instruction; 38 import org.jruby.lexer.yacc.ISourcePosition; 39 40 46 public class FlipNode extends Node { 47 static final long serialVersionUID = -4735579451657299802L; 48 49 private final Node beginNode; 50 private final Node endNode; 51 private final boolean exclusive; 52 private final int location; 55 56 public FlipNode(ISourcePosition position, Node beginNode, Node endNode, boolean exclusive, int location) { 57 super(position, NodeTypes.FLIPNODE); 58 this.beginNode = beginNode; 59 this.endNode = endNode; 60 this.exclusive = exclusive; 61 this.location = location; 62 } 63 64 68 public Instruction accept(NodeVisitor iVisitor) { 69 return iVisitor.visitFlipNode(this); 70 } 71 72 77 public Node getBeginNode() { 78 return beginNode; 79 } 80 81 86 public Node getEndNode() { 87 return endNode; 88 } 89 90 95 public boolean isExclusive() { 96 return exclusive; 97 } 98 99 104 public int getDepth() { 105 return location >> 16; 106 } 107 108 114 public int getIndex() { 115 return location & 0xffff; 116 } 117 118 public List childNodes() { 119 return Node.createList(beginNode, endNode); 120 } 121 122 } 123 | Popular Tags |