Skip to content

Commit 475b0c5

Browse files
author
Dimitri van Heesch
committed
Various VHDL fixes
1 parent e5076ed commit 475b0c5

24 files changed

+1248
-1217
lines changed

src/classdef.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4234,7 +4234,13 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QC
42344234
MemberList * ml = getMemberList(lt);
42354235
MemberList * ml2 = getMemberList((MemberListType)lt2);
42364236
if (getLanguage()==SrcLangExt_VHDL) // use specific declarations function
4237-
{
4237+
{
4238+
static ClassDef *cdef;
4239+
if (cdef!=this)
4240+
{ // only one inline link
4241+
VhdlDocGen::writeInlineClassLink(this,ol);
4242+
cdef=this;
4243+
}
42384244
if (ml)
42394245
{
42404246
VhdlDocGen::writeVhdlDeclarations(ml,ol,0,this,0,0);

src/libdoxygen.pro.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ linux-g++:TMAKE_CXXFLAGS += -fno-exceptions
231231
INCLUDEPATH += ../generated_src/doxygen ../src ../qtools ../libmd5 ../vhdlparser
232232
INCLUDEPATH += %%SQLITE3_INC%%
233233
INCLUDEPATH += %%LIBCLANG_INC%%
234-
DEPENDPATH += ../generated_src/doxygen
234+
DEPENDPATH += ../generated_src/doxygen ../qtools ../libmd5 ../vhdlparser
235235
win32:INCLUDEPATH += .
236236
DESTDIR = ../lib
237237
TARGET = doxygen

src/vhdldocgen.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,21 +1785,6 @@ QCString VhdlDocGen::convertArgumentListToString(const ArgumentList* al,bool fun
17851785
void VhdlDocGen::writeVhdlDeclarations(MemberList* ml,
17861786
OutputList& ol,GroupDef* gd,ClassDef* cd,FileDef *fd,NamespaceDef* nd)
17871787
{
1788-
static ClassDef *cdef;
1789-
//static GroupDef* gdef;
1790-
if (cd && cdef!=cd)
1791-
{ // only one inline link
1792-
VhdlDocGen::writeInlineClassLink(cd,ol);
1793-
cdef=cd;
1794-
}
1795-
1796-
/*
1797-
if (gd && gdef==gd) return;
1798-
if (gd && gdef!=gd)
1799-
{
1800-
gdef=gd;
1801-
}
1802-
*/
18031788
VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::LIBRARY,FALSE),0,FALSE,VhdlDocGen::LIBRARY);
18041789
VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::USE,FALSE),0,FALSE,VhdlDocGen::USE);
18051790
VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,theTranslator_vhdlType(VhdlDocGen::FUNCTION,FALSE),0,FALSE,VhdlDocGen::FUNCTION);

src/vhdljjparser.cpp

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,6 @@ static int iDocLine = -1;
4242
static QCString inputString;
4343
static Entry gBlock;
4444
static Entry* previous = 0;
45-
#if 0
46-
int iLine;
47-
QStringList qrl;
48-
ParserInterface *g_thisParser;
49-
int inputPosition;
50-
int inputLen;
51-
int startComment = 0;
52-
QFile inputFile;
53-
QCString inbuf;
54-
55-
QCString yyFileName;
56-
bool g_lexInit = FALSE;
57-
int yyLineNr = 1;
58-
int g_lastCommentContext = 0;
59-
bool docBlockAutoBrief;
60-
char docBlockTerm;
61-
int iDocLine = -1;
62-
int num_chars;
63-
int* lineParse;
64-
#endif
6545
//-------------------------------------------------------
6646

6747
static Entry* oldEntry;
@@ -124,7 +104,6 @@ void startCodeBlock(int index)
124104
int ll=strComment.length();
125105
iCodeLen=inputString.findRev(strComment.data())+ll;
126106
// fprintf(stderr,"\n startin code..%d %d %d\n",iCodeLen,num_chars,ll);
127-
//assert(false);
128107
gBlock.reset();
129108
int len=strComment.length();
130109
QCString name=strComment.right(len-index);//
@@ -134,8 +113,6 @@ void startCodeBlock(int index)
134113
else
135114
gBlock.name=name;
136115

137-
//int li=strComment.contains('\n');
138-
139116
gBlock.startLine=yyLineNr;
140117
gBlock.bodyLine=yyLineNr;
141118

@@ -232,7 +209,10 @@ void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,En
232209
VhdlDocGen::resetCodeVhdlParserState();
233210
}
234211

235-
void VhdlParser::lineCount(){ yyLineNr++; }
212+
void VhdlParser::lineCount()
213+
{
214+
yyLineNr++;
215+
}
236216

