@@ -42,26 +42,6 @@ static int iDocLine = -1;
42
42
static QCString inputString;
43
43
static Entry gBlock ;
44
44
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
65
45
// -------------------------------------------------------
66
46
67
47
static Entry* oldEntry;
@@ -124,7 +104,6 @@ void startCodeBlock(int index)
124
104
int ll=strComment.length ();
125
105
iCodeLen=inputString.findRev (strComment.data ())+ll;
126
106
// fprintf(stderr,"\n startin code..%d %d %d\n",iCodeLen,num_chars,ll);
127
- // assert(false);
128
107
gBlock .reset ();
129
108
int len=strComment.length ();
130
109
QCString name=strComment.right (len-index );//
@@ -134,8 +113,6 @@ void startCodeBlock(int index)
134
113
else
135
114
gBlock .name =name;
136
115
137
- // int li=strComment.contains('\n');
138
-
139
116
gBlock .startLine =yyLineNr;
140
117
gBlock .bodyLine =yyLineNr;
141
118
@@ -232,7 +209,10 @@ void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,En
232
209
VhdlDocGen::resetCodeVhdlParserState ();
233
210
}
234
211
235
- void VhdlParser::lineCount (){ yyLineNr++; }
212
+ void VhdlParser::lineCount ()
213
+ {
214
+ yyLineNr++;
215
+ }
236
216
237
217
void VhdlParser::lineCount (const char * text)
238
218
{
@@ -309,7 +289,6 @@ bool checkInlineCode(QCString & doc)
309
289
310
290
void VhdlParser::handleFlowComment (const char * doc)
311
291
{
312
- lineCount (doc);
313
292
if (VhdlDocGen::getFlowMember ())
314
293
{
315
294
QCString qcs (doc);
@@ -319,6 +298,7 @@ void VhdlParser::handleFlowComment(const char* doc)
319
298
}
320
299
}
321
300
301
+
322
302
void VhdlParser::handleCommentBlock (const char * doc1,bool brief)
323
303
{
324
304
int position=0 ;
@@ -328,7 +308,7 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
328
308
329
309
if (checkMultiComment (doc,yyLineNr))
330
310
{
331
- lineCount (doc1 );
311
+ strComment. resize ( 0 );
332
312
return ;
333
313
}
334
314
@@ -345,15 +325,16 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
345
325
if (isIn)
346
326
{
347
327
isIn=false ;
348
- lineCount (doc1);
349
328
return ;
350
329
}
351
330
352
331
VhdlDocGen::prepareComment (doc);
353
332
354
333
bool needsEntry=FALSE ;
355
334
Protection protection=Public;
356
- int lineNr = iDocLine;
335
+ int lineNr;
336
+ if (iDocLine==-1 )
337
+ lineNr=yyLineNr;
357
338
358
339
if (oldEntry==current)
359
340
{
@@ -375,13 +356,13 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
375
356
{
376
357
current->docLine = yyLineNr;
377
358
}
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 );
379
360
while (parseCommentBlock (
380
361
g_thisParser,
381
362
current,
382
363
doc, // text
383
364
yyFileName, // file
384
- lineNr, // line of block start
365
+ iDocLine, // line of block start
385
366
brief,
386
367
0 ,
387
368
FALSE ,
@@ -405,7 +386,8 @@ void VhdlParser::handleCommentBlock(const char* doc1,bool brief)
405
386
}
406
387
newEntry ();
407
388
}
408
- lineCount (doc1);
389
+ iDocLine=-1 ;
390
+ strComment.resize (0 );
409
391
}
410
392
411
393
void VHDLLanguageScanner::parsePrototype (const char *text)
@@ -571,12 +553,10 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
571
553
QCString ent,arch,lab;
572
554
QCString l=genLabels;
573
555
ent=a;
574
- // lab = VhdlDocGen::parseForConfig(ent,arch);
575
556
576
557
if (b)
577
558
{
578
559
ent=b;
579
- // lab=VhdlDocGen::parseForBinding(ent,arch);
580
560
}
581
561
int level=0 ;
582
562
@@ -619,8 +599,7 @@ void VhdlParser::addConfigureNode(const char* a,const char*b, bool,bool isLeaf,b
619
599
}
620
600
621
601
configL.append (co);
622
-
623
- }// addConfigure
602
+ }
624
603
625
604
626
605
void VhdlParser::addProto (const char *s1,const char *s2,const char *s3,
@@ -788,23 +767,55 @@ void VhdlParser::createFlow()
788
767
currP=0 ;
789
768
}
790
769
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
+
791
805
bool checkMultiComment (QCString& qcs,int line)
792
806
{
793
807
QList<Entry> *pTemp=getEntryAtLine (VhdlParser::current_root,line);
794
808
795
809
if (pTemp->isEmpty ()) return false ;
796
810
797
- // int ii=pTemp->count();
798
- // qcs.stripPrefix("--!");
799
811
VhdlDocGen::prepareComment (qcs);
800
812
while (!pTemp->isEmpty ())
801
813
{
802
814
Entry *e=(Entry*)pTemp->getFirst ();
803
815
e->briefLine =line;
804
816
e->brief +=qcs;
805
- iDocLine=- 1 ;
817
+
806
818
pTemp->removeFirst ();
807
- // ii=pTemp->count();
808
819
}
809
820
return true ;
810
821
}
@@ -819,7 +830,7 @@ QList<Entry>* getEntryAtLine(const Entry* ce,int line)
819
830
if (rt->bodyLine ==line)
820
831
{
821
832
lineEntry.insert (0 ,rt);
822
- } // if
833
+ }
823
834
824
835
getEntryAtLine (rt,line);
825
836
}
0 commit comments