#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(tab+1); if(!pfchild) return pfchild=an; else return pfchild->addTail(an); } 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(); } }