YMLSAXParser Class Reference

#include <ymlsaxparser.h>

Inheritance diagram for YMLSAXParser:

Inheritance graph
[legend]
Collaboration diagram for YMLSAXParser:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::list< ParseCall * > parseCalls_t

Public Member Functions

 YMLSAXParser ()
virtual ~YMLSAXParser ()
void setInterpreter (Interpreter *interpreter)
virtual void startNetwork (const char *name, const char *className)
virtual void endNetwork ()
virtual void startNode (const char *name, const char *className)
virtual void endNode ()
virtual void startLink (const char *object1, const char *port1, const char *object2, const char *port2)
virtual void endLink ()
virtual void startPort (const char *name, const char *dir)
virtual void endPort ()
virtual void startProperty (const char *name, const char *value)
virtual void endProperty ()
virtual void doc (const char *data)
virtual void parseCall (call_t type, int argc, const char *const *args)
void executeSet (parseCalls_t::iterator start)
void startSet (const char *loop, const char *init, const char *cond)
void endSet ()
void script (const char *data)
const char * lookup (const char *)
void lookupArgs (int argc, const char *const *args, const char **pargs)
void localParseCall (call_t type, int argc, const char *const *args)
void dispatch (call_t type, int argc, char **args)
void clearText ()
void startDocument ()
void endDocument ()
void startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attributes)
void endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
void characters (const XMLCh *const chars, const unsigned int length)

Public Attributes

Interpreterinterpreter
BasicSmartPointer< XMLCh,
SP_ARRAY > 
text
int setDepth
parseCalls_t parseCalls

Protected Member Functions

void clearParseCalls ()

Member Typedef Documentation

typedef std::list<ParseCall *> YMLSAXParser::parseCalls_t
 


Constructor & Destructor Documentation

YMLSAXParser::YMLSAXParser  ) 
 

Construct a YMLSAXParser

YMLSAXParser::~YMLSAXParser  )  [virtual]
 

Destruct a YMLSAXParser


Member Function Documentation

void YMLSAXParser::setInterpreter Interpreter interpreter  )  [inline]
 

Set the script interpreter. This intrepreter is used for the yml scripting features. Any class which correctly implements the Intrepreter interface may be used.

Parameters:
interpreter A pointer to the intrepreter.

virtual void YMLSAXParser::startNetwork const char *  name,
const char *  className
[inline, virtual]
 

virtual void YMLSAXParser::endNetwork  )  [inline, virtual]
 

virtual void YMLSAXParser::startNode const char *  name,
const char *  className
[inline, virtual]
 

virtual void YMLSAXParser::endNode  )  [inline, virtual]
 

virtual void YMLSAXParser::startLink const char *  object1,
const char *  port1,
const char *  object2,
const char *  port2
[inline, virtual]
 

virtual void YMLSAXParser::endLink  )  [inline, virtual]
 

virtual void YMLSAXParser::startPort const char *  name,
const char *  dir
[inline, virtual]
 

virtual void YMLSAXParser::endPort  )  [inline, virtual]
 

virtual void YMLSAXParser::startProperty const char *  name,
const char *  value
[inline, virtual]
 

virtual void YMLSAXParser::endProperty  )  [inline, virtual]
 

virtual void YMLSAXParser::doc const char *  data  )  [inline, virtual]
 

void YMLSAXParser::parseCall call_t  type,
int  argc,
const char *const *  args
[virtual]
 

Calls the individual start and end Network, Node, Link, Port, Property and doc functions. Reimplementing this function is a good way to specialize the YMLSAXParser for your needs.

Parameters:
type The parse call type.
argc The number of arguments to this call.
args The arguments for this call.

Reimplemented in YMLLoader.

void YMLSAXParser::executeSet parseCalls_t::iterator  start  ) 
 

Execute a set by replaying the parse calls in side the set as perscribed by the sets loop control arguments.

Parameters:
start Pointer to where this set starts.

void YMLSAXParser::startSet const char *  loop,
const char *  init,
const char *  cond
 

This function should never be called.

Parameters:
loop loop argument
init init argument
cond cond argument

void YMLSAXParser::endSet  ) 
 

Called on the end of a set element. Calls executeSet and then deallocates parse calls.

void YMLSAXParser::script const char *  data  ) 
 

Execute a bit of script in the intrepreter.

Parameters:
data The script.

const char * YMLSAXParser::lookup const char *  var  ) 
 

Lookup a variable as a string value in the Intrepreter.

Parameters:
var The variable name.
Returns:
The variable string value on success, the empty string otherwise.

void YMLSAXParser::lookupArgs int  argc,
const char *const *  args,
const char **  pargs
 

Look up arguments which begin with $ as variables in the intrepreter.

Parameters:
argc Number of arguments.
args An array of pointers to the arguments.
pargs Array to hold the argument results.

void YMLSAXParser::localParseCall call_t  type,
int  argc,
const char *const *  args
 

Handles interpreter scope control, looks up variable arguments in the intrepreter and calls parseCall.

Parameters:
type 
argc 
args 

void YMLSAXParser::dispatch call_t  type,
int  argc,
char **  args
 

Dispatches a parse call to parseCall or localParseCall depending on if we are currently replaying a set or not.

Parameters:
type 
argc 
args 

void YMLSAXParser::clearText  )  [inline]
 

void YMLSAXParser::startDocument  ) 
 

Does nothing. Part of the DocumentHandler interface.

void YMLSAXParser::endDocument  ) 
 

Does nothing. Part of the DocumentHandler interface.

void YMLSAXParser::startElement const XMLCh *const   uri,
const XMLCh *const   localname,
const XMLCh *const   qname,
const XERCES_CPP_NAMESPACE::Attributes &  attributes
 

void YMLSAXParser::endElement const XMLCh *const   uri,
const XMLCh *const   localname,
const XMLCh *const   qname
 

Checks for the known YML types and dispatches parse calls for them.

Parameters:
uri Element uniform resource identifier.
localname Element local name.
qname Element fully qualified name.

void YMLSAXParser::characters const XMLCh *const   chars,
const unsigned int  length
 

Records text data.

Parameters:
chars The character data.
length Its length.

void YMLSAXParser::clearParseCalls  )  [protected]
 


Member Data Documentation

Interpreter* YMLSAXParser::interpreter
 

The script interpreter.

BasicSmartPointer<XMLCh, SP_ARRAY> YMLSAXParser::text
 

The last parsed text.

int YMLSAXParser::setDepth
 

How many sets we are deep.

parseCalls_t YMLSAXParser::parseCalls
 

Parse calls used to repeat sets.


The documentation for this class was generated from the following files:
Generated on Wed Apr 5 21:06:01 2006 for Sesame by  doxygen 1.4.6