SgmlNode

The SgmlNode class is a node within the parse tree for an SGML element's content model. More...

Public Methods

SgmlNode( Type type, SgmlNode* parent=??? );
SgmlNode( SgmlNode* node, SgmlNode* parent=??? );
voidcalculate( );
const QString&element( );
voidelement( const QString& element );
QList<SgmlNode>&firstpos( );
QList<SgmlNode>&followpos( );
QList<SgmlNode>&lastpos( );
SgmlNode*left( );
voidleft( SgmlNode* left );
boolnullable( );
SgmlNode*parent( );
voidparent( SgmlNode* parent );
SgmlNode*right( );
voidright( SgmlNode* right );
Typetype( );
voidtype( Type type );
~SgmlNode( );

Private Data Members

QString_element;
QList<SgmlNode>_firstpos;
QList<SgmlNode>_followpos;
QList<SgmlNode>_lastpos;
SgmlNode*_left;
bool_nullable;
SgmlNode*_parent;
SgmlNode*_right;
Type_type;

Detailed Documentation

The SgmlNode class is a node within the parse tree for an SGML element's content model.

There are two classes of nodes: interior and leaf. Leaf nodes have concrete types, such as Accept, Element, Cdata, Pcdata, and Empty. Interior nodes are operators, such as Group, And, Or, Star, Qmark, Plus, Seq. The DFA for the content model is computed from the tree of SgmlNodes.

Public Methods Documentation

void calculate ( );

Calculate the nullable(), firstpos(), lastpos(), and followpos() functions.

const QString& element ( );

Return the node's element name.

void element ( const QString& element );

Set the node's element name.

QList<SgmlNode>& firstpos ( );

Return the list of nodes that can appear at the beginning of this subtree.

QList<SgmlNode>& followpos ( );

Return the list of nodes that can directly follow the subtree rooted at this node.

QList<SgmlNode>& lastpos ( );

Return the list of nodes that can appear at the end of this subtree.

SgmlNode* left ( );

Return the node's left subtree.

void left ( SgmlNode* left );

Set the node's left subtree.

bool nullable ( );

Returns TRUE if this entire subtree can be nulled out.

SgmlNode* parent ( );

Return the node's parent.

void parent ( SgmlNode* parent );

Set the node's parent.

SgmlNode* right ( );

Return the node's right subtree.

void right ( SgmlNode* right );

Set the node's right subtree.

Type type ( );

Return the node's type.

void type ( Type type );

Set the type of the node.

~SgmlNode ( );

Destroy the node and its descendents.


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