Doxygen
Loading...
Searching...
No Matches
VhdlDocGen Class Reference

Class for generating documentation specific for VHDL. More...

#include <src/vhdldocgen.h>

Public Types

enum  VhdlClasses { ENTITYCLASS , PACKBODYCLASS , ARCHITECTURECLASS , PACKAGECLASS }

Static Public Member Functions

static VhdlClasses convert (Protection prot)
static void init ()
static DString convertFileNameToClassName (const DString &name)
static bool isSubClass (ClassDef *cd, ClassDef *scd, bool followInstances, int level)
static DString getIndexWord (const DString &, int index)
static bool deleteCharRev (DString &s, char c)
static void deleteAllChars (DString &s, char c)
static void parseFuncProto (const DString &text, DString &name, DString &ret, bool doc=false)
static void computeVhdlComponentRelations ()
static const char * findKeyWord (const DString &word)
static ClassDefgetPackageName (const DString &name)
static const MemberDeffindMember (const DString &className, const DString &memName)
static void findAllPackages (ClassDef *)
static const MemberDeffindMemberDef (ClassDef *cd, const DString &key, MemberListType type)
 This function returns the entity|package in which the key (type) is found.
static ClassDefgetClass (const DString &name)
static const MemberDeffindFunction (const DString &name, const DString &package)
static DString getClassTitle (const ClassDef *)
static void writeInlineClassLink (const ClassDef *, OutputList &ol)
static void writeTagFile (MemberDefMutable *mdef, TextStream &tagFile)
static bool isConstraint (const MemberDef *mdef)
static bool isConfig (const MemberDef *mdef)
static bool isAlias (const MemberDef *mdef)
static bool isLibrary (const MemberDef *mdef)
static bool isGeneric (const MemberDef *mdef)
static bool isPort (const MemberDef *mdef)
static bool isComponent (const MemberDef *mdef)
static bool isPackage (const MemberDef *mdef)
static bool isEntity (const MemberDef *mdef)
static bool isConstant (const MemberDef *mdef)
static bool isVType (const MemberDef *mdef)
static bool isSubType (const MemberDef *mdef)
static bool isVhdlFunction (const MemberDef *mdef)
static bool isProcess (const MemberDef *mdef)
static bool isSignal (const MemberDef *mdef)
static bool isAttribute (const MemberDef *mdef)
static bool isSignals (const MemberDef *mdef)
static bool isProcedure (const MemberDef *mdef)
static bool isRecord (const MemberDef *mdef)
static bool isArchitecture (const MemberDef *mdef)
static bool isUnit (const MemberDef *mdef)
static bool isPackageBody (const MemberDef *mdef)
static bool isVariable (const MemberDef *mdef)
static bool isFile (const MemberDef *mdef)
static bool isGroup (const MemberDef *mdef)
static bool isCompInst (const MemberDef *mdef)
static bool isMisc (const MemberDef *mdef)
static void prepareComment (DString &)
static void formatString (const DString &, OutputList &ol, const MemberDef *)
static void writeFormatString (const DString &, OutputList &ol, const MemberDef *)
static void writeFunctionProto (OutputList &ol, const ArgumentList &al, const MemberDef *)
static void writeProcessProto (OutputList &ol, const ArgumentList &al, const MemberDef *)
static void writeProcedureProto (OutputList &ol, const ArgumentList &al, const MemberDef *)
static bool writeFuncProcDocu (const MemberDef *mdef, OutputList &ol, const ArgumentList &al, bool type=false)
static void writeRecordProto (const MemberDef *mdef, OutputList &ol, const ArgumentList &al)
static bool writeVHDLTypeDocumentation (const MemberDef *mdef, const Definition *d, OutputList &ol)
static void writeVhdlDeclarations (const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)
static void writeVHDLDeclaration (MemberDefMutable *mdef, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool inGroup)
static void writePlainVHDLDeclarations (const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, VhdlSpecifier specifier)
static void writeVHDLDeclarations (const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const DString &title, const DString &subtitle, bool showEnumValues, VhdlSpecifier type)
static bool writeClassType (const ClassDef *, OutputList &ol, DString &cname)
static DString convertArgumentListToString (const ArgumentList &al, bool f)
static DString getProcessNumber ()
static DString getRecordNumber ()
static DString getClassName (const ClassDef *)
static bool isNumber (const std::string &s)
static DString getProtectionName (int prot)
static void parseUCF (const DString &input, Entry *entity, const DString &f, bool vendor)
static const ClassDeffindArchitecture (const ClassDef *cd)
static void correctMemberProperties (MemberDefMutable *md)
static void writeSource (const MemberDef *mdef, OutputList &ol, const DString &cname)
static DString parseForConfig (DString &entity, DString &arch)
static DString parseForBinding (DString &entity, DString &arch)
static void addBaseClass (ClassDef *cd, ClassDef *ent)
static ClassDeffindVhdlClass (const DString &className)
static void createFlowChart (const MemberDef *)
static void setFlowMember (const MemberDef *flowMember)
static const MemberDefgetFlowMember ()
static bool isVhdlClass (const Entry *cu)
static void resetCodeVhdlParserState ()

Static Private Member Functions

static void findAllArchitectures (std::vector< DString > &ql, const ClassDef *cd)
static bool compareArgList (const ArgumentList &, const ArgumentList &)
static void writeVhdlLink (const ClassDef *cdd, OutputList &ol, DString &type, DString &name, DString &beh)
static void writeStringLink (const MemberDef *mdef, DString mem, OutputList &ol)
static void writeRecUnitDocu (const MemberDef *md, OutputList &ol, DString largs)
static void writeRecordUnit (DString &largs, DString &ltype, OutputList &ol, MemberDefMutable *mdef)

Detailed Description

Class for generating documentation specific for VHDL.

Definition at line 66 of file vhdldocgen.h.

Member Enumeration Documentation

◆ VhdlClasses

Enumerator
ENTITYCLASS 
PACKBODYCLASS 
ARCHITECTURECLASS 
PACKAGECLASS 

Definition at line 70 of file vhdldocgen.h.

71 {
72 ENTITYCLASS, // Overlays: Public
73 PACKBODYCLASS, // Overlays: Protected
74 ARCHITECTURECLASS, // Overlays: Private
75 PACKAGECLASS // Overlays: Package
76 };
@ ARCHITECTURECLASS
Definition vhdldocgen.h:74

Member Function Documentation

◆ addBaseClass()

void VhdlDocGen::addBaseClass ( ClassDef * cd,
ClassDef * ent )
static

Definition at line 2341 of file vhdldocgen.cpp.

