|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.runtime.DynamicScope
public abstract class DynamicScope
Field Summary | |
---|---|
protected DynamicScope |
evalScope
|
protected DynamicScope |
parent
|
protected StaticScope |
staticScope
|
Constructor Summary | |
---|---|
protected |
DynamicScope(StaticScope staticScope)
|
protected |
DynamicScope(StaticScope staticScope,
DynamicScope parent)
|
Method Summary | |
---|---|
abstract DynamicScope |
cloneScope()
|
java.lang.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()
|
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 |
getValueZeroDepthZeroOrNil(IRubyObject nil)
getValueOrNil for index 0, depth 0 |
abstract void |
growIfNeeded()
|
static DynamicScope |
newDynamicScope(StaticScope staticScope)
|
static DynamicScope |
newDynamicScope(StaticScope staticScope,
DynamicScope parent)
|
abstract void |
setArgValues(IRubyObject[] values,
int size)
Set all values which represent 'normal' parameters in a call list to this dynamic scope. |
abstract void |
setValue(int offset,
IRubyObject value,
int depth)
Set value in current dynamic scope or one of its captured scopes. |
abstract void |
setValueDepthZero(IRubyObject value,
int offset)
setValue for depth zero |
abstract void |
setValueOneDepthZero(IRubyObject value)
Set value in current dynamic scope or one of its captured scopes. |
abstract void |
setValueZeroDepthZero(IRubyObject value)
Set value in current dynamic scope or one of its captured scopes. |
java.lang.String |
toString()
|
abstract java.lang.String |
toString(java.lang.StringBuffer buf,
java.lang.String indent)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected StaticScope staticScope
protected DynamicScope parent
protected DynamicScope evalScope
Constructor Detail |
---|
protected DynamicScope(StaticScope staticScope, DynamicScope parent)
protected DynamicScope(StaticScope staticScope)
Method Detail |
---|
public static DynamicScope newDynamicScope(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()
public final DynamicScope getNextCapturedScope()
public final StaticScope getStaticScope()
public final java.lang.String[] getAllNamesInScope()
public java.lang.String toString()
toString
in class java.lang.Object
public abstract void growIfNeeded()
public abstract java.lang.String toString(java.lang.StringBuffer buf, java.lang.String indent)
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 set
public 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 void 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 abstract void 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 void setValueZeroDepthZero(IRubyObject value)
offset
- zero-indexed value that represents where variable livesvalue
- to setdepth
- how many captured scopes down this variable should be setpublic abstract void setValueOneDepthZero(IRubyObject value)
offset
- zero-indexed value that represents where variable livesvalue
- to setdepth
- how many captured scopes down this variable should be setpublic 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 abstract IRubyObject[] getArgValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |