Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::xml::utf8::Builder Class Reference

An interface class for an Lexer to use to put tokens together into some other structure. More...

#include <xml/utf8/Builder.h>

List of all members.

Public Methods

 Builder ()
 It's an interface, so this doesn't do anything.

virtual ~Builder ()
 It's an interface, so this doesn't do anything.

virtual void startElementTag (const Position &selbegin, const::std::string &name)=0
 The lexer encountered an element open tag, atributes may follow.

virtual void addAttribute (const Position &attrbegin, const Position &attrend, const Position &valbegin, const Position &valend, const::std::string &name)=0
 The lexer encountered an attribute of an element open tag.

virtual void endElementTag (const Position &selend, bool wasempty)=0
 The lexer encountered the closing '>' of an element open tag.

virtual void closeElementTag (const Position &celbegin, const Position &celend, const::std::string &name)=0
 The lexer encountered the close element tag (a tag of the form </p>.


Detailed Description

An interface class for an Lexer to use to put tokens together into some other structure.

This is so the Lexer doesn't have to know the details of how the parser (or whatever is interpreting the output of the Lexer) works. It follows the Builder pattern from Design Patterns.

In the various member functions that follow, there are various parameters describing the positions of things. In order to make this description clearer, here is a diagram:


 <LongTagName withan="attribute">And some element text</LongTagName> 
 ^            ^       ^        ^^^                    ^             ^
 |            |       |        |||                    |             |
 `->selbegin  |       |        ||`->selend  celbegin<-'     celend<-'
              |       |        ||
   attrbegin<-'       |        |`->attrend
                      |        |
            valbegin<-'        `->valend
 

Definition at line 44 of file Builder.h.


Member Function Documentation

virtual void strmod::xml::utf8::Builder::addAttribute const Position   attrbegin,
const Position   attrend,
const Position   valbegin,
const Position   valend,
const::std::string &    name
[pure virtual]
 

The lexer encountered an attribute of an element open tag.

Parameters:
attrbegin The buffer position of the first character of the tag name.
attrend The buffer position one past the closing single or double quote of the attribute value.
valbegin The buffer position of the first character after the opening single or double quote of the attribute value.
valend The buffer position of the closing single or double quote of the attribute value.
name The attribute name.

virtual void strmod::xml::utf8::Builder::closeElementTag const Position   celbegin,
const Position   celend,
const::std::string &    name
[pure virtual]
 

The lexer encountered the close element tag (a tag of the form </p>.

Parameters:
celbegin The buffer position of the '<'.
celend The buffer position one past the '>'.
name The name of the element being closed.

virtual void strmod::xml::utf8::Builder::endElementTag const Position   selend,
bool    wasempty
[pure virtual]
 

The lexer encountered the closing '>' of an element open tag.

Parameters:
selend The buffer position one past the '>'.
wasempty Was the tag of the form <br/>?

virtual void strmod::xml::utf8::Builder::startElementTag const Position   selbegin,
const::std::string &    name
[pure virtual]
 

The lexer encountered an element open tag, atributes may follow.

Parameters:
selbegin The buffer position of the '<' of the tag.
name The name of the element being opened.


The documentation for this class was generated from the following file:
Generated on Wed Jan 29 00:32:58 2003 for libNet by doxygen1.3-rc1