From 6813ee0d373629968dc3ff9235285819e45f5707 Mon Sep 17 00:00:00 2001 From: dimitri Date: Mon, 6 Dec 2004 18:20:45 +0000 Subject: Doxygen-1.3.9.1-20041206 --- INSTALL | 4 +- README | 4 +- VERSION | 2 +- doc/commands.doc | 4 +- doc/formulas.doc | 34 ++++++++++--- doc/language.doc | 2 +- doc/translator_report.txt | 2 +- packages/rpm/doxygen.spec | 2 +- qtools/qcstring.h | 8 ++++ qtools/qstring.cpp | 8 ++++ qtools/qstring.h | 1 + qtools/qtools.pro.in | 3 +- src/bufstr.h | 90 +++++++++++++++++++++++------------ src/commentcnv.l | 4 ++ src/config.l | 2 +- src/docparser.cpp | 119 +++++++++++++++++++++++++--------------------- src/docparser.h | 6 ++- src/doctokenizer.l | 2 +- src/doxygen.cpp | 8 ++-- src/doxygen.h | 4 +- src/index.cpp | 13 +++-- src/memberdef.cpp | 27 +++++++++-- src/memberdef.h | 48 +++++++++++-------- src/outputlist.cpp | 6 +-- src/outputlist.h | 2 +- src/scanner.l | 56 ++++++++++++++-------- src/util.cpp | 15 ++++-- 27 files changed, 309 insertions(+), 167 deletions(-) diff --git a/INSTALL b/INSTALL index 8b60464..08d49d6 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.3.9.1-20041129 +DOXYGEN Version 1.3.9.1-20041206 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (29 November 2004) +Dimitri van Heesch (06 December 2004) diff --git a/README b/README index 97fdee6..baf3659 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3.9.1_20041129 +DOXYGEN Version 1.3.9.1_20041206 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) (29 November 2004) +Dimitri van Heesch (dimitri@stack.nl) (06 December 2004) diff --git a/VERSION b/VERSION index 0b1e6b6..5d60811 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.9.1-20041129 +1.3.9.1-20041206 diff --git a/doc/commands.doc b/doc/commands.doc index 9544ad9..e52ad74 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -1882,8 +1882,8 @@ class C {}; The third argument is optional and can be used to specify the caption that is displayed below the image. This argument has to be specified - between quotes even if it does not contain any spaces. The quotes are - stripped before the caption is displayed. + on a single line and between quotes even if it does not contain any + spaces. The quotes are stripped before the caption is displayed. The fourth argument is also optional and can be used to specify the width or height of the image. This is only useful diff --git a/doc/formulas.doc b/doc/formulas.doc index db52c3f..c62d6cf 100644 --- a/doc/formulas.doc +++ b/doc/formulas.doc @@ -23,14 +23,14 @@ formulas (as images) in the HTML documentation, you will also need to have the following tools installed -There are two ways to include formulas in the documentation. +There are three ways to include formulas in the documentation.
  1. Using in-text formulas that appear in the running text. These formulas should be put between a pair of \\f\$ @@ -69,12 +69,34 @@ There are two ways to include formulas in the documentation. \right\} dt \right| \f] +
  2. Formulas or other latex elements that are not in a math + environment can be specified using \\f{environment}, where + \c environment is the name of the \f$\mbox{\LaTeX}\f$ environment, + the corresponding end command is \\f}. Here is an example for an + equation array +\verbatim + \f{eqnarray*} + g &=& \frac{Gm_2}{r^2} \\ + &=& \frac{(6.673 \times 10^{-11}\,\mbox{m}^3\,\mbox{kg}^{-1}\, + \mbox{s}^{-2})(5.9736 \times 10^{24}\,\mbox{kg})}{(6371.01\,\mbox{km})^2} \\ + &=& 9.82066032\,\mbox{m/s}^2 + \f} +\endverbatim + which results in: + \f{eqnarray*} + g &=& \frac{Gm_2}{r^2} \\ + &=& \frac{(6.673 \times 10^{-11}\,\mbox{m}^3\,\mbox{kg}^{-1}\, + \mbox{s}^{-2})(5.9736 \times 10^{24}\,\mbox{kg})}{(6371.01\,\mbox{km})^2} \\ + &=& 9.82066032\,\mbox{m/s}^2 + \f}