2342{
2343 BaseClassList bcl = cd->baseClasses();
2344 for (auto &bcd : bcl)
2345 {
2346 ClassDef *ccd = bcd.classDef;
2347 if (ccd==ent)
2348 {
2349 DString n = bcd.usedName;
2350 size_t i = n.find('(');
2351 if (i==DString::npos)
2352 {
2353 bcd.usedName.append("(2)");
2354 return;
2355 }
2356 static const reg::Ex reg(R"(\d+)");
2357 DString s=n.left(i);
2358 DString r=n.mid(i);
2359 std::string t=r.str();
2362 r.setNum(r.toInt()+1);
2363 reg::replace(t, reg, r.str());
2364 s.append(t);
2365 bcd.usedName=s;
2366 bcd.templSpecifiers=t;
2367 }
2368 }
2369 cd->updateBaseClasses(bcl);
2370}
virtual void updateBaseClasses(const BaseClassList &bcd)=0
Update the list of base classes to the one passed.
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
DString & setNum(short n)
Definition dstring.h:552
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
DString & append(char c)
Definition dstring.h:489
size_t find(char c, size_t pos=0) const
Definition dstring.h:239
int toInt(bool *ok=nullptr, int base=10) const
Definition dstring.cpp:191
DString left(size_t len) const
Definition dstring.h:306
const std::string & str() const
Definition dstring.h:645
static void deleteAllChars(DString &s, char c)
std::vector< BaseClassDef > BaseClassList
Definition classdef.h:77
std::string replace(std::string_view str, const Ex &re, std::string_view replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
Definition regex.cpp:872

References DString::append(), ClassDef::baseClasses(), deleteAllChars(), DString::find(), DString::left(), DString::mid(), DString::npos, reg::replace(), DString::setNum(), DString::str(), DString::toInt(), and ClassDef::updateBaseClasses().

Referenced by addInstance().

◆ compareArgList()

bool VhdlDocGen::compareArgList ( const ArgumentList & ,
const ArgumentList &  )
staticprivate

◆ computeVhdlComponentRelations()

void VhdlDocGen::computeVhdlComponentRelations ( )
static

Definition at line 2140 of file vhdldocgen.cpp.

2141{
2142
2143 DString entity,arch,inst;
2144
2145 for (const auto &cur : getVhdlInstList())
2146 {
2147 if (cur->isStatic ) // was bind
2148 {
2149 continue;
2150 }
2151
2152 if (cur->includeName=="entity" || cur->includeName=="component" )
2153 {
2154 entity=cur->includeName+" "+cur->type;
2155 DString rr=VhdlDocGen::parseForBinding(entity,arch);
2156 }
2157 else if (cur->includeName.empty())
2158 {
2159 entity=cur->type;
2160 }
2161
2162 ClassDefMutable *classEntity= toClassDefMutable(VhdlDocGen::findVhdlClass(entity));
2163 inst=VhdlDocGen::getIndexWord(cur->args,0);
2164 ClassDefMutable *cd=toClassDefMutable(Doxygen::classLinkedMap->find(inst));
2165 ClassDefMutable *ar=toClassDefMutable(Doxygen::classLinkedMap->find(cur->args));
2166
2167 if (cd==nullptr)
2168 {
2169 continue;
2170 }
2171
2172 addInstance(classEntity,ar,cd,cur);
2173 }
2174
2175}
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:88
static ClassDef * findVhdlClass(const DString &className)
static DString getIndexWord(const DString &, int index)
static DString parseForBinding(DString &entity, DString &arch)
ClassDefMutable * toClassDefMutable(Definition *d)
static void addInstance(ClassDefMutable *entity, ClassDefMutable *arch, ClassDefMutable *inst, const std::shared_ptr< Entry > &cur)
const EntryList & getVhdlInstList()

References addInstance(), Doxygen::classLinkedMap, findVhdlClass(), getIndexWord(), getVhdlInstList(), parseForBinding(), and toClassDefMutable().

Referenced by parseInput().

◆ convert()

VhdlClasses VhdlDocGen::convert ( Protection prot)
inlinestatic

Definition at line 77 of file vhdldocgen.h.

78 {
79 switch (prot)
80 {
81 case Protection::Public: return ENTITYCLASS;
82 case Protection::Protected: return PACKBODYCLASS;
83 case Protection::Private: return ARCHITECTURECLASS;
84 case Protection::Package: return PACKAGECLASS;
85 }
86 return ENTITYCLASS;
87 }

References ARCHITECTURECLASS, ENTITYCLASS, PACKAGECLASS, and PACKBODYCLASS.

Referenced by DotGfxHierarchyTable::addClassList(), findMember(), getClassName(), getSpecifierTypeFromClass(), ClassDefImpl::setProtection(), writeAlphabeticalClassList(), writeAnnotatedClassList(), writeClassTree(), writeClassTreeForList(), writeClassTreeToOutput(), ClassDefImpl::writeDeclarationLink(), writeInlineClassLink(), and writeVHDLDeclaration().

◆ convertArgumentListToString()

DString VhdlDocGen::convertArgumentListToString ( const ArgumentList & al,
bool f )
static

Definition at line 1147 of file vhdldocgen.cpp.

1148{
1149 DString argString;
1150 bool sem=false;
1151
1152 for (const Argument &arg : al)
1153 {
1154 if (sem) argString.append(", ");
1155 if (func)
1156 {
1157 argString+=arg.name;
1158 argString+=":";
1159 argString+=arg.type;
1160 }
1161 else
1162 {
1163 argString+=arg.defval+" ";
1164 argString+=arg.name+" :";
1165 argString+=arg.attrib+" ";
1166 argString+=arg.type;
1167 }
1168 sem=true;
1169 }
1170 return argString;
1171}

References DString::append().

Referenced by writeTagFile().

◆ convertFileNameToClassName()

DString VhdlDocGen::convertFileNameToClassName ( const DString & name)
static

Definition at line 1898 of file vhdldocgen.cpp.

1899{
1900 DString n=name;
1901 n=n.remove(0,6);
1902 size_t i=0;
1903 while ((i=n.find("__"))!=DString::npos && i>0) n=n.remove(i,1);
1904 while ((i=n.find("_1"))!=DString::npos && i>0) n=n.replace(i,2,":");
1905 return n;
1906}
DString & replace(size_t index, size_t len, const char *s)
Definition dstring.cpp:154
DString & remove(size_t index, size_t len)
Definition dstring.h:535

References DString::find(), DString::npos, DString::remove(), and DString::replace().

◆ correctMemberProperties()

void VhdlDocGen::correctMemberProperties ( MemberDefMutable * md)
static

Definition at line 1205 of file vhdldocgen.cpp.

1206{
1207 if (md->argsString()=="package")
1208 {
1210 }
1211 else if (md->argsString()=="configuration")
1212 {
1214 }
1215 else if (md->typeString()=="library")
1216 {
1218 }
1219 else if (md->typeString()=="use")
1220 {
1222 }
1223 else if (md->typeString().lower()=="misc")
1224 {
1226 }
1227 else if (md->typeString().lower()=="ucf_const")
1228 {
1230 }
1231
1233 {
1234 size_t mm=md->name().rfind('_');
1235 if (mm!=DString::npos && mm>0)
1236 {
1237 md->setName(md->name().left(mm));
1238 }
1239 }
1240 else if (md->getVhdlSpecifiers()==VhdlSpecifier::TYPE)
1241 {
1242 DString largs=md->argsString();
1243 bool bRec=largs.stripPrefix("record") ;
1244 bool bUnit=largs.stripPrefix("units") ;
1245 if (bRec || bUnit)
1246 {
1247 md->setType("");
1248 }
1249 }
1250}
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:244
DString lower() const
Definition dstring.h:326
bool stripPrefix(const DString &prefix)
Definition dstring.h:290
virtual const DString & name() const =0
virtual void setName(const DString &name)=0
virtual DString argsString() const =0
virtual VhdlSpecifier getVhdlSpecifiers() const =0
virtual DString typeString() const =0
virtual void setVhdlSpecifiers(VhdlSpecifier s)=0
virtual void setType(const DString &t)=0
@ INSTANTIATION
Definition types.h:791
@ MISCELLANEOUS
Definition types.h:797

References MemberDef::argsString(), CONFIG, MemberDef::getVhdlSpecifiers(), INSTANTIATION, DString::left(), LIBRARY, DString::lower(), MISCELLANEOUS, Definition::name(), DString::npos, DString::rfind(), DefinitionMutable::setName(), MemberDefMutable::setType(), MemberDefMutable::setVhdlSpecifiers(), DString::stripPrefix(), TYPE, MemberDef::typeString(), UCF_CONST, and USE.

Referenced by vhdlCorrectMemberProperties().

◆ createFlowChart()

void VhdlDocGen::createFlowChart ( const MemberDef * mdef)
static

Definition at line 2387 of file vhdldocgen.cpp.

2388{
2389 if (mdef==nullptr) return;
2390
2391 DString codeFragment;
2392 const MemberDef* mm=nullptr;
2393 if ((mm=findMemFlow(mdef))!=nullptr)
2394 {
2395 // don't create the same flowchart twice
2397 return;
2398 }
2399 else
2400 {
2401 mdList.push_back(mdef);
2402 }
2403
2404 //fprintf(stderr,"\n create flow mem %s %p\n",qPrint(mdef->name()),mdef);
2405
2406 int actualStart= mdef->getStartBodyLine();
2407 int actualEnd=mdef->getEndBodyLine();
2408 const FileDef* fd=mdef->getFileDef();
2409 bool b=readCodeFragment( fd->absFilePath(), false, actualStart, actualEnd, codeFragment);
2410 if (!b) return;
2411
2412 auto parser { Doxygen::parserManager->getOutlineParser(".vhd") };
2414 std::shared_ptr<Entry> root = std::make_shared<Entry>();
2415 StringVector filesInSameTu;
2416 parser->parseInput("",codeFragment.data(),root,nullptr);
2417}
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
virtual int getEndBodyLine() const =0
virtual int getStartBodyLine() const =0
static ParserManager * parserManager
Definition doxygen.h:122
virtual DString absFilePath() const =0
virtual const FileDef * getFileDef() const =0
std::unique_ptr< OutlineParserInterface > getOutlineParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
Definition parserintf.h:244
static void setFlowMember(const MemberDef *flowMember)
std::vector< std::string > StringVector
Definition containers.h:33
bool readCodeFragment(const DString &fileName, bool isMacro, int &startLine, int &endLine, DString &result)
Reads a fragment from file fileName starting with line startLine and ending with line endLine.
static const MemberDef * findMemFlow(const MemberDef *mdef)
static std::vector< const MemberDef * > mdList

References FileDef::absFilePath(), DString::data(), findMemFlow(), Definition::getEndBodyLine(), MemberDef::getFileDef(), ParserManager::getOutlineParser(), Definition::getStartBodyLine(), mdList, Doxygen::parserManager, readCodeFragment(), and setFlowMember().

Referenced by DocVhdlFlow::parse().

◆ deleteAllChars()

void VhdlDocGen::deleteAllChars ( DString & s,
char c )
static

Definition at line 718 of file vhdldocgen.cpp.

719{
720 size_t index=s.rfind_insensitive(c);
721 while (index!=DString::npos)
722 {
723 s = s.remove(index,1);
724 index=s.rfind_insensitive(c);
725 }
726}
size_t rfind_insensitive(char c, size_t pos=npos) const
Definition dstring.cpp:48

References DString::npos, DString::remove(), and DString::rfind_insensitive().

Referenced by addBaseClass(), VHDLOutlineParser::createFunction(), and initUCF().

◆ deleteCharRev()

bool VhdlDocGen::deleteCharRev ( DString & s,
char c )
static

deletes a char backwards in a string

Definition at line 707 of file vhdldocgen.cpp.

708{
709 size_t index=s.rfind_insensitive(c);
710 if (index!=DString::npos)
711 {
712 s = s.remove(index,1);
713 return true;
714 }
715 return false;
716}

References DString::npos, DString::remove(), and DString::rfind_insensitive().

Referenced by parseFuncProto().

◆ findAllArchitectures()

void VhdlDocGen::findAllArchitectures ( std::vector< DString > & ql,
const ClassDef * cd )
staticprivate

Definition at line 524 of file vhdldocgen.cpp.

525{
526 for (const auto &citer : *Doxygen::classLinkedMap)
527 {
528 DString className=citer->className();
529 size_t pos = DString::npos;
530 if (cd != citer.get() && (pos=className.find('-'))!=DString::npos)
531 {
532 DString postfix=className.mid(pos+1);
533 if (dstricmp(cd->className(),postfix)==0)
534 {
535 qll.push_back(className);
536 }
537 }
538 }// for
539}//findAllArchitectures
virtual DString className() const =0
Returns the name of the class including outer classes, but not including namespaces.
int dstricmp(const char *s1, const char *s2)
Definition dstring.cpp:444

References Doxygen::classLinkedMap, ClassDef::className(), dstricmp(), DString::find(), DString::mid(), and DString::npos.

Referenced by writeInlineClassLink().

◆ findAllPackages()

void VhdlDocGen::findAllPackages ( ClassDef * cdef)
static

finds all included packages of an Entity or Package

Definition at line 354 of file vhdldocgen.cpp.

355{
356 std::lock_guard lock(g_vhdlMutex);
357 if (g_packages.find(cdef)!=g_packages.end()) return;
358 std::vector<ClassDef*> cList;
359 MemberList *mem=cdef->getMemberList(MemberListType::VariableMembers());
360 if (mem)
361 {
362 for (const auto &md : *mem)
363 {
364 if (VhdlDocGen::isPackage(md))
365 {
366 ClassDef* cd=VhdlDocGen::getPackageName(md->name());
367 if (cd)
368 {
369 cList.push_back(cd);
371 g_packages.emplace(cdef,cList);
372 }
373 }
374 }//for
375 }
376
377}// findAllPackages
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt.
static void findAllPackages(ClassDef *)
static ClassDef * getPackageName(const DString &name)
static bool isPackage(const MemberDef *mdef)
static std::map< ClassDef *, std::vector< ClassDef * > > g_packages
static std::recursive_mutex g_vhdlMutex

References findAllPackages(), g_packages, g_vhdlMutex, ClassDef::getMemberList(), getPackageName(), and isPackage().

Referenced by findAllPackages(), and findMember().

◆ findArchitecture()

const ClassDef * VhdlDocGen::findArchitecture ( const ClassDef * cd)
static

Definition at line 541 of file vhdldocgen.cpp.

542{
543 for (const auto &citer : *Doxygen::classLinkedMap)
544 {
545 DString jj=citer->name();
546 StringVector ql=split(jj.str(),":");
547 if (ql.size()>1)
548 {
549 if (ql[0]==cd->name())
550 {
551 return citer.get();
552 }
553 }
554 }
555 return nullptr;
556}
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition stringutil.h:117

References Doxygen::classLinkedMap, Definition::name(), split(), and DString::str().

◆ findFunction()

const MemberDef * VhdlDocGen::findFunction ( const DString & funcname,
const DString & package )
static

returns the function with the matching argument list is called in vhdlcode.l

Definition at line 384 of file vhdldocgen.cpp.

385{
386 ClassDef *cdef=getClass(package);
387 if (cdef==nullptr) return nullptr;
388
389 MemberList *mem=cdef->getMemberList(MemberListType::PubMethods());
390 if (mem)
391 {
392 for (const auto &mdef : *mem)
393 {
394 DString mname=mdef->name();
395 if ((VhdlDocGen::isProcedure(mdef) || VhdlDocGen::isVhdlFunction(mdef)) && (compareString(funcname,mname)==0))
396 {
397 return mdef;
398 }//if
399 }//for
400 }//if
401 return nullptr;
402} //findFunction
static bool isVhdlFunction(const MemberDef *mdef)
static ClassDef * getClass(const DString &name)
static bool isProcedure(const MemberDef *mdef)
static int compareString(const DString &s1, const DString &s2)

References compareString(), getClass(), ClassDef::getMemberList(), isProcedure(), and isVhdlFunction().

Referenced by writeFuncProto().

◆ findKeyWord()

const char * VhdlDocGen::findKeyWord ( const DString & kw)
static

returns the color of a keyword

Definition at line 172 of file vhdldocgen.cpp.

173{
174 std::string word=kw.lower().str();
175
176 if (word.empty()) return nullptr;
177
178 if (g_vhdlKeyWordSet0.find(word)!=g_vhdlKeyWordSet0.end())
179 return "keywordflow";
180
181 if (g_vhdlKeyWordSet1.find(word)!=g_vhdlKeyWordSet1.end())
182 return "keywordtype";
183
184 if (g_vhdlKeyWordSet2.find(word)!=g_vhdlKeyWordSet2.end())
185 return "vhdllogic";
186
187 if (g_vhdlKeyWordSet3.find(word)!=g_vhdlKeyWordSet3.end())
188 return "vhdlkeyword";
189
190 return nullptr;
191}
static const std::unordered_set< std::string > g_vhdlKeyWordSet0
static const std::unordered_set< std::string > g_vhdlKeyWordSet2
static const std::unordered_set< std::string > g_vhdlKeyWordSet3
static const std::unordered_set< std::string > g_vhdlKeyWordSet1

References g_vhdlKeyWordSet0, g_vhdlKeyWordSet1, g_vhdlKeyWordSet2, g_vhdlKeyWordSet3, DString::lower(), and DString::str().

Referenced by writeColoredWord(), writeFormatString(), writeFunctionProto(), and writeProcedureProto().

◆ findMember()

const MemberDef * VhdlDocGen::findMember ( const DString & className,
const DString & memName )
static

Definition at line 209 of file vhdldocgen.cpp.

210{
211 std::lock_guard lock(g_vhdlMutex);
212 ClassDef *ecd=nullptr;
213 const MemberDef *mdef=nullptr;
214
215 ClassDef *cd=getClass(className);
216 //printf("VhdlDocGen::findMember(%s,%s)=%p\n",qPrint(className),qPrint(memName),cd);
217 if (cd==nullptr) return nullptr;
218
219 mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType::VariableMembers());
220 if (mdef) return mdef;
221 mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType::PubMethods());
222 if (mdef) return mdef;
223
224 // nothing found so far
225 // if we are an architecture or package body search in entity
226
229 {
230 Definition *d = cd->getOuterScope();
231 // searching upper/lower case names
232
233 DString tt=d->name();
234 ecd =getClass(tt);
235 if (!ecd)
236 {
237 tt=tt.upper();
238 ecd =getClass(tt);
239 }
240 if (!ecd)
241 {
242 tt=tt.lower();
243 ecd =getClass(tt);
244 }
245
246 if (ecd) //d && d->definitionType()==Definition::TypeClass)
247 {
248 //ClassDef *ecd = (ClassDef*)d;
249 mdef=VhdlDocGen::findMemberDef(ecd,memName,MemberListType::VariableMembers());
250 if (mdef) return mdef;
251 mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType::PubMethods());
252 if (mdef) return mdef;
253 }
254 }
255
256
259 {
260 Definition *d = cd->getOuterScope();
261
262 DString tt=d->name();
263 ClassDef *acd =getClass(tt);
264 if (!acd)
265 {
266 tt=tt.upper();
267 acd =getClass(tt);
268 }
269 if (!acd)
270 {
271 tt=tt.lower();
272 acd =getClass(tt);
273 }
274 if (acd) //d && d->definitionType()==Definition::TypeClass)
275 {
276 if(g_packages.find(acd)==g_packages.end())
277 {
279 }
280 }
281 }
282 else
283 {
284 ecd=cd;
285 if (g_packages.find(ecd)==g_packages.end()) VhdlDocGen::findAllPackages(ecd);
286 }
287
288 if (ecd)
289 {
290 auto cList_it = g_packages.find(ecd);
291 if (cList_it!=g_packages.end())
292 {
293 for (const auto &cdp : cList_it->second)
294 {
295 mdef=VhdlDocGen::findMemberDef(cdp,memName,MemberListType::VariableMembers());
296 if (mdef) return mdef;
297 mdef=VhdlDocGen::findMemberDef(cdp,memName,MemberListType::PubMethods());
298 if (mdef) return mdef;
299 }
300 }
301 }
302 return nullptr;
303
304}//findMember
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
DString upper() const
Definition dstring.h:331
virtual Definition * getOuterScope() const =0
static VhdlClasses convert(Protection prot)
Definition vhdldocgen.h:77
static const MemberDef * findMemberDef(ClassDef *cd, const DString &key, MemberListType type)
This function returns the entity|package in which the key (type) is found.

