org.jruby.runtime
Class BlockBody
java.lang.Object
org.jruby.runtime.BlockBody
- All Implemented Interfaces:
- JumpTarget
- Direct Known Subclasses:
- CallBlock, CompiledBlock, InterpretedBlock, MethodBlock
public abstract class BlockBody
- extends java.lang.Object
- implements JumpTarget
The executable body portion of a closure.
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,
IRubyObject[] args,
Binding binding,
Block.Type type)
|
abstract Block |
cloneBlock(Binding binding)
|
int |
getArgumentType()
|
static NodeType |
getArgumentTypeWackyHack(IterNode iterNode)
|
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 IRubyObject |
yield(ThreadContext context,
IRubyObject value,
Binding binding,
Block.Type type)
|
abstract IRubyObject |
yield(ThreadContext context,
IRubyObject value,
IRubyObject self,
RubyModule klass,
boolean aValue,
Binding binding,
Block.Type type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
argumentType
protected final int argumentType
NULL_BODY
public static final BlockBody NULL_BODY
BlockBody
public BlockBody(int argumentType)
call
public IRubyObject call(ThreadContext context,
IRubyObject[] args,
Binding binding,
Block.Type type)
getArgumentType
public int getArgumentType()
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)
getStaticScope
public abstract StaticScope getStaticScope()
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
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)
getArgumentTypeWackyHack
public static NodeType getArgumentTypeWackyHack(IterNode iterNode)
Copyright © 2002-2007 JRuby Team. All Rights Reserved.