Element_Tree.cpp

Go to the documentation of this file.
00001 // Element_Tree.cpp,v 1.5 2002/08/22 01:51:15 kitty Exp
00002 
00003 #include "ACEXML/parser/debug_validator/Element_Tree.h"
00004 
00005 #if !defined (__ACEXML_INLINE__)
00006 # include "ACEXML/parser/debug_validator/Element_Tree.i"
00007 #endif /* __ACEXML_INLINE__ */
00008 
00009 ACEXML_Element_Tree_Node::~ACEXML_Element_Tree_Node ()
00010 {
00011   delete this->next_;
00012 }
00013 
00014 ACE_ALLOC_HOOK_DEFINE (ACEXML_Element_Tree_Node)
00015 
00016 void
00017 ACEXML_Element_Tree_Name_Node::dump ()
00018 {
00019   cout << this->name_;
00020 }
00021 
00022 ACE_ALLOC_HOOK_DEFINE (ACEXML_Element_Tree_Name_Node)
00023 
00024 ACEXML_Element_Tree_List_Node::~ACEXML_Element_Tree_List_Node (void)
00025 {
00026   delete this->head_;
00027 }
00028 
00029 int
00030 ACEXML_Element_Tree_List_Node::insert (ACEXML_Element_Tree_Node *node)
00031 {
00032   if (this->head_ == 0)
00033     {
00034       this->tail_ = this->head_ = node;
00035     }
00036   else
00037     {
00038       this->tail_->next (node);
00039       this->tail_ = node;
00040     }
00041   return 0;
00042 }
00043 
00044 void
00045 ACEXML_Element_Tree_List_Node::dump (void)
00046 {
00047   ACEXML_Element_Tree_Node *ptr = this->head_;
00048   const ACEXML_Char *separator = (this->type_ == SEQUENCE) ? ACE_TEXT(" , ") : ACE_TEXT(" | ");
00049 
00050   cout << "(";
00051 
00052   if (ptr != 0)
00053     {
00054       ptr->dump ();
00055       ptr = ptr->next ();
00056 
00057       while (ptr != 0)
00058         {
00059           cout << separator;
00060           ptr->dump ();
00061           ptr->next ();
00062         }
00063     }
00064 
00065   cout << ")";
00066 }
00067 
00068 ACE_ALLOC_HOOK_DEFINE (ACEXML_Element_Tree_List_Node)
00069 
00070 
00071 
00072 ACE_ALLOC_HOOK_DEFINE (ACEXML_Element_Tree_List_Stack)

Generated on Thu Nov 9 11:45:36 2006 for ACEXML by doxygen 1.3.6