References ARCHITECTURECLASS, convert(), findAllPackages(), findMemberDef(), g_packages, g_vhdlMutex, getClass(), Definition::getOuterScope(), DString::lower(), Definition::name(), PACKBODYCLASS, ClassDef::protection(), and DString::upper().

Referenced by generateMemLink(), startCodeLine(), writeStringLink(), and writeVHDLTypeDocumentation().

◆ findMemberDef()

const MemberDef * VhdlDocGen::findMemberDef ( ClassDef * cd,
const DString & key,
MemberListType type )
static

This function returns the entity|package in which the key (type) is found.

Definition at line 310 of file vhdldocgen.cpp.

311{
312 std::lock_guard lock(g_vhdlMutex);
313 DString keyType=cd->symbolName()+"@"+key;
314 //printf("\n %s | %s | %s",qPrint(cd->symbolName()),key.data(,),qPrint(keyType));
315
316 auto it = g_varMap.find(keyType.str());
317 if (it!=g_varMap.end())
318 {
319 return it->second;
320 }
321 if (std::find(g_classList.begin(),g_classList.end(),cd)!=g_classList.end())
322 {
323 return nullptr;
324 }
325 const MemberList *ml=cd->getMemberList(type);
327 if (!ml)
328 {
329 return nullptr;
330 }
331 //int l=ml->count();
332 //fprintf(stderr,"\n loading entity %s %s: %d",qPrint(cd->symbolName()),qPrint(keyType),l);
333
334 for (const auto &md : *ml)
335 {
336 DString tkey=cd->symbolName()+"@"+md->name();
337 if (g_varMap.find(tkey.str())==g_varMap.end())
338 {
339 g_varMap.emplace(tkey.str(),md);
340 }
341 }
342 it=g_varMap.find(keyType.str());
343 if (it!=g_varMap.end())
344 {
345 return it->second;
346 }
347 return nullptr;
348}//findMemberDef
virtual DString symbolName() const =0
void push_back(const T &value)
Definition memberlist.h:49
static std::vector< ClassDef * > g_classList
static std::map< std::string, const MemberDef * > g_varMap

References g_classList, g_varMap, g_vhdlMutex, ClassDef::getMemberList(), DString::str(), and Definition::symbolName().

Referenced by findMember().

◆ findVhdlClass()

ClassDef * VhdlDocGen::findVhdlClass ( const DString & className)
static

Definition at line 2114 of file vhdldocgen.cpp.

2115{
2116 for (const auto &cd : *Doxygen::classLinkedMap)
2117 {
2118 if (dstricmp(className.data(),qPrint(cd->name()))==0)
2119 {
2120 return cd.get();
2121 }
2122 }
2123 return nullptr;
2124}
const char * qPrint(const char *s)
Definition dstring.h:783

References Doxygen::classLinkedMap, DString::data(), dstricmp(), and qPrint().

Referenced by computeVhdlComponentRelations().

◆ formatString()

void VhdlDocGen::formatString ( const DString & s,
OutputList & ol,
const MemberDef * mdef )
static

inserts white spaces for better readings and writes a colored string to the output

Definition at line 842 of file vhdldocgen.cpp.

843{
844 DString qcs = s;
845 DString temp;
846 qcs.stripPrefix(":");
847 qcs.stripPrefix("is");
848 qcs.stripPrefix("IS");
849 qcs.stripPrefix("of");
850 qcs.stripPrefix("OF");
851
852 size_t len = qcs.length();
853 size_t index=1;
854
855 for (size_t j=0;j<len;j++)
856 {
857 char c=qcs[j];
858 char b=c;
859 if (j>0) b=qcs[j-1];
860 if (c=='"' || c==',' || c=='\''|| c=='(' || c==')' || c==':' || c=='[' || c==']' ) // || (c==':' && b!='=')) // || (c=='=' && b!='>'))
861 {
862 if (temp.length()>=index && temp.at(index-1) != ' ')
863 {
864 temp+=" ";
865 }
866 temp+=c;
867 temp+=" ";
868 }
869 else if (c=='=')
870 {
871 if (b==':') // := operator
872 {
873 temp.replace(index-1,1,"=");
874 temp+=" ";
875 }
876 else // = operator
877 {
878 temp+=" ";
879 temp+=c;
880 temp+=" ";
881 }
882 }
883 else
884 {
885 temp+=c;
886 }
887
888 index=temp.length();
889 }// for
890 temp=temp.stripWhiteSpace();
891 // printf("\n [%s]",qPrint(qcs));
892 VhdlDocGen::writeFormatString(temp,ol,mdef);
893}
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:686
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:337
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
static void writeFormatString(const DString &, OutputList &ol, const MemberDef *)

References DString::at(), DString::length(), DString::replace(), DString::stripPrefix(), DString::stripWhiteSpace(), and writeFormatString().

Referenced by writeFunctionProto(), writeProcedureProto(), writeRecordUnit(), writeRecUnitDocu(), writeUCFLink(), writeVHDLDeclaration(), and writeVHDLTypeDocumentation().

◆ getClass()

ClassDef * VhdlDocGen::getClass ( const DString & name)
static

Definition at line 193 of file vhdldocgen.cpp.

194{
195 if (name.empty()) return nullptr;
196 return Doxygen::classLinkedMap->find(DString(name).stripWhiteSpace());
197}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
const T * find(const std::string &key) const
Definition linkedmap.h:47
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
Definition stringutil.h:75

References Doxygen::classLinkedMap, DString::empty(), LinkedMap< T, Hash, KeyEqual, Map >::find(), and stripWhiteSpace().

Referenced by findFunction(), findMember(), generateMemLink(), getPackageName(), writeInlineClassLink(), and writeVHDLDeclaration().

◆ getClassName()

DString VhdlDocGen::getClassName ( const ClassDef * cd)
static

Definition at line 438 of file vhdldocgen.cpp.

439{
440 DString temp;
441 if (cd==nullptr) return "";
442
444 {
445 temp=cd->name();
446 temp.stripPrefix("_");
447 return temp;
448 }
449
450 return substitute(cd->className(),"::",".");
451}
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:485

References ClassDef::className(), convert(), Definition::name(), PACKBODYCLASS, ClassDef::protection(), DString::stripPrefix(), and substitute().

Referenced by getClassTitle(), makeDisplayName(), and writeClassType().

◆ getClassTitle()

DString VhdlDocGen::getClassTitle ( const ClassDef * cd)
static

returns the class title+ref

Definition at line 426 of file vhdldocgen.cpp.

427{
428 DString pageTitle;
429 if (cd==nullptr) return "";
430 pageTitle=VhdlDocGen::getClassName(cd);
431 pageTitle+=" ";
433 return pageTitle;
434} // getClassTitle
static DString getClassName(const ClassDef *)
#define theTranslator_vhdlType
static VhdlSpecifier getSpecifierTypeFromClass(const ClassDef *cd)

References getClassName(), getSpecifierTypeFromClass(), and theTranslator_vhdlType.

Referenced by ClassDefImpl::title().

◆ getFlowMember()

◆ getIndexWord()

DString VhdlDocGen::getIndexWord ( const DString & c,
int index )
static

Definition at line 675 of file vhdldocgen.cpp.

676{
677 static const reg::Ex reg(R"([\s:|])");
678 auto ql=split(c.str(),reg);
679
680 if (index < static_cast<int>(ql.size()))
681 {
682 return ql[index];
683 }
684
685 return "";
686}

References split(), and DString::str().

Referenced by computeVhdlComponentRelations(), and parseFuncProto().

◆ getPackageName()

ClassDef * VhdlDocGen::getPackageName ( const DString & name)
static

Definition at line 199 of file vhdldocgen.cpp.

200{
201 return getClass(name);
202}

References getClass().

Referenced by findAllPackages().

◆ getProcessNumber()

DString VhdlDocGen::getProcessNumber ( )
static

returns the next number of an anonymous process

Definition at line 747 of file vhdldocgen.cpp.

748{
749 static int stringCounter;
750 DString qcs("PROCESS_");
751 char buf[8];
752 snprintf(buf,8,"%d",stringCounter++);
753 qcs.append(&buf[0]);
754 return qcs;
755}

References DString::append().

◆ getProtectionName()

DString VhdlDocGen::getProtectionName ( int prot)
static

Definition at line 689 of file vhdldocgen.cpp.

690{
691 if (prot==VhdlDocGen::ENTITYCLASS)
692 return "entity";
693 else if (prot==VhdlDocGen::ARCHITECTURECLASS)
694 return "architecture";
695 else if (prot==VhdlDocGen::PACKAGECLASS)
696 return "package";
697 else if (prot==VhdlDocGen::PACKBODYCLASS)
698 return "package body";
699
700 return "";
701}

References ARCHITECTURECLASS, ENTITYCLASS, PACKAGECLASS, and PACKBODYCLASS.

Referenced by writeAnnotatedClassList(), and ClassDefImpl::writeDeclarationLink().

◆ getRecordNumber()

DString VhdlDocGen::getRecordNumber ( )
static

returns the next number of a record|unit member

Definition at line 735 of file vhdldocgen.cpp.

736{
737 char buf[12];
738 snprintf(buf,12,"%d",recordCounter++);
739 DString qcs(&buf[0]);
740 return qcs;
741}
static int recordCounter

References recordCounter.

Referenced by VHDLOutlineParser::checkInlineCode(), and initUCF().

◆ init()

void VhdlDocGen::init ( )
static

Definition at line 165 of file vhdldocgen.cpp.

166{
167}

Referenced by VHDLCodeParser::parseCode().

◆ isAlias()

bool VhdlDocGen::isAlias ( const MemberDef * mdef)
static

Definition at line 2431 of file vhdldocgen.cpp.

2432{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::ALIAS; }

References ALIAS, and MemberDef::getVhdlSpecifiers().

Referenced by writeTagFile().

◆ isArchitecture()

bool VhdlDocGen::isArchitecture ( const MemberDef * mdef)
static

Definition at line 2465 of file vhdldocgen.cpp.

References ARCHITECTURE, and MemberDef::getVhdlSpecifiers().

◆ isAttribute()

bool VhdlDocGen::isAttribute ( const MemberDef * mdef)
static

Definition at line 2457 of file vhdldocgen.cpp.

References ATTRIBUTE, and MemberDef::getVhdlSpecifiers().

Referenced by writeTagFile().

◆ isCompInst()

bool VhdlDocGen::isCompInst ( const MemberDef * mdef)
static

Definition at line 2477 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers(), and INSTANTIATION.

Referenced by writeTagFile(), and writeVHDLDeclaration().

◆ isComponent()

bool VhdlDocGen::isComponent ( const MemberDef * mdef)
static

Definition at line 2439 of file vhdldocgen.cpp.

References COMPONENT, and MemberDef::getVhdlSpecifiers().

Referenced by writeTagFile(), and writeVHDLDeclaration().

◆ isConfig()

bool VhdlDocGen::isConfig ( const MemberDef * mdef)
static

Definition at line 2429 of file vhdldocgen.cpp.

2430{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::CONFIG; }

References CONFIG, and MemberDef::getVhdlSpecifiers().

Referenced by writeVHDLDeclaration().

◆ isConstant()

bool VhdlDocGen::isConstant ( const MemberDef * mdef)
static

Definition at line 2445 of file vhdldocgen.cpp.

2446{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::CONSTANT; }

References CONSTANT, and MemberDef::getVhdlSpecifiers().

Referenced by writeTagFile().

◆ isConstraint()

bool VhdlDocGen::isConstraint ( const MemberDef * mdef)
static

Definition at line 2427 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers(), and UCF_CONST.

Referenced by writeVHDLTypeDocumentation().

◆ isEntity()

bool VhdlDocGen::isEntity ( const MemberDef * mdef)
static

Definition at line 2443 of file vhdldocgen.cpp.

2444{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::ENTITY; }

References ENTITY, and MemberDef::getVhdlSpecifiers().

Referenced by writeTagFile().

◆ isFile()

bool VhdlDocGen::isFile ( const MemberDef * mdef)
static

Definition at line 2473 of file vhdldocgen.cpp.

2474{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::VFILE; }

References MemberDef::getVhdlSpecifiers(), and VFILE.

Referenced by writeTagFile().

◆ isGeneric()

bool VhdlDocGen::isGeneric ( const MemberDef * mdef)
static

Definition at line 2435 of file vhdldocgen.cpp.

2436{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::GENERIC; }

References GENERIC, and MemberDef::getVhdlSpecifiers().

Referenced by writeTagFile(), and writeVHDLTypeDocumentation().

◆ isGroup()

bool VhdlDocGen::isGroup ( const MemberDef * mdef)
static

Definition at line 2475 of file vhdldocgen.cpp.

2476{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::GROUP; }

References MemberDef::getVhdlSpecifiers(), and GROUP.

Referenced by writeTagFile().

◆ isLibrary()

bool VhdlDocGen::isLibrary ( const MemberDef * mdef)
static

Definition at line 2433 of file vhdldocgen.cpp.

2434{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::LIBRARY; }

References MemberDef::getVhdlSpecifiers(), and LIBRARY.

Referenced by writeTagFile(), and writeVHDLTypeDocumentation().

◆ isMisc()

bool VhdlDocGen::isMisc ( const MemberDef * mdef)
static

◆ isNumber()

bool VhdlDocGen::isNumber ( const std::string & s)
static

returns true if this string is a number

Definition at line 830 of file vhdldocgen.cpp.

831{
832 static const reg::Ex regg(R"([0-9][0-9eEfFbBcCdDaA_.#+?xXzZ-]*)");
833 return reg::match(s,regg);
834}// isNumber
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition regex.cpp:861

