summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vhdldocgen.cpp64
-rw-r--r--src/vhdldocgen.h2
-rw-r--r--src/vhdljjparser.cpp24
-rwxr-xr-x[-rw-r--r--]src/vhdljjparser.h5
-rwxr-xr-xvhdlparser/vhdlparser.jj71
5 files changed, 79 insertions, 87 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);
diff --git a/vhdlparser/vhdlparser.jj b/vhdlparser/vhdlparser.jj
index 5ef15ba..d9d1136 100755
--- a/vhdlparser/vhdlparser.jj
+++ b/vhdlparser/vhdlparser.jj
@@ -54,6 +54,9 @@ VHDLOutlineParser *outlineParser() const { return m_outlineParser; }
void setSharedState(SharedState *s) { m_sharedState=s; }
void clearError() { hasError = false; }
+
+
+
//typedef unsigned long long uint64;
//----------------------------------------
@@ -101,8 +104,8 @@ SKIP:
{
{
QCString doc(image.data());
- int count=doc.contains("--!");
- parser->outlineParser()->setMultCommentLine();
+ int count=doc.contains("--!");
+ parser->outlineParser()->setMultCommentLine();
parser->outlineParser()->lineCount(image.data());
if (count == 1)
parser->outlineParser()->oneLineComment(doc);
@@ -466,9 +469,6 @@ QCString array_type_definition (): { QCString s;}
}
-
-
-
QCString assertion() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
{
<ASSERT_T> s=condition() [ t=<REPORT_T> s1=expression() ] [t1=<SEVERITY_T> s2=expression()]
@@ -662,7 +662,7 @@ void case_statement() : {QCString s;}
{
FlowChart::moveToPrevLevel();
FlowChart::addFlowChart(FlowChart::END_CASE,"end case",0);
- }
+ }
}
void case_statement_alternative() : {QCString s;}
@@ -726,7 +726,7 @@ void component_declaration() : {QCString s;}
void component_instantiation_statement() : {QCString s,s1;}
{
-s=identifier() <COLON_T>
+ s=identifier() <COLON_T>
s1=instantiation_unit()
{
QCString s3;
@@ -976,15 +976,21 @@ return s1;
}
}
-QCString element_declaration() : {QCString s,s1;}
+QCString element_declaration() : {QCString rec_name,s1,s2;}
{
-s=identifier_list() <COLON_T> s1=subtype_indication() <SEMI_T>
+rec_name=identifier_list() <COLON_T> s1=subtype_indication() <SEMI_T>
{
-
- outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,s1.data(),Public);
- //outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,s1.data(),Public);
- return s+":"+s1;
-}
+ QCString name;
+ QCStringList ql=QCStringList::split(",",rec_name);
+ for (uint j=0;j<ql.count();j++)
+ {
+ name=ql[j]+"~";
+ name+=outlineParser()->getNameID().data();;
+ outlineParser()->addVhdlType(name.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,s1.data(),Public);
+ }
+ s2=rec_name+":"+s1;
+ return s2;
+ }
}
@@ -1236,31 +1242,26 @@ QCString full_type_declaration() : { std::shared_ptr<Entry> tmpEntry;QCString s
tmpEntry=m_sharedState->current;
outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,0,Public);
}
- try
- {
- s2=type_definition()
- }
- catch(...)
- { outlineParser()->error_skipto(SEMI_T); }
+
+ s2=type_definition()
+
<SEMI_T>
{
- if (s2.contains("#")) {
+ if (s2.contains("#")) {
VhdlDocGen::deleteAllChars(s2,'#');
tmpEntry->spec=VhdlDocGen::RECORD;
tmpEntry->type=s2.data();
- //outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(TYPE_T),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,s2.data(),Public);
}
else if (s2.contains("%")) {
VhdlDocGen::deleteAllChars(s2,'%');
tmpEntry->spec=VhdlDocGen::UNITS;
tmpEntry->type=s2.data();
- //outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(TYPE_T),Entry::VARIABLE_SEC,VhdlDocGen::UNITS,s2.data(),s2.data(),Public);
- }
+ }
else {
tmpEntry->spec=VhdlDocGen::TYPE;
tmpEntry->type=s2.data();
- //outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(TYPE_T),Entry::VARIABLE_SEC,VhdlDocGen::TYPE,0,s2.data(),Public);
}
+
tmpEntry.reset();
return "type "+s+" is "+s2+";";
}
@@ -1833,15 +1834,15 @@ QCString physical_literal() : {QCString s,s1;}
[LOOKAHEAD(abstract_literal()) s=abstract_literal()] s1=name(){s+=" ";s+=s1;s.prepend(" "); return s;}
}
-QCString physical_type_definition() : {QCString s,s1,s2;}
+QCString physical_type_definition() : {QCString s,s1,s2;Token *t=0;}
{
- <UNITS_T>
- s=identifier()<SEMI_T> { outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::UNITS,0,0,Public);}
+ t=<UNITS_T>
+ s=identifier()<SEMI_T> { outlineParser()->addVhdlType(s.data(),t->beginLine,Entry::VARIABLE_SEC,VhdlDocGen::UNITS,0,0,Public);}
(
s1=secondary_unit_declaration()
)*
<END_T> <UNITS_T> [name()]
- { return s+"%";}
+ { return s;}
}
@@ -2070,7 +2071,7 @@ QCString scalar_type_definition() : {QCString s,s1;}
{
LOOKAHEAD(enumeration_type_definition())
s=enumeration_type_definition(){ return s;}
-| s=range_constraint() [LOOKAHEAD( physical_type_definition()) s1=physical_type_definition()] { return s+" "+s1+"%";}
+| s=range_constraint() [ s1=physical_type_definition()] { return s+" "+s1;}
}
void secondary_unit() : {}
@@ -2079,14 +2080,12 @@ architecture_body()
| package_body()
}
-QCString secondary_unit_declaration() : {QCString s,s1;}
+QCString secondary_unit_declaration() : {QCString s,s1;Token *t1=0;}
{
-s=identifier() <EQU_T> s1=physical_literal() <SEMI_T>
+s=identifier() t1=<EQU_T> s1=physical_literal() <SEMI_T>
{
- //printf("\n %s %s [%d]",s.data(),s1.data(),outlineParser()->getLine());
- outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::UNITS,0,s1.data(),Public);
-
- return s+"="+s1; }
+ outlineParser()->addVhdlType(s.data(),t1->beginLine,Entry::VARIABLE_SEC,VhdlDocGen::UNITS,0,s1.data(),Public);
+ return s+"="+s1; }
}
QCString selected_name() : {QCString s,s1;}