public abstract class DynamicScope extends Object
Modifier and Type | Field and Description |
---|---|
protected DynamicScope |
evalScope |
protected DynamicScope |
parent |
protected StaticScope |
staticScope |
Modifier | Constructor and Description |
---|---|
protected |
DynamicScope(StaticScope staticScope) |
protected |
DynamicScope(StaticScope staticScope,
DynamicScope parent) |
Modifier and Type | Method and Description |
---|---|
abstract DynamicScope |
cloneScope() |
String[] |
getAllNamesInScope()
Get all variable names captured (visible) by this scope (sans $~ and $_).
|
abstract IRubyObject[] |
getArgValues()
Copy variable values back for ZSuper call.
|
DynamicScope |
getEvalScope(Ruby runtime) |
DynamicScope |
getFlipScope()
Find the scope to use for flip-flops.
|
DynamicScope |
getNextCapturedScope()
Get next 'captured' scope.
|
DynamicScope |
getNthParentScope(int n)
Returns the n-th parent scope of this scope.
|
StaticScope |
getStaticScope()
Get the static scope associated with this DynamicScope.
|
abstract IRubyObject |
getValue(int offset,
int depth)
Get value from current scope or one of its captured scopes.
|
abstract IRubyObject |
getValueDepthZeroOrNil(int offset,
IRubyObject nil)
getValueOrNil for depth 0
|
abstract IRubyObject |
getValueOneDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 1, depth 0
|
abstract IRubyObject |
getValueOrNil(int offset,
int depth,
IRubyObject nil)
Variation of getValue that checks for nulls, returning and setting the given value (presumably nil)
|
abstract IRubyObject[] |
getValues() |
abstract IRubyObject |
getValueThreeDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 3, depth 0
|
abstract IRubyObject |
getValueTwoDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 2, depth 0
|
abstract IRubyObject |
getValueZeroDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 0, depth 0
|
abstract void |
growIfNeeded() |
static DynamicScope |
newDummyScope(StaticScope staticScope,
DynamicScope parent) |
static DynamicScope |
newDynamicScope(StaticScope staticScope) |
static DynamicScope |
newDynamicScope(StaticScope staticScope,
DynamicScope parent) |
void |
setArgValues() |
void |
setArgValues(IRubyObject arg0) |
abstract void |
setArgValues(IRubyObject[] values,
int size)
Set all values which represent 'normal' parameters in a call list to this dynamic
scope.
|
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
IRubyObject arg4) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
IRubyObject arg4,
IRubyObject arg5) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
IRubyObject arg4,
IRubyObject arg5,
IRubyObject arg6) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
IRubyObject arg4,
IRubyObject arg5,
IRubyObject arg6,
IRubyObject arg7) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
IRubyObject arg4,
IRubyObject arg5,
IRubyObject arg6,
IRubyObject arg7,
IRubyObject arg8) |
void |
setArgValues(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
IRubyObject arg4,
IRubyObject arg5,
IRubyObject arg6,
IRubyObject arg7,
IRubyObject arg8,
IRubyObject arg9) |
abstract void |
setEndArgValues(IRubyObject[] values,
int index,
int size) |
abstract IRubyObject |
setValue(int offset,
IRubyObject value,
int depth)
Set value in current dynamic scope or one of its captured scopes.
|
IRubyObject |
setValue(IRubyObject value,
int offset,
int depth)
Set value in current dynamic scope or one of its captured scopes.
|
abstract IRubyObject |
setValueDepthZero(IRubyObject value,
int offset)
setValue for depth zero
|
abstract IRubyObject |
setValueOneDepthZero(IRubyObject value)
Set value one in this scope.
|
abstract IRubyObject |
setValueThreeDepthZero(IRubyObject value)
Set value three in this scope.
|
abstract IRubyObject |
setValueTwoDepthZero(IRubyObject value)
Set value two in this scope.
|
abstract IRubyObject |
setValueZeroDepthZero(IRubyObject value)
Set value zero in this scope;
|
String |
toString() |
String |
toString(StringBuffer buf,
String indent) |
protected final StaticScope staticScope
protected final DynamicScope parent
protected DynamicScope evalScope
protected DynamicScope(StaticScope staticScope, DynamicScope parent)
protected DynamicScope(StaticScope staticScope)
public static DynamicScope newDynamicScope(StaticScope staticScope, DynamicScope parent)
public static DynamicScope newDummyScope(StaticScope staticScope, DynamicScope parent)
public DynamicScope getNthParentScope(int n)
null
.n
- - number of levels above to look.null
.public static DynamicScope newDynamicScope(StaticScope staticScope)
public final DynamicScope getEvalScope(Ruby runtime)
public DynamicScope getFlipScope()
public final DynamicScope getNextCapturedScope()
public final StaticScope getStaticScope()
public final String[] getAllNamesInScope()
public abstract void growIfNeeded()
public abstract DynamicScope cloneScope()
public abstract IRubyObject[] getValues()
public abstract IRubyObject getValue(int offset, int depth)
offset
- zero-indexed value that represents where variable livesdepth
- how many captured scopes down this variable should be setpublic abstract IRubyObject getValueOrNil(int offset, int depth, IRubyObject nil)
public abstract IRubyObject getValueDepthZeroOrNil(int offset, IRubyObject nil)
public abstract IRubyObject getValueZeroDepthZeroOrNil(IRubyObject nil)
public abstract IRubyObject getValueOneDepthZeroOrNil(IRubyObject nil)
public abstract IRubyObject getValueTwoDepthZeroOrNil(IRubyObject nil)
public abstract IRubyObject getValueThreeDepthZeroOrNil(IRubyObject nil)
public abstract IRubyObject setValue(int offset, IRubyObject value, int depth)
offset
- zero-indexed value that represents where variable livesvalue
- to setdepth
- how many captured scopes down this variable should be setpublic IRubyObject setValue(IRubyObject value, int offset, int depth)
offset
- zero-indexed value that represents where variable livesvalue
- to setdepth
- how many captured scopes down this variable should be setpublic abstract IRubyObject setValueDepthZero(IRubyObject value, int offset)
offset
- zero-indexed value that represents where variable livesvalue
- to setdepth
- how many captured scopes down this variable should be setpublic abstract IRubyObject setValueZeroDepthZero(IRubyObject value)
public abstract IRubyObject setValueOneDepthZero(IRubyObject value)
public abstract IRubyObject setValueTwoDepthZero(IRubyObject value)
public abstract IRubyObject setValueThreeDepthZero(IRubyObject value)
public abstract void setArgValues(IRubyObject[] values, int size)
values
- up to size specified to be mapped as ordinary parm valuessize
- is the number of values to assign as ordinary parm valuespublic void setArgValues()
public void setArgValues(IRubyObject arg0)
public void setArgValues(IRubyObject arg0, IRubyObject arg1)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8)
public void setArgValues(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9)
public abstract void setEndArgValues(IRubyObject[] values, int index, int size)
values
- group where last n(size) values are usedindex
- index in the dynamic scope to start setting these valuessize
- which of the last size arguments of values parameter to setpublic abstract IRubyObject[] getArgValues()
public String toString(StringBuffer buf, String indent)
Copyright © 2001-2013 JRuby. All Rights Reserved.