References reg::match().

Referenced by checkVhdlString(), writeFormatString(), and writeWord().

◆ isPackage()

bool VhdlDocGen::isPackage ( const MemberDef * mdef)
static

Definition at line 2441 of file vhdldocgen.cpp.

2442{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::USE; }

References MemberDef::getVhdlSpecifiers(), and USE.

Referenced by findAllPackages(), writeTagFile(), and writeVHDLTypeDocumentation().

◆ isPackageBody()

bool VhdlDocGen::isPackageBody ( const MemberDef * mdef)
static

Definition at line 2469 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers(), and PACKAGE_BODY.

◆ isPort()

bool VhdlDocGen::isPort ( const MemberDef * mdef)
static

Definition at line 2437 of file vhdldocgen.cpp.

2438{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::PORT; }

References MemberDef::getVhdlSpecifiers(), and PORT.

Referenced by writeTagFile(), and writeVHDLTypeDocumentation().

◆ isProcedure()

bool VhdlDocGen::isProcedure ( const MemberDef * mdef)
static

◆ isProcess()

bool VhdlDocGen::isProcess ( const MemberDef * mdef)
static

◆ isRecord()

bool VhdlDocGen::isRecord ( const MemberDef * mdef)
static

Definition at line 2463 of file vhdldocgen.cpp.

2464{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::RECORD; }

References MemberDef::getVhdlSpecifiers(), and RECORD.

Referenced by writeTagFile().

◆ isSignal()

bool VhdlDocGen::isSignal ( const MemberDef * mdef)
static

Definition at line 2455 of file vhdldocgen.cpp.

2456{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::SIGNAL; }

References MemberDef::getVhdlSpecifiers(), and SIGNAL.

◆ isSignals()

bool VhdlDocGen::isSignals ( const MemberDef * mdef)
static

Definition at line 2459 of file vhdldocgen.cpp.

2460{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::SIGNAL; }

References MemberDef::getVhdlSpecifiers(), and SIGNAL.

Referenced by writeTagFile().

◆ isSubClass()

bool VhdlDocGen::isSubClass ( ClassDef * cd,
ClassDef * scd,
bool followInstances,
int level )
static

Definition at line 2307 of file vhdldocgen.cpp.

2308{
2309 bool found=false;
2310 //printf("isBaseClass(cd=%s) looking for %s\n",qPrint(name()),qPrint(bcd->name()));
2311 if (level>255)
2312 {
2313 err("Possible recursive class relation while inside {} and looking for {}\n",cd->name(),scd->name());
2314 abort();
2315 }
2316
2317 for (const auto &bcd :cd->subClasses())
2318 {
2319 const ClassDef *ccd=bcd.classDef;
2320 if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster();
2321 //printf("isSubClass() subclass %s\n",qPrint(ccd->name()));
2322 if (ccd==scd)
2323 {
2324 found=true;
2325 }
2326 else
2327 {
2328 if (level <256)
2329 {
2330 level = ccd->isBaseClass(scd,followInstances);
2331 if (level>0)
2332 {
2333 found=true;
2334 }
2335 }
2336 }
2337 }
2338 return found;
2339}
virtual int isBaseClass(const ClassDef *bcd, bool followInstances, const DString &templSpec=DString()) const =0
Returns true iff bcd is a direct or indirect base class of this class.
virtual const ClassDef * templateMaster() const =0
Returns the template master of which this class is an instance.
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
#define err(fmt,...)
Definition message.h:127

References err, ClassDef::isBaseClass(), Definition::name(), ClassDef::subClasses(), and ClassDef::templateMaster().

Referenced by addInstance().

◆ isSubType()

bool VhdlDocGen::isSubType ( const MemberDef * mdef)
static

Definition at line 2449 of file vhdldocgen.cpp.

2450{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::SUBTYPE; }

References MemberDef::getVhdlSpecifiers(), and SUBTYPE.

Referenced by writeTagFile().

◆ isUnit()

bool VhdlDocGen::isUnit ( const MemberDef * mdef)
static

Definition at line 2467 of file vhdldocgen.cpp.

2468{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::UNITS; }

References MemberDef::getVhdlSpecifiers(), and UNITS.

◆ isVariable()

bool VhdlDocGen::isVariable ( const MemberDef * mdef)
static

Definition at line 2471 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers(), and SHAREDVARIABLE.

Referenced by writeTagFile().

◆ isVhdlClass()

bool VhdlDocGen::isVhdlClass ( const Entry * cu)
inlinestatic

Definition at line 209 of file vhdldocgen.h.

210 {
211 return cu->vhdlSpec==VhdlSpecifier::ENTITY ||
215 }
VhdlSpecifier vhdlSpec
VHDL specifiers.
Definition entry.h:182

References ARCHITECTURE, ENTITY, PACKAGE, PACKAGE_BODY, and Entry::vhdlSpec.

Referenced by VHDLOutlineParser::mapLibPackage().

◆ isVhdlFunction()

bool VhdlDocGen::isVhdlFunction ( const MemberDef * mdef)
static

◆ isVType()

bool VhdlDocGen::isVType ( const MemberDef * mdef)
static

Definition at line 2447 of file vhdldocgen.cpp.

2448{ return mdef->getVhdlSpecifiers()==VhdlSpecifier::TYPE; }

References MemberDef::getVhdlSpecifiers(), and TYPE.

Referenced by writeTagFile().

◆ parseForBinding()

DString VhdlDocGen::parseForBinding ( DString & entity,
DString & arch )
static

Definition at line 2081 of file vhdldocgen.cpp.

2082{
2083 static const reg::Ex exp(R"([()\s])");
2084
2085 auto ql = split(entity.str(),exp);
2086
2087 if (findIndex(ql,"open")!=std::string::npos)
2088 {
2089 return "open";
2090 }
2091
2092 if (ql.size()<2)
2093 {
2094 return "";
2095 }
2096
2097 std::string label=ql[0];
2098 entity = ql[1];
2099 if (size_t index=entity.rfind('.'); index!=DString::npos)
2100 {
2101 entity.remove(0,index+1);
2102 }
2103
2104 if (ql.size()==3)
2105 {
2106 arch=ql[2];
2107 }
2108 return label;
2109}
size_t findIndex(const StringVector &sv, const std::string &s)
find the index of a string in a vector of strings, returns std::string::npos if the string could not ...
Definition stringutil.h:167

References findIndex(), DString::npos, DString::remove(), DString::rfind(), split(), and DString::str().

Referenced by computeVhdlComponentRelations().

◆ parseForConfig()

DString VhdlDocGen::parseForConfig ( DString & entity,
DString & arch )
static

Definition at line 2050 of file vhdldocgen.cpp.

2051{
2052 if (!entity.contains(":")) return "";
2053
2054 static const reg::Ex exp(R"([:()\s])");
2055 auto ql=split(entity.str(),exp);
2056 if (ql.size()<2)
2057 {
2058 return "";
2059 }
2060 DString label(ql[0]);
2061 entity = ql[1];
2062 if (size_t index = entity.rfind('.'); index!=DString::npos)
2063 {
2064 entity.remove(0,index+1);
2065 }
2066
2067 if (ql.size()==3)
2068 {
2069 arch = ql[2];
2070 ql=split(arch.str(),exp);
2071 if (ql.size()>1) // expression
2072 {
2073 arch="";
2074 }
2075 }
2076 return label; // label
2077}
int contains(char c, bool cs=true) const
Definition dstring.cpp:85

References DString::contains(), DString::npos, DString::remove(), DString::rfind(), split(), and DString::str().

◆ parseFuncProto()

void VhdlDocGen::parseFuncProto ( const DString & text,
DString & name,
DString & ret,
bool doc = false )
static

parses a function proto

Parameters
textfunction string
namepoints to the function name
retStores the return type
doc???

Definition at line 625 of file vhdldocgen.cpp.

626{
627 DString s1(text);
628 DString temp;
629
630 size_t index=s1.find('(');
631 if (index==DString::npos) index=0;
632 size_t end=s1.rfind(')');
633
634 if (end!=DString::npos && end>index)
635 {
636 temp=s1.mid(index+1,(end-index-1));
637 //getFuncParams(qlist,temp);
638 }
639 if (doc)
640 {
641 name=s1.left(index);
642 name=name.stripWhiteSpace();
643 if ((end-index)>0)
644 {
645 ret="function";
646 }
647 return;
648 }
649 else
650 {
651 s1=s1.stripWhiteSpace();
652 size_t i=s1.find('(');
653 size_t s=s1.find(' ');
654 if (s==DString::npos) s=s1.find('\t');
655 if (i==DString::npos || (s!=DString::npos && (i==DString::npos || i<s)))
657 else // s<i, s=start of name, i=end of name
658 s1=s1.mid(s,(i-s));
659
660 name=s1.stripWhiteSpace();
661 }
662 index=s1.rfind_insensitive("return");
663 if (index!=DString::npos)
664 {
665 ret=s1.mid(index+6,s1.length());
666 ret=ret.stripWhiteSpace();
668 }
669}
static bool deleteCharRev(DString &s, char c)
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:181

References deleteCharRev(), end(), DString::find(), getIndexWord(), DString::left(), DString::length(), DString::mid(), DString::npos, DString::rfind(), DString::rfind_insensitive(), and DString::stripWhiteSpace().

Referenced by writeFuncProto().

◆ parseUCF()

void VhdlDocGen::parseUCF ( const DString & input,
Entry * entity,
const DString & f,
bool vendor )
static

Definition at line 1908 of file vhdldocgen.cpp.

1909{
1910 DString ucFile(input);
1911 int lineNo=0;
1912 DString comment("#!");
1913 DString brief;
1914
1915 while (!ucFile.empty())
1916 {
1917 size_t i=ucFile.find('\n');
1918 if (i==DString::npos) break;
1919 lineNo++;
1920 DString temp=ucFile.left(i);
1921 temp=temp.stripWhiteSpace();
1922 bool bb=temp.stripPrefix("//");
1923
1924 if (!temp.empty())
1925 {
1926 if (temp.stripPrefix(comment) )
1927 {
1928 brief+=temp;
1929 brief.append("\\n");
1930 }
1931 else if (!temp.stripPrefix("#") && !bb)
1932 {
1933 if (altera)
1934 {
1935 size_t in=temp.find("-name");
1936 if (in!=DString::npos && in>0)
1937 {
1938 temp=temp.remove(0,in+5);
1939 }
1940
1941 temp.stripPrefix("set_location_assignment");
1942
1943 initUCF(entity,DString(),temp,lineNo,fileName,brief);
1944 }
1945 else
1946 {
1947 static const reg::Ex ee(R"([\s=])");
1948 size_t in=findIndex(temp.str(),ee);
1949 if (in==std::string::npos) in=0;
1950 DString ff=temp.left(in);
1951 temp.stripPrefix(ff);
1952 ff.append("#");
1953 if (!temp.empty())
1954 {
1955 initUCF(entity,ff,temp,lineNo,fileName,brief);
1956 }
1957 }
1958 }
1959 }//temp
1960
1961 ucFile=ucFile.remove(0,i+1);
1962 }// while
1963}
static void initUCF(Entry *root, const DString &type, DString &qcs, int line, const DString &fileName, DString &brief)

References DString::append(), DString::empty(), DString::find(), findIndex(), initUCF(), DString::left(), DString::npos, DString::remove(), DString::str(), DString::stripPrefix(), and DString::stripWhiteSpace().

Referenced by VHDLOutlineParser::parseInput().

◆ prepareComment()

void VhdlDocGen::prepareComment ( DString & qcs)
static

strips the "--!" prefixes of vhdl comments

Definition at line 585 of file vhdldocgen.cpp.

586{
587 qcs=qcs.stripWhiteSpace();
588 if (qcs.empty()) return;
589
590 const char* sc="--!";
591 if (qcs.startsWith(sc)) qcs = qcs.mid(dstrlen(sc));
592 static const reg::Ex re(R"(\n[ \t]*--!)");
593 std::string s = qcs.str();
594 reg::Iterator iter(s,re);
595 reg::Iterator end;
596 std::string result;
597 size_t p=0;
598 size_t sl=s.length();
599 for ( ; iter!=end ; ++iter)
600 {
601 const auto &match = *iter;
602 size_t i = match.position();
603 result+="\n";
604 result+=s.substr(p,i-p);
605 p = match.position()+match.length();
606 }
607 if (p<sl)
608 {
609 result+="\n";
610 result+=s.substr(p);
611 }
612
613 qcs = result;
614 qcs=qcs.stripWhiteSpace();
615}
bool startsWith(const char *s) const
Definition dstring.h:600
uint32_t dstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
Definition dstring.h:39

References dstrlen(), DString::empty(), end(), DString::mid(), DString::startsWith(), DString::str(), and DString::stripWhiteSpace().

Referenced by VHDLOutlineParser::checkInlineCode(), VHDLOutlineParser::checkMultiComment(), and VHDLOutlineParser::handleCommentBlock().

◆ resetCodeVhdlParserState()

void VhdlDocGen::resetCodeVhdlParserState ( )
static

Definition at line 2419 of file vhdldocgen.cpp.

2420{
2421 std::lock_guard lock(g_vhdlMutex);
2422 g_varMap.clear();
2423 g_classList.clear();
2424 g_packages.clear();
2425}

References g_classList, g_packages, g_varMap, and g_vhdlMutex.

◆ setFlowMember()

void VhdlDocGen::setFlowMember ( const MemberDef * flowMember)
static

Definition at line 69 of file vhdldocgen.cpp.

70{
71 flowMember=mem;
72}

References flowMember.

Referenced by createFlowChart().

◆ writeClassType()

bool VhdlDocGen::writeClassType ( const ClassDef * cd,
OutputList & ol,
DString & cname )
static

Definition at line 1803 of file vhdldocgen.cpp.

1805{
1806 DString qcs = theTranslator->trVhdlType(getSpecifierTypeFromClass(cd),true);
1807 cname=VhdlDocGen::getClassName(cd);
1808 ol.startBold();
1809 ol.writeString(qcs);
1810 ol.writeString(" ");
1811 ol.endBold();
1812 //ol.insertMemberAlign();
1813 return false;
1814}// writeClassLink
void writeString(const DString &text)
Definition outputlist.h:407
void startBold()
Definition outputlist.h:557
void endBold()
Definition outputlist.h:559
virtual DString trVhdlType(VhdlSpecifier type, bool single)=0
Translator * theTranslator
Definition language.cpp:76

References OutputList::endBold(), getClassName(), getSpecifierTypeFromClass(), OutputList::startBold(), theTranslator, Translator::trVhdlType(), and OutputList::writeString().

◆ writeFormatString()

void VhdlDocGen::writeFormatString ( const DString & s,
OutputList & ol,
const MemberDef * mdef )
static

writes a colored and formatted string

Definition at line 761 of file vhdldocgen.cpp.

762{
763 static const reg::Ex reg(R"([\‍[\‍]./<>:\s,;'+*|&=()\"-])");
764 DString qcs = s;
765 qcs+=DString(" ");// parsing the last sign
766 DString find=qcs;
767 DString temp=qcs;
768 char buf[2];
769 buf[1]='\0';
770
771 size_t j = findIndex(temp.str(),reg);
772
773 ol.startBold();
774 if (j!=std::string::npos)
775 {
776 while (j!=std::string::npos)
777 {
778 find=find.left(j);
779 buf[0]=temp[j];
780 const char *ss=VhdlDocGen::findKeyWord(find);
781 bool k=isNumber(find.str()); // is this a number
782 if (k)
783 {
784 ol.docify(" ");
785 startFonts(find,"vhdldigit",ol);
786 ol.docify(" ");
787 }
788 else if (j != 0 && ss)
789 {
790 startFonts(find,ss,ol);
791 }
792 else
793 {
794 if (j>0)
795 {
796 VhdlDocGen::writeStringLink(mdef,find,ol);
797 }
798 }
799 startFonts(&buf[0],"vhdlchar",ol);
800
801 DString st=temp.remove(0,j+1);
802 find=st;
803 if (!find.empty() && find.at(0)=='"')
804 {
805 size_t ii=find.find('"',2);
806 if (ii!=DString::npos && ii>1)
807 {
808 DString com=find.left(ii+1);
809 startFonts(com,"keyword",ol);
810 temp=find.remove(0,ii+1);
811 }
812 }
813 else
814 {
815 temp=st;
816 }
817 j = findIndex(temp.str(),reg);
818 }//while
819 }//if
820 else
821 {
822 startFonts(find,"vhdlchar",ol);
823 }
824 ol.endBold();
825}// writeFormatString
void docify(const DString &s)
Definition outputlist.h:433
static const char * findKeyWord(const DString &word)
static void writeStringLink(const MemberDef *mdef, DString mem, OutputList &ol)
static bool isNumber(const std::string &s)
static void startFonts(const DString &q, const char *keyword, OutputList &ol)

References DString::at(), OutputList::docify(), DString::empty(), OutputList::endBold(), DString::find(), findIndex(), findKeyWord(), isNumber(), DString::left(), DString::npos, DString::remove(), OutputList::startBold(), startFonts(), DString::str(), and writeStringLink().

Referenced by formatString(), writeFuncProcDocu(), and writeProcessProto().

◆ writeFuncProcDocu()

bool VhdlDocGen::writeFuncProcDocu ( const MemberDef * md,
OutputList & ol,
const ArgumentList & al,
bool type = false )
static

writes a function|procedure documentation to the output

Definition at line 1058 of file vhdldocgen.cpp.

1063{
1064 //bool sem=false;
1065 ol.enableAll();
1066
1067 size_t index=al.size();
1068 if (index==0)
1069 {
1070 ol.docify(" ( ) ");
1071 return false;
1072 }
1073 ol.endMemberDocName();
1074 ol.startParameterList(true);
1075 //ol.startParameterName(false);
1076 bool first=true;
1077 for (const Argument &arg : al)
1078 {
1079 ol.startParameterType(first,"");
1080 // if (first) ol.writeChar('(');
1081 DString attl=arg.defval;
1082
1083 //bool bGen=attl.stripPrefix("generic");
1084 //if (bGen)
1085 // VhdlDocGen::writeFormatString(DString("generic "),ol,md);
1086
1087
1089 {
1090 startFonts(arg.defval,"keywordtype",ol);
1091 ol.docify(" ");
1092 }
1093 ol.endParameterType();
1094
1095 ol.startParameterName(true);
1096 VhdlDocGen::writeFormatString(arg.name,ol,md);
1097
1099 {
1100 startFonts(arg.attrib,"stringliteral",ol);
1101 }
1102 else if (VhdlDocGen::isVhdlFunction(md))
1103 {
1104 startFonts(DString("in"),"stringliteral",ol);
1105 }
1106
1107 ol.docify(" ");
1109 ol.startEmphasis();
1111 if (!VhdlDocGen::isProcess(md))
1112 {
1113 // startFonts(arg.type,"vhdlkeyword",ol);
1114 VhdlDocGen::writeFormatString(arg.type,ol,md);
1115 }
1117 ol.endEmphasis();
1119
1120 if (--index)
1121 {
1122 ol.docify(" , ");
1123 }
1124 else
1125 {
1126 // ol.docify(" ) ");
1127 ol.endParameterName();
1129 ol.endParameterExtra(true,false,true);
1130 break;
1131 }
1132 ol.endParameterName();
1134 ol.endParameterExtra(false,false,false);
1135
1136 //sem=true;
1137 first=false;
1138 }
1139 //ol.endParameterList();
1140 return true;
1141
1142} // writeDocFunProc
size_t size() const
Definition arguments.h:101
void endParameterExtra(bool last, bool one, bool bracket)
Definition outputlist.h:690
void disable(OutputType o)
void endMemberDocName()
Definition outputlist.h:678
void startParameterExtra()
Definition outputlist.h:688
void startParameterList(bool openBracket)
Definition outputlist.h:696
void enable(OutputType o)
void endEmphasis()
Definition outputlist.h:523
void endParameterName()
Definition outputlist.h:686
void startEmphasis()
Definition outputlist.h:521
void endParameterType()
Definition outputlist.h:682
void startParameterName(bool one)
Definition outputlist.h:684
void enableAll()
void startParameterType(bool first, const DString &key)
Definition outputlist.h:680
static bool isProcess(const MemberDef *mdef)

References OutputList::disable(), OutputList::docify(), OutputList::enable(), OutputList::enableAll(), OutputList::endEmphasis(), OutputList::endMemberDocName(), OutputList::endParameterExtra(), OutputList::endParameterName(), OutputList::endParameterType(), isProcedure(), isProcess(), isVhdlFunction(), Man, ArgumentList::size(), OutputList::startEmphasis(), startFonts(), OutputList::startParameterExtra(), OutputList::startParameterList(), OutputList::startParameterName(), OutputList::startParameterType(), and writeFormatString().

Referenced by writeVHDLTypeDocumentation().

◆ writeFunctionProto()

void VhdlDocGen::writeFunctionProto ( OutputList & ol,
const ArgumentList & al,
const MemberDef * mdef )
static

writes a function prototype to the output

Definition at line 954 of file vhdldocgen.cpp.

955{
956 if (!al.hasParameters()) return;
957 bool sem=false;
958 size_t len=al.size();
959 ol.startBold();
960 ol.docify(" ( ");
961 ol.endBold();
962 if (len>2)
963 {
964 ol.lineBreak();
965 }
966 for (const Argument &arg : al)
967 {
968 ol.startBold();
969 DString att=arg.defval;
970 bool bGen=att.stripPrefix("generic");
971
972 if (sem && len < 3)
973 {
974 ol.docify(" , ");
975 }
976
977 if (bGen)
978 {
979 VhdlDocGen::formatString(DString("generic "),ol,mdef);
980 }
981 if (!att.empty())
982 {
983 const char *str=VhdlDocGen::findKeyWord(att);
984 att+=" ";
985 if (str)
986 VhdlDocGen::formatString(att,ol,mdef);
987 else
988 startFonts(att,"vhdlchar",ol);
989 }
990
991 DString nn=arg.name;
992 nn+=": ";
993 DString ss=arg.type.stripWhiteSpace(); //.lower();
994 DString w=ss.stripWhiteSpace();//.upper();
995 startFonts(nn,"vhdlchar",ol);
996 startFonts("in ","stringliteral",ol);
997 const char *str=VhdlDocGen::findKeyWord(ss);
998 if (str)
999 VhdlDocGen::formatString(w,ol,mdef);
1000 else
1001 startFonts(w,"vhdlchar",ol);
1002
1003 if (!arg.attrib.empty())
1004 startFonts(arg.attrib,"vhdlchar",ol);
1005
1006 sem=true;
1007 ol.endBold();
1008 if (len > 2)
1009 {
1010 ol.lineBreak();
1011 }
1012 }
1013 ol.startBold();
1014 ol.docify(" )");
1015 DString exp=mdef->excpString();
1016 if (!exp.empty())
1017 {
1018 ol.insertMemberAlign();
1019 ol.startBold();
1020 ol.docify("[ ");
1021 ol.docify(exp);
1022 ol.docify(" ]");
1023 ol.endBold();
1024 }
1025 ol.endBold();
1026}
bool hasParameters() const
Definition arguments.h:77
virtual DString excpString() const =0
void lineBreak(const DString &style=DString())
Definition outputlist.h:555
void insertMemberAlign(bool templ=false)
Definition outputlist.h:513
static void formatString(const DString &, OutputList &ol, const MemberDef *)

References OutputList::docify(), DString::empty(), OutputList::endBold(), MemberDef::excpString(), findKeyWord(), formatString(), ArgumentList::hasParameters(), OutputList::insertMemberAlign(), OutputList::lineBreak(), ArgumentList::size(), OutputList::startBold(), startFonts(), DString::stripPrefix(), and DString::stripWhiteSpace().

Referenced by writeVHDLDeclaration().

◆ writeInlineClassLink()

void VhdlDocGen::writeInlineClassLink ( const ClassDef * cd,
OutputList & ol )
static

writes an inline link form entity|package to architecture|package body and vice verca

Definition at line 457 of file vhdldocgen.cpp.

458{
459 std::vector<DString> ql;
460 DString nn=cd->className();
462
463 DString type = theTranslator_vhdlType(getSpecifierTypeFromClass(cd),true);
464
465 //type=type.lower();
466 type+=" >> ";
469
471 {
472 nn.stripPrefix("_");
473 cd=getClass(nn);
474 }
475 else if (ii==VhdlDocGen::PACKAGECLASS)
476 {
477 nn.prepend("_");
478 cd=getClass(nn);
479 }
481 {
482 StringVector qlist=split(nn.str(),"-");
483 if (qlist.size()>1)
484 {
485 nn=qlist[1];
487 }
488 }
489
490 DString opp;
492 {
494 for (const auto &s : ql)
495 {
496 StringVector qlist=split(s.str(),"-");
497 if (qlist.size()>2)
498 {
499 DString s1(qlist[0]);
500 DString s2(qlist[1]);
501 s1.stripPrefix("_");
502 if (ql.size()==1) s1.clear();
503 ClassDef *cc = getClass(s);
504 if (cc)
505 {
506 VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
507 }
508 }
509 }
510 }
511 else
512 {
513 VhdlDocGen::writeVhdlLink(cd,ol,type,nn,opp);
514 }
515
518
519}// write
DString & prepend(const char *s)
Definition dstring.h:515
static void writeVhdlLink(const ClassDef *cdd, OutputList &ol, DString &type, DString &name, DString &beh)
static void findAllArchitectures(std::vector< DString > &ql, const ClassDef *cd)

References ARCHITECTURECLASS, ClassDef::className(), DString::clear(), convert(), OutputList::disable(), OutputList::enable(), ENTITYCLASS, findAllArchitectures(), getClass(), getSpecifierTypeFromClass(), Man, PACKAGECLASS, PACKBODYCLASS, DString::prepend(), ClassDef::protection(), RTF, split(), DString::str(), DString::stripPrefix(), theTranslator_vhdlType, and writeVhdlLink().

Referenced by ClassDefImpl::writeMemberDeclarations().

◆ writePlainVHDLDeclarations()

void VhdlDocGen::writePlainVHDLDeclarations ( const MemberList * ml,
OutputList & ol,
const ClassDef * cd,
const NamespaceDef * nd,
const FileDef * fd,
const GroupDef * gd,
const ModuleDef * mod,
VhdlSpecifier specifier )
static

Definition at line 1686 of file vhdldocgen.cpp.

1690{
1691
1692 StringSet pack;
1693
1694 bool first=true;
1695 for (const auto &imd : *mlist)
1696 {
1697 MemberDefMutable *md = toMemberDefMutable(imd);
1698 if (md)
1699 {
1701 if (md->isBriefSectionVisible() && (mems==specifier) && (mems!=VhdlSpecifier::LIBRARY) )
1702 {
1703 if (first) { ol.startMemberList();first=false; }
1704 VhdlDocGen::writeVHDLDeclaration(md,ol,cd,nd,fd,gd,mod,false);
1705 } //if
1706 else if (md->isBriefSectionVisible() && (mems==specifier))
1707 {
1708 if (pack.find(md->name().str())==pack.end())
1709 {
1710 if (first) ol.startMemberList(),first=false;
1711 VhdlDocGen::writeVHDLDeclaration(md,ol,cd,nd,fd,gd,mod,false);
1712 pack.insert(md->name().str());
1713 }
1714 } //if
1715 } //if
1716 } //for
1717 if (!first) ol.endMemberList();
1718}//plainDeclaration
virtual bool isBriefSectionVisible() const =0
void startMemberList()
Definition outputlist.h:477
void endMemberList()
Definition outputlist.h:479
static void writeVHDLDeclaration(MemberDefMutable *mdef, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool inGroup)
std::set< std::string > StringSet
Definition containers.h:31
MemberDefMutable * toMemberDefMutable(Definition *d)
VhdlSpecifier
Definition types.h:770

References OutputList::endMemberList(), MemberDef::getVhdlSpecifiers(), MemberDef::isBriefSectionVisible(), LIBRARY, Definition::name(), OutputList::startMemberList(), DString::str(), toMemberDefMutable(), and writeVHDLDeclaration().

Referenced by writeVHDLDeclarations().

◆ writeProcedureProto()

void VhdlDocGen::writeProcedureProto ( OutputList & ol,
const ArgumentList & al,
const MemberDef * mdef )
static

writes a procedure prototype to the output

Definition at line 899 of file vhdldocgen.cpp.

900{
901 bool sem=false;
902 size_t len=al.size();
903 ol.docify("( ");
904 if (len > 2)
905 {
906 ol.lineBreak();
907 }
908 for (const Argument &arg : al)
909 {
910 ol.startBold();
911 if (sem && len <3)
912 ol.writeChar(',');
913
914 DString nn=arg.name;
915 nn+=": ";
916
917 DString defval = arg.defval;
918 const char *str=VhdlDocGen::findKeyWord(defval);
919 defval+=" ";
920 if (str)
921 {
922 startFonts(defval,str,ol);
923 }
924 else
925 {
926 startFonts(defval,"vhdlchar",ol); // write type (variable,constant etc.)
927 }
928
929 startFonts(nn,"vhdlchar",ol); // write name
930 if (dstricmp(arg.attrib,arg.type) != 0)
931 {
932 startFonts(arg.attrib.lower(),"stringliteral",ol); // write in|out
933 }
934 ol.docify(" ");
935 VhdlDocGen::formatString(arg.type,ol,mdef);
936 sem=true;
937 ol.endBold();
938 if (len > 2)
939 {
940 ol.lineBreak();
941 ol.docify(" ");
942 }
943 }//for
944
945 ol.docify(" )");
946
947
948}
void writeChar(char c)
Definition outputlist.h:525

References OutputList::docify(), dstricmp(), OutputList::endBold(), findKeyWord(), formatString(), OutputList::lineBreak(), ArgumentList::size(), OutputList::startBold(), startFonts(), and OutputList::writeChar().

Referenced by writeVHDLDeclaration().

◆ writeProcessProto()

void VhdlDocGen::writeProcessProto ( OutputList & ol,
const ArgumentList & al,
const MemberDef * mdef )
static

writes a process prototype to the output

Definition at line 1032 of file vhdldocgen.cpp.

1033{
1034 if (!al.hasParameters()) return;
1035 bool sem=false;
1036 ol.startBold();
1037 ol.docify(" ( ");
1038 for (const Argument &arg : al)
1039 {
1040 if (sem)
1041 {
1042 ol.docify(" , ");
1043 }
1044 DString nn=arg.name;
1045 // startFonts(nn,"vhdlchar",ol);
1047 sem=true;
1048 }
1049 ol.docify(" )");
1050 ol.endBold();
1051}

References OutputList::docify(), OutputList::endBold(), ArgumentList::hasParameters(), OutputList::startBold(), and writeFormatString().

Referenced by writeVHDLDeclaration().

◆ writeRecordProto()

void VhdlDocGen::writeRecordProto ( const MemberDef * mdef,
OutputList & ol,
const ArgumentList & al )
static

◆ writeRecordUnit()

void VhdlDocGen::writeRecordUnit ( DString & largs,
DString & ltype,
OutputList & ol,
MemberDefMutable * mdef )
staticprivate

Definition at line 2252 of file vhdldocgen.cpp.

2253{
2254 if (size_t i=mdef->name().find('~'); i!=DString::npos && i>0)
2255 {
2256 //sets the real record member name
2257 mdef->setName(mdef->name().left(i));
2258 }
2259
2260 writeLink(mdef,ol);
2261 ol.startBold();
2262 ol.insertMemberAlign();
2263 if (!ltype.empty())
2264 {
2265 VhdlDocGen::formatString(ltype,ol,mdef);
2266 }
2267 ol.endBold();
2268}
static void writeLink(const MemberDef *mdef, OutputList &ol)

References DString::empty(), OutputList::endBold(), DString::find(), formatString(), OutputList::insertMemberAlign(), DString::left(), Definition::name(), DString::npos, DefinitionMutable::setName(), OutputList::startBold(), and writeLink().

Referenced by writeVHDLDeclaration().

◆ writeRecUnitDocu()

void VhdlDocGen::writeRecUnitDocu ( const MemberDef * md,
OutputList & ol,
DString largs )
staticprivate

Definition at line 2271 of file vhdldocgen.cpp.

2275{
2276
2277 StringVector ql=split(largs.str(),"#");
2278 size_t len=ql.size();
2279 ol.startParameterList(true);
2280 bool first=true;
2281
2282 for(size_t i=0;i<len;i++)
2283 {
2284 DString n = ql[i];
2285 ol.startParameterType(first,"");
2286 ol.endParameterType();
2287 ol.startParameterName(true);
2288 VhdlDocGen::formatString(n,ol,md);
2289 ol.endParameterName();
2291 if ((len-i)>1)
2292 {
2293 ol.endParameterExtra(false,false,false);
2294 }
2295 else
2296 {
2297 ol.endParameterExtra(true,false,true);
2298 }
2299
2300 first=false;
2301 }
2302
2303}//#

References OutputList::endParameterExtra(), OutputList::endParameterName(), OutputList::endParameterType(), formatString(), split(), OutputList::startParameterExtra(), OutputList::startParameterList(), OutputList::startParameterName(), OutputList::startParameterType(), and DString::str().

Referenced by writeVHDLTypeDocumentation().

◆ writeSource()

void VhdlDocGen::writeSource ( const MemberDef * mdef,
OutputList & ol,
const DString & cname )
static

Definition at line 1843 of file vhdldocgen.cpp.

1844{
1845 auto intf = Doxygen::parserManager->getCodeParser(".vhd");
1846 // pIntf->resetCodeParserState();
1847
1848 DString codeFragment=mdef->documentation();
1849
1850 if (cname.empty())
1851 {
1852 writeLink(mdef,ol);
1853 size_t fi=0;
1854 int j=0;
1855 do { fi=codeFragment.find('\n',++fi); } while (fi!=DString::npos && j++ <3);
1856
1857 // show only the first four lines
1858 if (j==4)
1859 {
1860 codeFragment=codeFragment.left(fi);
1861 codeFragment.append("\n .... ");
1862 }
1863 }
1864
1865 codeFragment.prepend("\n");
1866 ol.pushGeneratorState();
1867 auto &codeOL = ol.codeGenerators();
1868 codeOL.startCodeFragment("DoxyCode");
1869 intf->parseCode(codeOL, // codeOutIntf
1870 DString(), // scope
1871 codeFragment, // input
1872 SrcLangExt::VHDL, // lang
1873 Config_getBool(STRIP_CODE_COMMENTS),
1874 CodeParserOptions()
1875 .setFileDef(mdef->getFileDef())
1876 .setStartLine(mdef->getStartBodyLine())
1877 .setEndLine(mdef->getEndBodyLine())
1878 .setInlineFragment(true)
1879 .setMemberDef(mdef)
1880 );
1881
1882 codeOL.endCodeFragment("DoxyCode");
1883 ol.popGeneratorState();
1884
1885 if (cname.empty()) return;
1886
1887 MemberDefMutable *mdm = toMemberDefMutable(const_cast<MemberDef*>(mdef));
1888 if (mdm)
1889 {
1890 mdm->writeSourceDef(ol);
1891 if (mdef->hasReferencesRelation()) mdm->writeSourceRefs(ol,cname);
1892 if (mdef->hasReferencedByRelation()) mdm->writeSourceReffedBy(ol,cname);
1893 }
1894}
virtual DString documentation() const =0
virtual void writeSourceReffedBy(OutputList &ol, const DString &scopeName) const =0
virtual void writeSourceDef(OutputList &ol) const =0
virtual void writeSourceRefs(OutputList &ol, const DString &scopeName) const =0
virtual bool hasReferencesRelation() const =0
virtual bool hasReferencedByRelation() const =0
void startCodeFragment(const DString &style)
Definition outputlist.h:276
const OutputCodeList & codeGenerators() const
Definition outputlist.h:354
void pushGeneratorState()
void popGeneratorState()
std::unique_ptr< CodeParserInterface > getCodeParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
Definition parserintf.h:253
#define Config_getBool(name)
Definition config.h:33

References DString::append(), OutputList::codeGenerators(), Config_getBool, Definition::documentation(), DString::empty(), DString::find(), ParserManager::getCodeParser(), Definition::getEndBodyLine(), MemberDef::getFileDef(), Definition::getStartBodyLine(), MemberDef::hasReferencedByRelation(), MemberDef::hasReferencesRelation(), DString::left(), DString::npos, Doxygen::parserManager, OutputList::popGeneratorState(), DString::prepend(), OutputList::pushGeneratorState(), CodeParserOptions::setEndLine(), CodeParserOptions::setInlineFragment(), CodeParserOptions::setMemberDef(), CodeParserOptions::setStartLine(), OutputCodeList::startCodeFragment(), toMemberDefMutable(), writeLink(), DefinitionMutable::writeSourceDef(), DefinitionMutable::writeSourceReffedBy(), and DefinitionMutable::writeSourceRefs().

Referenced by MemberDefImpl::writeDocumentation(), and writeVHDLDeclaration().

◆ writeStringLink()

void VhdlDocGen::writeStringLink ( const MemberDef * mdef,
DString mem,
OutputList & ol )
staticprivate

writes a link if the string is linkable else a formatted string

Definition at line 1819 of file vhdldocgen.cpp.

1820{
1821 if (mdef)
1822 {
1823 const ClassDef *cd=mdef->getClassDef();
1824 if (cd)
1825 {
1826 DString n=cd->name();
1827 const MemberDef* memdef=VhdlDocGen::findMember(n,mem);
1828 if (memdef && memdef->isLinkable())
1829 {
1830 ol.startBold();
1831 writeLink(memdef,ol);
1832 ol.endBold();
1833 ol.docify(" ");
1834 return;
1835 }
1836 }
1837 }
1838 startFonts(mem,"vhdlchar",ol);
1839}// found component
virtual bool isLinkable() const =0
virtual const ClassDef * getClassDef() const =0
static const MemberDef * findMember(const DString &className, const DString &memName)

References OutputList::docify(), OutputList::endBold(), findMember(), MemberDef::getClassDef(), Definition::isLinkable(), Definition::name(), OutputList::startBold(), startFonts(), and writeLink().

Referenced by writeFormatString().

◆ writeTagFile()

void VhdlDocGen::writeTagFile ( MemberDefMutable * mdef,
TextStream & tagFile )
static

Definition at line 1337 of file vhdldocgen.cpp.

1338{
1339 tagFile << " <member kind=\"";
1340 if (VhdlDocGen::isGeneric(mdef)) tagFile << "generic";
1341 if (VhdlDocGen::isPort(mdef)) tagFile << "port";
1342 if (VhdlDocGen::isEntity(mdef)) tagFile << "entity";
1343 if (VhdlDocGen::isComponent(mdef)) tagFile << "component";
1344 if (VhdlDocGen::isVType(mdef)) tagFile << "type";
1345 if (VhdlDocGen::isConstant(mdef)) tagFile << "constant";
1346 if (VhdlDocGen::isSubType(mdef)) tagFile << "subtype";
1347 if (VhdlDocGen::isVhdlFunction(mdef)) tagFile << "function";
1348 if (VhdlDocGen::isProcedure(mdef)) tagFile << "procedure";
1349 if (VhdlDocGen::isProcess(mdef)) tagFile << "process";
1350 if (VhdlDocGen::isSignals(mdef)) tagFile << "signal";
1351 if (VhdlDocGen::isAttribute(mdef)) tagFile << "attribute";
1352 if (VhdlDocGen::isRecord(mdef)) tagFile << "record";
1353 if (VhdlDocGen::isLibrary(mdef)) tagFile << "library";
1354 if (VhdlDocGen::isPackage(mdef)) tagFile << "package";
1355 if (VhdlDocGen::isVariable(mdef)) tagFile << "shared variable";
1356 if (VhdlDocGen::isFile(mdef)) tagFile << "file";
1357 if (VhdlDocGen::isGroup(mdef)) tagFile << "group";
1358 if (VhdlDocGen::isCompInst(mdef)) tagFile << "instantiation";
1359 if (VhdlDocGen::isAlias(mdef)) tagFile << "alias";
1360 if (VhdlDocGen::isCompInst(mdef)) tagFile << "configuration";
1361
1362 DString fn = mdef->getOutputFileBase();
1364 tagFile << "\">\n";
1365 tagFile << " <type>" << convertToXML(mdef->typeString()) << "</type>\n";
1366 tagFile << " <name>" << convertToXML(mdef->name()) << "</name>\n";
1367 tagFile << " <anchorfile>" << convertToXML(fn) << "</anchorfile>\n";
1368 tagFile << " <anchor>" << convertToXML(mdef->anchor()) << "</anchor>\n";
1369
1371 tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),true)) << "</arglist>\n";
1372 else if (VhdlDocGen::isProcedure(mdef))
1373 tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),false)) << "</arglist>\n";
1374 else
1375 tagFile << " <arglist>" << convertToXML(mdef->argsString()) << "</arglist>\n";
1376
1377 mdef->writeDocAnchorsToTagFile(tagFile);
1378 tagFile << " </member>\n";
1379}
virtual DString anchor() const =0
virtual DString getOutputFileBase() const =0
virtual void writeDocAnchorsToTagFile(TextStream &) const =0
virtual const ArgumentList & argumentList() const =0
static bool isGroup(const MemberDef *mdef)
static bool isConstant(const MemberDef *mdef)
static bool isAttribute(const MemberDef *mdef)
static bool isLibrary(const MemberDef *mdef)
static DString convertArgumentListToString(const ArgumentList &al, bool f)
static bool isEntity(const MemberDef *mdef)
static bool isPort(const MemberDef *mdef)
static bool isFile(const MemberDef *mdef)
static bool isSignals(const MemberDef *mdef)
static bool isVariable(const MemberDef *mdef)
static bool isVType(const MemberDef *mdef)
static bool isSubType(const MemberDef *mdef)
static bool isCompInst(const MemberDef *mdef)
static bool isRecord(const MemberDef *mdef)
static bool isComponent(const MemberDef *mdef)
static bool isGeneric(const MemberDef *mdef)
static bool isAlias(const MemberDef *mdef)
void addHtmlExtensionIfMissing(DString &fName)
Definition util.cpp:3931
DString convertToXML(const DString &s, bool keepEntities, const bool citeEntry)
Definition util.cpp:3232

References addHtmlExtensionIfMissing(), Definition::anchor(), MemberDef::argsString(), MemberDef::argumentList(), convertArgumentListToString(), convertToXML(), Definition::getOutputFileBase(), isAlias(), isAttribute(), isCompInst(), isComponent(), isConstant(), isEntity(), isFile(), isGeneric(), isGroup(), isLibrary(), isPackage(), isPort(), isProcedure(), isProcess(), isRecord(), isSignals(), isSubType(), isVariable(), isVhdlFunction(), isVType(), Definition::name(), MemberDef::typeString(), and DefinitionMutable::writeDocAnchorsToTagFile().

Referenced by MemberList::writeTagFile().

◆ writeVHDLDeclaration()

void VhdlDocGen::writeVHDLDeclaration ( MemberDefMutable * mdef,
OutputList & ol,
const ClassDef * cd,
const NamespaceDef * nd,
const FileDef * fd,
const GroupDef * gd,
const ModuleDef * mod,
bool inGroup )
static

printf("startMemberItem for %s\n",qPrint(name()));

Definition at line 1383 of file vhdldocgen.cpp.

1386{
1387 const Definition *d=nullptr;
1388
1389 ASSERT(cd!=nullptr || nd!=nullptr || fd!=nullptr || gd!=nullptr || mod!=nullptr ||
1392 ); // member should belong to something
1393 if (cd) d=cd;
1394 else if (nd) d=nd;
1395 else if (fd) d=fd;
1396 else if (mod) d=mod;
1397 else if (gd) d=gd;
1398 else d=mdef;
1399
1400 // write search index info
1401 if (Doxygen::searchIndex.enabled())
1402 {
1403 Doxygen::searchIndex.setCurrentDoc(mdef,mdef->anchor(),false);
1406 }
1407
1408 DString cname = d->name();
1409 DString cfname = d->getOutputFileBase();
1410
1411 //HtmlHelp *htmlHelp=nullptr;
1412 // bool hasHtmlHelp = Config_getBool(GENERATE_HTML) && Config_getBool(GENERATE_HTMLHELP);
1413 // if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance();
1414
1415 // search for the last anonymous scope in the member type
1416 const ClassDef *annoClassDef=mdef->getClassDefOfAnonymousType();
1417
1418 // start a new member declaration
1421 ///printf("startMemberItem for %s\n",qPrint(name()));
1425
1426 ol.startMemberItem( mdef->anchor(), memType );
1427
1428 // If there is no detailed description we need to write the anchor here.
1429 bool detailsVisible = mdef->hasDetailedDescription();
1430 if (!detailsVisible)
1431 {
1432 DString doxyName=mdef->name();
1433 if (!cname.empty()) doxyName.prepend(cname+"::");
1434 DString doxyArgs=mdef->argsString();
1435 ol.startDoxyAnchor(cfname,cname,mdef->anchor(),doxyName,doxyArgs);
1436 ol.addLabel(cfname,mdef->anchor());
1437
1438 ol.pushGeneratorState();
1441 ol.docify("\n");
1442 ol.popGeneratorState();
1443
1444 }
1445 // *** write type
1446 /*VHDL CHANGE */
1447
1448 DString ltype(mdef->typeString());
1449 DString largs(mdef->argsString());
1450
1451 ClassDef *kl=nullptr;
1452 const ArgumentList &al = mdef->argumentList();
1453 DString nn;
1454 //VhdlDocGen::adjustRecordMember(mdef);
1455 if (gd) gd=nullptr;
1456 switch (mm)
1457 {
1459 VhdlDocGen::writeSource(mdef,ol,nn);
1460 break;
1463 ol.startBold();
1464 VhdlDocGen::formatString(ltype,ol,mdef);
1465 ol.endBold();
1466 ol.insertMemberAlign();
1467 ol.docify(" ");
1468
1469 writeLink(mdef,ol);
1470 if (al.hasParameters() && mm==VhdlSpecifier::FUNCTION)
1472
1475
1476 break;
1477 case VhdlSpecifier::USE:
1478 kl=VhdlDocGen::getClass(mdef->name());
1479 if (kl && (VhdlDocGen::convert(kl->protection())==VhdlDocGen::ENTITYCLASS)) break;
1480 writeLink(mdef,ol);
1481 ol.insertMemberAlign();
1482 ol.docify(" ");
1483
1484 if (kl)
1485 {
1486 nn=kl->getOutputFileBase();
1487 ol.pushGeneratorState();
1489 ol.docify(" ");
1491 ol.startBold();
1492 ol.docify(name);
1493 name.clear();
1494 ol.endBold();
1495 name+=" <"+mdef->name()+">";
1496 ol.startEmphasis();
1497 ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),DString(),name);
1498 ol.popGeneratorState();
1499 }
1500 break;
1502 writeLink(mdef,ol);
1503 ol.insertMemberAlign();
1504 if (largs=="context")
1505 {
1506 VhdlDocGen::writeRecordUnit(ltype,largs,ol,mdef);
1507 }
1508
1509 break;
1510
1514
1515 writeLink(mdef,ol);
1516 ol.docify(" ");
1517 if (mm==VhdlSpecifier::GENERIC)
1518 {
1519 ol.insertMemberAlign();
1520 ol.startBold();
1521 VhdlDocGen::formatString(largs,ol,mdef);
1522 ol.endBold();
1523 }
1524 else
1525 {
1526 ol.insertMemberAlignLeft(memType, false);
1527 ol.docify(" ");
1528 ol.startBold();
1529 VhdlDocGen::formatString(ltype,ol,mdef);
1530 ol.endBold();
1531 ol.insertMemberAlign();
1532 ol.docify(" ");
1533 VhdlDocGen::formatString(largs,ol,mdef);
1534 }
1535 break;
1537 writeLink(mdef,ol);
1538 ol.insertMemberAlign();
1540 break;
1546 if (VhdlDocGen::isCompInst(mdef) )
1547 {
1548 nn=largs;
1549 if(nn.stripPrefix("function") || nn.stripPrefix("package"))
1550 {
1551 VhdlDocGen::formatString(largs,ol,mdef);
1552 ol.insertMemberAlign();
1553 writeLink(mdef,ol);
1554 ol.docify(" ");
1555 VhdlDocGen::formatString(ltype,ol,mdef);
1556 break;
1557 }
1558
1559 largs.prepend("::");
1560 largs.prepend(mdef->name());
1561 ol.writeObjectLink(mdef->getReference(),
1562 cfname,
1563 mdef->anchor(),
1564 mdef->name());
1565 }
1566 else
1567 writeLink(mdef,ol);
1568
1569 ol.insertMemberAlign();
1570 ol.docify(" ");
1571 ol.startBold();
1572 ol.docify(ltype);
1573 ol.endBold();
1574 ol.docify(" ");
1575 if (VhdlDocGen::isComponent(mdef) ||
1576 VhdlDocGen::isConfig(mdef) ||
1578 {
1580 {
1581 nn=ltype;
1582 }
1583 else
1584 {
1585 nn=mdef->name();
1586 }
1587 kl=getClass(nn);
1588 if (kl)
1589 {
1590 nn=kl->getOutputFileBase();
1591 ol.pushGeneratorState();
1593 ol.startEmphasis();
1594 DString name("<Entity ");
1596 {
1597 name+=ltype+">";
1598 }
1599 else
1600 {
1601 name+=mdef->name()+"> ";
1602 }
1603 ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),DString(),name);
1604 ol.endEmphasis();
1605 ol.popGeneratorState();
1606 }
1607 }
1608 break;
1610 writeUCFLink(mdef,ol);
1611 break;
1620 writeLink(mdef,ol);
1621 ol.docify(" ");
1622 ol.insertMemberAlign();
1623 VhdlDocGen::formatString(ltype,ol,mdef);
1624 break;
1627 writeRecordUnit(largs,ltype,ol,mdef);
1628 break;
1629
1630 default: break;
1631 }
1632
1633 bool htmlOn = ol.isEnabled(OutputType::Html);
1634 if (htmlOn && /*Config_getBool(HTML_ALIGN_MEMBERS) &&*/ !ltype.empty())
1635 {
1637 }
1638 if (!ltype.empty()) ol.docify(" ");
1639
1640 if (htmlOn)
1641 {
1643 }
1644
1645 if (!detailsVisible)
1646 {
1647 ol.endDoxyAnchor(cfname,mdef->anchor());
1648 }
1649
1650 ol.endMemberItem(memType);
1651 if (!mdef->briefDescription().empty() && Config_getBool(BRIEF_MEMBER_DESC) /* && !annMemb */)
1652 {
1653 DString s=mdef->briefDescription();
1654 ol.startMemberDescription(mdef->anchor(), DString(), mm == VhdlSpecifier::PORT);
1655 ol.generateDoc(mdef->briefFile(),
1656 mdef->briefLine(),
1657 mdef->getOuterScope()?mdef->getOuterScope():d,
1658 mdef,
1659 s,
1660 DocOptions()
1661 .setIndexWords(true)
1662 .setSingleLine(true));
1663 if (detailsVisible)
1664 {
1665 ol.pushGeneratorState();
1667 ol.docify(" ");
1668 if (mdef->getGroupDef()!=nullptr && gd==nullptr) // forward link to the group
1669 {
1670 ol.startTextLink(mdef->getOutputFileBase(),mdef->anchor());
1671 }
1672 else // local link
1673 {
1674 ol.startTextLink(DString(),mdef->anchor());
1675 }
1676 ol.endTextLink();
1677 ol.popGeneratorState();
1678 }
1680 }
1681 mdef->warnIfUndocumented();
1682
1683}// end writeVhdlDeclaration
void clear()
Definition dstring.h:214
virtual DString briefDescription(bool abbreviate=false) const =0
virtual DString briefFile() const =0
virtual const DString & localName() const =0
virtual int briefLine() const =0
virtual DString qualifiedName() const =0
virtual DString getReference() const =0
static SearchIndexIntf searchIndex
Definition doxygen.h:117
virtual bool hasDetailedDescription() const =0
virtual void warnIfUndocumented() const =0
virtual GroupDef * getGroupDef()=0
virtual const ClassDef * getClassDefOfAnonymousType() const =0
bool isEnabled(OutputType o)
void writeObjectLink(const DString &ref, const DString &file, const DString &anchor, const DString &name)
Definition outputlist.h:435
void endMemberDescription()
Definition outputlist.h:563
void insertMemberAlignLeft(OutputGenerator::MemberItemType typ=OutputGenerator::MemberItemType::Normal, bool templ=false)
Definition outputlist.h:515
void endDoxyAnchor(const DString &fn, const DString &anchor)
Definition outputlist.h:537
void endTextLink()
Definition outputlist.h:440
void addLabel(const DString &fName, const DString &anchor)
Definition outputlist.h:539
void endMemberItem(OutputGenerator::MemberItemType type)
Definition outputlist.h:491
void disableAllBut(OutputType o)
void startTextLink(const DString &file, const DString &anchor)
Definition outputlist.h:438
void startMemberItem(const DString &anchor, OutputGenerator::MemberItemType type, const DString &id=DString())
Definition outputlist.h:489
void startMemberDescription(const DString &anchor, const DString &inheritId=DString(), bool typ=false)
Definition outputlist.h:561
void generateDoc(const DString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const DString &docStr, const DocOptions &options)
void startDoxyAnchor(const DString &fName, const DString &manName, const DString &anchor, const DString &name, const DString &args)
Definition outputlist.h:533
void addWord(const DString &word, bool hiPriority)
void setCurrentDoc(const Definition *ctx, const DString &anchor, bool isSourceFile)
static void writeProcessProto(OutputList &ol, const ArgumentList &al, const MemberDef *)
static void writeRecordUnit(DString &largs, DString &ltype, OutputList &ol, MemberDefMutable *mdef)
static void writeProcedureProto(OutputList &ol, const ArgumentList &al, const MemberDef *)
static bool isConfig(const MemberDef *mdef)
static void writeSource(const MemberDef *mdef, OutputList &ol, const DString &cname)
static void writeFunctionProto(OutputList &ol, const ArgumentList &al, const MemberDef *)
#define ASSERT(x)
Definition message.h:142
static void writeUCFLink(const MemberDef *mdef, OutputList &ol)

