Yate
|
Script runtime execution. More...
#include <yatescript.h>
Public Types | |
enum | Status { Invalid, Running, Incomplete, Succeeded, Failed } |
Public Member Functions | |
ScriptRun (ScriptCode *code, ScriptContext *context=0) | |
virtual | ~ScriptRun () |
ScriptCode * | code () const |
ScriptContext * | context () const |
Status | state () const |
const char * | textState () const |
ObjList & | stack () |
const ObjList & | stack () const |
ScriptRun * | clone () const |
Status | reset () |
Status | execute () |
Status | run () |
bool | runAssign (const ExpOperation &oper, GenObject *context=0) |
Static Public Member Functions | |
static const char * | textState (Status state) |
Protected Member Functions | |
Status | resume () |
Friends | |
class | ScriptCode |
Script runtime execution.
An instance of script code and data, status machine run by a single thread at a time
enum Status |
Runtime states
ScriptRun | ( | ScriptCode * | code, |
ScriptContext * | context = 0 |
||
) |
Constructor
code | Code fragment to execute |
context | Script context, an empty one will be allocated if NULL |
virtual ~ScriptRun | ( | ) | [virtual] |
Destructor, disposes the code and context
Create a duplicate of the runtime with its own stack and state
ScriptCode* code | ( | ) | const [inline] |
Retrieve the parsed code being executed
ScriptContext* context | ( | ) | const [inline] |
Retrieve the execution context associated with the runtime
Execute script from where it was left, may stop and return Incomplete state
Resets code execution to the beginning, does not clear context
Resume script from where it was left, may stop and return Incomplete state
Execute script from the beginning until it returns a final state
bool runAssign | ( | const ExpOperation & | oper, |
GenObject * | context = 0 |
||
) |
Try to assign a value to a single field in the script context
oper | Field to assign to, contains the field name and new value |
context | Pointer to arbitrary object to be passed to called methods |
Const access the runtime execution stack
Get the text description of a runtime state
state | State to describe |
const char* textState | ( | ) | const [inline] |
Get the text description of the current runtime state
References ScriptRun::textState().
Referenced by ScriptRun::textState().