#include <script.h>
Inheritance diagram for ScriptImage:
Public Member Functions | |
virtual Name * | getScript (const char *name) |
Fetch named script. | |
virtual Name * | dupScript (const char *name, const char *target) |
Duplicate script if needed. | |
unsigned | gather (const char *suffix, Name **array, unsigned size) |
Fetch list of relational scripts. | |
std::istream * | getSource (void) |
Used by embedded interpreters to fetch script from the current source file. | |
Protected Member Functions | |
char * | getToken (char **pre=NULL) |
Method | getHandler (const char *keyword) |
Get the interpreter method pointer for a given keyword. | |
ScriptImage (ScriptCommand *cmdset, const char *symset) | |
Construct a new working image. | |
void | purge (void) |
Purge and reload the script image workspace. | |
Name * | include (const char *scrfile) |
A method to invoke the script compiler to include a script only if it has not been included already. | |
int | compile (const char *scrfile) |
The script compiler itself. | |
int | compile (const char *scrfile, char *name) |
Compile a script from disk and give it a different internal "name" as passed. | |
int | compile (std::istream *str, char *name, const char *scrname=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 bool | preProcess (const char *directive, Name *script) |
used to create dialect specific pre-precessor directives. | |
virtual const char * | getDefined (const char *token) |
Used to process '$const' inserts. | |
void | load (Initial *ilist) |
Used by a derived constructor to load an initialization list. | |
void | initial (const char *keyword, const char *value, unsigned size=0) |
Used to load a single initialization list entry. | |
Protected Attributes | |
std::ifstream | scrSource |
std::istream * | scrStream |
ScriptCommand * | cmds |
int | refcount |
Name * | index [37] |
char * | buffer |
unsigned | bufsize |
char * | bp |
bool | quote |
unsigned | paren |
Mutex | duplock |
ScriptImage::InitialList * | ilist |
Friends | |
class | ScriptInterp |
class | ScriptModule |
Classes | |
class | InitialList |
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.
ScriptImage::ScriptImage | ( | ScriptCommand * | cmdset, | |
const char * | symset | |||
) | [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.
cmdset | of keyword table object used. |
char* ScriptImage::getToken | ( | char ** | pre = NULL |
) | [protected] |
Method ScriptImage::getHandler | ( | const char * | keyword | ) | [inline, protected] |
Get the interpreter method pointer for a given keyword.
keyword | to search. |
void ScriptImage::purge | ( | void | ) | [protected] |
Purge and reload the script image workspace.
Name* 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.
name | of script file to compile. |
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.
name | of script file to compile. |
int ScriptImage::compile | ( | const char * | scrfile, | |
char * | name | |||
) | [protected] |
Compile a script from disk and give it a different internal "name" as passed.
name | of script file to compile. | |
name | of script to save under. | |
test | if script already loaded. |
int ScriptImage::compile | ( | std::istream * | str, | |
char * | name, | |||
const char * | scrname = NULL | |||
) | [protected] |
Compile an open stream object into a script.
stream | object to use. | |
name | of script save under. |
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.
virtual bool ScriptImage::preProcess | ( | const char * | directive, | |
Name * | script | |||
) | [inline, protected, virtual] |
used to create dialect specific pre-precessor directives.
directive | ||
script | object being built |
virtual const char* ScriptImage::getDefined | ( | const char * | token | ) | [inline, protected, virtual] |
Used to process '$const' inserts.
script | token being substituted. |
void ScriptImage::load | ( | Initial * | ilist | ) | [protected] |
Used by a derived constructor to load an initialization list.
initialization | list. |
void ScriptImage::initial | ( | const char * | keyword, | |
const char * | value, | |||
unsigned | size = 0 | |||
) | [protected] |
Used to load a single initialization list entry.
keyword | ||
value | ||
size |
virtual Name* ScriptImage::getScript | ( | const char * | name | ) | [virtual] |
Fetch named script.
script | name to find. |
virtual Name* ScriptImage::dupScript | ( | const char * | name, | |
const char * | target | |||
) | [virtual] |
Duplicate script if needed.
script | name to dup. | |
target | name to dup as. |
unsigned ScriptImage::gather | ( | const char * | suffix, | |
Name ** | array, | |||
unsigned | size | |||
) |
Fetch list of relational scripts.
suffix. | ||
index. | ||
max | entries. |
std::istream* ScriptImage::getSource | ( | void | ) | [inline] |
Used by embedded interpreters to fetch script from the current source file.
friend class ScriptInterp [friend] |
friend class ScriptModule [friend] |
std::ifstream ScriptImage::scrSource [protected] |
std::istream* ScriptImage::scrStream [protected] |
ScriptCommand* ScriptImage::cmds [protected] |
int ScriptImage::refcount [protected] |
Name* ScriptImage::index[37] [protected] |
char* ScriptImage::buffer [protected] |
unsigned ScriptImage::bufsize [protected] |
char* ScriptImage::bp [protected] |
bool ScriptImage::quote [protected] |
unsigned ScriptImage::paren [protected] |
Mutex ScriptImage::duplock [protected] |
ScriptImage::InitialList * ScriptImage::ilist [protected] |