org.jruby.ast
Class ForNode

java.lang.Object
  extended byorg.jruby.ast.AbstractNode
      extended byorg.jruby.ast.ForNode
All Implemented Interfaces:
INode, java.io.Serializable

public class ForNode
extends AbstractNode

a For statement. this is almost equivalent to an iternode (the difference being the visibility of the local variables defined in the iterator).

Version:
$Revision: 1.3 $
Author:
jpetersen
See Also:
IterNode, Serialized Form

Constructor Summary
ForNode(ISourcePosition position, INode varNode, INode bodyNode, INode iterNode)
           
 
Method Summary
 void accept(INodeVisitor iVisitor)
          Accept for the visitor pattern.
 INode getBodyNode()
          Gets the bodyNode.
 INode getIterNode()
          Gets the iterNode.
 INode getVarNode()
          Gets the varNode.
 
Methods inherited from class org.jruby.ast.AbstractNode
getPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForNode

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

accept

public void accept(INodeVisitor iVisitor)
Accept for the visitor pattern.

Parameters:
iVisitor - the visitor

getBodyNode

public INode getBodyNode()
Gets the bodyNode. bodyNode is the expression after the in, it is the expression which will have its each() method called.

Returns:
Returns a INode

getIterNode

public INode getIterNode()
Gets the iterNode. iterNode is the block which will be executed when the each() method of the bodyNode will yield.

Returns:
Returns a INode

getVarNode

public INode getVarNode()
Gets the varNode. varNode is the equivalent of the block variable in a regular method call with block type of iteration

Returns:
Returns a INode


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.