summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp35
-rw-r--r--src/classlist.cpp4
-rw-r--r--src/code.l35
-rw-r--r--src/config.l8
-rw-r--r--src/definition.cpp11
-rw-r--r--src/diagram.cpp6
-rw-r--r--src/doc.l6
-rw-r--r--src/doxygen.cpp65
-rw-r--r--src/filedef.cpp4
-rw-r--r--src/index.cpp50
-rw-r--r--src/memberdef.cpp10
-rw-r--r--src/namespacedef.cpp27
-rw-r--r--src/namespacedef.h1
-rw-r--r--src/scanner.l40
-rw-r--r--src/util.cpp147
15 files changed, 291 insertions, 158 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index d37ac01..8632c03 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -700,7 +700,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
if (outerTempArgList) pageTitle.prepend(" Template");
startFile(ol,getOutputFileBase(),name(),pageTitle);
startTitle(ol,getOutputFileBase());
- parseText(ol,theTranslator->trCompoundReference(name(),m_compType,outerTempArgList!=0));
+ parseText(ol,theTranslator->trCompoundReference(displayName(),m_compType,outerTempArgList!=0));
addGroupListToTitle(ol,this);
endTitle(ol,getOutputFileBase(),name());
@@ -844,11 +844,11 @@ void ClassDef::writeDocumentation(OutputList &ol)
}
Doxygen::tagFile << ">" << convertToXML(cd->name()) << "</base>" << endl;
}
- ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()+bcd->templSpecifiers);
+ ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName()+bcd->templSpecifiers);
}
else
{
- ol.docify(cd->name());
+ ol.docify(cd->displayName());
}
}
else
@@ -879,11 +879,11 @@ void ClassDef::writeDocumentation(OutputList &ol)
ClassDef *cd=bcd->classDef;
if (cd->isLinkable())
{
- ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name());
+ ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName());
}
else
{
- ol.docify(cd->name());
+ ol.docify(cd->displayName());
}
writeInheritanceSpecifier(ol,bcd);
}
@@ -945,9 +945,9 @@ void ClassDef::writeDocumentation(OutputList &ol)
ClassDiagram diagram(this); // create a diagram of this class.
ol.startClassDiagram();
ol.disable(OutputGenerator::Man);
- parseText(ol,theTranslator->trClassDiagram(name()));
+ parseText(ol,theTranslator->trClassDiagram(displayName()));
ol.enable(OutputGenerator::Man);
- ol.endClassDiagram(diagram,getOutputFileBase(),name());
+ ol.endClassDiagram(diagram,getOutputFileBase(),displayName());
}
if (Config_getBool("HAVE_DOT") && Config_getBool("COLLABORATION_GRAPH"))
@@ -958,7 +958,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
ol.startDotGraph();
- parseText(ol,theTranslator->trCollaborationDiagram(name()));
+ parseText(ol,theTranslator->trCollaborationDiagram(displayName()));
ol.endDotGraph(usageImplGraph);
if (Config_getBool("GENERATE_LEGEND"))
{
@@ -1251,10 +1251,10 @@ void ClassDef::writeMemberList(OutputList &ol)
startFile(ol,m_memListFileName,m_memListFileName,
theTranslator->trMemberList());
startTitle(ol,0);
- parseText(ol,name()+" "+theTranslator->trMemberList());
+ parseText(ol,displayName()+" "+theTranslator->trMemberList());
endTitle(ol,0,0);
parseText(ol,theTranslator->trThisIsTheListOfAllMembers());
- ol.writeObjectLink(getReference(),getOutputFileBase(),0,name());
+ ol.writeObjectLink(getReference(),getOutputFileBase(),0,displayName());
parseText(ol,theTranslator->trIncludingInheritedMembers());
//ol.startItemList();
@@ -1328,12 +1328,12 @@ void ClassDef::writeMemberList(OutputList &ol)
parseText(ol,theTranslator->trDefinedIn()+" ");
if (cd->isLinkable())
{
- ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name());
+ ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName());
}
else
{
ol.startBold();
- ol.docify(cd->name());
+ ol.docify(cd->displayName());
ol.endBold();
}
ol.writeString(")");
@@ -1344,7 +1344,7 @@ void ClassDef::writeMemberList(OutputList &ol)
{
ol.writeString("<td>");
ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),
- 0,cd->name());
+ 0,cd->displayName());
ol.writeString("</td>");
ol.writeString("<td>");
}
@@ -2383,7 +2383,14 @@ QCString ClassDef::qualifiedNameWithTemplateParameters(
scName = d->qualifiedName();
}
}
- if (!scName.isEmpty()) scName+="::";
+
+ QCString scopeSeparator;
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ scopeSeparator=".";
+ else
+ scopeSeparator="::";
+
+ if (!scName.isEmpty()) scName+=scopeSeparator;
scName+=localName();
ArgumentList *al=0;
bool isSpecialization = localName().find('<')!=-1;
diff --git a/src/classlist.cpp b/src/classlist.cpp
index f28281c..04664ef 100644
--- a/src/classlist.cpp
+++ b/src/classlist.cpp
@@ -104,13 +104,13 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
ol.writeObjectLink(cd->getReference(),
cd->getOutputFileBase(),
0,
- cd->name()
+ cd->localName()
);
}
else
{
ol.startBold();
- ol.docify(cd->name());
+ ol.docify(cd->localName());
ol.endBold();
}
ol.endMemberItem(FALSE);
diff --git a/src/code.l b/src/code.l
index adabd5a..57bbff1 100644
--- a/src/code.l
+++ b/src/code.l
@@ -623,10 +623,11 @@ static void generateClassOrGlobalLink(OutputDocInterface &ol,char *clName,int *c
if (!g_theVarContext.findVariable(className)) // not a local variable
{
- cd = getResolvedClass(g_currentDefinition,className);
+ Definition *d = g_currentDefinition;
+ cd = getResolvedClass(d,className);
if (cd==0 && (i=className.find('<'))!=-1)
{
- cd=getResolvedClass(g_currentDefinition,className.left(i));
+ cd=getResolvedClass(d,className.left(i));
}
}
if (cd && cd->isLinkable()) // is it a linkable class
@@ -976,9 +977,9 @@ SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID})
TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">"
SCOPETNAME ((({ID}{TEMPLIST}?){BN}*"::"{BN}*)*)((~{BN}*)?{ID})
SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*"::"{BN}*)+
-KEYWORD ("asm"|"auto"|"class"|"const"|"const_cast"|"delete"|"dynamic_cast"|"enum"|"explicit"|"extern"|"false"|"friend"|"inline"|"mutable"|"namespace"|"new"|"operator"|"private"|"protected"|"public"|"register"|"reinterpret_cast"|"sizeof"|"static"|"static_cast"|"struct"|"template"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile")
-FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"for"|"goto"|"if"|"return"|"switch"|"throw"|"try"|"while")
-TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"|"void"|"wchar_t")
+KEYWORD ("asm"|"auto"|"class"|"const"|"const_cast"|"delete"|"dynamic_cast"|"enum"|"explicit"|"extern"|"false"|"friend"|"inline"|"mutable"|"namespace"|"new"|"operator"|"private"|"protected"|"public"|"register"|"reinterpret_cast"|"sizeof"|"static"|"static_cast"|"struct"|"template"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient")
+FLOWKW ("break"|"case"|"catch"|"continue"|"default"|"do"|"else"|"for"|"goto"|"if"|"return"|"switch"|"throw"|"throws"|"try"|"while")
+TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"boolean")
%option noyywrap
@@ -994,6 +995,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
%x MemberCall2
%x SkipInits
%x ClassName
+%x PackageName
%x ClassVar
%x Bases
%x SkipSharp
@@ -1012,10 +1014,15 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
startFontClass("keyword");
codifyLines(yytext);
endFontClass();
- //g_code->codify(yytext);
if (!g_insideTemplate)
BEGIN( ClassName );
}
+<Body>("package")[ \t\n]+ {
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
+ BEGIN( PackageName );
+ }
<ReadInclude>[^\n\"\>]+/(">"|"\"") {
//FileInfo *f;
bool ambig;
@@ -1108,10 +1115,24 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
generateClassOrGlobalLink(*g_code,yytext);
BEGIN( ClassVar );
}
+<PackageName>{ID}("."{ID})* {
+ g_curClassName=yytext;
+ g_curClassName=substitute(g_curClassName,".","::");
+ //printf("found package: %s\n",g_curClassName.data());
+ addType();
+ codifyLines(yytext);
+ }
<ClassVar>"=" {
unput(*yytext);
BEGIN( Body );
}
+<ClassVar>("extends"|"implements") { // Java
+ startFontClass("keyword");
+ codifyLines(yytext);
+ endFontClass();
+ g_curClassBases.clear();
+ BEGIN( Bases );
+ }
<ClassVar>{ID} {
g_type = g_curClassName.copy();
g_name = yytext;
@@ -1123,6 +1144,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
g_curClassBases.clear();
BEGIN( Bases );
}
+<PackageName>[ \t]*";" |
<Bases,ClassName,ClassVar>[ \t]*"{"[ \t]* {
g_theVarContext.pushScope();
g_code->codify(yytext);
@@ -1138,6 +1160,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned"
{
g_scopeStack.push(SCOPEBLOCK);
pushScope(g_curClassName);
+ //printf("***** g_curClassName=%s\n",g_curClassName.data());
//CodeClassDef *cd=new CodeClassDef(g_ccd);
//g_codeClassDict.insert(cd->name,cd);
if (getResolvedClass(g_currentDefinition,g_curClassName)==0)
diff --git a/src/config.l b/src/config.l
index 62f2382..4c81fca 100644
--- a/src/config.l
+++ b/src/config.l
@@ -1565,6 +1565,14 @@ void Config::create()
FALSE
);
cb = addBool(
+ "OPTIMIZE_OUTPUT_JAVA",
+ "Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources \n"
+ "only. Doxygen will then generate output that is more tailored for Java. \n"
+ "For instance namespaces will be presented as packages, qualified scopes \n"
+ "will look different, etc. \n",
+ FALSE
+ );
+ cb = addBool(
"SHOW_USED_FILES",
"Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n"
"at the bottom of the documentation of classes and structs. If set to YES the \n"
diff --git a/src/definition.cpp b/src/definition.cpp
index 8800f81..08ddf6f 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -388,7 +388,14 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName,
//printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName);
if (!scope.isEmpty() && scope!=scopeName)
{
- name.prepend(scope+"::");
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ name.prepend(scope+".");
+ }
+ else
+ {
+ name.prepend(scope+"::");
+ }
}
Definition *d = md->getOuterScope();
if (d==Doxygen::globalScope) d=md->getBodyDef();
@@ -429,7 +436,7 @@ void Definition::writeSourceRefList(OutputList &ol,const char *scopeName,
{
ol.docify(name);
}
- if (md->isFunction() && md->isSlot()) ol.docify("()");
+ if (md->isFunction() || md->isSlot() || md->isPrototype() || md->isSignal()) ol.docify("()");
}
index=newIndex+matchLen;
}
diff --git a/src/diagram.cpp b/src/diagram.cpp
index 9df2bf5..3e9eb33 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -167,7 +167,7 @@ static void writeMapArea(QTextStream &t,ClassDef *cd,int x,int y,int w,int h)
if ((dest=Doxygen::tagDestinationDict[ref])) t << *dest << "/";
}
t << cd->getOutputFileBase() << htmlFileExtension << "\" ";
- t << "alt=\"" << cd->name();
+ t << "alt=\"" << cd->displayName();
t << "\" shape=\"rect\" coords=\"" << x << "," << y << ",";
t << (x+w) << "," << (y+h) << "\">" << endl;
}
@@ -199,11 +199,11 @@ QCString DiagramItem::label() const
QCString result;
if (!templSpec.isEmpty())
{
- result=insertTemplateSpecifierInScope(classDef->name(),templSpec);
+ result=insertTemplateSpecifierInScope(classDef->displayName(),templSpec);
}
else
{
- result=classDef->name();
+ result=classDef->displayName();
}
if (Config_getBool("HIDE_SCOPE_NAMES")) result=stripScope(result);
return result;
diff --git a/src/doc.l b/src/doc.l
index b6469a7..bafc73f 100644
--- a/src/doc.l
+++ b/src/doc.l
@@ -2485,7 +2485,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
outDoc->startEmphasis();
if (!insideHtmlLink)
{
- linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,FALSE);
+ linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE);
}
else
{
@@ -2524,7 +2524,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
outDoc->startBold();
if (!insideHtmlLink)
{
- linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,FALSE);
+ linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE);
}
else
{
@@ -2563,7 +2563,7 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
outDoc->startTypewriter();
if (!insideHtmlLink)
{
- linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,FALSE);
+ linkifyText(TextGeneratorOLImpl(*outDoc),className,0,yytext,FALSE,TRUE);
}
else
{
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index dc688b1..b3ea9ae 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -440,13 +440,14 @@ static bool addNamespace(Entry *root,ClassDef *cd)
if (e->section==Entry::NAMESPACE_SEC)
{
NamespaceDef *nd=0;
- //printf("addNameSpace() trying: %s\n",e->name.data());
QCString nsName = stripAnonymousNamespaceScope(e->name);
+ //printf("addNameSpace() trying: %s\n",nsName.data());
if (!nsName.isEmpty() && nsName.at(0)!='@' &&
(nd=getResolvedNamespace(nsName))
)
{
cd->setNamespace(nd);
+ cd->setOuterScope(nd);
nd->insertClass(cd);
return TRUE;
}
@@ -1080,18 +1081,25 @@ static MemberDef *addVariableToClass(
Entry *root,
ClassDef *cd,
MemberDef::MemberType mtype,
- const QCString &scope,
+ /*const QCString &scope,*/
const QCString &name,
bool fromAnnScope,
int indentDepth,
MemberDef *fromAnnMemb,
Protection prot)
{
+ QCString qualScope = cd->qualifiedNameWithTemplateParameters();
+ QCString scopeSeparator="::";
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ qualScope = substitute(qualScope,"::",".");
+ scopeSeparator=".";
+ }
Debug::print(Debug::Variables,0,
" class variable:\n"
" %s' %s'::`%s' `%s' prot=`%d ann=%d init=%s\n",
root->type.data(),
- scope.data(),
+ qualScope.data(),
name.data(),
root->args.data(),
root->protection,
@@ -1099,20 +1107,6 @@ static MemberDef *addVariableToClass(
root->initializer.data()
);
- // class friends may be templatized
- //QCString name=n;
- //int i;
- //if (root->type.left(7)=="friend " && (i=name.find('<'))!=-1)
- //{
- // name=name.left(i);
- //}
-
- // add template names, if the class is a non-specialized template
- //if (scope.find('<')==-1 && cd->templateArguments())
- //{
- // scope+=cd->getTemplateNameString();
- //}
- // generate member definition.
QCString def;
if (!root->type.isEmpty())
{
@@ -1122,7 +1116,7 @@ static MemberDef *addVariableToClass(
}
else
{
- def=root->type+" "+scope+"::"+name+root->args;
+ def=root->type+" "+qualScope+scopeSeparator+name+root->args;
}
}
else
@@ -1133,7 +1127,7 @@ static MemberDef *addVariableToClass(
}
else
{
- def=scope+"::"+name+root->args;
+ def=qualScope+scopeSeparator+name+root->args;
}
}
if (def.left(7)=="static ") def=def.right(def.length()-7);
@@ -1510,7 +1504,7 @@ void buildVarList(Entry *root)
cd=getClass(scope);
if (cd)
{
- addVariableToClass(root,cd,MemberDef::Friend,scope,
+ addVariableToClass(root,cd,MemberDef::Friend,/*scope,*/
root->name,FALSE,0,0,Public);
}
}
@@ -1563,7 +1557,7 @@ void buildVarList(Entry *root)
if (!pScope.isEmpty() && (pcd=getClass(pScope)))
{
//Protection p = (Protection)QMAX((int)root->protection,(int)cd->protection());
- md=addVariableToClass(root,pcd,mtype,pScope,name,TRUE,indentDepth,0,root->protection);
+ md=addVariableToClass(root,pcd,mtype,/*pScope,*/name,TRUE,indentDepth,0,root->protection);
}
else // annonymous scope inside namespace or file => put variable in the global scope
{
@@ -1573,7 +1567,7 @@ void buildVarList(Entry *root)
}
}
}
- addVariableToClass(root,cd,mtype,scope,name,FALSE,indentDepth,md,root->protection);
+ addVariableToClass(root,cd,mtype,/*scope,*/name,FALSE,indentDepth,md,root->protection);
}
else if (!name.isEmpty()) // global variable
{
@@ -1607,8 +1601,8 @@ nextMember:
// Searches the Entry tree for Function sections.
// If found they are stored in their class or in the global list.
-void addNewMemberToClass(Entry *root,ClassDef *cd,
- const QCString &rname,const QCString &scope,bool isFriend)
+void addMethodToClass(Entry *root,ClassDef *cd,
+ const QCString &rname,/*const QCString &scope,*/bool isFriend)
{
int l,i;
static QRegExp re("([a-z_A-Z0-9: ]*[ *]*[ ]*");
@@ -1658,6 +1652,13 @@ void addNewMemberToClass(Entry *root,ClassDef *cd,
//md->setScopeTemplateArguments(root->tArgList);
md->addSectionsToDefinition(root->anchors);
QCString def;
+ QCString qualScope = cd->qualifiedNameWithTemplateParameters();
+ QCString scopeSeparator="::";
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ qualScope = substitute(qualScope,"::",".");
+ scopeSeparator=".";
+ }
if (!root->relates.isEmpty() || isFriend || Config_getBool("HIDE_SCOPE_NAMES"))
{
if (!root->type.isEmpty())
@@ -1685,27 +1686,26 @@ void addNewMemberToClass(Entry *root,ClassDef *cd,
}
else
{
- QCString qualScope = cd->qualifiedNameWithTemplateParameters();
if (!root->type.isEmpty())
{
if (root->argList)
{
- def=root->type+" "+qualScope+"::"+name;
+ def=root->type+" "+qualScope+scopeSeparator+name;
}
else
{
- def=root->type+" "+qualScope+"::"+name+root->args;
+ def=root->type+" "+qualScope+scopeSeparator+name+root->args;
}
}
else
{
if (root->argList)
{
- def=qualScope+"::"+name;
+ def=qualScope+scopeSeparator+name;
}
else
{
- def=qualScope+"::"+name+root->args;
+ def=qualScope+scopeSeparator+name+root->args;
}
}
}
@@ -1717,7 +1717,7 @@ void addNewMemberToClass(Entry *root,ClassDef *cd,
" `%s' `%s'::`%s' `%s' proto=%d\n"
" def=`%s'\n",
root->type.data(),
- scope.data(),
+ qualScope.data(),
rname.data(),
root->args.data(),
root->proto,
@@ -1815,7 +1815,7 @@ static void buildFunctionList(Entry *root)
)
)
{
- addNewMemberToClass(root,cd,rname,scope,isFriend);
+ addMethodToClass(root,cd,rname,/*scope,*/isFriend);
}
else if (root->parent &&
!(root->parent->section & Entry::COMPOUND_MASK) &&
@@ -4125,7 +4125,7 @@ static void findMember(Entry *root,
// for which there is only a definition, no declaration in
// the class. TODO: we should actually check whether
// the arguments match!
- addNewMemberToClass(root,cd,md->name(),cd->name(),isFriend);
+ addMethodToClass(root,cd,md->name(),/*cd->name(),*/isFriend);
return;
}
candidates++;
@@ -5157,6 +5157,7 @@ static void generateClassList(ClassSDict &classSDict)
{
ClassDef *cd=cli.current();
+ //printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope);
if (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file
cd->getOuterScope()==Doxygen::globalScope // only look at global classes
)
diff --git a/src/filedef.cpp b/src/filedef.cpp
index fe5c70b..4c669e6 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -291,7 +291,7 @@ void FileDef::writeDocumentation(OutputList &ol)
ol.writeObjectLink(nd->getReference(),
nd->getOutputFileBase(),
0,
- nd->name()
+ nd->displayName()
);
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{
@@ -301,7 +301,7 @@ void FileDef::writeDocumentation(OutputList &ol)
else
{
ol.startBold();
- ol.docify(nd->name());
+ ol.docify(nd->displayName());
ol.endBold();
}
ol.endMemberItem(FALSE);
diff --git a/src/index.cpp b/src/index.cpp
index b07200d..2720545 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -190,13 +190,13 @@ void writeQuickLinks(OutputList &ol,bool compact ,bool ext=FALSE)
parseText(ol,theTranslator->trMainPage());
ol.endQuickIndexItem();
- if (documentedPackages>0)
- {
- if (!compact) ol.writeListItem();
- ol.startQuickIndexItem(extLink,"packages"+htmlFileExtension);
- parseText(ol,theTranslator->trPackages());
- ol.endQuickIndexItem();
- }
+ //if (documentedPackages>0)
+ //{
+ // if (!compact) ol.writeListItem();
+ // ol.startQuickIndexItem(extLink,"packages"+htmlFileExtension);
+ // parseText(ol,theTranslator->trPackages());
+ // ol.endQuickIndexItem();
+ //}
if (documentedGroups>0)
{
if (!compact) ol.writeListItem();
@@ -208,7 +208,14 @@ void writeQuickLinks(OutputList &ol,bool compact ,bool ext=FALSE)
{
if (!compact) ol.writeListItem();
ol.startQuickIndexItem(extLink,"namespaces"+htmlFileExtension);
- parseText(ol,theTranslator->trNamespaceList());
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ parseText(ol,theTranslator->trPackages());
+ }
+ else
+ {
+ parseText(ol,theTranslator->trNamespaceList());
+ }
ol.endQuickIndexItem();
}
if (hierarchyClasses>0)
@@ -1054,9 +1061,18 @@ void writeNamespaceIndex(OutputList &ol)
if (documentedNamespaces==0) return;
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
- startFile(ol,"namespaces",0,"Namespace Index");
+ QCString title;
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ startFile(ol,"namespaces",0,"Package Index");
+ title = theTranslator->trPackageList();
+ }
+ else
+ {
+ startFile(ol,"namespaces",0,"Namespace Index");
+ title = theTranslator->trNamespaceList();
+ }
startTitle(ol,0);
- QCString title = theTranslator->trNamespaceList();
QCString htmlHelpTitle = title;
QCString ftvHelpTitle = title;
if (!Config_getString("PROJECT_NAME").isEmpty()) title.prepend(Config_getString("PROJECT_NAME")+" ");
@@ -1081,7 +1097,14 @@ void writeNamespaceIndex(OutputList &ol)
ftvHelp->incContentsDepth();
}
//ol.newParagraph();
- parseText(ol,theTranslator->trNamespaceListDescription(Config_getBool("EXTRACT_ALL")));
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ parseText(ol,theTranslator->trPackageListDescription());
+ }
+ else
+ {
+ parseText(ol,theTranslator->trNamespaceListDescription(Config_getBool("EXTRACT_ALL")));
+ }
//ol.newParagraph();
ol.endTextBlock();
@@ -1100,7 +1123,7 @@ void writeNamespaceIndex(OutputList &ol)
}
//ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
ol.startIndexKey();
- ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->name());
+ ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->displayName());
ol.endIndexKey();
bool hasBrief = !nd->briefDescription().isEmpty();
ol.startIndexValue(hasBrief);
@@ -1110,7 +1133,7 @@ void writeNamespaceIndex(OutputList &ol)
parseDoc(ol,
nd->getDefFileName(),nd->getDefLine(),
nd->name(),0,
- abbreviate(nd->briefDescription(),nd->name()));
+ abbreviate(nd->briefDescription(),nd->displayName()));
//ol.docify(")");
}
ol.endIndexValue(nd->getOutputFileBase(),hasBrief);
@@ -1206,6 +1229,7 @@ void writeAnnotatedClassList(OutputList &ol)
//----------------------------------------------------------------------------
+// OBSOLETE
void writePackageList(OutputList &ol)
{
bool &generateHtml = Config_getBool("GENERATE_HTML") ;
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index dfcea4a..7adc450 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -1343,7 +1343,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
Definition *bd=bmd->group;
if (bd==0) bd=bcd;
ol.writeObjectLink(bd->getReference(),bd->getOutputFileBase(),
- bmd->anchor(),bcd->name());
+ bmd->anchor(),bcd->displayName());
//ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
// bmd->anchor(),bcd->name());
@@ -1355,7 +1355,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
else
{
ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
- 0,bcd->name());
+ 0,bcd->displayName());
if (bcd->isLinkableInProject()/* && !Config_getBool("PDF_HYPERLINKS")*/ )
{
writePageRef(ol,bcd->getOutputFileBase(),0);
@@ -1437,7 +1437,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (bmd->group) bd=bmd->group; else bd=bcd;
ol.writeObjectLink(bd->getReference(),bd->getOutputFileBase(),
- bmd->anchor(),bcd->name());
+ bmd->anchor(),bcd->displayName());
if (bd->isLinkableInProject() )
{
@@ -1569,8 +1569,8 @@ bool MemberDef::visibleMemberGroup(bool hideNoHeader)
QCString MemberDef::getScopeString() const
{
QCString result;
- if (getClassDef()) result=getClassDef()->name();
- else if (getNamespaceDef()) result=getNamespaceDef()->name();
+ if (getClassDef()) result=getClassDef()->displayName();
+ else if (getNamespaceDef()) result=getNamespaceDef()->displayName();
return result;
}
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index 96affc7..3a98438 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -176,9 +176,16 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
startFile(ol,getOutputFileBase(),name(),pageTitle);
startTitle(ol,getOutputFileBase());
//ol.docify(pageTitle);
- parseText(ol,theTranslator->trNamespaceReference(name()));
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ parseText(ol,theTranslator->trPackage(displayName()));
+ }
+ else
+ {
+ parseText(ol,theTranslator->trNamespaceReference(displayName()));
+ }
addGroupListToTitle(ol,this);
- endTitle(ol,getOutputFileBase(),name());
+ endTitle(ol,getOutputFileBase(),displayName());
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
{
@@ -327,10 +334,10 @@ QCString NamespaceDef::getOutputFileBase() const
return convertNameToFile(fileName);
}
-Definition *NamespaceDef::findInnerCompound(const char *name)
+Definition *NamespaceDef::findInnerCompound(const char *n)
{
- if (name==0) return 0;
- return m_innerCompounds->find(name);
+ if (n==0) return 0;
+ return m_innerCompounds->find(n);
}
void NamespaceDef::addInnerCompound(Definition *d)
@@ -358,3 +365,13 @@ void NamespaceDef::addListReferences()
docVarMembers.addListReferences(this);
}
+QCString NamespaceDef::displayName() const
+{
+ QCString result=name();
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ result = substitute(result,"::",".");
+ }
+ return result;
+}
+
diff --git a/src/namespacedef.h b/src/namespacedef.h
index 5ee62ed..5df8fa6 100644
--- a/src/namespacedef.h
+++ b/src/namespacedef.h
@@ -55,6 +55,7 @@ class NamespaceDef : public Definition
NamespaceList *getUsedNamespaces() const { return usingDirList; }
void addUsingDeclaration(ClassDef *cd);
ClassList *getUsedClasses() const { return usingDeclList; }
+ QCString displayName() const;
bool isLinkableInProject() const
{
diff --git a/src/scanner.l b/src/scanner.l
index ab08498..049dc9b 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -753,15 +753,32 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<FindMembers>{B}*"package"{BN}+ { // Java package
lineCount();
BEGIN(PackageName);
+
}
<PackageName>{ID}("."{ID})* {
- current->name = yytext;
- current->fileName = yyFileName;
- current->startLine = yyLineNr;
- current->section=Entry::PACKAGE_SEC;
+ //current->name = yytext;
+ //current->fileName = yyFileName;
+ //current->startLine = yyLineNr;
+ //current->section=Entry::PACKAGE_SEC;
+ //current_root->addSubEntry(current);
+ //current = new Entry ;
+ //initEntry();
+
+ isTypedef=FALSE;
+ current->name = yytext;
+ current->name = substitute(current->name,".","::");
+ current->section = Entry::NAMESPACE_SEC;
+ current->type = "namespace" ;
+ current->fileName = yyFileName;
+ current->startLine = yyLineNr;
+ current->bodyLine = yyLineNr;
+ lineCount();
+ curlyCount=0;
current_root->addSubEntry(current);
- current = new Entry ;
+ current_root = current ;
+ current = new Entry ;
initEntry();
+ BEGIN( FindMembers ) ;
}
<PackageName>";" {
BEGIN(FindMembers);
@@ -2222,6 +2239,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<FuncQual,FuncRound,FuncFunc>. { current->args += *yytext; }
<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
insideTryBlock=TRUE;
+ lineCount();
}
<FuncQual>{BN}*"throw"{BN}*"(" { // C++ style throw clause
current->exception = " throw (" ;
@@ -2255,8 +2273,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<ExcpList>"{" {
unput('{'); BEGIN( FuncQual );
}
+<ExcpList>";" {
+ unput(';'); BEGIN( FuncQual );
+ }
<ExcpList>"\n" {
current->exception += ' ';
+ yyLineNr++;
}
<ExcpList>. {
current->exception += *yytext;
@@ -2579,7 +2601,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
BEGIN( FindMembers );
}
-<CompoundName,ClassVar>{B}*"{"{B}* { current->fileName = yyFileName ;
+<CompoundName,ClassVar>{B}*"{"{B}* {
+ current->fileName = yyFileName ;
current->startLine = yyLineNr ;
current->name = removeRedundantWhiteSpace(current->name);
if (current->name.isEmpty() && !isTypedef) // anonymous compound
@@ -4244,7 +4267,10 @@ static void parseCompounds(Entry *rt)
// set default protection based on the compound type
if( ce->section==Entry::CLASS_SEC ) // class
{
- current->protection = protection = Private ;
+ if (ce->fileName.right(5)==".java")
+ current->protection = protection = Public ; // Actually this should be package scope!
+ else
+ current->protection = protection = Private ;
}
else if (ce->section == Entry::ENUM_SEC ) // enum
{
diff --git a/src/util.cpp b/src/util.cpp
index c99b1bd..d15cbff 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -453,86 +453,105 @@ ClassDef *getResolvedClass(
QCString *pTemplSpec
)
{
- //printf("getResolvedClass(%s,%s)\n",scope ? scope->name().data() : "<none>", n);
QCString name = n;
- if (name.isEmpty()) return 0;
if (scope==0) scope=Doxygen::globalScope;
- int i = name.findRev("::");
- QCString subst;
- if (i!=-1)
- {
- subst = resolveTypeDef(scope,name.right(name.length()-i-2));
- }
- else
- {
- subst = resolveTypeDef(scope,name);
- }
- //printf(" typedef subst=`%s'\n",subst.data());
-
- if (!subst.isEmpty())
- {
- // strip * and & from n
- int ip=subst.length()-1;
- while (ip>=0 && (subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ')) ip--;
- subst=subst.left(ip+1);
+ if (name.isEmpty()) return 0;
+ int index = name.findRev("::");
+ ClassDef *cd=0;
- if (pIsTypeDef) *pIsTypeDef=TRUE;
- //printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data());
- if (subst==name) // avoid resolving typedef struct foo foo;
+ do
+ {
+ //fprintf(stderr,"getResolvedClass(%s,%s)\n",scope ? scope->name().data() : "<none>", n);
+ QCString subst;
+ if (index!=-1)
{
- return Doxygen::classSDict.find(name);
+ subst = resolveTypeDef(scope,name.right(name.length()-index-2));
}
- int count=0; // recursion detection guard
- QCString newSubst;
- QCString typeName = subst;
-
- if (i!=-1) typeName.prepend(name.left(i)+"::");
- while (!(newSubst=resolveTypeDef(scope,typeName)).isEmpty()
- && count<10)
+ else
+ {
+ subst = resolveTypeDef(scope,name);
+ }
+ //printf(" typedef subst=`%s'\n",subst.data());
+
+ if (!subst.isEmpty())
{
- if (typeName==newSubst)
- {
- ClassDef *cd = Doxygen::classSDict.find(subst); // for breaking typedef struct A A;
- //printf(" getClass: exit `%s' %p\n",subst.data(),cd);
- return cd;
- }
- subst=newSubst;
// strip * and & from n
int ip=subst.length()-1;
- while (ip>=0 && subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ') ip--;
+ while (ip>=0 && (subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ')) ip--;
subst=subst.left(ip+1);
- //printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data());
- typeName=newSubst;
- if (i!=-1) typeName.prepend(name.left(i)+"::");
- count++;
- }
- if (count==10)
- {
- warn_cont("Warning: possible recursive typedef dependency detected for %s!\n",n);
- return Doxygen::classSDict.find(name);
- }
- else
- {
- int i;
- ClassDef *cd = Doxygen::classSDict.find(typeName);
- //printf(" getClass: subst %s->%s cd=%p\n",name.data(),typeName.data(),cd);
- if (cd==0 && (i=typeName.find('<'))>0) // try unspecialized version as well
+ if (pIsTypeDef) *pIsTypeDef=TRUE;
+ if (subst==name) // avoid resolving typedef struct foo foo;
{
- if (pTemplSpec) *pTemplSpec = typeName.right(typeName.length()-i);
- return Doxygen::classSDict.find(typeName.left(i));
+ cd = Doxygen::classSDict.find(name);
+ if (cd) goto found;
}
else
{
- return cd;
+ int count=0; // recursion detection guard
+ QCString newSubst;
+ QCString typeName = subst;
+
+ if (index!=-1) typeName.prepend(name.left(index)+"::");
+ while (!(newSubst=resolveTypeDef(scope,typeName)).isEmpty()
+ && count<10)
+ {
+ if (typeName==newSubst)
+ {
+ cd = Doxygen::classSDict.find(subst); // for breaking typedef struct A A;
+ //printf(" getClass: exit `%s' %p\n",subst.data(),cd);
+ if (cd) goto found;
+ break;
+ }
+ subst=newSubst;
+ // strip * and & from n
+ int ip=subst.length()-1;
+ while (ip>=0 && subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ') ip--;
+ subst=subst.left(ip+1);
+ //printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data());
+
+ typeName=newSubst;
+ if (index!=-1) typeName.prepend(name.left(index)+"::");
+ count++;
+ }
+ if (count==10)
+ {
+ warn_cont("Warning: possible recursive typedef dependency detected for %s!\n",n);
+ cd = Doxygen::classSDict.find(name);
+ if (cd) goto found;
+ }
+ else
+ {
+ int i;
+ cd = Doxygen::classSDict.find(typeName);
+ //printf(" getClass: subst %s->%s cd=%p\n",name.data(),typeName.data(),cd);
+ if (cd==0 && (i=typeName.find('<'))>0) // try unspecialized version as well
+ {
+ if (pTemplSpec) *pTemplSpec = typeName.right(typeName.length()-i);
+ cd = Doxygen::classSDict.find(typeName.left(i));
+ }
+ if (cd) goto found;
+ }
}
}
- }
- else
- {
- if (pIsTypeDef) *pIsTypeDef=FALSE;
- return Doxygen::classSDict.find(name);
- }
+ else
+ {
+ if (pIsTypeDef) *pIsTypeDef=FALSE;
+ if (scope!=Doxygen::globalScope)
+ cd = Doxygen::classSDict.find(scope->name()+"::"+name);
+ else
+ cd = Doxygen::classSDict.find(name);
+ if (cd) goto found;
+ }
+
+ if (scope==Doxygen::globalScope) scope=0;
+ else if (scope) scope=scope->getOuterScope();
+ //fprintf(stderr,"scope=%p\n",scope);
+ } while (scope);
+
+found:
+ //fprintf(stderr, "getResolvedClass()=%s\n",cd?cd->name().data():"<none>");
+ return cd;
}
static bool findOperator(const QCString &s,int i)