237217
void VhdlParser::lineCount(const char* text)
238218
{
@@ -309,7 +289,6 @@ bool checkInlineCode(QCString & doc)
309289

310290
void VhdlParser::handleFlowComment(const char* doc)
311291
{
312-
lineCount(doc);
313292
if (VhdlDocGen::getFlowMember())
314293
{
315294
QCString qcs(doc);
@@ -319,6 +298,7 @@ void VhdlParser::handleFlowComment(const char* doc)
319298
}
320299
}
321300

301+
322302
void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
323303
{
324304
int position=0;
@@ -328,7 +308,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
328308

329309
if (checkMultiComment(doc,yyLineNr))
330310
{
331-
lineCount(doc1);
311+
strComment.resize(0);
332312
return;
333313
}
334314

@@ -345,15 +325,16 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
345325
if (isIn)
346326
{
347327
isIn=false;
348-
lineCount(doc1);
349328
return;
350329
}
351330

352331
VhdlDocGen::prepareComment(doc);
353332

354333
bool needsEntry=FALSE;
355334
Protection protection=Public;
356-
int lineNr = iDocLine;
335+
int lineNr;
336+
if (iDocLine==-1)
337+
lineNr=yyLineNr;
357338

358339
if (oldEntry==current)
359340
{
@@ -375,13 +356,13 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
375356
{
376357
current->docLine = yyLineNr;
377358
}
378-
// printf("parseCommentBlock file<%s>\n [%s]\n",yyFileName.data(),doc.data());
359+
// printf("parseCommentBlock file<%s>\n [%s]\n at line [%d] \n ",yyFileName.data(),doc.data(),iDocLine);
379360
while (parseCommentBlock(
380361
g_thisParser,
381362
current,
382363
doc, // text
383364
yyFileName, // file
384-
lineNr, // line of block start
365+
iDocLine, // line of block start
385366
brief,
386367
0,
387368
FALSE,
@@ -405,7 +386,8 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
405386
}
406387
newEntry();
407388
}
408-
lineCount(doc1);
389+
iDocLine=-1;
390+
strComment.resize(0);
409391
}
410392

411393
void VHDLLanguageScanner::parsePrototype(const char *text)
@@ -571,12 +553,10 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
571553
QCString ent,arch,lab;
572554
QCString l=genLabels;
573555
ent=a;
574-
// lab = VhdlDocGen::parseForConfig(ent,arch);
575556

576557
if (b)
577558
{
578559
ent=b;
579-
// lab=VhdlDocGen::parseForBinding(ent,arch);
580560
}
581561
int level=0;
582562

@@ -619,8 +599,7 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
619599
}
620600

621601
configL.append(co);
622-
623-
}// addConfigure
602+
}
624603

625604

626605
void VhdlParser::addProto(const char *s1,const char *s2,const char *s3,
@@ -788,23 +767,55 @@ void VhdlParser::createFlow()
788767
currP=0;
789768
}
790769

770+
void VhdlParser::setMultCommentLine()
771+
{
772+
iDocLine=yyLineNr;
773+
}
774+
775+
void VhdlParser::oneLineComment(QCString qcs)
776+
{
777+
bool isEndCode=qcs.contains("\\endcode");
778+
779+
int index = qcs.find("\\code");
780+
if (isEndCode)
781+
{
782+
int end = inputString.find(qcs.data(),iCodeLen);
783+
makeInlineDoc(end);
784+
}
785+
else if (index > 0)
786+
{
787+
// assert(false);
788+
strComment=qcs;
789+
startCodeBlock(index);
790+
strComment.resize(0);
791+
}
792+
793+
if (!isEndCode && index==-1)
794+
{
795+
int j=qcs.find("--!");
796+
qcs=qcs.right(qcs.length()-3-j);
797+
if (!checkMultiComment(qcs,iDocLine))
798+
{
799+
handleCommentBlock(qcs,TRUE);
800+
}
801+
}
802+
}
803+
804+
791805
bool checkMultiComment(QCString& qcs,int line)
792806
{
793807
QList<Entry> *pTemp=getEntryAtLine(VhdlParser::current_root,line);
794808

795809
if (pTemp->isEmpty()) return false;
796810

797-
//int ii=pTemp->count();
798-
// qcs.stripPrefix("--!");
799811
VhdlDocGen::prepareComment(qcs);
800812
while (!pTemp->isEmpty())
801813
{
802814
Entry *e=(Entry*)pTemp->getFirst();
803815
e->briefLine=line;
804816
e->brief+=qcs;
805-
iDocLine=-1;
817+
806818
pTemp->removeFirst();
807-
//ii=pTemp->count();
808819
}
809820
return true;
810821
}
@@ -819,7 +830,7 @@ QList<Entry>* getEntryAtLine(const Entry* ce,int line)
819830
if (rt->bodyLine==line)
820831
{
821832
lineEntry.insert(0,rt);
822-
} // if
833+
}
823834

824835
getEntryAtLine(rt,line);
825836
}

vhdlparser/CharStream.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.0 */
1+
/* Generated By:JavaCC: Do not edit this line. CharStream.cc Version 6.2 */
22
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
33
#include "CharStream.h"
44

@@ -209,4 +209,4 @@ void CharStream::UpdateLineColumn(JAVACC_CHAR_TYPE c) {
209209

210210
}
211211
}
212-
/* JavaCC - OriginalChecksum=e709b9ee1adf0fcb6b1c5e1641f10348 (do not edit this line) */
212+
/* JavaCC - OriginalChecksum=ade3c1b57a731a003629de593814ffa6 (do not edit this line) */

0 commit comments

Comments
 (0)