org.jruby.ast
Class ForNode

java.lang.Object
  extended by org.jruby.ast.Node
      extended by org.jruby.ast.IterNode
          extended by org.jruby.ast.ForNode
All Implemented Interfaces:
ISourcePositionHolder

public class ForNode
extends IterNode

A 'for' statement. This is implemented using iter and that is how MRI does things, but 'for's do not have their own stack, so doing this way is mildly painful.

See Also:
IterNode

Field Summary
 CallSite callAdapter
           
 
Fields inherited from class org.jruby.ast.Node
EMPTY_COMMENT_LIST, INVALID_POSITION, nodeId
 
Constructor Summary
ForNode(ISourcePosition position, Node varNode, Node bodyNode, Node iterNode)
           
 
Method Summary
 Instruction accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 java.util.List<Node> childNodes()
           
 Node getIterNode()
           
 IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock)
           
 
Methods inherited from class org.jruby.ast.IterNode
getBlockBody, getBodyNode, getScope, getVarNode
 
Methods inherited from class org.jruby.ast.Node
addComment, addComments, assign, createList, definition, getComments, getNodeName, getPosition, getPositionIncludingComments, hasComments, isInvisible, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

callAdapter

public final CallSite callAdapter
Constructor Detail

ForNode

public ForNode(ISourcePosition position,
               Node varNode,
               Node bodyNode,
               Node iterNode)
Method Detail

getIterNode

public Node getIterNode()

accept

public Instruction accept(NodeVisitor iVisitor)
Accept for the visitor pattern.

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

childNodes

public java.util.List<Node> childNodes()
Overrides:
childNodes in class IterNode

interpret

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


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