An instance of the runtime interpreter. More...
#include <script.h>
Public Types | |
typedef char | num_t [16] |
Public Member Functions | |
bool | attach (script *image, char *entry=((void *) 0)) |
Attach a compiled image to the interpreter and start. | |
void | detach (void) |
Cleanup after interpreter run. | |
bool | error (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 (char *id) |
symbol * | find (char *id) |
virtual bool | getCondition (char *test, char *value) |
char * | getContent (char *text) |
char * | getContent (void) |
virtual char * | getFormat (symbol *sym, char *id, char *temp) |
char * | getIndex (void) |
char * | getKeyword (char *id) |
method_t | getLooping (void) |
void | getParams (header *scope, line_t *line) |
char * | getTemp (void) |
virtual char * | getTypeinit (char *type_id) |
virtual unsigned | getTypesize (char *type_id) |
char * | getValue (void) |
symbol * | getVar (char *id, char *value=((void *) 0)) |
bool | isConditional (unsigned index) |
virtual bool | isInherited (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 (char *pattern, char *name) |
Define pattern match virtual. | |
bool | pop (void) |
void | pullBase (void) |
void | pullLoop (void) |
void | pullScope (void) |
void | push (void) |
bool | scriptEvent (char *name) |
Try to branch to a named event handler. | |
event * | scriptMethod (char *name) |
Search for an event object in the method table. | |
bool | setConst (char *id, char *value) |
void | setRef (header *scope, char *id, char *data, unsigned size) |
void | setStack (header *scr, event *ev=((void *) 0)) |
void | skip (void) |
void | startScript (header *scr) |
bool | tryexit (void) |
bool | trylabel (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, | |
char * | entry = ((void *) 0) | |||
) |
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 | ( | 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 | ( | 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 | ( | char * | pattern, | |
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 | ( | 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 | ( | 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.