3 //=============================================================================
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 //=============================================================================
10 #ifndef _ACEXML_ELEMENT_TREE_H_
11 #define _ACEXML_ELEMENT_TREE_H_
13 #include /**/ "ace/pre.h"
14 #include "ACEXML/parser/debug_validator/Debug_DTD_Manager_Export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ACEXML/common/XML_Types.h"
23 * @class ACEXML_Element_Tree_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
25 * @brief An abstract base class for describing DTD child element definition.
27 * @sa ACEXML_Element_Tree_Name_Node, ACEXML_Element_Tree_List_Node
29 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_Node
32 /// Default constructor.
33 ACEXML_Element_Tree_Node ();
36 virtual ~ACEXML_Element_Tree_Node ();
38 /// Accessor for next element in chain
39 ACEXML_Element_Tree_Node
*next ();
40 void next (ACEXML_Element_Tree_Node
*n
);
42 /// Displaying the content.
43 virtual void dump () = 0;
45 ACE_ALLOC_HOOK_DECLARE
;
48 ACEXML_Element_Tree_Node
*next_
;
52 * @class ACEXML_Element_Tree_Name_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
54 * @brief An abstract base class for describing a name node in a DTD child
57 * @sa ACEXML_Element_Tree_Node, ACEXML_Element_Tree_List_Node
59 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_Name_Node
60 : public ACEXML_Element_Tree_Node
64 ACEXML_Element_Tree_Name_Node (const ACEXML_Char
*name
,
67 /// Change the name of this node.
68 void set (const ACEXML_Char
*name
,
73 ACE_ALLOC_HOOK_DECLARE
;
78 class ACEXML_Element_Tree_List_Stack
;
81 * @class ACEXML_Element_Tree_List_Node Element_Tree.h "parser/debug_validator/Element_Tree.h"
83 * @brief An abstract base class for describing a node list in a DTD child
86 * @sa ACEXML_Element_Tree_Node, ACEXML_Element_Tree_Name_Node
88 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_List_Node
89 : public ACEXML_Element_Tree_Node
92 friend class ACEXML_Element_Tree_List_Stack
;
99 /// Default constructor.
100 ACEXML_Element_Tree_List_Node ();
103 virtual ~ACEXML_Element_Tree_List_Node ();
105 /// Insert a new ACEXML_Element_Tree_Node into the list.
106 int insert (ACEXML_Element_Tree_Node
*node
);
108 /// Get/set the type of list.
110 int set (LIST_TYPE type
);
112 virtual void dump ();
114 ACE_ALLOC_HOOK_DECLARE
;
118 ACEXML_Element_Tree_Node
*head_
;
120 ACEXML_Element_Tree_Node
*tail_
;
122 ACEXML_Element_Tree_List_Node
*pop_next_
;
126 * @class ACEXML_Element_Tree_List_Stack Element_Tree.h "parser/debug_validator/Element_Tree.h"
128 * @brief A class for managing a stack of ACEXML_Element_Tree_List_Node's.
130 * @sa ACEXML_Element_Tree_List_Node
132 class ACEXML_DEBUG_DTD_MANAGER_Export ACEXML_Element_Tree_List_Stack
135 ACEXML_Element_Tree_List_Stack ();
137 void push (ACEXML_Element_Tree_List_Node
*n
);
139 ACEXML_Element_Tree_List_Node
*pop ();
141 ACEXML_Element_Tree_List_Node
*top ();
145 ACE_ALLOC_HOOK_DECLARE
;
148 ACEXML_Element_Tree_List_Node
*top_
;
151 #if defined (__ACEXML_INLINE__)
152 # include "ACEXML/parser/debug_validator/Element_Tree.inl"
153 #endif /* __ACEXML_INLINE__ */
155 #include /**/ "ace/post.h"
157 #endif /* _ACEXML_ELEMENT_TREE_H_ */