diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-08-26 14:15:46 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-08-26 14:15:46 (GMT) |
commit | c822eb3d9ce727dd69954661edcabcad479c1481 (patch) | |
tree | 9acee8d8d8b91289eb8173fd93a8f16891fc2a92 /src | |
parent | 2f7902073680b977b74f3faeada95119ec767eb3 (diff) | |
download | Doxygen-c822eb3d9ce727dd69954661edcabcad479c1481.zip Doxygen-c822eb3d9ce727dd69954661edcabcad479c1481.tar.gz Doxygen-c822eb3d9ce727dd69954661edcabcad479c1481.tar.bz2 |
Release-1.2.10
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 10 | ||||
-rw-r--r-- | src/classdef.h | 4 | ||||
-rw-r--r-- | src/classlist.cpp | 8 | ||||
-rw-r--r-- | src/doc.l | 43 | ||||
-rw-r--r-- | src/doxygen.cpp | 23 | ||||
-rw-r--r-- | src/htmlgen.cpp | 24 | ||||
-rw-r--r-- | src/htmlgen.h | 2 | ||||
-rw-r--r-- | src/index.cpp | 1 | ||||
-rw-r--r-- | src/latexgen.h | 2 | ||||
-rw-r--r-- | src/mangen.cpp | 2 | ||||
-rw-r--r-- | src/mangen.h | 2 | ||||
-rw-r--r-- | src/memberdef.cpp | 20 | ||||
-rw-r--r-- | src/outputgen.h | 2 | ||||
-rw-r--r-- | src/outputlist.h | 8 | ||||
-rw-r--r-- | src/rtfgen.cpp | 2 | ||||
-rw-r--r-- | src/rtfgen.h | 2 | ||||
-rw-r--r-- | src/scanner.l | 82 | ||||
-rw-r--r-- | src/util.cpp | 84 | ||||
-rw-r--r-- | src/xmlgen.cpp | 51 |
19 files changed, 228 insertions, 144 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index ebb22e4..54f78e4 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -104,6 +104,7 @@ ClassDef::ClassDef( m_templBaseClassNames = 0; m_artificial = FALSE; m_isAbstract = FALSE; + m_isStatic = FALSE; } // destroy the class definition @@ -1073,9 +1074,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (exampleFlag) { ol.startDescList(BaseOutputDocInterface::Examples); - ol.startBold(); parseText(ol,theTranslator->trExamples()+": "); - ol.endBold(); ol.endDescTitle(); ol.writeDescItem(); ol.newParagraph(); @@ -1546,7 +1545,8 @@ bool ClassDef::isLinkableInProject() const name().find('@')==-1 && /* anonymous compound */ (m_prot!=Private || Config_getBool("EXTRACT_PRIVATE")) && /* private */ hasDocumentation() && /* documented */ - !isReference(); /* not an external reference */ + !isReference() && /* not an external reference */ + (!m_isStatic || Config_getBool("EXTRACT_STATIC")); } } @@ -1578,7 +1578,9 @@ bool ClassDef::isVisibleInHierarchy() (hasDocumentation() || !Config_getBool("HIDE_UNDOC_CLASSES") || isReference() - ); + ) && + // is not part of an unnamed namespace or shown anyway + (!m_isStatic || Config_getBool("EXTRACT_STATIC")); } bool ClassDef::hasDocumentation() const diff --git a/src/classdef.h b/src/classdef.h index 51d0112..d31d99b 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -270,6 +270,7 @@ class ClassDef : public Definition void setTemplateMaster(ClassDef *tm) { m_templateMaster=tm; } void addMembersToTemplateInstance(ClassDef *cd,const char *templSpec); void setClassIsArtificial() { m_artificial = TRUE; } + void setIsStatic(bool b) { m_isStatic=b; } /*! Creates a new compound definition. * \param outerScope class, file or namespace in which this class is @@ -401,6 +402,9 @@ class ClassDef : public Definition bool m_isAbstract; QCString m_className; + + /*! Is the class part of an unnamed namespace? */ + bool m_isStatic; }; /*! \brief Class that contains information about a usage relation. diff --git a/src/classlist.cpp b/src/classlist.cpp index 7c69d73..3772ae5 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -35,8 +35,8 @@ int ClassList::compareItems(GCI item1, GCI item2) { ClassDef *c1=(ClassDef *)item1; ClassDef *c2=(ClassDef *)item2; - return stricmp(c1->name().data()+getPrefixIndex(c1->localName()), - c2->name().data()+getPrefixIndex(c2->localName()) + return stricmp(c1->localName().data()+getPrefixIndex(c1->localName()), + c2->localName().data()+getPrefixIndex(c2->localName()) ); } @@ -44,8 +44,8 @@ int ClassSDict::compareItems(GCI item1, GCI item2) { ClassDef *c1=(ClassDef *)item1; ClassDef *c2=(ClassDef *)item2; - return stricmp(c1->name().data()+getPrefixIndex(c1->localName()), - c2->name().data()+getPrefixIndex(c2->localName()) + return stricmp(c1->localName().data()+getPrefixIndex(c1->localName()), + c2->localName().data()+getPrefixIndex(c2->localName()) ); } @@ -1170,9 +1170,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inParBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Par); - outDoc->startBold(); outDoc->docify(title); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1190,9 +1188,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inWarningBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Warning); - outDoc->startBold(); scanString(theTranslator->trWarning()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1209,9 +1205,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inRemarkBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Remark); - outDoc->startBold(); scanString(theTranslator->trRemarks()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1228,9 +1222,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inAttentionBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Attention); - outDoc->startBold(); scanString(theTranslator->trAttention()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1247,9 +1239,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inNoteBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Note); - outDoc->startBold(); scanString(theTranslator->trNote()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1266,9 +1256,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inPreBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Pre); - outDoc->startBold(); scanString(theTranslator->trPrecondition()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1285,9 +1273,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inPostBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Post); - outDoc->startBold(); scanString(theTranslator->trPostcondition()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1304,9 +1290,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inInvarBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Invar); - outDoc->startBold(); scanString(theTranslator->trInvariant()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1323,9 +1307,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inVersionBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Version); - outDoc->startBold(); scanString(theTranslator->trVersion()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1342,9 +1324,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inSinceBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Since); - outDoc->startBold(); scanString(theTranslator->trSince()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1361,9 +1341,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inDateBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Date); - outDoc->startBold(); scanString(theTranslator->trDate()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1384,9 +1362,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Todo); - outDoc->startBold(); outDoc->writeObjectLink(0,"todo",item->listAnchor,theTranslator->trTodo()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); internalParseDocument(item->text); @@ -1406,9 +1382,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Test); - outDoc->startBold(); outDoc->writeObjectLink(0,"test",item->listAnchor,theTranslator->trTest()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); internalParseDocument(item->text); @@ -1428,9 +1402,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Bug); - outDoc->startBold(); outDoc->writeObjectLink(0,"bug",item->listAnchor,theTranslator->trBug()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); internalParseDocument(item->text); @@ -1446,9 +1418,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inDeprecatedBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Deprecated); - outDoc->startBold(); scanString(theTranslator->trDeprecated()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1467,9 +1437,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) if (inBlock()) endBlock(); currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::RCS); - outDoc->startBold(); scanString(tagName+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); scanString(tagText); @@ -1484,10 +1452,8 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inAuthorBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Author); - outDoc->startBold(); bool singular = ((QString)yytext).find('s')==-1; scanString(theTranslator->trAuthor(TRUE,singular)+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1504,9 +1470,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inReturnBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::Return); - outDoc->startBold(); scanString(theTranslator->trReturns()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -1519,9 +1483,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) inSeeBlock=TRUE; currentListIndent.push("D"); outDoc->startDescList(BaseOutputDocInterface::See); - outDoc->startBold(); scanString(theTranslator->trSeeAlso()+": "); - outDoc->endBold(); outDoc->endDescTitle(); outDoc->writeDescItem(); } @@ -2420,6 +2382,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) addListItemMarker(yytext,dashPos+1,isEnumerated); } <DocScan>({B}*"\n"){2,}{B}* { // new paragraph + bool ib = inBlock(); if (insideArgumentList) { insideArgumentList=FALSE; @@ -2435,12 +2398,12 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) { outDoc->docify(yytext); } - else + else if (!ib) { outDoc->newParagraph(); } } - if (inBlock()) endBlock(); + if (ib) endBlock(); } <DocScan>{BN}+/\n { outDoc->writeChar(' '); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index b0d7dab..f19f411 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -888,6 +888,7 @@ static void buildClassList(Entry *root) cd->setTemplateArguments(tArgList); cd->setProtection(root->protection); cd->addSectionsToDefinition(root->anchors); + cd->setIsStatic(root->stat); // file definition containing the class cd cd->setBodySegment(root->bodyLine,root->endBodyLine); @@ -2677,14 +2678,20 @@ static bool findTemplateInstanceRelation(Entry *root, // search for new template instances caused by base classes of // instanceClass Entry *templateRoot = classEntries.find(templateClass->name()); + if (templateRoot) + { + ArgumentList *templArgs = new ArgumentList; + stringToArgumentList(templSpec,templArgs); + findBaseClassesForClass(templateRoot,templateClass,instanceClass, + TemplateInstances,isArtificial,templArgs,templateNames); - ArgumentList *templArgs = new ArgumentList; - stringToArgumentList(templSpec,templArgs); - findBaseClassesForClass(templateRoot,templateClass,instanceClass, - TemplateInstances,isArtificial,templArgs,templateNames); - - findUsedClassesForClass(templateRoot,templateClass,instanceClass, - isArtificial,templArgs,templateNames); + findUsedClassesForClass(templateRoot,templateClass,instanceClass, + isArtificial,templArgs,templateNames); + } + else + { + // TODO: what happened if we get here? + } //Debug::print(Debug::Classes,0," Template instance %s : \n",instanceClass->name().data()); //ArgumentList *tl = templateClass->templateArguments(); @@ -7132,7 +7139,7 @@ void parseInput() msg("Adding source references...\n"); addSourceReferences(); - msg("Adding todo/test/bug list item...\n"); + msg("Adding todo/test/bug list items...\n"); addTodoTestBugReferences(); } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 568906a..31c24fc 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -49,7 +49,8 @@ static const char *defaultStyleSheet = "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }\n" "DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\n" "TD.md { background-color: #f2f2ff; font-weight: bold; }\n" - "TD.mdname { background-color: #f2f2ff; font-weight: bold; font-style: italic }\n" + "TD.mdname1 { background-color: #f2f2ff; font-weight: bold; font-style: italic; }\n" + "TD.mdname { background-color: #f2f2ff; font-weight: bold; font-style: italic; width: 600px; }\n" "DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }\n" "DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }\n" "FONT.keyword { color: #008000 }\n" @@ -911,7 +912,7 @@ void HtmlGenerator::startMemberDocPrefixItem() void HtmlGenerator::endMemberDocPrefixItem() { DBG_HTML(t << "<!-- endMemberDocPrefixItem -->" << endl;) - t << " </td>" << endl; + t << "</td>" << endl; t << " </tr>" << endl; } @@ -919,14 +920,13 @@ void HtmlGenerator::startMemberDocName() { DBG_HTML(t << "<!-- startMemberDocName -->" << endl;) t << " <tr>" << endl; - t << " <td class=\"md\" nowrap valign=\"top\"> " << endl; + t << " <td class=\"md\" nowrap valign=\"top\"> "; } void HtmlGenerator::endMemberDocName() { DBG_HTML(t << "<!-- endMemberDocName -->" << endl;) - t << endl; - t << " </td>" << endl; + t << "</td>" << endl; } void HtmlGenerator::startParameterList() @@ -955,13 +955,15 @@ void HtmlGenerator::startParameterType(bool first) void HtmlGenerator::endParameterType() { DBG_HTML(t << "<!-- endParameterType -->" << endl;) - t << " </td>" << endl; + t << "</td>" << endl; } -void HtmlGenerator::startParameterName() +void HtmlGenerator::startParameterName(bool oneArgOnly) { DBG_HTML(t << "<!-- startParameterName -->" << endl;) - t << " <td class=\"mdname\">"; + t << " <td class=\"mdname"; + if (oneArgOnly) t << "1"; + t << "\"> "; } void HtmlGenerator::endParameterName(bool last,bool emptyList) @@ -977,7 +979,7 @@ void HtmlGenerator::endParameterName(bool last,bool emptyList) } else { - t << " </td>" << endl; + t << "</td>" << endl; t << " </tr>" << endl; t << " <tr>" << endl; t << " <td></td>" << endl; @@ -987,7 +989,7 @@ void HtmlGenerator::endParameterName(bool last,bool emptyList) } else { - t << " </td>" << endl; + t << "</td>" << endl; t << " </tr>" << endl; } } @@ -995,7 +997,7 @@ void HtmlGenerator::endParameterName(bool last,bool emptyList) void HtmlGenerator::endParameterList() { DBG_HTML(t << "<!-- endParameterList -->" << endl;) - t << " </td>" << endl; + t << "</td>" << endl; t << " </tr>" << endl; } diff --git a/src/htmlgen.h b/src/htmlgen.h index dd58281..cbc40f1 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -236,7 +236,7 @@ class HtmlGenerator : public OutputGenerator void endMemberDocName(); void startParameterType(bool first); void endParameterType(); - void startParameterName(); + void startParameterName(bool); void endParameterName(bool last,bool emptyList); void startParameterList(); void endParameterList(); diff --git a/src/index.cpp b/src/index.cpp index d1ea611..5124dd9 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1285,6 +1285,7 @@ void writeAlphabeticalClassList(OutputList &ol) { QCString cname; QCString namesp; + if (cd->getNamespaceDef()) namesp=cd->getNamespaceDef()->name(); if (Config_getBool("HIDE_SCOPE_NAMES")) { cname=cd->displayName(); diff --git a/src/latexgen.h b/src/latexgen.h index c527e6f..3b09340 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -243,7 +243,7 @@ class LatexGenerator : public OutputGenerator void endMemberDocName() {} void startParameterType(bool) {} void endParameterType() {} - void startParameterName() {} + void startParameterName(bool) {} void endParameterName(bool,bool) {} void startParameterList() {} void endParameterList() {} diff --git a/src/mangen.cpp b/src/mangen.cpp index b721a44..9c06dc0 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -316,6 +316,7 @@ void ManGenerator::startDescList(SectionTypes) col=0; } paragraph=FALSE; + startBold(); } void ManGenerator::startParamList(ParamListTypes) @@ -458,6 +459,7 @@ void ManGenerator::startDescItem() void ManGenerator::endDescTitle() { + endBold(); paragraph=TRUE; } diff --git a/src/mangen.h b/src/mangen.h index 30fdea0..5ce5a7c 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -224,7 +224,7 @@ class ManGenerator : public OutputGenerator void endMemberDocName() {} void startParameterType(bool) {} void endParameterType() {} - void startParameterName() {} + void startParameterName(bool) {} void endParameterName(bool,bool) {} void startParameterList() {} void endParameterList() {} diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 4341c52..8aaa7cc 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -119,7 +119,7 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, bool first=TRUE; while (a) { - if (!md->isDefine() || first) ol.startParameterType(first); + if (md->isDefine() || first) ol.startParameterType(first); QRegExp re(")("); int vp; if (!a->attrib.isEmpty()) // argument has an IDL attribute @@ -141,7 +141,7 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, if (!md->isDefine()) { ol.endParameterType(); - ol.startParameterName(); + ol.startParameterName(argList->count()<2); } if (!a->name.isEmpty()) // argument has a name { @@ -191,13 +191,13 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, ol.disableAllBut(OutputGenerator::Html); if (!md->isDefine()) { - if (first) ol.startParameterName(); + if (first) ol.startParameterName(argList->count()<2); ol.endParameterName(TRUE,argList->count()<2); } else { ol.endParameterType(); - ol.startParameterName(); + ol.startParameterName(TRUE); ol.endParameterName(TRUE,TRUE); } ol.popGeneratorState(); @@ -260,7 +260,7 @@ MemberDef::MemberDef(const char *df,int dl, const ArgumentList *tal,const ArgumentList *al ) : Definition(df,dl,na) { - //printf("++++++ MemberDef(%s file=%s,line=%d) ++++++ \n",na,df,dl); + //printf("++++++ MemberDef(%s file=%s,line=%d static=%d) ++++++ \n",na,df,dl,s); classDef=0; fileDef=0; redefines=0; @@ -884,10 +884,8 @@ bool MemberDef::isDetailedSectionLinkable() const (mtype==EnumValue && !briefDescription().isEmpty()) || // has brief description that is part of the detailed description (!briefDescription().isEmpty() && - (!Config_getBool("BRIEF_MEMBER_DESC") || - Config_getBool("ALWAYS_DETAILED_SEC")) && - Config_getBool("REPEAT_BRIEF" - ) + Config_getBool("ALWAYS_DETAILED_SEC") && + Config_getBool("REPEAT_BRIEF") ) || // has a multi-line initialization block //(initLines>0 && initLines<maxInitLines) || @@ -1247,10 +1245,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, { //ol.newParagraph(); ol.startDescList(BaseOutputDocInterface::EnumValues); - ol.startBold(); parseText(ol,theTranslator->trEnumerationValues()); ol.docify(":"); - ol.endBold(); ol.endDescTitle(); ol.writeDescItem(); //ol.startItemList(); @@ -1444,10 +1440,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (hasExamples()) { ol.startDescList(BaseOutputDocInterface::Examples); - ol.startBold(); parseText(ol,theTranslator->trExamples()+": "); //ol.writeBoldString("Examples: "); - ol.endBold(); ol.endDescTitle(); ol.writeDescItem(); writeExample(ol,getExamples()); diff --git a/src/outputgen.h b/src/outputgen.h index 8818a3e..4b60bbd 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -369,7 +369,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endMemberDocName() = 0; virtual void startParameterType(bool) = 0; virtual void endParameterType() = 0; - virtual void startParameterName() = 0; + virtual void startParameterName(bool) = 0; virtual void endParameterName(bool,bool) = 0; virtual void startParameterList() = 0; virtual void endParameterList() = 0; diff --git a/src/outputlist.h b/src/outputlist.h index 96e07aa..3cc0b44 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -407,10 +407,10 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startParameterType,first); } void endParameterType() { forall(&OutputGenerator::endParameterType); } - void startParameterName() - { forall(&OutputGenerator::startParameterName); } - void endParameterName(bool last,bool emptyList) - { forall(&OutputGenerator::endParameterName,last,emptyList); } + void startParameterName(bool one) + { forall(&OutputGenerator::startParameterName,one); } + void endParameterName(bool last,bool one) + { forall(&OutputGenerator::endParameterName,last,one); } void startParameterList() { forall(&OutputGenerator::startParameterList); } void endParameterList() diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index e912f26..1831072 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1931,11 +1931,13 @@ void RTFGenerator::startDescList(SectionTypes) DBG_RTF(t << "{\\comment (startDescList)}" << endl) t << "{"; newParagraph(); + startBold(); } void RTFGenerator::endDescTitle() { DBG_RTF(t << "{\\comment (endDescTitle) }" << endl) + endBold(); newParagraph(); //t << Rtf_Style_Reset << styleStack.top(); incrementIndentLevel(); diff --git a/src/rtfgen.h b/src/rtfgen.h index 6e1209d..ce1b71d 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -227,7 +227,7 @@ class RTFGenerator : public OutputGenerator void endMemberDocName() {} void startParameterType(bool) {} void endParameterType() {} - void startParameterName() {} + void startParameterName(bool) {} void endParameterName(bool,bool) {} void startParameterList() {} void endParameterList() {} diff --git a/src/scanner.l b/src/scanner.l index 6d49da4..65e50b6 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -22,7 +22,6 @@ */ #include <stdio.h> #include <stdlib.h> -//#include <iostream.h> #include <assert.h> #include <ctype.h> @@ -147,10 +146,12 @@ static Grouping lastDefGroup( "", Grouping::GROUPING_LOWEST ); static bool insideFormula; static bool insideTryBlock=FALSE; +static bool needsSemi; static int depthIf; static int initializerSharpCount; + //----------------------------------------------------------------------------- static void initParser() @@ -600,6 +601,7 @@ TITLE [tT][iI][tT][lL][eE] <*>\x0d <NextSemi>"{" { curlyCount=0; + needsSemi = TRUE; BEGIN(SkipCurlyBlock); } <NextSemi>"(" { @@ -623,8 +625,14 @@ TITLE [tT][iI][tT][lL][eE] { --curlyCount ; } - else + else if (needsSemi) + { BEGIN( NextSemi ); + } + else + { + BEGIN( FindMembers ); + } } <NextSemi>"'"\\[0-7]{1,3}"'" <NextSemi>"'"\\."'" @@ -848,7 +856,8 @@ TITLE [tT][iI][tT][lL][eE] lineCount() ; BEGIN( CompoundName ) ; } -<FindMembers>{B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"struct"{BN}+ { +<FindMembers>{B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"struct{" | +<FindMembers>{B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"struct"/{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::STRUCT_SEC ; addType( current ) ; @@ -868,6 +877,7 @@ TITLE [tT][iI][tT][lL][eE] lineCount() ; BEGIN( CompoundName ) ; } +<FindMembers>{B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"union{" | <FindMembers>{B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"union"{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::UNION_SEC ; @@ -879,6 +889,7 @@ TITLE [tT][iI][tT][lL][eE] lineCount() ; BEGIN( CompoundName ) ; } +<FindMembers>{B}*(("typedef"{BN}+)?)"enum{" | <FindMembers>{B}*(("typedef"{BN}+)?)"enum"{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::ENUM_SEC ; @@ -2152,23 +2163,16 @@ TITLE [tT][iI][tT][lL][eE] current->name=current->name.simplifyWhiteSpace(); current->type=current->type.simplifyWhiteSpace(); current->args=current->args.simplifyWhiteSpace(); - QCString &cn=current->name; - QCString &rn=current_root->name; - //printf("current_root->name=`%s'\n",rn.data()); - //printf("Function: `%s' `%s' `%s'\n",current->type.data(),cn.data(),current->args.data()); - int i; - if ((i=cn.findRev("::"))!=-1) // name contains scope - { - if (cn.left(i)==rn.right(i)) // scope name is redundant - { - cn=cn.right(cn.length()-i-2); // strip scope - //printf("new name=`%s'\n",cn.data()); - } - } - //if (cname.left(current_root->name.length()+2)==current_root->name+"::") - //{ // strip redundant scope - // current->name=current->name.right(current->name.length()-current_root->name.length()-2); - // printf("new name=`%s'\n",current->name.data()); + //QCString &cn=current->name; + //QCString &rn=current_root->name; + //int i; + //if ((i=cn.findRev("::"))!=-1) // name contains scope + //{ + // if (cn.left(i)==rn.right(i)) // scope name is redundant + // { + // cn=cn.right(cn.length()-i-2); // strip scope + // //printf("new name=`%s'\n",cn.data()); + // } //} current->fileName = yyFileName; current->startLine = yyLineNr; @@ -2211,8 +2215,7 @@ TITLE [tT][iI][tT][lL][eE] current->proto = TRUE; } } - //printf("Adding entry `%s' inLine`%d' bodyLine=`%d'\n", - // current->name.data(),current->inLine,current->bodyLine); + //printf("Adding entry `%s'\n",current->name.data()); previous = current; current_root->addSubEntry(current); current = new Entry ; @@ -2470,7 +2473,9 @@ TITLE [tT][iI][tT][lL][eE] current->startLine = yyLineNr ; current->name = removeRedundantWhiteSpace(current->name); if (current->name.isEmpty() && !isTypedef) // anonymous compound + { current->name.sprintf("@%d",anonCount++); + } curlyCount=0; BEGIN( ReadBody ) ; } @@ -2652,9 +2657,18 @@ TITLE [tT][iI][tT][lL][eE] lineCount(); } <FindMembers>"{" { - current->type.resize(0); - current->name.resize(0); - current->args.resize(0); + if (insideJava && current->stat && current->name.isEmpty() && current->type.isEmpty()) + { + // static Java initializer + needsSemi = FALSE; + } + else + { + needsSemi = TRUE; + } + current->type.resize(0); + current->name.resize(0); + current->args.resize(0); current->argList->clear(); curlyCount=0; BEGIN( SkipCurlyBlock ); @@ -4024,18 +4038,32 @@ static void parseCompounds(Entry *rt) //printf("---> Inner block starts at line %d\n",yyLineNr); //current->reset(); current = new Entry; + gstat = FALSE; + int ni=ce->name.findRev("::"); if (ni==-1) ni=0; else ni+=2; // set default protection based on the compound type if( ce->section==Entry::CLASS_SEC ) // class + { current->protection = protection = Private ; + } else if (ce->section == Entry::ENUM_SEC ) // enum + { current->protection = protection = ce->protection; - else if (!ce->name.isEmpty() && ce->name.at(0)=='@') // anonymous union + } + else if (!ce->name.isEmpty() && ce->name.at(ni)=='@') // unnamed union or namespace + { + if (ce->section == Entry::NAMESPACE_SEC ) // unnamed namespace + { + current->stat = gstat = TRUE; + } current->protection = protection = ce->protection; + } else // named struct, union, or interface + { current->protection = protection = Public ; + } mtype = Method; - gstat = FALSE; virt = Normal; + //printf("name=%s current->stat=%d gstat=%d\n",ce->name.data(),current->stat,gstat); memberGroupId = NOGROUP; diff --git a/src/util.cpp b/src/util.cpp index 24cfa66..95193f7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -243,9 +243,11 @@ QCString replaceAnonymousScopes(const QCString &s) // strip annonymous left hand side part of the scope QCString stripAnonymousNamespaceScope(const QCString &s) { +#if 0 int oi=0,i=0,p=0; - if (s.isEmpty()) return s; - while (s.at(p)=='@' && (i=s.find("::",p))!=-1 && + p=s.find('@'); + if (p==-1) return s; + while (s.at(p)=='@' && (i=s.find("::@",p))!=-1 && Doxygen::namespaceDict[s.left(i)]!=0) { oi=i; p=i+2; } if (oi==0) { @@ -257,6 +259,32 @@ QCString stripAnonymousNamespaceScope(const QCString &s) //printf("stripAnonymousNamespaceScope(`%s')=`%s'\n",s.data(),s.right(s.length()-oi-2).data()); return s.right(s.length()-oi-2); } +#endif + + int i,p=0,l; + QCString newScope; + while ((i=getScopeFragment(s,p,&l))!=-1) + { + //printf("Scope fragment %s\n",s.mid(i,l).data()); + if (Doxygen::namespaceDict[s.left(i+l)]!=0) + { + if (s.at(i)!='@') + { + if (!newScope.isEmpty()) newScope+="::"; + newScope+=s.mid(i,l); + } + } + else + { + if (!newScope.isEmpty()) newScope+="::"; + newScope+=s.right(s.length()-i); + goto done; + } + p=i+l; + } +done: + //printf("stripAnonymousNamespaceScope(`%s')=`%s'\n",s.data(),newScope.data()); + return newScope; } void writePageRef(OutputDocInterface &od,const char *cn,const char *mn) @@ -1134,7 +1162,7 @@ void trimBaseClassScope(BaseClassList *bcl,QCString &s,int level=0) * scope. If neither or both have a namespace scope, t1 and t2 remain * unchanged. */ -static void trimNamespaceScope(QCString &t1,QCString &t2) +static void trimNamespaceScope(QCString &t1,QCString &t2,const QCString &nsName) { int p1=t1.length(); int p2=t2.length(); @@ -1149,20 +1177,54 @@ static void trimNamespaceScope(QCString &t1,QCString &t2) if (i1!=-1 && i2==-1) // only t1 has a scope { QCString scope=t1.left(i1); - if (!scope.isEmpty() && Doxygen::namespaceDict[scope]!=0) // scope is a namespace + + int so=nsName.length(); + do { - t1 = t1.right(t1.length()-i1-2); - return; + QCString fullScope=nsName.left(so); + if (!fullScope.isEmpty() && !scope.isEmpty()) fullScope+="::"; + fullScope+=scope; + if (!fullScope.isEmpty() && Doxygen::namespaceDict[fullScope]!=0) // scope is a namespace + { + t1 = t1.right(t1.length()-i1-2); + return; + } + if (so==0) + { + so=-1; + } + else if ((so=nsName.findRev("::",so-1))==-1) + { + so=0; + } } + while (so>=0); } else if (i1==-1 && i2!=-1) // only t2 has a scope { QCString scope=t2.left(i2); - if (!scope.isEmpty() && Doxygen::namespaceDict[scope]!=0) // scope is a namespace + + int so=nsName.length(); + do { - t2 = t2.right(t2.length()-i2-2); - return; + QCString fullScope=nsName.left(so); + if (!fullScope.isEmpty() && !scope.isEmpty()) fullScope+="::"; + fullScope+=scope; + if (!fullScope.isEmpty() && Doxygen::namespaceDict[fullScope]!=0) // scope is a namespace + { + t2 = t2.right(t2.length()-i2-2); + return; + } + if (so==0) + { + so=-1; + } + else if ((so=nsName.findRev("::",so-1))==-1) + { + so=0; + } } + while (so>=0); } p1 = QMAX(i1-2,0); p2 = QMAX(i2-2,0); @@ -1297,7 +1359,7 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, // remove a namespace scope that is only in one type // (assuming a using statement was used) - trimNamespaceScope(srcAType,dstAType); + trimNamespaceScope(srcAType,dstAType,namespaceName); //QCString srcScope; //QCString dstScope; @@ -1521,7 +1583,7 @@ static void mergeArgument(Argument *srcA,Argument *dstA, // remove a namespace scope that is only in one type // (assuming a using statement was used) - trimNamespaceScope(srcAType,dstAType); + trimNamespaceScope(srcAType,dstAType,namespaceName); //QCString srcScope; diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 7c9b09d..f18c2f3 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -68,20 +68,16 @@ static inline void writeXMLString(QTextStream &t,const char *s) } static void writeXMLLink(QTextStream &t,const char *compoundId, - const char *memId,const char *text) + const char *anchorId,const char *text) { - if (memId==0) + t << "<ref idref=\"" << compoundId << "\""; + if (anchorId) { - t << "<compoundref idref=\"" << compoundId << "\">"; - writeXMLString(t,text); - t << "</compoundref>"; - } - else - { - t << "<memberref idref=\"" << compoundId << "_1" << memId << "\">"; - writeXMLString(t,text); - t << "</memberref>"; + t << " anchor=\"" << anchorId << "\""; } + t << ">"; + writeXMLString(t,text); + t << "</ref>"; } class TextGeneratorXMLImpl : public TextGeneratorIntf @@ -218,11 +214,13 @@ class XMLGenerator : public OutputDocInterface } void startItemList() { + startParMode(); m_t << "<itemizedlist>" << endl;; m_inListStack.push(TRUE); } void startEnumList() { + startParMode(); m_t << "<orderedlist>"; m_inListStack.push(TRUE); } @@ -295,7 +293,7 @@ class XMLGenerator : public OutputDocInterface } void startCodeFragment() { - endParMode(); + startParMode(); m_t << "<programlisting>"; } void endCodeFragment() @@ -304,7 +302,7 @@ class XMLGenerator : public OutputDocInterface } void startPreFragment() { - endParMode(); + startParMode(); m_t << "<programlisting>"; } void endPreFragment() @@ -313,11 +311,12 @@ class XMLGenerator : public OutputDocInterface } void writeRuler() { - endParMode(); + startParMode(); m_t << "<hruler/>"; } void startDescription() { + startParMode(); m_t << "<variablelist>"; m_inListStack.push(TRUE); } @@ -351,6 +350,7 @@ class XMLGenerator : public OutputDocInterface } void startDescList(SectionTypes st) { + startParMode(); m_t << "<simplesect kind=\"" << sectionTypeToString(st); m_t << "\"><title>"; } @@ -361,6 +361,7 @@ class XMLGenerator : public OutputDocInterface } void startParamList(ParamListTypes t) { + startParMode(); QCString kind; switch(t) { @@ -380,7 +381,6 @@ class XMLGenerator : public OutputDocInterface { m_t << "</title>"; if (!m_inParamList) startNestedPar(); - printf("endDescTitle %d\n",m_inParamList); } void writeDescItem() { } void startDescTable() { } @@ -405,11 +405,12 @@ class XMLGenerator : public OutputDocInterface } void lineBreak() { + startParMode(); m_t << "<linebreak/>"; // non docbook } void writeNonBreakableSpace(int num) { - int i;for (i=0;i<num;i++) m_t << "<nonbreakablespace/>"; // non docbook + int i;for (i=0;i<num;i++) m_t << " "; } //// TODO: translate these as well.... @@ -440,6 +441,7 @@ class XMLGenerator : public OutputDocInterface } void startHtmlLink(const char *url) { + startParMode(); m_t << "<ulink url=\"" << url << "\">"; } void endHtmlLink() @@ -448,6 +450,7 @@ class XMLGenerator : public OutputDocInterface } void writeMailLink(const char *url) { + startParMode(); m_t << "<email>"; docify(url); m_t << "</email>"; @@ -478,6 +481,7 @@ class XMLGenerator : public OutputDocInterface } void startCenter() { + startParMode(); m_t << "<center>"; // non docbook } void endCenter() @@ -486,6 +490,7 @@ class XMLGenerator : public OutputDocInterface } void startSmall() { + startParMode(); m_t << "<small>"; // non docbook } void endSmall() @@ -494,6 +499,7 @@ class XMLGenerator : public OutputDocInterface } void startSubscript() { + startParMode(); m_t << "<subscript>"; } void endSubscript() @@ -502,6 +508,7 @@ class XMLGenerator : public OutputDocInterface } void startSuperscript() { + startParMode(); m_t << "<superscript>"; } void endSuperscript() @@ -510,6 +517,7 @@ class XMLGenerator : public OutputDocInterface } void startTable(int cols) { + startParMode(); m_t << "<table><tgroup cols=\"" << cols << "\"><tbody>\n"; } void endTable() @@ -554,11 +562,13 @@ class XMLGenerator : public OutputDocInterface } void writeAnchor(const char *id,const char *name) { + startParMode(); m_t << "<anchor id=\"" << id << "_" << name << "\"/>"; } void writeSectionRef(const char *,const char *id, const char *name,const char *text) { + startParMode(); m_t << "<link linkend=\"" << id << "_" << name << "\">"; docify(text); m_t << "</link>"; @@ -569,6 +579,7 @@ class XMLGenerator : public OutputDocInterface } void addIndexItem(const char *primaryie,const char *secondaryie) { + startParMode(); m_t << "<indexentry><primaryie>"; docify(primaryie); m_t << "</primaryie><secondaryie>"; @@ -577,12 +588,14 @@ class XMLGenerator : public OutputDocInterface } void writeFormula(const char *id,const char *text) { + startParMode(); m_t << "<formula id=\"" << id << "\">"; // non Docbook docify(text); m_t << "</formula>"; } void startImage(const char *name,const char *size,bool caption) { + startParMode(); m_t << "<image name=\"" << name << "\" size=\"" << size << "\" caption=\"" << (caption ? "1" : "0") << "\">"; // non docbook } @@ -592,6 +605,7 @@ class XMLGenerator : public OutputDocInterface } void startDotFile(const char *name,bool caption) { + startParMode(); m_t << "<dotfile name=\"" << name << "\" " << "caption=\"" << (caption ? "1" : "0") << "\">"; // non docbook } @@ -601,6 +615,7 @@ class XMLGenerator : public OutputDocInterface } void startTextLink(const char *name,const char *anchor) { + startParMode(); m_t << "<ulink url=\"" << name << "#" << anchor << "\">"; } void endTextLink() @@ -615,6 +630,7 @@ class XMLGenerator : public OutputDocInterface } void startCodeLine() { + startParMode(); m_t << "<linenumber>"; // non DocBook } void endCodeLine() @@ -623,6 +639,7 @@ class XMLGenerator : public OutputDocInterface } void startCodeAnchor(const char *id) { + startParMode(); m_t << "<anchor id=\"" << id << "\">"; } void endCodeAnchor() @@ -631,7 +648,7 @@ class XMLGenerator : public OutputDocInterface } void startFontClass(const char *colorClass) { - m_t << "<highlight class=\"" << colorClass << "\""; // non DocBook + m_t << "<highlight class=\"" << colorClass << "\">"; // non DocBook } void endFontClass() { |