diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-04-29 17:51:51 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-04-29 17:51:51 (GMT) |
commit | 44ca9512aaeb19f7fbd07afda88ec4cfe53ce831 (patch) | |
tree | a8d7cbd0da612bb0b1fa97dcc1bac1838f845338 /src/vhdldocgen.cpp | |
parent | f3e0c94b327d47e5c3d3a36a9a6300cee8d2a537 (diff) | |
download | Doxygen-44ca9512aaeb19f7fbd07afda88ec4cfe53ce831.zip Doxygen-44ca9512aaeb19f7fbd07afda88ec4cfe53ce831.tar.gz Doxygen-44ca9512aaeb19f7fbd07afda88ec4cfe53ce831.tar.bz2 |
Release-1.8.0-20120429
Diffstat (limited to 'src/vhdldocgen.cpp')
-rw-r--r-- | src/vhdldocgen.cpp | 127 |
1 files changed, 106 insertions, 21 deletions
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 605a659..04c1135 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -532,8 +532,6 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol) type+=" >> "; ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::Man); - ol.lineBreak(); - ol.lineBreak(); if (ii==VhdlDocGen::PACKAGE_BODY) { @@ -1403,7 +1401,6 @@ void VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit ol.docify(" "); ol.startBold(); - //ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,mdef->typeString()); writeLink(memdef,ol); ol.endBold(); ol.docify(" "); @@ -1421,11 +1418,8 @@ void VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit if (mdef->isVariable()) { - //ol.docify(mdef->name().data()); - // QCString ttype; if (VhdlDocGen::isConstraint(mdef)) { - writeLink(mdef,ol); ol.docify(" "); @@ -1436,8 +1430,11 @@ void VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit else { writeLink(mdef,ol); + if (VhdlDocGen::isLibrary(mdef) || VhdlDocGen::isPackage(mdef)) + { + return; + } ol.docify(" "); - // ttype=mdef->typeString(); } // QCString largs=mdef->argsString(); @@ -1793,7 +1790,7 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, } bool htmlOn = ol.isEnabled(OutputGenerator::Html); - if (htmlOn && Config_getBool("HTML_ALIGN_MEMBERS") && !ltype.isEmpty()) + if (htmlOn && /*Config_getBool("HTML_ALIGN_MEMBERS") &&*/ !ltype.isEmpty()) { ol.disable(OutputGenerator::Html); } @@ -2676,24 +2673,28 @@ void VhdlDocGen::computeVhdlComponentRelations() static void addInstance(ClassDef* classEntity, ClassDef* ar, ClassDef *cd , Entry *cur,ClassDef* /*archBind*/) { - if (classEntity==cd) return; - QCString bName=classEntity->name(); - //bName+="::"+cur->name; - cd->insertBaseClass(classEntity,bName,Public,Normal,0); + QCString bName=classEntity->name(); + //printf("addInstance %s to %s\n", cd->name().data(), classEntity->name().data()); + QCString n1=cur->type; - QCString n1=cur->name+"::"+cur->type; - // n1+="::"+cur->name; - // classEntity->setName(n1.data()); - // classEntity->_setSymbolName(n1.data()); + if (!cd->isBaseClass(classEntity, true, 0)) + { + cd->insertBaseClass(classEntity,n1,Public,Normal,0); + } + else + { + VhdlDocGen::addBaseClass(cd,classEntity); + } - // if (archBind) - // cd->insertSubClass(archBind,Public,Normal,0); - // else - classEntity->insertSubClass(cd,Public,Normal,0); + if (!VhdlDocGen::isSubClass(classEntity,cd,true,0)) + { + classEntity->insertSubClass(cd,Public,Normal,0); + } if (ar==0) return; + QCString uu=cur->name; MemberDef *md=new MemberDef( ar->getDefFileName(), cur->startLine, @@ -2702,16 +2703,30 @@ static void addInstance(ClassDef* classEntity, ClassDef* ar, MemberDef::Variable, 0, 0); + + if (ar->getOutputFileBase()) + { + TagInfo tg; + tg.anchor = 0; + tg.fileName = ar->getOutputFileBase(); + tg.tagName = 0; + md->setTagInfo(&tg); + } + + //fprintf(stderr,"\n%s%s%s\n",md->name().data(),cur->brief.data(),cur->doc.data()); + md->setLanguage(SrcLangExt_VHDL); md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION); md->setBriefDescription(cur->brief,cur->briefFile,cur->briefLine); md->setBodySegment(cur->startLine,-1) ; + md->setDocumentation(cur->doc.data(),cur->docFile.data(),cur->docLine); FileDef *fd=ar->getFileDef(); md->setBodyDef(fd); ar->insertMember(md); - // printf("\nMemberreference [%p]",md); + // printf("\nMemberreference [%p]",md); } + void VhdlDocGen::writeRecorUnit(QCString & largs,OutputList& ol ,const MemberDef *mdef) { QStringList ql=QStringList::split("#",largs,FALSE); @@ -2776,3 +2791,73 @@ void VhdlDocGen::writeCodeFragment(OutputList& ol,int start, QCString & codeFrag ol.endCodeFragment(); } +bool VhdlDocGen::isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int level) +{ + bool found=FALSE; + //printf("isBaseClass(cd=%s) looking for %s\n",name().data(),bcd->name().data()); + if (level>255) + { + err("Possible recursive class relation while inside %s and looking for %s\n",qPrint(cd->name()),qPrint(scd->name())); + abort(); + return FALSE; + } + + if (cd->subClasses()) + { + // Beware: trying to optimise the iterator away using ->first() & ->next() + // causes bug 625531 + BaseClassListIterator bcli(*cd->subClasses()); + for ( ; bcli.current() && !found ; ++bcli) + { + ClassDef *ccd=bcli.current()->classDef; + if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster(); + //printf("isSubClass() subclass %s\n",ccd->name().data()); + if (ccd==scd) + { + found=TRUE; + } + else + { + if (level <256) + { + found=ccd->isBaseClass(scd,followInstances,level+1); + } + } + } + } + return found; +} + +void VhdlDocGen::addBaseClass(ClassDef* cd,ClassDef *ent) +{ + if (cd->baseClasses()) + { + BaseClassListIterator bcli(*cd->baseClasses()); + for ( ; bcli.current() ; ++bcli) + { + ClassDef *ccd=bcli.current()->classDef; + if (ccd==ent) + { + QCString n = bcli.current()->usedName; + int i = n.find('('); + if(i<0) + { + bcli.current()->usedName.append("(2)"); + return; + } + static QRegExp reg("[0-9]+"); + QCString s=n.left(i); + QCString r=n.right(n.length()-i); + QCString t=r; + VhdlDocGen::deleteAllChars(r,')'); + VhdlDocGen::deleteAllChars(r,'('); + r.setNum(r.toInt()+1); + t.replace(reg,r.data()); + s.append(t.data()); + bcli.current()->usedName=s; + bcli.current()->templSpecifiers=t; + } + } + } +} + |