-Formulas should be valid commands in \f$\mbox{\LaTeX}\f$'s math-mode. +For the first two commands one should make sure formulas contain +valid commands in \f$\mbox{\LaTeX}\f$'s math-mode. For the third command +the section should contain valid command for the specific environment. \warning Currently, doxygen is not very fault tolerant in recovering from typos in formulas. It may have to be necessary to remove the -file formula.repository that is written in the html directory to +file formula.repository that is written to the html directory to a rid of an incorrect formula \htmlonly diff --git a/doc/language.doc b/doc/language.doc index ba92211..38e629d 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration file (with default name and known as Doxyfile). -Currently (version 1.3.9.1), 30 languages +Currently (version 1.3.9.1-20041129), 30 languages are supported (sorted alphabetically): Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, diff --git a/doc/translator_report.txt b/doc/translator_report.txt index ab1718b..41cb44f 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -1,4 +1,4 @@ -(1.3.9.1) +(1.3.9.1-20041129) Doxygen supports the following 30 languages (sorted alphabetically): diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 89a611f..107a382 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.3.9.1_20041129 +Version: 1.3.9.1_20041206 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/qtools/qcstring.h b/qtools/qcstring.h index 073a969..e735462 100644 --- a/qtools/qcstring.h +++ b/qtools/qcstring.h @@ -49,6 +49,8 @@ #include #endif +//#undef SMALLSTRING +#define SMALLSTRING /***************************************************************************** Fixes and workarounds for some platforms @@ -166,6 +168,11 @@ Q_EXPORT QDataStream &operator>>( QDataStream &, QByteArray & ); +#ifdef SMALLSTRING +#define SCString QCString +#include "scstring.h" +#else + /***************************************************************************** QCString class *****************************************************************************/ @@ -252,6 +259,7 @@ public: QCString &operator+=( char c ); }; +#endif /***************************************************************************** QCString stream functions diff --git a/qtools/qstring.cpp b/qtools/qstring.cpp index e13ffc8..4707fed 100644 --- a/qtools/qstring.cpp +++ b/qtools/qstring.cpp @@ -12212,6 +12212,14 @@ QString::QString( const QByteArray& ba ) d = new QStringData(uc,l,l); } +QString::QString( const QCString& ba ) +{ + Q2HELPER(stat_construct_ba++) + uint l; + QChar *uc = internalAsciiToUnicode(ba,&l); + d = new QStringData(uc,l,l); +} + /*! Constructs a string that is a deep copy of the first \a length QChar in the array \a unicode. diff --git a/qtools/qstring.h b/qtools/qstring.h index f131446..c64d756 100644 --- a/qtools/qstring.h +++ b/qtools/qstring.h @@ -353,6 +353,7 @@ public: QString( QChar ); // one-char string QString( const QString & ); // impl-shared copy QString( const QByteArray& ); // deep copy + QString( const QCString& ); // deep copy QString( const QChar* unicode, uint length ); // deep copy #ifndef QT_NO_CAST_ASCII QString( const char *str ); // deep copy diff --git a/qtools/qtools.pro.in b/qtools/qtools.pro.in index 37fc143..718803e 100644 --- a/qtools/qtools.pro.in +++ b/qtools/qtools.pro.in @@ -7,6 +7,7 @@ HEADERS = qarray.h \ qcollection.h \ qconfig.h \ qcstring.h \ + scstring.h \ qdatastream.h \ qdatetime.h \ qdict.h \ @@ -45,7 +46,7 @@ HEADERS = qarray.h \ qmodules.h SOURCES = qbuffer.cpp \ qcollection.cpp \ - qcstring.cpp \ + scstring.cpp \ qdatastream.cpp \ qdatetime.cpp \ qdir.cpp \ diff --git a/src/bufstr.h b/src/bufstr.h index 2426fac..ec372b9 100644 --- a/src/bufstr.h +++ b/src/bufstr.h @@ -19,56 +19,84 @@ #define _BUFSTR_H #include "qtbc.h" +#include +#include -/*! String that can deal more efficiently with large large numbers - * of resizing. +/*! @brief Buffer used to store strings + * + * This buffer is used append characters and strings. It will automatically + * resize itself, yet provide efficient random access to the content. */ -class BufStr : public QCString +class BufStr { public: - BufStr(int size) : QCString(size), offset(0), spareRoom(10240) {} + BufStr(int size) + : m_size(size), m_writeOffset(0), m_spareRoom(10240), m_buf(0) + { + m_buf = (char *)malloc(size); + } + ~BufStr() + { + free(m_buf); + } void addChar(char c) { - if (offset>=size()) - { - QCString::resize(size()+spareRoom); - } - QCString::data()[offset++]=c; + makeRoomFor(1); + m_buf[m_writeOffset++]=c; } void addArray(const char *a,int len) { - if (offset+len>=size()) - { - QCString::resize(size()+len+spareRoom); - } - memcpy(QCString::data()+offset,a,len); - offset+=len; + makeRoomFor(len); + memcpy(m_buf+m_writeOffset,a,len); + m_writeOffset+=len; } - uint curPos() { return offset; } void skip(uint s) { - if (offset+s>=size()) - { - QCString::resize(size()+s+spareRoom); - } - offset+=s; + makeRoomFor(s); + m_writeOffset+=s; } void resize( uint newlen ) { - //QCString::resize(newlen); - //if (offset>newlen) - //{ - // offset=newlen; - //} - offset=newlen; - if (offset>=size()) + m_size=newlen; + if (m_writeOffset>=m_size) // offset out of range -> enlarge { - QCString::resize(size()+spareRoom); + m_size=m_writeOffset+m_spareRoom; } + m_buf = (char *)realloc(m_buf,m_size); + } + char *data() const + { + return m_buf; + } + char &at(uint i) const + { + return m_buf[i]; + } + bool isEmpty() const + { + return m_writeOffset==0; + } + operator const char *() const + { + return m_buf; + } + uint curPos() const + { + return m_writeOffset; } private: - uint offset; - const int spareRoom; // 10Kb extra room to avoid frequent resizing + void makeRoomFor(uint size) + { + if (m_writeOffset+size>=m_size) + { + resize(m_size+size+m_spareRoom); + } + } + uint m_size; + uint m_writeOffset; + const int m_spareRoom; // 10Kb extra room to avoid frequent resizing + char *m_buf; }; + #endif diff --git a/src/commentcnv.l b/src/commentcnv.l index d7d04a7..dc152a1 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -188,6 +188,7 @@ static QCString handleCondCmdInAliases(const QCString &s) } else // get argument { + ep=sp; while ((c=*arg) && isId(c)) arg++,ep++; if (ep>sp) { @@ -195,6 +196,9 @@ static QCString handleCondCmdInAliases(const QCString &s) //printf("Found conditional section id %s\n",id.data()); startCondSection(id); } + else // invalid identifier + { + } } p=ep; } diff --git a/src/config.l b/src/config.l index bd0210f..60060e5 100644 --- a/src/config.l +++ b/src/config.l @@ -2850,12 +2850,12 @@ static QCString configFileToString(const char *name) int fsize=f.size(); QCString contents(fsize+2); f.readBlock(contents.data(),fsize); + f.close(); if (fsize==0 || contents[fsize-1]=='\n') contents[fsize]='\0'; else contents[fsize]='\n'; // to help the scanner contents[fsize+1]='\0'; - f.close(); return contents; } } diff --git a/src/docparser.cpp b/src/docparser.cpp index c50b66e..bd25e0e 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -338,31 +338,40 @@ static void checkUndocumentedParams() } /*! Check if a member has documentation for its parameter and or return - * type, if applicable. + * type, if applicable. If found this will be stored in the member, this + * is needed as a member can have brief and detailed documentation, while + * only one of these needs to document the parameters. */ -static void checkNoDocumentedParams() +static void detectNoDocumentedParams() { if (g_memberDef && Config_getBool("WARN_NO_PARAMDOC")) { - ArgumentList *al= g_memberDef->argumentList(); + ArgumentList *al = g_memberDef->argumentList(); ArgumentList *declAl = g_memberDef->declArgumentList(); - QString returnType = g_memberDef->typeString(); - if (!g_hasParamCommand && // no @param command - al && // but the member has a parameter list - al->count()>0 // with at least one parameter (that is not void) - ) + QString returnType = g_memberDef->typeString(); + if (!g_memberDef->hasDocumentedParams() && + g_hasParamCommand) + { + g_memberDef->setHasDocumentedParams(TRUE); + } + else if (!g_memberDef->hasDocumentedParams()) { - ArgumentListIterator ali(*al); - Argument *a; bool allDoc=TRUE; - for (ali.toFirst();(a=ali.current()) && allDoc;++ali) - { - allDoc = !a->docs.isEmpty(); - printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data()); - } - if (!allDoc) + if ( // member has parameters + al && // but the member has a parameter list + al->count()>0 // with at least one parameter (that is not void) + ) { - if (declAl) // try declaration arguments as well + ArgumentListIterator ali(*al); + Argument *a; + + // see if all parameters have documentation + for (ali.toFirst();(a=ali.current()) && allDoc;++ali) + { + allDoc = !a->docs.isEmpty(); + //printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data()); + } + if (!allDoc && declAl) // try declaration arguments as well { allDoc=TRUE; ArgumentListIterator ali(*declAl); @@ -370,32 +379,33 @@ static void checkNoDocumentedParams() for (ali.toFirst();(a=ali.current()) && allDoc;++ali) { allDoc = !a->docs.isEmpty(); - printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data()); + //printf("a->name=%s doc=%s\n",a->name.data(),a->docs.data()); } } - if (!allDoc) - { - QString errMsg = - "Warning: the parameters of member "+ - QString(g_memberDef->qualifiedName())+ - QString(argListToString(al))+ - " are not documented."; - warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),errMsg); - } } + if (allDoc) + { + g_memberDef->setHasDocumentedParams(TRUE); + } + } - if (!g_hasReturnCommand && // no @return or @retval commands - !returnType.isEmpty() && // non empty - returnType!="void" // end non void return type + //printf("Member %s hasReturnCommand=%d\n",g_memberDef->name().data(),g_hasReturnCommand); + if (!g_memberDef->hasDocumentedReturnType() && // docs not yet found + g_hasReturnCommand) + { + g_memberDef->setHasDocumentedReturnType(TRUE); + } + else if ( // see if return needs to documented + g_memberDef->hasDocumentedReturnType() || + returnType.isEmpty() || // empty return type + returnType.find("void")!=-1 || // void return type + !g_memberDef->isConstructor() || // a constructor + !g_memberDef->isDestructor() // or destructor ) { - QString errMsg = - "Warning: the return type or values of member "+ - QString(g_memberDef->qualifiedName())+ - QString(argListToString(al))+ - " are not documented."; - warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),errMsg); + g_memberDef->setHasDocumentedReturnType(TRUE); } + } } @@ -4953,7 +4963,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, Definition *ctx,MemberDef *md, const char *input,bool indexWords, bool isExample, const char *exampleName, - bool singleLine,bool isParam) + bool singleLine, bool linkFromIndex) { //printf("validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"", @@ -5052,7 +5062,8 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, } g_fileName = fileName; - g_relPath = ctx ? relativePathToRoot(ctx->getOutputFileBase()) : QString(""); + g_relPath = (!linkFromIndex && ctx) ? + relativePathToRoot(ctx->getOutputFileBase()) : QString(""); //printf("ctx->name=%s relPath=%s\n",ctx->name().data(),g_relPath.data()); g_memberDef = md; g_nodeStack.clear(); @@ -5086,11 +5097,8 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, delete v; } - if (!isParam) - { - checkUndocumentedParams(); - checkNoDocumentedParams(); - } + checkUndocumentedParams(); + detectNoDocumentedParams(); delete g_token; @@ -5106,7 +5114,6 @@ DocNode *validatingParseText(const char *input) { //printf("------------ input ---------\n%s\n" // "------------ end input -----\n",input); - g_token = new TokenInfo; g_context = ""; g_fileName = ""; @@ -5128,19 +5135,23 @@ DocNode *validatingParseText(const char *input) g_paramsFound.clear(); g_searchUrl=""; - doctokenizerYYlineno=1; - doctokenizerYYinit(input,g_fileName); - - // build abstract syntax tree DocText *txt = new DocText; - txt->parse(); - if (Debug::isFlagSet(Debug::PrintTree)) + if (input) { - // pretty print the result - PrintDocVisitor *v = new PrintDocVisitor; - txt->accept(v); - delete v; + doctokenizerYYlineno=1; + doctokenizerYYinit(input,g_fileName); + + // build abstract syntax tree + txt->parse(); + + if (Debug::isFlagSet(Debug::PrintTree)) + { + // pretty print the result + PrintDocVisitor *v = new PrintDocVisitor; + txt->accept(v); + delete v; + } } delete g_token; diff --git a/src/docparser.h b/src/docparser.h index 1b4333b..241ea6d 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -53,7 +53,9 @@ void initDocParser(); * @param exampleName Base name of the example file (0 if isExample is FALSE). * @param singleLine Output should be presented on a single line, so without * starting a new paragraph at the end. - * @param isParam TRUE if the documentation is for a parameter. + * @param linkFromIndex TRUE if the documentation is generated from an + * index page. In this case context is not used to determine + * the relative path when making a link. * @returns Root node of the abstract syntax tree. Ownership of the * pointer is handed over to the caller. */ @@ -61,7 +63,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, Definition *context, MemberDef *md, const char *input,bool indexWords, bool isExample,const char *exampleName=0, - bool singleLine=FALSE,bool isParam=FALSE); + bool singleLine=FALSE,bool linkFromIndex=FALSE); /*! Main entry point for parsing simple text fragments. These * fragments are limited to words, whitespace and symbols. diff --git a/src/doctokenizer.l b/src/doctokenizer.l index dc02f64..449abc8 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -299,7 +299,7 @@ SCOPEKEYS ":"({ID}":")* SCOPECPP {SCOPEPRE}*(~)?{ID}("<"{TEMPCHAR}*">")? SCOPEOBJC {SCOPEPRE}?{ID}{SCOPEKEYS}? SCOPEMASK {SCOPECPP}|{SCOPEOBJC} -FUNCARG "("{FUNCCHAR}*")" +FUNCARG "("{FUNCCHAR}*")"({BLANK}*("volatile"|"const"))? OPNEW {BLANK}+"new"({BLANK}*"[]")? OPDEL {BLANK}+"delete"({BLANK}*"[]")? OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()" diff --git a/src/doxygen.cpp b/src/doxygen.cpp index f4735a8..60e1c09 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -213,7 +213,7 @@ static void addRelatedPage(Entry *root) { if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname])) break; } - //printf("addRelatedPage() %s gd=%p\n",root->name.data(),gd); + //printf("---> addRelatedPage() %s gd=%p\n",root->name.data(),gd); PageDef *pd = addRelatedPage(root->name,root->args,root->doc,root->anchors, root->fileName,root->startLine, root->sli, @@ -1724,7 +1724,7 @@ static MemberDef *addVariableToFile( */ static int findFunctionPtr(const QCString &type,int *pLength=0) { - static const QRegExp re("([^)]\\*"); + static const QRegExp re("([^)]*\\*"); int i=-1,l; if (!type.isEmpty() && // return type is non-empty (i=re.match(type,0,&l))!=-1 && // contains a (* @@ -1905,7 +1905,7 @@ static void buildVarList(Entry *root) { root->type=root->type.left(root->type.length()-1); root->args.prepend(")"); - printf("root->type=%s root->args=%s\n",root->type.data(),root->args.data()); + //printf("root->type=%s root->args=%s\n",root->type.data(),root->args.data()); } } } @@ -6769,7 +6769,7 @@ static void generatePageDocs() SectionInfo *si=0; if (!pd->title().isEmpty() && !pd->name().isEmpty() && - (si=Doxygen::sectionDict.find(pd->name()))!=0) + (si=Doxygen::sectionDict.find(pageName))!=0) { outputList->startSection(si->label,si->title,si->type); outputList->docify(si->title); diff --git a/src/doxygen.h b/src/doxygen.h index 0720dd5..9a16cc6 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -123,7 +123,7 @@ void readConfiguration(int argc, char **argv); void parseInput(); void generateOutput(); -#undef USE_TMP_FILE -//#define USE_TMP_FILE +//#undef USE_TMP_FILE +#define USE_TMP_FILE #endif diff --git a/src/index.cpp b/src/index.cpp index 53a8c48..0951cc8 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -885,7 +885,8 @@ void writeFileIndex(OutputList &ol) FALSE, // index words FALSE, // isExample 0, // example name - TRUE // single line + TRUE, // single line + TRUE // link from index ); //ol.docify(")"); } @@ -1011,7 +1012,10 @@ void writeNamespaceIndex(OutputList &ol) nd,0, abbreviate(nd->briefDescription(),nd->displayName()), FALSE, // index words - FALSE // isExample + FALSE, // isExample + 0, // example name + TRUE, // single line + TRUE // link from index ); //ol.docify(")"); } @@ -1131,7 +1135,10 @@ void writeAnnotatedClassList(OutputList &ol) cd,0, abbreviate(cd->briefDescription(),cd->displayName()), FALSE, // indexWords - FALSE // isExample + FALSE, // isExample + 0, // example name + TRUE, // single line + TRUE // link from index ); } ol.endIndexValue(cd->getOutputFileBase(),hasBrief); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index a2bb3d9..9c2ed72 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -423,6 +423,8 @@ MemberDef::MemberDef(const char *df,int dl, m_inbodyLine = -1; m_implOnly=FALSE; groupMember = 0; + m_hasDocumentedParams = FALSE; + m_hasDocumentedReturnType = FALSE; } /*! Destroys the member definition. */ @@ -1584,13 +1586,10 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.startDescTableData(); ol.parseDoc(docFile(),docLine(), getOuterScope()?getOuterScope():container, - this, + this, // memberDef a->docs+"\n", // docStr TRUE, // indexWords - FALSE, // isExample - 0, // exampleName - FALSE, // singleLine - TRUE // isParam + FALSE // isExample ); ol.endDescTableData(); } @@ -1838,6 +1837,24 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, //if (Config_getBool("EXTRACT_ALL") && !hasDocs) ol.enable(OutputGenerator::Latex); ol.popGeneratorState(); + if (!Config_getBool("EXTRACT_ALL") && + Config_getBool("WARN_IF_UNDOCUMENTED") && + Config_getBool("WARN_NO_PARAMDOC")) + { + if (!hasDocumentedParams()) + { + warn_doc_error(docFile(),docLine(), + "Warning: parameters of member %s are not (all) documented", + qualifiedName().data()); + } + if (!hasDocumentedReturnType()) + { + warn_doc_error(docFile(),docLine(), + "Warning: return type of member %s is not documented", + qualifiedName().data()); + } + } + } void MemberDef::warnIfUndocumented() diff --git a/src/memberdef.h b/src/memberdef.h index 5456e98..2dfe5b7 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -71,11 +71,13 @@ class MemberDef : public Definition bool related,MemberType t,const ArgumentList *tal, const ArgumentList *al); ~MemberDef(); - DefType definitionType() { return TypeMember; } + DefType definitionType() { return TypeMember; } + // link id QCString getOutputFileBase() const; QCString getReference() const; QCString anchor() const; + const char *declaration() const { return decl; } const char *definition() const { return def; } const char *typeString() const { return type; } @@ -110,7 +112,7 @@ class MemberDef : public Definition Specifier virtualness() const; MemberType memberType() const { return mtype; } - // convenience methods + // getter methods bool isSignal() const { return mtype==Signal; } bool isSlot() const { return mtype==Slot; } bool isVariable() const { return mtype==Variable; } @@ -137,6 +139,8 @@ class MemberDef : public Definition bool isImplementation() const { return m_implOnly; } bool isExternal() const { return explExt; } bool isTemplateSpecialization() const { return tspec; } + bool hasDocumentedParams() const { return m_hasDocumentedParams; } + bool hasDocumentedReturnType() const { return m_hasDocumentedReturnType; } bool isObjCMethod() const; bool isConstructor() const; bool isDestructor() const; @@ -154,27 +158,29 @@ class MemberDef : public Definition bool isDocumentedFriendClass() const; // set functions - void setMemberType(MemberType t) { mtype=t; } - void setDefinition(const char *d) { def=d; } - void setFileDef(FileDef *fd) { fileDef=fd; } + void setMemberType(MemberType t) { mtype=t; } + void setDefinition(const char *d) { def=d; } + void setFileDef(FileDef *fd) { fileDef=fd; } void setAnchor(const char *a); - void setProtection(Protection p) { prot=p; } - void setMemberSpecifiers(int s) { memSpec=s; } - void mergeMemberSpecifiers(int s) { memSpec|=s; } + void setProtection(Protection p) { prot=p; } + void setMemberSpecifiers(int s) { memSpec=s; } + void mergeMemberSpecifiers(int s) { memSpec|=s; } void setInitializer(const char *i); - void setBitfields(const char *s) { bitfields = s; } - void setMaxInitLines(int lines) { userInitLines=lines; } + void setBitfields(const char *s) { bitfields = s; } + void setMaxInitLines(int lines) { userInitLines=lines; } void setMemberClass(ClassDef *cd); void setSectionList(Definition *d,MemberList *sl); void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, const QCString &fileName,int startLine,bool hasDocs, MemberDef *member=0); - void setExplicitExternal(bool b) { explExt=b; } - void setReadAccessor(const char *r) { read=r; } - void setWriteAccessor(const char *w) { write=w; } - void setTemplateSpecialization(bool b) { tspec=b; } + void setExplicitExternal(bool b) { explExt=b; } + void setReadAccessor(const char *r) { read=r; } + void setWriteAccessor(const char *w) { write=w; } + void setTemplateSpecialization(bool b) { tspec=b; } - void makeRelated() { related=TRUE; } + void makeRelated() { related=TRUE; } + void setHasDocumentedParams(bool b) { m_hasDocumentedParams = b; } + void setHasDocumentedReturnType(bool b) { m_hasDocumentedReturnType = b; } // output generatation void writeLink(OutputList &ol, @@ -330,18 +336,17 @@ class MemberDef : public Definition MemberDef *groupAlias; // Member containing the definition Specifier virt; // normal/virtual/pure virtual Protection prot; // protection type [Public/Protected/Private] - bool related; // is this a member that is only related to a class - bool stat; // is it a static function? - int memSpec; // The specifiers present for this member + int memSpec; // The specifiers present for this member MemberType mtype; // returns the kind of member + bool related; // is this a member that is only related to a class + bool stat; // is it a static function? bool proto; // is it a prototype; bool docEnumValues; // is an enum with documented enum values. bool annScope; // member is part of an annoymous scope bool annUsed; bool annShown; bool m_hasCallGraph; - //int indDepth; // indentation depth for this member if inside an annonymous scope - int maxInitLines; // when the initializer will be displayed + int maxInitLines; // when the initializer will be displayed int userInitLines; // result of explicit \hideinitializer or \showinitializer MemberList *section; // declation list containing this member MemberDef *annMemb; @@ -389,6 +394,9 @@ class MemberDef : public Definition // objective-c bool m_implOnly; // function found in implementation but not // in the interface + + bool m_hasDocumentedParams; + bool m_hasDocumentedReturnType; }; #endif diff --git a/src/outputlist.cpp b/src/outputlist.cpp index 83f9b29..917e5f6 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -133,7 +133,7 @@ void OutputList::parseDoc(const char *fileName,int startLine, Definition *ctx,MemberDef * md, const QCString &docStr,bool indexWords, bool isExample,const char *exampleName, - bool singleLine,bool isParam) + bool singleLine,bool linkFromIndex) { int count=0; if (docStr.isEmpty()) return; @@ -151,13 +151,13 @@ void OutputList::parseDoc(const char *fileName,int startLine, { root = validatingParseDoc(fileName,startLine, ctx,md,docStr,indexWords,isExample,exampleName, - singleLine,isParam); + singleLine,linkFromIndex); } else { root = validatingParseDoc(fileName,startLine, ctx,md,docStr+"\n",indexWords,isExample,exampleName, - singleLine,isParam); + singleLine,linkFromIndex); } og=outputs->first(); diff --git a/src/outputlist.h b/src/outputlist.h index 690e7da..78fc8cd 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -64,7 +64,7 @@ class OutputList : public OutputDocInterface void parseDoc(const char *fileName,int startLine, Definition *ctx,MemberDef *md,const QCString &docStr, bool indexWords,bool isExample,const char *exampleName=0, - bool singleLine=FALSE,bool isParam=FALSE); + bool singleLine=FALSE,bool linkFromIndex=FALSE); void parseText(const QCString &textStr); diff --git a/src/scanner.l b/src/scanner.l index a8f552e..e9b01b3 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -125,6 +125,7 @@ static QCString aliasName; static QCString baseName; static QCString* specName; static QCString formulaText; +static QCString formulaEnd; static bool useOverrideCommands = FALSE; static bool insideIDL = FALSE; //!< processing IDL code? static bool insideJava = FALSE; //!< processing Java code? @@ -160,7 +161,7 @@ static bool insideCode; static bool needsSemi; static int depthIf; -//static int initializerSharpCount; +static int initBracketCount; static QCString memberGroupRelates; static QCString memberGroupInside; static QCString xrefItemKey; @@ -2059,7 +2060,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] "=" { current->bodyLine = yyLineNr; lastInitializerContext = YY_START; - //initializerSharpCount=0; + initBracketCount=0; BEGIN(ReadInitializer); } /* Read initializer rules */ @@ -2079,18 +2080,20 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] } [;,] { //printf(">> initializer `%s' <<\n",current->initializer.data()); - //if (initializerSharpCount==0) - //{ if (*yytext==';' || lastInitializerContext==FindFields) { unput(*yytext); BEGIN(lastInitializerContext); } - //} - //else - //{ - // current->initializer+=*yytext; - //} + else if (*yytext==',' && initBracketCount==0) // for "int a=0,b=0" + { + unput(*yytext); + BEGIN(lastInitializerContext); + } + else + { + current->initializer+=*yytext; + } } \" { if (insideIDL && insideCppQuote) @@ -2105,7 +2108,6 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] BEGIN(CopyString); } } - /* "->" { current->initializer+=yytext; } @@ -2115,15 +2117,14 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] ">>" { current->initializer+=yytext; } -\< { - initializerSharpCount++; +[<\[{(] { + initBracketCount++; current->initializer+=*yytext; } -\> { - initializerSharpCount--; +[>\]})] { + initBracketCount--; current->initializer+=*yytext; } - */ {CHARLIT} { if (insidePHP) { @@ -2373,7 +2374,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] } "=" { lastInitializerContext = YY_START; - //initializerSharpCount=0; + initBracketCount=0; BEGIN(ReadInitializer); } "," { @@ -2670,7 +2671,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] } "=" { lastInitializerContext=YY_START; - //initializerSharpCount=0; + initBracketCount=0; BEGIN(ReadInitializer); /* BEGIN(MemberSpecSkip); */ } @@ -3137,6 +3138,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] //current->args += *yytext; //BEGIN(FuncPtrInit); lastInitializerContext=YY_START; + initBracketCount=0; BEGIN(ReadInitializer); } [{;] { @@ -5002,6 +5004,14 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] insideFormula=TRUE; BEGIN(ReadFormulaLong); } +{CMD}"f{"[^}\n]+"}" { + lastFormulaContext = YY_START; + formulaText="\\begin"; + formulaEnd=&yytext[2]; + formulaText+=formulaEnd; + insideFormula=TRUE; + BEGIN(ReadFormulaLong); + } {CMD}"f$" { formulaText+="$"; if (lastFormulaContext==ClassDocBrief || @@ -5037,8 +5047,16 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] BEGIN(lastFormulaContext); } } -{CMD}"f]" { - formulaText+="\\]"; +{CMD}"f"[\}\]] { + if (yytext[2]==']') + { + formulaText+="\\]"; + } + else + { + formulaText+="\\end"; + formulaText+=formulaEnd; + } if (lastFormulaContext==ClassDocBrief || lastFormulaContext==LineDoc || lastFormulaContext==JavaDoc || diff --git a/src/util.cpp b/src/util.cpp index 52d2889..77983bc 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -452,6 +452,11 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, if (scopeIndex!=-1) // strip scope part for the name { resName=qualifiedName.right(qualifiedName.length()-scopeIndex-2); + if (resName.isEmpty()) + { + // qualifiedName was of form A:: ! + return result; + } } MemberDef *md=0; while (mContext && md==0) @@ -2602,7 +2607,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,const Argument *a { QCString type = arg->type; QCString name = arg->name; - printf("extractCanonicalType(type=%s,name=%s)\n",type.data(),name.data()); + //printf("extractCanonicalType(type=%s,name=%s)\n",type.data(),name.data()); if ((type=="const" || type=="volatile") && !name.isEmpty()) { // name is part of type => correct type+=" "; @@ -2634,7 +2639,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,const Argument *a canType += type.mid(p,i-p); QCString word = type.mid(i,l); ClassDef *cd = getResolvedClass(d,fs,word); - printf("word %s => %s\n",word.data(),cd?cd->qualifiedName().data():""); + //printf("word %s => %s\n",word.data(),cd?cd->qualifiedName().data():""); if (cd) { canType+=cd->qualifiedName(); @@ -2654,7 +2659,7 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,const Argument *a p=i+l; } canType += type.right(type.length()-p); - printf("result = %s\n",canType.data()); + //printf("result = %s\n",canType.data()); return removeRedundantWhiteSpace(canType); } @@ -2961,7 +2966,8 @@ bool getDefs(const QCString &scName,const QCString &memberName, QCString mScope; if (memberName.left(9)!="operator " && // treat operator conversion methods // as a special case - (im=memberName.findRev("::"))!=-1 + (im=memberName.findRev("::"))!=-1 && + im<(int)memberName.length()-2 // not A:: ) { mScope=memberName.left(im); @@ -2973,6 +2979,7 @@ bool getDefs(const QCString &scName,const QCString &memberName, //printf("mScope=`%s' mName=`%s'\n",mScope.data(),mName.data()); + if (mName.isEmpty()) printf("memberName=%s\n",memberName.data()); MemberName *mn = Doxygen::memberNameSDict[mName]; if (!forceEmptyScope && mn && !(scopeName.isEmpty() && mScope.isEmpty())) { -- cgit v0.12