Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

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 <bayonnescript.h>

Inheritance diagram for ScriptCommand:

Keydata Mutex Script MemPager aaScript List of all members.

Public Member Functions

char * chkIgnore (Line *line, ScriptImage *img)
 Default compiler syntax to accept any syntax.
char * chkModule (Line *line, ScriptImage *img)
 Module based script checker.
char * chkUse (Line *line, ScriptImage *img)
 Performs DSO load phase for USE modules.
char * chkHasModify (Line *line, ScriptImage *img)
 A check used by "inc" and "dec".
char * chkHasVars (Line *line, ScriptImage *img)
 Script compiler syntax check for certain variable using statements such as "clear".
char * chkHasList (Line *line, ScriptImage *img)
 Script compiler syntax check for assignment statements such as "set", "for", etc.
char * chkNoArgs (Line *line, ScriptImage *img)
 Script compiler syntax check for commands that require no arguments to be present.
char * chkHasArgs (Line *line, ScriptImage *img)
 Script compiler syntax check for commands that require one or more arguments to be present.
unsigned getActivity (void)
 Get activity counter.
bool isCopied (void)
 Is this original or made from a copy constructor?
void * getDatabase (void)
 Get current database connection object for this virtual.
void setDatabase (void *dbc)
 Set database connection object.
void * endDatabase (void)
 Decrement database connection count and return database pointer if last connection being terminated.
bool setThreadQueue (ThreadQueue *tq)
 Assign a data queue object to this virtual script session.
ThreadQueuegetThreadQueue (void)
 Fetch the data queue object assigned to this virtual.

Public Attributes

Mutex dblock

Protected Member Functions

Method getHandler (const char *keyword)
 Get the method handler associated with a given keyword.
char * check (char *command, Line *line, ScriptImage *img)
 Check keyword syntax.
virtual unsigned getTrapId (const char *trap)
 Get the trap id number associated with a trap name.
virtual unsigned long getTrapDefault (void)
 Get the mask bits for the default script.
virtual unsigned long getTrapHandler (Name *scr)
 Get the mask bits for a trap "handler".
virtual unsigned long getTrapMask (unsigned id)
 Get a trap mask for a given identifer.
virtual unsigned long getTrapModifier (const char *trapname)
 A helper method for the compiler.
virtual unsigned long getTrapMask (const char *trapname)
 A helper method for the compiler used specifically for "^" trap subsection requests.
void load (Script::Define *keywords)
 Load a set of keywords into the system keyword table.
int trap (const char *name, bool inherited=true)
 Add a trap handler symbolic identity to the keyword table.
int getCount (void)
 Get count of active traps.
bool isInherited (unsigned id)
 Return true if the trap id is inherited.
virtual char * check (Check chk, Line *line, ScriptImage *img)
 Perform compile time check of a specified symbol.
 ScriptCommand ()
 Create an initialized script command box.
 ScriptCommand (ScriptCommand *ini)
 Create a ScriptCommand box initialized from another.

Protected Attributes

unsigned activity

Friends

class __EXPORT ScriptImage
class __EXPORT ScriptInterp
class __EXPORT ScriptModule

Classes

struct  _keyword

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  )  [protected]
 

Create an initialized script command box.

ScriptCommand::ScriptCommand ScriptCommand ini  )  [protected]
 

Create a ScriptCommand box initialized from another.


Member Function Documentation

virtual char* ScriptCommand::check Check  chk,
Line 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,
Line line,
ScriptImage img
[protected]
 

Check keyword syntax.

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

char* ScriptCommand::chkHasArgs Line line,
ScriptImage img
 

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 Line line,
ScriptImage img
 

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 Line line,
ScriptImage img
 

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

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

char* ScriptCommand::chkHasVars Line line,
ScriptImage img
 

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

Assumes list of valid variable arguments.

char* ScriptCommand::chkIgnore Line line,
ScriptImage img
 

Default compiler syntax to accept any syntax.

char* ScriptCommand::chkModule Line line,
ScriptImage img
 

Module based script checker.

char* ScriptCommand::chkNoArgs Line line,
ScriptImage img
 

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 Line line,
ScriptImage img
 

Performs DSO load phase for USE modules.

void* ScriptCommand::endDatabase void   ) 
 

Decrement database connection count and return database pointer if last connection being terminated.

Returns:
database connection object when closing last connection.

unsigned ScriptCommand::getActivity void   )  [inline]
 

Get activity counter.

Returns:
activity counter.

int ScriptCommand::getCount void   )  [inline, protected]
 

Get count of active traps.

Returns:
count of active trap identifiers.

Reimplemented from Keydata.

void* ScriptCommand::getDatabase void   ) 
 

Get current database connection object for this virtual.

Returns:
pointer to database connection object.

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

ThreadQueue* ScriptCommand::getThreadQueue void   )  [inline]
 

Fetch the data queue object assigned to this virtual.

Returns:
pointer to data queue object.

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 Name *  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.

Reimplemented in aaScript.

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.

bool ScriptCommand::isCopied void   )  [inline]
 

Is this original or made from a copy constructor?

Returns:
true if made from copy constructor.

bool ScriptCommand::isInherited unsigned  id  )  [protected]
 

Return true if the trap id is inherited.

void ScriptCommand::load Script::Define 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.

void ScriptCommand::setDatabase void *  dbc  ) 
 

Set database connection object.

Parameters:
pointer to a database connection object.

bool ScriptCommand::setThreadQueue ThreadQueue tq  ) 
 

Assign a data queue object to this virtual script session.

Returns:
false if already set.
Parameters:
pointer to data queue object.

int ScriptCommand::trap const char *  name,
bool  inherited = true
[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.


Friends And Related Function Documentation

friend class __EXPORT ScriptImage [friend]
 

friend class __EXPORT ScriptInterp [friend]
 

friend class __EXPORT ScriptModule [friend]
 


Member Data Documentation

unsigned ScriptCommand::activity [protected]
 

Mutex ScriptCommand::dblock
 


The documentation for this class was generated from the following file:
Generated on Tue Sep 13 02:19:09 2005 for Bayonne by  doxygen 1.4.4