From 04a4eddbeaa2fef70fe87a790efabe074062fadf Mon Sep 17 00:00:00 2001 From: dimitri Date: Tue, 21 Dec 2004 21:03:59 +0000 Subject: Release-1.3.9.1-20041221 --- INSTALL | 4 +- README | 4 +- VERSION | 2 +- configure | 2 +- packages/rpm/doxygen.spec | 2 +- src/declinfo.l | 12 ++- src/definition.cpp | 25 ++++- src/dirdef.cpp | 2 +- src/docparser.cpp | 40 ++++++-- src/doctokenizer.l | 3 +- src/dot.cpp | 32 +++++- src/doxygen.cpp | 17 +++- src/ftvhelp.cpp | 2 +- src/htmldocvisitor.cpp | 17 +++- src/htmlgen.cpp | 2 +- src/index.cpp | 1 + src/latexdocvisitor.cpp | 3 +- src/memberdef.cpp | 1 + src/memberdef.h | 8 +- src/memberlist.h | 1 + src/rtfdocvisitor.cpp | 3 +- src/scanner.l | 241 +++++++++++++++++++++++++--------------------- src/util.cpp | 5 +- 23 files changed, 280 insertions(+), 149 deletions(-) diff --git a/INSTALL b/INSTALL index ba714f6..81fe1eb 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.3.9.1-20041213 +DOXYGEN Version 1.3.9.1-20041221 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (13 December 2004) +Dimitri van Heesch (21 December 2004) diff --git a/README b/README index 31508a9..94640ac 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3.9.1_20041213 +DOXYGEN Version 1.3.9.1_20041221 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 December 2004) +Dimitri van Heesch (dimitri@stack.nl) (21 December 2004) diff --git a/VERSION b/VERSION index 94992c2..7256b0f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.9.1-20041213 +1.3.9.1-20041221 diff --git a/configure b/configure index 576e87d..0a35411 100755 --- a/configure +++ b/configure @@ -180,7 +180,7 @@ if test -z "$f_platform"; then f_platform=sunos-g++ ;; SunOS:5*) - f_platform=solaris-cc + f_platform=solaris-g++ ;; ULTRIX:*) f_platform=ultrix-g++ diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 8904473..7fb95b7 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_20041213 +Version: 1.3.9.1_20041221 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/declinfo.l b/src/declinfo.l index d115fb1..0c67a80 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -117,7 +117,9 @@ ID ([a-z_A-Z][a-z_A-Z0-9]*)|(@[0-9]+) name += yytext; BEGIN(Operator); } -(~{B}*)?{ID}({B}*"["{B}*"]")* { // the []'s are for Java +(~{B}*)?{ID}/({B}*"["{B}*"]")* { // the []'s are for Java, + // the / was add to deal with multi- + // dimensional C++ arrays like A[][15] addTypeName(); name += yytext; } @@ -331,3 +333,11 @@ int main() dumpDecl("void ( * Name < T > :: bla ) ( int, char * )"); } #endif + +#if !defined(YY_FLEX_SUBMINOR_VERSION) +//---------------------------------------------------------------------------- +extern "C" { // some bogus code to keep the compiler happy + void declinfoYYdummy() { yy_flex_realloc(0,0); } +} +#endif + diff --git a/src/definition.cpp b/src/definition.cpp index bdc6af0..6b42428 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -563,12 +563,18 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName, void Definition::writeSourceReffedBy(OutputList &ol,const char *scopeName) { - writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_sourceRefByDict,FALSE); + if (Config_getBool("REFERENCED_BY_RELATION")) + { + writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_sourceRefByDict,FALSE); + } } void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) { - writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_sourceRefsDict,TRUE); + if (Config_getBool("REFERENCES_RELATION")) + { + writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_sourceRefsDict,TRUE); + } } bool Definition::hasDocumentation() const @@ -758,7 +764,6 @@ void Definition::writePathFragment(OutputList &ol) const if (m_outerScope && m_outerScope!=Doxygen::globalScope) { m_outerScope->writePathFragment(ol); - ol.writeString(" "); if (m_outerScope->definitionType()==Definition::TypeClass || m_outerScope->definitionType()==Definition::TypeNamespace) { @@ -773,11 +778,21 @@ void Definition::writePathFragment(OutputList &ol) const } else { + ol.writeString(" "); ol.writeString("/"); + ol.writeString(" "); } - ol.writeString(" "); } - ol.writeObjectLink(getReference(),getOutputFileBase(),0,m_localName); + if (isLinkable()) + { + ol.writeObjectLink(getReference(),getOutputFileBase(),0,m_localName); + } + else + { + ol.startBold(); + ol.docify(m_localName); + ol.endBold(); + } } void Definition::writeNavigationPath(OutputList &ol) const diff --git a/src/dirdef.cpp b/src/dirdef.cpp index aef5e3f..e79601e 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -222,7 +222,7 @@ void DirDef::writeDocumentation(OutputList &ol) else { ol.startBold(); - ol.writeString(fd->name()); + ol.docify(fd->name()); ol.endBold(); } if (fd->generateSourceFile()) diff --git a/src/docparser.cpp b/src/docparser.cpp index bd25e0e..e7e970a 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -279,11 +279,24 @@ static void checkArgumentName(const QString &name,bool isParam) //printf("member type=%d\n",memberDef->memberType()); QString scope=g_memberDef->getScopeString(); if (!scope.isEmpty()) scope+="::"; else scope=""; - warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(), + QString inheritedFrom = ""; + QString docFile = g_memberDef->docFile(); + int docLine = g_memberDef->docLine(); + MemberDef *inheritedMd = g_memberDef->inheritsDocsFrom(); + if (inheritedMd) // documentation was inherited + { + inheritedFrom.sprintf(" inherited from member %s at line " + "%d in file %s",inheritedMd->name().data(), + inheritedMd->docLine(),inheritedMd->docFile().data()); + docFile = g_memberDef->getDefFileName(); + docLine = g_memberDef->getDefLine(); + + } + warn_doc_error(docFile,docLine, "Warning: argument `%s' of command @param " - "is not found in the argument list of %s%s%s", + "is not found in the argument list of %s%s%s%s", aName.data(),scope.data(),g_memberDef->name().data(), - argListToString(al).data()); + argListToString(al).data(),inheritedFrom.data()); } p=i+l; } @@ -331,7 +344,14 @@ static void checkUndocumentedParams() errMsg+=" parameter "+argName+"\n"; } } - warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),errMsg); + if (g_memberDef->inheritsDocsFrom()) + { + warn_doc_error(g_memberDef->getDefFileName(),g_memberDef->getDefLine(),errMsg); + } + else + { + warn_doc_error(g_memberDef->docFile(),g_memberDef->docLine(),errMsg); + } } } } @@ -1597,8 +1617,16 @@ bool DocXRefItem::parse() ASSERT(item!=0); if (item) { - m_file = refList->listName(); - m_anchor = item->listAnchor; + if (g_memberDef && g_memberDef->name().at(0)=='@') + { + m_file = "@"; // can't cross reference anonymous enum + m_anchor = "@"; + } + else + { + m_file = refList->listName(); + m_anchor = item->listAnchor; + } m_title = refList->sectionTitle(); //printf("DocXRefItem: file=%s anchor=%s title=%s\n", // m_file.data(),m_anchor.data(),m_title.data()); diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 449abc8..35c166c 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -317,6 +317,7 @@ HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|" HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P" HTMLKEYW {HTMLKEYL}|{HTMLKEYU} LABELID [a-z_A-Z][a-z_A-Z0-9\-]* +REFWORD ("#"|"::")?({ID}("."|"#"|"::"|"-"))*{ID}{FUNCARG}? %option noyywrap %option yylineno @@ -666,7 +667,7 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]* return 0; } -("#"|"::")?({ID}("."|"#"|"::"|"-"))*{ID} { +{REFWORD} { g_token->name=yytext; return TK_WORD; } diff --git a/src/dot.cpp b/src/dot.cpp index bb2eb92..ae34fb1 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -543,6 +543,20 @@ static void writeBoxMemberList(QTextStream &t,char prot,MemberList &ml,ClassDef t << "\\l"; } } + // write member groups within the memberlist + MemberGroupList *mgl = ml.getMemberGroupList(); + if (mgl) + { + MemberGroupListIterator mgli(*mgl); + MemberGroup *mg; + for (mgli.toFirst();(mg=mgli.current());++mgli) + { + if (mg->members()) + { + writeBoxMemberList(t,prot,*mg->members(),scope); + } + } + } } void DotNode::writeBox(QTextStream &t, @@ -582,6 +596,18 @@ void DotNode::writeBox(QTextStream &t, writeBoxMemberList(t,'-',m_classDef->priMethods,m_classDef); writeBoxMemberList(t,'-',m_classDef->priStaticMethods,m_classDef); writeBoxMemberList(t,'-',m_classDef->priSlots,m_classDef); + if (m_classDef->memberGroupSDict) + { + MemberGroupSDict::Iterator mgdi(*m_classDef->memberGroupSDict); + MemberGroup *mg; + for (mgdi.toFirst();(mg=mgdi.current());++mgdi) + { + if (mg->members()) + { + writeBoxMemberList(t,'*',*mg->members(),m_classDef); + } + } + } t << "}"; } else // old look @@ -2851,7 +2877,7 @@ void DotGroupCollaboration::addCollaborationMember( QCString DotGroupCollaboration::writeGraph( QTextStream &t, GraphOutputFormat format, - const char *path, const char *, + const char *path, const char *relPath, bool writeImageMap) { QDir d(path); @@ -2922,11 +2948,11 @@ QCString DotGroupCollaboration::writeGraph( QTextStream &t, GraphOutputFormat fo if (writeImageMap) { QCString mapLabel = convertNameToFile(baseName); - t << "
\"\"" << endl; t << "" << endl; - convertMapFile(t,mapName,""); + convertMapFile(t,mapName,relPath); t << "
" << endl; thisDir.remove(mapName); } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 213689c..5ed0f9a 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -3431,8 +3431,11 @@ static bool findClassRelation( cd->getFileDef(), // todo: is this ok? baseClassName, &baseClassTypeDef, - &templSpec); - //printf("baseClassName=%s baseClass=%p cd=%p\n",baseClassName.data(),baseClass,cd); + &templSpec, + mode==Undocumented + ); + //printf("baseClassName=%s baseClass=%p cd=%p explicitGlobalScope=%d\n", + // baseClassName.data(),baseClass,cd,explicitGlobalScope); //printf(" root->name=`%s' baseClassName=`%s' baseClass=%s templSpec=%s\n", // root->name.data(), // baseClassName.data(), @@ -3530,7 +3533,7 @@ static bool findClassRelation( { findTemplateInstanceRelation(root,context,baseClass,templSpec,templateNames,isArtificial); } - else if (mode==DocumentedOnly) + else if (mode==DocumentedOnly || mode==Undocumented) { QCString usedName; if (baseClassTypeDef) @@ -4243,7 +4246,8 @@ static bool findGlobalMember(Entry *root, } else // got docs for an undefined member! { - if (root->type!="friend class" && root->type!="friend struct" && + if (root->type!="friend class" && + root->type!="friend struct" && root->type!="friend union") { warn(root->fileName,root->startLine, @@ -4879,10 +4883,12 @@ static void findMember(Entry *root, int candidates=0; if (mn->count()>0) { + //printf("Assume template class\n"); for (mni.toFirst();(md=mni.current());++mni) { ClassDef *cd=md->getClassDef(); - if (cd!=0 && cd->name()==className) + //printf("cd->name()==%s className=%s\n",cd->name().data(),className.data()); + if (cd!=0 && rightScopeMatch(cd->name(),className)) { if (root->tArgLists && md->templateArguments() && root->tArgLists->getLast()->count()<=md->templateArguments()->count()) @@ -6175,6 +6181,7 @@ static void inheritDocumentation() } if (bmd) // copy the documentation from the reimplemented member { + md->setInheritsDocsFrom(bmd); md->setDocumentation(bmd->documentation(),bmd->docFile(),bmd->docLine()); md->setDocsForDefinition(bmd->isDocsForDefinition()); md->setBriefDescription(bmd->briefDescription(),bmd->briefFile(),bmd->briefLine()); diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 6704fb2..da38392 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -630,7 +630,7 @@ void FTVHelp::generateTreeView() #endif t << "\n"; t << " \n"; - t << " idLanguageCharset() << "\" />\n"; t << " \n"; t << " \n"; diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 03a1759..41c2fb4 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -923,10 +923,21 @@ void HtmlDocVisitor::visitPost(DocParamList *) void HtmlDocVisitor::visitPre(DocXRefItem *x) { if (m_hide) return; - m_t << "
relPath() << x->file() << Doxygen::htmlFileExtension << "#" << x->anchor() << "\">"; + bool anonymousEnum = x->file()=="@"; + if (!anonymousEnum) + { + m_t << "
relPath() << x->file() << Doxygen::htmlFileExtension + << "#" << x->anchor() << "\">"; + } + else + { + m_t << "
"; + } filter(x->title()); - m_t << ":
"; + m_t << ":"; + if (!anonymousEnum) m_t << ""; + m_t << "
"; } void HtmlDocVisitor::visitPost(DocXRefItem *) diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 4886bf4..eed39a5 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1108,7 +1108,7 @@ void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const { DBG_HTML(t << "" << endl;) t << "

" << endl; - t << "" << endl; + t << "
" << endl; t << " " << endl; t << "
" << endl; t << " " << endl; diff --git a/src/index.cpp b/src/index.cpp index 0951cc8..6d0b783 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -603,6 +603,7 @@ int countClassHierarchy() void writeHierarchicalIndex(OutputList &ol) { + //printf("writeHierarchicalIndex: %d classes\n",hierarchyClasses); if (hierarchyClasses==0) return; ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index c83a499..7436ccb 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -930,8 +930,9 @@ void LatexDocVisitor::visitPre(DocXRefItem *x) { if (m_hide) return; m_t << "\\begin{Desc}" << endl; + bool anonymousEnum = x->file()=="@"; m_t << "\\item["; - if (Config_getBool("PDF_HYPERLINKS")) + if (Config_getBool("PDF_HYPERLINKS") && !anonymousEnum) { m_t << "\\hyperlink{" << stripPath(x->file()) << "_" << x->anchor() << "}{"; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 9c2ed72..6b28bf9 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -425,6 +425,7 @@ MemberDef::MemberDef(const char *df,int dl, groupMember = 0; m_hasDocumentedParams = FALSE; m_hasDocumentedReturnType = FALSE; + m_docProvider = 0; } /*! Destroys the member definition. */ diff --git a/src/memberdef.h b/src/memberdef.h index 2dfe5b7..e5b48eb 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -181,8 +181,9 @@ class MemberDef : public Definition void makeRelated() { related=TRUE; } void setHasDocumentedParams(bool b) { m_hasDocumentedParams = b; } void setHasDocumentedReturnType(bool b) { m_hasDocumentedReturnType = b; } + void setInheritsDocsFrom(MemberDef *md) { m_docProvider = md; } - // output generatation + // output generation void writeLink(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); void writeDeclaration(OutputList &ol, @@ -276,6 +277,8 @@ class MemberDef : public Definition void setTemplateMaster(MemberDef *mt) { m_templateMaster=mt; } void addListReference(Definition *d); + MemberDef *inheritsDocsFrom() const { return m_docProvider; } + //QCString getBodyAnchor() const //{ // return bodyMemb ? bodyMemb->anchor() : anchor(); @@ -397,6 +400,9 @@ class MemberDef : public Definition bool m_hasDocumentedParams; bool m_hasDocumentedReturnType; + + // documentation inheritance + MemberDef *m_docProvider; }; #endif diff --git a/src/memberlist.h b/src/memberlist.h index 357142e..6df9786 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -58,6 +58,7 @@ class MemberList : public QList void setInGroup(bool group) { m_inGroup=group; } void addListReferences(Definition *def); void findSectionsInDocumentation(); + MemberGroupList *getMemberGroupList() const { return memberGroupList; } private: int m_varCnt,m_funcCnt,m_enumCnt,m_enumValCnt,m_typeCnt; diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index d85d323..acfaafa 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -1173,11 +1173,12 @@ void RTFDocVisitor::visitPost(DocParamList *) void RTFDocVisitor::visitPre(DocXRefItem *x) { if (m_hide) return; + bool anonymousEnum = x->file()=="@"; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocXRefItem)}\n"); m_t << "{"; // start param list //m_t << "{\\b "; // start bold m_t << "{" << rtf_Style["Heading5"]->reference << endl; - if (Config_getBool("RTF_HYPERLINKS")) + if (Config_getBool("RTF_HYPERLINKS") && !anonymousEnum) { QString refName; if (!x->file().isEmpty()) diff --git a/src/scanner.l b/src/scanner.l index ac2f2a4..7708a38 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -83,6 +83,7 @@ static int lastInternalDocContext; static int lastPreLineCtrlContext; static int lastSkipVerbStringContext; static int lastCommentInArgContext; +static int lastFileDocContext; static int nextDefContext; static int overloadContext; static Protection protection; @@ -299,34 +300,14 @@ static QCString stripQuotes(const char *s) return name; } -//static QCString stripCComments(const QCString &s) -//{ -// int p=0,i; -// QCString result; -// while ((i=s.find("/*",p))!=-1) -// { -// result+=s.mid(p,i-p); -// int ei = s.find("*/",i+1); -// if (ei!=-1) -// { -// p=ei+2; -// } -// else -// { -// return result; -// } -// } -// result+=s.right(s.length()-p); -// printf("stripCComments: input=%s output=%s\n",s.data(),result.data()); -// return result; -//} - static void newDocState(); //----------------------------------------------------------------- -static void addXRefItem(const char *listName,const char *itemTitle,const char *listTitle) +static void addXRefItem(bool inBody,const char *listName,const char *itemTitle,const char *listTitle) { + Entry *docEntry = inBody && previous ? previous : current; + //printf("docEntry=%p\n",docEntry); if (listName==0) return; //printf("addXRefItem(%s,%s,%s)\n",listName,itemTitle,listTitle); @@ -338,9 +319,9 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l Doxygen::xrefLists->insert(listName,refList); //printf("new list!\n"); } - if (current->sli) + if (docEntry->sli) { - QListIterator slii(*current->sli); + QListIterator slii(*docEntry->sli); for (slii.toFirst();(lii=slii.current());++slii) { if (strcmp(lii->type,listName)==0) @@ -350,9 +331,11 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l } } } +#if 0 // with this code multiple @todo items can be put under the same + // heading, I removed it because it changes the text flow. if (lii) // already found item of same type before { - //printf("listName=%s item id = %d\n",listName,lii->itemId); + //printf("listName=%s item id = %d existing\n",listName,lii->itemId); RefItem *item = refList->getRefItem(lii->itemId); ASSERT(item!=0); item->text += "

"; @@ -360,25 +343,29 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l //printf("%s: text +=%s\n",listName,item->text.data()); } else // new item +#endif { int itemId = refList->addRefItem(); - //printf("listName=%s item id = %d\n",listName,itemId); + //printf("listName=%s item id = %d new current=%p\n",listName,itemId,current); + + // if we have already an item from the same list type (e.g. a second @todo) + // in the same Entry (i.e. lii!=0) then we reuse its link anchor. char anchorLabel[1024]; - sprintf(anchorLabel,"_%s%06d",listName,itemId); + sprintf(anchorLabel,"_%s%06d",listName,lii ? lii->itemId : itemId); RefItem *item = refList->getRefItem(itemId); ASSERT(item!=0); - item->text = current->brief.copy(); + item->text = current->brief; item->listAnchor = anchorLabel; - current->addSpecialListItem(listName,itemId); + docEntry->addSpecialListItem(listName,itemId); QCString cmdString; cmdString.sprintf("\\xrefitem %s %d\n",listName,itemId); - current->doc += cmdString; + docEntry->doc += cmdString; SectionInfo *si=new SectionInfo(listName,anchorLabel, sectionTitle,SectionInfo::Anchor); Doxygen::sectionDict.insert(anchorLabel,si); - current->anchors->append(si); + docEntry->anchors->append(si); } - current->brief = slString.copy(); // restore orginial brief desc. + current->brief = slString; // restore orginial brief desc. } //----------------------------------------------------------------------------- @@ -405,6 +392,8 @@ static QCString addFormula() return formLabel; } +//----------------------------------------------------------------------------- + static bool nameIsOperator(QCString &name) { int i=name.find("operator"); @@ -414,6 +403,8 @@ static bool nameIsOperator(QCString &name) return FALSE; // case TEXToperatorTEXT } +//----------------------------------------------------------------------------- + static void checkFormula() { if (insideFormula) @@ -422,6 +413,8 @@ static void checkFormula() } } +//----------------------------------------------------------------------------- + static void checkDocs() { checkFormula(); @@ -436,33 +429,7 @@ static void checkDocs() } } -#if 0 -static QCString extractName(const QCString &s) -{ - //static const QRegExp id("[a-z_A-Z][a-z_A-Z0-9]*"); - //int i,p=0,l; - //while ((i=id.match(s,p,&l))!=-1) - //{ - // QCString idstr=s.mid(i,l); - // if (idstr!="struct" && idstr!="class" && idstr!="union") - // { - // - // return idstr; - // } - // p=i+l; - //} - //return ""; - QCString result=s; - if (result.left(7)=="struct ") result=result.right(result.length()-7); - if (result.left(6)=="class " ) result=result.right(result.length()-6); - if (result.left(6)=="union " ) result=result.right(result.length()-6); - int l=result.length()-1; - while (l>=0 && - (result.at(l)=='*' || result.at(l)==' ' || isspace(result.at(l))) - ) l--; - return removeRedundantWhiteSpace(result.left(l+1)); -} -#endif +//----------------------------------------------------------------------------- static void setContext() { @@ -483,6 +450,8 @@ static void setContext() //printf("setContext(%s) insideIDL=%d\n",yyFileName,insideIDL); } +//----------------------------------------------------------------------------- + static void prependScope() { if (current_root->section & Entry::SCOPE_MASK) @@ -516,6 +485,8 @@ static void prependScope() } } +//----------------------------------------------------------------------------- + /*! Returns TRUE iff the current entry could be a K&R style C function */ static bool checkForKnRstyleC() { @@ -532,6 +503,8 @@ static bool checkForKnRstyleC() return TRUE; } +//----------------------------------------------------------------------------- + static void splitKnRArg(QCString &oldStyleArgPtr,QCString &oldStyleArgName) { int si = current->args.length(); @@ -605,6 +578,8 @@ static void splitKnRArg(QCString &oldStyleArgPtr,QCString &oldStyleArgName) //fprintf(stderr,"type=%s ptr=%s name=%s\n",oldStyleArgType.data(),oldStyleArgPtr.data(),oldStyleArgName.data()); } +//----------------------------------------------------------------------------- + /*! Update the argument \a name with additional \a type info. For K&R style * function the type is found \e after the argument list, so this routine * in needed to fix up. @@ -930,6 +905,13 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] BEGIN( FindMembers ); } } +\' { + if (insidePHP) + { + lastStringContext=NextSemi; + BEGIN(SkipPHPString); + } + } {CHARLIT} { if (insidePHP) REJECT; } \" { lastStringContext=NextSemi; @@ -965,7 +947,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] else REJECT; } -{B}*("properties"|"__property"){BN}*":"{BN}* { // IDL or Borland C++ builder property +{B}*("properties"){BN}*":"{BN}* { // IDL or Borland C++ builder property current->mtype = mtype = Property; current->protection = protection = Public ; current->type.resize(0); @@ -1441,6 +1423,11 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] if (yytext[yyleng-1]=='{') unput('{'); BEGIN( CompoundName ) ; } +"("{BN}*")"({BN}*"<"[^>]*">"){BN}*/"(" { // A::operator()(int arg) + lineCount(); + current->name += "()"; + BEGIN( FindMembers ); + } "("{BN}*")"{BN}*/"(" { lineCount(); current->name += yytext ; @@ -2125,6 +2112,19 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] initBracketCount--; current->initializer+=*yytext; } +\' { + if (insidePHP) + { + current->initializer+=yytext; + pCopyQuotedString = ¤t->initializer; + lastStringContext=YY_START; + BEGIN(CopyPHPString); + } + else + { + current->initializer+=yytext; + } + } {CHARLIT} { if (insidePHP) { @@ -2218,6 +2218,19 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] yyLineNr++; *pCopyRoundString+=*yytext; } +\' { + if (insidePHP) + { + current->initializer+=yytext; + pCopyQuotedString = pCopyRoundString; + lastStringContext=YY_START; + BEGIN(CopyPHPString); + } + else + { + *pCopyRoundString+=yytext; + } + } {CHARLIT} { if (insidePHP) { @@ -2242,6 +2255,15 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] lastStringContext=YY_START; BEGIN(CopyString); } +\' { + *pCopyCurlyString+=*yytext; + if (insidePHP) + { + pCopyQuotedString=pCopyCurlyString; + lastStringContext=YY_START; + BEGIN(CopyPHPString); + } + } "{" { *pCopyCurlyString+=*yytext; curlyCount++; @@ -2439,6 +2461,19 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] lastContext = YY_START ; BEGIN( Comment ) ; } +"'" { + if (!insidePHP) + { + current->program += yytext; + } + else + { // begin of single quoted string + current->program += yytext; + pCopyQuotedString = ¤t->program; + lastStringContext=YY_START; + BEGIN(CopyPHPString); + } + } {CHARLIT} { if (insidePHP) { @@ -2699,19 +2734,6 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] insideObjC=FALSE; BEGIN( FindMembers ); } -"'" { - if (!insidePHP) - { - current->program += yytext; - } - else - { // begin of single quoted string - current->program += yytext; - pCopyQuotedString = ¤t->program; - lastStringContext=YY_START; - BEGIN(CopyPHPString); - } - } . { current->program += yytext ; } "("/({BN}*{TSCOPE}{BN}*"::")*{TSCOPE}{BN}*")"{BN}*"(" | /* typedef void (A::func_t)(args...) */ @@ -3155,6 +3177,15 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] lastStringContext=FuncPtrInit; BEGIN(CopyString); } +\' { + current->args += *yytext; + if (insidePHP) + { + pCopyQuotedString=¤t->args; + lastStringContext=FuncPtrInit; + BEGIN(CopyPHPString); + } + } {CHARLIT} { if (insidePHP) { @@ -3459,10 +3490,6 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current = tempEntry; BEGIN( lastCurlyContext ); } -{CHARLIT} { - //addToBody(yytext); - if (insidePHP) REJECT; - } \" { //addToBody(yytext); lastStringContext=SkipCurly; @@ -3526,6 +3553,13 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] pSkipVerbString=¤t->initializer; BEGIN(SkipVerbString); } +\' { + if (insidePHP) + { + lastStringContext=YY_START; + BEGIN(SkipPHPString); + } + } {CHARLIT} { if (insidePHP) REJECT; } @@ -4319,6 +4353,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->section = Entry::FILEDOC_SEC; current->fileName = yyFileName; current->startLine = yyLineNr; + lastFileDocContext = YY_START; BEGIN( FileDocArg1 ); } {B}*{CMD}"dir"{B}* { @@ -4406,7 +4441,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] "//" | "/*" | . { - addXRefItem("todo",theTranslator->trTodo(),theTranslator->trTodoList()); + addXRefItem(lastDocContext==SkipCurly, + "todo",theTranslator->trTodo(),theTranslator->trTodoList()); int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]); BEGIN(slStartContext); } @@ -4414,7 +4450,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] "//" | "/*" | . { - addXRefItem("test",theTranslator->trTest(),theTranslator->trTestList()); + addXRefItem(lastDocContext==SkipCurly, + "test",theTranslator->trTest(),theTranslator->trTestList()); int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]); BEGIN(slStartContext); } @@ -4422,7 +4459,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] "//" | "/*" | . { - addXRefItem("bug",theTranslator->trBug(),theTranslator->trBugList()); + addXRefItem(lastDocContext==SkipCurly, + "bug",theTranslator->trBug(),theTranslator->trBugList()); int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]); BEGIN(slStartContext); } @@ -4430,7 +4468,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] "//" | "/*" | . { - addXRefItem("deprecated",theTranslator->trDeprecated(),theTranslator->trDeprecatedList()); + addXRefItem(lastDocContext==SkipCurly, + "deprecated",theTranslator->trDeprecated(),theTranslator->trDeprecatedList()); int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]); BEGIN(slStartContext); } @@ -4469,7 +4508,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] "//" | "/*" | . { - addXRefItem(xrefItemKey,xrefItemTitle,xrefListTitle); + addXRefItem(lastDocContext==SkipCurly, + xrefItemKey,xrefItemTitle,xrefListTitle); int i;for (i=yyleng-1;i>=0;i--) unput(yytext[i]); BEGIN(slStartContext); } @@ -4649,6 +4689,14 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->name = yyFileName; yyLineNr++; newDocState(); + if (lastFileDocContext==LineDoc) + { + current->doc += "\n\n"; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); + BEGIN( FindMembers ); + } } {FILE} { current->name = stripQuotes(yytext); @@ -5734,25 +5782,10 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] } if (!handled) { - //QCString *pValue=Doxygen::aliasDict[yytext+1]; - //if (pValue) - //{ - // int i,l=pValue->length(); - // char c; - // for (i=l-1;i>=0;i--) - // { - // c=pValue->at(i); - // unput(c); - // if (c=='\n') yyLineNr--; - // } - //} - //else - //{ if (YY_START==CopyArgComment) fullArgString+=yytext; else current->doc+=yytext; - //} } } "\\"[a-z_A-Z][a-z_A-Z0-9]*[\\] { // directory type of text @@ -5766,22 +5799,10 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->brief+=yytext; } {CMD}[a-z_A-Z][a-z_A-Z0-9]* { - //QCString *pValue=Doxygen::aliasDict[yytext+1]; - //if (pValue) - //{ - // int i,l=pValue->length(); - // for (i=l-1;i>=0;i--) - // { - // unput(pValue->at(i)); - // } - //} - //else - //{ if (YY_START==CopyArgCommentLine) fullArgString+=yytext; else current->brief+=yytext; - //} } "/*"|"//" { current->doc += yytext; } .*/\n { diff --git a/src/util.cpp b/src/util.cpp index 77983bc..8f8c835 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3561,6 +3561,7 @@ bool resolveLink(/* in */ const char *scName, *resContext=0; QCString linkRef=lr; + printf("ResolveLink linkRef=%s\n",lr); FileDef *fd; GroupDef *gd; PageDef *pd; @@ -4704,7 +4705,7 @@ void addRefItem(const QList *sli, const char *prefix, const char *name,const char *title,const char *args) { - //printf("addRefItem(prefix=%s,name=%s,title=%s,args=%s)\n",prefix,name,title,args); + //printf("addRefItem(sli=%p,prefix=%s,name=%s,title=%s,args=%s)\n",sli,prefix,name,title,args); if (sli) { QListIterator slii(*sli); @@ -4724,7 +4725,7 @@ void addRefItem(const QList *sli, { RefItem *item = refList->getRefItem(lii->itemId); ASSERT(item!=0); - //printf("anchor=%s\n",item->listAnchor.data()); + //printf("anchor=%s written=%d\n",item->listAnchor.data(),item->written); if (item->written) return; QCString doc(1000); -- cgit v0.12