Bayonne2 / Common C++ 2 Framework
|
#include <script3.h>
Public Types | |
enum | scrAccess { scrPUBLIC, scrPROTECTED, scrPRIVATE, scrFUNCTION, scrLOCAL } |
typedef enum scrAccess | scrAccess |
enum | symType { symNORMAL = 0, symCONST, symDYNAMIC, symFIFO, symSEQUENCE, symSTACK, symCOUNTER, symPOINTER, symREF, symARRAY, symASSOC, symINITIAL, symNUMBER, symLOCK, symPROPERTY, symORIGINAL, symMODIFIED, symTIMER, symBOOL } |
typedef enum symType | symType |
typedef bool(ScriptInterp::* | Method )(void) |
typedef const char *(ScriptCommand::* | Check )(Line *line, ScriptImage *img) |
typedef bool(* | Cond )(ScriptInterp *interp, const char *v) |
typedef long(* | Function )(long *args, unsigned prec) |
typedef const char *(* | Meta )(ScriptInterp *interp, const char *token) |
typedef const char *(* | Parse )(ScriptCompiler *img, const char *token) |
typedef void(* | Init )(void) |
typedef struct ost::Script::_symbol | Symbol |
typedef struct ost::Script::_array | Array |
Public Member Functions | |
bool | scrNop (void) |
bool | scrError (void) |
bool | scrExit (void) |
bool | scrDecimal (void) |
bool | scrDefine (void) |
bool | scrVar (void) |
bool | scrType (void) |
bool | scrNumber (void) |
bool | scrSlog (void) |
bool | scrExpr (void) |
bool | scrIndex (void) |
bool | scrOffset (void) |
bool | scrRef (void) |
bool | scrRestart (void) |
bool | scrInit (void) |
bool | intGoto (void) |
bool | scrGoto (void) |
bool | scrCall (void) |
bool | scrReturn (void) |
bool | scrBegin (void) |
bool | scrEnd (void) |
bool | scrConst (void) |
bool | scrSequence (void) |
bool | scrSet (void) |
bool | scrArray (void) |
bool | scrClear (void) |
bool | scrConstruct (void) |
bool | scrDeconstruct (void) |
bool | scrPack (void) |
bool | scrUnpack (void) |
bool | scrLock (void) |
bool | scrSession (void) |
bool | scrSignal (void) |
bool | scrThrow (void) |
bool | scrInvoke (void) |
bool | scrCounter (void) |
bool | scrTimer (void) |
bool | scrCase (void) |
bool | scrEndcase (void) |
bool | scrRemove (void) |
bool | scrDo (void) |
bool | scrRepeat (void) |
bool | scrFor (void) |
bool | scrForeach (void) |
bool | scrLoop (void) |
bool | scrContinue (void) |
bool | scrBreak (void) |
bool | scrIf (void) |
bool | scrIfThen (void) |
bool | scrThen (void) |
bool | scrElse (void) |
bool | scrEndif (void) |
long | getIntValue (const char *text, unsigned prec, ScriptProperty *property=NULL) |
int | numericExpression (long *list, int max, unsigned prec, ScriptProperty *property=NULL) |
bool | conditionalExpression (void) |
bool | conditional (void) |
virtual unsigned | getId (void) |
unsigned long | getSequence (void) |
virtual const char * | getLogname (void) |
virtual ScriptInterp * | getInterp (const char *id) |
virtual const char * | getExternal (const char *opt) |
ScriptImage * | getImage (void) |
const char * | getMember (void) |
const char * | getKeyword (const char *kw) |
const char * | getKeyoption (const char *kw) |
const char * | getValue (const char *def=NULL) |
const char * | getOption (const char *def=NULL) |
const char * | hasOption (void) |
const char * | getContent (const char *opt) |
const char * | getSymContent (const char *opt) |
Symbol * | getKeysymbol (const char *kw, unsigned size=0) |
Symbol * | getSymbol (unsigned short size=0) |
bool | getSymbol (const char *id, char *buffer, unsigned short max) |
const char * | getSymbol (const char *id) |
char | getPackToken (void) |
Frame * | getFrame (void) |
Line * | getLine (void) |
void | setFrame (void) |
Name * | getName (void) |
bool | getTrace (void) |
bool | execute (Method method) |
Runtime execution of script handler. More... | |
virtual void | logmissing (const char *id, const char *level="undefined", const char *group="symbol") |
virtual void | logerror (const char *msg, const char *name=NULL) |
Symbol * | mapSymbol (const char *id, unsigned short=0) |
Symbol * | mapDirect (const char *id, unsigned short=0) |
bool | setNumber (const char *id, const char *value=NULL, unsigned dec=0) |
bool | setSymbol (const char *id, const char *value=NULL, unsigned short size=0) |
bool | setConst (const char *id, const char *value) |
bool | putSymbol (const char *id, const char *value, unsigned short size=0) |
bool | catSymbol (const char *id, const char *value, unsigned short size=0) |
Name * | getScript (const char *name) |
bool | step (void) |
bool | attach (ScriptCommand *cmd, const char *scrname) |
void | attach (ScriptCommand *cmd, ScriptImage *img, Name *scr) |
void | detach (void) |
void | release (void) |
Release any acquired lock... More... | |
bool | signal (const char *name) |
Signals are used during "delayed" execution steps when a signal event has occured aynchronously with the execution of a script controlled state event handler. More... | |
bool | signal (unsigned id) |
Signals can be referenced by numeric id as well as by symbolic name. More... | |
bool | done (void) |
timeout_t | getTimeout (void) |
virtual void | branching (void) |
A virtual holding a branch conditional member. More... | |
bool | isRunning (void) |
bool | isExiting (void) |
char * | getTemp (void) |
unsigned | getTempSize (void) |
void | nameMutex (const char *name) |
Enable setting of mutex name for deadlock debug. More... | |
void | enterMutex (void) |
Entering a Mutex locks the mutex for the current thread. More... | |
void | enter (void) |
Future abi will use enter/leave/test members. More... | |
void | leave (void) |
Future abi will use enter/leave/test members. More... | |
bool | test (void) |
Future abi will use enter/leave/test members. More... | |
bool | tryEnterMutex (void) |
Tries to lock the mutex for the current thread. More... | |
void | leaveMutex (void) |
Leaving a mutex frees that mutex for use by another thread. More... | |
const char * | cstring (const char *str) |
unsigned | gathertype (Symbol **idx, unsigned max, const char *prefix, symType group) |
unsigned | gather (Symbol **idx, unsigned max, const char *prefix, const char *suffix) |
Symbol * | find (const char *id, unsigned short size=0) |
Symbol * | make (const char *id, unsigned short size) |
Symbol * | setReference (const char *id, Symbol *target) |
int | getPages (void) |
Return the total number of pages that have been allocated for this memory pool. More... | |
Static Public Member Functions | |
static long | getRealValue (double val, unsigned prec) |
static double | getDouble (long value, unsigned prec) |
static long | getInteger (long value, unsigned prec) |
static long | getTens (unsigned prec) |
static void | setDebug (bool mode) |
Enable or disable deadlock debugging. More... | |
static bool | isScript (Name *scr) |
static bool | isSymbol (const char *id) |
static bool | use (const char *name) |
static unsigned | getIndex (const char *id) |
static Symbol * | deref (Symbol *sym) |
static bool | commit (Symbol *sym, const char *value) |
static bool | append (Symbol *sym, const char *value) |
static bool | symindex (Symbol *sym, short offset) |
static const char * | extract (Symbol *sym) |
static unsigned | count (Symbol *sym) |
static unsigned | storage (Symbol *sym) |
static void | clear (Symbol *sym) |
static void | addFunction (const char *name, unsigned count, Function i) |
static void | addConditional (const char *name, Cond test) |
static bool | isPrivate (Name *scr) |
static bool | isFunction (Name *scr) |
Data Fields | |
class __EXPORT | Line |
class __EXPORT | Name |
Static Public Attributes | |
static size_t | pagesize |
static bool | fastStart |
static bool | useBigmem |
static unsigned | fastStepping |
static unsigned | autoStepping |
static unsigned | symsize |
static unsigned | symlimit |
static char | decimal |
static bool | use_definitions |
static bool | use_macros |
static bool | use_prefix |
static bool | use_merge |
static bool | use_funcs |
static const char * | plugins |
static const char * | altplugins |
static const char * | access_user |
static const char * | access_pass |
static const char * | access_host |
static bool | exec_funcs |
static const char * | exec_extensions |
static const char * | exec_token |
static const char * | exec_prefix |
static const char * | exit_token |
static const char * | apps_extensions |
static const char * | apps_prefix |
static const char * | etc_prefix |
static const char * | var_prefix |
static const char * | log_prefix |
Protected Member Functions | |
virtual ScriptSymbols * | getSymbols (const char *id) |
ScriptSymbols * | getLocal (void) |
void | initRuntime (Name *name) |
Initialize execution environment for a script. More... | |
virtual void | initialize (void) |
New virtual to initialize script environment syms before running init sections. More... | |
bool | push (void) |
Attempt to push a value onto the stack. More... | |
bool | pull (void) |
Attempt to recall a previous stack level. More... | |
void | clearStack (void) |
Clear the stack of local loops or recursion for branching. More... | |
void | advance (void) |
Advance program to the next script statement. More... | |
void | skip (void) |
Skip line without checking or setting updates. More... | |
void | error (const char *error) |
Set error variable and advance to either the error handler or next script statement. More... | |
bool | scriptEvent (const char *name, bool inhereted=true) |
Events reference to named @event handlers which have been attached to a script. More... | |
void | gotoEvent (NamedEvent *event) |
Branch to a selected event record immediately. More... | |
void | trap (unsigned id) |
Set the execution interpreter to a trap identifier. More... | |
void | trap (const char *name) |
Select trap by symbolic name and execute if found, else advance to next script step (unless exit trap). More... | |
bool | tryCatch (const char *id) |
Tries a catch handler... More... | |
virtual bool | isLocked (const char *id) |
virtual const char * | remapLocal (void) |
virtual bool | exit (void) |
virtual void | enterThread (ScriptThread *thread) |
virtual void | exitThread (const char *msg) |
virtual void | waitThread (void) |
virtual void | startThread (void) |
bool | eventThread (const char *evt, bool flag=true) |
bool | redirect (const char *scr) |
bool | redirect (bool evflag) |
void | ripple (void) |
unsigned long | getMask (void) |
void | purge (void) |
virtual void * | first (size_t size) |
Allocate first workspace from paged memory. More... | |
char * | first (char *str) |
Allocate a string from the memory pager pool and copy the string into it's new memory area. More... | |
virtual void * | alloc (size_t size) |
Allocate memory from either the currently active page, or allocate a new page for the object. More... | |
char * | alloc (const char *str) |
Allocate a string from the memory pager pool and copy the string inti it's new memory area. More... | |
void | clean (void) |
Clean for memory cleanup before exiting. More... | |
Protected Attributes | |
Mutex * | lock |
ScriptCommand * | cmd |
ScriptImage * | image |
ScriptInterp * | session |
ScriptThread * | thread |
Frame | frame [32] |
char * | temps [16] |
unsigned | tempidx |
unsigned | stack |
bool | initialized |
bool | trace |
bool | exiting |
bool | updated |
unsigned long | sequence |
char | logname [32] |
Symbol * | index [KEYDATA_INDEX_SIZE+1] |
Static Protected Attributes | |
static Test * | test |
static Fun * | ifun |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
staticinherited |
|
staticinherited |
|
protectedinherited |
Advance program to the next script statement.
|
protectedvirtualinherited |
Allocate memory from either the currently active page, or allocate a new page for the object.
size | size of memory to allocate. |
Reimplemented in SharedMemPager.
|
protectedinherited |
Allocate a string from the memory pager pool and copy the string inti it's new memory area.
This checks only the last active page for available space before allocating a new page.
str | string to allocate and copy into paged memory pool. |
|
staticinherited |
|
inherited |
|
inherited |
|
virtualinherited |
A virtual holding a branch conditional member.
This may be invoked typically from goto or restart. Can be used to check contextual changes.
Reimplemented in ost::BayonneSession.
|
inherited |
|
protectedinherited |
Clean for memory cleanup before exiting.
|
staticinherited |
|
protectedinherited |
Clear the stack of local loops or recursion for branching.
|
staticinherited |
|
inherited |
|
inherited |
|
staticinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
Entering a Mutex locks the mutex for the current thread.
This also can be done using the ENTER_CRITICAL macro or by using the ++ operator on a mutex.
|
protectedvirtualinherited |
Reimplemented in ost::BayonneSession.
|
protectedinherited |
Set error variable and advance to either the error handler or next script statement.
error | message. |
|
protectedinherited |
|
inherited |
Runtime execution of script handler.
This can be called in the current or derived class to invoke extensible methods.
method | derived method member to call. |
|
protectedvirtualinherited |
Reimplemented in ost::BayonneSession.
|
protectedvirtualinherited |
Reimplemented in ost::BayonneSession.
|
staticinherited |
|
inherited |
|
protectedvirtualinherited |
Allocate first workspace from paged memory.
This method scans all currently allocated blocks for available space before adding new pages and hence is both slower and more efficient.
size | size of memory to allocate. |
Reimplemented in SharedMemPager.
|
protectedinherited |
Allocate a string from the memory pager pool and copy the string into it's new memory area.
This method allocates memory by first searching for an available page, and then allocating a new page if no space is found.
str | string to allocate and copy into paged memory pool. |
|
inherited |
|
inherited |
|
inherited |
|
staticinherited |
|
virtualinherited |
Reimplemented in ost::BayonneSession.
|
inlineinherited |
|
virtualinherited |
Reimplemented in ost::BayonneSession.
|
inlineinherited |
|
staticinherited |
|
staticinherited |
|
virtualinherited |
Reimplemented in ost::BayonneSession.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
protectedinherited |
|
inlinevirtualinherited |
|
protectedinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
staticinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedvirtualinherited |
Reimplemented in ost::BayonneSession.
|
inherited |
|
inherited |
|
inherited |
|
staticinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
protectedinherited |
Branch to a selected event record immediately.
event | record pointer to access. |
|
inherited |
|
protectedvirtualinherited |
New virtual to initialize script environment syms before running init sections.
Reimplemented in ost::BayonneSession.
|
protectedinherited |
Initialize execution environment for a script.
bool ost::ScriptMethods::intGoto | ( | void | ) |
|
inlineinherited |
|
staticinherited |
|
protectedvirtualinherited |
|
staticinherited |
|
inlineinherited |
|
staticinherited |
|
staticinherited |
|
inlineinherited |
|
inherited |
Leaving a mutex frees that mutex for use by another thread.
If the mutex has been entered (invoked) multiple times (recursivily) by the same thread, then it will need to be exited the same number of instances before it is free for re-use. This operation can also be done using the LEAVE_CRITICAL macro or by the – operator on a mutex.
|
virtualinherited |
|
virtualinherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
protectedinherited |
Attempt to recall a previous stack level.
|
protectedinherited |
|
protectedinherited |
Attempt to push a value onto the stack.
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
Release any acquired lock...
|
protectedvirtualinherited |
|
protectedinherited |
bool ost::ScriptMethods::scrArray | ( | void | ) |
bool ost::ScriptMethods::scrBegin | ( | void | ) |
bool ost::ScriptMethods::scrBreak | ( | void | ) |
bool ost::ScriptMethods::scrCall | ( | void | ) |
bool ost::ScriptMethods::scrCase | ( | void | ) |
bool ost::ScriptMethods::scrClear | ( | void | ) |
bool ost::ScriptMethods::scrConst | ( | void | ) |
bool ost::ScriptMethods::scrConstruct | ( | void | ) |
bool ost::ScriptMethods::scrContinue | ( | void | ) |
bool ost::ScriptMethods::scrCounter | ( | void | ) |
bool ost::ScriptMethods::scrDecimal | ( | void | ) |
bool ost::ScriptMethods::scrDeconstruct | ( | void | ) |
bool ost::ScriptMethods::scrDefine | ( | void | ) |
bool ost::ScriptMethods::scrDo | ( | void | ) |
bool ost::ScriptMethods::scrElse | ( | void | ) |
bool ost::ScriptMethods::scrEnd | ( | void | ) |
bool ost::ScriptMethods::scrEndcase | ( | void | ) |
bool ost::ScriptMethods::scrEndif | ( | void | ) |
bool ost::ScriptMethods::scrError | ( | void | ) |
bool ost::ScriptMethods::scrExit | ( | void | ) |
bool ost::ScriptMethods::scrExpr | ( | void | ) |
bool ost::ScriptMethods::scrFor | ( | void | ) |
bool ost::ScriptMethods::scrForeach | ( | void | ) |
bool ost::ScriptMethods::scrGoto | ( | void | ) |
bool ost::ScriptMethods::scrIf | ( | void | ) |
bool ost::ScriptMethods::scrIfThen | ( | void | ) |
bool ost::ScriptMethods::scrIndex | ( | void | ) |
bool ost::ScriptMethods::scrInit | ( | void | ) |
bool ost::ScriptMethods::scrInvoke | ( | void | ) |
|
protectedinherited |
Events reference to named @event handlers which have been attached to a script.
This allows low level applications to invoke an event handler much the way a signal handler occurs.
name | of event handler. |
inhereted | search flag. |
bool ost::ScriptMethods::scrLock | ( | void | ) |
bool ost::ScriptMethods::scrLoop | ( | void | ) |
bool ost::ScriptMethods::scrNop | ( | void | ) |
bool ost::ScriptMethods::scrNumber | ( | void | ) |
bool ost::ScriptMethods::scrOffset | ( | void | ) |
bool ost::ScriptMethods::scrPack | ( | void | ) |
bool ost::ScriptMethods::scrRef | ( | void | ) |
bool ost::ScriptMethods::scrRemove | ( | void | ) |
bool ost::ScriptMethods::scrRepeat | ( | void | ) |
bool ost::ScriptMethods::scrRestart | ( | void | ) |
bool ost::ScriptMethods::scrReturn | ( | void | ) |
bool ost::ScriptMethods::scrSequence | ( | void | ) |
bool ost::ScriptMethods::scrSession | ( | void | ) |
bool ost::ScriptMethods::scrSet | ( | void | ) |
bool ost::ScriptMethods::scrSignal | ( | void | ) |
bool ost::ScriptMethods::scrSlog | ( | void | ) |
bool ost::ScriptMethods::scrThen | ( | void | ) |
bool ost::ScriptMethods::scrThrow | ( | void | ) |
bool ost::ScriptMethods::scrTimer | ( | void | ) |
bool ost::ScriptMethods::scrType | ( | void | ) |
bool ost::ScriptMethods::scrUnpack | ( | void | ) |
bool ost::ScriptMethods::scrVar | ( | void | ) |
|
inherited |
|
inlinestaticinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Signals are used during "delayed" execution steps when a signal event has occured aynchronously with the execution of a script controlled state event handler.
This mechanism can be used in place of calling implicit "Step" traps.
name | of signal identifier. |
|
inherited |
Signals can be referenced by numeric id as well as by symbolic name.
id | number of handler. |
|
protectedinherited |
Skip line without checking or setting updates.
|
protectedvirtualinherited |
Reimplemented in ost::BayonneSession.
|
inherited |
|
staticinherited |
|
staticinherited |
|
inlineinherited |
|
protectedinherited |
Set the execution interpreter to a trap identifier.
If no trap id exists, then advance to next script statement (unless exit trap).
id | of trap to select numerically. |
|
protectedinherited |
Select trap by symbolic name and execute if found, else advance to next script step (unless exit trap).
name | of trap to select. |
|
protectedinherited |
Tries a catch handler...
id | of catch handler to try. |
|
inherited |
Tries to lock the mutex for the current thread.
Behaves like enterMutex , except that it doesn't block the calling thread if the mutex is already locked by another thread.
|
staticinherited |
|
protectedvirtualinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |