ucc::script Class Reference

Compiled script container. More...

#include <script.h>

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

Data Structures

class  checks
 A container class for compile-time check methods. More...
class  error
 A class to collect compile-time errors. More...
class  event
 An event block for a script. More...
class  header
 Header describes a script section. More...
class  interp
 An instance of the runtime interpreter. More...
struct  keyword
 A structure to introduce new core commands to the runtime engine. More...
struct  line
 Basic compiled statement. More...
class  methods
 Runtime methods collection class. More...
struct  stack_t
 Runtime stack for each interpreter instance. More...
class  strict
 Contains defined variables found by scope when strict is used. More...
class  symbol
 Contains instance of a runtime symbol. More...

Public Types

typedef char *(* check_t )(script *img, script::header *scr, script::line_t *line)
 A type for compile-time command verification method invokation.
typedef event event_t
 Convenience typedef to allow use of event name.
typedef struct ucc::script::keyword keyword_t
 A structure to introduce new core commands to the runtime engine.
typedef struct ucc::script::line line_t
 Basic compiled statement.
typedef bool(script::interp::* method_t )(void)
 A type for runtime script method invokation.

Public Member Functions

unsigned getErrors (void)
char * getFilename (void)
unsigned getLines (void)
LinkedObjectgetListing (void)
bool isStrict (void)
method_t looping (void)
method_t pull (void)
bool push (line_t *line)

Static Public Member Functions

static scriptappend (script *merge, char *filename, script *config=((void *) 0))
 Append a file into an existing image.
static void assign (keyword_t *list)
 Assign new keywords from extensions and derived service.
static scriptcompile (char *filename, script *config=((void *) 0))
 Compile a script file into an image.
static void copy (char *list, char *item, unsigned size)
static unsigned count (char *list)
static headerfind (script *img, char *id)
static keyword_tfind (char *id)
 Find a keyword from internal command table.
static char * get (char *list, unsigned offset)
static char * get (char *list, unsigned offset)
static void init (void)
 Initialize entire script engine.
static bool isEvent (header *scr, char *id)
static scriptmerge (char *filename, script *root=((void *) 0))
 Compile and merge a script into an existing shared image.
static unsigned offset (char *list, unsigned index)

Data Fields

headerfirst
LinkedObject ** scripts

Static Public Attributes

static unsigned decimals
 default decimal places
static unsigned indexing
 default symbol indexing
static size_t paging
 default heap paging
static unsigned sizing
 default symbol size
static unsigned stacking
 stack frames in script runtime
static unsigned stepping
 default stepping increment

Friends

class checks
class error
class interp
class methods
class strict

Detailed Description

Compiled script container.

This class holds the image of a reference counted instance of a compiled script.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 50 of file script.h.


Member Typedef Documentation

A structure to introduce new core commands to the runtime engine.

This is typically passed to assign as an array. Entries with no runtime method (method = NULL) are only processed at compile-time.

Basic compiled statement.

This is a linked list of statement lines, with an array of parsed statement arguments. An optional dsp resource mask value can be assigned by a check method on a per-line basis as well as at closure time for a script.


Member Function Documentation

static script* ucc::script::append ( script merge,
char *  filename,
script config = ((void *) 0) 
) [static]

Append a file into an existing image.

A shared config script can be used that holds common definitions. Multiple script files can also be merged together into a final image.

Parameters:
merge with prior compiled script.
filename to compile.
config image of script with common definitions.
Returns:
compiled script object if successful.
static void ucc::script::assign ( keyword_t list  )  [static]

Assign new keywords from extensions and derived service.

Must be called before any use.

Parameters:
list of keywords to add to engine.
static script* ucc::script::compile ( char *  filename,
script config = ((void *) 0) 
) [static]

Compile a script file into an image.

Creates the new image that will be used. A shared config script can be compiled and used to hold common definitions.

Parameters:
filename to compile.
config image of script with common definitions.
Returns:
compiled script object if successful.
static keyword_t* ucc::script::find ( char *  id  )  [static]

Find a keyword from internal command table.

This includes the core runtime engine keywords set through init() and any derived ones added through assign.

Parameters:
id of command to find.
Returns:
keyword object for the command or NULL.
static void ucc::script::init ( void   )  [static]

Initialize entire script engine.

Must be called first and once.

static script* ucc::script::merge ( char *  filename,
script root = ((void *) 0) 
) [static]

Compile and merge a script into an existing shared image.

This is related to compile, but the target script's definitions are linked into the base config script. Use NULL if no base. This is often used to compose lint images.

Parameters:
filename to merge.
root script to merge definitions with.
Returns:
compiled script instance if successful.

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