SgmlLexer

The SgmlLexer class tokenizes a data stream from a Request. More...

Publicly inherits QObject.

Public Methods

SgmlLexer( );
voiddtd( Dtd* dtd );
Modemode( );
~SgmlLexer( );

Public Slots

voiddata( const char* bytes, int end );
voidendOfData( );
voidmode( Mode m );

Private Methods

voiddoToken( Token token, int length );

Signals

voiddone( );
voidtoken( Token token, const char* text );

Private Data Members

char*_buf;
int_bufEnd;
int_bufSize;
int_bufStart;
bool_done;
Dtd*_dtd;
Mode_mode;
char*_token;
int_tokenSize;

Detailed Documentation

The SgmlLexer class tokenizes a data stream from a Request.

The SgmlLexer accepts raw data from a request, and converts into SGML tokens. Each token is emitted one at a time, usually to an SgmlParser or a DtdParser. The SgmlLexer automatically destroys itself after the last token has been emitted.

Public Methods Documentation

SgmlLexer ( );

Create a new SgmlLexer.

void dtd ( Dtd* dtd );

Set the DTD used for resolving parameter entity references.

Mode mode ( );

Return the current lexer mode.

~SgmlLexer ( );

Destroy the lexer.

Public Slots Documentation

void data ( const char* bytes, int end );

Store the incoming text, and tokenize as much of it as we can.

void endOfData ( );

Finish tokenizing the remaining data, and die.

void mode ( Mode m );

Sets the major mode for the lexer. The mode can be CdataMode, RcdataMode, PcdataMode, or MarkupMode. The tokens and delimiters are slightly different between modes.

Private Methods Documentation

void doToken ( Token token, int length );

Emit the token, and move the input pointer to the next character.

Signals Documentation

void done ( );

This signal is emitted after the last token has been emitted.

void token ( Token token, const char* text );

This signal is emitted as each token is recognized. The token is the type of token, and the text is the actual string that was recognized.


Return to Index.
Automatically generated on Aug 11 23:32