ost::ScriptInterp Class Reference

#include <script3.h>

Inheritance diagram for ost::ScriptInterp:

ost::Mutex ost::ScriptSymbols ost::MemPager ost::Script ost::BayonneSession ost::ScriptMethods ost::BayonneTSession List of all members.

Public Member Functions

long getIntValue (const char *text, unsigned prec, ScriptProperty *property=NULL)
int numericExpression (long *list, int max, unsigned prec, ScriptProperty *property=NULL)
bool conditionalExpression (void)
bool conditional (void)
virtual unsigned getId (void)
unsigned long getSequence (void)
virtual const char * getLogname (void)
virtual ScriptInterpgetInterp (const char *id)
virtual const char * getExternal (const char *opt)
ScriptImagegetImage (void)
const char * getMember (void)
const char * getKeyword (const char *kw)
const char * getKeyoption (const char *kw)
const char * getValue (const char *def=NULL)
const char * getOption (const char *def=NULL)
const char * hasOption (void)
const char * getContent (const char *opt)
const char * getSymContent (const char *opt)
SymbolgetKeysymbol (const char *kw, unsigned size=0)
SymbolgetSymbol (unsigned short size=0)
char getPackToken (void)
FramegetFrame (void)
Line * getLine (void)
void setFrame (void)
Name * getName (void)
bool getTrace (void)
bool execute (Method method)
 Runtime execution of script handler.
virtual void logmissing (const char *id, const char *level="undefined", const char *group="symbol")
virtual void logerror (const char *msg, const char *name=NULL)
SymbolmapSymbol (const char *id, unsigned short=0)
SymbolmapDirect (const char *id, unsigned short=0)
bool setNumber (const char *id, const char *value=NULL, unsigned dec=0)
bool setSymbol (const char *id, const char *value=NULL, unsigned short size=0)
bool setConst (const char *id, const char *value)
bool putSymbol (const char *id, const char *value, unsigned short size=0)
bool getSymbol (const char *id, char *buffer, unsigned short max)
bool catSymbol (const char *id, const char *value, unsigned short size=0)
const char * getSymbol (const char *id)
Name * getScript (const char *name)
 ScriptInterp ()
bool step (void)
bool attach (ScriptCommand *cmd, const char *scrname)
void detach (void)
void attach (ScriptCommand *cmd, ScriptImage *img, Name *scr)
void release (void)
 Release any aquired lock.
bool signal (const char *name)
 Signals are used during "delayed" execution steps when a signal event has occured aynchronously with the execution of a script controlled state event handler.
bool signal (unsigned id)
 Signals can be referenced by numeric id as well as by symbolic name.
bool done (void)
timeout_t getTimeout (void)
virtual void branching (void)
 A virtual holding a branch conditional member.
bool isRunning (void)
bool isExiting (void)
char * getTemp (void)
unsigned getTempSize (void)

Static Public Member Functions

static long getRealValue (double val, unsigned prec)
static double getDouble (long value, unsigned prec)
static long getInteger (long value, unsigned prec)
static long getTens (unsigned prec)

Protected Member Functions

virtual ScriptSymbolsgetSymbols (const char *id)
ScriptSymbolsgetLocal (void)
void initRuntime (Name *name)
 Initialize execution environment for a script.
virtual void initialize (void)
 New virtual to initialize script environment syms before running init sections.
bool push (void)
 Attempt to push a value onto the stack.
bool pull (void)
 Attempt to recall a previous stack level.
void clearStack (void)
 Clear the stack of local loops or recursion for branching.
void advance (void)
 Advance program to the next script statement.
void skip (void)
 Skip line without checking or setting updates.
void error (const char *error)
 Set error variable and advance to either the error handler or next script statement.
bool scriptEvent (const char *name, bool inhereted=true)
 Events reference to named @event handlers which have been attached to a script.
void gotoEvent (NamedEvent *event)
 Branch to a selected event record immediately.
void trap (unsigned id)
 Set the execution interpreter to a trap identifier.
bool tryCatch (const char *id)
 Tries a catch handler.
void trap (const char *name)
 Select trap by symbolic name and execute if found, else advance to next script step (unless exit trap).
virtual bool isLocked (const char *id)
virtual const char * remapLocal (void)
virtual bool exit (void)
virtual void enterThread (ScriptThread *thread)
virtual void exitThread (const char *msg)
virtual void waitThread (void)
virtual void startThread (void)
bool eventThread (const char *evt, bool flag=true)
bool redirect (const char *scr)
void ripple (void)
bool redirect (bool evflag)
unsigned long getMask (void)

Protected Attributes

Mutexlock
ScriptCommandcmd
ScriptImageimage
ScriptInterpsession
ScriptThreadthread
Frame frame [SCRIPT_STACK_SIZE]
char * temps [SCRIPT_TEMP_SPACE]
unsigned tempidx
unsigned stack
bool initialized
bool trace
bool exiting
bool updated
unsigned long sequence
char logname [32]

Friends

class ScriptThread
class ScriptCommand
class ScriptBinder

Classes

class  Frame

