summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-02-01 13:59:42 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-02-01 13:59:42 (GMT)
commit8fda55cdfe71d9e23407169499e918478161328d (patch)
tree95791f3a49cf176781e5089ddcf643f2aa8e93a1 /src
parentdaa0336ab06f76a07f59499cbc47fd919073749d (diff)
downloadDoxygen-8fda55cdfe71d9e23407169499e918478161328d.zip
Doxygen-8fda55cdfe71d9e23407169499e918478161328d.tar.gz
Doxygen-8fda55cdfe71d9e23407169499e918478161328d.tar.bz2
Release-1.3-rc3
Diffstat (limited to 'src')
-rw-r--r--src/code.l6
-rw-r--r--src/docparser.cpp19
-rw-r--r--src/doctokenizer.l6
-rw-r--r--src/doxygen.cpp34
-rw-r--r--src/doxytag.l3
-rw-r--r--src/filedef.cpp44
-rw-r--r--src/filedef.h3
-rw-r--r--src/index.cpp2
-rw-r--r--src/memberdef.cpp2
-rw-r--r--src/memberlist.cpp142
-rw-r--r--src/scanner.l6
-rw-r--r--src/xmlgen.cpp4
12 files changed, 129 insertions, 142 deletions
diff --git a/src/code.l b/src/code.l
index 13f92d1..5e3d152 100644
--- a/src/code.l
+++ b/src/code.l
@@ -593,7 +593,11 @@ static MemberDef *setCallContextForVar(const QCString &name)
//printf("mn=%p md=%p md->getBodyDef()=%p g_sourceFileDef=%p\n",
// mn,md,
// md->getBodyDef(),g_sourceFileDef);
- if (md->getBodyDef()==g_sourceFileDef)
+
+ // in case there are multiple members we could link to, we
+ // only link to members if defined in the same file or
+ // defined as external.
+ if (!md->isStatic() || md->getBodyDef()==g_sourceFileDef)
{
g_theCallContext.setClass(stripClassName(md->typeString()));
//printf("returning member %s in source file %s\n",md->name().data(),g_sourceFileDef->name().data());
diff --git a/src/docparser.cpp b/src/docparser.cpp
index d194a49..2fd7341 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -276,7 +276,7 @@ static void checkArgumentName(const QString &name,bool isParam)
}
}
-/*! Checks if the parameters that have been specified using @param are
+/*! Checks if the parameters that have been specified using \@param are
* indeed all paramters.
* Must be called after checkArgumentName() has been called for each
* argument.
@@ -2219,7 +2219,7 @@ int DocIndexEntry::parse()
break;
}
}
- if (tok!=TK_WHITESPACE) retval=tok;
+ if (tok!=0) retval=tok;
doctokenizerYYsetStatePara();
endindexentry:
DBG(("DocIndexEntry::parse() end retval=%x\n",retval));
@@ -4561,10 +4561,17 @@ void DocRoot::parse()
while (retval==RetVal_Section)
{
SectionInfo *sec=Doxygen::sectionDict[g_token->sectionId];
- ASSERT(sec!=0);
- DocSection *s=new DocSection(this,1,g_token->sectionId);
- m_children.append(s);
- retval = s->parse();
+ if (sec)
+ {
+ DocSection *s=new DocSection(this,1,g_token->sectionId);
+ m_children.append(s);
+ retval = s->parse();
+ }
+ else
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'",g_token->sectionId.data());
+ retval = 0;
+ }
}
if (retval==RetVal_Internal)
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 5b8ae93..d55e015 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -769,7 +769,8 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]*
processSection();
BEGIN(St_Sections);
}
-<St_SecLabel2>{LABELID}{BLANK}+ {
+<St_SecLabel2>{LABELID}{BLANK}+ |
+<St_SecLabel2>{LABELID} {
g_secLabel = yytext;
g_secLabel = g_secLabel.stripWhiteSpace();
BEGIN(St_SecTitle);
@@ -780,6 +781,9 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]*
processSection();
BEGIN(St_Sections);
}
+<St_SecTitle,St_SecLabel1,St_SecLabel2>. {
+ warn(g_fileName,yylineno,"Error: Unexpected character `%s' while looking for section label or title",yytext);
+ }
/* Generic rules that work for all states */
<*>\n {
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index ba2943c..eac9b8a 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -1226,6 +1226,37 @@ static void findUsingDeclImports(Entry *root)
//----------------------------------------------------------------------
+static void findIncludedUsingDirectives()
+{
+ // first mark all files as not visited
+ FileNameListIterator fnli(Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
+ {
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (;(fd=fni.current());++fni)
+ {
+ fd->visited=FALSE;
+ }
+ fn=Doxygen::inputNameList.next();
+ }
+ // then recursively add using directives found in #include files
+ // to files that have not been visited.
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
+ {
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (;(fd=fni.current());++fni)
+ {
+ if (!fd->visited) fd->addIncludedUsingDirectives();
+ }
+ fn=Doxygen::inputNameList.next();
+ }
+}
+
+//----------------------------------------------------------------------
+
static MemberDef *addVariableToClass(
Entry *root,
ClassDef *cd,
@@ -7796,6 +7827,9 @@ void parseInput()
msg("Building file list...\n");
buildFileList(root);
+ msg("Searching for included using directives...\n");
+ findIncludedUsingDirectives();
+
msg("Building class list...\n");
buildClassList(root);
buildClassDocList(root);
diff --git a/src/doxytag.l b/src/doxytag.l
index f80a12b..d5a3edc 100644
--- a/src/doxytag.l
+++ b/src/doxytag.l
@@ -20,7 +20,6 @@
* includes
*/
#include <stdio.h>
-#include <iostream.h>
#include <assert.h>
#include <ctype.h>
@@ -165,7 +164,7 @@ static void addReference()
// docRefName.data(),(docBaseLink+"#"+docAnchor).data());
if (genIndex && !docRefName.isEmpty() && !docBaseLink.isEmpty())
{
- if (!docAnchor.isEmpty())
+ if (docAnchor.isEmpty())
searchIndex.addReference(docRefName,docBaseLink);
else
searchIndex.addReference(docRefName,docBaseLink+"#"+docAnchor);
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 9d9edcc..d360813 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -615,6 +615,7 @@ MemberDef *FileDef::getSourceMember(int lineNr)
return result;
}
+
void FileDef::addUsingDirective(NamespaceDef *nd)
{
if (usingDirList==0)
@@ -648,6 +649,49 @@ void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local)
}
}
+void FileDef::addIncludedUsingDirectives()
+{
+ if (!visited)
+ {
+ visited=TRUE;
+ NamespaceList nl;
+ if (includeList) // file contains #includes
+ {
+ QListIterator<IncludeInfo> iii(*includeList);
+ IncludeInfo *ii;
+ for (;(ii=iii.current());++iii) // foreach #include...
+ {
+ if (ii->fileDef) // ...that is a known file
+ {
+ // recurse into this file
+ ii->fileDef->addIncludedUsingDirectives();
+ }
+ }
+ // iterate through list from last to first
+ for (iii.toLast();(ii=iii.current());--iii)
+ {
+ if (ii->fileDef)
+ {
+ NamespaceList *unl = ii->fileDef->usingDirList;
+ if (unl)
+ {
+ NamespaceListIterator nli(*unl);
+ NamespaceDef *nd;
+ for (nli.toLast();(nd=nli.current());--nli)
+ {
+ // append each using directive found in a #include file
+ if (usingDirList==0) usingDirList = new NamespaceList;
+ usingDirList->prepend(nd);
+ }
+ }
+ }
+ }
+ }
+ // add elements of nl to usingDirList
+ }
+}
+
+
void FileDef::addIncludedByDependency(FileDef *fd,const char *incName,bool local)
{
//printf("FileDef::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local);
diff --git a/src/filedef.h b/src/filedef.h
index 1850a7c..ce5adb3 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -146,6 +146,7 @@ class FileDef : public Definition
void addMembersToMemberGroup();
void distributeMemberGroupDocumentation();
void findSectionsInDocumentation();
+ void addIncludedUsingDirectives();
void addListReferences();
@@ -175,6 +176,8 @@ class FileDef : public Definition
NamespaceSDict *namespaceSDict;
ClassSDict *classSDict;
+
+ bool visited;
private:
diff --git a/src/index.cpp b/src/index.cpp
index 966accc..42a0452 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1388,7 +1388,7 @@ void writeAlphabeticalClassList(OutputList &ol)
"<tr>"
"<td><div class=\"ah\">&nbsp;&nbsp;");
ol.writeString(s);
- ol.writeString( "&nbsp;&nbsp;"
+ ol.writeString( "&nbsp;&nbsp;</div>"
"</td>"
"</tr>"
"</table>\n");
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 0cbe74c..50354fb 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -654,7 +654,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
//printf("%s MemberDef::writeDeclaration() inGroup=%d\n",name().data(),inGroup);
// hide members whose brief section should not be visible
- if (!isBriefSectionVisible()) return;
+ //if (!isBriefSectionVisible()) return;
// write tag file information of this member
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index 28a3e9a..aea2f27 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -193,130 +193,16 @@ void MemberList::writePlainDeclarations(OutputList &ol,
case MemberDef::Property: // fall through
case MemberDef::Event:
{
- if (first) ol.startMemberList(),first=FALSE;
- md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
+ if (md->isBriefSectionVisible())
+ {
+ if (first) ol.startMemberList(),first=FALSE;
+ md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
+ }
break;
}
case MemberDef::Enumeration:
{
if (first) ol.startMemberList(),first=FALSE;
-#if 0
- OutputList typeDecl(&ol);
- QCString name(md->name());
- int i=name.findRev("::");
- if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
- if (name[0]!='@') // not an anonymous enum
- {
- if (md->isLinkableInProject() || md->hasDocumentedEnumValues())
- {
- if (!Config_getString("GENERATE_TAGFILE").isEmpty())
- {
- Doxygen::tagFile << " <member kind=\"enumeration\">" << endl;
- Doxygen::tagFile << " <name>" << convertToXML(md->name()) << "</name>" << endl;
- Doxygen::tagFile << " <anchor>" << convertToXML(md->anchor()) << "</anchor>" << endl;
- Doxygen::tagFile << " <arglist>" << convertToXML(md->argsString()) << "</arglist>" << endl;
- Doxygen::tagFile << " </member>" << endl;
- }
- md->writeLink(typeDecl,cd,nd,fd,gd);
- }
- else
- {
- typeDecl.startBold();
- typeDecl.docify(name);
- typeDecl.endBold();
- }
- typeDecl.writeChar(' ');
- }
-
- int enumMemCount=0;
-
- QList<MemberDef> *fmdl=md->enumFieldList();
- uint numVisibleEnumValues=0;
- if (fmdl)
- {
- MemberDef *fmd=fmdl->first();
- while (fmd)
- {
- if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
- fmd=fmdl->next();
- }
- }
- if (numVisibleEnumValues==0 && !md->isBriefSectionVisible()) break;
- if (numVisibleEnumValues>0)
- {
- uint enumValuesPerLine = (uint)Config_getInt("ENUM_VALUES_PER_LINE");
- typeDecl.docify("{ ");
- if (fmdl)
- {
- MemberDef *fmd=fmdl->first();
- bool fmdVisible = fmd->isBriefSectionVisible();
- while (fmd)
- {
- if (fmdVisible)
- {
- /* in html we start a new line after a number of items */
- if (numVisibleEnumValues>enumValuesPerLine
- && (enumMemCount%enumValuesPerLine)==0
- )
- {
- typeDecl.pushGeneratorState();
- typeDecl.disableAllBut(OutputGenerator::Html);
- typeDecl.lineBreak();
- typeDecl.writeString("&nbsp;&nbsp;");
- typeDecl.popGeneratorState();
- }
-
- if (fmd->hasDocumentation()) // enum value has docs
- {
- if (!Config_getString("GENERATE_TAGFILE").isEmpty())
- {
- Doxygen::tagFile << " <member kind=\"enumvalue\">" << endl;
- Doxygen::tagFile << " <name>" << convertToXML(fmd->name()) << "</name>" << endl;
- Doxygen::tagFile << " <anchor>" << convertToXML(fmd->anchor()) << "</anchor>" << endl;
- Doxygen::tagFile << " <arglist>" << convertToXML(fmd->argsString()) << "</arglist>" << endl;
- Doxygen::tagFile << " </member>" << endl;
- }
- fmd->writeLink(typeDecl,cd,nd,fd,gd);
- }
- else // no docs for this enum value
- {
- typeDecl.startBold();
- typeDecl.docify(fmd->name());
- typeDecl.endBold();
- }
- if (fmd->hasOneLineInitializer()) // enum value has initializer
- {
- typeDecl.writeString(" = ");
- typeDecl.parseText(fmd->initializer());
- }
- }
-
- bool prevVisible = fmdVisible;
- fmd=fmdl->next();
- if (fmd && (fmdVisible=fmd->isBriefSectionVisible()))
- {
- typeDecl.writeString(", ");
- }
- if (prevVisible)
- {
- typeDecl.disable(OutputGenerator::Man);
- typeDecl.writeString("\n"); // to prevent too long lines in LaTeX
- typeDecl.enable(OutputGenerator::Man);
- enumMemCount++;
- }
- }
- if (numVisibleEnumValues>enumValuesPerLine)
- {
- typeDecl.pushGeneratorState();
- typeDecl.disableAllBut(OutputGenerator::Html);
- typeDecl.lineBreak();
- typeDecl.popGeneratorState();
- }
- }
- typeDecl.docify(" }");
- md->setEnumDecl(typeDecl);
- }
-#endif
int enumVars=0;
MemberListIterator vmli(*this);
MemberDef *vmd;
@@ -381,8 +267,11 @@ void MemberList::writePlainDeclarations(OutputList &ol,
}
case MemberDef::Friend:
{
- if (first) ol.startMemberList(),first=FALSE;
- md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
+ if (md->isBriefSectionVisible())
+ {
+ if (first) ol.startMemberList(),first=FALSE;
+ md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
+ }
break;
}
case MemberDef::EnumValue:
@@ -400,10 +289,13 @@ void MemberList::writePlainDeclarations(OutputList &ol,
if (md->fromAnonymousScope() && !md->anonymousDeclShown())
{
//printf("anonymous compound members\n");
- if (first) ol.startMemberList(),first=FALSE;
- md->setFromAnonymousScope(FALSE);
- md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
- md->setFromAnonymousScope(TRUE);
+ if (md->isBriefSectionVisible())
+ {
+ if (first) ol.startMemberList(),first=FALSE;
+ md->setFromAnonymousScope(FALSE);
+ md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup);
+ md->setFromAnonymousScope(TRUE);
+ }
}
}
}
diff --git a/src/scanner.l b/src/scanner.l
index 3d30f2d..463aad6 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -355,7 +355,7 @@ static void addSpecialItem(const char *listName)
//sectionLabel=anchorLabel;
//addSection();
//current->name = tmpName;
- //printf("%s: text %s doc %s\n",listName,item->text.data(),cmdString.data());
+ //printf("%s: text `%s' doc %s\n",listName,item->text.data(),cmdString.data());
}
current->brief = slString.copy(); // restore orginial brief desc.
}
@@ -4127,7 +4127,6 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<DocBaseClass>\n { yyLineNr++; BEGIN( ClassDoc ); }
<ClassDocBrief>{BS}({BL}|"\\n\\n") {
- current->brief=current->brief.stripWhiteSpace();
//if (!current->doc.isEmpty()) current->doc+=" <p>";
if (lastBriefContext==TodoParam ||
lastBriefContext==TestParam ||
@@ -4139,6 +4138,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
+ current->brief=current->brief.stripWhiteSpace();
if (yytext[yyleng-1]=='\n') yyLineNr++;
}
BEGIN( lastBriefContext );
@@ -4186,7 +4186,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
- current->brief += " ";
+ current->brief += "\n";
if (!current->doc.isEmpty())
{
current->doc += "<p>";
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index ef16705..c5f6d46 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -528,8 +528,8 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De
t << " <type>";
linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),typeStr);
t << "</type>" << endl;
- t << " <definition>" << md->definition() << "</definition>" << endl;
- t << " <argsstring>" << md->argsString() << "</argsstring>" << endl;
+ t << " <definition>" << convertToXML(md->definition()) << "</definition>" << endl;
+ t << " <argsstring>" << convertToXML(md->argsString()) << "</argsstring>" << endl;
}
t << " <name>" << convertToXML(md->name()) << "</name>" << endl;