public abstract class DynamicScope
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected DynamicScope |
parent |
protected StaticScope |
staticScope |
Modifier | Constructor and Description |
---|---|
protected |
DynamicScope(StaticScope staticScope,
DynamicScope parent) |
Modifier and Type | Method and Description |
---|---|
void |
clearEvalType() |
DynamicScope |
cloneScope()
Deprecated.
|
java.lang.String[] |
getAllNamesInScope()
Get all variable names captured (visible) by this scope (sans $~ and $_).
|
EvalType |
getEvalType() |
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.
|
IRubyObject |
getValueDepthZero(int offset)
Variation of getValue for depth 0
|
IRubyObject |
getValueDepthZeroOrNil(int offset,
IRubyObject nil)
getValueOrNil for depth 0
|
IRubyObject |
getValueEightDepthZero()
getValue for index 8, depth 0
|
IRubyObject |
getValueEightDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 8, depth 0
|
IRubyObject |
getValueFiveDepthZero()
getValue for index 5, depth 0
|
IRubyObject |
getValueFiveDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 5, depth 0
|
IRubyObject |
getValueFourDepthZero()
getValue for index 4, depth 0
|
IRubyObject |
getValueFourDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 4, depth 0
|
IRubyObject |
getValueNineDepthZero()
getValue for index 9, depth 0
|
IRubyObject |
getValueNineDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 9, depth 0
|
IRubyObject |
getValueOneDepthZero()
getValue for index 1, depth 0
|
IRubyObject |
getValueOneDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 1, depth 0
|
IRubyObject |
getValueOrNil(int offset,
int depth,
IRubyObject nil)
Variation of getValue that checks for nulls, returning and setting the given value (presumably nil)
|
IRubyObject[] |
getValues() |
IRubyObject |
getValueSevenDepthZero()
getValue for index 7, depth 0
|
IRubyObject |
getValueSevenDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 7, depth 0
|
IRubyObject |
getValueSixDepthZero()
getValue for index 6, depth 0
|
IRubyObject |
getValueSixDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 6, depth 0
|
IRubyObject |
getValueThreeDepthZero()
getValue for index 3, depth 0
|
IRubyObject |
getValueThreeDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 3, depth 0
|
IRubyObject |
getValueTwoDepthZero()
getValue for index 2, depth 0
|
IRubyObject |
getValueTwoDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 2, depth 0
|
IRubyObject |
getValueZeroDepthZero()
getValue for index 0, depth 0
|
IRubyObject |
getValueZeroDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 0, depth 0
|
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) |
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.
|
IRubyObject |
setValueDepthZero(IRubyObject value,
int offset)
setValue for depth zero
|
void |
setValueDepthZeroVoid(IRubyObject value,
int offset)
setValue for depth zero
|
void |
setValueEightDepthZeroVoid(IRubyObject value)
Set value eight in this scope.
|
void |
setValueFiveDepthZeroVoid(IRubyObject value)
Set value five in this scope.
|
void |
setValueFourDepthZeroVoid(IRubyObject value)
Set value four in this scope.
|
void |
setValueNineDepthZeroVoid(IRubyObject value)
Set value nine in this scope.
|
IRubyObject |
setValueOneDepthZero(IRubyObject value)
Set value one in this scope.
|
void |
setValueOneDepthZeroVoid(IRubyObject value)
Set value one in this scope.
|
void |
setValueSevenDepthZeroVoid(IRubyObject value)
Set value seven in this scope.
|
void |
setValueSixDepthZeroVoid(IRubyObject value)
Set value six in this scope.
|
IRubyObject |
setValueThreeDepthZero(IRubyObject value)
Set value three in this scope.
|
void |
setValueThreeDepthZeroVoid(IRubyObject value)
Set value three in this scope.
|
IRubyObject |
setValueTwoDepthZero(IRubyObject value)
Set value two in this scope.
|
void |
setValueTwoDepthZeroVoid(IRubyObject value)
Set value two in this scope.
|
abstract void |
setValueVoid(IRubyObject value,
int offset,
int depth)
Set value in current dynamic scope or one of its captured scopes.
|
IRubyObject |
setValueZeroDepthZero(IRubyObject value)
Set value zero in this scope;
|
void |
setValueZeroDepthZeroVoid(IRubyObject value)
Set value zero in this scope;
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.StringBuffer buf,
java.lang.String indent) |
protected final StaticScope staticScope
protected final DynamicScope parent
protected DynamicScope(StaticScope staticScope, DynamicScope parent)
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 final StaticScope getStaticScope()
public final java.lang.String[] getAllNamesInScope()
public void growIfNeeded()
public 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 IRubyObject getValueDepthZero(int offset)
public IRubyObject getValueZeroDepthZero()
public IRubyObject getValueOneDepthZero()
public IRubyObject getValueTwoDepthZero()
public IRubyObject getValueThreeDepthZero()
public IRubyObject getValueFourDepthZero()
public IRubyObject getValueFiveDepthZero()
public IRubyObject getValueSixDepthZero()
public IRubyObject getValueSevenDepthZero()
public IRubyObject getValueEightDepthZero()
public IRubyObject getValueNineDepthZero()
public IRubyObject getValueOrNil(int offset, int depth, IRubyObject nil)
public IRubyObject getValueDepthZeroOrNil(int offset, IRubyObject nil)
public IRubyObject getValueZeroDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueOneDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueTwoDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueThreeDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueFourDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueFiveDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueSixDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueSevenDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueEightDepthZeroOrNil(IRubyObject nil)
public IRubyObject getValueNineDepthZeroOrNil(IRubyObject nil)
public 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 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 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 IRubyObject setValueZeroDepthZero(IRubyObject value)
public void setValueZeroDepthZeroVoid(IRubyObject value)
public IRubyObject setValueOneDepthZero(IRubyObject value)
public void setValueOneDepthZeroVoid(IRubyObject value)
public IRubyObject setValueTwoDepthZero(IRubyObject value)
public void setValueTwoDepthZeroVoid(IRubyObject value)
public IRubyObject setValueThreeDepthZero(IRubyObject value)
public void setValueThreeDepthZeroVoid(IRubyObject value)
public void setValueFourDepthZeroVoid(IRubyObject value)
public void setValueFiveDepthZeroVoid(IRubyObject value)
public void setValueSixDepthZeroVoid(IRubyObject value)
public void setValueSevenDepthZeroVoid(IRubyObject value)
public void setValueEightDepthZeroVoid(IRubyObject value)
public void setValueNineDepthZeroVoid(IRubyObject value)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.StringBuffer buf, java.lang.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()
@Deprecated public DynamicScope cloneScope()
Copyright © 2001-2020 JRuby. All Rights Reserved.