|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoscript.NodeEvaluator
oscript.compiler.CompiledNodeEvaluator
This is the base class for all compiled script functions. I could have used an interface, but there was no need for a compiled script function object to subclass any other object.
A compiled function does not store the scope the script function was defined in, but simply a compiled version of the function's syntaxtree. This means that once a function is compiled for one scope, it does not need to be recompiled for a different scope.
Field Summary |
Fields inherited from class oscript.NodeEvaluator |
ALL, PRIVATE, PUBPROT, SMIT_PERMS |
Constructor Summary | |
protected |
CompiledNodeEvaluator(java.lang.String name,
java.lang.String desc)
Class Constructor. |
Method Summary | |
protected static Value |
evalHelper(java.lang.String str,
Scope scope)
A helper function for evaluating an EvalBlock. |
abstract java.lang.Object |
evalInnerNode(int idx,
StackFrame sf,
Scope scope)
Evaluate, in the specified scope. |
java.lang.Object |
evalNode(StackFrame sf,
Scope scope)
Evaluate, in the specified scope. |
AbstractFile |
getFile()
Get the file that this node was parsed from. |
int |
getId()
Get the function symbol (name), if this node evaluator is a function, otherwise return -1 . |
abstract SymbolTable |
getInnerSharedMemberIndexTable(int idx,
int perm)
Get the SMIT for the scope(s) created when invoking this node evaluator. |
SymbolTable |
getSharedMemberIndexTable(int perm)
Get the SMIT for the scope(s) created when invoking this node evaluator. |
protected static Value |
importHelper(java.lang.String str,
Scope scope)
A helper function for evaluating an ImportBlock. |
static Value |
returnHelper(Value val)
A helper function for evaluating an ReturnStatement or ThrowBlock, to ensure that the value being returned/thrown is not (undefined) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected CompiledNodeEvaluator(java.lang.String name, java.lang.String desc)
name
- the name of this functiondesc
- the description of input source (ie. filename)Method Detail |
public AbstractFile getFile()
getFile
in class NodeEvaluator
public int getId()
-1
.
getId
in class NodeEvaluator
-1
public java.lang.Object evalNode(StackFrame sf, Scope scope) throws PackagedScriptObjectException
scope
that the
function is evaluated in.
evalNode
in class NodeEvaluator
sf
- the stack frame to evaluate the node inscope
- the scope to evaluate the function in
PackagedScriptObjectException
public abstract java.lang.Object evalInnerNode(int idx, StackFrame sf, Scope scope) throws PackagedScriptObjectException
scope
that the
function is evaluated in.
sf
- the stack frame to evaluate the node inscope
- the scope to evaluate the function in
PackagedScriptObjectException
public SymbolTable getSharedMemberIndexTable(int perm)
getSharedMemberIndexTable
in class NodeEvaluator
perm
- PRIVATE
, PUBPROT
,
ALL
public abstract SymbolTable getInnerSharedMemberIndexTable(int idx, int perm)
protected static final Value evalHelper(java.lang.String str, Scope scope)
str
- the string to evaluatescope
- the scope to evaluate in
protected static final Value importHelper(java.lang.String str, Scope scope)
str
- the string identifying what to importscope
- the scope to evaluate in
public static final Value returnHelper(Value val)
(undefined)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |