| java.lang.Object oscript.NodeEvaluator oscript.compiler.CompiledNodeEvaluator
CompiledNodeEvaluator | abstract public class CompiledNodeEvaluator extends NodeEvaluator (Code) | | 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.
author: Rob Clark (rob@ti.com) author: version: 1.19 |
Constructor Summary | |
protected | CompiledNodeEvaluator(String name, String desc) Class Constructor.
Parameters: name - the name of this function Parameters: desc - the description of input source (ie. |
Method Summary | |
final protected static Value | evalHelper(String str, Scope scope) A helper function for evaluating an EvalBlock. | abstract public Object | evalInnerNode(int idx, StackFrame sf, Scope scope) Evaluate, in the specified scope. | public Object | evalNode(StackFrame sf, Scope scope) Evaluate, in the specified scope. | public AbstractFile | getFile() Get the file that this node was parsed from. | public int | getId() Get the function symbol (name), if this node evaluator is a function,
otherwise return -1 . | abstract public SymbolTable | getInnerSharedMemberIndexTable(int idx, int perm) Get the SMIT for the scope(s) created when invoking this node evaluator. | public SymbolTable | getSharedMemberIndexTable(int perm) Get the SMIT for the scope(s) created when invoking this node evaluator. | final protected static Value | importHelper(String path, Scope scope) A helper function for evaluating an ImportBlock. | final public 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) . |
CompiledNodeEvaluator | protected CompiledNodeEvaluator(String name, String desc)(Code) | | Class Constructor.
Parameters: name - the name of this function Parameters: desc - the description of input source (ie. filename) |
evalHelper | final protected static Value evalHelper(String str, Scope scope)(Code) | | A helper function for evaluating an EvalBlock.
Parameters: str - the string to evaluate Parameters: scope - the scope to evaluate in the result |
evalInnerNode | abstract public Object evalInnerNode(int idx, StackFrame sf, Scope scope) throws PackagedScriptObjectException(Code) | | Evaluate, in the specified scope. If this is a function, the Arguments
to the function, etc., are defined in the scope that the
function is evaluated in.
Parameters: sf - the stack frame to evaluate the node in Parameters: scope - the scope to evaluate the function in the result of evaluating the function |
evalNode | public Object evalNode(StackFrame sf, Scope scope) throws PackagedScriptObjectException(Code) | | Evaluate, in the specified scope. If this is a function, the Arguments
to the function, etc., are defined in the scope that the
function is evaluated in.
Parameters: sf - the stack frame to evaluate the node in Parameters: scope - the scope to evaluate the function in the result of evaluating the function |
getFile | public AbstractFile getFile()(Code) | | Get the file that this node was parsed from.
the file |
getId | public int getId()(Code) | | Get the function symbol (name), if this node evaluator is a function,
otherwise return -1 .
the symbol, or -1 |
getInnerSharedMemberIndexTable | abstract public SymbolTable getInnerSharedMemberIndexTable(int idx, int perm)(Code) | | Get the SMIT for the scope(s) created when invoking this node evaluator.
|
getSharedMemberIndexTable | public SymbolTable getSharedMemberIndexTable(int perm)(Code) | | Get the SMIT for the scope(s) created when invoking this node evaluator.
Parameters: perm - PRIVATE , PUBPROT ,ALL |
importHelper | final protected static Value importHelper(String path, Scope scope)(Code) | | A helper function for evaluating an ImportBlock.
Parameters: path - the string identifying what to import Parameters: scope - the scope to evaluate in the result |
returnHelper | final public static Value returnHelper(Value val)(Code) | | A helper function for evaluating an ReturnStatement or
ThrowBlock, to ensure that the value being returned/thrown
is not (undefined) .
|
|
|