1 32 package org.jruby.ast; 33 34 import org.jruby.ast.types.ILiteralNode; 35 import org.jruby.ast.visitor.NodeVisitor; 36 import org.jruby.evaluator.Instruction; 37 import org.jruby.lexer.yacc.ISourcePosition; 38 39 45 public class DRegexpNode extends ListNode implements ILiteralNode { 46 static final long serialVersionUID = 7307853378003210140L; 47 48 private final int options; 49 private final boolean once; 50 51 public DRegexpNode(ISourcePosition position) { 52 this(position, 0, false); 53 } 54 55 public DRegexpNode(ISourcePosition position, DStrNode node, int options, boolean once) { 56 super(position, NodeTypes.DREGEXPNODE); 57 58 this.options = options; 59 this.once = once; 60 61 addAll(node); 62 } 63 64 public DRegexpNode(ISourcePosition position, int options, boolean once) { 65 super(position, NodeTypes.DREGEXPNODE); 66 67 this.options = options; 68 this.once = once; 69 } 70 71 75 public Instruction accept(NodeVisitor iVisitor) { 76 return iVisitor.visitDRegxNode(this); 77 } 78 79 83 public boolean getOnce() { 84 return once; 85 } 86 87 91 public int getOptions() { 92 return options; 93 } 94 } 95 | Popular Tags |