All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface websphinx.workbench.ScriptInterpreter

public interface ScriptInterpreter

Method Index

 o apply(Object, Object[])
Call a procedure or function.
 o eval(String)
Evaluate an expression in the script language.
 o get(String)
Get a variable defined in the interpreter's global namespace
 o getLanguage()
Return name of language this interpreter handles.
 o lambda(String[], String)
Construct a procedure or function.
 o set(String, Object)
Set a variable in the interpreter's global namespace

Methods

 o getLanguage
 public abstract String getLanguage()
Return name of language this interpreter handles.

Returns:
Language name, such as "Javascript" or "TCL"
 o eval
 public abstract Object eval(String expression) throws ScriptException
Evaluate an expression in the script language.

Parameters:
expression - Expression to evaluate
Throws: ScriptException
if execution encounters an error
 o lambda
 public abstract Object lambda(String args[],
                               String body) throws ScriptException
Construct a procedure or function.

Parameters:
args - Argument names
body - Function body
Returns:
Function object suitable for apply()
Throws: ScriptException
if execution encounters an error
 o apply
 public abstract Object apply(Object func,
                              Object args[]) throws ScriptException
Call a procedure or function.

Parameters:
func - Function object (previously returned by lambda()
args - Arguments for the function
Throws: ScriptException
if execution encounters an error
 o set
 public abstract void set(String name,
                          Object object)
Set a variable in the interpreter's global namespace

Parameters:
name - Name of variable
object - New value for variable
 o get
 public abstract Object get(String name)
Get a variable defined in the interpreter's global namespace

Parameters:
name - Name of variable to get
Returns:
Value of variable, or null if not defined

All Packages  Class Hierarchy  This Package  Previous  Next  Index