Doxygen
Loading...
Searching...
No Matches
vhdljjparser.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 2014 by M. Kreis
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 */
12
13#include <string>
14
15#include "qcstring.h"
16#include "containers.h"
17#include "vhdljjparser.h"
18#include "vhdldocgen.h"
19#include "message.h"
20#include "config.h"
21#include "doxygen.h"
22#include "util.h"
23#include "language.h"
24#include "commentscan.h"
25#include "definition.h"
26#include "searchindex.h"
27#include "outputlist.h"
28#include "arguments.h"
29#include "types.h"
30#include "markdown.h"
33#include "regex.h"
34
35using namespace vhdl::parser;
36
38{
40 bool brief;
41 bool pending = false;
42 int iDocLine = 1;
43};
44
45
46static bool isConstraintFile(const QCString &fileName,const QCString &ext)
47{
48 return fileName.right(ext.length())==ext;
49}
50
51
52//-------------------------------------
53
55
86
88 const QCString &inputBuffer,bool inLine)
89{
90 CharStream *stream = new CharStream(reinterpret_cast<const JJChar*>(inputBuffer.data()), (int)inputBuffer.size(), 1, 1);
91 VhdlParserTokenManager *tokenManager = new VhdlParserTokenManager(stream);
93 vhdlParser=new VhdlParser(tokenManager);
94 vhdlParser->setOutlineParser(thisParser);
95 vhdlParser->setSharedState(&shared);
96 tokenManager->setLexParser(vhdlParser);
97 tokenManager->ReInit(stream,0);
98 tokenManager->setErrorHandler(tokErrHandler);
99 VhdlErrorHandler *parserErrHandler=new VhdlErrorHandler(fileName.data());
100 vhdlParser->setErrorHandler(parserErrHandler);
101 try
102 {
103 if(inLine)
104 {
105 vhdlParser->parseInline();
106 }
107 else
108 {
109 // vhdlParser->interface_variable_declaration(); //interface_declaration() ;
110 vhdlParser->design_file();
111 }
112 }
113 catch( std::exception &){ /* fprintf(stderr,"\n[%s]",e.what()); */ }
114 // fprintf(stderr,"\n\nparsed lines: %d\n",yyLineNr);
115 // fprintf(stderr,"\n\nerrors : %d\n\n",myErr->getErrorCount());
116 //
117 delete vhdlParser;
118 delete tokenManager;
119 delete stream;
120}
121
123{
124}
125
129
130void VHDLOutlineParser::parseInput(const QCString &fileName,const char *fileBuf,
131 const std::shared_ptr<Entry> &root, ClangTUParser *)
132{
133 VhdlParser::SharedState *s = &p->shared;
134 p->thisParser=this;
135 p->inputString=fileBuf;
136
137 // fprintf(stderr,"\n ============= %s\n ==========\n",fileBuf);
138
139 bool inLine = fileName.isEmpty();
140
141 if (!inLine) msg("Parsing file {}...\n",fileName);
142
143 p->yyFileName=fileName;
144
145 bool xilinx_ucf=isConstraintFile(p->yyFileName,".ucf");
146 bool altera_qsf=isConstraintFile(p->yyFileName,".qsf");
147
148 // support XILINX(ucf) and ALTERA (qsf) file
149
150 if (xilinx_ucf)
151 {
152 VhdlDocGen::parseUCF(fileBuf,root.get(),p->yyFileName,FALSE);
153 return;
154 }
155 if (altera_qsf)
156 {
157 VhdlDocGen::parseUCF(fileBuf,root.get(),p->yyFileName,TRUE);
158 return;
159 }
160 p->yyLineNr=1;
161 s->current_root=root;
162 s->lastCompound=nullptr;
163 s->lastEntity=nullptr;
164 p->oldEntry = nullptr;
165 s->current=std::make_shared<Entry>();
166 initEntry(s->current.get());
167 p->commentScanner.enterFile(fileName,p->yyLineNr);
168 p->lineParse.reserve(200);
169 p->parseVhdlfile(fileName,fileBuf,inLine);
170 p->commentScanner.leaveFile(fileName,p->yyLineNr);
171
172 s->current.reset();
173
174 if (!inLine)
175 mapLibPackage(root.get());
176
177 p->yyFileName.clear();
178 p->libUse.clear();
179}
180
182{
183 p->yyLineNr++;
184}
185
187{
188 if (!text.isEmpty())
189 {
190 for (const char* c=text.data() ; *c ; ++c )
191 {
192 if (*c == '\n') p->yyLineNr++;
193 }
194 }
195}
196
198{
199 e->fileName = p->yyFileName;
200 e->lang = SrcLangExt::VHDL;
201 if (p->str_doc.pending)
202 {
203 p->str_doc.pending=FALSE;
204 p->oldEntry=nullptr; // prevents endless recursion
205 p->iDocLine=p->str_doc.iDocLine;
206 handleCommentBlock(p->str_doc.doc,p->str_doc.brief);
207 p->iDocLine=-1;
208 }
209 p->commentScanner.initGroupInfo(e);
210}
211
213{
214 VhdlParser::SharedState *s = &p->shared;
215 p->previous = s->current.get();
216 if (s->current->vhdlSpec==VhdlSpecifier::ENTITY ||
217 s->current->vhdlSpec==VhdlSpecifier::PACKAGE ||
218 s->current->vhdlSpec==VhdlSpecifier::ARCHITECTURE ||
220 {
221 s->current_root->moveToSubEntryAndRefresh(s->current);
222 }
223 else
224 {
225 if (s->lastCompound)
226 {
227 s->lastCompound->moveToSubEntryAndRefresh(s->current);
228 }
229 else
230 {
231 if (s->lastEntity)
232 {
233 s->lastEntity->moveToSubEntryAndRefresh(s->current);
234 }
235 else
236 {
237 s->current_root->moveToSubEntryAndRefresh(s->current);
238 }
239 }
240 }
241 initEntry(s->current.get());
242}
243
244static int idCounter;
245
246/** returns a unique id for each record member.
247*
248* type first_rec is record
249* RE: data_type;
250* end;
251*
252* type second_rec is record
253* RE: data_type;
254* end;
255*/
256
261
263{
264 lineCount(doc);
265
267 {
268 QCString qcs(doc);
269 qcs=qcs.stripWhiteSpace();
270 qcs.stripPrefix("--#");
272 }
273}
274
276{
277 static const reg::Ex csRe(R"([\\@]code)");
278 static const reg::Ex cendRe(R"(\s*[\\@]endcode)");
279 static const reg::Ex cbriefRe(R"([\\@]brief)");
280
281 // helper to simulate behavior of QString.find(const QRegExp &re,int pos)
282 auto findRe = [](const QCString &str,const reg::Ex &re,int pos=0) -> int
283 {
284 if ((int)str.length()<pos) return -1;
285 reg::Match match;
286 if (reg::search(str.str(),match,re,pos)) // match found
287 {
288 return (int)match.position();
289 }
290 else // not found
291 {
292 return -1;
293 }
294 };
295 auto replaceRe = [](const QCString &str,const reg::Ex &re,const QCString &replacement) -> QCString
296 {
297 return reg::replace(str.str(), re, replacement.str());
298 };
299
300 int index = findRe(doc,csRe);
301
302 if (findRe(doc,cendRe)!=-1)
303 return 1;
304
305 if (index < 0)
306 return index;
307
308 VhdlParser::SharedState *s = &p->shared;
309 p->strComment += doc;
310 p->code = findRe(p->inputString,csRe, p->code + 1);
311 int com = p->inputString.find(p->strComment.data());
312 int ref = findRe(p->inputString,cendRe, p->code + 1);
313 int len = static_cast<int>(p->strComment.size());
314
315 int ll = com + len;
316 int diff = ref - ll - 3;
317 QCString code = p->inputString.mid(ll, diff);
318 int iLine = 0;
319 code = stripLeadingAndTrailingEmptyLines(code, iLine);
320 int val = code.contains('\n');
321 VhdlDocGen::prepareComment(p->strComment);
322 StringVector ql = split(p->strComment.str(),"\n");
323
324 QCString co;
325 QCString na;
326 for (const auto &qcs_ : ql)
327 {
328 QCString qcs(qcs_);
329 qcs = qcs.simplifyWhiteSpace();
330 if (findRe(qcs,csRe)!=-1)
331 {
332 int i = qcs.find('{');
333 int j = qcs.find('}');
334 if (i > 0 && j > 0 && j > i)
335 {
336 na = qcs.mid(i + 1, (j - i - 1));
337 }
338 continue;
339 }
340 qcs = replaceRe(qcs,cbriefRe, "");
341 co += qcs;
342 co += '\n';
343 }
344
346
347 Entry gBlock;
348 if (!na.isEmpty())
349 gBlock.name = na;
350 else
351 gBlock.name = "misc" + VhdlDocGen::getRecordNumber();
352 gBlock.startLine = p->yyLineNr+iLine-1;
353 gBlock.bodyLine = p->yyLineNr+iLine-1 ;
354 gBlock.doc = code;
355 gBlock.inbodyDocs = code;
356 gBlock.brief = co;
357 gBlock.section = EntryType::makeVariable();
359 gBlock.fileName = p->yyFileName;
360 gBlock.endBodyLine = p->yyLineNr + val +iLine;
361 gBlock.lang = SrcLangExt::VHDL;
362 std::shared_ptr<Entry> compound;
363
364 if (s->lastEntity)
365 compound = s->lastEntity;
366 else if (s->lastCompound)
367 compound = s->lastCompound;
368 else
369 compound = nullptr;
370
371 if (compound)
372 {
373 compound->copyToSubEntry(&gBlock);
374 }
375 else
376 {
377 gBlock.type = "misc"; // global code like library ieee...
378 s->current_root->copyToSubEntry(&gBlock);
379 }
380 p->strComment.clear();
381 return 1;
382}
383
385{
386 int position = 0;
387 bool needsEntry = FALSE;
388 VhdlParser::SharedState *s = &p->shared;
389 QCString doc = doc1;
390
391 if (doc.isEmpty())
392 return;
393
394 if (checkMultiComment(doc, p->yyLineNr))
395 {
396 p->strComment.clear();
397 return;
398 }
399
400 if (checkInlineCode(doc) > 0)
401 {
402 return;
403 }
404
405 Protection protection = Protection::Public;
407 if (doc.isEmpty()) return;
408
409 if (p->oldEntry == s->current.get())
410 {
411 p->str_doc.doc = doc;
412 p->str_doc.iDocLine = p->iDocLine;
413 p->str_doc.brief = brief;
414 p->str_doc.pending = TRUE;
415 return;
416 }
417
418 p->oldEntry = s->current.get();
419
420 if (brief)
421 {
422 s->current->briefLine = p->yyLineNr;
423 }
424 else
425 {
426 s->current->docLine = p->yyLineNr;
427 }
428
429
430
431 Markdown markdown(p->yyFileName,p->iDocLine);
432 int lineNr = p->iDocLine;
433 GuardedSectionStack guards;
434 QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc,lineNr) : doc;
435
436 while (p->commentScanner.parseCommentBlock(
437 p->thisParser,
438 s->current.get(),
439 processedDoc, // text
440 p->yyFileName, // file
441 lineNr, // line of block start
442 brief,
443 0,
444 FALSE,
445 protection,
446 position,
447 needsEntry,
448 Config_getBool(MARKDOWN_SUPPORT),
449 &guards
450 ))
451 {
452 if (needsEntry)
453 newEntry();
454 }
455 if (needsEntry)
456 {
457 if (p->varr)
458 {
459 p->varr = FALSE;
460 s->current->name = p->varName;
461 s->current->section = EntryType::makeVariableDoc();
462 p->varName = "";
463 }
464 newEntry();
465 }
466 p->iDocLine = -1;
467 p->strComment.clear();
468}
469
471{
472 p->varName=text;
473 p->varr=TRUE;
474}
475
476void VHDLOutlineParser::addCompInst(const QCString &n, const QCString &instName, const QCString &comp,int iLine)
477{
478 VhdlParser::SharedState *s = &p->shared;
480 s->current->section=EntryType::makeVariable();
481 s->current->startLine=iLine;
482 s->current->bodyLine=iLine;
483 s->current->type=instName; // foo:instname e.g proto or work. proto(ttt)
484 s->current->exception=s->genLabels.lower(); // |arch|label1:label2...
485 s->current->name=n; // foo
486 if (s->lastCompound)
487 {
488 s->current->args=s->lastCompound->name; // architecture name
489 }
490 s->current->includeName=comp; // component/entity/configuration
491 int u=s->genLabels.find("|",1);
492 if (u>0)
493 {
494 s->current->write=s->genLabels.right(s->genLabels.length()-u);
495 s->current->read=s->genLabels.left(u);
496 }
497 //printf (" \n genlabel: [%s] inst: [%s] name: [%s] %d\n",n,instName,comp,iLine);
498
499 if (s->lastCompound)
500 {
501 s->current->args=s->lastCompound->name;
502 if (true) // !findInstant(current->type))
503 {
504 initEntry(s->current.get());
505 // TODO: protect with mutex
506 g_instFiles.emplace_back(std::make_shared<Entry>(*s->current));
507 // TODO: end protect with mutex
508 }
509
510 s->current=std::make_shared<Entry>();
511 }
512 else
513 {
514 newEntry();
515 }
516}
517
518void VHDLOutlineParser::addVhdlType(const QCString &n,int startLine,EntryType section,
519 VhdlSpecifier spec,const QCString &args,const QCString &type,Protection prot)
520{
521 VhdlParser::SharedState *s = &p->shared;
523
525 {
527 }
528
529 StringVector ql=split(n.str(),",");
530
531 for (size_t u=0;u<ql.size();u++)
532 {
533 s->current->name=ql[u];
534 s->current->startLine=startLine;
535 s->current->bodyLine=startLine;
536 s->current->section=section;
537 s->current->vhdlSpec=spec;
538 s->current->fileName=p->yyFileName;
539 if (s->current->args.isEmpty())
540 {
541 s->current->args=args;
542 }
543 s->current->type=type;
544 s->current->protection=prot;
545
546 if (!s->lastCompound && section.isVariable() && (spec == VhdlSpecifier::USE || spec == VhdlSpecifier::LIBRARY) )
547 {
548 p->libUse.emplace_back(std::make_shared<Entry>(*s->current));
549 s->current->reset();
550 }
551 newEntry();
552 }
553}
554
556{
557 VhdlParser::SharedState *s = &p->shared;
558 s->current->vhdlSpec=spec;
559 s->current->section=EntryType::makeFunction();
560
561 if (impure=="impure" || impure=="pure")
562 {
563 s->current->exception=impure;
564 }
565
567 {
568 s->current->vhdlSpec=VhdlSpecifier::GENERIC;
569 s->current->section=EntryType::makeFunction();
570 }
571
573 {
574 s->current->name=impure;
575 s->current->exception="";
576 }
577 else
578 {
579 s->current->name=fname;
580 }
581
582 if (spec==VhdlSpecifier::PROCESS)
583 {
584 s->current->args=fname;
585 s->current->name=impure;
587 if (!fname.isEmpty())
588 {
589 StringVector q1=split(fname.str(),",");
590 for (const auto &name : q1)
591 {
592 Argument arg;
593 arg.name=name;
594 s->current->argList.push_back(arg);
595 }
596 }
597 }
598}
599
600
602{
603 VhdlParser::SharedState *s = &p->shared;
607 )
608 {
609 return TRUE;
610 }
611 return FALSE;
612}
613
615{
616 label+="|";
617 label+=val;
618}
619
621{
622 int i=q.findRev("|");
623 if (i<0) return QCString();
624 q = q.left(i);
625 return q;
626}
627
628
629
630void VHDLOutlineParser::addProto(const QCString &s1,const QCString &s2,const QCString &s3,
631 const QCString &s4,const QCString &s5,const QCString &s6)
632{
633 VhdlParser::SharedState *s = &p->shared;
634 (void)s5; // avoid unused warning
635 StringVector ql=split(s2.str(),",");
636
637 for (const auto &n : ql)
638 {
639 Argument arg;
640 arg.name=n;
641 if (!s3.isEmpty())
642 {
643 arg.type=s3;
644 }
645 arg.type+=" ";
646 arg.type+=s4;
647 if (!s6.isEmpty())
648 {
649 arg.type+=s6;
650 }
652 {
653 arg.defval="generic";
654 }
655
657 {
658 // assert(false);
659 }
660
661 arg.defval+=s1;
662 arg.attrib="";//s6;
663
664 s->current->argList.push_back(arg);
665 s->current->args+=s2;
666 s->current->args+=",";
667 }
668}
669
670
671/*
672 * adds the library|use statements to the next class (entity|package|architecture|package body
673 * library ieee
674 * entity xxx
675 * .....
676 * library
677 * package
678 * entity zzz
679 * .....
680 * and so on..
681 */
683{
684 for (const auto &rt : p->libUse)
685 {
686 if (addLibUseClause(rt->name))
687 {
688 bool bFound=FALSE;
689 for (const auto &current : root->children())
690 {
691 if (VhdlDocGen::isVhdlClass(current.get()))
692 {
693 if (current->startLine > rt->startLine)
694 {
695 bFound=TRUE;
696 current->copyToSubEntry(rt);
697 break;
698 }
699 }
700 }//for
701 if (!bFound)
702 {
703 root->copyToSubEntry(rt);
704 }
705 } //if
706 }// for
707}//MapLib
708
710{
711 bool showIEEESTD=Config_getBool(FORCE_LOCAL_INCLUDES);
712
713 if (showIEEESTD) // all standard packages and libraries will not be shown
714 {
715 if (type.lower().stripPrefix("ieee")) return FALSE;
716 if (type.lower().stripPrefix("std")) return FALSE;
717 }
718 return TRUE;
719}
720
722{
723 return p->yyLineNr;
724}
725
727{
728 if ((int)p->lineParse.size()<=tok) p->lineParse.resize(tok+1);
729 p->lineParse[tok]=p->yyLineNr;
730}
731
733{
734 int val=p->lineParse[tok];
735 if (val<0) val=0;
736 //assert(val>=0 && val<=yyLineNr);
737 return val;
738}
739
740
742{
743 VhdlParser::SharedState *s = &p->shared;
745 {
746 return;
747 }
748 QCString q,ret;
749
751 {
752 q=":function( ";
753 FlowChart::alignFuncProc(q,s->tempEntry->argList,true);
754 q+=")";
755 }
756 else if (s->currP==VhdlSpecifier::PROCEDURE)
757 {
758 q=":procedure (";
759 FlowChart::alignFuncProc(q,s->tempEntry->argList,false);
760 q+=")";
761 }
762 else
763 {
764 q=":process( "+s->tempEntry->args;
765 q+=")";
766 }
767
769
771
773 {
774 ret="end function ";
775 }
776 else if (s->currP==VhdlSpecifier::PROCEDURE)
777 {
778 ret="end procedure";
779 }
780 else
781 {
782 ret="end process ";
783 }
784
786 // FlowChart::printFlowList();
789}
790
792{
793 p->iDocLine=p->yyLineNr;
794}
795
797{
798 int j=qcs.find("--!");
799 qcs=qcs.right(qcs.length()-3-j);
800 if (!checkMultiComment(qcs,p->iDocLine))
801 {
803 }
804}
805
806
808{
809 VhdlParser::SharedState *s = &p->shared;
811
812 if (p->lineEntry.empty()) return false;
813
815 while (!p->lineEntry.empty())
816 {
817 std::shared_ptr<Entry> e=p->lineEntry.back();
818 e->briefLine=line;
819 e->brief+=qcs;
820
821 p->lineEntry.pop_back();
822 }
823 return true;
824}
825
826// returns the vhdl parsed types at line xxx
827void VHDLOutlineParser::insertEntryAtLine(std::shared_ptr<Entry> ce,int line)
828{
829 for (const auto &rt : ce->children())
830 {
831 if (rt->bodyLine==line)
832 {
833 p->lineEntry.push_back(rt);
834 }
835
836 insertEntryAtLine(rt,line);
837 }
838}
839
841{
842 return g_instFiles;
843}
844
846{
847 Token *op;
848 do
849 {
850 p->vhdlParser->getNextToken(); // step to next token
851 op=p->vhdlParser->getToken(1); // get first token
852 if (op==nullptr) break;
853 //fprintf(stderr,"\n %s",qPrint(t->image));
854 } while (op->kind != kind);
855 p->vhdlParser->clearError();
856 // The above loop consumes tokens all the way up to a token of
857 // "kind". We use a do-while loop rather than a while because the
858 // current token is the one immediately before the erroneous token
859 // (in our case the token immediately before what should have been
860 // "if"/"while".
861}
862
864{
865 if (s.length()<4) return s;
866 QCString result;
867 result.reserve(s.length());
868 const char *p=s.data()+3; // skip /*!
869 char c='\0';
870 while (*p == ' ' || *p == '\t') p++;
871 while ((c=*p++))
872 {
873 result+=c;
874 if (c == '\n')
875 {
876 // special handling of space followed by * at beginning of line
877 while (*p == ' ' || *p == '\t') p++;
878 while (*p == '*') p++;
879 // special attention in case character at end is /
880 if (*p == '/') p++;
881 }
882 }
883 // special attention in case */ at end of last line
884 size_t len = result.length();
885 if (len>=2 && result[len-1]=='/' && result[len-2]=='*')
886 {
887 len -= 2;
888 while (len>0 && result[len-1] == '*') len--;
889 while (len>0 && ((c = result[len-1]) == ' ' || c == '\t')) len--;
890 result.resize(len);
891 }
892 return result;
893}
JAVACC_CHAR_TYPE JJChar
Definition JavaCC.h:21
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Definition clangparser.h:25
Represents an unstructured piece of information, about an entity found in the sources.
Definition entry.h:116
VhdlSpecifier vhdlSpec
VHDL specifiers.
Definition entry.h:183
const std::vector< std::shared_ptr< Entry > > & children() const
Definition entry.h:139
int endBodyLine
line number where the definition ends
Definition entry.h:218
SrcLangExt lang
programming language in which this entry was found
Definition entry.h:227
QCString inbodyDocs
documentation inside the body of a function
Definition entry.h:206
QCString fileName
file this entry was extracted from
Definition entry.h:223
QCString type
member type
Definition entry.h:173
int startLine
start line of entry in the source
Definition entry.h:224
QCString name
member name
Definition entry.h:174
EntryType section
entry type (see Sections);
Definition entry.h:172
int bodyLine
line number of the body in the source
Definition entry.h:216
void copyToSubEntry(Entry *e)
Definition entry.cpp:156
QCString doc
documentation block (partly parsed)
Definition entry.h:200
QCString brief
brief description (doc block)
Definition entry.h:203
Wrapper class for the Entry type.
Definition types.h:813
static void alignFuncProc(QCString &q, const ArgumentList &al, bool isFunc)
static void addFlowChart(int type, const QCString &text, const QCString &exp, const QCString &label=QCString())
static void writeFlowChart()
Helper class to process markdown formatted text.
Definition markdown.h:32
QCString process(const QCString &input, int &startNewlines, bool fromParseInput=false)
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:422
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
QCString lower() const
Definition qcstring.h:249
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
void resize(size_t newlen)
Definition qcstring.h:180
const std::string & str() const
Definition qcstring.h:552
QCString & setNum(short n)
Definition qcstring.h:459
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition qcstring.cpp:190
QCString right(size_t len) const
Definition qcstring.h:234
size_t size() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:169
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
Definition qcstring.h:185
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
QCString left(size_t len) const
Definition qcstring.h:229
int contains(char c, bool cs=TRUE) const
Definition qcstring.cpp:148
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:213
int checkInlineCode(QCString &doc)
void error_skipto(int kind)
void handleCommentBlock(const QCString &doc, bool brief)
void setLineParsed(int tok)
std::unique_ptr< Private > p
void addVhdlType(const QCString &n, int startLine, EntryType section, VhdlSpecifier spec, const QCString &args, const QCString &type, Protection prot)
~VHDLOutlineParser() override
void insertEntryAtLine(std::shared_ptr< Entry > ce, int line)
void oneLineComment(QCString qcs)
void initEntry(Entry *e)
QCString popLabel(QCString &q)
void pushLabel(QCString &, QCString &)
bool addLibUseClause(const QCString &type)
void addCompInst(const QCString &n, const QCString &instName, const QCString &comp, int iLine)
bool checkMultiComment(QCString &qcs, int line)
void parsePrototype(const QCString &text) override
Callback function called by the comment block scanner.
void handleFlowComment(const QCString &)
void parseInput(const QCString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser) override
Parses a single input file with the goal to build an Entry tree.
QCString getNameID()
returns a unique id for each record member.
void createFunction(const QCString &impure, VhdlSpecifier spec, const QCString &fname)
void addProto(const QCString &s1, const QCString &s2, const QCString &s3, const QCString &s4, const QCString &s5, const QCString &s6)
void mapLibPackage(Entry *root)
static const MemberDef * getFlowMember()
static QCString getRecordNumber()
static bool isVhdlClass(const Entry *cu)
Definition vhdldocgen.h:212
static void prepareComment(QCString &)
static void parseUCF(const QCString &input, Entry *entity, const QCString &f, bool vendor)
static void deleteAllChars(QCString &s, char c)
Class representing a regular expression.
Definition regex.h:39
Object representing the matching results.
Definition regex.h:151
This class describes a character stream that maintains line and column number positions of the charac...
Definition CharStream.h:31
Describes the input token stream.
Definition Token.h:17
int kind
An integer that describes the kind of this token.
Definition Token.h:25
void setLexParser(VhdlParser *p)
Definition vhdlstring.h:20
void ReInit(JAVACC_CHARSTREAM *stream, int lexState=0)
void setErrorHandler(TokenManagerErrorHandler *eh)
Interface for the comment block scanner.
std::stack< GuardedSection > GuardedSectionStack
Definition commentscan.h:48
#define Config_getBool(name)
Definition config.h:33
std::vector< int > IntVector
Definition containers.h:38
std::vector< std::string > StringVector
Definition containers.h:33
std::vector< std::shared_ptr< Entry > > EntryList
Definition entry.h:269
#define msg(fmt,...)
Definition message.h:94
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:844
std::string replace(std::string_view str, const Ex &re, std::string_view replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
Definition regex.cpp:866
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
Web server based search engine.
This class contains the information about the argument of a function or template.
Definition arguments.h:27
QCString type
Definition arguments.h:42
QCString name
Definition arguments.h:44
QCString defval
Definition arguments.h:46
QCString attrib
Definition arguments.h:41
void parseVhdlfile(const QCString &fileName, const QCString &inputBuffer, bool inLine)
VHDLOutlineParser * thisParser
VhdlParser::SharedState shared
std::shared_ptr< Entry > lastEntity
std::shared_ptr< Entry > lastCompound
std::shared_ptr< Entry > current_root
std::shared_ptr< Entry > tempEntry
std::shared_ptr< Entry > current
This file contains a number of basic enums and types.
Protection
Definition types.h:32
VhdlSpecifier
Definition types.h:730
@ INSTANTIATION
Definition types.h:751
@ MISCELLANEOUS
Definition types.h:757
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition util.cpp:6568
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition util.cpp:4966
A bunch of utility functions.
const EntryList & getVhdlInstList()
static int idCounter
QCString filter2008VhdlComment(const QCString &s)
static EntryList g_instFiles
static bool isConstraintFile(const QCString &fileName, const QCString &ext)