ucc::script::interp Class Reference

An instance of the runtime interpreter. More...

#include <script.h>

Inheritance diagram for ucc::script::interp:
Inheritance graph
[legend]
Collaboration diagram for ucc::script::interp:
Collaboration graph
[legend]

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

symbolcreateSymbol (char *id)
symbolfind (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)
symbolgetVar (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.
eventscriptMethod (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< scriptimage
stack_tstack
LinkedObject ** syms

Detailed Description

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.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 256 of file script.h.


Member Function Documentation

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.

Parameters:
image to attach (ref count).
entry point, NULL for "@main"
Returns:
true ifi successful, false if failed to find entry.
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.

Parameters:
text to post into error symbol.
unsigned ucc::script::interp::getResource ( void   ) 

Get current dsp resource mask.

Returns:
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.

Parameters:
name of event.
Returns:
true if is inherited.
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.

Parameters:
pattern to match.
name we match with.
Returns:
true if pattern matches.
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.

Parameters:
name of event to request.
Returns:
true if found.
event* ucc::script::interp::scriptMethod ( char *  name  )  [protected]

Search for an event object in the method table.

Parameters:
name to search for.
Returns:
method if found.
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.

Returns:
true if still running, false if exited.

The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208