An instance of the runtime interpreter. More...
#include <ccscript.h>
Public Types | |
typedef char | num_t [16] |
Public Member Functions | |
interp () | |
virtual | ~interp () |
bool | step (void) |
Step through an instance of the interpreter. More... | |
bool | attach (Script *image, const char *entry=NULL) |
Attach a compiled image to the interpreter and start. More... | |
void | detach (void) |
Cleanup after interpreter run. More... | |
void | initialize (void) |
Used to initialize and purge the interpreter between runs. More... | |
bool | error (const char *text) |
Invoke runtime interpreter error handling. More... | |
unsigned | getResource (void) |
Get current dsp resource mask. More... | |
const char * | getFilename (void) |
Get effective filename of base. More... | |
Protected Member Functions | |
symbol * | find (const char *id) |
void | skip (void) |
void | push (void) |
bool | trylabel (const char *id) |
bool | tryexit (void) |
void | pullScope (void) |
void | pullBase (void) |
void | pullLoop (void) |
bool | pop (void) |
void | setStack (header *scr, event *ev=NULL) |
bool | scriptEvent (const char *name) |
Try to branch to a named event handler. More... | |
event * | scriptMethod (const char *name) |
Search for an event object in the method table. More... | |
char * | getTemp (void) |
bool | setConst (const char *id, const char *value) |
symbol * | createSymbol (const char *id) |
symbol * | getVar (const char *id, const char *value=NULL) |
const char * | getValue (void) |
const char * | getContent (void) |
const char * | getContent (const char *text) |
const char * | getKeyword (const char *id) |
method_t | getLooping (void) |
bool | isConditional (unsigned index) |
void | setRef (header *scope, const char *id, char *data, unsigned size) |
void | getParams (header *scope, line_t *line) |
void | startScript (header *scr) |
virtual unsigned | getTypesize (const char *type_id) |
virtual const char * | getTypeinit (const char *type_id) |
virtual const char * | getFormat (symbol *sym, const char *id, char *temp) |
virtual bool | getCondition (const char *test, const char *value) |
const char * | getIndex (void) |
Protected Attributes | |
stack_t * | stack |
object_pointer< Script > | image |
LinkedObject ** | syms |
unsigned | frame |
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 253 of file ccscript.h.
typedef char ucommon::Script::interp::num_t[16] |
Definition at line 256 of file ccscript.h.
interp::interp | ( | ) |
Definition at line 35 of file interp.cpp.
|
virtual |
Definition at line 40 of file interp.cpp.
bool 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" |
Definition at line 771 of file interp.cpp.
|
protected |
Definition at line 494 of file interp.cpp.
void interp::detach | ( | void | ) |
Cleanup after interpreter run.
Releases reference to image.
Definition at line 746 of file interp.cpp.
bool interp::error | ( | const char * | text | ) |
Invoke runtime interpreter error handling.
text | to post into error symbol. |
Definition at line 68 of file interp.cpp.
|
protected |
Definition at line 724 of file interp.cpp.
|
protectedvirtual |
Definition at line 1026 of file interp.cpp.
|
protected |
Definition at line 429 of file interp.cpp.
|
protected |
Definition at line 351 of file interp.cpp.
const char * interp::getFilename | ( | void | ) |
|
protectedvirtual |
Definition at line 97 of file interp.cpp.
|
protected |
Definition at line 405 of file interp.cpp.
|
protected |
Definition at line 388 of file interp.cpp.
|
protected |
Definition at line 421 of file interp.cpp.
|
protected |
Definition at line 582 of file interp.cpp.
unsigned interp::getResource | ( | void | ) |
|
protected |
Definition at line 87 of file interp.cpp.
|
protectedvirtual |
Definition at line 568 of file interp.cpp.
|
protectedvirtual |
Definition at line 551 of file interp.cpp.
|
protected |
Definition at line 446 of file interp.cpp.
|
protected |
Definition at line 656 of file interp.cpp.
void 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.
Definition at line 45 of file interp.cpp.
|
protected |
Definition at line 1138 of file interp.cpp.
|
protected |
Definition at line 946 of file interp.cpp.
|
protected |
Definition at line 913 of file interp.cpp.
|
protected |
Definition at line 925 of file interp.cpp.
|
protected |
Definition at line 919 of file interp.cpp.
|
protected |
Definition at line 957 of file interp.cpp.
|
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. |
Definition at line 825 of file interp.cpp.
|
protected |
Search for an event object in the method table.
name | to search for. |
Definition at line 813 of file interp.cpp.
|
protected |
Definition at line 463 of file interp.cpp.
|
protected |
Definition at line 620 of file interp.cpp.
|
protected |
Definition at line 899 of file interp.cpp.
|
protected |
Definition at line 808 of file interp.cpp.
|
protected |
Definition at line 756 of file interp.cpp.
bool interp::step | ( | void | ) |
Step through an instance of the interpreter.
This can step through multiple lines at once, depending on Script::stepping.
Definition at line 1003 of file interp.cpp.
|
protected |
Definition at line 985 of file interp.cpp.
|
protected |
Definition at line 971 of file interp.cpp.
|
protected |
Definition at line 339 of file ccscript.h.
|
protected |
Definition at line 337 of file ccscript.h.
|
protected |
Definition at line 336 of file ccscript.h.
|
protected |
Definition at line 338 of file ccscript.h.