org.jruby.runtime
Class BlockBody

java.lang.Object
  extended by org.jruby.runtime.BlockBody
Direct Known Subclasses:
CallBlock, CallBlock19, ContextAwareBlockBody, NullBlockBody

public abstract class BlockBody
extends java.lang.Object

The executable body portion of a closure.


Field Summary
protected  int argumentType
           
static int ARRAY
           
static java.lang.String[] EMPTY_PARAMETER_LIST
           
static int MULTIPLE_ASSIGNMENT
           
static BlockBody NULL_BODY
           
static int SINGLE_RESTARG
           
static int ZERO_ARGS
           
 
Constructor Summary
BlockBody(int argumentType)
           
 
Method Summary
abstract  Arity arity()
          What is the arity of this block?
static int asArgumentType(NodeType nodeId)
          Compiled codes way of examining arguments
 IRubyObject call(ThreadContext context, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args, Binding binding, Block.Type type, Block block)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type, Block unusedBlock)
           
abstract  Block cloneBlock(Binding binding)
           
 int getArgumentType()
           
static NodeType getArgumentTypeWackyHack(IterNode iterNode)
           
abstract  java.lang.String getFile()
          Get the filename for this block
abstract  int getLine()
          get The line number for this block
 java.lang.String[] getParameterList()
           
abstract  StaticScope getStaticScope()
           
 boolean isGiven()
          Is the current block a real yield'able block instead a null one
 IRubyObject[] prepareArgumentsForCall(ThreadContext context, IRubyObject[] args, Block.Type type)
           
abstract  void setStaticScope(StaticScope newScope)
           
abstract  IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type, Block block)
           
abstract  IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean aValue, Binding binding, Block.Type type)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean aValue, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO_ARGS

public static final int ZERO_ARGS
See Also:
Constant Field Values

MULTIPLE_ASSIGNMENT

public static final int MULTIPLE_ASSIGNMENT
See Also:
Constant Field Values

ARRAY

public static final int ARRAY
See Also:
Constant Field Values

SINGLE_RESTARG

public static final int SINGLE_RESTARG
See Also:
Constant Field Values

EMPTY_PARAMETER_LIST

public static final java.lang.String[] EMPTY_PARAMETER_LIST

argumentType

protected final int argumentType

NULL_BODY

public static final BlockBody NULL_BODY
Constructor Detail

BlockBody

public BlockBody(int argumentType)
Method Detail

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        Binding binding,
                        Block.Type type,
                        Block block)

yield

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

yield

public abstract IRubyObject yield(ThreadContext context,
                                  IRubyObject value,
                                  IRubyObject self,
                                  RubyModule klass,
                                  boolean aValue,
                                  Binding binding,
                                  Block.Type type)

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         IRubyObject self,
                         RubyModule klass,
                         boolean aValue,
                         Binding binding,
                         Block.Type type,
                         Block block)

yield

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

getArgumentType

public int getArgumentType()

call

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

call

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

yieldSpecific

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

call

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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

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

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 Binding binding,
                                 Block.Type type)

getStaticScope

public abstract StaticScope getStaticScope()

setStaticScope

public abstract void setStaticScope(StaticScope newScope)

cloneBlock

public abstract Block cloneBlock(Binding binding)

arity

public abstract Arity arity()
What is the arity of this block?

Returns:
the arity

isGiven

public boolean isGiven()
Is the current block a real yield'able block instead a null one

Returns:
true if this is a valid block or false otherwise

getFile

public abstract java.lang.String getFile()
Get the filename for this block


getLine

public abstract int getLine()
get The line number for this block


asArgumentType

public static int asArgumentType(NodeType nodeId)
Compiled codes way of examining arguments

Parameters:
nodeId - to be considered
Returns:
something not linked to AST and a constant to make compiler happy

prepareArgumentsForCall

public IRubyObject[] prepareArgumentsForCall(ThreadContext context,
                                             IRubyObject[] args,
                                             Block.Type type)

getParameterList

public java.lang.String[] getParameterList()

getArgumentTypeWackyHack

public static NodeType getArgumentTypeWackyHack(IterNode iterNode)


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