#include <skInterpreter.h>
Inheritance diagram for skInterpreter:
Public Member Functions | |
skMethodDefNode * | parseString (const skString &location, const skString &code, skExecutableContext &ctxt) |
this function parses the script in the code variable and returns a parse tree if there are no syntax errors. | |
skMethodDefNode * | parseExternalParams (const skString &location, skStringList ¶mNames, const skString &code, skExecutableContext &ctxt) |
this function parses the script in the code variable and returns a parse tree if there are no syntax errors. | |
void | executeString (const skString &location, skiExecutable *obj, const skString &code, skRValueArray &args, skRValue &return_value, skMethodDefNode **parseTree, skExecutableContext &ctxt) |
this function parses and executes script which is assumed to belong to the object passed in. | |
void | executeStringExternalParams (const skString &location, skiExecutable *obj, skStringList ¶mNames, const skString &code, skRValueArray &args, skRValue &r, skMethodDefNode **keepParseTree, skExecutableContext &ctxt) |
this function parses and executes script with externally declared parameters which is assumed to belong to the object passed in. | |
void | executeParseTree (const skString &location, skiExecutable *obj, skMethodDefNode *parseTree, skRValueArray &args, skRValue &return_value, skExecutableContext &ctxt) |
this function executes some script that has already been parsed into a parse tree. | |
void | evaluateExpression (const skString &location, skiExecutable *obj, const skString &expression, skRValueTable &vars, skRValue &return_value, skExecutableContext &ctxt) |
this function parses and evaluates an expression within the given context | |
void | evaluateExpression (const skString &location, skiExecutable *obj, skExprNode *expression, skRValueTable &vars, skRValue &return_value, skExecutableContext &ctxt) |
this function parses and evaluates an expression within the given context | |
void | addGlobalVariable (const skString &name, const skRValue &value) |
this method adds a global variable to the list held by this interpreter. | |
void | removeGlobalVariable (const skString &name) |
this method removes a global variable from the list held by this interpreter | |
bool | findGlobalVariable (const skString &name, skRValue &return_value) |
this method finds the value of a global variable by name | |
const skRValueTable & | getGlobalVariables () const |
this method returns the table of global variables | |
virtual bool | setValue (const skString &s, const skString &attribute, const skRValue &v) |
this method is used to set the Tracing variable in the interpreter. | |
virtual bool | getValue (const skString &s, const skString &attribute, skRValue &v) |
this method is used to retrieve the Tracing variable in the interpreter. | |
virtual bool | method (const skString &method_name, skRValueArray &arguments, skRValue &return_value, skExecutableContext &ctxt) |
Requests that the object execute the given method. | |
virtual void | getInstanceVariables (skRValueTable &table) |
This method returns the instance variables for this object. | |
void | trace (const skString &msg) |
output a message to the current trace output | |
void | trace (const Char *msg) |
output a message to the current trace output | |
void | setTraceCallback (skTraceCallback *callback) |
this method sets an object to receive trace messages. | |
void | setStatementStepper (skStatementStepper *stepper) |
this method sets an object to be called each time a statement is executed. | |
void | runtimeError (skStackFrame &ctxt, const skString &msg) |
This method reports a runtime error by throwing a skRuntimeException. | |
void | runtimeError (skStackFrame &ctxt, const Char *msg) |
This method reports a runtime error by throwing a skRuntimeException. | |
skInterpreter () | |
Constructor - adds the interpreter as a global variable with the name "Interpreter". | |
virtual | ~skInterpreter () |
Destructor - deletes the global variable list. | |
void | init () |
init function |
There is one global Interpreter object which you should set up at the start, although others can also be created.
|
Constructor - adds the interpreter as a global variable with the name "Interpreter".
|
|
this method adds a global variable to the list held by this interpreter. If the variable already has a value, it is replaced with the new one
|
|
this function parses and evaluates an expression within the given context
|
|
this function parses and evaluates an expression within the given context
|
|
this function executes some script that has already been parsed into a parse tree.
|
|
this function parses and executes script which is assumed to belong to the object passed in.
|
|
this function parses and executes script with externally declared parameters which is assumed to belong to the object passed in.
|
|
this method finds the value of a global variable by name
|
|
this method returns the table of global variables
|
|
This method returns the instance variables for this object.
Reimplemented from skExecutable. |
|
this method is used to retrieve the Tracing variable in the interpreter. If true, method calls will show in the trace as the script is executed In Simkin call tracing=Interpreter.Tracing Reimplemented from skExecutable. |
|
init function
|
|
Requests that the object execute the given method. Methods supported: breakpoint - breaks to the debugger (if present)
Reimplemented from skExecutable. |
|
this function parses the script in the code variable and returns a parse tree if there are no syntax errors. It assumes that the script does *not* contain parameters and enclosing braces. If there are syntax errors the function throws an skParseException object
|
|
this function parses the script in the code variable and returns a parse tree if there are no syntax errors. If there are syntax errors the function throws an skParseException object
|
|
this method removes a global variable from the list held by this interpreter
|
|
This method reports a runtime error by throwing a skRuntimeException.
|
|
This method reports a runtime error by throwing a skRuntimeException.
|
|
this method sets an object to be called each time a statement is executed.
|
|
this method sets an object to receive trace messages. Pass 0 to fall back to standard mechanism (using skTracer)
|
|
this method is used to set the Tracing variable in the interpreter. This will show method calls as the script is executed In Simkin call Interpreter.Tracing=true Reimplemented from skExecutable. |
|
output a message to the current trace output
|
|
output a message to the current trace output
|