ost::ScriptCompiler Class Reference

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

#include <script3.h>

Inheritance diagram for ost::ScriptCompiler:

ost::ScriptImage ost::Keydata ost::Script ost::Assoc ost::MemPager List of all members.

Public Member Functions

char * getToken (char **pre=NULL)
virtual void fastBranch (ScriptInterp *interp)
 Fast branch linkback code.
 ScriptCompiler (ScriptCommand *cmdset, const char *symset)
 Construct a new working image.
Name * include (const char *name)
 A method to invoke the script compiler to include a script only if it has not been included already.
int compile (const char *file)
 The script compiler itself.
int compile (const char *file, char *name)
 Compile a script from disk and give it a different internal "name" as passed.
int compileDefinitions (const char *file)
 Compile a defintions library, commonly used for remapping tokens to macros.
int compile (std::istream *stream, char *name, const char *file=NULL)
 Compile an open stream object into a script.
void commit (void)
 Used in the derived constructor to "commit" the current image for new processes.
virtual const char * getDefined (const char *token)
 Used to process '$const' inserts.
const char * preproc (const char *token)
 Check for special preprocessor token.
std::istream * getSource (void)
 Used by embedded interpreters to fetch script from the current source file.

Protected Types

typedef ost::ScriptCompiler::_merge merge_t

Protected Member Functions

virtual bool checkSegment (Name *scr)

Protected Attributes

std::ifstream scrSource
std::istream * scrStream
char * buffer
unsigned bufsize
char * bp
bool quote
unsigned paren
unsigned inccount
const char * incfiles [256]
merge_tmlist

Friends

class ScriptInterp

Classes

struct  _merge

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:
David Sugar <dyfet@ostel.com>.


Member Typedef Documentation

typedef struct ost::ScriptCompiler::_merge ost::ScriptCompiler::merge_t [protected]
 


Constructor & Destructor Documentation

ost::ScriptCompiler::ScriptCompiler ScriptCommand cmdset,
const char *  symset
 

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.
symset of symbols to set.


Member Function Documentation

virtual bool ost::ScriptCompiler::checkSegment Name *  scr  )  [protected, virtual]
 

void ost::ScriptCompiler::commit void   ) 
 

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

This is usually the last statement in the derived constructor.

Reimplemented from ost::ScriptImage.

int ost::ScriptCompiler::compile std::istream *  stream,
char *  name,
const char *  file = NULL
 

Compile an open stream object into a script.

Returns:
lines of script compiled.
Parameters:
stream object to use.
name of script save under.
file name to use in object.

int ost::ScriptCompiler::compile const char *  file,
char *  name
 

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

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

int ost::ScriptCompiler::compile const char *  file  ) 
 

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:
file name of script file to compile.

int ost::ScriptCompiler::compileDefinitions const char *  file  ) 
 

Compile a defintions library, commonly used for remapping tokens to macros.

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

virtual void ost::ScriptCompiler::fastBranch ScriptInterp interp  )  [virtual]
 

Fast branch linkback code.

Reimplemented from ost::ScriptImage.

virtual const char* ost::ScriptCompiler::getDefined const char *  token  )  [virtual]
 

Used to process '$const' inserts.

Returns:
string if found.
Parameters:
token string being substituted.

std::istream* ost::ScriptCompiler::getSource void   )  [inline]
 

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

Returns:
reference to source file stream.

char* ost::ScriptCompiler::getToken char **  pre = NULL  ) 
 

Name* ost::ScriptCompiler::include const char *  name  ) 
 

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.

const char* ost::ScriptCompiler::preproc const char *  token  ) 
 

Check for special preprocessor token.

Returns:
error message or NULL if no error.
Parameters:
token name of keyword to check.


Friends And Related Function Documentation

friend class ScriptInterp [friend]
 

Reimplemented from ost::ScriptImage.


Member Data Documentation

char* ost::ScriptCompiler::bp [protected]
 

char* ost::ScriptCompiler::buffer [protected]
 

unsigned ost::ScriptCompiler::bufsize [protected]
 

unsigned ost::ScriptCompiler::inccount [protected]
 

const char* ost::ScriptCompiler::incfiles[256] [protected]
 

merge_t* ost::ScriptCompiler::mlist [protected]
 

unsigned ost::ScriptCompiler::paren [protected]
 

bool ost::ScriptCompiler::quote [protected]
 

std::ifstream ost::ScriptCompiler::scrSource [protected]
 

std::istream* ost::ScriptCompiler::scrStream [protected]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 6 09:03:07 2006 for Bayonne Framework by  doxygen 1.4.6