org.jruby.runtime
Class InterpretedBlock

java.lang.Object
  extended by org.jruby.runtime.BlockBody
      extended by org.jruby.runtime.ContextAwareBlockBody
          extended by org.jruby.runtime.InterpretedBlock
Direct Known Subclasses:
SharedScopeBlock

public class InterpretedBlock
extends ContextAwareBlockBody

This branch of the BlockBody hierarchy represents an interpreted block that passes its AST nodes to the interpreter. It forms the top of the hierarchy of interpreted blocks. In a typical application, it is the most heavily consumed type of block.

See Also:
SharedScopeBlock, CompiledBlock

Field Summary
protected  Assigner assigner
          Logic for assigning the blocks local variables
 
Fields inherited from class org.jruby.runtime.ContextAwareBlockBody
scope
 
Fields inherited from class org.jruby.runtime.BlockBody
argumentType, ARRAY, EMPTY_PARAMETER_LIST, MULTIPLE_ASSIGNMENT, NULL_BODY, SINGLE_RESTARG, ZERO_ARGS
 
Constructor Summary
InterpretedBlock(IterNode iterNode, Arity arity, int argumentType)
           
InterpretedBlock(IterNode iterNode, int argumentType)
           
 
Method Summary
 Node getBodyNode()
           
 java.lang.String getFile()
          Get the filename for this block
 int getLine()
          get The line number for this block
static BlockBody newBlockBody(IterNode iter, Arity arity, int argumentType)
           
static Block newInterpretedClosure(ThreadContext context, BlockBody body, IRubyObject self)
           
static Block newInterpretedClosure(ThreadContext context, IterNode iterNode, IRubyObject self)
           
 IRubyObject yield(ThreadContext context, Binding binding, Block.Type type)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type, Block block)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean alreadyArray, Binding binding, Block.Type type)
          Yield to this block, usually passed to the current call.
 IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean alreadyArray, Binding binding, Block.Type type, Block block)
           
 IRubyObject yieldSpecific(ThreadContext context, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type)
           
 
Methods inherited from class org.jruby.runtime.ContextAwareBlockBody
arity, cloneBlock, getStaticScope, post, pre, setStaticScope
 
Methods inherited from class org.jruby.runtime.BlockBody
asArgumentType, call, call, call, call, call, call, call, call, call, call, getArgumentType, getArgumentTypeWackyHack, getParameterList, isGiven, prepareArgumentsForCall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

assigner

protected Assigner assigner
Logic for assigning the blocks local variables

Constructor Detail

InterpretedBlock

public InterpretedBlock(IterNode iterNode,
                        int argumentType)

InterpretedBlock

public InterpretedBlock(IterNode iterNode,
                        Arity arity,
                        int argumentType)
Method Detail

newInterpretedClosure

public static Block newInterpretedClosure(ThreadContext context,
                                          IterNode iterNode,
                                          IRubyObject self)

newInterpretedClosure

public static Block newInterpretedClosure(ThreadContext context,
                                          BlockBody body,
                                          IRubyObject self)

newBlockBody

public static BlockBody newBlockBody(IterNode iter,
                                     Arity arity,
                                     int argumentType)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 Binding binding,
                                 Block.Type type)
Overrides:
yieldSpecific in class BlockBody

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 Binding binding,
                                 Block.Type type)
Overrides:
yieldSpecific in class BlockBody

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 Binding binding,
                                 Block.Type type)
Overrides:
yieldSpecific in class BlockBody

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 Binding binding,
                                 Block.Type type)
Overrides:
yieldSpecific in class BlockBody

yield

public IRubyObject yield(ThreadContext context,
                         Binding binding,
                         Block.Type type)

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         Binding binding,
                         Block.Type type)
Specified by:
yield in class BlockBody

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         IRubyObject self,
                         RubyModule klass,
                         boolean alreadyArray,
                         Binding binding,
                         Block.Type type,
                         Block block)
Overrides:
yield in class BlockBody

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         Binding binding,
                         Block.Type type,
                         Block block)
Overrides:
yield in class BlockBody

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         IRubyObject self,
                         RubyModule klass,
                         boolean alreadyArray,
                         Binding binding,
                         Block.Type type)
Yield to this block, usually passed to the current call.

Specified by:
yield in class BlockBody
Parameters:
context - represents the current thread-specific data
value - The value to yield, either a single value or an array of values
self - The current self
klass -
alreadyArray - do we need an array or should we assume it already is one?
Returns:
result of block invocation

getBodyNode

public Node getBodyNode()

getFile

public java.lang.String getFile()
Description copied from class: BlockBody
Get the filename for this block

Specified by:
getFile in class BlockBody

getLine

public int getLine()
Description copied from class: BlockBody
get The line number for this block

Specified by:
getLine in class BlockBody


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