org.jruby.ast
Class DRegexpNode

java.lang.Object
  extended by org.jruby.ast.Node
      extended by org.jruby.ast.ListNode
          extended by org.jruby.ast.DRegexpNode
All Implemented Interfaces:
ILiteralNode, ISourcePositionHolder

public class DRegexpNode
extends ListNode
implements ILiteralNode

A regexp which contains some expressions which will need to be evaluated everytime the regexp is used for a match.


Constructor Summary
DRegexpNode(ISourcePosition position)
           
DRegexpNode(ISourcePosition position, DStrNode node, int options, boolean once)
           
DRegexpNode(ISourcePosition position, int options, boolean once)
           
 
Method Summary
 java.lang.Object accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 NodeType getNodeType()
           
 boolean getOnce()
          Gets the once.
 RubyRegexp getOnceRegexp()
          For regular expressions with /o flag
 int getOptions()
          Gets the options.
 IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock)
           
 void setOnceRegexp(RubyRegexp regexp)
          For regular expressions with /o flag, the value in here can be used for subsequent evaluations.
 
Methods inherited from class org.jruby.ast.ListNode
add, addAll, addAll, childNodes, get, getLast, prepend, size
 
Methods inherited from class org.jruby.ast.Node
assign, createList, definition, getNodeName, getPosition, isInvisible, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DRegexpNode

public DRegexpNode(ISourcePosition position)

DRegexpNode

public DRegexpNode(ISourcePosition position,
                   DStrNode node,
                   int options,
                   boolean once)

DRegexpNode

public DRegexpNode(ISourcePosition position,
                   int options,
                   boolean once)
Method Detail

getNodeType

public NodeType getNodeType()
Overrides:
getNodeType in class ListNode
Returns:
the nodeId

accept

public java.lang.Object accept(NodeVisitor iVisitor)
Accept for the visitor pattern.

Overrides:
accept in class ListNode
Parameters:
iVisitor - the visitor

getOnce

public boolean getOnce()
Gets the once.

Returns:
Returns a boolean

getOptions

public int getOptions()
Gets the options.

Returns:
Returns a int

getOnceRegexp

public RubyRegexp getOnceRegexp()
For regular expressions with /o flag

Returns:

setOnceRegexp

public void setOnceRegexp(RubyRegexp regexp)
For regular expressions with /o flag, the value in here can be used for subsequent evaluations. Setting will only succeed if it is a regular expression with /o flag, and the value hasn't been already set.

Parameters:
regexp -

interpret

public IRubyObject interpret(Ruby runtime,
                             ThreadContext context,
                             IRubyObject self,
                             Block aBlock)
Overrides:
interpret in class Node


Copyright © 2002-2007 JRuby Team. All Rights Reserved.