Doxygen
vhdldocgen.cpp
浏览该文件的文档.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2015 by Dimitri van Heesch.
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  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 /******************************************************************************
16  * Parser for VHDL subset
17  * written by M. Kreis
18  * supports VHDL-87/93/2008
19  * does not support VHDL-AMS
20  ******************************************************************************/
21 
22 // global includes
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <assert.h>
26 #include <string.h>
27 #include <map>
28 #include <algorithm>
29 
30 
31 /* --------------------------------------------------------------- */
32 
33 // local includes
34 #include "qcstring.h"
35 #include "vhdldocgen.h"
36 #include "message.h"
37 #include "config.h"
38 #include "doxygen.h"
39 #include "util.h"
40 #include "language.h"
41 #include "commentscan.h"
42 #include "index.h"
43 #include "definition.h"
44 #include "searchindex.h"
45 #include "outputlist.h"
46 #include "parserintf.h"
47 #include "layout.h"
48 #include "arguments.h"
49 #include "portable.h"
50 #include "memberlist.h"
51 #include "memberdef.h"
52 #include "groupdef.h"
53 #include "classlist.h"
54 #include "namespacedef.h"
55 #include "filename.h"
56 #include "membergroup.h"
57 #include "memberdef.h"
58 #include "membername.h"
59 #include "plantuml.h"
60 #include "vhdljjparser.h"
61 #include "VhdlParser.h"
62 #include "regex.h"
63 #include "plantuml.h"
64 #include "textstream.h"
65 //#define DEBUGFLOW
66 #define theTranslator_vhdlType theTranslator->trVhdlType
67 
68 static void initUCF(Entry* root,const QCString &type,QCString &qcs,int line,const QCString & fileName,QCString & brief);
69 static void writeUCFLink(const MemberDef* mdef,OutputList &ol);
70 static void addInstance(ClassDefMutable* entity, ClassDefMutable* arch, ClassDefMutable *inst,
71  const std::shared_ptr<Entry> &cur);
72 
73 //---------- create svg -------------------------------------------------------------
74 static void createSVG();
75 static void startDot(TextStream &t);
76 static void startTable(TextStream &t,const QCString &className);
77 static std::vector<const MemberDef *> getPorts(const ClassDef *cd);
78 static void writeVhdlEntityToolTip(TextStream& t,ClassDef *cd);
79 static void endDot(TextStream &t);
80 static void writeTable(const std::vector<const MemberDef*> &portList,TextStream & t);
81 static void endTable(TextStream &t);
82 static void writeClassToDot(TextStream &t,ClassDef* cd);
83 static void writeVhdlDotLink(TextStream &t,const QCString &a,const QCString &b,const QCString &style);
84 
85 static const MemberDef *flowMember=0;
86 
88 {
89  flowMember=mem;
90 }
91 
93 {
94  return flowMember;
95 }
96 
97 
98 
99 //--------------------------------------------------------------------------------------------------
100 static void codify(TextStream &t,const QCString &str)
101 {
102  if (!str.isEmpty())
103  {
104  const char *p=str.data();
105  char c;
106  while (*p)
107  {
108  c=*p++;
109  switch(c)
110  {
111  case '<': t << "&lt;";
112  break;
113  case '>': t << "&gt;";
114  break;
115  case '&': t << "&amp;";
116  break;
117  case '\'': t << "&#39;";
118  break;
119  case '"': t << "&quot;";
120  break;
121  default: t << c;
122  break;
123  }
124  }
125  }
126 }
127 
128 static void writeLink(const MemberDef* mdef,OutputList &ol)
129 {
130  ol.writeObjectLink(mdef->getReference(),
131  mdef->getOutputFileBase(),
132  mdef->anchor(),
133  mdef->name());
134 }
135 
136 static void startFonts(const QCString& q, const char *keyword,OutputList& ol)
137 {
138  ol.startFontClass(keyword);
139  ol.docify(q);
140  ol.endFontClass();
141 }
142 
143 static QCString splitString(QCString& str,char c)
144 {
145  QCString n=str;
146  int i=str.find(c);
147  if (i>0)
148  {
149  n=str.left(i);
150  str=str.remove(0,i+1);
151  }
152  return n;
153 }
154 
155 static int compareString(const QCString& s1,const QCString& s2)
156 {
157  return qstricmp(s1.stripWhiteSpace(),s2.stripWhiteSpace());
158 }
159 
160 static void createSVG()
161 {
162  QCString ov =Config_getString(HTML_OUTPUT);
163  QCString dir="-o \""+ov+"/vhdl_design_overview.html\"";
164  ov+="/vhdl_design.dot";
165 
166  QCString vlargs="-Tsvg \""+ov+"\" "+dir ;
167 
168  if (Portable::system(Config_getString(DOT_PATH) + "dot",vlargs)!=0)
169  {
170  err("could not create dot file");
171  }
172 }
173 
174 // Creates an svg image. All in/out/inout ports are shown with brief description and direction.
175 // Brief descriptions for entities are shown too.
177 {
178  bool found=FALSE;
179  for (const auto &cd : *Doxygen::classLinkedMap)
180  {
181  if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS )
182  {
183  found=TRUE;
184  break;
185  }
186  }
187 
188  if (!found) return;
189 
190  QCString ov =Config_getString(HTML_OUTPUT);
191  QCString fileName=ov+"/vhdl_design.dot";
192  std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
193  if (!f.is_open())
194  {
195  err("Warning: Cannot open file %s for writing\n",qPrint(fileName));
196  return;
197  }
198  TextStream t(&f);
199 
200  startDot(t);
201 
202  for (const auto &cd : *Doxygen::classLinkedMap)
203  {
204  if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS )
205  {
206  continue;
207  }
208 
209  std::vector<const MemberDef *> ports = getPorts(cd.get());
210  if (ports.empty())
211  {
212  continue;
213  }
214 
215  startTable(t,cd->name());
216  writeClassToDot(t,cd.get());
217  writeTable(ports,t);
218  endTable(t);
219 
220  writeVhdlEntityToolTip(t,cd.get());
221 
222  for (const auto &bcd : cd->baseClasses())
223  {
224  ClassDef *bClass=bcd.classDef;
225  QCString dotn=cd->name()+":";
226  dotn+=cd->name();
227  QCString csc=bClass->name()+":";
228  csc+=bClass->name();
229  // fprintf(stderr,"\n <%s| %s>",qPrint(dotn),qPrint(csc));
230  writeVhdlDotLink(t,dotn,csc,QCString());
231  }
232  }// for
233 
234  endDot(t);
235  // writePortLinks(t);
236  t.flush();
237  f.close();
238  createSVG();
239 }
240 
241 //------------------------------------------------------------------------------------------------------------------------------------------------------
242 
243 static void startDot(TextStream &t)
244 {
245  t << " digraph G { \n";
246  t << "rankdir=LR \n";
247  t << "concentrate=TRUE\n";
248  t << "stylesheet=\"doxygen.css\"\n";
249 }
250 
251 static void endDot(TextStream &t)
252 {
253  t <<" } \n";
254 }
255 
256 static void startTable(TextStream &t,const QCString &className)
257 {
258  t << className <<" [ shape=none , fontname=\"arial\", fontcolor=\"blue\" , \n";
259  t << "label=<<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\">\n";
260 }
261 
263  const QCString &a,const QCString &b,const QCString &style)
264 {
265  t << a << "->" << b;
266  if (!style.isEmpty())
267  {
268  t << "[style=" << style << "];\n";
269  }
270  t << "\n";
271 }
272 
273 
274 static QCString formatBriefNote(const QCString &brief,ClassDef * cd)
275 {
276  QCString vForm;
277  QCString repl("<BR ALIGN=\"LEFT\"/>");
278  QCString file=cd->getDefFileName();
279 
280  int k=cd->briefLine();
281 
282  auto qsl=split(brief.str(),"\n");
283  for(const auto &line : qsl)
284  {
285  vForm+=parseCommentAsText(cd,NULL,line.c_str(),file,k);
286  k++;
287  vForm+=repl;
288  }
289  return vForm;
290 }
291 
293 {
294 
295  QCString brief=cd->briefDescription();
296 
297  if (brief.isEmpty()) return;
298 
299  brief=formatBriefNote(brief,cd);
300 
301  QCString node="node";
303  t << node <<"[shape=none margin=0.1, label=<\n";
304  t << "<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
305  t << "<TR><TD BGCOLOR=\"lightcyan\"> ";
306  t << brief;
307  t << " </TD></TR></TABLE>>];";
308  QCString dotn=cd->name()+":";
309  dotn+=cd->name();
310  writeVhdlDotLink(t,dotn,node,"dotted");
311 }
312 
313 static void writeColumn(TextStream &t,const MemberDef *md,bool start)
314 {
315  QCString toolTip;
316 
317  bool bidir=(md!=0 &&( qstricmp(md->typeString(),"inout")==0));
318 
319  if (md)
320  {
321  toolTip=md->briefDescriptionAsTooltip();
322  if (!toolTip.isEmpty())
323  {
324  QCString largs = md->argsString();
325  toolTip+=" [";
326  toolTip+=substitute(largs,"%"," ");
327  toolTip+="]";
328  }
329  }
330  if (start)
331  {
332  t <<"<TR>\n";
333  }
334 
335  t << "<TD ALIGN=\"LEFT\" ";
336  if (md)
337  {
338  t << "href=\"";
340  t << "#" << md->anchor();
341  t<<"\" ";
342 
343  t<<" TOOLTIP=\"";
344  if (!toolTip.isEmpty())
345  {
346  codify(t,toolTip);
347  }
348  else
349  {
350  QCString largs = md->argsString();
351  if (!largs.isEmpty())
352  {
353  largs=substitute(largs,"%"," ");
354  codify(t,largs);
355  }
356  }
357  t << "\" ";
358 
359  t << " PORT=\"";
360  t << md->name();
361  t << "\" ";
362  }
363  if (!toolTip.isEmpty())
364  {
365  // if (!toolTip.isEmpty())
366 
367  if (bidir)
368  t << "BGCOLOR=\"orange\">";
369  else
370  t << "BGCOLOR=\"azure\">";
371  }
372  else if (bidir)
373  {
374  t << "BGCOLOR=\"pink\">";
375  }
376  else
377  {
378  t << "BGCOLOR=\"lightgrey\">";
379  }
380  if (md)
381  {
382  t << md->name();
383  }
384  else
385  {
386  t << " \n";
387  }
388  t << "</TD>\n";
389 
390  if (!start)
391  {
392  t << "</TR>\n";
393  }
394 }
395 
396 static void endTable(TextStream &t)
397 {
398  t << "</TABLE>>\n";
399  t << "] \n";
400 }
401 
403 {
404  t << "<TR><TD COLSPAN=\"2\" BGCOLOR=\"yellow\" ";
405  t << "PORT=\"";
406  t << cd->name();
407  t << "\" ";
408  t << "href=\"";
410  t << "\" ";
411  t << ">";
412  t << cd->name();
413  t << " </TD></TR>\n";
414 }
415 
416 static std::vector<const MemberDef*> getPorts(const ClassDef *cd)
417 {
419  std::vector<const MemberDef *> portList;
420 
421  if (ml==0)
422  {
423  return portList;
424  }
425 
426  for (const auto &md : *ml)
427  {
428  if (md->getMemberSpecifiers()==VhdlDocGen::PORT)
429  {
430  portList.push_back(md);
431  }
432  }
433  return portList;
434 }
435 
436 //writeColumn(TextStream &t,QCString name,bool start)
437 
438 static void writeTable(const std::vector<const MemberDef*> &portList,TextStream & t)
439 {
440  std::vector<const MemberDef *> inPorts;
441  std::vector<const MemberDef *> outPorts;
442 
443  for (const auto &md : portList)
444  {
445  QCString qc=md->typeString();
446  if (qc=="in")
447  {
448  inPorts.push_back(md);
449  }
450  else
451  {
452  outPorts.push_back(md);
453  }
454  }
455 
456  size_t inp = inPorts.size();
457  size_t outp = outPorts.size();
458  size_t maxLen;
459 
460  if (inp>=outp)
461  {
462  maxLen=inp;
463  }
464  else
465  {
466  maxLen=outp;
467  }
468 
469  size_t i;
470  for (i=0;i<maxLen;i++)
471  {
472  //write inports
473  if (i<inp)
474  {
475  auto md = inPorts[i];
476  writeColumn(t,md,TRUE);
477  }
478  else
479  {
480  writeColumn(t,NULL,TRUE);
481  }
482 
483  if (i<outp)
484  {
485  auto md = outPorts[i];
486  writeColumn(t,md,FALSE);
487  }
488  else
489  {
490  writeColumn(t,NULL,FALSE);
491  }
492  }
493 }
494 
495 //--------------------------------------------------------------------------------------------------
496 
497 
499 {
500 }
501 
503 {
504 }
505 
506  // vhdl keywords included VHDL 2008
507 static const std::set< std::string > g_vhdlKeyWordSet0 =
508 {
509  "abs","access","after","alias","all","and","architecture","array","assert","assume","assume_guarantee","attribute",
510  "begin","block","body","buffer","bus",
511  "case","component","configuration","constant","context","cover",
512  "default","disconnect","downto",
513  "else","elsif","end","entity","exit",
514  "fairness","file","for","force","function",
515  "generate","generic","group","guarded",
516  "if","impure","in","inertial","inout","is",
517  "label","library","linkage","literal","loop",
518  "map","mod",
519  "nand","new","next","nor","not","null",
520  "of","on","open","or","others","out",
521  "package","parameter","port","postponed","procedure","process","property","protected","pure",
522  "range","record","register","reject","release","restrict","restrict_guarantee","rem","report","rol","ror","return",
523  "select","sequence","severity","signal","shared","sla","sll","sra","srl","strong","subtype",
524  "then","to","transport","type",
525  "unaffected","units","until","use",
526  "variable","vmode","vprop","vunit",
527  "wait","when","while","with",
528  "xor","xnor"
529 };
530 
531 
532 // type
533 static const std::set< std::string> g_vhdlKeyWordSet1 =
534 {
535  "natural","unsigned","signed","string","boolean", "bit","bit_vector","character",
536  "std_ulogic","std_ulogic_vector","std_logic","std_logic_vector","integer",
537  "real","float","ufixed","sfixed","time","positive"
538 };
539 
540 // logic
541 static const std::set< std::string > g_vhdlKeyWordSet2 =
542 {
543  "abs","and","or","not","mod","xor","rem","xnor","ror","rol","sla","sll"
544 };
545 
546 // predefined attributes
547 static const std::set< std::string > g_vhdlKeyWordSet3 =
548 {
549  "base","left","right","high","low","ascending",
550  "image","value","pos","val","succ","pred","leftof","rightof","left","right","high","low",
551  "range","reverse_range","length","ascending","delayed","stable","quiet","transaction","event",
552  "active","last_event","last_active","last_value","driving","driving_value","simple_name","instance_name","path_name"
553 };
554 
556 {
557 }
558 
559 /*!
560  * returns the color of a keyword
561  */
562 const char* VhdlDocGen::findKeyWord(const QCString& kw)
563 {
564  std::string word=kw.lower().str();
565 
566  if (word.empty()) return 0;
567 
568  if (g_vhdlKeyWordSet0.find(word)!=g_vhdlKeyWordSet0.end())
569  return "keywordflow";
570 
571  if (g_vhdlKeyWordSet1.find(word)!=g_vhdlKeyWordSet1.end())
572  return "keywordtype";
573 
574  if (g_vhdlKeyWordSet2.find(word)!=g_vhdlKeyWordSet2.end())
575  return "vhdllogic";
576 
577  if (g_vhdlKeyWordSet3.find(word)!=g_vhdlKeyWordSet3.end())
578  return "vhdlkeyword";
579 
580  return 0;
581 }
582 
584 {
585  if (name.isEmpty()) return 0;
586  return Doxygen::classLinkedMap->find(QCString(name).stripWhiteSpace());
587 }
588 
590 {
591  return getClass(name);
592 }
593 
594 static std::map<std::string,const MemberDef*> g_varMap;
595 static std::vector<ClassDef*> g_classList;
596 static std::map<ClassDef*,std::vector<ClassDef*> > g_packages;
597 
598 const MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& memName)
599 {
600  ClassDef* cd,*ecd=0;
601  const MemberDef *mdef=0;
602 
603  cd=getClass(className);
604  //printf("VhdlDocGen::findMember(%s,%s)=%p\n",qPrint(className),qPrint(memName),cd);
605  if (cd==0) return 0;
606 
608  if (mdef) return mdef;
610  if (mdef) return mdef;
611 
612  // nothing found so far
613  // if we are an architecture or package body search in entity
614 
617  {
618  Definition *d = cd->getOuterScope();
619  // searching upper/lower case names
620 
621  QCString tt=d->name();
622  ecd =getClass(tt);
623  if (!ecd)
624  {
625  tt=tt.upper();
626  ecd =getClass(tt);
627  }
628  if (!ecd)
629  {
630  tt=tt.lower();
631  ecd =getClass(tt);
632  }
633 
634  if (ecd) //d && d->definitionType()==Definition::TypeClass)
635  {
636  //ClassDef *ecd = (ClassDef*)d;
638  if (mdef) return mdef;
640  if (mdef) return mdef;
641  }
642  }
643 
644 
647  {
648  Definition *d = cd->getOuterScope();
649 
650  QCString tt=d->name();
651  ClassDef *acd =getClass(tt);
652  if (!acd)
653  {
654  tt=tt.upper();
655  acd =getClass(tt);
656  }
657  if (!acd)
658  {
659  tt=tt.lower();
660  acd =getClass(tt);
661  }
662  if (acd) //d && d->definitionType()==Definition::TypeClass)
663  {
664  if(g_packages.find(acd)==g_packages.end())
665  {
667  }
668  }
669  }
670  else
671  {
672  ecd=cd;
673  if (g_packages.find(ecd)==g_packages.end()) VhdlDocGen::findAllPackages(ecd);
674  }
675 
676  if (ecd)
677  {
678  auto cList_it = g_packages.find(ecd);
679  if (cList_it!=g_packages.end())
680  {
681  for (const auto &cdp : cList_it->second)
682  {
684  if (mdef) return mdef;
686  if (mdef) return mdef;
687  }
688  }
689  }
690  return 0;
691 
692 }//findMember
693 
694 /**
695  * This function returns the entity|package
696  * in which the key (type) is found
697  */
699 {
700  QCString keyType=cd->symbolName()+"@"+key;
701  //printf("\n %s | %s | %s",qPrint(cd->symbolName()),key.data(,),qPrint(keyType));
702 
703  auto it = g_varMap.find(keyType.str());
704  if (it!=g_varMap.end())
705  {
706  return it->second;
707  }
708  if (std::find(g_classList.begin(),g_classList.end(),cd)!=g_classList.end())
709  {
710  return 0;
711  }
712  const MemberList *ml=cd->getMemberList(type);
713  g_classList.push_back(cd);
714  if (!ml)
715  {
716  return 0;
717  }
718  //int l=ml->count();
719  // fprintf(stderr,"\n loading entity %s %s: %d",qPrint(cd->symbolName()),qPrint(keyType),l);
720 
721  for (const auto &md : *ml)
722  {
723  QCString tkey=cd->symbolName()+"@"+md->name();
724  if (g_varMap.find(tkey.str())==g_varMap.end())
725  {
726  g_varMap.insert({tkey.str(),md});
727  }
728  }
729  it=g_varMap.find(keyType.str());
730  if (it!=g_varMap.end())
731  {
732  return it->second;
733  }
734  return 0;
735 }//findMemberDef
736 
737 /*!
738  * finds all included packages of an Entity or Package
739  */
740 
742 {
743  if (g_packages.find(cdef)!=g_packages.end()) return;
744  std::vector<ClassDef*> cList;
746  if (mem)
747  {
748  for (const auto &md : *mem)
749  {
750  if (VhdlDocGen::isPackage(md))
751  {
752  ClassDef* cd=VhdlDocGen::getPackageName(md->name());
753  if (cd)
754  {
755  cList.push_back(cd);
757  g_packages.insert({cdef,cList});
758  }
759  }
760  }//for
761  }
762 
763 }// findAllPackages
764 
765 /*!
766  * returns the function with the matching argument list
767  * is called in vhdlcode.l
768  */
769 
770 const MemberDef* VhdlDocGen::findFunction(const QCString& funcname, const QCString& package)
771 {
772  ClassDef *cdef=getClass(package);
773  if (cdef==0) return 0;
774 
776  if (mem)
777  {
778  for (const auto &mdef : *mem)
779  {
780  QCString mname=mdef->name();
781  if ((VhdlDocGen::isProcedure(mdef) || VhdlDocGen::isVhdlFunction(mdef)) && (compareString(funcname,mname)==0))
782  {
783  return mdef;
784  }//if
785  }//for
786  }//if
787  return 0;
788 } //findFunction
789 
790 
791 
792 
793 /*!
794  * returns the class title+ref
795  */
796 
798 {
799  QCString pageTitle;
800  if (cd==0) return "";
801  pageTitle=VhdlDocGen::getClassName(cd);
802  int ii=cd->protection();
803  pageTitle+=" ";
804  pageTitle+=theTranslator_vhdlType(ii+2,TRUE);
805  return pageTitle;
806 } // getClassTitle
807 
808 /* returns the class name without their prefixes */
809 
811 {
812  QCString temp;
813  if (cd==0) return "";
814 
816  {
817  temp=cd->name();
818  temp.stripPrefix("_");
819  return temp;
820  }
821 
822  return substitute(cd->className(),"::",".");
823 }
824 
825 /*!
826  * writes an inline link form entity|package to architecture|package body and vice verca
827  */
828 
830 {
831  std::vector<QCString> ql;
832  QCString nn=cd->className();
833  int ii=(int)cd->protection()+2;
834 
835  QCString type;
836  if (ii==VhdlDocGen::ENTITY)
838  else if (ii==VhdlDocGen::ARCHITECTURE)
840  else if (ii==VhdlDocGen::PACKAGE_BODY)
842  else if (ii==VhdlDocGen::PACKAGE)
844  else
845  type+="";
846 
847  //type=type.lower();
848  type+=" >> ";
851 
852  if (ii==VhdlDocGen::PACKAGE_BODY)
853  {
854  nn.stripPrefix("_");
855  cd=getClass(nn);
856  }
857  else if (ii==VhdlDocGen::PACKAGE)
858  {
859  nn.prepend("_");
860  cd=getClass(nn);
861  }
862  else if (ii==VhdlDocGen::ARCHITECTURE)
863  {
864  StringVector qlist=split(nn.str(),"-");
865  if (qlist.size()>1)
866  {
867  nn=qlist[1];
868  cd=VhdlDocGen::getClass(nn);
869  }
870  }
871 
872  QCString opp;
873  if (ii==VhdlDocGen::ENTITY)
874  {
876  for (const auto &s : ql)
877  {
878  StringVector qlist=split(s.str(),"-");
879  if (qlist.size()>2)
880  {
881  QCString s1(qlist[0]);
882  QCString s2(qlist[1]);
883  s1.stripPrefix("_");
884  if (ql.size()==1) s1.resize(0);
885  ClassDef *cc = getClass(s);
886  if (cc)
887  {
888  VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
889  }
890  }
891  }
892  }
893  else
894  {
895  VhdlDocGen::writeVhdlLink(cd,ol,type,nn,opp);
896  }
897 
900 
901 }// write
902 
903 /*
904  * finds all architectures which belongs to an entity
905  */
906 void VhdlDocGen::findAllArchitectures(std::vector<QCString>& qll,const ClassDef *cd)
907 {
908  for (const auto &citer : *Doxygen::classLinkedMap)
909  {
910  QCString className=citer->className();
911  int pos;
912  if (cd != citer.get() && (pos=className.find('-'))!=-1)
913  {
914  QCString postfix=className.mid(pos+1);
915  if (qstricmp(cd->className(),postfix)==0)
916  {
917  qll.push_back(className);
918  }
919  }
920  }// for
921 }//findAllArchitectures
922 
924 {
925  QCString nn=cd->name();
926  for (const auto &citer : *Doxygen::classLinkedMap)
927  {
928  QCString jj=citer->name();
929  StringVector ql=split(jj.str(),":");
930  if (ql.size()>1)
931  {
932  if (QCString(ql[0])==nn)
933  {
934  return citer.get();
935  }
936  }
937  }
938  return 0;
939 }
940 /*
941  * writes the link entity >> .... or architecture >> ...
942  */
943 
945 {
946  if (ccd==0) return;
947  ol.startBold();
948  ol.docify(type);
949  ol.endBold();
950  nn.stripPrefix("_");
952 
953  if (!behav.isEmpty())
954  {
955  behav.prepend(" ");
956  ol.startBold();
957  ol.docify(behav);
958  ol.endBold();
959  }
960 
961  ol.lineBreak();
962 }
963 
964 
965 /*!
966  * strips the "--" prefixes of vhdl comments
967  */
969 {
970  const char* s="--!";
971  int index=0;
972 
973  while (TRUE)
974  {
975  index=qcs.find(s,0,TRUE);
976  if (index<0) break;
977  qcs=qcs.remove(index,qstrlen(s));
978  }
979  qcs=qcs.stripWhiteSpace();
980 }
981 
982 
983 /*!
984  * parses a function proto
985  * @param text function string
986  * @param name points to the function name
987  * @param ret Stores the return type
988  * @param doc ???
989  */
990 void VhdlDocGen::parseFuncProto(const QCString &text,QCString& name,QCString& ret,bool doc)
991 {
992  int index,end;
993  QCString s1(text);
994  QCString temp;
995 
996  index=s1.find("(");
997  if (index<0) index=0;
998  end=s1.findRev(")");
999 
1000  if ((end-index)>0)
1001  {
1002  temp=s1.mid(index+1,(end-index-1));
1003  //getFuncParams(qlist,temp);
1004  }
1005  if (doc)
1006  {
1007  name=s1.left(index);
1008  name=name.stripWhiteSpace();
1009  if ((end-index)>0)
1010  {
1011  ret="function";
1012  }
1013  return;
1014  }
1015  else
1016  {
1017  s1=s1.stripWhiteSpace();
1018  int i=s1.find('(');
1019  int s=s1.find(' ');
1020  if (s==-1) s=s1.find('\t');
1021  if (i==-1 || i<s)
1022  s1=VhdlDocGen::getIndexWord(s1,1);
1023  else // s<i, s=start of name, i=end of name
1024  s1=s1.mid(s,(i-s));
1025 
1026  name=s1.stripWhiteSpace();
1027  }
1028  index=s1.findRev("return",-1,FALSE);
1029  if (index !=-1)
1030  {
1031  ret=s1.mid(index+6,s1.length());
1032  ret=ret.stripWhiteSpace();
1033  VhdlDocGen::deleteCharRev(ret,';');
1034  }
1035 }
1036 
1037 /*
1038  * returns the n'th word of a string
1039  */
1040 
1042 {
1043  static const reg::Ex reg(R"([\s|])");
1044  auto ql=split(c.str(),reg);
1045 
1046  if ((size_t)index < ql.size())
1047  {
1048  return QCString(ql[index]);
1049  }
1050 
1051  return "";
1052 }
1053 
1054 
1056 {
1057  if (prot==VhdlDocGen::ENTITYCLASS)
1058  return "entity";
1059  else if (prot==VhdlDocGen::ARCHITECTURECLASS)
1060  return "architecture";
1061  else if (prot==VhdlDocGen::PACKAGECLASS)
1062  return "package";
1063  else if (prot==VhdlDocGen::PACKBODYCLASS)
1064  return "package body";
1065 
1066  return "";
1067 }
1068 
1069 /*!
1070  * deletes a char backwards in a string
1071  */
1072 
1074 {
1075  int index=s.findRev(c,-1,FALSE);
1076  if (index > -1)
1077  {
1078  QCString qcs=s.remove(index,1);
1079  s=qcs;
1080  return TRUE;
1081  }
1082  return FALSE;
1083 }
1084 
1086 {
1087  int index=s.findRev(c,-1,FALSE);
1088  while (index > -1)
1089  {
1090  QCString qcs=s.remove(index,1);
1091  s=qcs;
1092  index=s.findRev(c,-1,FALSE);
1093  }
1094 }
1095 
1096 
1097 static int recordCounter=0;
1098 
1099 /*!
1100  * returns the next number of a record|unit member
1101  */
1102 
1104 {
1105  char buf[12];
1106  sprintf(buf,"%d",recordCounter++);
1107  QCString qcs(&buf[0]);
1108  return qcs;
1109 }
1110 
1111 /*!
1112  * returns the next number of an anonymous process
1113  */
1114 
1116 {
1117  static int stringCounter;
1118  char buf[8];
1119  QCString qcs("PROCESS_");
1120  sprintf(buf,"%d",stringCounter++);
1121  qcs.append(&buf[0]);
1122  return qcs;
1123 }
1124 
1125 /*!
1126  * writes a colored and formatted string
1127  */
1128 
1130 {
1131  static const reg::Ex reg(R"([\[\]./<>:\s,;'+*|&=()\"-])");
1132  QCString qcs = s;
1133  qcs+=QCString(" ");// parsing the last sign
1134  QCString find=qcs;
1135  QCString temp=qcs;
1136  char buf[2];
1137  buf[1]='\0';
1138 
1139  int j = findIndex(temp.str(),reg);
1140 
1141  ol.startBold();
1142  if (j>=0)
1143  {
1144  while (j>=0)
1145  {
1146  find=find.left(j);
1147  buf[0]=temp[j];
1148  const char *ss=VhdlDocGen::findKeyWord(find);
1149  bool k=isNumber(find.str()); // is this a number
1150  if (k)
1151  {
1152  ol.docify(" ");
1153  startFonts(find,"vhdldigit",ol);
1154  ol.docify(" ");
1155  }
1156  else if (j != 0 && ss)
1157  {
1158  startFonts(find,ss,ol);
1159  }
1160  else
1161  {
1162  if (j>0)
1163  {
1164  VhdlDocGen::writeStringLink(mdef,find,ol);
1165  }
1166  }
1167  startFonts(&buf[0],"vhdlchar",ol);
1168 
1169  QCString st=temp.remove(0,j+1);
1170  find=st;
1171  if (!find.isEmpty() && find.at(0)=='"')
1172  {
1173  int ii=find.find('"',2);
1174  if (ii>1)
1175  {
1176  QCString com=find.left(ii+1);
1177  startFonts(com,"keyword",ol);
1178  temp=find.remove(0,ii+1);
1179  }
1180  }
1181  else
1182  {
1183  temp=st;
1184  }
1185  j = findIndex(temp.str(),reg);
1186  }//while
1187  }//if
1188  else
1189  {
1190  startFonts(find,"vhdlchar",ol);
1191  }
1192  ol.endBold();
1193 }// writeFormatString
1194 
1195 /*!
1196  * returns TRUE if this string is a number
1197  */
1198 bool VhdlDocGen::isNumber(const std::string& s)
1199 {
1200  static const reg::Ex regg(R"([0-9][0-9eEfFbBcCdDaA_.#+?xXzZ-]*)");
1201  return reg::match(s,regg);
1202 }// isNumber
1203 
1204 
1205 /*!
1206  * inserts white spaces for better readings
1207  * and writes a colored string to the output
1208  */
1209 
1211 {
1212  QCString qcs = s;
1213  QCString temp;
1214  qcs.stripPrefix(":");
1215  qcs.stripPrefix("is");
1216  qcs.stripPrefix("IS");
1217  qcs.stripPrefix("of");
1218  qcs.stripPrefix("OF");
1219 
1220  // VhdlDocGen::deleteCharRev(qcs,';');
1221  //char white='\t';
1222  int len = qcs.length();
1223  unsigned int index=1;//temp.length();
1224 
1225  for (int j=0;j<len;j++)
1226  {
1227  char c=qcs[j];
1228  char b=c;
1229  if (j>0) b=qcs[j-1];
1230  if (c=='"' || c==',' || c=='\''|| c=='(' || c==')' || c==':' || c=='[' || c==']' ) // || (c==':' && b!='=')) // || (c=='=' && b!='>'))
1231  {
1232  if (temp.length()>=index && temp.at(index-1) != ' ')
1233  {
1234  temp+=" ";
1235  }
1236  temp+=c;
1237  temp+=" ";
1238  }
1239  else if (c=='=')
1240  {
1241  if (b==':') // := operator
1242  {
1243  temp.replace(index-1,1,"=");
1244  temp+=" ";
1245  }
1246  else // = operator
1247  {
1248  temp+=" ";
1249  temp+=c;
1250  temp+=" ";
1251  }
1252  }
1253  else
1254  {
1255  temp+=c;
1256  }
1257 
1258  index=temp.length();
1259  }// for
1260  temp=temp.stripWhiteSpace();
1261  // printf("\n [%s]",qPrint(qcs));
1262  VhdlDocGen::writeFormatString(temp,ol,mdef);
1263 }
1264 
1265 /*!
1266  * writes a procedure prototype to the output
1267  */
1268 
1270 {
1271  bool sem=FALSE;
1272  size_t len=al.size();
1273  ol.docify("( ");
1274  if (len > 2)
1275  {
1276  ol.lineBreak();
1277  }
1278  for (const Argument &arg : al)
1279  {
1280  ol.startBold();
1281  if (sem && len <3)
1282  ol.writeChar(',');
1283 
1284  QCString nn=arg.name;
1285  nn+=": ";
1286 
1287  QCString defval = arg.defval;
1288  const char *str=VhdlDocGen::findKeyWord(defval);
1289  defval+=" ";
1290  if (str)
1291  {
1292  startFonts(defval,str,ol);
1293  }
1294  else
1295  {
1296  startFonts(defval,"vhdlchar",ol); // write type (variable,constant etc.)
1297  }
1298 
1299  startFonts(nn,"vhdlchar",ol); // write name
1300  if (qstricmp(arg.attrib,arg.type) != 0)
1301  {
1302  startFonts(arg.attrib.lower(),"stringliteral",ol); // write in|out
1303  }
1304  ol.docify(" ");
1305  VhdlDocGen::formatString(arg.type,ol,mdef);
1306  sem=TRUE;
1307  ol.endBold();
1308  if (len > 2)
1309  {
1310  ol.lineBreak();
1311  ol.docify(" ");
1312  }
1313  }//for
1314 
1315  ol.docify(" )");
1316 
1317 
1318 }
1319 
1320 /*!
1321  * writes a function prototype to the output
1322  */
1323 
1325 {
1326  if (!al.hasParameters()) return;
1327  bool sem=FALSE;
1328  size_t len=al.size();
1329  ol.startBold();
1330  ol.docify(" ( ");
1331  ol.endBold();
1332  if (len>2)
1333  {
1334  ol.lineBreak();
1335  }
1336  for (const Argument &arg : al)
1337  {
1338  ol.startBold();
1339  QCString att=arg.defval;
1340  bool bGen=att.stripPrefix("gen!");
1341 
1342  if (sem && len < 3)
1343  {
1344  ol.docify(" , ");
1345  }
1346 
1347  if (bGen)
1348  {
1349  VhdlDocGen::formatString(QCString("generic "),ol,mdef);
1350  }
1351  if (!att.isEmpty())
1352  {
1353  const char *str=VhdlDocGen::findKeyWord(att);
1354  att+=" ";
1355  if (str)
1356  VhdlDocGen::formatString(att,ol,mdef);
1357  else
1358  startFonts(att,"vhdlchar",ol);
1359  }
1360 
1361  QCString nn=arg.name;
1362  nn+=": ";
1363  QCString ss=arg.type.stripWhiteSpace(); //.lower();
1364  QCString w=ss.stripWhiteSpace();//.upper();
1365  startFonts(nn,"vhdlchar",ol);
1366  startFonts("in ","stringliteral",ol);
1367  const char *str=VhdlDocGen::findKeyWord(ss);
1368  if (str)
1369  VhdlDocGen::formatString(w,ol,mdef);
1370  else
1371  startFonts(w,"vhdlchar",ol);
1372 
1373  if (!arg.attrib.isEmpty())
1374  startFonts(arg.attrib,"vhdlchar",ol);
1375 
1376  sem=TRUE;
1377  ol.endBold();
1378  if (len > 2)
1379  {
1380  ol.lineBreak();
1381  }
1382  }
1383  ol.startBold();
1384  ol.docify(" )");
1385  QCString exp=mdef->excpString();
1386  if (!exp.isEmpty())
1387  {
1388  ol.insertMemberAlign();
1389  ol.startBold();
1390  ol.docify("[ ");
1391  ol.docify(exp);
1392  ol.docify(" ]");
1393  ol.endBold();
1394  }
1395  ol.endBold();
1396 }
1397 
1398 /*!
1399  * writes a process prototype to the output
1400  */
1401 
1403 {
1404  if (!al.hasParameters()) return;
1405  bool sem=FALSE;
1406  ol.startBold();
1407  ol.docify(" ( ");
1408  for (const Argument &arg : al)
1409  {
1410  if (sem)
1411  {
1412  ol.docify(" , ");
1413  }
1414  QCString nn=arg.name;
1415  // startFonts(nn,"vhdlchar",ol);
1416  VhdlDocGen::writeFormatString(nn,ol,mdef);
1417  sem=TRUE;
1418  }
1419  ol.docify(" )");
1420  ol.endBold();
1421 }
1422 
1423 
1424 /*!
1425  * writes a function|procedure documentation to the output
1426  */
1427 
1429  const MemberDef *md,
1430  OutputList& ol,
1431  const ArgumentList &al,
1432  bool /*type*/)
1433 {
1434  //bool sem=FALSE;
1435  ol.enableAll();
1436 
1437  size_t index=al.size();
1438  if (index==0)
1439  {
1440  ol.docify(" ( ) ");
1441  return FALSE;
1442  }
1443  ol.endMemberDocName();
1445  //ol.startParameterName(FALSE);
1446  bool first=TRUE;
1447  for (const Argument &arg : al)
1448  {
1449  ol.startParameterType(first,"");
1450  // if (first) ol.writeChar('(');
1451  QCString attl=arg.defval;
1452  bool bGen=attl.stripPrefix("gen!");
1453  if (bGen)
1454  VhdlDocGen::writeFormatString(QCString("generic "),ol,md);
1455 
1456 
1457  if (VhdlDocGen::isProcedure(md))
1458  {
1459  startFonts(arg.defval,"keywordtype",ol);
1460  ol.docify(" ");
1461  }
1462  ol.endParameterType();
1463 
1465  VhdlDocGen::writeFormatString(arg.name,ol,md);
1466 
1467  if (VhdlDocGen::isProcedure(md))
1468  {
1469  startFonts(arg.attrib,"stringliteral",ol);
1470  }
1471  else if (VhdlDocGen::isVhdlFunction(md))
1472  {
1473  startFonts(QCString("in"),"stringliteral",ol);
1474  }
1475 
1476  ol.docify(" ");
1478  ol.startEmphasis();
1480  if (!VhdlDocGen::isProcess(md))
1481  {
1482  // startFonts(arg.type,"vhdlkeyword",ol);
1483  VhdlDocGen::writeFormatString(arg.type,ol,md);
1484  }
1486  ol.endEmphasis();
1488 
1489  if (--index)
1490  {
1491  ol.docify(" , ");
1492  }
1493  else
1494  {
1495  // ol.docify(" ) ");
1497  break;
1498  }
1500 
1501  //sem=TRUE;
1502  first=FALSE;
1503  }
1504  //ol.endParameterList();
1505  return TRUE;
1506 
1507 } // writeDocFunProc
1508 
1509 
1510 
1511 
1513 {
1514  QCString argString;
1515  bool sem=FALSE;
1516 
1517  for (const Argument &arg : al)
1518  {
1519  if (sem) argString.append(", ");
1520  if (func)
1521  {
1522  argString+=arg.name;
1523  argString+=":";
1524  argString+=arg.type;
1525  }
1526  else
1527  {
1528  argString+=arg.defval+" ";
1529  argString+=arg.name+" :";
1530  argString+=arg.attrib+" ";
1531  argString+=arg.type;
1532  }
1533  sem=TRUE;
1534  }
1535  return argString;
1536 }
1537 
1538 
1540  OutputList& ol,const GroupDef* gd,const ClassDef* cd,const FileDef *fd,const NamespaceDef* nd)
1541 {
1563 
1564  // configurations must be added to global file definitions.
1567 
1568 }
1569 
1571 {
1572  if (md->argsString()=="package")
1573  {
1575  }
1576  else if (md->argsString()=="configuration")
1577  {
1579  }
1580  else if (md->typeString()=="library")
1581  {
1583  }
1584  else if (md->typeString()=="use")
1585  {
1587  }
1588  else if (md->typeString().lower()=="misc")
1589  {
1591  }
1592  else if (md->typeString().lower()=="ucf_const")
1593  {
1595  }
1596 
1598  {
1599  int mm=md->name().findRev('_');
1600  if (mm>0)
1601  {
1602  md->setName(md->name().left(mm));
1603  }
1604  }
1605  else if (md->getMemberSpecifiers()==VhdlDocGen::TYPE)
1606  {
1607  QCString largs=md->argsString();
1608  bool bRec=largs.stripPrefix("record") ;
1609  bool bUnit=largs.stripPrefix("units") ;
1610  if (bRec || bUnit)
1611  {
1612  md->setType("");
1613  }
1614  }
1615 }
1616 
1617 /* writes a vhdl type documentation */
1619 {
1620  const ClassDef *cd=toClassDef(d);
1621  bool hasParams = FALSE;
1622 
1623  if (cd==0) return hasParams;
1624 
1625  QCString ttype=mdef->typeString();
1626  QCString largs=mdef->argsString();
1627 
1629  {
1630  QCString nn=mdef->typeString();
1631  nn=nn.stripWhiteSpace();
1632  QCString na=cd->name();
1633  const MemberDef* memdef=VhdlDocGen::findMember(na,nn);
1634  if (memdef && memdef->isLinkable())
1635  {
1636  ol.docify(" ");
1637 
1638  ol.startBold();
1639  writeLink(memdef,ol);
1640  ol.endBold();
1641  ol.docify(" ");
1642  }
1643  else
1644  {
1645  ol.docify(" ");
1646  VhdlDocGen::formatString(ttype,ol,mdef);
1647  ol.docify(" ");
1648  }
1649  ol.docify(mdef->name());
1650  hasParams = VhdlDocGen::writeFuncProcDocu(mdef,ol, mdef->argumentList());
1651  }
1652 
1653 
1654  if (mdef->isVariable())
1655  {
1656  if (VhdlDocGen::isConstraint(mdef))
1657  {
1658  writeLink(mdef,ol);
1659  ol.docify(" ");
1660 
1661  largs=substitute(largs,"#"," ");
1662  VhdlDocGen::formatString(largs,ol,mdef);
1663  return hasParams;
1664  }
1665  else
1666  {
1667  writeLink(mdef,ol);
1668  if (VhdlDocGen::isLibrary(mdef) || VhdlDocGen::isPackage(mdef))
1669  {
1670  return hasParams;
1671  }
1672  ol.docify(" ");
1673  }
1674 
1675  // QCString largs=mdef->argsString();
1676 
1677  bool c=largs=="context";
1678  bool brec=largs.stripPrefix("record") ;
1679 
1680  if (!brec && !c)
1681  VhdlDocGen::formatString(ttype,ol,mdef);
1682 
1683  if (c || brec || largs.stripPrefix("units"))
1684  {
1685  if (c)
1686  largs=ttype;
1687  VhdlDocGen::writeRecUnitDocu(mdef,ol,largs);
1688  return hasParams;
1689  }
1690 
1691  ol.docify(" ");
1692  if (VhdlDocGen::isPort(mdef) || VhdlDocGen::isGeneric(mdef))
1693  {
1694  // QCString largs=mdef->argsString();
1695  VhdlDocGen::formatString(largs,ol,mdef);
1696  ol.docify(" ");
1697  }
1698  }
1699  return hasParams;
1700 }
1701 
1703 {
1704  tagFile << " <member kind=\"";
1705  if (VhdlDocGen::isGeneric(mdef)) tagFile << "generic";
1706  if (VhdlDocGen::isPort(mdef)) tagFile << "port";
1707  if (VhdlDocGen::isEntity(mdef)) tagFile << "entity";
1708  if (VhdlDocGen::isComponent(mdef)) tagFile << "component";
1709  if (VhdlDocGen::isVType(mdef)) tagFile << "type";
1710  if (VhdlDocGen::isConstant(mdef)) tagFile << "constant";
1711  if (VhdlDocGen::isSubType(mdef)) tagFile << "subtype";
1712  if (VhdlDocGen::isVhdlFunction(mdef)) tagFile << "function";
1713  if (VhdlDocGen::isProcedure(mdef)) tagFile << "procedure";
1714  if (VhdlDocGen::isProcess(mdef)) tagFile << "process";
1715  if (VhdlDocGen::isSignals(mdef)) tagFile << "signal";
1716  if (VhdlDocGen::isAttribute(mdef)) tagFile << "attribute";
1717  if (VhdlDocGen::isRecord(mdef)) tagFile << "record";
1718  if (VhdlDocGen::isLibrary(mdef)) tagFile << "library";
1719  if (VhdlDocGen::isPackage(mdef)) tagFile << "package";
1720  if (VhdlDocGen::isVariable(mdef)) tagFile << "shared variable";
1721  if (VhdlDocGen::isFile(mdef)) tagFile << "file";
1722  if (VhdlDocGen::isGroup(mdef)) tagFile << "group";
1723  if (VhdlDocGen::isCompInst(mdef)) tagFile << "instantiation";
1724  if (VhdlDocGen::isAlias(mdef)) tagFile << "alias";
1725  if (VhdlDocGen::isCompInst(mdef)) tagFile << "configuration";
1726 
1727  tagFile << "\">\n";
1728  tagFile << " <type>" << convertToXML(mdef->typeString()) << "</type>\n";
1729  tagFile << " <name>" << convertToXML(mdef->name()) << "</name>\n";
1730  tagFile << " <anchorfile>" << convertToXML(addHtmlExtensionIfMissing(mdef->getOutputFileBase())) << "</anchorfile>\n";
1731  tagFile << " <anchor>" << convertToXML(mdef->anchor()) << "</anchor>\n";
1732 
1733  if (VhdlDocGen::isVhdlFunction(mdef))
1734  tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),TRUE)) << "</arglist>\n";
1735  else if (VhdlDocGen::isProcedure(mdef))
1736  tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),FALSE)) << "</arglist>\n";
1737  else
1738  tagFile << " <arglist>" << convertToXML(mdef->argsString()) << "</arglist>\n";
1739 
1740  mdef->writeDocAnchorsToTagFile(tagFile);
1741  tagFile << " </member>\n";
1742 }
1743 
1744 /* writes a vhdl type declaration */
1745 
1747  const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
1748  bool /*inGroup*/)
1749 {
1750  const Definition *d=0;
1751 
1752  ASSERT(cd!=0 || nd!=0 || fd!=0 || gd!=0 ||
1755  ); // member should belong to something
1756  if (cd) d=cd;
1757  else if (nd) d=nd;
1758  else if (fd) d=fd;
1759  else if (gd) d=gd;
1760  else d=(Definition*)mdef;
1761 
1762  // write search index info
1764  {
1768  }
1769 
1770  QCString cname = d->name();
1771  QCString cfname = d->getOutputFileBase();
1772 
1773  //HtmlHelp *htmlHelp=0;
1774  // bool hasHtmlHelp = Config_getBool(GENERATE_HTML) && Config_getBool(GENERATE_HTMLHELP);
1775  // if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance();
1776 
1777  // search for the last anonymous scope in the member type
1778  ClassDef *annoClassDef=mdef->getClassDefOfAnonymousType();
1779 
1780  // start a new member declaration
1781  uint isAnonymous = (bool)(annoClassDef); // || m_impl->annMemb || m_impl->annEnumType;
1782  ///printf("startMemberItem for %s\n",qPrint(name()));
1783  uint64_t mm=mdef->getMemberSpecifiers();
1784  if (mm==VhdlDocGen::MISCELLANEOUS)
1785  isAnonymous=3;
1786 
1787  ol.startMemberItem( mdef->anchor(), isAnonymous ); //? 1 : m_impl->tArgList ? 3 : 0);
1788 
1789  // If there is no detailed description we need to write the anchor here.
1790  bool detailsVisible = mdef->hasDetailedDescription();
1791  if (!detailsVisible) // && !m_impl->annMemb)
1792  {
1793  QCString doxyName=mdef->name();
1794  if (!cname.isEmpty()) doxyName.prepend(cname+"::");
1795  QCString doxyArgs=mdef->argsString();
1796  ol.startDoxyAnchor(cfname,cname,mdef->anchor(),doxyName,doxyArgs);
1797 
1798  ol.pushGeneratorState();
1801  ol.docify("\n");
1802  ol.popGeneratorState();
1803 
1804  }
1805  // *** write type
1806  /*VHDL CHANGE */
1807 
1808  QCString ltype(mdef->typeString());
1809  QCString largs(mdef->argsString());
1810 
1811  ClassDef *kl=0;
1812  const ArgumentList &al = mdef->argumentList();
1813  QCString nn;
1814  //VhdlDocGen::adjustRecordMember(mdef);
1815  if (gd) gd=0;
1816  switch (mm)
1817  {
1819  VhdlDocGen::writeSource(mdef,ol,nn);
1820  break;
1821  case VhdlDocGen::PROCEDURE:
1822  case VhdlDocGen::FUNCTION:
1823  ol.startBold();
1824  VhdlDocGen::formatString(ltype,ol,mdef);
1825  ol.endBold();
1826  ol.insertMemberAlign();
1827  ol.docify(" ");
1828 
1829  writeLink(mdef,ol);
1830  if (al.hasParameters() && mm==VhdlDocGen::FUNCTION)
1831  VhdlDocGen::writeFunctionProto(ol,al,mdef);
1832 
1833  if (al.hasParameters() && mm==VhdlDocGen::PROCEDURE)
1834  VhdlDocGen::writeProcedureProto(ol,al,mdef);
1835 
1836  break;
1837  case VhdlDocGen::USE:
1838  kl=VhdlDocGen::getClass(mdef->name());
1839  if (kl && ((VhdlDocGen::VhdlClasses)kl->protection()==VhdlDocGen::ENTITYCLASS)) break;
1840  writeLink(mdef,ol);
1841  ol.insertMemberAlign();
1842  ol.docify(" ");
1843 
1844  if (kl)
1845  {
1846  nn=kl->getOutputFileBase();
1847  ol.pushGeneratorState();
1849  ol.docify(" ");
1851  ol.startBold();
1852  ol.docify(name);
1853  name.resize(0);
1854  ol.endBold();
1855  name+=" <"+mdef->name()+">";
1856  ol.startEmphasis();
1857  ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),QCString(),name);
1858  ol.popGeneratorState();
1859  }
1860  break;
1861  case VhdlDocGen::LIBRARY:
1862  writeLink(mdef,ol);
1863  ol.insertMemberAlign();
1864  if (largs=="context")
1865  {
1866  VhdlDocGen::writeRecordUnit(ltype,largs,ol,mdef);
1867  }
1868 
1869  break;
1870 
1871  case VhdlDocGen::GENERIC:
1872  case VhdlDocGen::PORT:
1873  case VhdlDocGen::ALIAS:
1874 
1875  writeLink(mdef,ol);
1876  ol.docify(" ");
1877  if (mm==VhdlDocGen::GENERIC)
1878  {
1879  ol.insertMemberAlign();
1880  ol.startBold();
1881  VhdlDocGen::formatString(largs,ol,mdef);
1882  ol.endBold();
1883  }
1884  else
1885  {
1886  ol.insertMemberAlignLeft(isAnonymous, false);
1887  ol.docify(" ");
1888  ol.startBold();
1889  VhdlDocGen::formatString(ltype,ol,mdef);
1890  ol.endBold();
1891  ol.insertMemberAlign();
1892  ol.docify(" ");
1893  VhdlDocGen::formatString(largs,ol,mdef);
1894  }
1895  break;
1896  case VhdlDocGen::PROCESS:
1897  writeLink(mdef,ol);
1898  ol.insertMemberAlign();
1899  VhdlDocGen::writeProcessProto(ol,al,mdef);
1900  break;
1901  case VhdlDocGen::PACKAGE:
1902  case VhdlDocGen::ENTITY:
1903  case VhdlDocGen::COMPONENT:
1905  case VhdlDocGen::CONFIG:
1906  if (VhdlDocGen::isCompInst(mdef) )
1907  {
1908  nn=largs;
1909  if(nn.stripPrefix("function") || nn.stripPrefix("package"))
1910  {
1911  VhdlDocGen::formatString(largs,ol,mdef);
1912  ol.insertMemberAlign();
1913  writeLink(mdef,ol);
1914  ol.docify(" ");
1915  VhdlDocGen::formatString(ltype,ol,mdef);
1916  break;
1917  }
1918 
1919  largs.prepend("::");
1920  largs.prepend(mdef->name());
1921  ol.writeObjectLink(mdef->getReference(),
1922  cfname,
1923  mdef->anchor(),
1924  mdef->name());
1925  }
1926  else
1927  writeLink(mdef,ol);
1928 
1929  ol.insertMemberAlign();
1930  ol.docify(" ");
1931  ol.startBold();
1932  ol.docify(ltype);
1933  ol.endBold();
1934  ol.docify(" ");
1935  if (VhdlDocGen::isComponent(mdef) ||
1936  VhdlDocGen::isConfig(mdef) ||
1937  VhdlDocGen::isCompInst(mdef))
1938  {
1939  if (VhdlDocGen::isConfig(mdef) || VhdlDocGen::isCompInst(mdef))
1940  {
1941  nn=ltype;
1942  }
1943  else
1944  {
1945  nn=mdef->name();
1946  }
1947  kl=getClass(nn);
1948  if (kl)
1949  {
1950  nn=kl->getOutputFileBase();
1951  ol.pushGeneratorState();
1953  ol.startEmphasis();
1954  QCString name("<Entity ");
1955  if (VhdlDocGen::isConfig(mdef) || VhdlDocGen::isCompInst(mdef))
1956  {
1957  name+=ltype+">";
1958  }
1959  else
1960  {
1961  name+=mdef->name()+"> ";
1962  }
1963  ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),QCString(),name);
1964  ol.endEmphasis();
1965  ol.popGeneratorState();
1966  }
1967  }
1968  break;
1969  case VhdlDocGen::UCF_CONST:
1970  writeUCFLink(mdef,ol);
1971  break;
1972  case VhdlDocGen::SIGNAL:
1973  case VhdlDocGen::ATTRIBUTE:
1974  case VhdlDocGen::SUBTYPE:
1975  case VhdlDocGen::CONSTANT:
1977  case VhdlDocGen::VFILE:
1978  case VhdlDocGen::GROUP:
1979  case VhdlDocGen::TYPE:
1980  writeLink(mdef,ol);
1981  ol.docify(" ");
1982  ol.insertMemberAlign();
1983  VhdlDocGen::formatString(ltype,ol,mdef);
1984  break;
1985  case VhdlDocGen::RECORD:
1986  case VhdlDocGen::UNITS:
1987  writeRecordUnit(largs,ltype,ol,mdef);
1988  break;
1989 
1990  default: break;
1991  }
1992 
1993  bool htmlOn = ol.isEnabled(OutputGenerator::Html);
1994  if (htmlOn && /*Config_getBool(HTML_ALIGN_MEMBERS) &&*/ !ltype.isEmpty())
1995  {
1997  }
1998  if (!ltype.isEmpty()) ol.docify(" ");
1999 
2000  if (htmlOn)
2001  {
2003  }
2004 
2005  if (!detailsVisible)// && !m_impl->annMemb)
2006  {
2007  ol.endDoxyAnchor(cfname,mdef->anchor());
2008  }
2009 
2010  ol.endMemberItem();
2011  if (!mdef->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC) /* && !annMemb */)
2012  {
2013  QCString s=mdef->briefDescription();
2015  ol.generateDoc(mdef->briefFile(),mdef->briefLine(),
2016  mdef->getOuterScope()?mdef->getOuterScope():d,
2017  mdef,s,TRUE,FALSE,
2018  QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
2019  if (detailsVisible)
2020  {
2021  ol.pushGeneratorState();
2023  //ol.endEmphasis();
2024  ol.docify(" ");
2025  if (mdef->getGroupDef()!=0 && gd==0) // forward link to the group
2026  {
2027  ol.startTextLink(mdef->getOutputFileBase(),mdef->anchor());
2028  }
2029  else // local link
2030  {
2031  ol.startTextLink(QCString(),mdef->anchor());
2032  }
2033  ol.endTextLink();
2034  //ol.startEmphasis();
2035  ol.popGeneratorState();
2036  }
2037  //ol.newParagraph();
2038  ol.endMemberDescription();
2039  }
2040  mdef->warnIfUndocumented();
2041 
2042 }// end writeVhdlDeclaration
2043 
2044 
2046  const MemberList* mlist,OutputList &ol,
2047  const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,uint64_t specifier)
2048 {
2049 
2050  StringSet pack;
2051 
2052  bool first=TRUE;
2053  for (const auto &imd : *mlist)
2054  {
2056  if (md)
2057  {
2058  uint64_t mems=md->getMemberSpecifiers();
2059  if (md->isBriefSectionVisible() && (mems==specifier) && (mems!=VhdlDocGen::LIBRARY) )
2060  {
2061  if (first) { ol.startMemberList();first=FALSE; }
2062  VhdlDocGen::writeVHDLDeclaration(md,ol,cd,nd,fd,gd,FALSE);
2063  } //if
2064  else if (md->isBriefSectionVisible() && (mems==specifier))
2065  {
2066  if (pack.find(md->name().str())==pack.end())
2067  {
2068  if (first) ol.startMemberList(),first=FALSE;
2069  VhdlDocGen::writeVHDLDeclaration(md,ol,cd,nd,fd,gd,FALSE);
2070  pack.insert(md->name().str());
2071  }
2072  } //if
2073  } //if
2074  } //for
2075  if (!first) ol.endMemberList();
2076 }//plainDeclaration
2077 
2078 static bool membersHaveSpecificType(const MemberList *ml,uint64 type)
2079 {
2080  if (ml==0) return FALSE;
2081  for (const auto &mdd : *ml)
2082  {
2083  if (mdd->getMemberSpecifiers()==type) //is type in class
2084  {
2085  return TRUE;
2086  }
2087  }
2088  for (const auto &mg : ml->getMemberGroupList())
2089  {
2090  if (!mg->members().empty())
2091  {
2092  if (membersHaveSpecificType(&mg->members(),type)) return TRUE;
2093  }
2094  }
2095  return FALSE;
2096 }
2097 
2099  const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,
2100  const QCString &title,const QCString &subtitle,bool /*showEnumValues*/,int type)
2101 {
2102  if (!membersHaveSpecificType(ml,type)) return;
2103 
2104  if (!title.isEmpty())
2105  {
2106  ol.startMemberHeader(convertToId(title),type == VhdlDocGen::PORT ? 3 : 2);
2107  ol.parseText(title);
2108  ol.endMemberHeader();
2109  ol.docify(" ");
2110  }
2111  if (!subtitle.isEmpty())
2112  {
2113  ol.startMemberSubtitle();
2114  ol.generateDoc("[generated]",-1,0,0,subtitle,FALSE,FALSE,
2115  QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
2116  ol.endMemberSubtitle();
2117  } //printf("memberGroupList=%p\n",memberGroupList);
2118 
2119  VhdlDocGen::writePlainVHDLDeclarations(ml,ol,cd,nd,fd,gd,type);
2120 
2121  for (const auto &mg : ml->getMemberGroupList())
2122  {
2123  if (membersHaveSpecificType(&mg->members(),type))
2124  {
2125  //printf("mg->header=%s\n",qPrint(mg->header()));
2126  bool hasHeader=mg->header()!="[NOHEADER]";
2127  ol.startMemberGroupHeader(hasHeader);
2128  if (hasHeader)
2129  {
2130  ol.parseText(mg->header());
2131  }
2132  ol.endMemberGroupHeader();
2133  if (!mg->documentation().isEmpty())
2134  {
2135  //printf("Member group has docs!\n");
2136  ol.startMemberGroupDocs();
2137  ol.generateDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE,
2138  QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
2139  ol.endMemberGroupDocs();
2140  }
2141  ol.startMemberGroup();
2142  //printf("--- mg->writePlainDeclarations ---\n");
2143  VhdlDocGen::writePlainVHDLDeclarations(&mg->members(),ol,cd,nd,fd,gd,type);
2144  ol.endMemberGroup(hasHeader);
2145  }
2146  }
2147 }// writeVHDLDeclarations
2148 
2149 
2151  OutputList &ol ,QCString & cname)
2152 {
2153  int id=cd->protection();
2154  QCString qcs = theTranslator->trVhdlType(id+2,TRUE);
2155  cname=VhdlDocGen::getClassName(cd);
2156  ol.startBold();
2157  ol.writeString(qcs);
2158  ol.writeString(" ");
2159  ol.endBold();
2160  //ol.insertMemberAlign();
2161  return FALSE;
2162 }// writeClassLink
2163 
2164 
2165 /*! writes a link if the string is linkable else a formatted string */
2166 
2168 {
2169  if (mdef)
2170  {
2171  const ClassDef *cd=mdef->getClassDef();
2172  if (cd)
2173  {
2174  QCString n=cd->name();
2175  const MemberDef* memdef=VhdlDocGen::findMember(n,mem);
2176  if (memdef && memdef->isLinkable())
2177  {
2178  ol.startBold();
2179  writeLink(memdef,ol);
2180  ol.endBold();
2181  ol.docify(" ");
2182  return;
2183  }
2184  }
2185  }
2186  startFonts(mem,"vhdlchar",ol);
2187 }// found component
2188 
2189 
2190 
2192 {
2193  auto intf = Doxygen::parserManager->getCodeParser(".vhd");
2194  // pIntf->resetCodeParserState();
2195 
2196  QCString codeFragment=mdef->documentation();
2197 
2198  if (cname.isEmpty())
2199  {
2200  writeLink(mdef,ol);
2201  int fi=0;
2202  int j=0;
2203  do
2204  {
2205  fi=codeFragment.find("\n",++fi);
2206  } while(fi>=0 && j++ <3);
2207 
2208  // show only the first four lines
2209  if (j==4)
2210  {
2211  codeFragment=codeFragment.left(fi);
2212  codeFragment.append("\n .... ");
2213  }
2214  }
2215 
2216  codeFragment.prepend("\n");
2217  ol.pushGeneratorState();
2218  ol.startCodeFragment("DoxyCode");
2219  intf->parseCode( ol, // codeOutIntf
2220  QCString(), // scope
2221  codeFragment, // input
2222  SrcLangExt_VHDL, // lang
2223  FALSE, // isExample
2224  QCString(), // exampleName
2225  const_cast<FileDef*>(mdef->getFileDef()), // fileDef
2226  mdef->getStartBodyLine(), // startLine
2227  mdef->getEndBodyLine(), // endLine
2228  TRUE, // inlineFragment
2229  mdef, // memberDef
2230  TRUE // show line numbers
2231  );
2232 
2233  ol.endCodeFragment("DoxyCode");
2234  ol.popGeneratorState();
2235 
2236  if (cname.isEmpty()) return;
2237 
2238  mdef->writeSourceDef(ol,cname);
2239  if (mdef->hasReferencesRelation()) mdef->writeSourceRefs(ol,cname);
2240  if (mdef->hasReferencedByRelation()) mdef->writeSourceReffedBy(ol,cname);
2241 }
2242 
2243 
2244 
2246 {
2247 
2248  QCString n=name;
2249  n=n.remove(0,6);
2250 
2251  int i=0;
2252 
2253  while((i=n.find("__"))>0)
2254  {
2255  n=n.remove(i,1);
2256  }
2257 
2258  while((i=n.find("_1"))>0)
2259  {
2260  n=n.replace(i,2,":");
2261  }
2262 
2263  return n;
2264 }
2265 
2266 void VhdlDocGen::parseUCF(const char* input, Entry* entity,const QCString &fileName,bool altera)
2267 {
2268  QCString ucFile(input);
2269  int lineNo=0;
2270  QCString comment("#!");
2271  QCString brief;
2272 
2273  while (!ucFile.isEmpty())
2274  {
2275  int i=ucFile.find("\n");
2276  if (i<0) break;
2277  lineNo++;
2278  QCString temp=ucFile.left(i);
2279  temp=temp.stripWhiteSpace();
2280  bool bb=temp.stripPrefix("//");
2281 
2282  if (!temp.isEmpty())
2283  {
2284  if (temp.stripPrefix(comment) )
2285  {
2286  brief+=temp;
2287  brief.append("\\n");
2288  }
2289  else if (!temp.stripPrefix("#") && !bb)
2290  {
2291  if (altera)
2292  {
2293  int in=temp.find("-name");
2294  if (in>0)
2295  {
2296  temp=temp.remove(0,in+5);
2297  }
2298 
2299  temp.stripPrefix("set_location_assignment");
2300 
2301  initUCF(entity,QCString(),temp,lineNo,fileName,brief);
2302  }
2303  else
2304  {
2305  static const reg::Ex ee(R"([\s=])");
2306  int in=findIndex(temp.str(),ee);
2307  if (in<0) in=0;
2308  QCString ff=temp.left(in);
2309  temp.stripPrefix(ff);
2310  ff.append("#");
2311  if (!temp.isEmpty())
2312  {
2313  initUCF(entity,ff,temp,lineNo,fileName,brief);
2314  }
2315  }
2316  }
2317  }//temp
2318 
2319  ucFile=ucFile.remove(0,i+1);
2320  }// while
2321 }
2322 
2323 static void initUCF(Entry* root,const QCString &type,QCString &qcs,
2324  int line,const QCString &fileName,QCString & brief)
2325 {
2326  if (qcs.isEmpty())return;
2327  QCString n;
2328 
2329  VhdlDocGen::deleteAllChars(qcs,';');
2330  qcs=qcs.stripWhiteSpace();
2331 
2332  static const reg::Ex reg(R"([\s=])");
2333  int i = findIndex(qcs.str(),reg);
2334  if (i<0) return;
2335  if (i==0)
2336  {
2337  n=type;
2339  }
2340  else
2341  {
2342  n=qcs.left(i);
2343  }
2344  qcs=qcs.remove(0,i+1);
2345  // qcs.prepend("|");
2346 
2347  qcs.stripPrefix("=");
2348 
2349  std::shared_ptr<Entry> current = std::make_shared<Entry>();
2350  current->spec=VhdlDocGen::UCF_CONST;
2351  current->section=Entry::VARIABLE_SEC;
2352  current->bodyLine=line;
2353  current->fileName=fileName;
2354  current->type="ucf_const";
2355  current->args+=qcs;
2356  current->lang= SrcLangExt_VHDL ;
2357 
2358  // adding dummy name for constraints like VOLTAGE=5,TEMPERATURE=20 C
2359  if (n.isEmpty())
2360  {
2361  n="dummy";
2363  }
2364 
2365  current->name= n+"_";
2366  current->name.append(VhdlDocGen::getRecordNumber());
2367 
2368  if (!brief.isEmpty())
2369  {
2370  current->brief=brief;
2371  current->briefLine=line;
2372  current->briefFile=fileName;
2373  brief.resize(0);
2374  }
2375 
2376  root->moveToSubEntryAndKeep(current);
2377 }
2378 
2379 
2380 static void writeUCFLink(const MemberDef* mdef,OutputList &ol)
2381 {
2382 
2383  QCString largs(mdef->argsString());
2384  QCString n= splitString(largs, '#');
2385  // VhdlDocGen::adjustRecordMember(mdef);
2386  bool equ=(n.length()==largs.length());
2387 
2388  if (!equ)
2389  {
2390  ol.writeString(n);
2391  ol.docify(" ");
2392  ol.insertMemberAlign();
2393  }
2394 
2395  if (mdef->name().contains("dummy")==0)
2396  {
2397  writeLink(mdef,ol);
2398  }
2399  if (equ)
2400  {
2401  ol.insertMemberAlign();
2402  }
2403  ol.docify(" ");
2404  VhdlDocGen::formatString(largs,ol,mdef);
2405 }
2406 
2407 // for cell_inst : [entity] work.proto [ (label|expr) ]
2409 {
2410  QCString label;
2411  if (!entity.contains(":")) return "";
2412 
2413  static const reg::Ex exp(R"([:()\s])");
2414  auto ql=split(entity.str(),exp);
2415  if (ql.size()<2)
2416  {
2417  return "";
2418  }
2419  label = ql[0];
2420  entity = ql[1];
2421  int index;
2422  if ((index=entity.findRev("."))>=0)
2423  {
2424  entity.remove(0,index+1);
2425  }
2426 
2427  if (ql.size()==3)
2428  {
2429  arch = ql[2];
2430  ql=split(arch.str(),exp);
2431  if (ql.size()>1) // expression
2432  {
2433  arch="";
2434  }
2435  }
2436  return label; // label
2437 }
2438 
2439 // use (configuration|entity|open) work.test [(cellfor)];
2440 
2442 {
2443  static const reg::Ex exp(R"([()\s])");
2444 
2445  auto ql = split(entity.str(),exp);
2446 
2447  if (findIndex(ql,"open")!=-1)
2448  {
2449  return "open";
2450  }
2451 
2452  if (ql.size()<2)
2453  {
2454  return "";
2455  }
2456 
2457  std::string label=ql[0];
2458  entity = ql[1];
2459  int index;
2460  if ((index=entity.findRev("."))>=0)
2461  {
2462  entity.remove(0,index+1);
2463  }
2464 
2465  if (ql.size()==3)
2466  {
2467  arch=ql[2];
2468  }
2469  return QCString(label);
2470 }
2471 
2472 
2473 
2474 // find class with upper/lower letters
2476 {
2477  for (const auto &cd : *Doxygen::classLinkedMap)
2478  {
2479  if (qstricmp(className.data(),qPrint(cd->name()))==0)
2480  {
2481  return cd.get();
2482  }
2483  }
2484  return 0;
2485 }
2486 
2487 
2488 /*
2489 
2490 // file foo.vhd
2491 // entity foo
2492 // .....
2493 // end entity
2494 
2495 // file foo_arch.vhd
2496 // architecture xxx of foo is
2497 // ........
2498 // end architecture
2499 
2500 */
2502 {
2503 
2504  QCString entity,arch,inst;
2505 
2506  for (const auto &cur : getVhdlInstList())
2507  {
2508  if (cur->stat ) // was bind
2509  {
2510  continue;
2511  }
2512 
2513  if (cur->includeName=="entity" || cur->includeName=="component" )
2514  {
2515  entity=cur->includeName+" "+cur->type;
2516  QCString rr=VhdlDocGen::parseForBinding(entity,arch);
2517  }
2518  else if (cur->includeName.isEmpty())
2519  {
2520  entity=cur->type;
2521  }
2522 
2524  inst=VhdlDocGen::getIndexWord(cur->args,0);
2527 
2528  if (cd==0)
2529  {
2530  continue;
2531  }
2532 
2533  // if (classEntity==0)
2534  // err("%s:%d:Entity:%s%s",qPrint(cur->fileName),cur->startLine,qPrint(entity)," could not be found");
2535 
2536  addInstance(classEntity,ar,cd,cur);
2537  }
2538 
2539 }
2540 
2541 static void addInstance(ClassDefMutable* classEntity, ClassDefMutable* ar,
2542  ClassDefMutable *cd , const std::shared_ptr<Entry> &cur)
2543 {
2544 
2545  QCString bName,n1;
2546  if (ar==0) return;
2547 
2548  if (classEntity==0)
2549  {
2550  //add component inst
2551  n1=cur->type;
2552  goto ferr;
2553  }
2554 
2555  if (classEntity==cd) return;
2556 
2557  bName=classEntity->name();
2558  // fprintf(stderr,"\naddInstance %s to %s %s %s\n",qPrint( classEntity->name()),qPrint(cd->name()),qPrint(ar->name()),cur->name);
2559  n1=classEntity->name();
2560 
2561  if (!cd->isBaseClass(classEntity, true, 0))
2562  {
2563  cd->insertBaseClass(classEntity,n1,Public,Normal,QCString());
2564  }
2565  else
2566  {
2567  VhdlDocGen::addBaseClass(cd,classEntity);
2568  }
2569 
2570  if (!VhdlDocGen::isSubClass(classEntity,cd,true,0))
2571  {
2572  classEntity->insertSubClass(cd,Public,Normal,QCString());
2573  classEntity->setLanguage(SrcLangExt_VHDL);
2574  }
2575 
2576 ferr:
2577  QCString uu=cur->name;
2578  std::unique_ptr<MemberDefMutable> md { createMemberDef(
2579  ar->getDefFileName(), cur->startLine,cur->startColumn,
2580  n1,uu,uu, QCString(),
2581  Public, Normal, cur->stat,Member,
2583  ArgumentList(),
2584  ArgumentList(),
2585  "") };
2586 
2587  if (!ar->getOutputFileBase().isEmpty())
2588  {
2589  TagInfo tg;
2590  tg.anchor = 0;
2591  tg.fileName = ar->getOutputFileBase();
2592  tg.tagName = 0;
2593  md->setTagInfo(&tg);
2594  }
2595 
2596  //fprintf(stderr,"\n%s%s%s\n",qPrint(md->name()),qPrint(cur->brief),qPrint(cur->doc));
2597 
2598  md->setLanguage(SrcLangExt_VHDL);
2599  md->setMemberSpecifiers(VhdlDocGen::INSTANTIATION);
2600  md->setBriefDescription(cur->brief,cur->briefFile,cur->briefLine);
2601  md->setBodySegment(cur->startLine,cur->startLine,-1) ;
2602  md->setDocumentation(cur->doc,cur->docFile,cur->docLine);
2603  FileDef *fd=ar->getFileDef();
2604  md->setBodyDef(fd);
2605  ar->insertMember(md.get());
2607  mn->push_back(std::move(md));
2608 
2609 }
2610 
2611 
2613 {
2614  int i=mdef->name().find('~');
2615  if (i>0)
2616  {
2617  //sets the real record member name
2618  const_cast<MemberDefMutable*>(mdef)->setName(mdef->name().left(i));
2619  }
2620 
2621  writeLink(mdef,ol);
2622  ol.startBold();
2623  ol.insertMemberAlign();
2624  if (!ltype.isEmpty()){
2625  VhdlDocGen::formatString(ltype,ol,mdef);
2626  }
2627  ol.endBold();
2628 }
2629 
2630 
2632  const MemberDef *md,
2633  OutputList& ol,
2634  QCString largs)
2635 {
2636 
2637  StringVector ql=split(largs.str(),"#");
2638  size_t len=ql.size();
2640  bool first=TRUE;
2641 
2642  for(size_t i=0;i<len;i++)
2643  {
2644  QCString n=QCString(ql[i]);
2645  ol.startParameterType(first,"");
2646  ol.endParameterType();
2648  VhdlDocGen::formatString(n,ol,md);
2649  if ((len-i)>1)
2650  {
2652  }
2653  else
2654  {
2656  }
2657 
2658  first=FALSE;
2659  }
2660 
2661 }//#
2662 
2663 
2664 
2665 bool VhdlDocGen::isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int level)
2666 {
2667  bool found=FALSE;
2668  //printf("isBaseClass(cd=%s) looking for %s\n",qPrint(name()),qPrint(bcd->name()));
2669  if (level>255)
2670  {
2671  err("Possible recursive class relation while inside %s and looking for %s\n",qPrint(cd->name()),qPrint(scd->name()));
2672  abort();
2673  return FALSE;
2674  }
2675 
2676  for (const auto &bcd :cd->subClasses())
2677  {
2678  const ClassDef *ccd=bcd.classDef;
2679  if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster();
2680  //printf("isSubClass() subclass %s\n",qPrint(ccd->name()));
2681  if (ccd==scd)
2682  {
2683  found=TRUE;
2684  }
2685  else
2686  {
2687  if (level <256)
2688  {
2689  found=ccd->isBaseClass(scd,followInstances,level+1);
2690  }
2691  }
2692  }
2693  return found;
2694 }
2695 
2697 {
2698  BaseClassList bcl = cd->baseClasses();
2699  for (auto &bcd : bcl)
2700  {
2701  ClassDef *ccd = bcd.classDef;
2702  if (ccd==ent)
2703  {
2704  QCString n = bcd.usedName;
2705  int i = n.find('(');
2706  if(i<0)
2707  {
2708  bcd.usedName.append("(2)");
2709  return;
2710  }
2711  static const reg::Ex reg(R"(\d+)");
2712  QCString s=n.left(i);
2713  QCString r=n.right(n.length()-i);
2714  std::string t=r.str();
2717  r.setNum(r.toInt()+1);
2718  reg::replace(t, reg, r.str());
2719  s.append(t.c_str());
2720  bcd.usedName=s;
2721  bcd.templSpecifiers=t;
2722  }
2723  }
2724  cd->updateBaseClasses(bcl);
2725 }
2726 
2727 
2728 static std::vector<const MemberDef*> mdList;
2729 
2730 static const MemberDef* findMemFlow(const MemberDef* mdef)
2731 {
2732  for (const auto &md : mdList)
2733  {
2734  if (md->name()==mdef->name() && md->getStartBodyLine()==mdef->getStartBodyLine())
2735  {
2736  return md;
2737  }
2738  }
2739  return 0;
2740 }
2741 
2743 {
2744  if (mdef==0) return;
2745 
2746  QCString codeFragment;
2747  const MemberDef* mm=0;
2748  if ((mm=findMemFlow(mdef))!=0)
2749  {
2750  // don't create the same flowchart twice
2752  return;
2753  }
2754  else
2755  {
2756  mdList.push_back(mdef);
2757  }
2758 
2759  //fprintf(stderr,"\n create flow mem %s %p\n",qPrint(mdef->name()),mdef);
2760 
2761  int actualStart= mdef->getStartBodyLine();
2762  int actualEnd=mdef->getEndBodyLine();
2763  const FileDef* fd=mdef->getFileDef();
2764  bool b=readCodeFragment( fd->absFilePath(), actualStart,actualEnd,codeFragment);
2765  if (!b) return;
2766 
2767  auto parser { Doxygen::parserManager->getOutlineParser(".vhd") };
2769  std::shared_ptr<Entry> root = std::make_shared<Entry>();
2770  StringVector filesInSameTu;
2771  parser->parseInput("",codeFragment.data(),root,nullptr);
2772 }
2773 
2775 {
2776  g_varMap.clear();
2777  g_classList.clear();
2778  g_packages.clear();
2779 }
2780 
2782 { return mdef->getMemberSpecifiers()==VhdlDocGen::UCF_CONST; }
2784 { return mdef->getMemberSpecifiers()==VhdlDocGen::CONFIG; }
2786 { return mdef->getMemberSpecifiers()==VhdlDocGen::ALIAS; }
2788 { return mdef->getMemberSpecifiers()==VhdlDocGen::LIBRARY; }
2790 { return mdef->getMemberSpecifiers()==VhdlDocGen::GENERIC; }
2792 { return mdef->getMemberSpecifiers()==VhdlDocGen::PORT; }
2794 { return mdef->getMemberSpecifiers()==VhdlDocGen::COMPONENT; }
2796 { return mdef->getMemberSpecifiers()==VhdlDocGen::USE; }
2798 { return mdef->getMemberSpecifiers()==VhdlDocGen::ENTITY; }
2800 { return mdef->getMemberSpecifiers()==VhdlDocGen::CONSTANT; }
2802 { return mdef->getMemberSpecifiers()==VhdlDocGen::TYPE; }
2804 { return mdef->getMemberSpecifiers()==VhdlDocGen::SUBTYPE; }
2806 { return mdef->getMemberSpecifiers()==VhdlDocGen::FUNCTION; }
2808 { return mdef->getMemberSpecifiers()==VhdlDocGen::PROCESS; }
2810 { return mdef->getMemberSpecifiers()==VhdlDocGen::SIGNAL; }
2812 { return mdef->getMemberSpecifiers()==VhdlDocGen::ATTRIBUTE; }
2814 { return mdef->getMemberSpecifiers()==VhdlDocGen::SIGNAL; }
2816 { return mdef->getMemberSpecifiers()==VhdlDocGen::PROCEDURE; }
2818 { return mdef->getMemberSpecifiers()==VhdlDocGen::RECORD; }
2820 { return mdef->getMemberSpecifiers()==VhdlDocGen::ARCHITECTURE; }
2822 { return mdef->getMemberSpecifiers()==VhdlDocGen::UNITS; }
2824 { return mdef->getMemberSpecifiers()==VhdlDocGen::PACKAGE_BODY; }
2828 { return mdef->getMemberSpecifiers()==VhdlDocGen::VFILE; }
2830 { return mdef->getMemberSpecifiers()==VhdlDocGen::GROUP; }
2835 
2836 
2837 
2838 //############################## Flowcharts #################################################
2839 
2840 #define STARTL (FlowChart::WHILE_NO | FlowChart::IF_NO | \
2841  FlowChart::FOR_NO | FlowChart::CASE_NO | \
2842  FlowChart::LOOP_NO | WHEN_NO)
2843 #define DECLN (FlowChart::WHEN_NO | \
2844  FlowChart::ELSIF_NO | FlowChart::IF_NO | \
2845  FlowChart::FOR_NO | FlowChart::WHILE_NO | \
2846  FlowChart::CASE_NO | FlowChart::LOOP_NO )
2847 #define STARTFIN (FlowChart::START_NO | FlowChart::END_NO)
2848 #define LOOP (FlowChart::FOR_NO | FlowChart::WHILE_NO | \
2849  FlowChart::LOOP_NO )
2850 #define ENDCL (FlowChart::END_CASE | FlowChart::END_LOOP)
2851 #define EEND (FlowChart::ENDIF_NO | FlowChart::ELSE_NO )
2852 #define IFF (FlowChart::ELSIF_NO | FlowChart::IF_NO)
2853 #define EXITNEXT (FlowChart::EXIT_NO | FlowChart::NEXT_NO )
2854 #define EMPTY (EEND | FlowChart::ELSIF_NO)
2855 #define EE (FlowChart::ELSE_NO | FlowChart::ELSIF_NO)
2856 #define EMPTNODE (ENDCL | EEND | FlowChart::ELSIF_NO)
2857 #define FLOWLEN (flowList.size()-1)
2858 
2859 static int ifcounter=0;
2860 static int nodeCounter=0;
2861 
2862 static struct
2863 {
2864  // link colors
2865  const char *textNodeLink;
2866  const char *yesNodeLink;
2867  const char *noNodeLink;
2868 
2869  // node colors
2870  const char* comment;
2871  const char* decisionNode;
2872  const char* varNode;
2873  const char *startEndNode;
2874  const char* textNode;
2875 } flowCol =
2876 { "green", // textNodeLink
2877  "red", // yesNodeLink
2878  "black", // noNodeLink
2879  "khaki", // comment
2880  "0.7 0.3 1.0", // decisionNode
2881  "lightyellow", // varNode
2882  "white", // startEndNode
2883  "lightcyan" // textNode
2884 };
2885 
2886 std::vector<FlowChart> flowList;
2887 
2888 #ifdef DEBUGFLOW
2889 static std::map<std::string,int> g_keyMap;
2890 #endif
2891 
2893 {
2894  if (q.length()<=80) return;
2895 
2896  if (q.length()>200)
2897  {
2898  q.resize(200);
2899  }
2900 
2901  q.append(" ...");
2902 
2903  QCString str(q);
2904  QCString temp;
2905 
2906  while (str.length()>80)
2907  {
2908  int j=std::max(str.findRev(' ',80),str.findRev('|',80));
2909  if (j<=0)
2910  {
2911  temp+=str;
2912  q=temp;
2913  return;
2914  }
2915  else
2916  {
2917  QCString qcs=str.left(j);
2918  temp+=qcs+"\\";
2919  temp+="n";
2920  str.remove(0,j);
2921  }
2922  }//while
2923 
2924  q=temp+str;
2925 // #endif
2926 }
2927 
2929 {
2930  QCString ui="-";
2931  std::string q;
2932  std::string t;
2933 
2934  ui.fill('-',255);
2935 
2936  if (flo.type & STARTL)
2937  {
2938  if (flo.stamp>0)
2939  {
2940  q=ui.left(2*flo.stamp).str();
2941  }
2942  else
2943  {
2944  q=" ";
2945  }
2946  QCString nn=flo.exp.stripWhiteSpace();
2947  printf("\nYES: %s%s[%d,%d]",qPrint(q),qPrint(nn),flo.stamp,flo.id);
2948  }
2949  else
2950  {
2951  if (flo.type & COMMENT_NO)
2952  {
2953  t=flo.label.str();
2954  }
2955  else
2956  {
2957  t=flo.text.str();
2958  }
2959  static const reg::Ex ep(R"(\s)");
2960  t = reg::replace(t,ep,std::string());
2961  if (t.empty())
2962  {
2963  t=" ";
2964  }
2965  if (flo.stamp>0)
2966  {
2967  q=ui.left(2*flo.stamp).str();
2968  }
2969  else
2970  {
2971  q=" ";
2972  }
2973  if (flo.type & EMPTNODE)
2974  {
2975  printf("\n NO: %s%s[%d,%d]",q.c_str(),FlowChart::getNodeType(flo.type),flo.stamp,flo.id);
2976  }
2977  else if (flo.type & COMMENT_NO)
2978  {
2979  printf("\n NO: %s%s[%d,%d]",t.c_str(),FlowChart::getNodeType(flo.type),flo.stamp,flo.id);
2980  }
2981  else
2982  {
2983  printf("\n NO: %s[%d,%d]",t.c_str(),flo.stamp,flo.id);
2984  }
2985  }
2986 }
2987 
2989 {
2990  for (const auto &flowChart : flowList)
2991  {
2992  printNode(flowChart);
2993  }
2994 }
2995 
2997 {
2998  FlowChart *flno = nullptr;
2999  bool found=FALSE;
3000  for (size_t j=0;j<flowList.size();j++)
3001  {
3002  FlowChart &flo = flowList[j];
3003  if (flo.type&TEXT_NO)
3004  {
3005  if (!found)
3006  {
3007  flno=&flo;
3008  }
3009  else
3010  {
3011  flno->text+=flo.text;
3012  flowList.erase(flowList.begin()+j);
3013  if (j>0) j=j-1;
3014  }
3015  found=TRUE;
3016  }
3017  else
3018  {
3019  found=FALSE;
3020  }
3021  }
3022 
3023  // find if..endif without text
3024  // if..elseif without text
3025  if (!flowList.empty())
3026  {
3027  for (size_t j=0;j<flowList.size()-1;j++)
3028  {
3029  const FlowChart &flo = flowList[j];
3030  int kind = flo.type;
3031  if ( (kind & IFF) || (flo.type & ELSE_NO))
3032  {
3033  const FlowChart &ftemp = flowList[j+1];
3034  if (ftemp.type & EMPTY)
3035  {
3036  FlowChart fc(TEXT_NO,"empty ",QCString());
3037  fc.stamp = flo.stamp;
3038  flowList.insert(flowList.begin()+j+1,fc);
3039  }
3040  }
3041  }
3042  }
3043 
3044 }// colTextNode
3045 
3047 {
3048  QCString node;
3049  node.setNum(n);
3050  return node.prepend("node");
3051 }
3052 
3054 {
3055  ifcounter=0;
3056  nodeCounter=0;
3057  flowList.clear();
3058 }
3059 
3061 {
3062  uint max=0;
3063  QCString s;
3064  StringVector ql=split(com.str(),"\n");
3065  for (size_t j=0;j<ql.size();j++)
3066  {
3067  s=ql[j];
3068  if (max<s.length()) max=s.length();
3069  }
3070 
3071  s=ql.back();
3072  int diff=max-s.length();
3073 
3074  QCString n(1);
3075  if (diff>0)
3076  {
3077  n.fill(' ',2*diff);
3078  n.append(".");
3079  s+=n;
3080  ql.pop_back();
3081  ql.push_back(s.str());
3082  }
3083 
3084  for (size_t j=0;j<ql.size();j++)
3085  {
3086  s=ql[j];
3087  if (j<ql.size()-1)
3088  {
3089  s+="\n";
3090  }
3091  FlowChart::codify(t,s);
3092  }
3093 }
3094 
3095 
3097 {
3098  size_t size=flowList.size();
3099  bool begin=false;
3100 
3101  if (size>0)
3102  {
3103  for (uint j=0;j < size-1 ;j++)
3104  {
3105  FlowChart &fll = flowList[j];
3106  if (fll.type & COMMENT_NO)
3107  {
3108  FlowChart &to=flowList[j+1];
3109  if (to.type & COMMENT_NO)
3110  {
3111  to.label = fll.label+"\n"+to.label;
3112  flowList.erase(flowList.begin()+j);
3113  if (size>0) size--;
3114  if (j>0) j--;
3115  }
3116  }
3117  }// for
3118  }
3119 
3120  for (size_t j=0;j <flowList.size() ;j++)
3121  {
3122  const FlowChart &fll=flowList[j];
3123 
3124  if (fll.type & BEGIN_NO)
3125  {
3126  begin = true;
3127  continue;
3128  }
3129 
3130  if (fll.type & COMMENT_NO)
3131  {
3132  const FlowChart *to;
3133  if (!begin)
3134  {
3135  // comment between function/process .. begin is linked to start node
3136  to = &flowList[0];
3137  }
3138  else if (j>0 && flowList[j-1].line==fll.line)
3139  {
3140  to = &flowList[j-1];
3141  }
3142  else
3143  {
3144  to = &flowList[j+1];
3145  }
3146  t << getNodeName(fll.id);
3147  t << "[shape=none, label=<\n";
3148  t << "<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
3149  t << "<TR><TD BGCOLOR=\"";
3150  t << flowCol.comment;
3151  t << "\" > ";
3152 
3154  t << " </TD></TR></TABLE>>];";
3155  writeEdge(t,fll.id,to->id,2);
3156  }
3157  }// for
3158 
3159  // delete comment nodes;
3160  size=flowList.size();
3161  for (size_t j=0; j<size; j++)
3162  {
3163  FlowChart &fll=flowList[j];
3164  if (fll.type & (COMMENT_NO | BEGIN_NO))
3165  {
3166  size_t diff=FLOWLEN-(j+1);
3167 
3168  if ((fll.type & COMMENT_NO) && diff > 1)
3169  {
3170  flowList[j+1].label = fll.label;
3171  }
3172 
3173  flowList.erase(flowList.begin()+j);
3174 
3175  if (size>0) size--;
3176  if (j>0) j--;
3177  }
3178  }// for;
3179 }
3180 
3182 {
3183  if (!str.isEmpty())
3184  {
3185  const char *p=str.data();
3186  char c;
3187  while (*p)
3188  {
3189  c=*p++;
3190  switch(c)
3191  {
3192  case '<': t << "&lt;"; break;
3193  case '>': t << "&gt;"; break;
3194  case '&': t << "&amp;"; break;
3195  case '\'': t << "&#39;"; break;
3196  case '"': t << "&quot;"; break;
3197  case '\n': t <<"<BR ALIGN=\"LEFT\"/>"; break;
3198  default: t << c; break;
3199  }
3200  }
3201  }
3202 }//codify
3203 
3205 {
3206 }
3207 
3208 FlowChart::FlowChart(int typ,const QCString &t,const QCString &ex,const QCString &lab)
3209 {
3210  stamp=ifcounter;
3211 
3212  if (typ & STARTL)
3213  {
3214  ifcounter++;
3215  }
3216 
3217  text=t;
3218  exp=ex;
3219  type=typ;
3220  label=lab;
3221 
3222  if (typ & (ELSE_NO | ELSIF_NO))
3223  {
3224  stamp--;
3225  }
3226 
3227  if (typ & (START_NO | END_NO | VARIABLE_NO))
3228  {
3229  stamp=0;
3230  }
3231 
3232  id=nodeCounter++;
3233 }
3234 
3235 void FlowChart::addFlowChart(int type,const QCString &text,const QCString &exp, const QCString &label)
3236 {
3237  if (!VhdlDocGen::getFlowMember()) return;
3238 
3239  QCString typeString(text);
3240  QCString expression(exp);
3241 
3242 
3243  if (!text.isEmpty())
3244  {
3245  typeString=substitute(typeString,";","\n");
3246  }
3247 
3248  if (!exp.isEmpty())
3249  {
3250  expression=substitute(expression,"\"","\\\"");
3251  }
3252 
3253  if (type & (START_NO | VARIABLE_NO))
3254  {
3255  flowList.insert(flowList.begin(),FlowChart(type,typeString,expression,label));
3256  flowList.front().line=1; // TODO: use getLine(); of the parser
3257  }
3258  else
3259  {
3260  flowList.emplace_back(type,typeString,expression,label);
3261  flowList.back().line=1; // TODO: use getLine(); of the parser
3262  }
3263 }
3264 
3266 {
3267  if (!VhdlDocGen::getFlowMember()) return;
3268  ifcounter--;
3269 }
3270 
3271 QCString FlowChart::printPlantUmlNode(const FlowChart &flo,bool ca,bool endL)
3272 {
3273  QCString t;
3276  switch (flo.type)
3277  {
3278  case START_NO: t=":"+text+"|"; break;
3279  case IF_NO : t="\nif ("+exp+") then (yes)"; break;
3280  case ELSIF_NO: t="\nelseif ("+exp+") then (yes)"; break;
3281  case ELSE_NO: t="\nelse"; break;
3282  case CASE_NO: t="\n:"+exp+";"; break;
3283  case WHEN_NO: t="\n";
3284  if (!ca) t+="else";
3285  t+="if ("+exp+") then (yes)";
3286  break;
3287  case EXIT_NO: break;
3288  case END_NO: if (text.contains(" function")==0) t="\n:"+text+";";
3289  break;
3290  case TEXT_NO: t="\n:"+text+"]"; break;
3291  case ENDIF_NO: t="\nendif"; break;
3292  case FOR_NO: t="\nwhile ("+exp+") is (yes)"; break;
3293  case WHILE_NO: t="\nwhile ("+exp+") is (yes)"; break;
3294  case END_LOOP: t="\nendwhile"; break;
3295  case END_CASE: t="\nendif\n:end case;"; break;
3296  case VARIABLE_NO:t="\n:"+text+";"; break;
3297  case RETURN_NO: t="\n:"+text+";";
3298  if (!endL) t+="\nstop";
3299  break;
3300  case LOOP_NO: t="\nwhile (infinite loop)"; break;
3301  case NEXT_NO: break;
3302  case EMPTY_NO: break;
3303  case COMMENT_NO: t="\n note left \n "+flo.label+"\nend note \n"; break;
3304  case BEGIN_NO: t="\n:begin;"; break;
3305  default: assert(false); break;
3306  }
3307  return t;
3308 }
3309 
3311 {
3312  int caseCounter = 0;
3313  int whenCounter = 0;
3314 
3315  QCString qcs;
3316  size_t size=flowList.size();
3317  for (size_t j=0;j<size;j++)
3318  {
3319  bool endList = j==FLOWLEN;
3320  const FlowChart &flo = flowList[j];
3321  if (flo.type==CASE_NO)
3322  {
3323  caseCounter++;
3324  whenCounter=0;
3325  }
3326 
3327  if (flo.type==END_CASE)
3328  {
3329  caseCounter--;
3330  }
3331 
3332  bool ca = (caseCounter>0 && whenCounter==0);
3333 
3334  qcs+=printPlantUmlNode(flo,ca,endList);
3335 
3336  if (flo.type==WHEN_NO)
3337  {
3338  whenCounter++;
3339  }
3340 
3341  }
3342  qcs+="\n";
3343 
3344  QCString htmlOutDir = Config_getString(HTML_OUTPUT);
3345 
3349 }
3350 
3352 {
3353  return VhdlDocGen::getFlowMember()->name();
3354 }
3355 
3356 const char* FlowChart::getNodeType(int c)
3357 {
3358  switch(c)
3359  {
3360  case IF_NO: return "if ";
3361  case ELSIF_NO: return "elsif ";
3362  case ELSE_NO: return "else ";
3363  case CASE_NO: return "case ";
3364  case WHEN_NO: return "when ";
3365  case EXIT_NO: return "exit ";
3366  case END_NO: return "end ";
3367  case TEXT_NO: return "text ";
3368  case START_NO: return "start ";
3369  case ENDIF_NO: return "endif ";
3370  case FOR_NO: return "for ";
3371  case WHILE_NO: return "while ";
3372  case END_LOOP: return "end_loop ";
3373  case END_CASE: return "end_case ";
3374  case VARIABLE_NO: return "variable_decl ";
3375  case RETURN_NO: return "return ";
3376  case LOOP_NO: return "infinite loop ";
3377  case NEXT_NO: return "next ";
3378  case COMMENT_NO: return "comment ";
3379  case EMPTY_NO: return "empty ";
3380  case BEGIN_NO: return "<begin> ";
3381  default: return "--failure--";
3382  }
3383 }
3384 
3386 {
3387  QCString qcs("/");
3388  QCString ov = Config_getString(HTML_OUTPUT);
3389 
3390  qcs+=FlowChart::convertNameToFileName()+".svg";
3391 
3392  //const MemberDef *m=VhdlDocGen::getFlowMember();
3393  //if (m)
3394  // fprintf(stderr,"\n creating flowchart : %s %s in file %s \n",theTranslator->trVhdlType(m->getMemberSpecifiers(),TRUE),qPrint(m->name()),qPrint(m->getFileDef()->name()));
3395 
3396  QCString dir=" -o \""+ov+qcs+"\"";
3397  ov+="/flow_design.dot";
3398 
3399  QCString vlargs="-Tsvg \""+ov+"\" "+dir ;
3400 
3401  if (Portable::system(Config_getString(DOT_PATH) + "dot",vlargs)!=0)
3402  {
3403  err("could not create dot file");
3404  }
3405 }
3406 
3408 {
3409  t << " digraph G { \n";
3410  t << "rankdir=TB \n";
3411  t << "concentrate=true\n";
3412  t << "stylesheet=\"doxygen.css\"\n";
3413 }
3414 
3416 {
3417  t << " } \n";
3418 }
3419 
3421 {
3422  // assert(VhdlDocGen::flowMember);
3423 
3424  QCString ov = Config_getString(HTML_OUTPUT);
3425  QCString fileName = ov+"/flow_design.dot";
3426  std::ofstream f(fileName.str(),std::ofstream::out | std::ofstream::binary);
3427  if (!f.is_open())
3428  {
3429  err("Cannot open file %s for writing\n",qPrint(fileName));
3430  return;
3431  }
3432  TextStream t(&f);
3433 
3434  colTextNodes();
3435  // buildCommentNodes(t);
3436 
3437 #ifdef DEBUGFLOW
3438  printFlowTree();
3439 #endif
3440 
3441  if (!Config_getString(PLANTUML_JAR_PATH).isEmpty())
3442  {
3443  printUmlTree();
3444  delFlowList();
3445  t.flush();
3446  f.close();
3447  return;
3448  }
3449 
3450  startDot(t);
3451  buildCommentNodes(t);
3452  for (const auto &fll : flowList)
3453  {
3454  writeShape(t,fll);
3455  }
3456  writeFlowLinks(t);
3457 
3458  FlowChart::endDot(t);
3459  delFlowList();
3460  t.flush();
3461  f.close();
3463 }// writeFlowChart
3464 
3466 {
3467  if (fl.type & EEND) return;
3468  QCString var;
3469  if (fl.type & LOOP)
3470  {
3471  var=" loop";
3472  }
3473  else if (fl.type & IFF)
3474  {
3475  var=" then";
3476  }
3477  else
3478  {
3479  var="";
3480  }
3481 
3482  t << getNodeName(fl.id);
3483 
3484 #ifdef DEBUGFLOW
3485  QCString qq(getNodeName(fl.id));
3486  g_keyMap.insert({qq.str(),fl.id});
3487 #endif
3488 
3489  bool dec=(fl.type & DECLN);
3490  bool exit=(fl.type & EXITNEXT);
3491  if (exit && !fl.exp.isEmpty())
3492  {
3493  dec=TRUE;
3494  }
3495  if (dec)
3496  {
3497  QCString exp=fl.exp;
3498  alignText(exp);
3499 
3500  t << " [shape=diamond,style=filled,color=\"";
3501  t << flowCol.decisionNode;
3502  t << "\",label=\" ";
3503  QCString kl;
3504  if (exit) kl=fl.text+" ";
3505 
3506  if (!fl.label.isEmpty())
3507  {
3508  kl+=fl.label+":"+exp+var;
3509  }
3510  else
3511  {
3512  kl+=exp+var;
3513  }
3514 
3516  t << "\"]\n";
3517  }
3518  else if (fl.type & ENDCL)
3519  {
3520  QCString val=fl.text;
3521  t << " [shape=ellipse ,label=\""+val+"\"]\n";
3522  }
3523  else if (fl.type & STARTFIN)
3524  {
3525  QCString val=fl.text;
3526  t << "[shape=box , style=rounded label=<\n";
3527  t << "<TABLE BORDER=\"0\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" >\n ";
3528  t << "<TR><TD BGCOLOR=\"";
3529  t<< flowCol.startEndNode;
3530  t<< "\"> ";
3532  t << " </TD></TR></TABLE>>];";
3533  }
3534  else
3535  {
3536  if (fl.text.isEmpty()) return;
3537  bool isVar=(fl.type & FlowChart::VARIABLE_NO);
3538  QCString q=fl.text;
3539 
3540  if (exit)
3541  {
3542  q+=" "+fl.label;
3543  }
3544 
3545  int z=q.findRev("\n");
3546 
3547  if (z==(int)q.length()-1)
3548  {
3549  q=q.remove(z,2);
3550  }
3551  t << "[shape=none margin=0.1, label=<\n";
3552  t << "<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
3553  if (isVar)
3554  {
3555  t << "<TR><TD BGCOLOR=\"" << flowCol.varNode << "\" > ";
3556  }
3557  else
3558  {
3559  t << "<TR><TD BGCOLOR=\"" << flowCol.textNode << "\" > ";
3560  }
3562  t << " </TD></TR></TABLE>>];";
3563  }
3564 }
3565 
3566 
3567 void FlowChart::writeEdge(TextStream &t,const FlowChart &fl_from,const FlowChart &fl_to,int i)
3568 {
3569  bool b=fl_from.type & STARTL;
3570  bool c=fl_to.type & STARTL;
3571 
3572 #ifdef DEBUGFLOW
3573  QCString s1(getNodeName(fl_from.id));
3574  QCString s2(getNodeName(fl_to.id));
3575  auto it = g_keyMap.find(s1.str());
3576  auto it1 = g_keyMap.find(s2.str());
3577  // checks if the link is connected to a valid node
3578  assert(it!=g_keyMap.end());
3579  assert(it1!=g_keyMap.end());
3580 #endif
3581 
3582  writeEdge(t,fl_from.id,fl_to.id,i,b,c);
3583 }
3584 
3585 void FlowChart::writeEdge(TextStream &t,int fl_from,int fl_to,int i,bool bFrom,bool bTo)
3586 {
3587  QCString label,col;
3588 
3589  if (i==0)
3590  {
3591  col=flowCol.yesNodeLink;
3592  label="yes";
3593  }
3594  else if (i==1)
3595  {
3596  col=flowCol.noNodeLink;
3597  label="no";
3598  }
3599  else
3600  {
3601  col=flowCol.textNodeLink;
3602  label="";
3603  }
3604 
3605  t << "edge [color=\""+col+"\",label=\""+label+"\"]\n";
3606  t << getNodeName(fl_from);
3607  if (bFrom) t << ":s";
3608  t << "->";
3609  t << getNodeName(fl_to);
3610  if (bTo) t << ":n";
3611  t << "\n";
3612 }
3613 
3614 void FlowChart::alignFuncProc( QCString & q,const ArgumentList &al,bool isFunc)
3615 {
3616  size_t index=al.size();
3617  if (index==0) return;
3618 
3619  int len=q.length()+VhdlDocGen::getFlowMember()->name().length();
3620  QCString prev,temp;
3621  prev.fill(' ',len+1);
3622 
3623  q+="\n";
3624  for (const Argument &arg : al)
3625  {
3626  QCString attl=arg.defval+" ";
3627  attl+=arg.name+" ";
3628 
3629  if (!isFunc)
3630  {
3631  attl+=arg.attrib+" ";
3632  }
3633  else
3634  {
3635  attl+=" in ";
3636  }
3637  attl+=arg.type;
3638  if (--index) attl+=",\n"; else attl+="\n";
3639 
3640  attl.prepend(prev);
3641  temp+=attl;
3642  }
3643 
3644  q+=temp;
3645 }
3646 
3647 size_t FlowChart::findNextLoop(size_t index,int stamp)
3648 {
3649  for (size_t j=index+1; j<flowList.size(); j++)
3650  {
3651  const FlowChart &flo = flowList[j];
3652  if (flo.stamp==stamp)
3653  {
3654  continue;
3655  }
3656  if (flo.type&END_LOOP)
3657  {
3658  return j;
3659  }
3660  }
3661  return flowList.size()-1;
3662 }
3663 
3664 size_t FlowChart::findPrevLoop(size_t index,int stamp,bool endif)
3665 {
3666  for (size_t j=index;j>0;j--)
3667  {
3668  const FlowChart &flo = flowList[j];
3669  if (flo.type & LOOP)
3670  {
3671  if (flo.stamp==stamp && endif)
3672  {
3673  return j;
3674  }
3675  else
3676  {
3677  if (flo.stamp<stamp)
3678  {
3679  return j;
3680  }
3681  }
3682  }
3683  }
3684  return flowList.size()-1;
3685 }
3686 
3687 size_t FlowChart::findLabel(size_t index,const QCString &label)
3688 {
3689  for (size_t j=index;j>0;j--)
3690  {
3691  const FlowChart &flo = flowList[j];
3692  if ((flo.type & LOOP) && !flo.label.isEmpty() && qstricmp(flo.label,label)==0)
3693  {
3694  return j;
3695  }
3696  }
3697  err("could not find label: %s",qPrint(label));
3698  return 0;
3699 }
3700 
3701 size_t FlowChart::findNode(size_t index,int stamp,int type)
3702 {
3703  for (size_t j=index+1; j<flowList.size(); j++)
3704  {
3705  const FlowChart &flo = flowList[j];
3706  if (flo.type==type && flo.stamp==stamp)
3707  {
3708  return j;
3709  }
3710  }
3711  return 0;
3712 }// findNode
3713 
3714 size_t FlowChart::getNextNode(size_t index,int stamp)
3715 {
3716  for (size_t j=index+1; j<flowList.size(); j++)
3717  {
3718  const FlowChart &flo = flowList[j];
3719  int kind = flo.type;
3720  int s = flo.stamp;
3721  if (s>stamp)
3722  {
3723  continue;
3724  }
3725  if (kind & ENDIF_NO)
3726  {
3727  if (s<stamp && stamp>0)
3728  {
3729  stamp--;
3730  continue;
3731  }
3732  }
3733  if (kind & (ELSE_NO | ELSIF_NO))
3734  {
3735  if (s<stamp && stamp>0)
3736  {
3737  stamp--;
3738  }
3739  j=findNode(j,stamp,ENDIF_NO);
3740  continue;
3741  }
3742  if (kind & WHEN_NO)
3743  {
3744  if (s<stamp && stamp>0)
3745  {
3746  stamp--;
3747  }
3748  return findNode(j,stamp-1,END_CASE);
3749  }
3750  return j;
3751  }
3752  return FLOWLEN;
3753 }
3754 
3755 size_t FlowChart::getNextIfLink(const FlowChart &fl,size_t index)
3756 {
3757  int stamp=fl.stamp;
3758  size_t start = index+1;
3759  size_t endifNode = findNode(start,stamp,ENDIF_NO);
3760  size_t elseifNode = findNode(start,stamp,ELSIF_NO);
3761  size_t elseNode = findNode(start,stamp,ELSE_NO);
3762 
3763  if (elseifNode>0 && elseifNode<endifNode)
3764  {
3765  return elseifNode;
3766  }
3767 
3768  if (elseNode>0 && elseNode<endifNode)
3769  {
3770  return elseNode+1;
3771  }
3772 
3773  stamp=flowList[endifNode].stamp;
3774  return getNextNode(endifNode,stamp);
3775 }
3776 
3778 {
3779  size_t size=flowList.size();
3780  if (size<2) return;
3781 
3782  // write start link
3783  writeEdge(t,flowList[0],flowList[1],2);
3784 
3785  for (size_t j=0;j<size;j++)
3786  {
3787  const FlowChart &fll = flowList[j];
3788  int kind = fll.type;
3789  int stamp = fll.stamp;
3790  if (kind & EEND)
3791  {
3792  continue;
3793  }
3794 
3795  if (kind & IFF)
3796  {
3797  writeEdge(t,fll,flowList[j+1],0);
3798  size_t z=getNextIfLink(fll,j);
3799  // assert(z>-1);
3800  writeEdge(t,fll,flowList[z],1);
3801  }
3802  else if (kind & LOOP_NO)
3803  {
3804  writeEdge(t,fll,flowList[j+1],2);
3805  continue;
3806  }
3807  else if (kind & (CASE_NO | FOR_NO | WHILE_NO))
3808  {
3809  if (kind & CASE_NO)
3810  {
3811  writeEdge(t,fll,flowList[j+1],2);
3812  continue;
3813  }
3814  else
3815  {
3816  writeEdge(t,fll,flowList[j+1],0);
3817  }
3818 
3819  kind=END_LOOP;
3820  size_t z=findNode(j+1,fll.stamp,kind);
3821  z=getNextNode(z,flowList[z].stamp);
3822 
3823  // assert(z>-1);
3824  writeEdge(t,fll,flowList[z],1);
3825  continue;
3826  }
3827  else if (kind & (TEXT_NO | VARIABLE_NO))
3828  {
3829  size_t z=getNextNode(j,stamp);
3830  writeEdge(t,fll,flowList[z],2);
3831  }
3832  else if (kind & WHEN_NO)
3833  {
3834  // default value
3835  if (qstricmp(fll.text.simplifyWhiteSpace(),"others")==0)
3836  {
3837  writeEdge(t,fll,flowList[j+1],2);
3838  continue;
3839  }
3840 
3841 
3842  writeEdge(t,fll,flowList[j+1],0);
3843  size_t u=findNode(j,stamp,WHEN_NO);
3844  size_t v=findNode(j,stamp-1,END_CASE);
3845 
3846  if (u>0 && u<v)
3847  {
3848  writeEdge(t,fll,flowList[u],1);
3849  }
3850  else
3851  {
3852  writeEdge(t,fll,flowList[v],1);
3853  }
3854  }
3855  else if (kind & END_CASE)
3856  {
3857  size_t z=FlowChart::getNextNode(j,fll.stamp);
3858  writeEdge(t,fll,flowList[z],2);
3859  }
3860  else if (kind & END_LOOP)
3861  {
3862  size_t z=findPrevLoop(j,fll.stamp,true);
3863  writeEdge(t,fll,flowList[z],2);
3864  }
3865  else if (kind & RETURN_NO)
3866  {
3867  writeEdge(t,fll,flowList[size-1],2);
3868  }
3869  else if (kind & (EXIT_NO | NEXT_NO))
3870  {
3871  size_t z;
3872  bool b = kind==NEXT_NO;
3873  if (!fll.exp.isEmpty())
3874  {
3875  writeEdge(t,fll,flowList[j+1],1);
3876  }
3877  if (!fll.label.isEmpty())
3878  {
3879  z=findLabel(j,fll.label);
3880  if (b)
3881  {
3882  writeEdge(t,fll,flowList[z],0);
3883  }
3884  else
3885  {
3886  z=findNode(z,flowList[z].stamp,END_LOOP);
3887  z=getNextNode(z,flowList[z].stamp);
3888  writeEdge(t,fll,flowList[z],0);
3889  }
3890  continue;
3891  }
3892  else
3893  {
3894  if (b)
3895  {
3896  z=findPrevLoop(j,fll.stamp);
3897  writeEdge(t,fll,flowList[z],0);
3898  continue;
3899  }
3900  else
3901  {
3902  z =findNextLoop(j,fll.stamp-1);
3903  }
3904  z=getNextNode(z,flowList[z].stamp);
3905  }
3906  writeEdge(t,fll,flowList[z],0);
3907  }
3908  } //for
3909 } //writeFlowLinks
OutputList::startMemberGroup
void startMemberGroup()
Definition: outputlist.h:229
VhdlDocGen::getFlowMember
static const MemberDef * getFlowMember()
Definition: vhdldocgen.cpp:92
PlantumlManager::writePlantUMLSource
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
Definition: plantuml.cpp:26
OutputList::startParameterType
void startParameterType(bool first, const QCString &key)
Definition: outputlist.h:423
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
OutputList::startParameterName
void startParameterName(bool one)
Definition: outputlist.h:427
OutputList::disableAllBut
void disableAllBut(OutputGenerator::OutputType o)
Definition: outputlist.cpp:76
VhdlDocGen::getProcessNumber
static QCString getProcessNumber()
Definition: vhdldocgen.cpp:1115
FlowChart::writeFlowChart
static void writeFlowChart()
Definition: vhdldocgen.cpp:3420
VhdlDocGen::writePlainVHDLDeclarations
static void writePlainVHDLDeclarations(const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, uint64_t specifier)
Definition: vhdldocgen.cpp:2045
OutputList::startMemberDescription
void startMemberDescription(const QCString &anchor, const QCString &inheritId=QCString(), bool typ=false)
Definition: outputlist.h:306
VhdlDocGen::isPort
static bool isPort(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2791
VhdlDocGen::PROCEDURE
@ PROCEDURE
Definition: vhdldocgen.h:95
outputlist.h
VhdlDocGen::correctMemberProperties
static void correctMemberProperties(MemberDefMutable *md)
Definition: vhdldocgen.cpp:1570
FlowChart::EXIT_NO
@ EXIT_NO
Definition: vhdldocgen.h:271
VhdlDocGen::~VhdlDocGen
virtual ~VhdlDocGen()
Definition: vhdldocgen.cpp:502
VhdlDocGen::isConfig
static bool isConfig(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2783
TagInfo
This struct is used to capture the tag file information for an Entry.
Definition: entry.h:48
FlowChart::exp
QCString exp
Definition: vhdldocgen.h:338
FlowChart::getNodeType
static const char * getNodeType(int c)
Definition: vhdldocgen.cpp:3356
OutputList::startMemberList
void startMemberList()
Definition: outputlist.h:197
VhdlDocGen::TYPE
@ TYPE
Definition: vhdldocgen.h:91
MemberType_Variable
@ MemberType_Variable
Definition: types.h:278
EMPTY
#define EMPTY
Definition: vhdldocgen.cpp:2854
createSVG
static void createSVG()
Definition: vhdldocgen.cpp:160
FlowChart::getNextNode
static size_t getNextNode(size_t index, int stamp)
Definition: vhdldocgen.cpp:3714
ClassDefMutable
Definition: classdef.h:384
FlowChart::convertNameToFileName
static QCString convertNameToFileName()
Definition: vhdldocgen.cpp:3351
DefinitionMutable::writeSourceReffedBy
virtual void writeSourceReffedBy(OutputList &ol, const QCString &scopeName) const =0
reg::replace
std::string replace(const std::string &str, const Ex &re, const std::string &replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
Definition: regex.cpp:740
toMemberDefMutable
MemberDefMutable * toMemberDefMutable(Definition *d)
Definition: memberdef.cpp:6125
VhdlDocGen::parseForConfig
static QCString parseForConfig(QCString &entity, QCString &arch)
Definition: vhdldocgen.cpp:2408
Normal
@ Normal
Definition: types.h:29
MemberDef::hasReferencedByRelation
virtual bool hasReferencedByRelation() const =0
FlowChart::printNode
static void printNode(const FlowChart &n)
Definition: vhdldocgen.cpp:2928
QCString::replace
QCString & replace(size_t index, size_t len, const char *s)
Definition: qcstring.cpp:207
VhdlDocGen::COMPONENT
@ COMPONENT
Definition: vhdldocgen.h:89
FlowChart::colTextNodes
static void colTextNodes()
Definition: vhdldocgen.cpp:2996
membergroup.h
MemberDef::argsString
virtual QCString argsString() const =0
flowList
std::vector< FlowChart > flowList
Definition: vhdldocgen.cpp:2886
VhdlDocGen::SUBTYPE
@ SUBTYPE
Definition: vhdldocgen.h:92
MemberListType
MemberListType
Definition: types.h:100
MemberDef::briefDescription
virtual QCString briefDescription(bool abbr=FALSE) const =0
DefinitionMutable::writeSourceRefs
virtual void writeSourceRefs(OutputList &ol, const QCString &scopeName) const =0
VhdlDocGen::isLibrary
static bool isLibrary(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2787
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
VhdlDocGen::isGeneric
static bool isGeneric(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2789
VhdlDocGen::createFlowChart
static void createFlowChart(const MemberDef *)
Definition: vhdldocgen.cpp:2742
MemberDef::documentation
virtual QCString documentation() const =0
FlowChart::endDot
static void endDot(TextStream &t)
Definition: vhdldocgen.cpp:3415
ClassDef::updateBaseClasses
virtual void updateBaseClasses(const BaseClassList &bcd)=0
Update the list of base classes to the one passed
VhdlDocGen::writeFunctionProto
static void writeFunctionProto(OutputList &ol, const ArgumentList &al, const MemberDef *)
Definition: vhdldocgen.cpp:1324
OutputList::startDoxyAnchor
void startDoxyAnchor(const QCString &fName, const QCString &manName, const QCString &anchor, const QCString &name, const QCString &args)
Definition: outputlist.h:264
VhdlDocGen::getProtectionName
static QCString getProtectionName(int prot)
Definition: vhdldocgen.cpp:1055
QCString::upper
QCString upper() const
Definition: qcstring.h:237
NamespaceDef
An abstract interface of a namespace symbol.
Definition: namespacedef.h:54
OutputList::endDoxyAnchor
void endDoxyAnchor(const QCString &fn, const QCString &anchor)
Definition: outputlist.h:268
g_packages
static std::map< ClassDef *, std::vector< ClassDef * > > g_packages
Definition: vhdldocgen.cpp:596
OutputList::docify
void docify(const QCString &s)
Definition: outputlist.h:137
FlowChart::alignFuncProc
static void alignFuncProc(QCString &q, const ArgumentList &al, bool isFunc)
Definition: vhdldocgen.cpp:3614
VhdlDocGen::writeVHDLTypeDocumentation
static bool writeVHDLTypeDocumentation(const MemberDef *mdef, const Definition *d, OutputList &ol)
Definition: vhdldocgen.cpp:1618
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
FlowChart::text
QCString text
Definition: vhdldocgen.h:337
VhdlDocGen::parseForBinding
static QCString parseForBinding(QCString &entity, QCString &arch)
Definition: vhdldocgen.cpp:2441
findMemFlow
static const MemberDef * findMemFlow(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2730
FlowChart::type
int type
Definition: vhdldocgen.h:332
MemberList::getMemberGroupList
const MemberGroupRefList & getMemberGroupList() const
Definition: memberlist.h:118
ArgumentList
This class represents an function or template argument list.
Definition: arguments.h:59
OutputList::endMemberDescription
void endMemberDescription()
Definition: outputlist.h:308
VhdlDocGen::ENTITY
@ ENTITY
Definition: vhdldocgen.h:83
memberdef.h
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
VhdlDocGen::writeSource
static void writeSource(const MemberDefMutable *mdef, OutputList &ol, const QCString &cname)
Definition: vhdldocgen.cpp:2191
VhdlDocGen::SIGNAL
@ SIGNAL
Definition: vhdldocgen.h:88
MemberName::push_back
void push_back(Ptr &&p)
Definition: membername.h:68
DefinitionMutable::setName
virtual void setName(const QCString &name)=0
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
reg::match
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition: regex.cpp:729
VhdlDocGen::CONFIG
@ CONFIG
Definition: vhdldocgen.h:105
VhdlDocGen::GENERIC
@ GENERIC
Definition: vhdldocgen.h:100
index.h
VhdlDocGen::getClassTitle
static QCString getClassTitle(const ClassDef *)
Definition: vhdldocgen.cpp:797
TagInfo::tagName
QCString tagName
Definition: entry.h:50
OutputList::startBold
void startBold()
Definition: outputlist.h:302
FlowChart::TEXT_NO
@ TEXT_NO
Definition: vhdldocgen.h:273
namespacedef.h
OutputList::writeString
void writeString(const QCString &text)
Definition: outputlist.h:111
commentscan.h
Interface for the comment block scanner
OutputList::insertMemberAlign
void insertMemberAlign(bool templ=FALSE)
Definition: outputlist.h:233
FlowChart::WHEN_NO
@ WHEN_NO
Definition: vhdldocgen.h:270
QCString::size
uint size() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:150
VhdlDocGen::writeVhdlDeclarations
static void writeVhdlDeclarations(const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *)
Definition: vhdldocgen.cpp:1539
OutputList::endFontClass
void endFontClass()
Definition: outputlist.h:484
MemberDef::getClassDefOfAnonymousType
virtual ClassDef * getClassDefOfAnonymousType() const =0
VhdlDocGen::PACKAGE
@ PACKAGE
Definition: vhdldocgen.h:86
membername.h
split
static std::vector< QCString > split(const QCString &str, const QCString &sep, bool allowEmptyEntries=FALSE, bool cleanup=TRUE)
Definition: template.cpp:47
writeTable
static void writeTable(const std::vector< const MemberDef * > &portList, TextStream &t)
Definition: vhdldocgen.cpp:438
VhdlDocGen::PACKAGECLASS
@ PACKAGECLASS
Definition: vhdldocgen.h:77
FlowChart::END_CASE
@ END_CASE
Definition: vhdldocgen.h:279
MemberVector::push_back
void push_back(const MemberDef *md)
Definition: memberlist.h:42
VhdlDocGen::addBaseClass
static void addBaseClass(ClassDef *cd, ClassDef *ent)
Definition: vhdldocgen.cpp:2696
endDot
static void endDot(TextStream &t)
Definition: vhdldocgen.cpp:251
LinkedMap::add
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
Definition: linkedmap.h:103
VhdlDocGen::findAllArchitectures
static void findAllArchitectures(std::vector< QCString > &ql, const ClassDef *cd)
Definition: vhdldocgen.cpp:906
MemberDefMutable::setType
virtual void setType(const QCString &t)=0
startFonts
static void startFonts(const QCString &q, const char *keyword, OutputList &ol)
Definition: vhdldocgen.cpp:136
codify
static void codify(TextStream &t, const QCString &str)
Definition: vhdldocgen.cpp:100
StringSet
std::set< std::string > StringSet
Definition: containers.h:30
formatBriefNote
static QCString formatBriefNote(const QCString &brief, ClassDef *cd)
Definition: vhdldocgen.cpp:274
QCString::str
std::string str() const
Definition: qcstring.h:442
ClassDefMutable::insertBaseClass
virtual void insertBaseClass(ClassDef *, const QCString &name, Protection p, Specifier s, const QCString &t=QCString())=0
OutputList::endParameterName
void endParameterName(bool last, bool one, bool bracket)
Definition: outputlist.h:429
FlowChart::getNodeName
static QCString getNodeName(int n)
Definition: vhdldocgen.cpp:3046
PlantumlManager::instance
static PlantumlManager & instance()
Definition: plantuml.cpp:124
Public
@ Public
Definition: types.h:26
FlowChart::printPlantUmlNode
static QCString printPlantUmlNode(const FlowChart &flo, bool, bool)
Definition: vhdldocgen.cpp:3271
ifcounter
static int ifcounter
Definition: vhdldocgen.cpp:2859
writeUCFLink
static void writeUCFLink(const MemberDef *mdef, OutputList &ol)
Definition: vhdldocgen.cpp:2380
writeClassToDot
static void writeClassToDot(TextStream &t, ClassDef *cd)
Definition: vhdldocgen.cpp:402
textstream.h
VhdlDocGen::getIndexWord
static QCString getIndexWord(const QCString &, int index)
Definition: vhdldocgen.cpp:1041
err
void err(const char *fmt,...)
Definition: message.cpp:203
VhdlDocGen::isVariable
static bool isVariable(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2825
VhdlDocGen::isAlias
static bool isAlias(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2785
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
FLOWLEN
#define FLOWLEN
Definition: vhdldocgen.cpp:2857
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
createMemberDef
MemberDefMutable * createMemberDef(const QCString &defFileName, int defLine, int defColumn, const QCString &type, const QCString &name, const QCString &args, const QCString &excp, Protection prot, Specifier virt, bool stat, Relationship related, MemberType t, const ArgumentList &tal, const ArgumentList &al, const QCString &metaData)
Factory method to create a new instance of a MemberDef
Definition: memberdef.cpp:373
ClassDef::protection
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
Definition::briefLine
virtual int briefLine() const =0
TagInfo::anchor
QCString anchor
Definition: entry.h:52
FlowChart::FlowChart
FlowChart(int typ, const QCString &t, const QCString &ex, const QCString &label=QCString())
Definition: vhdldocgen.cpp:3208
MemberDefMutable
Definition: memberdef.h:296
MemberListType_pubMethods
@ MemberListType_pubMethods
Definition: types.h:107
qcstring.h
VhdlDocGen::findFunction
static const MemberDef * findFunction(const QCString &name, const QCString &package)
Definition: vhdldocgen.cpp:770
filename.h
TextStream::flush
void flush()
Flushes the buffer.
Definition: textstream.h:188
LOOP
#define LOOP
Definition: vhdldocgen.cpp:2848
VhdlDocGen::writeFormatString
static void writeFormatString(const QCString &, OutputList &ol, const MemberDef *)
Definition: vhdldocgen.cpp:1129
FlowChart::IF_NO
@ IF_NO
Definition: vhdldocgen.h:266
ClassDef::getFileDef
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
VhdlDocGen::VFILE
@ VFILE
Definition: vhdldocgen.h:103
VhdlDocGen::UNITS
@ UNITS
Definition: vhdldocgen.h:99
MemberDef::getReference
virtual QCString getReference() const =0
FlowChart::line
int line
Definition: vhdldocgen.h:334
VhdlDocGen::PORT
@ PORT
Definition: vhdldocgen.h:98
VhdlDocGen::init
static void init()
Definition: vhdldocgen.cpp:555
VhdlDocGen::isProcess
static bool isProcess(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2807
begin
DirIterator begin(DirIterator it) noexcept
Definition: dir.cpp:123
VhdlDocGen::isPackage
static bool isPackage(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2795
FlowChart::moveToPrevLevel
static void moveToPrevLevel()
Definition: vhdldocgen.cpp:3265
OutputList::endMemberGroupDocs
void endMemberGroupDocs()
Definition: outputlist.h:227
ArgumentList::hasParameters
bool hasParameters() const
Definition: arguments.h:69
textNode
const char * textNode
Definition: vhdldocgen.cpp:2874
g_vhdlKeyWordSet1
static const std::set< std::string > g_vhdlKeyWordSet1
Definition: vhdldocgen.cpp:533
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
MemberName
Definition: membername.h:24
QCString::contains
int contains(char c, bool cs=TRUE) const
Definition: qcstring.cpp:138
MemberDef::isLinkable
virtual bool isLinkable() const =0
OutputGenerator::RTF
@ RTF
Definition: outputgen.h:333
FlowChart::NEXT_NO
@ NEXT_NO
Definition: vhdldocgen.h:283
VhdlDocGen::isSubType
static bool isSubType(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2803
ClassDef::templateMaster
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
MemberDef::isBriefSectionVisible
virtual bool isBriefSectionVisible() const =0
GroupDef
A model of a group of symbols.
Definition: groupdef.h:49
FlowChart::findPrevLoop
static size_t findPrevLoop(size_t j, int stamp, bool endif=FALSE)
Definition: vhdldocgen.cpp:3664
DefinitionMutable::setBodyDef
virtual void setBodyDef(const FileDef *fd)=0
reg
Namespace for the regular expression functions
Definition: regex.cpp:30
VhdlDocGen::isProcedure
static bool isProcedure(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2815
VhdlDocGen::writeProcessProto
static void writeProcessProto(OutputList &ol, const ArgumentList &al, const MemberDef *)
Definition: vhdldocgen.cpp:1402
uint
unsigned uint
Definition: qcstring.h:40
OutputList::startMemberGroupDocs
void startMemberGroupDocs()
Definition: outputlist.h:225
MemberDef::anchor
virtual QCString anchor() const =0
Member
@ Member
Definition: types.h:38
OutputList
Class representing a list of output generators that are written to in parallel.
Definition: outputlist.h:37
startDot
static void startDot(TextStream &t)
Definition: vhdldocgen.cpp:243
VhdlDocGen::getClassName
static QCString getClassName(const ClassDef *)
Definition: vhdldocgen.cpp:810
flowMember
static const MemberDef * flowMember
Definition: vhdldocgen.cpp:85
VhdlDocGen::VhdlDocGen
VhdlDocGen()
Definition: vhdldocgen.cpp:498
FlowChart::addFlowChart
static void addFlowChart(int type, const QCString &text, const QCString &exp, const QCString &label=QCString())
Definition: vhdldocgen.cpp:3235
FlowChart::codify
static void codify(TextStream &t, const QCString &str)
Definition: vhdldocgen.cpp:3181
addHtmlExtensionIfMissing
QCString addHtmlExtensionIfMissing(const QCString &fName)
Definition: util.cpp:5275
FlowChart::stamp
int stamp
Definition: vhdldocgen.h:331
textNodeLink
const char * textNodeLink
Definition: vhdldocgen.cpp:2865
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
OutputList::writeChar
void writeChar(char c)
Definition: outputlist.h:256
g_vhdlKeyWordSet0
static const std::set< std::string > g_vhdlKeyWordSet0
Definition: vhdldocgen.cpp:507
getVhdlInstList
const EntryList & getVhdlInstList()
Definition: vhdljjparser.cpp:839
OutputGenerator::Latex
@ Latex
Definition: outputgen.h:333
VhdlDocGen::isConstraint
static bool isConstraint(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2781
yesNodeLink
const char * yesNodeLink
Definition: vhdldocgen.cpp:2866
VhdlDocGen::deleteCharRev
static bool deleteCharRev(QCString &s, char c)
Definition: vhdldocgen.cpp:1073
MemberDefMutable::setMemberSpecifiers
virtual void setMemberSpecifiers(uint64 s)=0
alignText
void alignText(QCString &q)
Definition: vhdldocgen.cpp:2892
ClassDef
A abstract class representing of a compound symbol.
Definition: classdef.h:103
classlist.h
OutputList::startParameterList
void startParameterList(bool openBracket)
Definition: outputlist.h:431
QCString::stripWhiteSpace
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition: qcstring.h:243
FlowChart::writeFlowLinks
static void writeFlowLinks(TextStream &t)
Definition: vhdldocgen.cpp:3777
Doxygen::functionNameLinkedMap
static MemberNameLinkedMap * functionNameLinkedMap
Definition: doxygen.h:94
OutputList::startMemberItem
void startMemberItem(const QCString &anchor, int i1, const QCString &id=QCString())
Definition: outputlist.h:209
OutputList::disable
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:100
VhdlDocGen::parseFuncProto
static void parseFuncProto(const QCString &text, QCString &name, QCString &ret, bool doc=false)
Definition: vhdldocgen.cpp:990
VhdlDocGen::writeVHDLDeclarations
static void writeVHDLDeclarations(const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const QCString &title, const QCString &subtitle, bool showEnumValues, int type)
Definition: vhdldocgen.cpp:2098
VhdlDocGen::ALIAS
@ ALIAS
Definition: vhdldocgen.h:106
OutputList::startMemberHeader
void startMemberHeader(const QCString &anchor, int typ=2)
Definition: outputlist.h:185
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
FlowChart::ENDIF_NO
@ ENDIF_NO
Definition: vhdldocgen.h:275
message.h
VhdlDocGen::convertFileNameToClassName
static QCString convertFileNameToClassName(QCString name)
Definition: vhdldocgen.cpp:2245
MemberDef::excpString
virtual QCString excpString() const =0
VhdlDocGen::isVhdlFunction
static bool isVhdlFunction(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2805
MemberDef::isVariable
virtual bool isVariable() const =0
VhdlDocGen::isFile
static bool isFile(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2827
Doxygen::parserManager
static ParserManager * parserManager
Definition: doxygen.h:111
compareString
static int compareString(const QCString &s1, const QCString &s2)
Definition: vhdldocgen.cpp:155
ParserManager::getOutlineParser
std::unique_ptr< OutlineParserInterface > getOutlineParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
Definition: parserintf.h:208
recordCounter
static int recordCounter
Definition: vhdldocgen.cpp:1097
VhdlDocGen::ARCHITECTURE
@ ARCHITECTURE
Definition: vhdldocgen.h:85
OutputList::endMemberGroup
void endMemberGroup(bool last)
Definition: outputlist.h:231
ClassDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Returns the unique base name (without extension) of the class's file on disk
Definition::symbolName
virtual QCString symbolName() const =0
VhdlDocGen::isSignals
static bool isSignals(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2813
ClassDef::baseClasses
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
writeLink
static void writeLink(const MemberDef *mdef, OutputList &ol)
Definition: vhdldocgen.cpp:128
VhdlDocGen::parseUCF
static void parseUCF(const char *input, Entry *entity, const QCString &f, bool vendor)
Definition: vhdldocgen.cpp:2266
FlowChart::writeEdge
static void writeEdge(TextStream &t, int fl_from, int fl_to, int i, bool bFrom=FALSE, bool bTo=FALSE)
Definition: vhdldocgen.cpp:3585
VhdlDocGen::isSignal
static bool isSignal(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2809
initUCF
static void initUCF(Entry *root, const QCString &type, QCString &qcs, int line, const QCString &fileName, QCString &brief)
Definition: vhdldocgen.cpp:2323
flowCol
static struct @4 flowCol
QCString::simplifyWhiteSpace
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition: qcstring.cpp:180
VhdlDocGen::ENTITYCLASS
@ ENTITYCLASS
Definition: vhdldocgen.h:74
arguments.h
theTranslator_vhdlType
#define theTranslator_vhdlType
Definition: vhdldocgen.cpp:66
VhdlDocGen::findArchitecture
static const ClassDef * findArchitecture(const ClassDef *cd)
Definition: vhdldocgen.cpp:923
qstricmp
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:433
VhdlDocGen::ATTRIBUTE
@ ATTRIBUTE
Definition: vhdldocgen.h:87
VhdlDocGen::writeVHDLDeclaration
static void writeVHDLDeclaration(const MemberDefMutable *mdef, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, bool inGroup)
Definition: vhdldocgen.cpp:1746
OutputList::lineBreak
void lineBreak(const QCString &style=QCString())
Definition: outputlist.h:300
theTranslator
Translator * theTranslator
Definition: language.cpp:156
Definition::name
virtual QCString name() const =0
getPorts
static std::vector< const MemberDef * > getPorts(const ClassDef *cd)
Definition: vhdldocgen.cpp:416
VhdlDocGen::isCompInst
static bool isCompInst(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2831
VhdlDocGen::writeTagFile
static void writeTagFile(MemberDefMutable *mdef, TextStream &tagFile)
Definition: vhdldocgen.cpp:1702
FlowChart::CASE_NO
@ CASE_NO
Definition: vhdldocgen.h:269
doxygen.h
VhdlDocGen::writeFuncProcDocu
static bool writeFuncProcDocu(const MemberDef *mdef, OutputList &ol, const ArgumentList &al, bool type=false)
Definition: vhdldocgen.cpp:1428
SearchIndexIntf::addWord
virtual void addWord(const QCString &word, bool hiPriority)=0
VhdlDocGen::formatString
static void formatString(const QCString &, OutputList &ol, const MemberDef *)
Definition: vhdldocgen.cpp:1210
FlowChart::LOOP_NO
@ LOOP_NO
Definition: vhdldocgen.h:282
parserintf.h
VhdlDocGen::writeProcedureProto
static void writeProcedureProto(OutputList &ol, const ArgumentList &al, const MemberDef *)
Definition: vhdldocgen.cpp:1269
Argument
This class contains the information about the argument of a function or template
Definition: arguments.h:26
parseCommentAsText
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
Definition: util.cpp:5738
VhdlDocGen::CONSTANT
@ CONSTANT
Definition: vhdldocgen.h:90
MemberDef::getClassDef
virtual const ClassDef * getClassDef() const =0
VhdlDocGen::isComponent
static bool isComponent(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2793
language.h
QCString::lower
QCString lower() const
Definition: qcstring.h:232
FlowChart::FOR_NO
@ FOR_NO
Definition: vhdldocgen.h:276
FlowChart::findNextLoop
static size_t findNextLoop(size_t j, int stamp)
Definition: vhdldocgen.cpp:3647
Entry::moveToSubEntryAndKeep
void moveToSubEntryAndKeep(Entry *e)
Definition: entry.cpp:146
VhdlDocGen::VhdlClasses
VhdlClasses
Definition: vhdldocgen.h:72
Translator::trVhdlType
virtual QCString trVhdlType(uint64 type, bool single)=0
varNode
const char * varNode
Definition: vhdldocgen.cpp:2872
VhdlDocGen::PACKAGE_BODY
@ PACKAGE_BODY
Definition: vhdldocgen.h:84
FlowChart::END_LOOP
@ END_LOOP
Definition: vhdldocgen.h:278
VhdlDocGen::isSubClass
static bool isSubClass(ClassDef *cd, ClassDef *scd, bool followInstances, int level)
Definition: vhdldocgen.cpp:2665
ClassDef::isBaseClass
virtual bool isBaseClass(const ClassDef *bcd, bool followInstances, int level=0) const =0
Returns TRUE iff bcd is a direct or indirect base class of this class.
MemberDef::warnIfUndocumented
virtual void warnIfUndocumented() const =0
VhdlDocGen::isNumber
static bool isNumber(const std::string &s)
Definition: vhdldocgen.cpp:1198
readCodeFragment
bool readCodeFragment(const QCString &fileName, int &startLine, int &endLine, QCString &result)
Reads a fragment from file fileName starting with line startLine and ending with line endLine.
Definition: definition.cpp:719
VhdlDocGen::LIBRARY
@ LIBRARY
Definition: vhdldocgen.h:82
DefinitionMutable::setLanguage
virtual void setLanguage(SrcLangExt lang)=0
OutputList::endMemberDocName
void endMemberDocName()
Definition: outputlist.h:421
VhdlDocGen::getRecordNumber
static QCString getRecordNumber()
Definition: vhdldocgen.cpp:1103
ParserManager::getCodeParser
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
Definition: parserintf.h:217
Definition::briefDescription
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
TRUE
#define TRUE
Definition: qcstring.h:36
Definition::getOutputFileBase
virtual QCString getOutputFileBase() const =0
OutputList::endMemberList
void endMemberList()
Definition: outputlist.h:199
Definition::getStartBodyLine
virtual int getStartBodyLine() const =0
Definition::getEndBodyLine
virtual int getEndBodyLine() const =0
VhdlDocGen::findMemberDef
static const MemberDef * findMemberDef(ClassDef *cd, const QCString &key, MemberListType type)
This function returns the entity|package in which the key (type) is found
Definition: vhdldocgen.cpp:698
FlowChart::alignCommentNode
static void alignCommentNode(TextStream &t, QCString com)
Definition: vhdldocgen.cpp:3060
VhdlDocGen::writeOverview
static void writeOverview()
Definition: vhdldocgen.cpp:176
VhdlDocGen::writeStringLink
static void writeStringLink(const MemberDef *mdef, QCString mem, OutputList &ol)
Definition: vhdldocgen.cpp:2167
Portable::system
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition: portable.cpp:42
FlowChart
Definition: vhdldocgen.h:262
MemberListType_variableMembers
@ MemberListType_variableMembers
Definition: types.h:142
regex.h
QCString::toInt
int toInt(bool *ok=0, int base=10) const
Definition: qcstring.cpp:244
STARTFIN
#define STARTFIN
Definition: vhdldocgen.cpp:2847
OutputList::endMemberItem
void endMemberItem()
Definition: outputlist.h:211
VhdlDocGen::UCF_CONST
@ UCF_CONST
Definition: vhdldocgen.h:108
OutputGenerator::Html
@ Html
Definition: outputgen.h:333
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
toClassDef
ClassDef * toClassDef(Definition *d)
Definition: classdef.cpp:4907
noNodeLink
const char * noNodeLink
Definition: vhdldocgen.cpp:2867
FlowChart::WHILE_NO
@ WHILE_NO
Definition: vhdldocgen.h:277
OutputList::enableAll
void enableAll()
Definition: outputlist.cpp:84
OutputList::isEnabled
bool isEnabled(OutputGenerator::OutputType o)
Definition: outputlist.cpp:116
QCString::fill
bool fill(char c, int len=-1)
Fills a string with a predefined character
Definition: qcstring.h:175
VhdlDocGen::writeRecordUnit
static void writeRecordUnit(QCString &largs, QCString &ltype, OutputList &ol, const MemberDefMutable *mdef)
Definition: vhdldocgen.cpp:2612
IFF
#define IFF
Definition: vhdldocgen.cpp:2852
ClassDefMutable::insertSubClass
virtual void insertSubClass(ClassDef *, Protection p, Specifier s, const QCString &t=QCString())=0
memberlist.h
writeColumn
static void writeColumn(TextStream &t, const MemberDef *md, bool start)
Definition: vhdldocgen.cpp:313
ClassDef::subClasses
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class
VhdlDocGen::isGroup
static bool isGroup(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2829
VhdlDocGen::writeInlineClassLink
static void writeInlineClassLink(const ClassDef *, OutputList &ol)
Definition: vhdldocgen.cpp:829
OutputList::popGeneratorState
void popGeneratorState()
Definition: outputlist.cpp:134
Definition::briefFile
virtual QCString briefFile() const =0
OutputList::startTextLink
void startTextLink(const QCString &file, const QCString &anchor)
Definition: outputlist.h:152
OutputList::endMemberSubtitle
void endMemberSubtitle()
Definition: outputlist.h:191
VhdlDocGen::deleteAllChars
static void deleteAllChars(QCString &s, char c)
Definition: vhdldocgen.cpp:1085
endTable
static void endTable(TextStream &t)
Definition: vhdldocgen.cpp:396
OutputList::startEmphasis
void startEmphasis()
Definition: outputlist.h:252
QCString::setNum
QCString & setNum(short n)
Definition: qcstring.h:372
ArgumentList::size
size_t size() const
Definition: arguments.h:93
VhdlDocGen::writeClassType
static bool writeClassType(const ClassDef *, OutputList &ol, QCString &cname)
Definition: vhdldocgen.cpp:2150
VhdlDocGen::isUnit
static bool isUnit(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2821
FlowChart::END_NO
@ END_NO
Definition: vhdldocgen.h:272
MemberDef::getMemberSpecifiers
virtual uint64 getMemberSpecifiers() const =0
OutputList::startCodeFragment
void startCodeFragment(const QCString &style)
Definition: outputlist.h:241
startTable
static void startTable(TextStream &t, const QCString &className)
Definition: vhdldocgen.cpp:256
OutputList::startMemberGroupHeader
void startMemberGroupHeader(bool b)
Definition: outputlist.h:221
splitString
static QCString splitString(QCString &str, char c)
Definition: vhdldocgen.cpp:143
VhdlDocGen::writeVhdlLink
static void writeVhdlLink(const ClassDef *cdd, OutputList &ol, QCString &type, QCString &name, QCString &beh)
Definition: vhdldocgen.cpp:944
MemberDef::qualifiedName
virtual QCString qualifiedName() const =0
Doxygen::searchIndex
static SearchIndexIntf * searchIndex
Definition: doxygen.h:105
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
OutputList::endMemberHeader
void endMemberHeader()
Definition: outputlist.h:187
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
FlowChart::~FlowChart
~FlowChart()
Definition: vhdldocgen.cpp:3204
FlowChart::buildCommentNodes
static void buildCommentNodes(TextStream &t)
Definition: vhdldocgen.cpp:3096
MemberDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
membersHaveSpecificType
static bool membersHaveSpecificType(const MemberList *ml, uint64 type)
Definition: vhdldocgen.cpp:2078
ENDCL
#define ENDCL
Definition: vhdldocgen.cpp:2850
VhdlDocGen::INSTANTIATION
@ INSTANTIATION
Definition: vhdldocgen.h:101
DefinitionMutable::writeDocAnchorsToTagFile
virtual void writeDocAnchorsToTagFile(TextStream &) const =0
VhdlDocGen::findKeyWord
static const char * findKeyWord(const QCString &word)
Definition: vhdldocgen.cpp:562
QCString::remove
QCString & remove(size_t index, size_t len)
Definition: qcstring.h:354
Entry
Represents an unstructured piece of information, about an entity found in the sources.
Definition: entry.h:61
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
VhdlDocGen::isVType
static bool isVType(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2801
QCString::append
QCString & append(char c)
Definition: qcstring.h:318
comment
const char * comment
Definition: vhdldocgen.cpp:2870
layout.h
decisionNode
const char * decisionNode
Definition: vhdldocgen.cpp:2871
FlowChart::label
QCString label
Definition: vhdldocgen.h:336
FlowChart::getNextIfLink
static size_t getNextIfLink(const FlowChart &, size_t)
Definition: vhdldocgen.cpp:3755
g_varMap
static std::map< std::string, const MemberDef * > g_varMap
Definition: vhdldocgen.cpp:594
FlowChart::ELSE_NO
@ ELSE_NO
Definition: vhdldocgen.h:268
definition.h
reg::Ex
Class representing a regular expression.
Definition: regex.h:48
ClassDef::getReference
virtual QCString getReference() const =0
If this class originated from a tagfile, this will return the tag file reference
FlowChart::writeShape
static void writeShape(TextStream &t, const FlowChart &fl)
Definition: vhdldocgen.cpp:3465
VhdlDocGen::isAttribute
static bool isAttribute(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2811
SearchIndexIntf::setCurrentDoc
virtual void setCurrentDoc(const Definition *ctx, const QCString &anchor, bool isSourceFile)=0
VhdlDocGen::findAllPackages
static void findAllPackages(ClassDef *)
Definition: vhdldocgen.cpp:741
Definition::getOuterScope
virtual Definition * getOuterScope() const =0
FlowChart::ELSIF_NO
@ ELSIF_NO
Definition: vhdldocgen.h:267
OutputList::parseText
void parseText(const QCString &textStr)
Definition: outputlist.cpp:179
VhdlDocGen::PROCESS
@ PROCESS
Definition: vhdldocgen.h:97
OutputList::endMemberGroupHeader
void endMemberGroupHeader()
Definition: outputlist.h:223
VhdlDocGen::computeVhdlComponentRelations
static void computeVhdlComponentRelations()
Definition: vhdldocgen.cpp:2501
VhdlDocGen::convertArgumentListToString
static QCString convertArgumentListToString(const ArgumentList &al, bool f)
Definition: vhdldocgen.cpp:1512
FileDef::absFilePath
virtual QCString absFilePath() const =0
VhdlDocGen::SHAREDVARIABLE
@ SHAREDVARIABLE
Definition: vhdldocgen.h:104
FlowChart::delFlowList
static void delFlowList()
Definition: vhdldocgen.cpp:3053
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
OutputList::startMemberSubtitle
void startMemberSubtitle()
Definition: outputlist.h:189
nodeCounter
static int nodeCounter
Definition: vhdldocgen.cpp:2860
MemberDef::getFileDef
virtual const FileDef * getFileDef() const =0
VhdlDocGen::writeRecUnitDocu
static void writeRecUnitDocu(const MemberDef *md, OutputList &ol, QCString largs)
Definition: vhdldocgen.cpp:2631
Config_getString
#define Config_getString(name)
Definition: config.h:32
writeVhdlEntityToolTip
static void writeVhdlEntityToolTip(TextStream &t, ClassDef *cd)
Definition: vhdldocgen.cpp:292
startEndNode
const char * startEndNode
Definition: vhdldocgen.cpp:2873
Definition::getDefFileName
virtual QCString getDefFileName() const =0
VhdlDocGen::findVhdlClass
static ClassDef * findVhdlClass(const QCString &className)
Definition: vhdldocgen.cpp:2475
OutputList::startFontClass
void startFontClass(const QCString &c)
Definition: outputlist.h:482
OutputList::generateDoc
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
Definition: outputlist.cpp:142
VhdlParser.h
MemberDef::argumentList
virtual const ArgumentList & argumentList() const =0
FlowChart::VARIABLE_NO
@ VARIABLE_NO
Definition: vhdldocgen.h:280
VhdlDocGen::isRecord
static bool isRecord(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2817
config.h
OutputList::endEmphasis
void endEmphasis()
Definition: outputlist.h:254
FlowChart::createSVG
static void createSVG()
Definition: vhdldocgen.cpp:3385
VhdlDocGen::findMember
static const MemberDef * findMember(const QCString &className, const QCString &memName)
Definition: vhdldocgen.cpp:598
DefinitionMutable::writeSourceDef
virtual void writeSourceDef(OutputList &ol, const QCString &scopeName) const =0
g_vhdlKeyWordSet3
static const std::set< std::string > g_vhdlKeyWordSet3
Definition: vhdldocgen.cpp:547
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
OutputList::pushGeneratorState
void pushGeneratorState()
Definition: outputlist.cpp:126
groupdef.h
VhdlDocGen::resetCodeVhdlParserState
static void resetCodeVhdlParserState()
Definition: vhdldocgen.cpp:2774
QCString::data
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:153
ClassDef::getMemberList
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt
convertToXML
QCString convertToXML(const QCString &s, bool keepEntities)
Definition: util.cpp:3948
TagInfo::fileName
QCString fileName
Definition: entry.h:51
VhdlDocGen::GROUP
@ GROUP
Definition: vhdldocgen.h:102
g_vhdlKeyWordSet2
static const std::set< std::string > g_vhdlKeyWordSet2
Definition: vhdldocgen.cpp:541
FileDef
A model of a file symbol.
Definition: filedef.h:73
FlowChart::START_NO
@ START_NO
Definition: vhdldocgen.h:274
VhdlDocGen::PACKBODYCLASS
@ PACKBODYCLASS
Definition: vhdldocgen.h:75
VhdlDocGen::isPackageBody
static bool isPackageBody(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2823
plantuml.h
SrcLangExt_VHDL
@ SrcLangExt_VHDL
Definition: types.h:54
Entry::VARIABLE_SEC
@ VARIABLE_SEC
Definition: entry.h:96
EXITNEXT
#define EXITNEXT
Definition: vhdldocgen.cpp:2853
DECLN
#define DECLN
Definition: vhdldocgen.cpp:2843
OutputList::endParameterType
void endParameterType()
Definition: outputlist.h:425
FlowChart::printUmlTree
static void printUmlTree()
Definition: vhdldocgen.cpp:3310
VhdlDocGen::getPackageName
static ClassDef * getPackageName(const QCString &name)
Definition: vhdldocgen.cpp:589
mdList
static std::vector< const MemberDef * > mdList
Definition: vhdldocgen.cpp:2728
ClassDefMutable::insertMember
virtual void insertMember(MemberDef *)=0
OutputList::writeObjectLink
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition: outputlist.h:141
OutputList::insertMemberAlignLeft
void insertMemberAlignLeft(int typ=0, bool templ=FALSE)
Definition: outputlist.h:235
VhdlDocGen::isMisc
static bool isMisc(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2833
toClassDefMutable
ClassDefMutable * toClassDefMutable(Definition *d)
Definition: classdef.cpp:4944
VhdlDocGen::USE
@ USE
Definition: vhdldocgen.h:96
PlantumlManager::PUML_SVG
@ PUML_SVG
Definition: plantuml.h:44
portable.h
Portable versions of functions that are platform dependent.
PlantumlManager::generatePlantUMLOutput
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition: plantuml.cpp:91
searchindex.h
FlowChart::findLabel
static size_t findLabel(size_t j, const QCString &)
Definition: vhdldocgen.cpp:3687
addInstance
static void addInstance(ClassDefMutable *entity, ClassDefMutable *arch, ClassDefMutable *inst, const std::shared_ptr< Entry > &cur)
Definition: vhdldocgen.cpp:2541
Definition::briefDescriptionAsTooltip
virtual QCString briefDescriptionAsTooltip() const =0
MemberDef::hasReferencesRelation
virtual bool hasReferencesRelation() const =0
Doxygen::classLinkedMap
static ClassLinkedMap * classLinkedMap
Definition: doxygen.h:78
FlowChart::startDot
static void startDot(TextStream &t)
Definition: vhdldocgen.cpp:3407
STARTL
#define STARTL
Definition: vhdldocgen.cpp:2840
util.h
A bunch of utility functions.
EEND
#define EEND
Definition: vhdldocgen.cpp:2851
MemberDef::typeString
virtual QCString typeString() const =0
BaseClassList
std::vector< BaseClassDef > BaseClassList
Definition: classdef.h:81
Definition::localName
virtual QCString localName() const =0
VhdlDocGen::setFlowMember
static void setFlowMember(const MemberDef *flowMember)
Definition: vhdldocgen.cpp:87
g_classList
static std::vector< ClassDef * > g_classList
Definition: vhdldocgen.cpp:595
OutputList::enable
void enable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:108
FlowChart::EMPTY_NO
@ EMPTY_NO
Definition: vhdldocgen.h:284
VhdlDocGen::prepareComment
static void prepareComment(QCString &)
Definition: vhdldocgen.cpp:968
VhdlDocGen::FUNCTION
@ FUNCTION
Definition: vhdldocgen.h:93
convertToId
QCString convertToId(const QCString &s)
Definition: util.cpp:3908
MemberList
A list of MemberDef objects as shown in documentation sections.
Definition: memberlist.h:81
MemberDef::hasDetailedDescription
virtual bool hasDetailedDescription() const =0
QCString::stripPrefix
bool stripPrefix(const QCString &prefix)
Definition: qcstring.h:197
FlowChart::printFlowTree
static void printFlowTree()
Definition: vhdldocgen.cpp:2988
VhdlDocGen::isConstant
static bool isConstant(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2799
uint64
uint64_t uint64
Definition: qcstring.h:43
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
VhdlDocGen::RECORD
@ RECORD
Definition: vhdldocgen.h:94
ClassDef::className
virtual QCString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
OutputList::endCodeFragment
void endCodeFragment(const QCString &style)
Definition: outputlist.h:243
VhdlDocGen::isArchitecture
static bool isArchitecture(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2819
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
OutputList::endTextLink
void endTextLink()
Definition: outputlist.h:154
qstrlen
uint qstrlen(const char *str)
Definition: qcstring.h:65
writeVhdlDotLink
static void writeVhdlDotLink(TextStream &t, const QCString &a, const QCString &b, const QCString &style)
Definition: vhdldocgen.cpp:262
VhdlDocGen::isEntity
static bool isEntity(const MemberDef *mdef)
Definition: vhdldocgen.cpp:2797
FlowChart::BEGIN_NO
@ BEGIN_NO
Definition: vhdldocgen.h:286
FlowChart::findNode
static size_t findNode(size_t index, int stamp, int type)
Definition: vhdldocgen.cpp:3701
VhdlDocGen::ARCHITECTURECLASS
@ ARCHITECTURECLASS
Definition: vhdldocgen.h:76
MemberDef::getGroupDef
virtual const GroupDef * getGroupDef() const =0
vhdljjparser.h
vhdldocgen.h
VhdlDocGen::getClass
static ClassDef * getClass(const QCString &name)
Definition: vhdldocgen.cpp:583
FlowChart::RETURN_NO
@ RETURN_NO
Definition: vhdldocgen.h:281
findIndex
int findIndex(const StringVector &sv, const std::string &s)
find the index of a string in a vector of strings, returns -1 if the string could not be found
Definition: util.cpp:7319
FlowChart::COMMENT_NO
@ COMMENT_NO
Definition: vhdldocgen.h:285
VhdlDocGen::MISCELLANEOUS
@ MISCELLANEOUS
Definition: vhdldocgen.h:107
FALSE
#define FALSE
Definition: qcstring.h:33
FlowChart::id
int id
Definition: vhdldocgen.h:330
EMPTNODE
#define EMPTNODE
Definition: vhdldocgen.cpp:2856
OutputList::endBold
void endBold()
Definition: outputlist.h:304
OutputGenerator::Man
@ Man
Definition: outputgen.h:333
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108