DtdParser

The DtdParser class parses a DTD received from a Request. More...

Publicly inherits QObject.

Public Methods

DtdParser( Dtd* dtd );
~DtdParser( );

Public Slots

voiddone( );
voidfwdData( const char* bytes, int length );
voidfwdEndOfData( );
voidtoken( Token token, const char* text );

Private Methods

voidstateAttlist( Token token, const char* text );
voidstateAttlistAttrName( Token token, const char* text );
voidstateAttlistAttrType( Token token, const char* text );
voidstateAttlistAttrValue( Token token, const char* text );
voidstateAttlistAttrValueType( Token token, const char* text );
voidstateAttlistEnd( );
voidstateContent( Token token, const char* text );
voidstateDeclSubset( Token token, const char* text );
voidstateElementDeclETag( Token token, const char* text );
voidstateElementDeclEnd( );
voidstateElementDeclExcl( Token token, const char* text );
voidstateElementDeclIncl( Token token, const char* text );
voidstateElementDeclModel( Token token, const char* text );
voidstateElementDeclNames( Token token, const char* text );
voidstateElementDeclSTag( Token token, const char* text );
voidstateEntityDecl( Token token, const char* text );
voidstateMarkupDeclSkip( Token token, const char* text );
voidstateMarkupDeclStart( Token token, const char* text );

Signals

voiddata( const char* bytes, int length );
voiddone( Dtd* dtd );
voidendOfData( );

Private Data Members

QString_attrDefaultValue;
QStrIList_attrEnums;
QString_attrName;
Type_attrType;
QString_attrValue;
ValueType_attrValueType;
QStrIList_contentElements;
SgmlEntity*_currentEntity;
SgmlNode*_currentNode;
int_declDepth;
Dtd*_dtd;
bool_elementList;
QStrIList_elementNames;
bool_etagRequired;
QStrIList_exclNames;
QStrIList_inclNames;
SgmlLexer*_lexer;
bool_stagRequired;

Detailed Documentation

The DtdParser class parses a DTD received from a Request.

The DtdParser tokenizes the a data stream, using an SgmlLexer, and constructs a set of DFAs. The DFAs are used by the SgmlParser to tell it where to expect optional start and end tags.

Public Methods Documentation

DtdParser ( Dtd* dtd );

Create a new DtdParser, and an SgmlLexer to tokenize the input stream.

~DtdParser ( );

Destroy the parser.

Public Slots Documentation

void done ( );

This slot processes the done signal from the SgmlLexer. Figure out what the starting element for the document type is, and emit the done signal.

void fwdData ( const char* bytes, int length );

This slot forwards the data signal from the Request to the SgmlLexer.

void fwdEndOfData ( );

This slot forwards the endOfData signal from the Request to the SgmlLexer.

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

This slot processes a token emitted from the SgmlLexer. An appropriate dispatch function is chosen based on the current state of the parser.

Private Methods Documentation

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

Process the list of elements that this ATTLIST declaration applies to.

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

Process the name of the attribute.

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

Process the type of attribute (IMPLIED, FIXED, REQUIRED).

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

Process the default value (if any) for an attribute.

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

Process the attribute's value type (CDATA, NAME, NUMBER).

void stateAttlistEnd ( );

Create the attribute list for each element.

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

Ignore all content, and search for the beginning of a markup declaration.

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

Process a marked section. A mark section may be INCLUDEd or IGNOREd.

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

Process the optional/required end tag specification.

void stateElementDeclEnd ( );

Do post-processing of an element declaration. This includes creating a new SgmlElement, and constructing a ContentModel for it.

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

Process the list of elements that are excluded from the content model.

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

Process the list of elements that are included on the content model.

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

Process the content model declaration for an element.

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

Process the list of elements that this declaration applies to.

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

Process the optional/required start tag specification.

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

Process a parameter entity declaration and store it in the DTD.

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

Eat all the tokens until we get a MarkupDeclEnd, and ignore the rest of this declaration.

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

Figure out what kind of markup declaration we've got (e.g. ELEMENT, ATTLIST, ...).

Signals Documentation

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

This signal is used to forward the end of data signal to the SgmlLexer.

void done ( Dtd* dtd );

This signal is emitted when both the DTD has been parsed.

void endOfData ( );

This signal is used to forward the end of data signal to the SgmlLexer.


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