class ScriptCommand

Bayonne script keyword binding tables and compiler constants. More...

Definition#include <../../extras/script/script.h>
InheritsKeydata, Mutex
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Protected Members


Detailed Description

This class holds the bound keyword set for a given Bayonne style script interpreter. Application specific dialects are created by deriving a application specific version of ScriptCommand which then binds application specific keywords and associated methods in an application derived ScriptInterp which are typecast to (scriptmethod_t).

unsigned getTrapId (const char *trap)
[protected virtual]

Get the trap id number associated with a trap name.

Parameters:
nameof trap identifier.

Returns: trap id number, 0 (exit) if invalid.

unsigned long getTrapDefault (void)
[protected virtual]

Get the mask bits for the default script.

Returns: trap mask to use.

unsigned long getTrapHandler (scriptname_t *scr)
[protected virtual]

Get the mask bits for a trap "handler".

Returns: trap mask to use.

unsigned long getTrapMask (unsigned id)
[protected virtual]

Get a trap mask for a given identifer. This is a virtual since some derived handlers may manipulate mask bits.

Parameters:
identifier.

Returns: signal mask.

unsigned long getTrapModifier (const char *trapname)
[protected virtual]

A helper method for the compiler. Converts a named trap into it's bit shifted mask. By making it a virtual, derived dialects can add "aliases" to default trap names.

Parameters:
nameof trap identifier.

Returns: bit shifted mask or 0 if invalid.

unsigned long getTrapMask (const char *trapname)
[protected virtual]

A helper method for the compiler used specifically for "^" trap subsection requests. These will occasionally carry different attribute settings.

Parameters:
nameof trap identifier.

Returns: bit shifted mask or 0 if invalid.

char * chkIgnore (scriptline_t *line)
[protected]

Default compiler syntax to accept any syntax.

char * chkHasModify (scriptline_t *line)
[protected]

A check used by "inc" and "dec".

Parameters:
linestatement.

Returns: synxtax error message string or NULL.

char * chkHasVars (scriptline_t *line)
[protected]

Script compiler syntax check for certain variable using statements such as "clear". Assumes list of valid variable arguments.

char * chkHasList (scriptline_t *line)
[protected]

Script compiler syntax check for assignment statements such as "set", "for", etc.

Parameters:
linestatement.

Returns: syntax error message string or NULL.

char * chkNoArgs (scriptline_t *line)
[protected]

Script compiler syntax check for commands that require no arguments to be present.

Parameters:
linestatement.

Returns: syntax error message string or NULL.

char * chkHasArgs (scriptline_t *line)
[protected]

Script compiler syntax check for commands that require one or more arguments to be present.

Parameters:
linestatement.

Returns: syntax error message string or NULL.

void Load (SCRKEYWORDS *keywords)
[protected]

Load a set of keywords into the system keyword table. This provides a convenient method of initializing and adding to the keyword indexes.

Parameters:
keywordentries to load.

Reimplemented from Keydata

int Trap (const char *name)
[protected]

Add a trap handler symbolic identity to the keyword table. These are used to handle signal mask coercion and event branch points in the compiler.

Parameters:
requestedtrap name.

Returns: assigned id number for the trap.

inline int getCount (void)
[protected]

Get count of active traps.

Returns: count of active trap identifiers.

Reimplemented from Keydata

char * Check (scriptcheck_t check, scriptline_t *line)
[protected virtual]

Perform compile time check of a specified symbol.

Parameters:
linepointer.

Returns: syntax error message string.

ScriptCommand (const char *cfgfile)
[protected]

Load a keydata entry for compile-time constants and bind the default ScriptInterp base class methods. This class is never used alone, so no public constructor is provided.

Parameters:
keydataentry for constants.