Constructor & Destructor Documentation

ost::ScriptInterp::ScriptInterp  ) 
 


Member Function Documentation

void ost::ScriptInterp::advance void   )  [protected]
 

Advance program to the next script statement.

void ost::ScriptInterp::attach ScriptCommand cmd,
ScriptImage img,
Name *  scr
 

bool ost::ScriptInterp::attach ScriptCommand cmd,
const char *  scrname
 

virtual void ost::ScriptInterp::branching void   )  [virtual]
 

A virtual holding a branch conditional member.

This may be invoked typically from goto or restart. Can be used to check contextual changes.

Reimplemented in ost::BayonneSession.

bool ost::ScriptInterp::catSymbol const char *  id,
const char *  value,
unsigned short  size = 0
 

void ost::ScriptInterp::clearStack void   )  [protected]
 

Clear the stack of local loops or recursion for branching.

bool ost::ScriptInterp::conditional void   ) 
 

bool ost::ScriptInterp::conditionalExpression void   ) 
 

void ost::ScriptInterp::detach void   ) 
 

Reimplemented in ost::BayonneSession.

bool ost::ScriptInterp::done void   ) 
 

virtual void ost::ScriptInterp::enterThread ScriptThread thread  )  [protected, virtual]
 

Reimplemented in ost::BayonneSession.

void ost::ScriptInterp::error const char *  error  )  [protected]
 

Set error variable and advance to either the error handler or next script statement.

Parameters:
error message.

bool ost::ScriptInterp::eventThread const char *  evt,
bool  flag = true
[protected]
 

bool ost::ScriptInterp::execute Method  method  ) 
 

Runtime execution of script handler.

This can be called in the current or derived class to invoke extensible methods.

Returns:
true if immediately ready for next step.
Parameters:
method derived method member to call.

virtual bool ost::ScriptInterp::exit void   )  [protected, virtual]
 

Reimplemented in ost::BayonneSession.

virtual void ost::ScriptInterp::exitThread const char *  msg  )  [protected, virtual]
 

Reimplemented in ost::BayonneSession.

const char* ost::ScriptInterp::getContent const char *  opt  ) 
 

static double ost::ScriptInterp::getDouble long  value,
unsigned  prec
[static]
 

virtual const char* ost::ScriptInterp::getExternal const char *  opt  )  [virtual]
 

Reimplemented in ost::BayonneSession.

Frame* ost::ScriptInterp::getFrame void   )  [inline]
 

virtual unsigned ost::ScriptInterp::getId void   )  [virtual]
 

Reimplemented in ost::BayonneSession.

ScriptImage* ost::ScriptInterp::getImage void   )  [inline]
 

static long ost::ScriptInterp::getInteger long  value,
unsigned  prec
[static]
 

virtual ScriptInterp* ost::ScriptInterp::getInterp const char *  id  )  [virtual]
 

Reimplemented in ost::BayonneSession.

long ost::ScriptInterp::getIntValue const char *  text,
unsigned  prec,
ScriptProperty property = NULL
 

const char* ost::ScriptInterp::getKeyoption const char *  kw  ) 
 

Symbol* ost::ScriptInterp::getKeysymbol const char *  kw,
unsigned  size = 0
 

const char* ost::ScriptInterp::getKeyword const char *  kw  ) 
 

Line* ost::ScriptInterp::getLine void   )  [inline]
 

ScriptSymbols* ost::ScriptInterp::getLocal void   )  [protected]
 

virtual const char* ost::ScriptInterp::getLogname void   )  [inline, virtual]
 

unsigned long ost::ScriptInterp::getMask void   )  [protected]
 

const char* ost::ScriptInterp::getMember void   ) 
 

Name* ost::ScriptInterp::getName void   )  [inline]
 

const char* ost::ScriptInterp::getOption const char *  def = NULL  ) 
 

char ost::ScriptInterp::getPackToken void   ) 
 

static long ost::ScriptInterp::getRealValue double  val,
unsigned  prec
[static]
 

Name* ost::ScriptInterp::getScript const char *  name  ) 
 

Reimplemented in ost::BayonneSession.

unsigned long ost::ScriptInterp::getSequence void   )  [inline]
 

const char* ost::ScriptInterp::getSymbol const char *  id  ) 
 

bool ost::ScriptInterp::getSymbol const char *  id,
char *  buffer,
unsigned short  max
 

Symbol* ost::ScriptInterp::getSymbol unsigned short  size = 0  ) 
 

virtual ScriptSymbols* ost::ScriptInterp::getSymbols const char *  id  )  [protected, virtual]
 

Reimplemented in ost::BayonneSession.

const char* ost::ScriptInterp::getSymContent const char *  opt  ) 
 

char* ost::ScriptInterp::getTemp void   ) 
 

unsigned ost::ScriptInterp::getTempSize void   ) 
 

static long ost::ScriptInterp::getTens unsigned  prec  )  [static]
 

timeout_t ost::ScriptInterp::getTimeout void   ) 
 

bool ost::ScriptInterp::getTrace void   )  [inline]
 

