ccScript 5.1.0
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ucommon::Script Class Reference

Compiled script container. More...

#include <ccscript.h>

Inheritance diagram for ucommon::Script:
Inheritance graph
[legend]
Collaboration diagram for ucommon::Script:
Collaboration graph
[legend]

Classes

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
 NAMESPACE_UCOMMON 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 bool(Script::interp::* method_t )(void)
 A type for runtime script method invokation. More...
 
typedef struct
ucommon::Script::line 
line_t
 Basic compiled statement. More...
 
typedef const char *(* check_t )(Script *img, Script::header *scr, Script::line_t *line)
 A type for compile-time command verification method invokation. More...
 
typedef struct
ucommon::Script::keyword 
keyword_t
 NAMESPACE_UCOMMON A structure to introduce new core commands to the runtime engine. More...
 
typedef event event_t
 Convenience typedef to allow use of event name. More...
 

Public Member Functions

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

Static Public Member Functions

static Scriptcompile (Script *merge, const char *filename, Script *config=NULL)
 Compiled a file into an existing image. More...
 
static void assign (keyword_t *list)
 Assign new keywords from extensions and derived service. More...
 
static keyword_tfind (const char *id)
 Find a keyword from internal command table. More...
 
static void init (void)
 Initialize entire script engine. More...
 
static unsigned offset (const char *list, unsigned index)
 
static void copy (const char *list, char *item, unsigned size)
 
static unsigned count (const char *list)
 
static const char * get (const char *list, unsigned offset)
 
static char * get (char *list, unsigned offset)
 
static headerfind (Script *img, const char *id)
 
static bool isEvent (header *scr, const char *id)
 

Public Attributes

LinkedObjectscheduler
 scheduler list More...
 
headerfirst
 
LinkedObject ** scripts
 

Static Public Attributes

static unsigned stepping = 7
 default stepping increment More...
 
static unsigned indexing = 77
 default symbol indexing More...
 
static size_t paging = 0
 default heap paging More...
 
static unsigned sizing = 64
 default symbol size More...
 
static unsigned stacking = 20
 stack frames in script runtime More...
 
static unsigned decimals = 2
 default decimal places More...
 

Friends

class strict
 
class checks
 
class error
 
class interp
 
class methods
 

Detailed Description

Compiled script container.

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

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 31 of file ccscript.h.

Member Typedef Documentation

typedef const char*(* ucommon::Script::check_t)(Script *img, Script::header *scr, Script::line_t *line)

A type for compile-time command verification method invokation.

Definition at line 64 of file ccscript.h.

Convenience typedef to allow use of event name.

Definition at line 140 of file ccscript.h.

NAMESPACE_UCOMMON 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.

typedef bool(Script::interp::* ucommon::Script::method_t)(void)

A type for runtime script method invokation.

Definition at line 41 of file ccscript.h.

Constructor & Destructor Documentation

ucommon::Script::~Script ( )

Definition at line 314 of file script.cpp.

Member Function Documentation

void ucommon::Script::assign ( Script::keyword_t keyword)
static

Assign new keywords from extensions and derived service.

Must be called before any use.

Parameters
listof keywords to add to engine.

Definition at line 336 of file script.cpp.

Script * ucommon::Script::compile ( Script merge,
const char *  filename,
Script config = NULL 
)
static

Compiled 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
mergewith prior compiled script.
filenameto compile.
configimage of script with common definitions.
Returns
compiled script object if successful.

Definition at line 427 of file script.cpp.

void ucommon::Script::copy ( const char *  list,
char *  item,
unsigned  size 
)
static

Definition at line 1213 of file script.cpp.

unsigned ucommon::Script::count ( const char *  list)
static

Definition at line 1187 of file script.cpp.

Script::keyword_t * ucommon::Script::find ( const 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
idof command to find.
Returns
keyword object for the command or NULL.

Definition at line 345 of file script.cpp.

Script::header * ucommon::Script::find ( Script img,
const char *  id 
)
static

Definition at line 413 of file script.cpp.

const char * ucommon::Script::get ( const char *  list,
unsigned  offset 
)
static

Definition at line 1273 of file script.cpp.

char * ucommon::Script::get ( char *  list,
unsigned  offset 
)
static

Definition at line 1302 of file script.cpp.

unsigned ucommon::Script::getErrors ( void  )
inline

Definition at line 505 of file ccscript.h.

const char* ucommon::Script::getFilename ( void  )
inline

Definition at line 511 of file ccscript.h.

unsigned ucommon::Script::getLines ( void  )
inline

Definition at line 517 of file ccscript.h.

LinkedObject* ucommon::Script::getListing ( void  )
inline

Definition at line 508 of file ccscript.h.

void ucommon::Script::init ( void  )
static

Initialize entire script engine.

Must be called first and once.

Definition at line 357 of file script.cpp.

bool ucommon::Script::isEvent ( header scr,
const char *  id 
)
static

Definition at line 948 of file script.cpp.

bool ucommon::Script::isStrict ( void  )
inline

Definition at line 514 of file ccscript.h.

Script::method_t ucommon::Script::looping ( void  )

Definition at line 977 of file script.cpp.

unsigned ucommon::Script::offset ( const char *  list,
unsigned  index 
)
static

Definition at line 1267 of file script.cpp.

Script::method_t ucommon::Script::pull ( void  )

Definition at line 969 of file script.cpp.

bool ucommon::Script::push ( line_t line)

Definition at line 960 of file script.cpp.

Friends And Related Function Documentation

friend class checks
friend

Definition at line 522 of file ccscript.h.

friend class error
friend

Definition at line 523 of file ccscript.h.

friend class interp
friend

Definition at line 524 of file ccscript.h.

friend class methods
friend

Definition at line 525 of file ccscript.h.

friend class strict
friend

Definition at line 521 of file ccscript.h.

Member Data Documentation

unsigned ucommon::Script::decimals = 2
static

default decimal places

Definition at line 454 of file ccscript.h.

header* ucommon::Script::first

Definition at line 498 of file ccscript.h.

unsigned ucommon::Script::indexing = 77
static

default symbol indexing

Definition at line 450 of file ccscript.h.

size_t ucommon::Script::paging = 0
static

default heap paging

Definition at line 451 of file ccscript.h.

LinkedObject* ucommon::Script::scheduler

scheduler list

Definition at line 456 of file ccscript.h.

LinkedObject** ucommon::Script::scripts

Definition at line 499 of file ccscript.h.

unsigned ucommon::Script::sizing = 64
static

default symbol size

Definition at line 452 of file ccscript.h.

unsigned ucommon::Script::stacking = 20
static

stack frames in script runtime

Definition at line 453 of file ccscript.h.

unsigned ucommon::Script::stepping = 7
static

default stepping increment

Definition at line 449 of file ccscript.h.


The documentation for this class was generated from the following files: