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