Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ScriptCommand Class Reference

This class holds the bound keyword set for a given Bayonne style script interpreter. Bayonne script keyword binding tables and compiler constants. More...

#include <script.h>

Inheritance diagram for ScriptCommand::

Keydata Mutex List of all members.

Protected Methods

scriptmethod_t getHandler (const char *keyword)
 Get the method handler associated with a given keyword. More...

char * Check (char *command, scriptline_t *line, ScriptImage *img)
 Check keyword syntax. More...

virtual unsigned getTrapId (const char *trap)
 Get the trap id number associated with a trap name. More...

virtual unsigned long getTrapDefault (void)
 Get the mask bits for the default script. More...

virtual unsigned long getTrapHandler (scriptname_t *scr)
 Get the mask bits for a trap "handler". More...

virtual unsigned long getTrapMask (unsigned id)
 Get a trap mask for a given identifer. More...

virtual unsigned long getTrapModifier (const char *trapname)
 A helper method for the compiler. More...

virtual unsigned long getTrapMask (const char *trapname)
 A helper method for the compiler used specifically for "^" trap subsection requests. More...

char * chkIgnore (scriptline_t *line, ScriptImage *img)
 Default compiler syntax to accept any syntax. More...

char * chkModule (scriptline_t *line, ScriptImage *img)
 Module based script checker. More...

char * chkUse (scriptline_t *line, ScriptImage *img)
 Performs DSO load phase for USE modules. More...

char * chkHasModify (scriptline_t *line, ScriptImage *img)
 A check used by "inc" and "dec". More...

char * chkHasVars (scriptline_t *line, ScriptImage *img)
 Script compiler syntax check for certain variable using statements such as "clear". More...

char * chkHasList (scriptline_t *line, ScriptImage *img)
 Script compiler syntax check for assignment statements such as "set", "for", etc. More...

char * chkNoArgs (scriptline_t *line, ScriptImage *img)
 Script compiler syntax check for commands that require no arguments to be present. More...

char * chkHasArgs (scriptline_t *line, ScriptImage *img)
 Script compiler syntax check for commands that require one or more arguments to be present. More...

void Load (SCRKEYWORDS *keywords)
 Load a set of keywords into the system keyword table. More...

int Trap (const char *name)
 Add a trap handler symbolic identity to the keyword table. More...

int getCount (void)
 Get count of active traps. More...

virtual char * Check (scriptcheck_t check, scriptline_t *line, ScriptImage *img)
 Perform compile time check of a specified symbol. More...

 ScriptCommand (const char *cfgfile)
 Load a keydata entry for compile-time constants and bind the default ScriptInterp base class methods. More...


Friends

class ScriptImage
class ScriptInterp
class ScriptModule

Detailed Description

This class holds the bound keyword set for a given Bayonne style script interpreter. Bayonne script keyword binding tables and compiler constants.

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

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ScriptCommand::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:
keydata   entry for constants.


Member Function Documentation

virtual char* ScriptCommand::Check scriptcheck_t   check,
scriptline_t *   line,
ScriptImage *   img
[inline, protected, virtual]
 

Perform compile time check of a specified symbol.

Returns:
syntax error message string.
Parameters:
line   pointer.

char* ScriptCommand::Check char *   command,
scriptline_t *   line,
ScriptImage *   img
[protected]
 

Check keyword syntax.

Returns:
syntax error string or NULL.
Parameters:
name   of keyword to check.
hook   to compiler source.

void ScriptCommand::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:
keyword   entries to load.

int ScriptCommand::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:
requested   trap name.
Returns:
assigned id number for the trap.

char* ScriptCommand::chkHasArgs scriptline_t *   line,
ScriptImage *   img
[protected]
 

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

Returns:
syntax error message string or NULL.
Parameters:
line   statement.

char* ScriptCommand::chkHasList scriptline_t *   line,
ScriptImage *   img
[protected]
 

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

Returns:
syntax error message string or NULL.
Parameters:
line   statement.

char* ScriptCommand::chkHasModify scriptline_t *   line,
ScriptImage *   img
[protected]
 

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

Returns:
synxtax error message string or NULL.
Parameters:
line   statement.

char* ScriptCommand::chkHasVars scriptline_t *   line,
ScriptImage *   img
[protected]
 

Script compiler syntax check for certain variable using statements such as "clear".

Assumes list of valid variable arguments.

char* ScriptCommand::chkIgnore scriptline_t *   line,
ScriptImage *   img
[protected]
 

Default compiler syntax to accept any syntax.

char* ScriptCommand::chkModule scriptline_t *   line,
ScriptImage *   img
[protected]
 

Module based script checker.

char* ScriptCommand::chkNoArgs scriptline_t *   line,
ScriptImage *   img
[protected]
 

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

Returns:
syntax error message string or NULL.
Parameters:
line   statement.

char* ScriptCommand::chkUse scriptline_t *   line,
ScriptImage *   img
[protected]
 

Performs DSO load phase for USE modules.

int ScriptCommand::getCount void   [inline, protected]
 

Get count of active traps.

Returns:
count of active trap identifiers.

scriptmethod_t ScriptCommand::getHandler const char *   keyword [protected]
 

Get the method handler associated with a given keyword.

This is used by ScriptImage when compiling.

Parameters:
keyword   to search for.
Returns:
method handler to execute for this keyword.

virtual unsigned long ScriptCommand::getTrapDefault void   [inline, protected, virtual]
 

Get the mask bits for the default script.

Returns:
trap mask to use.

virtual unsigned long ScriptCommand::getTrapHandler scriptname_t *   scr [inline, protected, virtual]
 

Get the mask bits for a trap "handler".

Returns:
trap mask to use.

virtual unsigned ScriptCommand::getTrapId const char *   trap [protected, virtual]
 

Get the trap id number associated with a trap name.

Returns:
trap id number, 0 (exit) if invalid.
Parameters:
name   of trap identifier.

virtual unsigned long ScriptCommand::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:
name   of trap identifier.
Returns:
bit shifted mask or 0 if invalid.

virtual unsigned long ScriptCommand::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.

Returns:
signal mask.
Parameters:
identifier.  

virtual unsigned long ScriptCommand::getTrapModifier const char *   trapname [inline, 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:
name   of trap identifier.
Returns:
bit shifted mask or 0 if invalid.


Friends And Related Function Documentation

friend class ScriptImage [friend]
 

friend class ScriptInterp [friend]
 

friend class ScriptModule [friend]
 


The documentation for this class was generated from the following file:
Generated at Sat Nov 3 09:42:20 2001 for ccScript by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001