An instance of the runtime interpreter. More...
#include <script.h>
Public Types | |
typedef char | num_t [16] |
Public Member Functions | |
bool | attach (script *image, const char *entry=NULL) |
Attach a compiled image to the interpreter and start. | |
void | detach (void) |
Cleanup after interpreter run. | |
bool | error (const char *text) |
Invoke runtime interpreter error handling. | |
unsigned | getResource (void) |
Get current dsp resource mask. | |
void | initialize (void) |
Used to initialize and purge the interpreter between runs. | |
bool | step (void) |
Step through an instance of the interpreter. | |
Protected Member Functions | |
symbol * | createSymbol (const char *id) |
symbol * | find (const char *id) |
virtual bool | getCondition (const char *test, const char *value) |
const char * | getContent (void) |
const char * | getContent (const char *text) |
virtual const char * | getFormat (symbol *sym, const char *id, char *temp) |
const char * | getIndex (void) |
const char * | getKeyword (const char *id) |
method_t | getLooping (void) |
void | getParams (header *scope, line_t *line) |
char * | getTemp (void) |
virtual const char * | getTypeinit (const char *type_id) |
virtual unsigned | getTypesize (const char *type_id) |
const char * | getValue (void) |
symbol * | getVar (const char *id, const char *value=NULL) |
bool | isConditional (unsigned index) |
virtual bool | isInherited (const char *name) |
Used to determine if an event handler should be treated as inherited/callable from the base script when requested from a defined block of code but not found there. | |
virtual bool | match (const char *pattern, const char *name) |
Define pattern match virtual. | |
bool | pop (void) |
void | pullBase (void) |
void | pullLoop (void) |
void | pullScope (void) |
void | push (void) |
bool | scriptEvent (const char *name) |
Try to branch to a named event handler. | |
event * | scriptMethod (const char *name) |
Search for an event object in the method table. | |
bool | setConst (const char *id, const char *value) |
void | setRef (header *scope, const char *id, char *data, unsigned size) |
void | setStack (header *scr, event *ev=NULL) |
void | skip (void) |
void | startScript (header *scr) |
bool | tryexit (void) |
bool | trylabel (const char *id) |
Protected Attributes | |
unsigned | frame |
pointer< script > | image |
stack_t * | stack |
LinkedObject ** | syms |
An instance of the runtime interpreter.
Some application servers, like GNU Bayonne, may create an interpreter instance for each telephone call session. All runtime execution happens through the interpreter class, which executes compiled script images. This is commonly used as a base class for runtime methods and application specific interpreters. All interpreter instance data and symbols are allocated off the interpreter instance private heap.
Definition at line 256 of file script.h.
bool ucc::script::interp::attach | ( | script * | image, | |
const char * | entry = NULL | |||
) |
Attach a compiled image to the interpreter and start.
Even when different entry points are called, the initialization block is always called.
image | to attach (ref count). | |
entry | point, NULL for "@main" |
void ucc::script::interp::detach | ( | void | ) |
Cleanup after interpreter run.
Releases reference to image.
bool ucc::script::interp::error | ( | const char * | text | ) |
Invoke runtime interpreter error handling.
text | to post into error symbol. |
unsigned ucc::script::interp::getResource | ( | void | ) |
Get current dsp resource mask.
void ucc::script::interp::initialize | ( | void | ) |
Used to initialize and purge the interpreter between runs.
This is used especially if the same interpreter object is kept in memory and directly re-used for multiple executions.
virtual bool ucc::script::interp::isInherited | ( | const char * | name | ) | [protected, virtual] |
Used to determine if an event handler should be treated as inherited/callable from the base script when requested from a defined block of code but not found there.
name | of event. |
virtual bool ucc::script::interp::match | ( | const char * | pattern, | |
const char * | name | |||
) | [protected, virtual] |
Define pattern match virtual.
This is used for the "$" conditional expression, for event dispatch, and for some searches.
pattern | to match. | |
name | we match with. |
bool ucc::script::interp::scriptEvent | ( | const char * | name | ) | [protected] |
Try to branch to a named event handler.
If successful, the interpreter transfers control to the start of the handler for the next step.
name | of event to request. |
event* ucc::script::interp::scriptMethod | ( | const char * | name | ) | [protected] |
Search for an event object in the method table.
name | to search for. |
bool ucc::script::interp::step | ( | void | ) |
Step through an instance of the interpreter.
This can step through multiple lines at once, depending on script::stepping.