Commit 7c34dd2b authored by dimitri's avatar dimitri

Release-1.2.18-20021020

parent 2c6d31c8
DOXYGEN Version 1.2.18-20021013
DOXYGEN Version 1.2.18-20021020
Please read the installation section of the manual for instructions.
--------
Dimitri van Heesch (13 October 2002)
Dimitri van Heesch (20 October 2002)
DOXYGEN Version 1.2.18_20021013
DOXYGEN Version 1.2.18_20021020
Please read INSTALL for compilation instructions.
......@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (13 October 2002)
Dimitri van Heesch (dimitri@stack.nl) (20 October 2002)
1.2.18-20021013
1.2.18-20021020
......@@ -131,8 +131,8 @@ class IDoc
enum Kind
{
Invalid = 0, // 0
Para = 1, // 1 -> IDocPara
Text = 2, // 2 -> IDocText
Para, // 1 -> IDocPara
Text, // 2 -> IDocText
MarkupModifier, // 3 -> IDocMarkupModifier
ItemizedList, // 4 -> IDocItemizedList
OrderedList, // 5 -> IDocOrderedList
......@@ -160,7 +160,9 @@ class IDoc
Row, // 27 -> IDocRow
Entry, // 28 -> IDocEntry
Section, // 29 -> IDocSection
Root, // 30 -> IDocRoot
Preformatted, // 30 -> IDocPreformatted
Symbol, // 31 -> IDocSymbol
Root // 32 -> IDocRoot
};
virtual Kind kind() const = 0;
};
......@@ -177,10 +179,8 @@ class IDocMarkup : public IDoc
Subscript = 0x08,
Superscript = 0x10,
SmallFont = 0x20,
Center = 0x40,
Preformatted = 0x80
Center = 0x40
};
};
class IDocPara : public IDoc
......@@ -393,6 +393,24 @@ class IDocSection : public IDoc
virtual IDocIterator *title() const = 0;
};
class IDocPreformatted : public IDoc
{
public:
virtual IDocIterator *contents() const = 0;
};
class IDocSymbol : public IDoc
{
public:
enum Types
{ Invalid = 0,
Umlaut, Acute, Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Copy
};
virtual Types type() const = 0;
virtual const IString * typeString() const = 0;
virtual char letter() const = 0;
};
class IDocRoot : public IDoc
{
public:
......@@ -737,15 +755,15 @@ class IClass : public ICompound
virtual IRelatedCompoundIterator *baseCompounds() const = 0;
virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
virtual ICompoundIterator *nestedCompounds() const = 0;
virtual IParamIterator *templateParameters() const = 0;
virtual const IString *locationFile() const = 0;
virtual int locationLine() const = 0;
virtual int locationBodyStartLine() const = 0;
virtual int locationBodyEndLine() const = 0;
// TODO:
// class:
// ITemplateParamListIterator *templateParamLists()
// listOfAllMembers()
// locationFile()
// locationLine()
// locationBodyStartLine()
// locationBodyEndLine()
};
/*! \brief The interface to a struct in the object model.
......@@ -756,6 +774,10 @@ class IStruct : public ICompound
virtual ICompoundIterator *nestedCompounds() const = 0;
virtual IRelatedCompoundIterator *baseCompounds() const = 0;
virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
virtual const IString *locationFile() const = 0;
virtual int locationLine() const = 0;
virtual int locationBodyStartLine() const = 0;
virtual int locationBodyEndLine() const = 0;
};
/*! \brief The interface to a union in the object model.
......@@ -822,6 +844,8 @@ class IGroup : public ICompound
*/
class IPage : public ICompound
{
public:
virtual const IDocTitle *title() const = 0;
};
/*! Root node of the object model. */
......
......@@ -75,11 +75,11 @@ template<class T> class ElementMapper
Handler m_handler;
};
public:
typedef StartElementHandler StartElementHandlerT;
typedef EndElementHandler EndElementHandlerT;
public:
ElementMapper() : m_startHandlers(67), m_endHandlers(67)
ElementMapper() : m_startHandlers(67), m_endHandlers(67)
{
m_startHandlers.setAutoDelete(TRUE);
m_endHandlers.setAutoDelete(TRUE);
......
......@@ -145,15 +145,15 @@ CompoundHandler::CompoundHandler(const QString &xmlDir)
: m_brief(0), m_detailed(0), m_programListing(0),
m_xmlDir(xmlDir), m_refCount(1), m_memberDict(257), m_memberNameDict(257),
m_mainHandler(0), m_inheritanceGraph(0), m_collaborationGraph(0),
m_includeDependencyGraph(0), m_includedByDependencyGraph(0),
m_hasTemplateParams(FALSE)
m_includeDependencyGraph(0), m_includedByDependencyGraph(0), m_templateParamList(0),
m_titleHandler(0)
{
m_superClasses.setAutoDelete(TRUE);
m_subClasses.setAutoDelete(TRUE);
m_sections.setAutoDelete(TRUE);
m_memberNameDict.setAutoDelete(TRUE);
m_innerCompounds.setAutoDelete(TRUE);
m_templateParams.setAutoDelete(TRUE);
m_params.setAutoDelete(TRUE);
addStartHandler("doxygen");
addEndHandler("doxygen");
......@@ -201,16 +201,19 @@ CompoundHandler::CompoundHandler(const QString &xmlDir)
addStartHandler("innergroup",this,&CompoundHandler::startInnerGroup);
addEndHandler("innergroup");
addStartHandler("templateparamlist");
addStartHandler("templateparamlist",this,&CompoundHandler::startTemplateParamList);
addEndHandler("templateparamlist");
addStartHandler("param",this,&CompoundHandler::startParam);
addEndHandler("param");
addStartHandler("title",this,&CompoundHandler::startTitle);
}
CompoundHandler::~CompoundHandler()
{
debug(2,"CompoundHandler::~CompoundHandler()\n");
delete m_titleHandler;
delete m_brief;
delete m_detailed;
delete m_programListing;
......@@ -265,6 +268,8 @@ void CompoundHandler::startLocation(const QXmlAttributes& attrib)
{
m_defFile = attrib.value("file");
m_defLine = attrib.value("line").toInt();
m_defBodyStart = attrib.value("bodystart").toInt();
m_defBodyEnd = attrib.value("bodyend").toInt();
}
void CompoundHandler::endCompoundName()
......@@ -295,10 +300,15 @@ void CompoundHandler::startInnerGroup(const QXmlAttributes& attrib)
void CompoundHandler::startParam(const QXmlAttributes& attrib)
{
m_hasTemplateParams = TRUE;
ParamHandler *ph = new ParamHandler(this);
ph->startParam(attrib);
m_templateParams.append(ph);
m_params.append(ph);
}
void CompoundHandler::startTemplateParamList(const QXmlAttributes& attrib)
{
m_templateParamList = new TemplateParamListHandler(this);
m_templateParamList->startParam(attrib);
}
void CompoundHandler::addSuperClass(const QXmlAttributes& attrib)
......@@ -349,6 +359,13 @@ void CompoundHandler::addSubClass(const QXmlAttributes& attrib)
m_subClasses.append(sc);
}
void CompoundHandler::startTitle(const QXmlAttributes& attrib)
{
ASSERT(m_titleHandler==0);
m_titleHandler = new TitleHandler(this);
m_titleHandler->startTitle(attrib);
}
bool CompoundHandler::parseXML(const char *compId)
{
QFile xmlFile(m_xmlDir+"/"+compId+".xml");
......@@ -506,6 +523,10 @@ IDocProgramListing *CompoundHandler::source() const
IParamIterator *CompoundHandler::templateParameters() const
{
return m_hasTemplateParams ? new ParamIterator(m_templateParams) : 0;
return m_templateParamList ? m_templateParamList->templateParams() : 0;
}
const IDocTitle *CompoundHandler::title() const
{
return m_titleHandler;
}
......@@ -32,7 +32,8 @@ class MemberHandler;
class CompoundHandler;
class SectionHandler;
class ParamHandler;
class TemplateParamListHandler;
class TitleHandler;
class RelatedCompound : public IRelatedCompound
{
......@@ -97,6 +98,8 @@ class CompoundHandler : public IClass,
virtual void startInnerFile(const QXmlAttributes& attrib);
virtual void startInnerGroup(const QXmlAttributes& attrib);
virtual void startParam(const QXmlAttributes& attrib);
virtual void startTitle(const QXmlAttributes& attrib);
virtual void startTemplateParamList(const QXmlAttributes& attrib);
virtual void addref() { m_refCount++; }
CompoundHandler(const QString &dirName);
......@@ -126,39 +129,48 @@ class CompoundHandler : public IClass,
IRelatedCompoundIterator *derivedCompounds() const;
ICompoundIterator *nestedCompounds() const;
ICompoundIterator *nestedGroup() const;
const IString *locationFile() const { return &m_defFile; }
int locationLine() const { return m_defLine; }
int locationBodyStartLine() const { return m_defBodyStart; }
int locationBodyEndLine() const { return m_defBodyEnd; }
// IFile implementation
IGraph *includeDependencyGraph() const;
IGraph *includedByDependencyGraph() const;
IDocProgramListing *source() const;
// IPage implementation
const IDocTitle *title() const;
private:
QList<RelatedCompound> m_superClasses;
QList<RelatedCompound> m_subClasses;
QList<SectionHandler> m_sections;
QList<ParamHandler> m_templateParams;
DocHandler *m_brief;
DocHandler *m_detailed;
ProgramListingHandler *m_programListing;
StringImpl m_id;
StringImpl m_kindString;
CompoundKind m_kind;
StringImpl m_name;
QString m_defFile;
int m_defLine;
QString m_xmlDir;
int m_refCount;
QDict<MemberHandler> m_memberDict;
QDict<QList<MemberHandler> > m_memberNameDict;
MainHandler *m_mainHandler;
GraphHandler *m_inheritanceGraph;
GraphHandler *m_collaborationGraph;
GraphHandler *m_includeDependencyGraph;
GraphHandler *m_includedByDependencyGraph;
QList<QString> m_innerCompounds;
ProgramListingHandler *m_source;
bool m_hasTemplateParams;
QList<RelatedCompound> m_superClasses;
QList<RelatedCompound> m_subClasses;
QList<SectionHandler> m_sections;
QList<ParamHandler> m_params;
DocHandler* m_brief;
DocHandler* m_detailed;
ProgramListingHandler* m_programListing;
StringImpl m_id;
StringImpl m_kindString;
CompoundKind m_kind;
StringImpl m_name;
StringImpl m_defFile;
int m_defLine;
int m_defBodyStart;
int m_defBodyEnd;
QString m_xmlDir;
int m_refCount;
QDict<MemberHandler> m_memberDict;
QDict<QList<MemberHandler> > m_memberNameDict;
MainHandler* m_mainHandler;
GraphHandler* m_inheritanceGraph;
GraphHandler* m_collaborationGraph;
GraphHandler* m_includeDependencyGraph;
GraphHandler* m_includedByDependencyGraph;
QList<QString> m_innerCompounds;
ProgramListingHandler* m_source;
TemplateParamListHandler* m_templateParamList;
TitleHandler* m_titleHandler;
};
void compoundhandler_init();
......
......@@ -117,9 +117,6 @@ MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
addStartHandler("superscript",this,&MarkupHandler::startSuperscript);
addEndHandler("superscript",this,&MarkupHandler::endSuperscript);
addStartHandler("preformatted",this,&MarkupHandler::startPreformatted);
addEndHandler("preformatted",this,&MarkupHandler::endPreformatted);
}
MarkupHandler::~MarkupHandler()
......@@ -234,20 +231,6 @@ void MarkupHandler::endSuperscript()
m_curMarkup &= ~IDocMarkup::Superscript;
}
void MarkupHandler::startPreformatted(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,TRUE));
m_curMarkup |= IDocMarkup::Preformatted;
}
void MarkupHandler::endPreformatted()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,FALSE));
m_curMarkup &= ~IDocMarkup::Preformatted;
}
//----------------------------------------------------------------------
// ListItemHandler
//----------------------------------------------------------------------
......@@ -1314,6 +1297,69 @@ IDocIterator *TableHandler::rows() const
return new TableIterator(*this);
}
//----------------------------------------------------------------------
// PreformattedHandler
//----------------------------------------------------------------------
PreformattedHandler::PreformattedHandler(IBaseHandler *parent)
: m_parent(parent)
{
m_children.setAutoDelete(TRUE);
addEndHandler("preformatted",this,&PreformattedHandler::endPreformatted);
}
PreformattedHandler::~PreformattedHandler()
{
}
void PreformattedHandler::startPreformatted(const QXmlAttributes&)
{
m_parent->setDelegate(this);
}
void PreformattedHandler::endPreformatted()
{
m_parent->setDelegate(0);
}
IDocIterator *PreformattedHandler::contents() const
{
return new PreformattedIterator(*this);
}
//----------------------------------------------------------------------
// SymbolHandler
//----------------------------------------------------------------------
SymbolHandler::SymbolHandler(IBaseHandler *parent,Types type)
: m_parent(parent), m_letter('\0'), m_type(type)
{
addEndHandler("symbol");
switch (type)
{
case IDocSymbol::Invalid: m_typeString="invalid"; break;
case IDocSymbol::Umlaut: m_typeString="umlaut"; break;
case IDocSymbol::Acute: m_typeString="acute"; break;
case IDocSymbol::Grave: m_typeString="grave"; break;
case IDocSymbol::Circ: m_typeString="circ"; break;
case IDocSymbol::Tilde: m_typeString="tilde"; break;
case IDocSymbol::Szlig: m_typeString="szlig"; break;
case IDocSymbol::Cedil: m_typeString="cedil"; break;
case IDocSymbol::Ring: m_typeString="ring"; break;
case IDocSymbol::Nbsp: m_typeString="nbsp"; break;
case IDocSymbol::Copy: m_typeString="copy"; break;
}
}
SymbolHandler::~SymbolHandler()
{
}
void SymbolHandler::startSymbol(const QXmlAttributes& attrib)
{
QString ls = attrib.value("char");
if (!ls.isEmpty()) m_letter = ls.latin1()[0];
}
//----------------------------------------------------------------------
// ParagraphHandler
......@@ -1346,6 +1392,17 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
addStartHandler("dotfile",this,&ParagraphHandler::startDotFile);
addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry);
addStartHandler("table",this,&ParagraphHandler::startTable);
addStartHandler("preformatted",this,&ParagraphHandler::startPreformatted);
addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut);
addStartHandler("acute",this,&ParagraphHandler::startAcute);
addStartHandler("grave",this,&ParagraphHandler::startGrave);
addStartHandler("circ",this,&ParagraphHandler::startCirc);
addStartHandler("tilde",this,&ParagraphHandler::startTilde);
addStartHandler("szlig",this,&ParagraphHandler::startSzlig);
addStartHandler("cedil",this,&ParagraphHandler::startCedil);
addStartHandler("ring",this,&ParagraphHandler::startRing);
addStartHandler("nbsp",this,&ParagraphHandler::startNbsp);
addStartHandler("copy",this,&ParagraphHandler::startCopy);
}
ParagraphHandler::~ParagraphHandler()
......@@ -1502,6 +1559,94 @@ void ParagraphHandler::startTable(const QXmlAttributes& attrib)
m_children.append(th);
}
void ParagraphHandler::startPreformatted(const QXmlAttributes& attrib)
{
addTextNode();
PreformattedHandler *ph = new PreformattedHandler(this);
ph->startPreformatted(attrib);
m_children.append(ph);
}
void ParagraphHandler::startUmlaut(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Umlaut);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startAcute(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Acute);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startGrave(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Grave);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startCirc(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Circ);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startTilde(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Tilde);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startSzlig(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Szlig);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startCedil(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Cedil);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startRing(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Ring);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startNbsp(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Nbsp);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::startCopy(const QXmlAttributes& attrib)
{
addTextNode();
SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Copy);
sh->startSymbol(attrib);
m_children.append(sh);
}
void ParagraphHandler::addTextNode()
{
if (!m_curString.isEmpty())
......@@ -1587,12 +1732,17 @@ DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent)
addEndHandler("briefdescription",this,&DocHandler::endDoc);
addEndHandler("detaileddescription",this,&DocHandler::endDoc);
addEndHandler("internal");
addStartHandler("para",this,&DocHandler::startParagraph);
addStartHandler("sect1",this,&DocHandler::startSect1);
addStartHandler("sect2",this,&DocHandler::startSect2);
addStartHandler("sect3",this,&DocHandler::startSect3);
addStartHandler("sect4",this,&DocHandler::startSect4);
addStartHandler("sect5",this,&DocHandler::startSect5);
addStartHandler("sect6",this,&DocHandler::startSect6);
addStartHandler("title",this,&DocHandler::startTitle);
addStartHandler("internal");
}
DocHandler::~DocHandler()
......@@ -1639,6 +1789,27 @@ void DocHandler::startSect3(const QXmlAttributes& attrib)
m_children.append(secHandler);
}
void DocHandler::startSect4(const QXmlAttributes& attrib)
{
DocSectionHandler *secHandler = new DocSectionHandler(this,4);
secHandler->startDocSection(attrib);
m_children.append(secHandler);
}
void DocHandler::startSect5(const QXmlAttributes& attrib)
{
DocSectionHandler *secHandler = new DocSectionHandler(this,5);
secHandler->startDocSection(attrib);
m_children.append(secHandler);
}
void DocHandler::startSect6(const QXmlAttributes& attrib)
{
DocSectionHandler *secHandler = new DocSectionHandler(this,6);
secHandler->startDocSection(attrib);
m_children.append(secHandler);
}
void DocHandler::startTitle(const QXmlAttributes& attrib)
{
TitleHandler *titleHandler = new TitleHandler(this);
......
......@@ -64,6 +64,8 @@ DEFINE_CLS_IMPL(DocTable);
DEFINE_CLS_IMPL(DocRow);
DEFINE_CLS_IMPL(DocEntry);
DEFINE_CLS_IMPL(DocSection);
DEFINE_CLS_IMPL(DocPreformatted);
DEFINE_CLS_IMPL(DocSymbol);
DEFINE_CLS_IMPL(DocRoot);
//-----------------------------------------------------------------------------
......@@ -138,8 +140,6 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
virtual void endSubscript();
virtual void startSuperscript(const QXmlAttributes &attrib);
virtual void endSuperscript();
virtual void startPreformatted(const QXmlAttributes &attrib);
virtual void endPreformatted();
private:
......@@ -189,6 +189,17 @@ class ParagraphHandler : public DocParaImpl,
virtual void startDotFile(const QXmlAttributes& attrib);
virtual void startIndexEntry(const QXmlAttributes& attrib);
virtual void startTable(const QXmlAttributes& attrib);
virtual void startPreformatted(const QXmlAttributes& attrib);
virtual void startUmlaut(const QXmlAttributes& attrib);
virtual void startAcute(const QXmlAttributes& attrib);
virtual void startGrave(const QXmlAttributes& attrib);
virtual void startCirc(const QXmlAttributes& attrib);
virtual void startTilde(const QXmlAttributes& attrib);
virtual void startSzlig(const QXmlAttributes& attrib);
virtual void startCedil(const QXmlAttributes& attrib);
virtual void startRing(const QXmlAttributes& attrib);
virtual void startNbsp(const QXmlAttributes& attrib);
virtual void startCopy(const QXmlAttributes& attrib);
ParagraphHandler(IBaseHandler *parent);
virtual ~ParagraphHandler();
......@@ -975,6 +986,64 @@ class TableIterator : public BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImp
BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>(handler.m_children) {}
};
//-----------------------------------------------------------------------------
/*! \brief Node representing an preformatted section
*/
class PreformattedHandler : public DocPreformattedImpl,
public BaseHandler<PreformattedHandler>
{
friend class PreformattedIterator;
public:
PreformattedHandler(IBaseHandler *parent);
virtual ~PreformattedHandler();
void startPreformatted(const QXmlAttributes& attrib);
void endPreformatted();
// IDocPreformatted
virtual IDocIterator *contents() const;
virtual Kind kind() const { return DocImpl::Preformatted; }
private:
IBaseHandler *m_parent;
QList<DocImpl> m_children;
};
class PreformattedIterator :
public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{
public:
PreformattedIterator(const PreformattedHandler &handler) :
BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
};
//-----------------------------------------------------------------------------
/*! \brief Node representing an special symbol.
*
*/
// children: -
class SymbolHandler : public DocSymbolImpl, public BaseHandler<SymbolHandler>
{
public:
SymbolHandler(IBaseHandler *parent,Types type);
virtual ~SymbolHandler();
void startSymbol(const QXmlAttributes& attrib);
void endSymbol();
// IDocSymbol
virtual Kind kind() const { return DocImpl::Symbol; }
virtual Types type() const { return m_type; }
virtual const IString *typeString() const { return &m_typeString; }
virtual char letter() const { return m_letter; }
private:
IBaseHandler *m_parent;
char m_letter;
Types m_type;
StringImpl m_typeString;
};
//-----------------------------------------------------------------------------
......@@ -1033,6 +1102,9 @@ class DocHandler : public DocRootImpl, public BaseHandler<DocHandler>
virtual void startSect1(const QXmlAttributes& attrib);
virtual void startSect2(const QXmlAttributes& attrib);
virtual void startSect3(const QXmlAttributes& attrib);
virtual void startSect4(const QXmlAttributes& attrib);
virtual void startSect5(const QXmlAttributes& attrib);
virtual void startSect6(const QXmlAttributes& attrib);
virtual void startTitle(const QXmlAttributes& attrib);
DocHandler(IBaseHandler *parent);
......@@ -1054,6 +1126,8 @@ class DocIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
};
//-----------------------------------------------------------------------------
void dochandler_init();
void dochandler_exit();
......
......@@ -131,8 +131,8 @@ class IDoc
enum Kind
{
Invalid = 0, // 0
Para = 1, // 1 -> IDocPara
Text = 2, // 2 -> IDocText
Para, // 1 -> IDocPara
Text, // 2 -> IDocText
MarkupModifier, // 3 -> IDocMarkupModifier
ItemizedList, // 4 -> IDocItemizedList
OrderedList, // 5 -> IDocOrderedList
......@@ -160,7 +160,9 @@ class IDoc
Row, // 27 -> IDocRow
Entry, // 28 -> IDocEntry
Section, // 29 -> IDocSection
Root, // 30 -> IDocRoot
Preformatted, // 30 -> IDocPreformatted
Symbol, // 31 -> IDocSymbol
Root // 32 -> IDocRoot
};
virtual Kind kind() const = 0;
};
......@@ -177,10 +179,8 @@ class IDocMarkup : public IDoc
Subscript = 0x08,
Superscript = 0x10,
SmallFont = 0x20,
Center = 0x40,
Preformatted = 0x80
Center = 0x40
};
};
class IDocPara : public IDoc
......@@ -393,6 +393,24 @@ class IDocSection : public IDoc
virtual IDocIterator *title() const = 0;
};
class IDocPreformatted : public IDoc
{
public:
virtual IDocIterator *contents() const = 0;
};
class IDocSymbol : public IDoc
{
public:
enum Types
{ Invalid = 0,
Umlaut, Acute, Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Copy
};
virtual Types type() const = 0;
virtual const IString * typeString() const = 0;
virtual char letter() const = 0;
};
class IDocRoot : public IDoc
{
public:
......@@ -737,15 +755,15 @@ class IClass : public ICompound
virtual IRelatedCompoundIterator *baseCompounds() const = 0;
virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
virtual ICompoundIterator *nestedCompounds() const = 0;
virtual IParamIterator *templateParameters() const = 0;
virtual const IString *locationFile() const = 0;
virtual int locationLine() const = 0;
virtual int locationBodyStartLine() const = 0;
virtual int locationBodyEndLine() const = 0;
// TODO:
// class:
// ITemplateParamListIterator *templateParamLists()
// listOfAllMembers()
// locationFile()
// locationLine()
// locationBodyStartLine()
// locationBodyEndLine()
};
/*! \brief The interface to a struct in the object model.
......@@ -756,6 +774,10 @@ class IStruct : public ICompound
virtual ICompoundIterator *nestedCompounds() const = 0;
virtual IRelatedCompoundIterator *baseCompounds() const = 0;
virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
virtual const IString *locationFile() const = 0;
virtual int locationLine() const = 0;
virtual int locationBodyStartLine() const = 0;
virtual int locationBodyEndLine() const = 0;
};
/*! \brief The interface to a union in the object model.
......@@ -822,6 +844,8 @@ class IGroup : public ICompound
*/
class IPage : public ICompound
{
public:
virtual const IDocTitle *title() const = 0;
};
/*! Root node of the object model. */
......
......@@ -228,13 +228,16 @@ ICompound *MainHandler::compoundById(const char *id) const
// unchanged.
MainHandler *that = (MainHandler *)this;
ch->initialize(that);
printf("loading compound %s in memory\n",id);
that->m_compoundsLoaded.insert(id,ch);
return ch->toICompound();
}
void MainHandler::unloadCompound(CompoundHandler *ch)
{
m_compoundsLoaded.remove(ch->id()->latin1());
printf("unloading compound %s from memory\n",ch->id()->latin1());
bool result = m_compoundsLoaded.remove(ch->id()->latin1());
if (!result) printf("Failed to unload!\n");
}
ICompound *MainHandler::compoundByName(const char *name) const
......@@ -276,6 +279,7 @@ IDoxygen *createObjectModel()
void MainHandler::release()
{
//printf("MainHandler::release()\n");
QDictIterator<CompoundHandler> chi(m_compoundsLoaded);
CompoundHandler *ch;
for (chi.toFirst();(ch=chi.current());++chi)
......
......@@ -82,7 +82,7 @@ IMember *MemberReference::member() const
//------------------------------------------------------------------------------
EnumValueHandler::EnumValueHandler(IBaseHandler *parent) : m_parent(parent)
EnumValueHandler::EnumValueHandler(IBaseHandler *parent) : m_parent(parent), m_brief(0), m_detailed(0)
{
addEndHandler("enumvalue",this,&EnumValueHandler::endEnumValue);
......@@ -90,6 +90,11 @@ EnumValueHandler::EnumValueHandler(IBaseHandler *parent) : m_parent(parent)
addEndHandler("name",this,&EnumValueHandler::endName);
addStartHandler("initializer",this,&EnumValueHandler::startInitializer);
addEndHandler("initializer",this,&EnumValueHandler::endInitializer);
addStartHandler("briefdescription",this,&EnumValueHandler::startBriefDesc);
addStartHandler("detaileddescription",this,&EnumValueHandler::startDetailedDesc);
}
void EnumValueHandler::startEnumValue(const QXmlAttributes& /*attrib*/)
......@@ -122,6 +127,21 @@ void EnumValueHandler::endInitializer()
m_initializer = m_curString;
}
void EnumValueHandler::startBriefDesc(const QXmlAttributes& attrib)
{
DocHandler *docHandler = new DocHandler(this);
docHandler->startDoc(attrib);
m_brief = docHandler;
}
void EnumValueHandler::startDetailedDesc(const QXmlAttributes& attrib)
{
DocHandler *docHandler = new DocHandler(this);
docHandler->startDoc(attrib);
m_detailed = docHandler;
}
//------------------------------------------------------------------------------
MemberHandler::MemberHandler(IBaseHandler *parent)
......
......@@ -30,6 +30,7 @@
class MainHandler;
class CompoundHandler;
class SectionHandler;
class ParamHandler;
struct MemberReference : public IMemberReference
{
......@@ -59,6 +60,8 @@ class EnumValueHandler : public IEnumValue, public BaseHandler<EnumValueHandler>
virtual void endInitializer();
virtual void startEnumValue(const QXmlAttributes& attrib);
virtual void endEnumValue();
virtual void startBriefDesc(const QXmlAttributes& attrib);
virtual void startDetailedDesc(const QXmlAttributes& attrib);
// IEnumValue
virtual const IString *name() const { return &m_name; }
......@@ -67,13 +70,20 @@ class EnumValueHandler : public IEnumValue, public BaseHandler<EnumValueHandler>
void setName(const QString &name) { m_name=name; }
void setInitializer(const QString &init) { m_initializer=init; }
virtual ~EnumValueHandler() {}
virtual ~EnumValueHandler() { delete m_brief; delete m_detailed; }
EnumValueHandler(IBaseHandler *parent);
virtual IDocRoot *briefDescription() const
{ return m_brief; }
virtual IDocRoot *detailedDescription() const
{ return m_detailed; }
private:
StringImpl m_name;
StringImpl m_initializer;
IBaseHandler *m_parent;
DocHandler *m_brief;
DocHandler *m_detailed;
};
class EnumValueIterator : public BaseIterator<IEnumValueIterator,IEnumValue,EnumValueHandler>
......
......@@ -17,6 +17,39 @@
#include "memberhandler.h"
#include "debug.h"
TemplateParamListHandler::TemplateParamListHandler(IBaseHandler *parent) : m_parent(parent)
{
addStartHandler("param",this,&TemplateParamListHandler::startParam);
//addEndHandler("param",this,&TemplateParamListHandler::endParam);
addEndHandler("templateparamlist",this,&TemplateParamListHandler::endTemplateParamList);
}
void TemplateParamListHandler::startParam(const QXmlAttributes& attrib)
{
ParamHandler *ph = new ParamHandler(this);
ph->startParam(attrib);
m_templateParams.append(ph);
}
void TemplateParamListHandler::endParam()
{
}
void TemplateParamListHandler::startTemplateParamList(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
debug(2,"templateparamlist\n");
}
void TemplateParamListHandler::endTemplateParamList()
{
m_parent->setDelegate(0);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
ParamHandler::ParamHandler(IBaseHandler *parent) : m_parent(parent)
{
addEndHandler("param",this,&ParamHandler::endParam);
......
......@@ -26,6 +26,7 @@
#include "baseiterator.h"
#include "linkedtexthandler.h"
class ParamHandler : public IParam, public BaseHandler<ParamHandler>
{
public:
......@@ -69,5 +70,25 @@ class ParamIterator : public BaseIterator<IParamIterator,IParam,ParamHandler>
BaseIterator<IParamIterator,IParam,ParamHandler>(list) {}
};
class TemplateParamListHandler : public BaseHandler<TemplateParamListHandler>
{
public:
virtual void startParam(const QXmlAttributes& attrib);
virtual void endParam();
virtual void startTemplateParamList(const QXmlAttributes& attrib);
virtual void endTemplateParamList();
TemplateParamListHandler(IBaseHandler *parent);
virtual ~TemplateParamListHandler() {}
ParamIterator* templateParams() { return new ParamIterator(m_templateParams); }
protected:
IBaseHandler *m_parent;
QList<ParamHandler> m_templateParams;
};
#endif
......@@ -9,6 +9,8 @@ class StringImpl : public QString, public IString
public:
StringImpl() {}
StringImpl(const QString &str) : QString(str) {}
StringImpl &operator=(const QString &str)
{ QString::operator=(str); return *this; }
virtual ~StringImpl() {}
// IString
......
......@@ -47,6 +47,7 @@ QString linkedTextToString(ILinkedTextIterator *ti)
*/
void DumpDoc(IDoc *doc,int level)
{
if (doc==0) return;
QString indent;
indent.fill(' ',level);
//printf(" doc node kind=`%d'\n",doc->kind());
......@@ -374,6 +375,29 @@ void DumpDoc(IDoc *doc,int level)
InPrint(("<section/>\n"));
}
break;
case IDoc::Preformatted:
{
InPrint(("<preformatted>\n"));
IDocPreformatted *pf = dynamic_cast<IDocPreformatted*>(doc);
ASSERT(pf!=0);
IDocIterator *di = pf->contents();
IDoc *pdoc;
for (di->toFirst();(pdoc=di->current());di->toNext())
{
DumpDoc(pdoc,level+1);
}
di->release();
InPrint(("<preformatted/>\n"));
}
break;
case IDoc::Symbol:
{
IDocSymbol *sym = dynamic_cast<IDocSymbol*>(doc);
ASSERT(sym!=0);
InPrint(("<symbol type=%s letter=%c/>\n",
sym->typeString()->latin1(),sym->letter()));
}
break;
case IDoc::Root:
{
InPrint(("<root>\n"));
......@@ -391,6 +415,7 @@ void DumpDoc(IDoc *doc,int level)
break;
default:
printf("Found unsupported node type %d!\n",doc->kind());
break;
}
}
......@@ -463,7 +488,7 @@ int main(int argc,char **argv)
IDoxygen *dox = createObjectModel();
dox->setDebugLevel(0);
dox->setDebugLevel(4);
if (!dox->readXMLDir(argv[1]))
{
......@@ -478,6 +503,7 @@ int main(int argc,char **argv)
{
printf("Compound name=%s id=%s kind=%s\n",
comp->name()->latin1(),comp->id()->latin1(),comp->kindString()->latin1());
ISectionIterator *sli = comp->sections();
ISection *sec;
for (sli->toFirst();(sec=sli->current());sli->toNext())
......
Summary: A documentation system for C/C++.
Name: doxygen
Version: 1.2.18_20021013
Version: 1.2.18_20021020
Release: 1
Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
......
......@@ -485,6 +485,7 @@ void ClassDef::internalInsertMember(MemberDef *md,
if (addToAllList)
{
//printf("=======> adding member %s to class %s\n",md->name().data(),name().data());
MemberInfo *mi = new MemberInfo((MemberDef *)md,
prot,md->virtualness(),FALSE);
MemberNameInfo *mni=0;
......@@ -2505,6 +2506,7 @@ MemberDef *ClassDef::getMemberByName(const QCString &name)
{
MemberDef *xmd = 0;
MemberNameInfo *mni = m_allMemberNameInfoSDict->find(name);
//printf("getMemberByName(%s)=%p\n",name.data(),mni);
if (mni)
{
const int maxInheritanceDepth = 100000;
......@@ -2514,6 +2516,7 @@ MemberDef *ClassDef::getMemberByName(const QCString &name)
for (mnii.toFirst();(mi=mnii.current());++mnii)
{
ClassDef *mcd=mi->memberDef->getClassDef();
//printf("found member in %s\n",mcd->name().data());
int m=minClassDistance(this,mcd);
if (m<mdist && mcd->isLinkable())
{
......
......@@ -175,6 +175,9 @@ CommandMap htmlTagMap[] =
{ "h1", HTML_H1 },
{ "h2", HTML_H2 },
{ "h3", HTML_H3 },
{ "h4", HTML_H4 },
{ "h5", HTML_H5 },
{ "h6", HTML_H6 },
{ 0, 0 }
};
......
......@@ -131,7 +131,10 @@ enum HtmlTagType
HTML_P = 24,
HTML_H1 = 25,
HTML_H2 = 26,
HTML_H3 = 27
HTML_H3 = 27,
HTML_H4 = 28,
HTML_H5 = 29,
HTML_H6 = 30
};
class CmdMapper
......
......@@ -65,6 +65,7 @@ static const char * g_inputString; //!< the code fragment as text
static int g_inputPosition; //!< read offset during parsing
static int g_inputLines; //!< number of line in the code fragment
static int g_yyLineNr; //!< current line number
static bool g_needsTermination;
static bool g_exampleBlock;
static QCString g_exampleName;
......@@ -923,7 +924,17 @@ static int countLines()
const char *p=g_inputString;
char c;
int count=1;
while ((c=*p++)) if (c=='\n') count++;
while ((c=*p))
{
p++ ;
if (c=='\n') count++;
}
if (p>g_inputString && *(p-1)!='\n')
{ // last line does not end with a \n, so we add an extra
// line and explicitly terminate the line after parsing.
count++,
g_needsTermination=TRUE;
}
return count;
}
......@@ -1989,14 +2000,17 @@ void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s,
g_inputString = s;
g_inputPosition = 0;
g_currentFontClass = 0;
g_needsTermination = FALSE;
if (endLine!=-1)
g_inputLines = endLine+1;
else
g_inputLines = countLines();
if (startLine!=-1)
g_yyLineNr = startLine;
else
g_yyLineNr = 1;
g_curlyCount = 0;
g_bodyCurlyCount = 0;
g_bracketCount = 0;
......@@ -2027,7 +2041,7 @@ void parseCode(BaseCodeDocInterface &od,const char *className,const QCString &s,
codeYYrestart( codeYYin );
BEGIN( Body );
codeYYlex();
if (g_inputLines==1)
if (g_needsTermination)
{
endFontClass();
g_code->endCodeLine();
......
......@@ -255,6 +255,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]*
if (*yytext==')' && g_curArgTypeName.stripWhiteSpace().isEmpty())
{
g_curArgTypeName+=*yytext;
BEGIN(FuncQual);
}
else
{
......
/******************************************************************************
*
*
*
* Copyright (C) 1997-2002 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
#ifndef DOC_H
#define DOC_H
#include "qtbc.h"
class OutputDocInterface;
class MemberDef;
extern void parseDoc(OutputDocInterface &ol,
const char *fileName,int startLine,
const char *clName, MemberDef *md,
const QCString &docString);
extern void parseExample(OutputDocInterface &ol,const QCString &docString,
const char *fileName);
extern void parseText(OutputDocInterface &ol,const QCString &txtString);
#endif
This diff is collapsed.
......@@ -1740,6 +1740,33 @@ int DocHtmlHeader::parse()
}
goto endheader;
}
else if (tagId==HTML_H4 && g_token->endTag) // found </h4> tag
{
if (m_level!=4)
{
warn(g_fileName,doctokenizerYYlineno,"Error: <h%d> ended with </h4>",
m_level);
}
goto endheader;
}
else if (tagId==HTML_H5 && g_token->endTag) // found </h5> tag
{
if (m_level!=5)
{
warn(g_fileName,doctokenizerYYlineno,"Error: <h%d> ended with </h5>",
m_level);
}
goto endheader;
}
else if (tagId==HTML_H6 && g_token->endTag) // found </h6> tag
{
if (m_level!=6)
{
warn(g_fileName,doctokenizerYYlineno,"Error: <h%d> ended with </h6>",
m_level);
}
goto endheader;
}
else
{
warn(g_fileName,doctokenizerYYlineno,"Error: Unexpected html tag <%s%s> found within <h%d> context",
......@@ -3504,6 +3531,27 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
retval = header->parse();
}
break;
case HTML_H4:
{
DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,4);
m_children.append(header);
retval = header->parse();
}
break;
case HTML_H5:
{
DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,5);
m_children.append(header);
retval = header->parse();
}
break;
case HTML_H6:
{
DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,6);
m_children.append(header);
retval = header->parse();
}
break;
case HTML_IMG:
{
HtmlAttribListIterator li(tagHtmlAttribs);
......
......@@ -987,7 +987,7 @@ class DocSimpleListItem : public DocNode
DocPara *m_paragraph;
};
/*! @brief Node representing a Html list item */
/*! @brief Node representing a HTML list item */
class DocHtmlListItem : public CompAccept<DocHtmlListItem>, public DocNode
{
public:
......@@ -1006,7 +1006,7 @@ class DocHtmlListItem : public CompAccept<DocHtmlListItem>, public DocNode
int m_itemNum;
};
/*! @brief Node representing a Html description data */
/*! @brief Node representing a HTML description data */
class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode
{
public:
......@@ -1024,7 +1024,7 @@ class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode
};
/*! @brief Node representing a Html list item */
/*! @brief Node representing a preformatted HTML section */
class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode
{
public:
......@@ -1041,7 +1041,7 @@ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode
HtmlAttribList m_attribs;
};
/*! @brief Node representing a Html table cell */
/*! @brief Node representing a HTML table cell */
class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode
{
public:
......@@ -1067,7 +1067,7 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode
HtmlAttribList m_attribs;
};
/*! @brief Node representing a Html table caption */
/*! @brief Node representing a HTML table caption */
class DocHtmlCaption : public CompAccept<DocHtmlCaption>, public DocNode
{
public:
......@@ -1084,7 +1084,7 @@ class DocHtmlCaption : public CompAccept<DocHtmlCaption>, public DocNode
HtmlAttribList m_attribs;
};
/*! @brief Node representing a Html table row */
/*! @brief Node representing a HTML table row */
class DocHtmlRow : public CompAccept<DocHtmlRow>, public DocNode
{
public:
......@@ -1102,7 +1102,7 @@ class DocHtmlRow : public CompAccept<DocHtmlRow>, public DocNode
HtmlAttribList m_attribs;
};
/*! @brief Node representing a Html table */
/*! @brief Node representing a HTML table */
class DocHtmlTable : public CompAccept<DocHtmlTable>, public DocNode
{
public:
......
......@@ -234,13 +234,17 @@ OPDEL {BLANK}+"delete"({BLANK}*"[]")?
OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()"
OPCAST {BLANK}+[^(\r\n.,]+
OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG})
LNKWORD1 {SCOPEMASK}({FUNCARG}({BLANK}*("const"|"volatile"))?)?
LNKWORD1 {SCOPEMASK}
CVSPEC {BLANK}*("const"|"volatile")
LNKWORD2 {SCOPEPRE}*"operator"{OPMASK}
WORD1 [^ \t\n\r\\@<>&$#,.]+
WORD2 "."|","
WORD1NQ [^ \t\n\r\\@<>&$#,."]+
WORD2NQ "."|","
HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">"
HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"
HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"
HTMLKEYW {HTMLKEYL}|{HTMLKEYU}
%option noyywrap
%option yylineno
......@@ -354,11 +358,29 @@ HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">"
g_token->name = yytext;
return TK_SYMBOL;
}
<St_Para>{LNKWORD1}/[^a-z_A-Z0-9] |
/********* patterns for linkable words ******************/
<St_Para>{ID}/"<"{HTMLKEYW}">" { /* this rule is to prevent opening html
* tag to be recognized as a templated classes
*/
g_token->name = yytext;
return TK_LNKWORD;
}
<St_Para>{LNKWORD1} |
<St_Para>{LNKWORD1}{FUNCARG} |
<St_Para>{LNKWORD2} {
g_token->name = yytext;
return TK_LNKWORD;
}
<St_Para>{LNKWORD1}{FUNCARG}{CVSPEC}[^a-z_A-Z0-9] {
g_token->name = yytext;
g_token->name = g_token->name.left(g_token->name.length()-1);
unput(yytext[yyleng-1]);
return TK_LNKWORD;
}
/********* patterns for normal words ******************/
<St_Para,St_Text>{WORD1} |
<St_Para,St_Text>{WORD2} { /* function call */
g_token->name = yytext;
......@@ -370,6 +392,9 @@ HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">"
*/
goto find_rule;
}
/*******************************************************/
<St_Para,St_Text>{BLANK}+ |
<St_Para,St_Text>{BLANK}*\n{BLANK}* { /* white space */
g_token->chars=yytext;
......
......@@ -76,7 +76,7 @@ static bool convertMapFile(QTextStream &t,const char *mapName)
if (strncmp(buf,"rect",4)==0)
{
// obtain the url and the coordinates in the order used by graphviz-1.5
sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y2,&x2,&y1);
sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
// later versions of graphviz corrected the y coordinate order
// the rule is that y2>=y1, so test and switch if needed
if (y2<y1)
......
......@@ -696,7 +696,8 @@ static void addClassToContext(Entry *root)
QCString namespaceName;
extractNamespaceName(fullName,className,namespaceName);
//printf("New class: namespace `%s' name=`%s'\n",className.data(),namespaceName.data());
//printf("New class: namespace `%s' name=`%s' brief=`%s' docs=`%s'\n",
// className.data(),namespaceName.data(),root->brief.data(),root->doc.data());
QCString tagName;
QCString refFileName;
......@@ -1777,6 +1778,10 @@ void addMethodToClass(Entry *root,ClassDef *cd,
name=name.left(i);
}
//printf("root->name=`%s; root->args=`%s' root->argList=`%s'\n",
// root->name.data(),root->args.data(),argListToString(root->argList).data()
// );
// adding class member
MemberDef *md=new MemberDef(
root->fileName,root->startLine,
......@@ -2043,6 +2048,7 @@ static void buildFunctionList(Entry *root)
//}
if (root->proto)
{
//printf("setDeclArgumentList to %p\n",argList);
md->setDeclArgumentList(argList);
}
else
......@@ -4463,7 +4469,6 @@ static void findMember(Entry *root,
// );
md->setDefinitionTemplateParameterLists(root->tArgLists);
//md->setMemberDefTemplateArguments(root->mtArgList);
md->setArgumentList(argList);
}
else // no match -> delete argument list
......@@ -5377,7 +5382,7 @@ static void buildCompleteMemberLists()
ClassSDict::Iterator cli(Doxygen::classSDict);
for (cli.toFirst();(cd=cli.current());++cli)
{
if (!cd->isReference() && // not an external class
if (// !cd->isReference() && // not an external class
cd->subClasses()->count()==0 && // is a root of the hierarchy
cd->baseClasses()->count()>0) // and has at least one base class
{
......
......@@ -110,11 +110,11 @@ HtmlGenerator::~HtmlGenerator()
//printf("HtmlGenerator::~HtmlGenerator()\n");
}
void HtmlGenerator::append(const OutputGenerator *g)
{
t << g->getContents();
col+=((HtmlGenerator *)g)->col;
}
//void HtmlGenerator::append(const OutputGenerator *g)
//{
// t << g->getContents();
// col+=((HtmlGenerator *)g)->col;
//}
void HtmlGenerator::init()
{
......
......@@ -33,9 +33,6 @@ class HtmlGenerator : public OutputGenerator
static void writeHeaderFile(QFile &f);
static void writeFooterFile(QFile &f);
OutputGenerator *copy() { return new HtmlGenerator; }
//OutputGenerator *clone() { return new HtmlGenerator(*this); }
void append(const OutputGenerator *o);
void enable() { active=TRUE; }
void disable() { active=FALSE; }
void enableIf(OutputType o) { if (o==Html) active=TRUE; }
......@@ -46,15 +43,12 @@ class HtmlGenerator : public OutputGenerator
void printDoc(DocNode *);
//void generateExternalIndex();
void startFile(const char *name,const char *manName,
const char *title,bool external);
void writeFooter(int,bool);
void endFile();
void clearBuffer();
//void writeIndex();
void startIndexSection(IndexSections) {}
void endIndexSection(IndexSections) {}
void startProjectNumber();
......@@ -75,11 +69,6 @@ class HtmlGenerator : public OutputGenerator
void endIndexValue(const char *,bool);
void startItemList() { t << "<ul>" << endl; }
void endItemList() { t << "</ul>" << endl; }
//void startEnumList() { t << "<ol>" << endl; }
//void endEnumList() { t << "</ol>" << endl; }
//void startAlphabeticalIndexList();
//void endAlphabeticalIndexList();
//void writeIndexHeading(const char *s);
void writeIndexItem(const char *ref,const char *file,const char *name);
void docify(const char *text);
void codify(const char *text);
......@@ -91,7 +80,6 @@ class HtmlGenerator : public OutputGenerator
void endTextLink();
void startHtmlLink(const char *url);
void endHtmlLink();
//void writeMailLink(const char *url);
void startTypewriter() { t << "<code>"; }
void endTypewriter() { t << "</code>"; }
void startGroupHeader();
......@@ -125,15 +113,9 @@ class HtmlGenerator : public OutputGenerator
{ t << "<a name=\"" << name <<"\"></a>"; }
void startCodeFragment() { t << "<div class=\"fragment\"><pre>"; }
void endCodeFragment() { t << "</pre></div>"; }
//void startPreFragment() { t << "<pre>"; }
//void endPreFragment() { t << "</pre>"; }
//void startVerbatimFragment() { t << "<div class=\"fragment\"><pre>"; }
//void endVerbatimFragment() { t << "</pre></div>"; }
void writeLineNumber(const char *,const char *,const char *,int);
void startCodeLine() { col=0; }
void endCodeLine() { codify("\n"); }
//void writeBoldString(const char *text)
// { t << "<b>"; docify(text); t << "</b>"; }
void startEmphasis() { t << "<em>"; }
void endEmphasis() { t << "</em>"; }
void startBold() { t << "<b>"; }
......@@ -146,15 +128,12 @@ class HtmlGenerator : public OutputGenerator
void writeChar(char c);
void startMemberDoc(const char *,const char *,const char *,const char *);
void endMemberDoc();
//void writeDoxyAnchor(const char *fName,const char *clName,
// const char *anchor,const char *name);
void startDoxyAnchor(const char *fName,const char *manName,
const char *anchor,const char *name);
void endDoxyAnchor(const char *fName,const char *anchor);
void startCodeAnchor(const char *label) { t << "<a name=\"" << label << "\"></a>"; }
void endCodeAnchor() { }
void writeLatexSpacing() {}
//void writeLatexLabel(const char *,const char *) {}
void writeStartAnnoItem(const char *type,const char *file,
const char *path,const char *name);
void writeEndAnnoItem(const char *) { t << endl; }
......@@ -166,63 +145,26 @@ class HtmlGenerator : public OutputGenerator
void endCenter() { t << "</center>" << endl; }
void startSmall() { t << "<small>" << endl; }
void endSmall() { t << "</small>" << endl; }
//void startSubscript() { t << "<sub>"; }
//void endSubscript() { t << "</sub>"; }
//void startSuperscript() { t << "<sup>"; }
//void endSuperscript() { t << "</sup>"; }
//void startTable(bool,int)
// { t << "<table border=1 cellspacing=3 cellpadding=3>"; }
//void endTable(bool hasCaption)
// { if (!hasCaption) t << "</tr>";
// t << "</table>" << endl;
// }
//void startCaption() { t << "</tr><caption align=\"bottom\">"; }
//void endCaption() { t << "</caption>" << endl; }
//void nextTableRow() { t << "<tr><td>"; }
//void endTableRow() { t << "</tr>" << endl; }
//void nextTableColumn() { t << "<td>"; }
//void endTableColumn() { t << "</td>"; }
//void writeCopyright() { t << "&copy;"; }
//void writeQuote() { t << "&quot;"; }
//void writeUmlaut(char c) { t << "&" << c << "uml;"; }
//void writeAcute(char c) { t << "&" << c << "acute;"; }
//void writeGrave(char c) { t << "&" << c << "grave;"; }
//void writeCirc(char c) { t << "&" << c << "circ;"; }
//void writeTilde(char c) { t << "&" << c << "tilde;"; }
//void writeRing(char c) { t << "&" << c << "ring;"; }
//void writeSharpS() { t << "&szlig;"; }
//void writeCCedil(char c) { t << "&" << c << "cedil;"; }
void startDescList(SectionTypes) { t << "<dl compact><dt><b>" << endl; }
void endDescList() { t << "</dl>"; }
void startSimpleSect(SectionTypes,const char *,const char *,const char *);
void endSimpleSect();
void startParamList(ParamListTypes,const char *);
void endParamList();
//void endDescTitle() { t << "</b>"; }
void writeDescItem() { t << "<dd>" << endl; }
void startSection(const char *,const char *,SectionInfo::SectionType);
void endSection(const char *,SectionInfo::SectionType);
//void writeSectionRef(const char *,const char *,const char *,const char *);
//void writeSectionRefItem(const char *,const char *,const char *);
//void writeSectionRefAnchor(const char *,const char *,const char *);
void addIndexItem(const char *,const char *);
void startIndent();
void endIndent();
void writeSynopsis() {}
void startClassDiagram();
void endClassDiagram(ClassDiagram &,const char *,const char *);
//void startColorFont(uchar r,uchar g,uchar b);
//void endColorFont();
void startPageRef() {}
void endPageRef(const char *,const char *) {}
void startQuickIndexItem(const char *,const char *);
void endQuickIndexItem();
//void writeFormula(const char *,const char *);
void writeNonBreakableSpace(int);
//void startImage(const char *,const char *,bool);
//void endImage(bool);
//void startDotFile(const char *,bool);
//void endDotFile(bool);
void startDescTable()
{ t << "<table border=0 cellspacing=2 cellpadding=0>" << endl; }
......@@ -236,7 +178,6 @@ class HtmlGenerator : public OutputGenerator
{ t << "<td>" << endl; }
void endDescTableData()
{ t << "</td></tr>" << endl; }
//static void docifyStatic(QTextStream &t,const char *str);
void startDotGraph();
void endDotGraph(DotClassGraph &g);
......@@ -262,14 +203,6 @@ class HtmlGenerator : public OutputGenerator
void startFontClass(const char *s) { t << "<span class=\"" << s << "\">"; }
void endFontClass() { t << "</span>"; }
//void startHtmlOnly() {}
//void endHtmlOnly() {}
//void startLatexOnly() {}
//void endLatexOnly() {}
//void startSectionRefList();
//void endSectionRefList();
void writeCodeAnchor(const char *anchor)
{ t << "<a name=\"" << anchor << "\"></a>"; }
......
......@@ -623,18 +623,21 @@ void LatexDocVisitor::visitPre(DocHtmlHeader *header)
{
switch(header->level())
{
case 1: m_t << "\\subsection*{"; break;
case 2: m_t << "\\subsubsection*{"; break;
case 3: m_t << "\\paragraph*{"; break;
case 1: m_t << "\\subsection*{"; break;
case 2: m_t << "\\subsubsection*{"; break;
case 3: m_t << "\\paragraph*{"; break;
default: m_t << "\\subparagraph*{"; break;
}
}
else
{
switch(header->level())
{
case 1: m_t << "\\section*{"; break;
case 2: m_t << "\\subsection*{"; break;
case 3: m_t << "\\subsubsection*{"; break;
case 1: m_t << "\\section*{"; break;
case 2: m_t << "\\subsection*{"; break;
case 3: m_t << "\\subsubsection*{"; break;
case 4: m_t << "\\paragraph*{"; break;
default: m_t << "\\subparagraph*{"; break;
}
}
}
......
......@@ -113,24 +113,24 @@ LatexGenerator::~LatexGenerator()
// col=g.col;
//}
void LatexGenerator::append(const OutputGenerator *g)
{
t << g->getContents();
col+=((LatexGenerator *)g)->col;
insideTabbing=insideTabbing || ((LatexGenerator *)g)->insideTabbing;
firstDescItem = ((LatexGenerator *)g)->firstDescItem;
insidePre = insidePre || ((LatexGenerator *)g)->insidePre;
//printf("LatexGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(),
// insideTabbing ? "TRUE" : "FALSE" );
}
//void LatexGenerator::append(const OutputGenerator *g)
//{
// t << g->getContents();
// col+=((LatexGenerator *)g)->col;
// insideTabbing=insideTabbing || ((LatexGenerator *)g)->insideTabbing;
// firstDescItem = ((LatexGenerator *)g)->firstDescItem;
// insidePre = insidePre || ((LatexGenerator *)g)->insidePre;
// //printf("LatexGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(),
// // insideTabbing ? "TRUE" : "FALSE" );
//}
OutputGenerator *LatexGenerator::copy()
{
LatexGenerator *result = new LatexGenerator;
result->insideTabbing=insideTabbing;
result->insidePre=insidePre;
return result;
}
//OutputGenerator *LatexGenerator::copy()
//{
// LatexGenerator *result = new LatexGenerator;
// result->insideTabbing=insideTabbing;
// result->insidePre=insidePre;
// return result;
//}
void LatexGenerator::init()
{
......@@ -1295,62 +1295,6 @@ void LatexGenerator::endSection(const char *lab,SectionInfo::SectionType)
//void LatexGenerator::docifyStatic(QTextStream &t,const char *str)
void LatexGenerator::docify(const char *str)
{
#if 0
//static bool isCzech = theTranslator->idLanguage()=="czech";
static bool isJapanese = theTranslator->idLanguage()=="japanese";
//static bool isKorean = theTranslator->idLanguage()=="korean";
//static bool isRussian = theTranslator->idLanguage()=="russian";
//static bool isUkrainian = theTranslator->idLanguage()=="ukrainian";
//static bool isChinese = theTranslator->idLanguage()=="chinese" ||
// theTranslator->idLanguage()=="chinese-traditional";
//static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2";
//static bool isGreek = theTranslator->idLanguage()=="greek";
if (str)
{
const unsigned char *p=(const unsigned char *)str;
unsigned char c;
unsigned char pc='\0';
bool multiByte = FALSE;
while (*p)
{
c=*p++;
if( isJapanese)
{
if (multiByte)
{
t << (char)c;
multiByte = FALSE;
pc = c;
continue;
}
if (c>=0x80)
{
multiByte = TRUE;
t << (char)c;
pc = c;
continue;
}
}
if (insidePre)
{
switch(c)
{
case '\\': t << "\\(\\backslash\\)"; break;
case '{': t << "\\{"; break;
case '}': t << "\\}"; break;
default: t << (char)c; break;
}
}
else
{
filterLatexChar(t,c,insideTabbing);
}
pc = c;
}
}
#endif
filterLatexString(t,str,insideTabbing,insidePre);
}
......@@ -1377,7 +1321,7 @@ void LatexGenerator::codify(const char *str)
MultiByte = FALSE;
continue;
}
if ( c<0 ) // char in range [0x80..0xff]
if ( (uchar)c>=0x80 || (uchar)c<=0xff) // char in range [0x80..0xff]
{
t << (char)c;
MultiByte = TRUE;
......
......@@ -31,9 +31,9 @@ class LatexGenerator : public OutputGenerator
static void writeStyleSheetFile(QFile &f);
static void writeHeaderFile(QFile &f);
OutputGenerator *copy();
//OutputGenerator *copy();
//OutputGenerator *clone() { return new LatexGenerator(*this); }
void append(const OutputGenerator *o);
//void append(const OutputGenerator *o);
void enable() { active=TRUE; }
void disable() { active=FALSE; }
void enableIf(OutputType o) { if (o==Latex) active=TRUE; }
......
......@@ -62,21 +62,21 @@ ManGenerator::~ManGenerator()
{
}
void ManGenerator::append(const OutputGenerator *g)
{
QCString r=g->getContents();
if (upperCase)
t << r.upper();
else
t << r;
if (!r.isEmpty())
firstCol = r.at(r.length()-1)=='\n';
else
firstCol = ((ManGenerator *)g)->firstCol;
col+=((ManGenerator *)g)->col;
inHeader=((ManGenerator *)g)->inHeader;
paragraph=FALSE;
}
//void ManGenerator::append(const OutputGenerator *g)
//{
// QCString r=g->getContents();
// if (upperCase)
// t << r.upper();
// else
// t << r;
// if (!r.isEmpty())
// firstCol = r.at(r.length()-1)=='\n';
// else
// firstCol = ((ManGenerator *)g)->firstCol;
// col+=((ManGenerator *)g)->col;
// inHeader=((ManGenerator *)g)->inHeader;
// paragraph=FALSE;
//}
void ManGenerator::init()
{
......
......@@ -28,9 +28,9 @@ class ManGenerator : public OutputGenerator
ManGenerator();
~ManGenerator();
OutputGenerator *copy() { return new ManGenerator; }
//OutputGenerator *copy() { return new ManGenerator; }
//OutputGenerator *clone() { return new ManGenerator(*this); }
void append(const OutputGenerator *o);
//void append(const OutputGenerator *o);
void enable() { active=TRUE; }
void disable() { active=FALSE; }
void enableIf(OutputType o) { if (o==Man) active=TRUE; }
......
......@@ -262,7 +262,8 @@ MemberDef::MemberDef(const char *df,int dl,
const ArgumentList *tal,const ArgumentList *al
) : Definition(df,dl,na)
{
//printf("++++++ MemberDef(%s file=%s,line=%d static=%d) ++++++ \n",na,df,dl,s);
//printf("++++++ MemberDef(%s file=%s,line=%d static=%d) ++++++ \n",
// na,df,dl,s);
classDef=0;
fileDef=0;
redefines=0;
......@@ -345,6 +346,7 @@ MemberDef::MemberDef(const char *df,int dl,
defArgList->constSpecifier = al->constSpecifier;
defArgList->volatileSpecifier = al->volatileSpecifier;
defArgList->pureSpecifier = al->pureSpecifier;
//printf("defArgList(%p)->constSpecifier=%d\n",defArgList,defArgList->constSpecifier);
}
else
{
......@@ -355,6 +357,8 @@ MemberDef::MemberDef(const char *df,int dl,
{
declArgList = new ArgumentList;
stringToArgumentList(args,declArgList);
//printf("setDeclArgList %s to %p const=%d\n",args.data(),
// declArgList,declArgList->constSpecifier);
}
else
{
......@@ -1922,3 +1926,13 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl,
}
}
void MemberDef::setArgumentList(ArgumentList *al)
{
if (defArgList) delete defArgList;
defArgList = al;
}
void MemberDef::setDeclArgumentList(ArgumentList *al)
{
if (declArgList) delete declArgList;
declArgList = al;
}
......@@ -200,16 +200,8 @@ class MemberDef : public Definition
// argument related members
ArgumentList *argumentList() const { return defArgList; }
ArgumentList *declArgumentList() const { return declArgList; }
void setArgumentList(ArgumentList *al)
{
if (defArgList) delete defArgList;
defArgList = al;
}
void setDeclArgumentList(ArgumentList *al)
{
if (declArgList) delete declArgList;
declArgList = al;
}
void setArgumentList(ArgumentList *al);
void setDeclArgumentList(ArgumentList *al);
ArgumentList *templateArguments() const { return tArgList; }
void setDefinitionTemplateParameterLists(QList<ArgumentList> *lists);
QList<ArgumentList> *definitionTemplateParameterLists() const
......
......@@ -254,8 +254,6 @@ class OutputGenerator : public BaseOutputDocInterface
///////////////////////////////////////////////////////////////
// generic generator methods
///////////////////////////////////////////////////////////////
virtual OutputGenerator *copy() = 0;
//virtual void append(const OutputGenerator *) = 0;
virtual void enable() = 0;
virtual void disable() = 0;
virtual void enableIf(OutputType o) = 0;
......@@ -263,8 +261,6 @@ class OutputGenerator : public BaseOutputDocInterface
virtual void disableIfNot(OutputType o) = 0;
virtual bool isEnabled(OutputType o) = 0;
virtual OutputGenerator *get(OutputType o) = 0;
//void clear() { b.close(); a.resize(0); b.setBuffer(a);
// b.open(IO_WriteOnly); t.setDevice(&b); }
void startPlainFile(const char *name);
void endPlainFile();
QCString getContents() const;
......@@ -370,8 +366,8 @@ class OutputGenerator : public BaseOutputDocInterface
/*! \brief Interface used for generating documentation.
*
* This abstract class is used by the documentation block
* parser to generate the output for a specific format.
* This abstract class is used by several functions
* to generate the output for a specific format.
* This interface contains some state saving and changing
* functions for dealing with format specific output.
*/
......@@ -383,7 +379,7 @@ class OutputDocInterface : public BaseOutputDocInterface
/*! Create a new output generator. This can later by appended
* to the current one using append().
*/
virtual OutputDocInterface *clone() = 0;
//virtual OutputDocInterface *clone() = 0;
/*! Disables all output formats except format \a o
* (useful for OutputList only)
......
......@@ -36,23 +36,23 @@ OutputList::OutputList(bool)
outputs->setAutoDelete(TRUE);
}
OutputList::OutputList(const OutputList *olist)
{
//printf("OutputList::OutputList() deep copy\n");
outputs = new QList<OutputGenerator>;
outputs->setAutoDelete(TRUE);
QList<OutputGenerator> *ol=olist->outputs;
OutputGenerator *og=ol->first();
while (og)
{
OutputGenerator *ogc=og->copy();
outputs->append(ogc);
if (og->isEnabled()) ogc->enable(); else ogc->disable();
og=ol->next();
}
//printf("OutputList::OutputList dst=%d res=%d\n",ol->count(),outputs->count());
}
//OutputList::OutputList(const OutputList *olist)
//{
// //printf("OutputList::OutputList() deep copy\n");
// outputs = new QList<OutputGenerator>;
// outputs->setAutoDelete(TRUE);
//
// QList<OutputGenerator> *ol=olist->outputs;
// OutputGenerator *og=ol->first();
// while (og)
// {
// OutputGenerator *ogc=og->copy();
// outputs->append(ogc);
// if (og->isEnabled()) ogc->enable(); else ogc->disable();
// og=ol->next();
// }
// //printf("OutputList::OutputList dst=%d res=%d\n",ol->count(),outputs->count());
//}
OutputList::~OutputList()
{
......@@ -60,23 +60,23 @@ OutputList::~OutputList()
delete outputs;
}
OutputList &OutputList::operator=(const OutputList &olist)
{
if (this!=&olist)
{
QList<OutputGenerator> *ol=olist.outputs;
OutputGenerator *ogsrc=ol->first();
OutputGenerator *ogdst=outputs->first();
//printf("OutputList::operator= src=%d dst=%d\n",outputs->count(),ol->count());
while (ogdst)
{
ogdst=ogsrc->copy();
ogsrc=ol->next();
ogdst=outputs->next();
}
}
return *this;
}
//OutputList &OutputList::operator=(const OutputList &olist)
//{
// if (this!=&olist)
// {
// QList<OutputGenerator> *ol=olist.outputs;
// OutputGenerator *ogsrc=ol->first();
// OutputGenerator *ogdst=outputs->first();
// //printf("OutputList::operator= src=%d dst=%d\n",outputs->count(),ol->count());
// while (ogdst)
// {
// ogdst=ogsrc->copy();
// ogsrc=ol->next();
// ogdst=outputs->next();
// }
// }
// return *this;
//}
void OutputList::add(const OutputGenerator *og)
{
......
This diff is collapsed.
This diff is collapsed.
......@@ -31,9 +31,9 @@ class RTFGenerator : public OutputGenerator
static void writeStyleSheetFile(QFile &f);
static void writeExtensionsFile(QFile &file);
OutputGenerator *copy();
//OutputGenerator *copy();
//OutputGenerator *clone() { return new RTFGenerator(*this); }
void append(const OutputGenerator *o);
//void append(const OutputGenerator *o);
void enable() { active=TRUE; }
void disable() { active=FALSE; }
void enableIf(OutputType o) { if (o==RTF) active=TRUE; }
......
This diff is collapsed.
This diff is collapsed.
......@@ -278,7 +278,7 @@ class TranslatorCatalan : public TranslatorAdapter_1_2_17
result+="documentats ";
}
result+=" amb enllaços a ";
if (extractAll)
if (!extractAll)
{
if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C"))
{
......
This diff is collapsed.
......@@ -272,7 +272,7 @@ class TranslatorGerman : public TranslatorAdapter_1_2_17
result+="Strukturen und Varianten mit Verweisen auf ";
else
result+="Klassenelemente mit Verweisen auf ";
if (extractAll) {
if (!extractAll) {
if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C"))
result+="die Dokumentation zu jedem Element:";
else
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment