class ScriptInterp

Extensible Bayonne Scripting Engine. More...

Contains pure virtuals
Definition#include <../common/script.h>
InheritsScriptSymbol
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Protected Members


Detailed Description

System script interpreter core engine class. This class is further derived to impliment application specific language dialects.

ScriptInterp (ScriptCommand *cmd, int symsize, int pgsize = 1024)
[protected]

Derive a new instance of the system script interpreter.

Parameters:
symsizefor default symbol sizing.
pgsizefor memory fragmentation.

inline ScriptCommand * getCommand (void)
[protected]

Fetch the active command interpreter subsystem.

Returns: script interpreter.

bool Conditional (void)
[protected]

Used to process "conditional" arguments such as for IF/DO/LOOP statements. The index is kept at the next logical argument so a goto can be performed if needed.

Returns: true if conditional test is true.

bool scrExit (void)
[protected]

Some systems can derive alternative "exit" commands which can call this routine after performing other operations.

bool scrGoto (void)
[protected]

This is often called to process branching requests.

bool Attach (const char *scrname)
[protected]

Attempt to attach script engine to active session and specify a starting script.

Parameters:
nameof script entry.

Returns: false if failed to attach.

void Detach (void)
[protected]

Detach the current script image. If it is the last ref count and the exit flag is set, then delete it.

unsigned getId (void)
[protected virtual]

Used to return channel identifiers in some systems.

Returns: channel id or 0 for none.

char * getOption (const char *def = NULL)
[protected]

Fetch next logical option but do not evaluate. The index is advanced.

Parameters:
optionaldefault.

Returns: option or NULL if end of list.

char * getValue (const char *def = NULL)
[protected]

Fetch and evaluate next logical option. If a symbol ref. then the symbol is also expressed. The index is advanced.

Parameters:
optionaldefault value.

Returns: option value or NULL if end of list.

scriptsymbol_t * getVariable (int size = 0)
[protected]

Fetch a variable (symbol) that will be used to store data. This advances the index.

Parameters:
optionalsize to allocate if new symbol.

Returns: symbol found if any.

char * getContent (char *sym)
[protected]

Evaluate the content of an option retrieved with getOption.

Parameters:
optionstring.

Returns: value of evaluation.

scriptsymbol_t * getIndirect (char *sym)
[protected virtual]

May be used to override processing of indirect content requests. This is used in the Bayonne IVR to fetch content constants based on language and country settings.

Parameters:
indirectfetch request.

Returns: symbol for indirect content.

void Advance (void)
[protected]

Advance program to the next script statement.

void Error (const char *error)
[protected]

Set error variable and advance to either the error handler or next script statement.

Parameters:
errormessage.

void Trap (unsigned id)
[protected]

Set the execution interpreter to a trap identifier. If no trap id exists, then advance to next script statement (unless exit trap).

Parameters:
idof trap to select numerically.

void Trap (const char *trapname)
[protected]

Select trap by symbolic name and execute if found, else advance to next script step (unless exit trap).

Parameters:
nameof trap to select.

bool Push (void)
[protected]

Attempt to push a value onto the stack.

Returns: false if stack overflow.

bool Pull (void)
[protected]

Attempt to recall a previous stack level.

Returns: false if stack underflow.

bool Step (const char *trapname = NULL)
[protected]

Execute the next pending script statement. If no statement is selected, then we execute the exit handler instead. We can also force feed a trap identifier.

Parameters:
optionaltrap branch point (also checks mask).

Returns: true if advanced to next script statement already.

bool Signal (const char *trapname)
[protected]

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.

Parameters:
nameof signal identifier.

Returns: true if signal handler is not blocked.

bool Signal (unsigned trapid)
[protected]

Signals can be referenced by numeric id as well as by symbolic name.

Parameters:
trapnumber of handler.

Returns: true if signal handler is not blocked.

bool Execute (scriptmethod_t method)
[protected virtual]

Runtime execution of script handler. This can be called in the current or derived class to invoke extensible methods.

Parameters:
derivedmethod to call.

Returns: true if immediately ready for next step.

void Stop (unsigned long mask)
[protected virtual]

Stop request handler. Used for handling external trap requests during a "Signal". This is needed in some state engines when the current state is being abandoned because of a signaled trap.

Parameters:
signalmask forcing stop.

void Exit (void)
[protected pure virtual]

Exit request handler. This is called when no script line exists. No default behavior is known.