OMNeT++ NEDXML  5.5
ASTBuilder Class Reference

#include <astbuilder.h>

Description

SAX handler (to be used with SAXParser) that builds an AST.

Elements of the tree are subclassed from ASTNode; ASTNodeFactory is used to actually create the objects.

Usage:

   NEDSAXHandler nedsaxhandler(filename);
   SAXParser parser;
   parser.setHandler(&nedsaxhandler);
   parser.parse(filename);
   ASTNode *result = nedsaxhandler.getTree();
Inheritance diagram for ASTBuilder:
SAXHandler

Public Member Functions

 ASTBuilder (const char *filename, ErrorStore *e)
 
virtual ~ASTBuilder ()
 
virtual ASTNodegetTree ()
 
SAX event handlers
virtual void startElement (const char *name, const char **atts) override
 
virtual void endElement (const char *name) override
 
virtual void characterData (const char *s, int len) override
 
virtual void processingInstruction (const char *target, const char *data) override
 
virtual void comment (const char *data) override
 
virtual void startCdataSection () override
 
virtual void endCdataSection () override
 
- Public Member Functions inherited from SAXHandler
 SAXHandler ()
 
virtual ~SAXHandler ()
 

Additional Inherited Members

- Protected Member Functions inherited from SAXHandler
virtual void setParser (SAXParser *p)
 
- Protected Attributes inherited from SAXHandler
SAXParserparser
 

Constructor & Destructor Documentation

◆ ASTBuilder()

ASTBuilder ( const char *  filename,
ErrorStore e 
)

Constructor. Filename is necessary to create correct src-loc info.

◆ ~ASTBuilder()

virtual ~ASTBuilder ( )
virtual

Destructor

Member Function Documentation

◆ getTree()

virtual ASTNode* getTree ( )
virtual

Returns the object tree that was built up during XML parsing.

◆ startElement()

virtual void startElement ( const char *  name,
const char **  atts 
)
overridevirtual

Called by the parser on SAX StartElement events.

Reimplemented from SAXHandler.

◆ endElement()

virtual void endElement ( const char *  name)
overridevirtual

Called by the parser on SAX EndElement events.

Reimplemented from SAXHandler.

◆ characterData()

virtual void characterData ( const char *  s,
int  len 
)
overridevirtual

Called by the parser on SAX CharacterData events.

Reimplemented from SAXHandler.

◆ processingInstruction()

virtual void processingInstruction ( const char *  target,
const char *  data 
)
overridevirtual

Called by the parser on SAX ProcessingInstruction events.

Reimplemented from SAXHandler.

◆ comment()

virtual void comment ( const char *  data)
overridevirtual

Called by the parser on SAX Comment events.

Reimplemented from SAXHandler.

◆ startCdataSection()

virtual void startCdataSection ( )
overridevirtual

Called by the parser on SAX CDataStart events.

Reimplemented from SAXHandler.

◆ endCdataSection()

virtual void endCdataSection ( )
overridevirtual

Called by the parser on SAX CDataEnd events.

Reimplemented from SAXHandler.


The documentation for this class was generated from the following file: