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 "growbuf.h"
31#include "markdown.h"
34#include "regex.h"
35
36using namespace vhdl::parser;
37
39{
41 bool brief;
42 bool pending = false;
43 int iDocLine = 1;
44};
45
46
47static bool isConstraintFile(const QCString &fileName,const QCString &ext)
48{
49 return fileName.right(ext.length())==ext;
50}
51
52
53//-------------------------------------
54
56
87
89 const QCString &inputBuffer,bool inLine)
90{
91 QCString s =inputBuffer;
92 CharStream *stream = new CharStream(reinterpret_cast<const JJChar*>(s.data()), (int)s.size(), 1, 1);
93 VhdlParserTokenManager *tokenManager = new VhdlParserTokenManager(stream);
95 vhdlParser=new VhdlParser(tokenManager);
96 vhdlParser->setOutlineParser(thisParser);
97 vhdlParser->setSharedState(&shared);
98 tokenManager->setLexParser(vhdlParser);
99 tokenManager->ReInit(stream,0);
100 tokenManager->setErrorHandler(tokErrHandler);
101 VhdlErrorHandler *parserErrHandler=new VhdlErrorHandler(fileName.data());
102 vhdlParser->setErrorHandler(parserErrHandler);
103 try
104 {
105 if(inLine)
106 {
107 vhdlParser->parseInline();
108 }
109 else
110 {
111 // vhdlParser->interface_variable_declaration(); //interface_declaration() ;
112 vhdlParser->design_file();
113 }
114 }
115 catch( std::exception &){ /* fprintf(stderr,"\n[%s]",e.what()); */ }
116 // fprintf(stderr,"\n\nparsed lines: %d\n",yyLineNr);
117 // fprintf(stderr,"\n\nerrors : %d\n\n",myErr->getErrorCount());
118 //
119 delete vhdlParser;
120 delete tokenManager;
121 delete stream;
122}
123
125{
126}
127
131
132void VHDLOutlineParser::parseInput(const QCString &fileName,const char *fileBuf,
133 const std::shared_ptr<Entry> &root, ClangTUParser *)
134{
135 VhdlParser::SharedState *s = &p->shared;
136 p->thisParser=this;
137 p->inputString=fileBuf;
138
139 // fprintf(stderr,"\n ============= %s\n ==========\n",fileBuf);
140
141 bool inLine = fileName.isEmpty();
142
143 if (!inLine) msg("Parsing file %s...\n",qPrint(fileName));
144
145 p->yyFileName=fileName;
146
147 bool xilinx_ucf=isConstraintFile(p->yyFileName,".ucf");
148 bool altera_qsf=isConstraintFile(p->yyFileName,".qsf");
149
150 // support XILINX(ucf) and ALTERA (qsf) file
151
152 if (xilinx_ucf)
153 {
154 VhdlDocGen::parseUCF(fileBuf,root.get(),p->yyFileName,FALSE);
155 return;
156 }
157 if (altera_qsf)
158 {
159 VhdlDocGen::parseUCF(fileBuf,root.get(),p->yyFileName,TRUE);
160 return;
161 }
162 p->yyLineNr=1;
163 s->current_root=root;
164 s->lastCompound=nullptr;
165 s->lastEntity=nullptr;
166 p->oldEntry = nullptr;
167 s->current=std::make_shared<Entry>();
168 initEntry(s->current.get());
169 p->commentScanner.enterFile(fileName,p->yyLineNr);
170 p->lineParse.reserve(200);
171 p->parseVhdlfile(fileName,fileBuf,inLine);
172 p->commentScanner.leaveFile(fileName,p->yyLineNr);
173
174 s->current.reset();
175
176 if (!inLine)
177 mapLibPackage(root.get());
178
179 p->yyFileName.clear();
180 p->libUse.clear();
181}
182
184{
185 p->yyLineNr++;
186}
187
189{
190 if (!text.isEmpty())
191 {
192 for (const char* c=text.data() ; *c ; ++c )
193 {
194 if (*c == '\n') p->yyLineNr++;
195 }
196 }
197}
198
200{
201 e->fileName = p->yyFileName;
203 if (p->str_doc.pending)
204 {
205 p->str_doc.pending=FALSE;
206 p->oldEntry=nullptr; // prevents endless recursion
207 p->iDocLine=p->str_doc.iDocLine;
208 handleCommentBlock(p->str_doc.doc,p->str_doc.brief);
209 p->iDocLine=-1;
210 }
211 p->commentScanner.initGroupInfo(e);
212}
213
215{
216 VhdlParser::SharedState *s = &p->shared;
217 p->previous = s->current.get();
218 if (s->current->vhdlSpec==VhdlSpecifier::ENTITY ||
219 s->current->vhdlSpec==VhdlSpecifier::PACKAGE ||
220 s->current->vhdlSpec==VhdlSpecifier::ARCHITECTURE ||
222 {
223 s->current_root->moveToSubEntryAndRefresh(s->current);
224 }
225 else
226 {
227 if (s->lastCompound)
228 {
229 s->lastCompound->moveToSubEntryAndRefresh(s->current);
230 }
231 else
232 {
233 if (s->lastEntity)
234 {
235 s->lastEntity->moveToSubEntryAndRefresh(s->current);
236 }
237 else
238 {
239 s->current_root->moveToSubEntryAndRefresh(s->current);
240 }
241 }
242 }
243 initEntry(s->current.get());
244}
245
246static int idCounter;
247
248/** returns a unique id for each record member.
249*
250* type first_rec is record
251* RE: data_type;
252* end;
253*
254* type second_rec is record
255* RE: data_type;
256* end;
257*/
258
263
265{
266 lineCount(doc);
267
269 {
270 QCString qcs(doc);
271 qcs=qcs.stripWhiteSpace();
272 qcs.stripPrefix("--#");
274 }
275}
276
278{
279 static const reg::Ex csRe(R"([\\@]code)");
280 static const reg::Ex cendRe(R"(\s*[\\@]endcode)");
281 static const reg::Ex cbriefRe(R"([\\@]brief)");
282
283 // helper to simulate behavior of QString.find(const QRegExp &re,int pos)
284 auto findRe = [](const QCString &str,const reg::Ex &re,int pos=0) -> int
285 {
286 if ((int)str.length()<pos) return -1;
287 reg::Match match;
288 const std::string s = str.str();
289 if (reg::search(s,match,re,pos)) // match found
290 {
291 return (int)match.position();
292 }
293 else // not found
294 {
295 return -1;
296 }
297 };
298 auto replaceRe = [](const QCString &str,const reg::Ex &re,const QCString &replacement) -> QCString
299 {
300 return reg::replace(str.str(), re, replacement.str());
301 };
302
303 int index = findRe(doc,csRe);
304
305 if (findRe(doc,cendRe)!=-1)
306 return 1;
307
308 if (index < 0)
309 return index;
310
311 VhdlParser::SharedState *s = &p->shared;
312 p->strComment += doc;
313 p->code = findRe(p->inputString,csRe, p->code + 1);
314 int com = p->inputString.find(p->strComment.data());
315 int ref = findRe(p->inputString,cendRe, p->code + 1);
316 int len = static_cast<int>(p->strComment.size());
317
318 int ll = com + len;
319 int diff = ref - ll - 3;
320 QCString code = p->inputString.mid(ll, diff);
321 int iLine = 0;
322 code = stripLeadingAndTrailingEmptyLines(code, iLine);
323 int val = code.contains('\n');
324 VhdlDocGen::prepareComment(p->strComment);
325 StringVector ql = split(p->strComment.str(),"\n");
326
327 QCString co;
328 QCString na;
329 for (const auto &qcs_ : ql)
330 {
331 QCString qcs(qcs_);
332 qcs = qcs.simplifyWhiteSpace();
333 if (findRe(qcs,csRe)!=-1)
334 {
335 int i = qcs.find('{');
336 int j = qcs.find('}');
337 if (i > 0 && j > 0 && j > i)
338 {
339 na = qcs.mid(i + 1, (j - i - 1));
340 }
341 continue;
342 }
343 qcs = replaceRe(qcs,cbriefRe, "");
344 co += qcs;
345 co += '\n';
346 }
347
349
350 Entry gBlock;
351 if (!na.isEmpty())
352 gBlock.name = na;
353 else
354 gBlock.name = "misc" + VhdlDocGen::getRecordNumber();
355 gBlock.startLine = p->yyLineNr+iLine-1;
356 gBlock.bodyLine = p->yyLineNr+iLine-1 ;
357 gBlock.doc = code;
358 gBlock.inbodyDocs = code;
359 gBlock.brief = co;
360 gBlock.section = EntryType::makeVariable();
362 gBlock.fileName = p->yyFileName;
363 gBlock.endBodyLine = p->yyLineNr + val +iLine;
364 gBlock.lang = SrcLangExt::VHDL;
365 std::shared_ptr<Entry> compound;
366
367 if (s->lastEntity)
368 compound = s->lastEntity;
369 else if (s->lastCompound)
370 compound = s->lastCompound;
371 else
372 compound = nullptr;
373
374 if (compound)
375 {
376 compound->copyToSubEntry(&gBlock);
377 }
378 else
379 {
380 gBlock.type = "misc"; // global code like library ieee...
381 s->current_root->copyToSubEntry(&gBlock);
382 }
383 p->strComment.clear();
384 return 1;
385}
386
388{
389 int position = 0;
390 bool needsEntry = FALSE;
391 VhdlParser::SharedState *s = &p->shared;
392 QCString doc = doc1;
393
394 if (doc.isEmpty())
395 return;
396
397 if (checkMultiComment(doc, p->yyLineNr))
398 {
399 p->strComment.clear();
400 return;
401 }
402
403 if (checkInlineCode(doc) > 0)
404 {
405 return;
406 }
407
408 Protection protection = Protection::Public;
410 if (doc.isEmpty()) return;
411
412 if (p->oldEntry == s->current.get())
413 {
414 p->str_doc.doc = doc;
415 p->str_doc.iDocLine = p->iDocLine;
416 p->str_doc.brief = brief;
417 p->str_doc.pending = TRUE;
418 return;
419 }
420
421 p->oldEntry = s->current.get();
422
423 if (brief)
424 {
425 s->current->briefLine = p->yyLineNr;
426 }
427 else
428 {
429 s->current->docLine = p->yyLineNr;
430 }
431
432
433
434 Markdown markdown(p->yyFileName,p->iDocLine);
435 int lineNr = p->iDocLine;
436 GuardedSectionStack guards;
437 QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc,lineNr) : doc;
438
439 while (p->commentScanner.parseCommentBlock(
440 p->thisParser,
441 s->current.get(),
442 processedDoc, // text
443 p->yyFileName, // file
444 lineNr, // line of block start
445 brief,
446 0,
447 FALSE,
448 protection,
449 position,
450 needsEntry,
451 Config_getBool(MARKDOWN_SUPPORT),
452 &guards
453 ))
454 {
455 if (needsEntry)
456 newEntry();
457 }
458 if (needsEntry)
459 {
460 if (p->varr)
461 {
462 p->varr = FALSE;
463 s->current->name = p->varName;
464 s->current->section = EntryType::makeVariableDoc();
465 p->varName = "";
466 }
467 newEntry();
468 }
469 p->iDocLine = -1;
470 p->strComment.clear();
471}
472
474{
475 p->varName=text;
476 p->varr=TRUE;
477}
478
479void VHDLOutlineParser::addCompInst(const QCString &n, const QCString &instName, const QCString &comp,int iLine)
480{
481 VhdlParser::SharedState *s = &p->shared;
483 s->current->section=EntryType::makeVariable();
484 s->current->startLine=iLine;
485 s->current->bodyLine=iLine;
486 s->current->type=instName; // foo:instname e.g proto or work. proto(ttt)
487 s->current->exception=s->genLabels.lower(); // |arch|label1:label2...
488 s->current->name=n; // foo
489 if (s->lastCompound)
490 {
491 s->current->args=s->lastCompound->name; // architecture name
492 }
493 s->current->includeName=comp; // component/entity/configuration
494 int u=s->genLabels.find("|",1);
495 if (u>0)
496 {
497 s->current->write=s->genLabels.right(s->genLabels.length()-u);
498 s->current->read=s->genLabels.left(u);
499 }
500 //printf (" \n genlabel: [%s] inst: [%s] name: [%s] %d\n",n,instName,comp,iLine);
501
502 if (s->lastCompound)
503 {
504 s->current->args=s->lastCompound->name;
505 if (true) // !findInstant(current->type))
506 {
507 initEntry(s->current.get());
508 // TODO: protect with mutex
509 g_instFiles.emplace_back(std::make_shared<Entry>(*s->current));
510 // TODO: end protect with mutex
511 }
512
513 s->current=std::make_shared<Entry>();
514 }
515 else
516 {
517 newEntry();
518 }
519}
520
521void VHDLOutlineParser::addVhdlType(const QCString &n,int startLine,EntryType section,
522 VhdlSpecifier spec,const QCString &args,const QCString &type,Protection prot)
523{
524 VhdlParser::SharedState *s = &p->shared;
525 QCString name(n);
527
529 {
531 }
532
533 StringVector ql=split(name.str(),",");
534
535 for (size_t u=0;u<ql.size();u++)
536 {
537 s->current->name=ql[u];
538 s->current->startLine=startLine;
539 s->current->bodyLine=startLine;
540 s->current->section=section;
541 s->current->vhdlSpec=spec;
542 s->current->fileName=p->yyFileName;
543 if (s->current->args.isEmpty())
544 {
545 s->current->args=args;
546 }
547 s->current->type=type;
548 s->current->protection=prot;
549
550 if (!s->lastCompound && section.isVariable() && (spec == VhdlSpecifier::USE || spec == VhdlSpecifier::LIBRARY) )
551 {
552 p->libUse.emplace_back(std::make_shared<Entry>(*s->current));
553 s->current->reset();
554 }
555 newEntry();
556 }
557}
558
560{
561 VhdlParser::SharedState *s = &p->shared;
562 s->current->vhdlSpec=spec;
563 s->current->section=EntryType::makeFunction();
564
565 if (impure=="impure" || impure=="pure")
566 {
567 s->current->exception=impure;
568 }
569
571 {
572 s->current->vhdlSpec=VhdlSpecifier::GENERIC;
573 s->current->section=EntryType::makeFunction();
574 }
575
577 {
578 s->current->name=impure;
579 s->current->exception="";
580 }
581 else
582 {
583 s->current->name=fname;
584 }
585
586 if (spec==VhdlSpecifier::PROCESS)
587 {
588 s->current->args=fname;
589 s->current->name=impure;
591 if (!fname.isEmpty())
592 {
593 StringVector q1=split(fname.str(),",");
594 for (const auto &name : q1)
595 {
596 Argument arg;
597 arg.name=name;
598 s->current->argList.push_back(arg);
599 }
600 }
601 }
602}
603
604
606{
607 VhdlParser::SharedState *s = &p->shared;
611 )
612 {
613 return TRUE;
614 }
615 return FALSE;
616}
617
619{
620 label+="|";
621 label+=val;
622}
623
625{
626 int i=q.findRev("|");
627 if (i<0) return QCString();
628 q = q.left(i);
629 return q;
630}
631
632
633
634void VHDLOutlineParser::addProto(const QCString &s1,const QCString &s2,const QCString &s3,
635 const QCString &s4,const QCString &s5,const QCString &s6)
636{
637 VhdlParser::SharedState *s = &p->shared;
638 (void)s5; // avoid unused warning
639 QCString name=s2;
640 StringVector ql=split(name.str(),",");
641
642 for (const auto &n : ql)
643 {
644 Argument arg;
645 arg.name=n;
646 if (!s3.isEmpty())
647 {
648 arg.type=s3;
649 }
650 arg.type+=" ";
651 arg.type+=s4;
652 if (!s6.isEmpty())
653 {
654 arg.type+=s6;
655 }
657 {
658 arg.defval="generic";
659 }
660
662 {
663 // assert(false);
664 }
665
666 arg.defval+=s1;
667 arg.attrib="";//s6;
668
669 s->current->argList.push_back(arg);
670 s->current->args+=s2;
671 s->current->args+=",";
672 }
673}
674
675
676/*
677 * adds the library|use statements to the next class (entity|package|architecture|package body
678 * library ieee
679 * entity xxx
680 * .....
681 * library
682 * package
683 * entity zzz
684 * .....
685 * and so on..
686 */
688{
689 for (const auto &rt : p->libUse)
690 {
691 if (addLibUseClause(rt->name))
692 {
693 bool bFound=FALSE;
694 for (const auto &current : root->children())
695 {
696 if (VhdlDocGen::isVhdlClass(current.get()))
697 {
698 if (current->startLine > rt->startLine)
699 {
700 bFound=TRUE;
701 current->copyToSubEntry(rt);
702 break;
703 }
704 }
705 }//for
706 if (!bFound)
707 {
708 root->copyToSubEntry(rt);
709 }
710 } //if
711 }// for
712}//MapLib
713
715{
716 bool showIEEESTD=Config_getBool(FORCE_LOCAL_INCLUDES);
717
718 if (showIEEESTD) // all standard packages and libraries will not be shown
719 {
720 if (type.lower().stripPrefix("ieee")) return FALSE;
721 if (type.lower().stripPrefix("std")) return FALSE;
722 }
723 return TRUE;
724}
725
727{
728 return p->yyLineNr;
729}
730
732{
733 if ((int)p->lineParse.size()<=tok) p->lineParse.resize(tok+1);
734 p->lineParse[tok]=p->yyLineNr;
735}
736
738{
739 int val=p->lineParse[tok];
740 if (val<0) val=0;
741 //assert(val>=0 && val<=yyLineNr);
742 return val;
743}
744
745
747{
748 VhdlParser::SharedState *s = &p->shared;
750 {
751 return;
752 }
753 QCString q,ret;
754
756 {
757 q=":function( ";
758 FlowChart::alignFuncProc(q,s->tempEntry->argList,true);
759 q+=")";
760 }
761 else if (s->currP==VhdlSpecifier::PROCEDURE)
762 {
763 q=":procedure (";
764 FlowChart::alignFuncProc(q,s->tempEntry->argList,false);
765 q+=")";
766 }
767 else
768 {
769 q=":process( "+s->tempEntry->args;
770 q+=")";
771 }
772
774
776
778 {
779 ret="end function ";
780 }
781 else if (s->currP==VhdlSpecifier::PROCEDURE)
782 {
783 ret="end procedure";
784 }
785 else
786 {
787 ret="end process ";
788 }
789
791 // FlowChart::printFlowList();
794}
795
797{
798 p->iDocLine=p->yyLineNr;
799}
800
802{
803 int j=qcs.find("--!");
804 qcs=qcs.right(qcs.length()-3-j);
805 if (!checkMultiComment(qcs,p->iDocLine))
806 {
808 }
809}
810
811
813{
814 VhdlParser::SharedState *s = &p->shared;
816
817 if (p->lineEntry.empty()) return false;
818
820 while (!p->lineEntry.empty())
821 {
822 std::shared_ptr<Entry> e=p->lineEntry.back();
823 e->briefLine=line;
824 e->brief+=qcs;
825
826 p->lineEntry.pop_back();
827 }
828 return true;
829}
830
831// returns the vhdl parsed types at line xxx
832void VHDLOutlineParser::insertEntryAtLine(std::shared_ptr<Entry> ce,int line)
833{
834 for (const auto &rt : ce->children())
835 {
836 if (rt->bodyLine==line)
837 {
838 p->lineEntry.push_back(rt);
839 }
840
841 insertEntryAtLine(rt,line);
842 }
843}
844
846{
847 return g_instFiles;
848}
849
851{
852 Token *op;
853 do
854 {
855 p->vhdlParser->getNextToken(); // step to next token
856 op=p->vhdlParser->getToken(1); // get first token
857 if (op==nullptr) break;
858 //fprintf(stderr,"\n %s",qPrint(t->image));
859 } while (op->kind != kind);
860 p->vhdlParser->clearError();
861 // The above loop consumes tokens all the way up to a token of
862 // "kind". We use a do-while loop rather than a while because the
863 // current token is the one immediately before the erroneous token
864 // (in our case the token immediately before what should have been
865 // "if"/"while".
866}
867
869{
870 if (s.length()<4) return s;
871 GrowBuf growBuf;
872 const char *p=s.data()+3; // skip /*!
873 char c='\0';
874 while (*p == ' ' || *p == '\t') p++;
875 while ((c=*p++))
876 {
877 growBuf.addChar(c);
878 if (c == '\n')
879 {
880 // special handling of space followed by * at beginning of line
881 while (*p == ' ' || *p == '\t') p++;
882 while (*p == '*') p++;
883 // special attention in case character at end is /
884 if (*p == '/') p++;
885 }
886 }
887 // special attention in case */ at end of last line
888 size_t len = growBuf.getPos();
889 if (len>=2 && growBuf.at(len-1) == '/' && growBuf.at(len-2) == '*')
890 {
891 len -= 2;
892 while (len>0 && growBuf.at(len-1) == '*') len--;
893 while (len>0 && ((c = growBuf.at(len-1)) == ' ' || c == '\t')) len--;
894 growBuf.setPos(len);
895 }
896 growBuf.addChar(0);
897 return growBuf.get();
898}
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:631
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()
Class representing a string buffer optimized for growing.
Definition growbuf.h:28
size_t getPos() const
Definition growbuf.h:116
void addChar(char c)
Definition growbuf.h:69
const char & at(size_t i) const
Definition growbuf.h:118
char * get()
Definition growbuf.h:114
void setPos(size_t newPos)
Definition growbuf.h:117
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:407
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
QCString lower() const
Definition qcstring.h:234
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
QCString & setNum(short n)
Definition qcstring.h:444
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition qcstring.cpp:185
QCString right(size_t len) const
Definition qcstring.h:219
size_t size() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:156
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
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:159
QCString left(size_t len) const
Definition qcstring.h:214
int contains(char c, bool cs=TRUE) const
Definition qcstring.cpp:143
bool stripPrefix(const QCString &prefix)
Definition qcstring.h:198
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:153
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
void msg(const char *fmt,...)
Definition message.cpp:98
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:748
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:770
const char * qPrint(const char *s)
Definition qcstring.h:672
#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:37
QCString name
Definition arguments.h:39
QCString defval
Definition arguments.h:41
QCString attrib
Definition arguments.h:36
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
Protection level of members.
Definition types.h:26
@ Public
Definition types.h:26
VhdlSpecifier
Definition types.h:548
@ INSTANTIATION
Definition types.h:569
@ MISCELLANEOUS
Definition types.h:575
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition util.cpp:6946
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition util.cpp:5368
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)