diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdldocgen.cpp | 64 | ||||
-rw-r--r-- | src/vhdldocgen.h | 2 | ||||
-rw-r--r-- | src/vhdljjparser.cpp | 24 | ||||
-rwxr-xr-x[-rw-r--r--] | src/vhdljjparser.h | 5 |
4 files changed, 44 insertions, 51 deletions
diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index a4ec163..e12052d 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1956,9 +1956,10 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, } // *** write type /*VHDL CHANGE */ - bool bRec,bUnit; + QCString ltype(mdef->typeString()); QCString largs(mdef->argsString()); + ClassDef *kl=0; const ArgumentList &al = mdef->argumentList(); QCString nn; @@ -2014,7 +2015,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, ol.insertMemberAlign(); if (largs=="context") { - VhdlDocGen::writeRecorUnit(ltype,ol,mdef); + VhdlDocGen::writeRecordUnit(ltype,largs,ol,mdef); } break; @@ -2079,7 +2080,6 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, ol.insertMemberAlign(); ol.docify(" "); - ol.startBold(); ol.docify(ltype); ol.endBold(); @@ -2128,6 +2128,7 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, case VhdlDocGen::SHAREDVARIABLE: case VhdlDocGen::VFILE: case VhdlDocGen::GROUP: + case VhdlDocGen::TYPE: writeLink(mdef,ol); ol.docify(" "); ol.insertMemberAlign(); @@ -2135,34 +2136,9 @@ void VhdlDocGen::writeVHDLDeclaration(const MemberDef* mdef,OutputList &ol, break; case VhdlDocGen::RECORD: case VhdlDocGen::UNITS: - writeLink(mdef,ol); - ol.docify(" "); - ol.startBold(); - if (ltype.isEmpty()) { - ol.docify(" "); - } - ol.insertMemberAlign(); - if (!ltype.isEmpty()) - VhdlDocGen::formatString(ltype,ol,mdef); - ol.endBold(); + writeRecordUnit(largs,ltype,ol,mdef); break; - case VhdlDocGen::TYPE: - bRec=largs.stripPrefix("record") ; - bUnit=largs.stripPrefix("units") ; - ol.startBold(); - if (bRec) ol.docify("record: "); - if (bUnit) ol.docify("units: "); - writeLink(mdef,ol); - ol.insertMemberAlign(); - if (!bRec && !bUnit) VhdlDocGen::formatString(ltype,ol,mdef); - if (bUnit) ol.lineBreak(); - if (bRec || bUnit) - { - writeRecorUnit(largs,ol,mdef); - } - ol.endBold(); - break; - + default: break; } @@ -2930,8 +2906,6 @@ ferr: md->setDocumentation(cur->doc.data(),cur->docFile.data(),cur->docLine); FileDef *fd=ar->getFileDef(); md->setBodyDef(fd); - - QCString info="Info: Elaborating entity "+n1; fd=ar->getFileDef(); info+=" for hierarchy "; @@ -2940,23 +2914,27 @@ ferr: label.replace(epr,":"); info+=label; fprintf(stderr,"\n[%s:%d:%s]\n",fd->fileName().data(),cur->startLine,info.data()); - - ar->insertMember(md); } -void VhdlDocGen::writeRecorUnit(QCString & largs,OutputList& ol ,const MemberDef *mdef) +void VhdlDocGen::writeRecordUnit(QCString & largs,QCString & ltype,OutputList& ol ,const MemberDef *mdef) { - QCStringList ql=QCStringList::split("#",largs,FALSE); - uint len=ql.count(); - for(uint i=0;i<len;i++) - { - QCString n=ql[i]; - VhdlDocGen::formatString(n,ol,mdef); - if ((len-i)>1) ol.lineBreak(); - } + int i=mdef->name().find('~'); + if(i>0){ + //sets the real record member name + const_cast<MemberDef*>(mdef)->setName(mdef->name().left(i).data()); + } + + writeLink(mdef,ol); + ol.startBold(); + ol.insertMemberAlign(); + if (!ltype.isEmpty()){ + VhdlDocGen::formatString(ltype,ol,mdef); + } + ol.endBold(); + } diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h index a557c27..1e43a67 100644 --- a/src/vhdldocgen.h +++ b/src/vhdldocgen.h @@ -253,7 +253,7 @@ class VhdlDocGen static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh); static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol); static void writeRecUnitDocu( const MemberDef *md, OutputList& ol,QCString largs); - static void writeRecorUnit(QCString & largs,OutputList& ol ,const MemberDef *mdef); + static void writeRecordUnit(QCString & largs,QCString & ltype,OutputList& ol ,const MemberDef *mdef); }; //------------------------------------------------------------------------------------------------------------------- diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp index 6e5f318..cf6e294 100644 --- a/src/vhdljjparser.cpp +++ b/src/vhdljjparser.cpp @@ -233,6 +233,23 @@ void VHDLOutlineParser::newEntry() initEntry(s->current.get()); } +static int idCounter; + +/** returns a unique id for each record member. +* +* type first_rec is record +* RE: data_type; +* end; +* +* type second_rec is record +* RE: data_type; +* end; +*/ + +QString VHDLOutlineParser::getNameID(){ + return QString::number(idCounter++,10); +} + void VHDLOutlineParser::handleFlowComment(const char* doc) { lineCount(doc); @@ -251,7 +268,6 @@ void VHDLOutlineParser::handleCommentBlock(const char* doc1,bool brief) { VhdlParser::SharedState *s = &p->shared; QCString doc = doc1; - // fprintf(stderr,"\n %s",doc.data()); if (doc.isEmpty()) return; if (checkMultiComment(doc,p->yyLineNr)) @@ -284,8 +300,7 @@ void VHDLOutlineParser::handleCommentBlock(const char* doc1,bool brief) { s->current->docLine = p->yyLineNr; } - // printf("parseCommentBlock file<%s>\n [%s]\n at line [%d] \n ",yyFileName.data(),doc.data(),p->iDocLine); - + int j=doc.find("[plant]"); if (j>=0) { @@ -296,7 +311,7 @@ void VHDLOutlineParser::handleCommentBlock(const char* doc1,bool brief) int position=0; bool needsEntry=FALSE; QCString processedDoc = processMarkdownForCommentBlock(doc,p->yyFileName,p->iDocLine); - while (p->commentScanner.parseCommentBlock( + while (p->commentScanner.parseCommentBlock( p->thisParser, s->current.get(), processedDoc, // text @@ -311,7 +326,6 @@ void VHDLOutlineParser::handleCommentBlock(const char* doc1,bool brief) ) ) { - //printf("parseCommentBlock position=%d [%s]\n",position,doc.data()+position); if (needsEntry) newEntry(); } if (needsEntry) diff --git a/src/vhdljjparser.h b/src/vhdljjparser.h index 16b651b..c4a55de 100644..100755 --- a/src/vhdljjparser.h +++ b/src/vhdljjparser.h @@ -45,7 +45,7 @@ class VHDLOutlineParser : public OutlineParserInterface // interface for generated parser code - + void setLineParsed(int tok); int getLine(int tok); int getLine(); @@ -71,12 +71,13 @@ class VHDLOutlineParser : public OutlineParserInterface void setMultCommentLine(); bool checkMultiComment(QCString& qcs,int line); void insertEntryAtLine(std::shared_ptr<Entry> ce,int line); - + QString getNameID(); private: struct Private; std::unique_ptr<Private> p; }; + const EntryList &getVhdlInstList(); QCString filter2008VhdlComment(const char *s); |