oscript
Class NodeEvaluator

java.lang.Object
  extended byoscript.NodeEvaluator
Direct Known Subclasses:
CompiledInnerNodeEvaluator, CompiledNodeEvaluator, InterpretedNodeEvaluator

public abstract class NodeEvaluator
extends java.lang.Object

A NodeEvaluator is created by the NodeFactory to evaluate a node. The node-evaluator can be used any number of times in order to evaluate a node, and must be thread safe.

Version:
1.2
Author:
Rob Clark (rob@ti.com)

Field Summary
static int ALL
           
static int PRIVATE
           
static int PUBPROT
           
static int[] SMIT_PERMS
           
 
Constructor Summary
NodeEvaluator()
           
 
Method Summary
abstract  java.lang.Object evalNode(StackFrame sf, Scope scope)
          Evaluate, in the specified scope.
abstract  AbstractFile getFile()
          Get the file that this node was parsed from.
abstract  int getId()
          Get the function symbol (name), if this node evaluator is a function, otherwise return -1.
abstract  SymbolTable getSharedMemberIndexTable(int perm)
          Get the SMIT for the scope(s) created when invoking this node evaluator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
See Also:
Constant Field Values

PUBPROT

public static final int PUBPROT
See Also:
Constant Field Values

PRIVATE

public static final int PRIVATE
See Also:
Constant Field Values

SMIT_PERMS

public static final int[] SMIT_PERMS
Constructor Detail

NodeEvaluator

public NodeEvaluator()
Method Detail

evalNode

public abstract java.lang.Object evalNode(StackFrame sf,
                                          Scope scope)
                                   throws PackagedScriptObjectException
Evaluate, in the specified scope.

Parameters:
sf - the stack frame to evaluate the node in
scope - the scope to evaluate the node in
Returns:
the result of evaluating the node
Throws:
PackagedScriptObjectException

getFile

public abstract AbstractFile getFile()
Get the file that this node was parsed from.

Returns:
the file

getId

public abstract int getId()
Get the function symbol (name), if this node evaluator is a function, otherwise return -1.

Returns:
the symbol, or -1

getSharedMemberIndexTable

public abstract SymbolTable getSharedMemberIndexTable(int perm)
Get the SMIT for the scope(s) created when invoking this node evaluator.

Parameters:
perm - PRIVATE, PUBPROT, ALL