public abstract class DynamicScope extends Object
Modifier and Type | Field and Description |
---|---|
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 |
---|---|
void |
clearEvalType() |
abstract DynamicScope |
cloneScope() |
String[] |
getAllNamesInScope()
Get all variable names captured (visible) by this scope (sans $~ and $_).
|
EvalType |
getEvalType() |
DynamicScope |
getFlipScope()
Find the scope to use for flip-flops.
|
DynamicScope |
getNextCapturedScope()
Deprecated.
|
DynamicScope |
getNthParentScope(int n)
Returns the n-th parent scope of this scope.
|
DynamicScope |
getParentScope()
Get parent (capturing) 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() |
boolean |
inBindingEval() |
boolean |
inInstanceEval() |
boolean |
inModuleEval() |
boolean |
isLambda() |
static DynamicScope |
newDummyScope(StaticScope staticScope,
DynamicScope parent) |
static DynamicScope |
newDynamicScope(StaticScope staticScope) |
static DynamicScope |
newDynamicScope(StaticScope staticScope,
DynamicScope parent) |
static DynamicScope |
newDynamicScope(StaticScope staticScope,
DynamicScope parent,
EvalType evalType) |
void |
setEvalType(EvalType evalType) |
void |
setLambda(boolean lambda) |
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
|
void |
setValueDepthZeroVoid(IRubyObject value,
int offset)
setValue for depth zero
|
abstract IRubyObject |
setValueOneDepthZero(IRubyObject value)
Set value one in this scope.
|
void |
setValueOneDepthZeroVoid(IRubyObject value)
Set value one in this scope.
|
abstract IRubyObject |
setValueThreeDepthZero(IRubyObject value)
Set value three in this scope.
|
void |
setValueThreeDepthZeroVoid(IRubyObject value)
Set value three in this scope.
|
abstract IRubyObject |
setValueTwoDepthZero(IRubyObject value)
Set value two in this scope.
|
void |
setValueTwoDepthZeroVoid(IRubyObject value)
Set value two in this scope.
|
void |
setValueVoid(IRubyObject value,
int offset,
int depth)
Set value in current dynamic scope or one of its captured scopes.
|
abstract IRubyObject |
setValueZeroDepthZero(IRubyObject value)
Set value zero in this scope;
|
void |
setValueZeroDepthZeroVoid(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(StaticScope staticScope, DynamicScope parent)
protected DynamicScope(StaticScope staticScope)
public static DynamicScope newDynamicScope(StaticScope staticScope, DynamicScope parent)
public static DynamicScope newDynamicScope(StaticScope staticScope, DynamicScope parent, EvalType evalType)
public static DynamicScope newDummyScope(StaticScope staticScope, DynamicScope parent)
public final DynamicScope getParentScope()
@Deprecated public DynamicScope getNextCapturedScope()
public DynamicScope getNthParentScope(int n)
null
.n
- - number of levels above to look.null
.public static DynamicScope newDynamicScope(StaticScope staticScope)
public DynamicScope getFlipScope()
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 void setValueVoid(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)
value
- to setoffset
- zero-indexed value that represents where variable livespublic void setValueDepthZeroVoid(IRubyObject value, int offset)
value
- to setoffset
- zero-indexed value that represents where variable livespublic abstract IRubyObject setValueZeroDepthZero(IRubyObject value)
public void setValueZeroDepthZeroVoid(IRubyObject value)
public abstract IRubyObject setValueOneDepthZero(IRubyObject value)
public void setValueOneDepthZeroVoid(IRubyObject value)
public abstract IRubyObject setValueTwoDepthZero(IRubyObject value)
public void setValueTwoDepthZeroVoid(IRubyObject value)
public abstract IRubyObject setValueThreeDepthZero(IRubyObject value)
public void setValueThreeDepthZeroVoid(IRubyObject value)
public String toString(StringBuffer buf, String indent)
public boolean inInstanceEval()
public boolean inModuleEval()
public boolean inBindingEval()
public void setEvalType(EvalType evalType)
public EvalType getEvalType()
public void clearEvalType()
public void setLambda(boolean lambda)
public boolean isLambda()
Copyright © 2001-2016 JRuby. All Rights Reserved.