const char* ost::ScriptInterp::getValue const char *  def = NULL  ) 
 

void ost::ScriptInterp::gotoEvent NamedEvent *  event  )  [protected]
 

Branch to a selected event record immediately.

Parameters:
event record pointer to access.

const char* ost::ScriptInterp::hasOption void   ) 
 

virtual void ost::ScriptInterp::initialize void   )  [protected, virtual]
 

New virtual to initialize script environment syms before running init sections.

Reimplemented in ost::BayonneSession.

void ost::ScriptInterp::initRuntime Name *  name  )  [protected]
 

Initialize execution environment for a script.

bool ost::ScriptInterp::isExiting void   )  [inline]
 

virtual bool ost::ScriptInterp::isLocked const char *  id  )  [protected, virtual]
 

bool ost::ScriptInterp::isRunning void   )  [inline]
 

virtual void ost::ScriptInterp::logerror const char *  msg,
const char *  name = NULL
[virtual]
 

virtual void ost::ScriptInterp::logmissing const char *  id,
const char *  level = "undefined",
const char *  group = "symbol"
[virtual]
 

Symbol* ost::ScriptInterp::mapDirect const char *  id,
unsigned  short = 0
 

Symbol* ost::ScriptInterp::mapSymbol const char *  id,
unsigned  short = 0
 

int ost::ScriptInterp::numericExpression long *  list,
int  max,
unsigned  prec,
ScriptProperty property = NULL
 

bool ost::ScriptInterp::pull void   )  [protected]
 

Attempt to recall a previous stack level.

Returns:
false if stack underflow.

bool ost::ScriptInterp::push void   )  [protected]
 

Attempt to push a value onto the stack.

Returns:
false if stack overflow.

bool ost::ScriptInterp::putSymbol const char *  id,
const char *  value,
unsigned short  size = 0
 

bool ost::ScriptInterp::redirect bool  evflag  )  [protected]
 

bool ost::ScriptInterp::redirect const char *  scr  )  [protected]
 

void ost::ScriptInterp::release void   ) 
 

Release any aquired lock.

..

virtual const char* ost::ScriptInterp::remapLocal void   )  [protected, virtual]
 

void ost::ScriptInterp::ripple void   )  [protected]
 

bool ost::ScriptInterp::scriptEvent const char *  name,
bool  inhereted = true
[protected]
 

Events reference to named @event handlers which have been attached to a script.

This allows low level applications to invoke an event handler much the way a signal handler occurs.

Returns:
true if event handler exists.
Parameters:
name of event handler.
inhereted search flag.

bool ost::ScriptInterp::setConst const char *  id,
const char *  value
 

void ost::ScriptInterp::setFrame void   ) 
 

bool ost::ScriptInterp::setNumber const char *  id,
const char *  value = NULL,
unsigned  dec = 0
 

bool ost::ScriptInterp::setSymbol const char *  id,
const char *  value = NULL,
unsigned short  size = 0
 

bool ost::ScriptInterp::signal unsigned  id  ) 
 

Signals can be referenced by numeric id as well as by symbolic name.

Returns:
true if signal handler is not blocked.
Parameters:
id number of handler.

bool ost::ScriptInterp::signal const char *  name  ) 
 

Signals are used during "delayed" execution steps when a signal event has occured aynchronously with the execution of a script controlled state event handler.

This mechanism can be used in place of calling implicit "Step" traps.

Returns:
true if signal handler is not blocked.
Parameters:
name of signal identifier.

void ost::ScriptInterp::skip void   )  [protected]
 

Skip line without checking or setting updates.

virtual void ost::ScriptInterp::startThread void   )  [protected, virtual]
 

Reimplemented in ost::BayonneSession.

bool ost::ScriptInterp::step void   ) 
 

void ost::ScriptInterp::trap const char *  name  )  [protected]
 

Select trap by symbolic name and execute if found, else advance to next script step (unless exit trap).

Parameters:
name of trap to select.

void ost::ScriptInterp::trap unsigned  id  )  [protected]
 

Set the execution interpreter to a trap identifier.

If no trap id exists, then advance to next script statement (unless exit trap).

Parameters:
id of trap to select numerically.

bool ost::ScriptInterp::tryCatch const char *  id  )  [protected]
 

Tries a catch handler.

..

Returns:
true if caught.
Parameters:
id of catch handler to try.

virtual void ost::ScriptInterp::waitThread void   )  [protected, virtual]
 


Friends And Related Function Documentation

friend class ScriptBinder [friend]
 

friend class ScriptCommand [friend]
 

friend class ScriptThread [friend]
 


Member Data Documentation

ScriptCommand* ost::ScriptInterp::cmd [protected]
 

bool ost::ScriptInterp::exiting [protected]
 

Frame ost::ScriptInterp::frame[SCRIPT_STACK_SIZE] [protected]
 

ScriptImage* ost::ScriptInterp::image [protected]
 

bool ost::ScriptInterp::initialized [protected]
 

Mutex* ost::ScriptInterp::lock [protected]
 

char ost::ScriptInterp::logname[32]