References OutputList::addLabel(), SearchIndexIntf::addWord(), ALIAS, Definition::anchor(), OutputGenerator::AnonymousStart, MemberDef::argsString(), MemberDef::argumentList(), ASSERT, ATTRIBUTE, Definition::briefDescription(), Definition::briefFile(), Definition::briefLine(), DString::clear(), COMPONENT, CONFIG, Config_getBool, CONSTANT, convert(), OutputList::disable(), OutputList::disableAllBut(), OutputList::docify(), DString::empty(), OutputList::enable(), OutputList::endBold(), OutputList::endDoxyAnchor(), OutputList::endEmphasis(), OutputList::endMemberDescription(), OutputList::endMemberItem(), OutputList::endTextLink(), ENTITY, ENTITYCLASS, formatString(), FUNCTION, OutputList::generateDoc(), GENERIC, getClass(), MemberDef::getClassDefOfAnonymousType(), MemberDef::getGroupDef(), Definition::getOuterScope(), Definition::getOutputFileBase(), Definition::getReference(), MemberDef::getVhdlSpecifiers(), GROUP, MemberDef::hasDetailedDescription(), ArgumentList::hasParameters(), Html, OutputList::insertMemberAlign(), OutputList::insertMemberAlignLeft(), INSTANTIATION, isCompInst(), isComponent(), isConfig(), OutputList::isEnabled(), Latex, LIBRARY, Definition::localName(), Man, MISCELLANEOUS, Definition::name(), OutputGenerator::Normal, PACKAGE, OutputList::popGeneratorState(), PORT, DString::prepend(), PROCEDURE, PROCESS, ClassDef::protection(), OutputList::pushGeneratorState(), Definition::qualifiedName(), RECORD, Doxygen::searchIndex, SearchIndexIntf::setCurrentDoc(), SHAREDVARIABLE, SIGNAL, OutputList::startBold(), OutputList::startDoxyAnchor(), OutputList::startEmphasis(), OutputList::startMemberDescription(), OutputList::startMemberItem(), OutputList::startTextLink(), DString::stripPrefix(), SUBTYPE, OutputGenerator::Templated, theTranslator_vhdlType, TYPE, MemberDef::typeString(), UCF_CONST, UNITS, USE, VFILE, MemberDef::warnIfUndocumented(), writeFunctionProto(), writeLink(), OutputList::writeObjectLink(), writeProcedureProto(), writeProcessProto(), writeRecordUnit(), writeSource(), and writeUCFLink().

Referenced by writePlainVHDLDeclarations().

◆ writeVHDLDeclarations()

void VhdlDocGen::writeVHDLDeclarations ( const MemberList * ml,
OutputList & ol,
const ClassDef * cd,
const NamespaceDef * nd,
const FileDef * fd,
const GroupDef * gd,
const ModuleDef * mod,
const DString & title,
const DString & subtitle,
bool showEnumValues,
VhdlSpecifier type )
static

Definition at line 1740 of file vhdldocgen.cpp.

1743{
1744 if (!membersHaveSpecificType(ml,type)) return;
1745
1746 if (!title.empty())
1747 {
1748 ol.startMemberHeader(convertToId(title),type == VhdlSpecifier::PORT ? 3 : 2);
1749 ol.parseText(title);
1750 ol.endMemberHeader();
1751 ol.docify(" ");
1752 }
1753 if (!subtitle.empty())
1754 {
1756 ol.generateDoc("[generated]",
1757 -1,
1758 nullptr,
1759 nullptr,
1760 subtitle,
1761 DocOptions()
1762 .setSingleLine(true));
1763 ol.endMemberSubtitle();
1764 } //printf("memberGroupList=%p\n",memberGroupList);
1765
1766 VhdlDocGen::writePlainVHDLDeclarations(ml,ol,cd,nd,fd,gd,mod,type);
1767
1768 int groupId=0;
1769 for (const auto &mg : ml->getMemberGroupList())
1770 {
1771 if (membersHaveSpecificType(&mg->members(),type))
1772 {
1773 //printf("mg->header=%s\n",qPrint(mg->header()));
1774 bool hasHeader=!mg->header().empty();
1775 DString groupAnchor = DString(ml->listType().toLabel())+"-"+DString().setNum(groupId++);
1776 ol.startMemberGroupHeader(groupAnchor,hasHeader);
1777 if (hasHeader)
1778 {
1779 ol.parseText(mg->header());
1780 }
1781 ol.endMemberGroupHeader(hasHeader);
1782 if (!mg->documentation().empty())
1783 {
1784 //printf("Member group has docs!\n");
1786 ol.generateDoc("[generated]",
1787 -1,
1788 nullptr,
1789 nullptr,
1790 mg->documentation()+"\n",
1791 DocOptions());
1792 ol.endMemberGroupDocs();
1793 }
1794 ol.startMemberGroup();
1795 //printf("--- mg->writePlainDeclarations ---\n");
1796 VhdlDocGen::writePlainVHDLDeclarations(&mg->members(),ol,cd,nd,fd,gd,mod,type);
1797 ol.endMemberGroup(hasHeader);
1798 }
1799 }
1800}// writeVHDLDeclarations
MemberListType listType() const
Definition memberlist.h:131
const MemberGroupRefList & getMemberGroupList() const
Definition memberlist.h:167
constexpr const char * toLabel() const noexcept
Definition types.h:402
void parseText(const DString &textStr)
void endMemberGroupDocs()
Definition outputlist.h:507
void startMemberHeader(const DString &anchor, int typ=2)
Definition outputlist.h:465
void endMemberGroupHeader(bool b)
Definition outputlist.h:503
void startMemberGroup()
Definition outputlist.h:509
void startMemberGroupHeader(const DString &id, bool b)
Definition outputlist.h:501
void endMemberGroup(bool last)
Definition outputlist.h:511
void startMemberGroupDocs()
Definition outputlist.h:505
void endMemberHeader()
Definition outputlist.h:467
void endMemberSubtitle()
Definition outputlist.h:471
void startMemberSubtitle()
Definition outputlist.h:469
static void writePlainVHDLDeclarations(const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, VhdlSpecifier specifier)
DString convertToId(const DString &s)
Definition util.cpp:3202
static bool membersHaveSpecificType(const MemberList *ml, VhdlSpecifier type)

References convertToId(), OutputList::docify(), DString::empty(), OutputList::endMemberGroup(), OutputList::endMemberGroupDocs(), OutputList::endMemberGroupHeader(), OutputList::endMemberHeader(), OutputList::endMemberSubtitle(), OutputList::generateDoc(), MemberList::getMemberGroupList(), MemberList::listType(), membersHaveSpecificType(), OutputList::parseText(), PORT, DString::setNum(), OutputList::startMemberGroup(), OutputList::startMemberGroupDocs(), OutputList::startMemberGroupHeader(), OutputList::startMemberHeader(), OutputList::startMemberSubtitle(), MemberListType::toLabel(), and writePlainVHDLDeclarations().

Referenced by writeVhdlDeclarations().

◆ writeVhdlDeclarations()

void VhdlDocGen::writeVhdlDeclarations ( const MemberList * ml,
OutputList & ol,
const GroupDef * gd,
const ClassDef * cd,
const FileDef * fd,
const NamespaceDef * nd,
const ModuleDef * mod )
static

Definition at line 1174 of file vhdldocgen.cpp.

1176{
1198
1199 // configurations must be added to global file definitions.
1202
1203}
static void writeVHDLDeclarations(const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const DString &title, const DString &subtitle, bool showEnumValues, VhdlSpecifier type)

References ALIAS, ATTRIBUTE, COMPONENT, CONFIG, CONSTANT, FUNCTION, GENERIC, GROUP, INSTANTIATION, LIBRARY, MISCELLANEOUS, PORT, PROCEDURE, PROCESS, RECORD, SHAREDVARIABLE, SIGNAL, SUBTYPE, theTranslator_vhdlType, TYPE, UCF_CONST, UNITS, USE, VFILE, and writeVHDLDeclarations().

Referenced by MemberList::writeDeclarations(), ClassDefImpl::writeMemberDeclarations(), FileDefImpl::writeMemberDeclarations(), and GroupDefImpl::writeMemberDeclarations().

◆ writeVhdlLink()

void VhdlDocGen::writeVhdlLink ( const ClassDef * cdd,
OutputList & ol,
DString & type,
DString & name,
DString & beh )
staticprivate

Definition at line 561 of file vhdldocgen.cpp.

562{
563 if (ccd==nullptr) return;
564 ol.startBold();
565 ol.docify(type);
566 ol.endBold();
567 nn.stripPrefix("_");
568 ol.writeObjectLink(ccd->getReference(),ccd->getOutputFileBase(),DString(),nn);
569
570 if (!behav.empty())
571 {
572 behav.prepend(" ");
573 ol.startBold();
574 ol.docify(behav);
575 ol.endBold();
576 }
577
578 ol.lineBreak();
579}

References OutputList::docify(), DString::empty(), OutputList::endBold(), Definition::getOutputFileBase(), Definition::getReference(), OutputList::lineBreak(), DString::prepend(), OutputList::startBold(), DString::stripPrefix(), and OutputList::writeObjectLink().

Referenced by writeInlineClassLink().

◆ writeVHDLTypeDocumentation()

bool VhdlDocGen::writeVHDLTypeDocumentation ( const MemberDef * mdef,
const Definition * d,
OutputList & ol )
static

Definition at line 1253 of file vhdldocgen.cpp.

1254{
1255 const ClassDef *cd=toClassDef(d);
1256 bool hasParams = false;
1257
1258 if (cd==nullptr) return hasParams;
1259
1260 DString ttype=mdef->typeString();
1261 DString largs=mdef->argsString();
1262
1264 {
1265 DString nn=mdef->typeString();
1266 nn=nn.stripWhiteSpace();
1267 DString na=cd->name();
1268 const MemberDef* memdef=VhdlDocGen::findMember(na,nn);
1269 if (memdef && memdef->isLinkable())
1270 {
1271 ol.docify(" ");
1272
1273 ol.startBold();
1274 writeLink(memdef,ol);
1275 ol.endBold();
1276 ol.docify(" ");
1277 }
1278 else
1279 {
1280 ol.docify(" ");
1281 VhdlDocGen::formatString(ttype,ol,mdef);
1282 ol.docify(" ");
1283 }
1284 ol.docify(mdef->name());
1285 hasParams = VhdlDocGen::writeFuncProcDocu(mdef,ol, mdef->argumentList());
1286 }
1287
1288
1289 if (mdef->isVariable())
1290 {
1291 if (VhdlDocGen::isConstraint(mdef))
1292 {
1293 writeLink(mdef,ol);
1294 ol.docify(" ");
1295
1296 largs=substitute(largs,"#"," ");
1297 VhdlDocGen::formatString(largs,ol,mdef);
1298 return hasParams;
1299 }
1300 else
1301 {
1302 writeLink(mdef,ol);
1304 {
1305 return hasParams;
1306 }
1307 ol.docify(" ");
1308 }
1309
1310 // DString largs=mdef->argsString();
1311
1312 bool c=largs=="context";
1313 bool brec=largs.stripPrefix("record") ;
1314
1315 if (!brec && !c)
1316 VhdlDocGen::formatString(ttype,ol,mdef);
1317
1318 if (c || brec || largs.stripPrefix("units"))
1319 {
1320 if (c)
1321 largs=ttype;
1322 VhdlDocGen::writeRecUnitDocu(mdef,ol,largs);
1323 return hasParams;
1324 }
1325
1326 ol.docify(" ");
1327 if (VhdlDocGen::isPort(mdef) || VhdlDocGen::isGeneric(mdef))
1328 {
1329 // DString largs=mdef->argsString();
1330 VhdlDocGen::formatString(largs,ol,mdef);
1331 ol.docify(" ");
1332 }
1333 }
1334 return hasParams;
1335}
virtual bool isVariable() const =0
static void writeRecUnitDocu(const MemberDef *md, OutputList &ol, DString largs)
static bool isConstraint(const MemberDef *mdef)
static bool writeFuncProcDocu(const MemberDef *mdef, OutputList &ol, const ArgumentList &al, bool type=false)
ClassDef * toClassDef(Definition *d)

References MemberDef::argsString(), MemberDef::argumentList(), OutputList::docify(), OutputList::endBold(), findMember(), formatString(), isConstraint(), isGeneric(), isLibrary(), Definition::isLinkable(), isPackage(), isPort(), isProcedure(), isProcess(), MemberDef::isVariable(), isVhdlFunction(), Definition::name(), OutputList::startBold(), DString::stripPrefix(), DString::stripWhiteSpace(), substitute(), toClassDef(), MemberDef::typeString(), writeFuncProcDocu(), writeLink(), and writeRecUnitDocu().

Referenced by MemberDefImpl::writeDocumentation().


The documentation for this class was generated from the following files: