#include "node.h" #include "string.h" node::node() { pnext=0; pfchild=0; // cout<<"\nkonstruktor klasy node"<addTail(an); } node * node::addChTail(node * an) { an->settab(tabulacje+1); if(!pfchild) return pfchild=an; else return pfchild->addTail(an); } html_doc::~html_doc() { // if(pnext) delete pnext; // if(pfchild) delete pfchild; } void html_doc::Print() { cout << "\n" << "\n" << "\n"; if(pfchild)pfchild->Print(); cout << "\n\n"; } html_center::html_center() { cout << " "; } html_center::~html_center() { cout << " "; } void html_center::Print() { wcinaj(); cout <<"
\n"; if(pfchild)pfchild->Print(); if(pnext)pnext->Print(); wcinaj(); cout << "
\n"; if(pnext)pnext->Print(); } //********************************************************************************************************* void node_a::Print() { cout << "a"; if (pfchild) { cout << "("; pfchild->Print(); cout << ")"; } if (pnext) { cout << ","; pnext->Print(); } } void node_b::Print() { cout << "b"; if (pfchild) { cout << "("; pfchild->Print(); cout << ")"; } if (pnext) { cout << ","; pnext->Print(); } } char* html_item0::settext(char*at) { if(text) delete[]text; if(!at) return 0; text = new char[strlen(at)+1]; strcpy(text, at); return text; } html_item0::html_item0(char *at) { html_item0(); //text = 0 settext(at); } html_item0::~html_item0() { settext(0); } void html_item0::Print(){ for(int i=0;iPrint(); } if(pnext){ cout << "\n"; pnext->Print(); } }