|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoscript.data.Value
oscript.data.Scope
oscript.data.ForkScope
public class ForkScope
The ForkScope is used to implement a fork in the scope
chain. This is needed because when evaluating a superFxn, or a
method defined in the superFxn, the scope chain should use the scope
that the superFxn is defined in, rather than the scope of the
derived function.
This is basically just a simple wrapper for the obj,
with the exception that lookupInScope uses env as the
previous instead. This means that any member created in this scope
is actually created in the obj scope.
| Field Summary |
|---|
| Fields inherited from class oscript.data.Scope |
|---|
previous |
| Fields inherited from class oscript.data.Value |
|---|
DEBUG, MEMBER_NAMES, NULL, PARENT_TYPE_NAME, TYPE, TYPE_NAME, UNDEFINED |
| Method Summary | |
|---|---|
Value |
__getInstanceMember(int id)
|
Value |
createMember(int id,
int attr)
Create a member of this object with the specified value. |
void |
free()
Indicate that this scope is no longer needed |
Value |
getMember(int id,
boolean exception)
Get a member of this object. |
Scope |
getSafeCopy()
In case a scope has any resource allocated from a source which will no long be valid after a stack frame has returned (ie. |
Value |
getSuper()
Lookup the "super" within a scope. |
protected Value |
getTypeImpl()
Get the type of this object. |
boolean |
isSafe()
|
Value |
lookupInScope(int id)
Get a member from this scope. |
void |
mixin(Value val)
"mixin" the specified variable into the current scope. |
| Methods inherited from class oscript.data.Scope |
|---|
__setJavaObject, createMember, createMember, findDesc, getCallee, getInstanceMemberImpl, getMemberImpl, getPreviousScope, getThis, getThis, lookupInScope, lookupInScope |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public boolean isSafe()
isSafe in class Scopeprotected Value getTypeImpl()
Value.getType().
getTypeImpl in class Valuepublic Scope getSafeCopy()
getSafeCopy in class Scopepublic Value getSuper()
getSuper in class Scope
public Value createMember(int id,
int attr)
createMember in class Scopeid - the id of the symbol that maps to the memberattr - the attributes of the object (see Reference.)Referencepublic void mixin(Value val)
mixin in class Scopeval - the value to mixin to this scope
public Value getMember(int id,
boolean exception)
throws PackagedScriptObjectException
getMember in class Valueid - the id of the symbol that maps to the memberexception - whether an exception should be thrown if the
member object is not resolved
PackagedScriptObjectException(NoSuchMethodException)
PackagedScriptObjectException(NoSuchMemberException)
PackagedScriptObjectExceptionpublic Value __getInstanceMember(int id)
__getInstanceMember in class Scope
public Value lookupInScope(int id)
throws PackagedScriptObjectException
previous
node in the scope chain is checked.
lookupInScope in class Scopeid - the id of the symbol that maps to the member
PackagedScriptObjectException(NoSuchMemberException)
PackagedScriptObjectExceptionpublic void free()
free in class Scope
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||