Google

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

ScriptImage Class Reference

A derivable class to hold compiled script images for active processes. Script compiler image set. More...

#include <script.h>

Inheritance diagram for ScriptImage:

MemPager List of all members.

Public Methods

ifstream& getSource (void)
 Used by embedded interpreters to fetch script from the current source file. More...


Protected Methods

char* getToken (void)
 ScriptImage (ScriptCommand *cmdset)
 Construct a new working image. More...

scriptname_tInclude (const char *scrfile)
 A method to invoke the script compiler to include a script only if it has not been included already. More...

int Compile (const char *scrfile)
 The script compiler itself. More...

int Compile (const char *scrfile, char *name)
 Compile a script from disk and give it a different internal "name" as passed. More...

void Commit (void)
 Used in the derived constructor to "commit" the current image for new processes. More...

virtual scriptname_tgetScript (const char *name)
 Fetch named script. More...


Protected Attributes

ifstream scrFile
ScriptCommandcmds
int refcount
scriptname_tindex [SCRIPT_INDEX_SIZE]
char buffer [512]
char* bp
bool quote

Friends

class  ScriptInterp

Detailed Description

A derivable class to hold compiled script images for active processes. Script compiler image set.

This includes the script image compiler itself. Typically, a script is compiled one file at a time from a directory, and the committed, during the constructor in a derived class.

Author(s):
David Sugar <dyfet@ostel.com>.


Constructor & Destructor Documentation

ScriptImage::ScriptImage ( ScriptCommand * cmdset ) [protected]
 

Construct a new working image.

This must be derived to an application specific compiler that can scan directories and invoke the compiler as needed.

Parameters:
cmdset   of keyword table object used.


Member Function Documentation

void ScriptImage::Commit ( void ) [protected]
 

Used in the derived constructor to "commit" the current image for new processes.

This is usually the last statement in the derived constructor.

int ScriptImage::Compile ( const char * scrfile,
char * name ) [protected]
 

Compile a script from disk and give it a different internal "name" as passed.

Returns:
lines of script compiled.
Parameters:
name   of script file to compile.
name   of script to save under.
test   if script already loaded.

int ScriptImage::Compile ( const char * scrfile ) [protected]
 

The script compiler itself.

This linearly compiles a Bayonne script file that is specified. Normally used along with a dir scanner in the constructor.

Returns:
lines of script compiled.
Parameters:
name   of script file to compile.

scriptname_t * ScriptImage::Include ( const char * scrfile ) [protected]
 

A method to invoke the script compiler to include a script only if it has not been included already.

Returns:
named script object.
Parameters:
name   of script file to compile.

scriptname_t * ScriptImage::getScript ( const char * name ) [protected, virtual]
 

Fetch named script.

Made virtual so that it could have a a overriden version which externally fetches scripts not already compiled, for example.

Parameters:
script   name to find.
Returns:
script or NULL.

ifstream & ScriptImage::getSource ( void ) [inline]
 

Used by embedded interpreters to fetch script from the current source file.

Returns:
reference to source file stream.

char* ScriptImage::getToken ( void ) [protected]
 


Friends And Related Function Documentation

class ScriptInterp [friend]
 


Member Data Documentation

char * ScriptImage::bp [protected]
 

char ScriptImage::buffer[512] [protected]
 

ScriptCommand * ScriptImage::cmds [protected]
 

scriptname_t * ScriptImage::index[SCRIPT_INDEX_SIZE] [protected]
 

bool ScriptImage::quote [protected]
 

int ScriptImage::refcount [protected]
 

ifstream ScriptImage::scrFile [protected]
 


The documentation for this class was generated from the following file:
Generated at Thu Apr 5 14:11:40 2001 for ccscript by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000