Skip to main content

The VhdlDocGen Class Reference

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

Declaration

class VhdlDocGen { ... }

Included Headers

#include <src/vhdldocgen.h>

Enumerations Index

enumVhdlClasses { ... }

Public Static Functions Index

static VhdlClassesconvert (Protection prot)
static voidinit ()
static QCStringconvertFileNameToClassName (const QCString &name)
static boolisSubClass (ClassDef *cd, ClassDef *scd, bool followInstances, int level)
static QCStringgetIndexWord (const QCString &, int index)
static booldeleteCharRev (QCString &s, char c)
static voiddeleteAllChars (QCString &s, char c)
static voidparseFuncProto (const QCString &text, QCString &name, QCString &ret, bool doc=false)
static voidcomputeVhdlComponentRelations ()
static const char *findKeyWord (const QCString &word)
static ClassDef *getPackageName (const QCString &name)
static const MemberDef *findMember (const QCString &className, const QCString &memName)
static voidfindAllPackages (ClassDef *)
static const MemberDef *findMemberDef (ClassDef *cd, const QCString &key, MemberListType type)

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

static ClassDef *getClass (const QCString &name)
static const MemberDef *findFunction (const QCString &name, const QCString &package)
static QCStringgetClassTitle (const ClassDef *)
static voidwriteInlineClassLink (const ClassDef *, OutputList &ol)
static voidwriteTagFile (MemberDefMutable *mdef, TextStream &tagFile)
static boolisConstraint (const MemberDef *mdef)
static boolisConfig (const MemberDef *mdef)
static boolisAlias (const MemberDef *mdef)
static boolisLibrary (const MemberDef *mdef)
static boolisGeneric (const MemberDef *mdef)
static boolisPort (const MemberDef *mdef)
static boolisComponent (const MemberDef *mdef)
static boolisPackage (const MemberDef *mdef)
static boolisEntity (const MemberDef *mdef)
static boolisConstant (const MemberDef *mdef)
static boolisVType (const MemberDef *mdef)
static boolisSubType (const MemberDef *mdef)
static boolisVhdlFunction (const MemberDef *mdef)
static boolisProcess (const MemberDef *mdef)
static boolisSignal (const MemberDef *mdef)
static boolisAttribute (const MemberDef *mdef)
static boolisSignals (const MemberDef *mdef)
static boolisProcedure (const MemberDef *mdef)
static boolisRecord (const MemberDef *mdef)
static boolisArchitecture (const MemberDef *mdef)
static boolisUnit (const MemberDef *mdef)
static boolisPackageBody (const MemberDef *mdef)
static boolisVariable (const MemberDef *mdef)
static boolisFile (const MemberDef *mdef)
static boolisGroup (const MemberDef *mdef)
static boolisCompInst (const MemberDef *mdef)
static boolisMisc (const MemberDef *mdef)
static voidprepareComment (QCString &)
static voidformatString (const QCString &, OutputList &ol, const MemberDef *)
static voidwriteFormatString (const QCString &, OutputList &ol, const MemberDef *)
static voidwriteFunctionProto (OutputList &ol, const ArgumentList &al, const MemberDef *)
static voidwriteProcessProto (OutputList &ol, const ArgumentList &al, const MemberDef *)
static voidwriteProcedureProto (OutputList &ol, const ArgumentList &al, const MemberDef *)
static boolwriteFuncProcDocu (const MemberDef *mdef, OutputList &ol, const ArgumentList &al, bool type=false)
static voidwriteRecordProto (const MemberDef *mdef, OutputList &ol, const ArgumentList &al)
static boolwriteVHDLTypeDocumentation (const MemberDef *mdef, const Definition *d, OutputList &ol)
static voidwriteVhdlDeclarations (const MemberList *, OutputList &, const GroupDef *, const ClassDef *, const FileDef *, const NamespaceDef *, const ModuleDef *)
static voidwriteVHDLDeclaration (MemberDefMutable *mdef, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, bool inGroup)
static voidwritePlainVHDLDeclarations (const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, VhdlSpecifier specifier)
static voidwriteVHDLDeclarations (const MemberList *ml, OutputList &ol, const ClassDef *cd, const NamespaceDef *nd, const FileDef *fd, const GroupDef *gd, const ModuleDef *mod, const QCString &title, const QCString &subtitle, bool showEnumValues, VhdlSpecifier type)
static boolwriteClassType (const ClassDef *, OutputList &ol, QCString &cname)
static QCStringconvertArgumentListToString (const ArgumentList &al, bool f)
static QCStringgetProcessNumber ()
static QCStringgetRecordNumber ()
static QCStringgetClassName (const ClassDef *)
static boolisNumber (const std::string &s)
static QCStringgetProtectionName (int prot)
static voidparseUCF (const QCString &input, Entry *entity, const QCString &f, bool vendor)
static const ClassDef *findArchitecture (const ClassDef *cd)
static voidcorrectMemberProperties (MemberDefMutable *md)
static voidwriteSource (const MemberDef *mdef, OutputList &ol, const QCString &cname)
static QCStringparseForConfig (QCString &entity, QCString &arch)
static QCStringparseForBinding (QCString &entity, QCString &arch)
static voidaddBaseClass (ClassDef *cd, ClassDef *ent)
static ClassDef *findVhdlClass (const QCString &className)
static voidcreateFlowChart (const MemberDef *)
static voidsetFlowMember (const MemberDef *flowMember)
static const MemberDef *getFlowMember ()
static boolisVhdlClass (const Entry *cu)
static voidresetCodeVhdlParserState ()

Private Static Functions Index

static voidfindAllArchitectures (std::vector< QCString > &ql, const ClassDef *cd)
static boolcompareArgList (const ArgumentList &, const ArgumentList &)
static voidwriteVhdlLink (const ClassDef *cdd, OutputList &ol, QCString &type, QCString &name, QCString &beh)
static voidwriteStringLink (const MemberDef *mdef, QCString mem, OutputList &ol)
static voidwriteRecUnitDocu (const MemberDef *md, OutputList &ol, QCString largs)
static voidwriteRecordUnit (QCString &largs, QCString &ltype, OutputList &ol, MemberDefMutable *mdef)

Description

Class for generating documentation specific for VHDL.

Definition at line 69 of file vhdldocgen.h.

Enumerations

VhdlClasses

enum VhdlDocGen::VhdlClasses
Enumeration values
ENTITYCLASS
PACKBODYCLASS
ARCHITECTURECLASS
PACKAGECLASS

Definition at line 73 of file vhdldocgen.h.

74 {
75 ENTITYCLASS, // Overlays: Public
76 PACKBODYCLASS, // Overlays: Protected
77 ARCHITECTURECLASS, // Overlays: Private
78 PACKAGECLASS // Overlays: Package
79 };

Public Static Functions

addBaseClass()

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

Declaration at line 202 of file vhdldocgen.h, definition at line 2356 of file vhdldocgen.cpp.

2357{
2358 BaseClassList bcl = cd->baseClasses();
2359 for (auto &bcd : bcl)
2360 {
2361 ClassDef *ccd = bcd.classDef;
2362 if (ccd==ent)
2363 {
2364 QCString n = bcd.usedName;
2365 int i = n.find('(');
2366 if(i<0)
2367 {
2368 bcd.usedName.append("(2)");
2369 return;
2370 }
2371 static const reg::Ex reg(R"(\d+)");
2372 QCString s=n.left(i);
2373 QCString r=n.right(n.length()-i);
2374 std::string t=r.str();
2377 r.setNum(r.toInt()+1);
2378 reg::replace(t, reg, r.str());
2379 s.append(t.c_str());
2380 bcd.usedName=s;
2381 bcd.templSpecifiers=t;
2382 }
2383 }
2384 cd->updateBaseClasses(bcl);
2385}

References QCString::append, ClassDef::baseClasses, deleteAllChars, QCString::find, QCString::left, QCString::length, reg::replace, QCString::right, QCString::setNum, QCString::str, QCString::toInt and ClassDef::updateBaseClasses.

Referenced by addInstance.

computeVhdlComponentRelations()

void VhdlDocGen::computeVhdlComponentRelations ()
static

Declaration at line 107 of file vhdldocgen.h, definition at line 2154 of file vhdldocgen.cpp.

2155{
2156
2157 QCString entity,arch,inst;
2158
2159 for (const auto &cur : getVhdlInstList())
2160 {
2161 if (cur->isStatic ) // was bind
2162 {
2163 continue;
2164 }
2165
2166 if (cur->includeName=="entity" || cur->includeName=="component" )
2167 {
2168 entity=cur->includeName+" "+cur->type;
2170 }
2171 else if (cur->includeName.isEmpty())
2172 {
2173 entity=cur->type;
2174 }
2175
2177 inst=VhdlDocGen::getIndexWord(cur->args,0);
2180
2181 if (cd==nullptr)
2182 {
2183 continue;
2184 }
2185
2186 addInstance(classEntity,ar,cd,cur);
2187 }
2188
2189}

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

Referenced by parseInput.

convert()

VhdlClasses VhdlDocGen::convert (Protection prot)
inline static

Definition at line 80 of file vhdldocgen.h.

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

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()

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

Declaration at line 184 of file vhdldocgen.h, definition at line 1156 of file vhdldocgen.cpp.

1157{
1158 QCString argString;
1159 bool sem=FALSE;
1160
1161 for (const Argument &arg : al)
1162 {
1163 if (sem) argString.append(", ");
1164 if (func)
1165 {
1166 argString+=arg.name;
1167 argString+=":";
1168 argString+=arg.type;
1169 }
1170 else
1171 {
1172 argString+=arg.defval+" ";
1173 argString+=arg.name+" :";
1174 argString+=arg.attrib+" ";
1175 argString+=arg.type;
1176 }
1177 sem=TRUE;
1178 }
1179 return argString;
1180}

References QCString::append, FALSE and TRUE.

Referenced by writeTagFile.

convertFileNameToClassName()

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

Declaration at line 93 of file vhdldocgen.h, definition at line 1899 of file vhdldocgen.cpp.

1900{
1901
1902 QCString n=name;
1903 n=n.remove(0,6);
1904
1905 int i=0;
1906
1907 while((i=n.find("__"))>0)
1908 {
1909 n=n.remove(i,1);
1910 }
1911
1912 while((i=n.find("_1"))>0)
1913 {
1914 n=n.replace(i,2,":");
1915 }
1916
1917 return n;
1918}

References QCString::find, QCString::remove and QCString::replace.

correctMemberProperties()

void VhdlDocGen::correctMemberProperties (MemberDefMutable * md)
static

Declaration at line 196 of file vhdldocgen.h, definition at line 1214 of file vhdldocgen.cpp.

1215{
1216 if (md->argsString()=="package")
1217 {
1219 }
1220 else if (md->argsString()=="configuration")
1221 {
1223 }
1224 else if (md->typeString()=="library")
1225 {
1227 }
1228 else if (md->typeString()=="use")
1229 {
1231 }
1232 else if (md->typeString().lower()=="misc")
1233 {
1235 }
1236 else if (md->typeString().lower()=="ucf_const")
1237 {
1239 }
1240
1242 {
1243 int mm=md->name().findRev('_');
1244 if (mm>0)
1245 {
1246 md->setName(md->name().left(mm));
1247 }
1248 }
1250 {
1251 QCString largs=md->argsString();
1252 bool bRec=largs.stripPrefix("record") ;
1253 bool bUnit=largs.stripPrefix("units") ;
1254 if (bRec || bUnit)
1255 {
1256 md->setType("");
1257 }
1258 }
1259}

References MemberDef::argsString, CONFIG, QCString::findRev, MemberDef::getVhdlSpecifiers, INSTANTIATION, QCString::left, LIBRARY, QCString::lower, MISCELLANEOUS, Definition::name, DefinitionMutable::setName, MemberDefMutable::setType, MemberDefMutable::setVhdlSpecifiers, QCString::stripPrefix, TYPE, MemberDef::typeString, UCF_CONST and USE.

Referenced by vhdlCorrectMemberProperties.

createFlowChart()

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

Declaration at line 206 of file vhdldocgen.h, definition at line 2402 of file vhdldocgen.cpp.

2403{
2404 if (mdef==nullptr) return;
2405
2406 QCString codeFragment;
2407 const MemberDef* mm=nullptr;
2408 if ((mm=findMemFlow(mdef))!=nullptr)
2409 {
2410 // don't create the same flowchart twice
2412 return;
2413 }
2414 else
2415 {
2416 mdList.push_back(mdef);
2417 }
2418
2419 //fprintf(stderr,"\n create flow mem %s %p\n",qPrint(mdef->name()),mdef);
2420
2421 int actualStart= mdef->getStartBodyLine();
2422 int actualEnd=mdef->getEndBodyLine();
2423 const FileDef* fd=mdef->getFileDef();
2424 bool b=readCodeFragment( fd->absFilePath(), false, actualStart, actualEnd, codeFragment);
2425 if (!b) return;
2426
2427 auto parser { Doxygen::parserManager->getOutlineParser(".vhd") };
2429 std::shared_ptr<Entry> root = std::make_shared<Entry>();
2430 StringVector filesInSameTu;
2431 parser->parseInput("",codeFragment.data(),root,nullptr);
2432}

References FileDef::absFilePath, QCString::data, findMemFlow, Definition::getEndBodyLine, MemberDef::getFileDef, Definition::getStartBodyLine, mdList, Doxygen::parserManager, readCodeFragment and setFlowMember.

Referenced by DocVhdlFlow::parse.

deleteAllChars()

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

Declaration at line 100 of file vhdldocgen.h, definition at line 727 of file vhdldocgen.cpp.

728{
729 int index=s.findRev(c,-1,FALSE);
730 while (index > -1)
731 {
732 s = s.remove(index,1);
733 index=s.findRev(c,-1,FALSE);
734 }
735}

References FALSE, QCString::findRev and QCString::remove.

Referenced by addBaseClass, VHDLOutlineParser::createFunction and initUCF.

deleteCharRev()

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

deletes a char backwards in a string

Declaration at line 99 of file vhdldocgen.h, definition at line 716 of file vhdldocgen.cpp.

717{
718 int index=s.findRev(c,-1,FALSE);
719 if (index > -1)
720 {
721 s = s.remove(index,1);
722 return TRUE;
723 }
724 return FALSE;
725}

References FALSE, QCString::findRev, QCString::remove and TRUE.

Referenced by parseFuncProto.

findAllPackages()

void VhdlDocGen::findAllPackages (ClassDef * cdef)
static

finds all included packages of an Entity or Package

Declaration at line 114 of file vhdldocgen.h, definition at line 362 of file vhdldocgen.cpp.

363{
364 std::lock_guard lock(g_vhdlMutex);
365 if (g_packages.find(cdef)!=g_packages.end()) return;
366 std::vector<ClassDef*> cList;
367 MemberList *mem=cdef->getMemberList(MemberListType::VariableMembers());
368 if (mem)
369 {
370 for (const auto &md : *mem)
371 {
373 {
375 if (cd)
376 {
377 cList.push_back(cd);
379 g_packages.emplace(cdef,cList);
380 }
381 }
382 }//for
383 }
384
385}// findAllPackages

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

Declaration at line 194 of file vhdldocgen.h, definition at line 549 of file vhdldocgen.cpp.

550{
551 QCString nn=cd->name();
552 for (const auto &citer : *Doxygen::classLinkedMap)
553 {
554 QCString jj=citer->name();
555 StringVector ql=split(jj.str(),":");
556 if (ql.size()>1)
557 {
558 if (QCString(ql[0])==nn)
559 {
560 return citer.get();
561 }
562 }
563 }
564 return nullptr;
565}

References Doxygen::classLinkedMap, Definition::name, split and QCString::str.

findFunction()

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

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

Declaration at line 119 of file vhdldocgen.h, definition at line 392 of file vhdldocgen.cpp.

392const MemberDef* VhdlDocGen::findFunction(const QCString& funcname, const QCString& package)
393{
394 ClassDef *cdef=getClass(package);
395 if (cdef==nullptr) return nullptr;
396
397 MemberList *mem=cdef->getMemberList(MemberListType::PubMethods());
398 if (mem)
399 {
400 for (const auto &mdef : *mem)
401 {
402 QCString mname=mdef->name();
403 if ((VhdlDocGen::isProcedure(mdef) || VhdlDocGen::isVhdlFunction(mdef)) && (compareString(funcname,mname)==0))
404 {
405 return mdef;
406 }//if
407 }//for
408 }//if
409 return nullptr;
410} //findFunction

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

Referenced by writeFuncProto.

findKeyWord()

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

returns the color of a keyword

Declaration at line 109 of file vhdldocgen.h, definition at line 180 of file vhdldocgen.cpp.

180const char* VhdlDocGen::findKeyWord(const QCString& kw)
181{
182 std::string word=kw.lower().str();
183
184 if (word.empty()) return nullptr;
185
186 if (g_vhdlKeyWordSet0.find(word)!=g_vhdlKeyWordSet0.end())
187 return "keywordflow";
188
189 if (g_vhdlKeyWordSet1.find(word)!=g_vhdlKeyWordSet1.end())
190 return "keywordtype";
191
192 if (g_vhdlKeyWordSet2.find(word)!=g_vhdlKeyWordSet2.end())
193 return "vhdllogic";
194
195 if (g_vhdlKeyWordSet3.find(word)!=g_vhdlKeyWordSet3.end())
196 return "vhdlkeyword";
197
198 return nullptr;
199}

References g_vhdlKeyWordSet0, g_vhdlKeyWordSet1, g_vhdlKeyWordSet2, g_vhdlKeyWordSet3, QCString::lower and QCString::str.

Referenced by writeColoredWord, writeFormatString, writeFunctionProto and writeProcedureProto.

findMember()

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

Declaration at line 112 of file vhdldocgen.h, definition at line 217 of file vhdldocgen.cpp.

217const MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& memName)
218{
219 std::lock_guard lock(g_vhdlMutex);
220 ClassDef *ecd=nullptr;
221 const MemberDef *mdef=nullptr;
222
223 ClassDef *cd=getClass(className);
224 //printf("VhdlDocGen::findMember(%s,%s)=%p\n",qPrint(className),qPrint(memName),cd);
225 if (cd==nullptr) return nullptr;
226
227 mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType::VariableMembers());
228 if (mdef) return mdef;
229 mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType::PubMethods());
230 if (mdef) return mdef;
231
232 // nothing found so far
233 // if we are an architecture or package body search in entity
234
237 {
238 Definition *d = cd->getOuterScope();
239 // searching upper/lower case names
240
241 QCString tt=d->name();
242 ecd =getClass(tt);
243 if (!ecd)
244 {
245 tt=tt.upper();
246 ecd =getClass(tt);
247 }
248 if (!ecd)
249 {
250 tt=tt.lower();
251 ecd =getClass(tt);
252 }
253
254 if (ecd) //d && d->definitionType()==Definition::TypeClass)
255 {
256 //ClassDef *ecd = (ClassDef*)d;
257 mdef=VhdlDocGen::findMemberDef(ecd,memName,MemberListType::VariableMembers());
258 if (mdef) return mdef;
259 mdef=VhdlDocGen::findMemberDef(cd,memName,MemberListType::PubMethods());
260 if (mdef) return mdef;
261 }
262 }
263
264
267 {
268 Definition *d = cd->getOuterScope();
269
270 QCString tt=d->name();
271 ClassDef *acd =getClass(tt);
272 if (!acd)
273 {
274 tt=tt.upper();
275 acd =getClass(tt);
276 }
277 if (!acd)
278 {
279 tt=tt.lower();
280 acd =getClass(tt);
281 }
282 if (acd) //d && d->definitionType()==Definition::TypeClass)
283 {
284 if(g_packages.find(acd)==g_packages.end())
285 {
287 }
288 }
289 }
290 else
291 {
292 ecd=cd;
293 if (g_packages.find(ecd)==g_packages.end()) VhdlDocGen::findAllPackages(ecd);
294 }
295
296 if (ecd)
297 {
298 auto cList_it = g_packages.find(ecd);
299 if (cList_it!=g_packages.end())
300 {
301 for (const auto &cdp : cList_it->second)
302 {
303 mdef=VhdlDocGen::findMemberDef(cdp,memName,MemberListType::VariableMembers());
304 if (mdef) return mdef;
305 mdef=VhdlDocGen::findMemberDef(cdp,memName,MemberListType::PubMethods());
306 if (mdef) return mdef;
307 }
308 }
309 }
310 return nullptr;
311
312}//findMember

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

Referenced by generateMemLink, startCodeLine, writeStringLink and writeVHDLTypeDocumentation.

findMemberDef()

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

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

Declaration at line 115 of file vhdldocgen.h, definition at line 318 of file vhdldocgen.cpp.

319{
320 std::lock_guard lock(g_vhdlMutex);
321 QCString keyType=cd->symbolName()+"@"+key;
322 //printf("\n %s | %s | %s",qPrint(cd->symbolName()),key.data(,),qPrint(keyType));
323
324 auto it = g_varMap.find(keyType.str());
325 if (it!=g_varMap.end())
326 {
327 return it->second;
328 }
329 if (std::find(g_classList.begin(),g_classList.end(),cd)!=g_classList.end())
330 {
331 return nullptr;
332 }
333 const MemberList *ml=cd->getMemberList(type);
334 g_classList.push_back(cd);
335 if (!ml)
336 {
337 return nullptr;
338 }
339 //int l=ml->count();
340 // fprintf(stderr,"\n loading entity %s %s: %d",qPrint(cd->symbolName()),qPrint(keyType),l);
341
342 for (const auto &md : *ml)
343 {
344 QCString tkey=cd->symbolName()+"@"+md->name();
345 if (g_varMap.find(tkey.str())==g_varMap.end())
346 {
347 g_varMap.emplace(tkey.str(),md);
348 }
349 }
350 it=g_varMap.find(keyType.str());
351 if (it!=g_varMap.end())
352 {
353 return it->second;
354 }
355 return nullptr;
356}//findMemberDef

References g_classList, g_varMap, g_vhdlMutex, ClassDef::getMemberList, QCString::str and Definition::symbolName.

Referenced by findMember.

findVhdlClass()

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

Declaration at line 203 of file vhdldocgen.h, definition at line 2128 of file vhdldocgen.cpp.

2129{
2130 for (const auto &cd : *Doxygen::classLinkedMap)
2131 {
2132 if (qstricmp(className.data(),qPrint(cd->name()))==0)
2133 {
2134 return cd.get();
2135 }
2136 }
2137 return nullptr;
2138}

References Doxygen::classLinkedMap, QCString::data, qPrint and qstricmp.

Referenced by computeVhdlComponentRelations.

formatString()

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

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

Declaration at line 157 of file vhdldocgen.h, definition at line 851 of file vhdldocgen.cpp.

852{
853 QCString qcs = s;
854 QCString temp;
855 qcs.stripPrefix(":");
856 qcs.stripPrefix("is");
857 qcs.stripPrefix("IS");
858 qcs.stripPrefix("of");
859 qcs.stripPrefix("OF");
860
861 size_t len = qcs.length();
862 size_t index=1;
863
864 for (size_t j=0;j<len;j++)
865 {
866 char c=qcs[j];
867 char b=c;
868 if (j>0) b=qcs[j-1];
869 if (c=='"' || c==',' || c=='\''|| c=='(' || c==')' || c==':' || c=='[' || c==']' ) // || (c==':' && b!='=')) // || (c=='=' && b!='>'))
870 {
871 if (temp.length()>=index && temp.at(index-1) != ' ')
872 {
873 temp+=" ";
874 }
875 temp+=c;
876 temp+=" ";
877 }
878 else if (c=='=')
879 {
880 if (b==':') // := operator
881 {
882 temp.replace(index-1,1,"=");
883 temp+=" ";
884 }
885 else // = operator
886 {
887 temp+=" ";
888 temp+=c;
889 temp+=" ";
890 }
891 }
892 else
893 {
894 temp+=c;
895 }
896
897 index=temp.length();
898 }// for
899 temp=temp.stripWhiteSpace();
900 // printf("\n [%s]",qPrint(qcs));
902}

References QCString::at, QCString::length, QCString::replace, QCString::stripPrefix, QCString::stripWhiteSpace and writeFormatString.

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

getClass()

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

Declaration at line 118 of file vhdldocgen.h, definition at line 201 of file vhdldocgen.cpp.

202{
203 if (name.isEmpty()) return nullptr;
205}

References Doxygen::classLinkedMap, QCString::isEmpty and stripWhiteSpace.

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

getClassName()

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

Declaration at line 188 of file vhdldocgen.h, definition at line 446 of file vhdldocgen.cpp.

447{
448 QCString temp;
449 if (cd==nullptr) return "";
450
452 {
453 temp=cd->name();
454 temp.stripPrefix("_");
455 return temp;
456 }
457
458 return substitute(cd->className(),"::",".");
459}

References ClassDef::className, convert, Definition::name, PACKBODYCLASS, ClassDef::protection, QCString::stripPrefix and substitute.

Referenced by getClassTitle, makeDisplayName and writeClassType.

getClassTitle()

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

returns the class title+ref

Declaration at line 121 of file vhdldocgen.h, definition at line 434 of file vhdldocgen.cpp.

435{
436 QCString pageTitle;
437 if (cd==nullptr) return "";
438 pageTitle=VhdlDocGen::getClassName(cd);
439 pageTitle+=" ";
441 return pageTitle;
442} // getClassTitle

References getClassName, getSpecifierTypeFromClass, theTranslator_vhdlType and TRUE.

Referenced by ClassDefImpl::title.

getFlowMember()

getIndexWord()

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

Declaration at line 98 of file vhdldocgen.h, definition at line 684 of file vhdldocgen.cpp.

685{
686 static const reg::Ex reg(R"([\s:|])");
687 auto ql=split(c.str(),reg);
688
689 if (index < static_cast<int>(ql.size()))
690 {
691 return QCString(ql[index]);
692 }
693
694 return "";
695}

References split and QCString::str.

Referenced by computeVhdlComponentRelations and parseFuncProto.

getPackageName()

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

Declaration at line 111 of file vhdldocgen.h, definition at line 207 of file vhdldocgen.cpp.

208{
209 return getClass(name);
210}

Reference getClass.

Referenced by findAllPackages.

getProcessNumber()

QCString VhdlDocGen::getProcessNumber ()
static

returns the next number of an anonymous process

Declaration at line 185 of file vhdldocgen.h, definition at line 756 of file vhdldocgen.cpp.

757{
758 static int stringCounter;
759 QCString qcs("PROCESS_");
760 char buf[8];
761 qsnprintf(buf,8,"%d",stringCounter++);
762 qcs.append(&buf[0]);
763 return qcs;
764}

References QCString::append and qsnprintf.

getProtectionName()

QCString VhdlDocGen::getProtectionName (int prot)
static

Declaration at line 190 of file vhdldocgen.h, definition at line 698 of file vhdldocgen.cpp.

699{
701 return "entity";
702 else if (prot==VhdlDocGen::ARCHITECTURECLASS)
703 return "architecture";
704 else if (prot==VhdlDocGen::PACKAGECLASS)
705 return "package";
706 else if (prot==VhdlDocGen::PACKBODYCLASS)
707 return "package body";
708
709 return "";
710}

References ARCHITECTURECLASS, ENTITYCLASS, PACKAGECLASS and PACKBODYCLASS.

Referenced by writeAnnotatedClassList and ClassDefImpl::writeDeclarationLink.

getRecordNumber()

QCString VhdlDocGen::getRecordNumber ()
static

returns the next number of a record|unit member

Declaration at line 186 of file vhdldocgen.h, definition at line 744 of file vhdldocgen.cpp.

745{
746 char buf[12];
747 qsnprintf(buf,12,"%d",recordCounter++);
748 QCString qcs(&buf[0]);
749 return qcs;
750}

References qsnprintf and recordCounter.

Referenced by VHDLOutlineParser::checkInlineCode and initUCF.

init()

void VhdlDocGen::init ()
static

Declaration at line 92 of file vhdldocgen.h, definition at line 173 of file vhdldocgen.cpp.

174{
175}

Referenced by VHDLCodeParser::parseCode.

isAlias()

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

Declaration at line 128 of file vhdldocgen.h, definition at line 2446 of file vhdldocgen.cpp.

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

References ALIAS and MemberDef::getVhdlSpecifiers.

Referenced by writeTagFile.

isArchitecture()

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

Declaration at line 145 of file vhdldocgen.h, definition at line 2480 of file vhdldocgen.cpp.

References ARCHITECTURE and MemberDef::getVhdlSpecifiers.

isAttribute()

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

Declaration at line 141 of file vhdldocgen.h, definition at line 2472 of file vhdldocgen.cpp.

References ATTRIBUTE and MemberDef::getVhdlSpecifiers.

Referenced by writeTagFile.

isCompInst()

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

Declaration at line 151 of file vhdldocgen.h, definition at line 2492 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and INSTANTIATION.

Referenced by writeTagFile and writeVHDLDeclaration.

isComponent()

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

Declaration at line 132 of file vhdldocgen.h, definition at line 2454 of file vhdldocgen.cpp.

References COMPONENT and MemberDef::getVhdlSpecifiers.

Referenced by writeTagFile and writeVHDLDeclaration.

isConfig()

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

Declaration at line 127 of file vhdldocgen.h, definition at line 2444 of file vhdldocgen.cpp.

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

References CONFIG and MemberDef::getVhdlSpecifiers.

Referenced by writeVHDLDeclaration.

isConstant()

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

Declaration at line 135 of file vhdldocgen.h, definition at line 2460 of file vhdldocgen.cpp.

References CONSTANT and MemberDef::getVhdlSpecifiers.

Referenced by writeTagFile.

isConstraint()

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

Declaration at line 126 of file vhdldocgen.h, definition at line 2442 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and UCF_CONST.

Referenced by writeVHDLTypeDocumentation.

isEntity()

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

Declaration at line 134 of file vhdldocgen.h, definition at line 2458 of file vhdldocgen.cpp.

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

References ENTITY and MemberDef::getVhdlSpecifiers.

Referenced by writeTagFile.

isFile()

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

Declaration at line 149 of file vhdldocgen.h, definition at line 2488 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and VFILE.

Referenced by writeTagFile.

isGeneric()

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

Declaration at line 130 of file vhdldocgen.h, definition at line 2450 of file vhdldocgen.cpp.

References GENERIC and MemberDef::getVhdlSpecifiers.

Referenced by writeTagFile and writeVHDLTypeDocumentation.

isGroup()

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

Declaration at line 150 of file vhdldocgen.h, definition at line 2490 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and GROUP.

Referenced by writeTagFile.

isLibrary()

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

Declaration at line 129 of file vhdldocgen.h, definition at line 2448 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and LIBRARY.

Referenced by writeTagFile and writeVHDLTypeDocumentation.

isMisc()

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

Declaration at line 152 of file vhdldocgen.h, definition at line 2494 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and MISCELLANEOUS.

Referenced by MemberDefImpl::writeDocumentation.

isNumber()

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

returns TRUE if this string is a number

Declaration at line 189 of file vhdldocgen.h, definition at line 839 of file vhdldocgen.cpp.

839bool VhdlDocGen::isNumber(const std::string& s)
840{
841 static const reg::Ex regg(R"([0-9][0-9eEfFbBcCdDaA_.#+?xXzZ-]*)");
842 return reg::match(s,regg);
843}// isNumber

Reference reg::match.

Referenced by checkVhdlString, writeFormatString and writeWord.

isPackage()

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

Declaration at line 133 of file vhdldocgen.h, definition at line 2456 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and USE.

Referenced by findAllPackages, writeTagFile and writeVHDLTypeDocumentation.

isPackageBody()

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

Declaration at line 147 of file vhdldocgen.h, definition at line 2484 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and PACKAGE_BODY.

isPort()

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

Declaration at line 131 of file vhdldocgen.h, definition at line 2452 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and PORT.

Referenced by writeTagFile and writeVHDLTypeDocumentation.

isProcedure()

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

Declaration at line 143 of file vhdldocgen.h, definition at line 2476 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and PROCEDURE.

Referenced by findFunction, writeFuncProcDocu, writeTagFile and writeVHDLTypeDocumentation.

isProcess()

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

Declaration at line 139 of file vhdldocgen.h, definition at line 2468 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and PROCESS.

Referenced by writeFuncProcDocu, writeTagFile and writeVHDLTypeDocumentation.

isRecord()

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

Declaration at line 144 of file vhdldocgen.h, definition at line 2478 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and RECORD.

Referenced by writeTagFile.

isSignal()

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

Declaration at line 140 of file vhdldocgen.h, definition at line 2470 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and SIGNAL.

isSignals()

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

Declaration at line 142 of file vhdldocgen.h, definition at line 2474 of file vhdldocgen.cpp.

2475{ 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

Declaration at line 96 of file vhdldocgen.h, definition at line 2322 of file vhdldocgen.cpp.

2322bool VhdlDocGen::isSubClass(ClassDef* cd,ClassDef *scd, bool followInstances,int level)
2323{
2324 bool found=FALSE;
2325 //printf("isBaseClass(cd=%s) looking for %s\n",qPrint(name()),qPrint(bcd->name()));
2326 if (level>255)
2327 {
2328 err("Possible recursive class relation while inside {} and looking for {}\n",cd->name(),scd->name());
2329 abort();
2330 }
2331
2332 for (const auto &bcd :cd->subClasses())
2333 {
2334 const ClassDef *ccd=bcd.classDef;
2335 if (!followInstances && ccd->templateMaster()) ccd=ccd->templateMaster();
2336 //printf("isSubClass() subclass %s\n",qPrint(ccd->name()));
2337 if (ccd==scd)
2338 {
2339 found=true;
2340 }
2341 else
2342 {
2343 if (level <256)
2344 {
2345 level = ccd->isBaseClass(scd,followInstances);
2346 if (level>0)
2347 {
2348 found=true;
2349 }
2350 }
2351 }
2352 }
2353 return found;
2354}

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

Referenced by addInstance.

isSubType()

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

Declaration at line 137 of file vhdldocgen.h, definition at line 2464 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and SUBTYPE.

Referenced by writeTagFile.

isUnit()

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

Declaration at line 146 of file vhdldocgen.h, definition at line 2482 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and UNITS.

isVariable()

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

Declaration at line 148 of file vhdldocgen.h, definition at line 2486 of file vhdldocgen.cpp.

References MemberDef::getVhdlSpecifiers and SHAREDVARIABLE.

Referenced by writeTagFile.

isVhdlClass()

bool VhdlDocGen::isVhdlClass (const Entry * cu)
inline static

Definition at line 212 of file vhdldocgen.h.

212 static bool isVhdlClass (const Entry *cu)
213 {
214 return cu->vhdlSpec==VhdlSpecifier::ENTITY ||
218 }

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

Referenced by VHDLOutlineParser::mapLibPackage.

isVhdlFunction()

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

Declaration at line 138 of file vhdldocgen.h, definition at line 2466 of file vhdldocgen.cpp.

References FUNCTION and MemberDef::getVhdlSpecifiers.

Referenced by findFunction, writeFuncProcDocu, writeTagFile and writeVHDLTypeDocumentation.

isVType()

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

Declaration at line 136 of file vhdldocgen.h, definition at line 2462 of file vhdldocgen.cpp.

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

References MemberDef::getVhdlSpecifiers and TYPE.

Referenced by writeTagFile.

parseForBinding()

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

Declaration at line 201 of file vhdldocgen.h, definition at line 2094 of file vhdldocgen.cpp.

2095{
2096 static const reg::Ex exp(R"([()\s])");
2097
2098 auto ql = split(entity.str(),exp);
2099
2100 if (findIndex(ql,"open")!=-1)
2101 {
2102 return "open";
2103 }
2104
2105 if (ql.size()<2)
2106 {
2107 return "";
2108 }
2109
2110 std::string label=ql[0];
2111 entity = ql[1];
2112 int index=entity.findRev(".");
2113 if (index!=-1)
2114 {
2115 entity.remove(0,index+1);
2116 }
2117
2118 if (ql.size()==3)
2119 {
2120 arch=ql[2];
2121 }
2122 return QCString(label);
2123}

References findIndex, QCString::findRev, QCString::remove, split and QCString::str.

Referenced by computeVhdlComponentRelations.

parseForConfig()

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

Declaration at line 200 of file vhdldocgen.h, definition at line 2062 of file vhdldocgen.cpp.

2063{
2064 if (!entity.contains(":")) return "";
2065
2066 static const reg::Ex exp(R"([:()\s])");
2067 auto ql=split(entity.str(),exp);
2068 if (ql.size()<2)
2069 {
2070 return "";
2071 }
2072 QCString label(ql[0]);
2073 entity = ql[1];
2074 int index = entity.findRev(".");
2075 if (index!=-1)
2076 {
2077 entity.remove(0,index+1);
2078 }
2079
2080 if (ql.size()==3)
2081 {
2082 arch = ql[2];
2083 ql=split(arch.str(),exp);
2084 if (ql.size()>1) // expression
2085 {
2086 arch="";
2087 }
2088 }
2089 return label; // label
2090}

References QCString::contains, QCString::findRev, QCString::remove, split and QCString::str.

parseFuncProto()

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

parses a function proto

Parameters
text

function string

name

points to the function name

ret

Stores the return type

doc

???

Declaration at line 101 of file vhdldocgen.h, definition at line 634 of file vhdldocgen.cpp.

634void VhdlDocGen::parseFuncProto(const QCString &text,QCString& name,QCString& ret,bool doc)
635{
636 QCString s1(text);
637 QCString temp;
638
639 int index=s1.find("(");
640 if (index<0) index=0;
641 int end=s1.findRev(")");
642
643 if ((end-index)>0)
644 {
645 temp=s1.mid(index+1,(end-index-1));
646 //getFuncParams(qlist,temp);
647 }
648 if (doc)
649 {
650 name=s1.left(index);
651 name=name.stripWhiteSpace();
652 if ((end-index)>0)
653 {
654 ret="function";
655 }
656 return;
657 }
658 else
659 {
660 s1=s1.stripWhiteSpace();
661 int i=s1.find('(');
662 int s=s1.find(' ');
663 if (s==-1) s=s1.find('\t');
664 if (i==-1 || i<s)
666 else // s<i, s=start of name, i=end of name
667 s1=s1.mid(s,(i-s));
668
669 name=s1.stripWhiteSpace();
670 }
671 index=s1.findRev("return",-1,FALSE);
672 if (index !=-1)
673 {
674 ret=s1.mid(index+6,s1.length());
675 ret=ret.stripWhiteSpace();
677 }
678}

References deleteCharRev, end, FALSE, QCString::find, QCString::findRev, getIndexWord, QCString::left, QCString::length, QCString::mid and QCString::stripWhiteSpace.

Referenced by writeFuncProto.

parseUCF()

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

Declaration at line 192 of file vhdldocgen.h, definition at line 1920 of file vhdldocgen.cpp.

1920void VhdlDocGen::parseUCF(const QCString &input,Entry* entity,const QCString &fileName,bool altera)
1921{
1922 QCString ucFile(input);
1923 int lineNo=0;
1924 QCString comment("#!");
1925 QCString brief;
1926
1927 while (!ucFile.isEmpty())
1928 {
1929 int i=ucFile.find("\n");
1930 if (i<0) break;
1931 lineNo++;
1932 QCString temp=ucFile.left(i);
1933 temp=temp.stripWhiteSpace();
1934 bool bb=temp.stripPrefix("//");
1935
1936 if (!temp.isEmpty())
1937 {
1938 if (temp.stripPrefix(comment) )
1939 {
1940 brief+=temp;
1941 brief.append("\\n");
1942 }
1943 else if (!temp.stripPrefix("#") && !bb)
1944 {
1945 if (altera)
1946 {
1947 int in=temp.find("-name");
1948 if (in>0)
1949 {
1950 temp=temp.remove(0,in+5);
1951 }
1952
1953 temp.stripPrefix("set_location_assignment");
1954
1955 initUCF(entity,QCString(),temp,lineNo,fileName,brief);
1956 }
1957 else
1958 {
1959 static const reg::Ex ee(R"([\s=])");
1960 int in=findIndex(temp.str(),ee);
1961 if (in<0) in=0;
1962 QCString ff=temp.left(in);
1963 temp.stripPrefix(ff);
1964 ff.append("#");
1965 if (!temp.isEmpty())
1966 {
1967 initUCF(entity,ff,temp,lineNo,fileName,brief);
1968 }
1969 }
1970 }
1971 }//temp
1972
1973 ucFile=ucFile.remove(0,i+1);
1974 }// while
1975}

References QCString::append, comment, QCString::find, findIndex, initUCF, QCString::isEmpty, QCString::left, QCString::remove, QCString::str, QCString::stripPrefix and QCString::stripWhiteSpace.

Referenced by VHDLOutlineParser::parseInput.

prepareComment()

void VhdlDocGen::prepareComment (QCString & qcs)
static

strips the "--!" prefixes of vhdl comments

Declaration at line 156 of file vhdldocgen.h, definition at line 594 of file vhdldocgen.cpp.

595{
596 qcs=qcs.stripWhiteSpace();
597 if (qcs.isEmpty()) return;
598
599 const char* sc="--!";
600 if (qcs.startsWith(sc)) qcs = qcs.mid(qstrlen(sc));
601 static const reg::Ex re(R"(\n[ \t]*--!)");
602 std::string s = qcs.str();
603 reg::Iterator iter(s,re);
605 std::string result;
606 size_t p=0;
607 size_t sl=s.length();
608 for ( ; iter!=end ; ++iter)
609 {
610 const auto &match = *iter;
611 size_t i = match.position();
612 result+="\n";
613 result+=s.substr(p,i-p);
614 p = match.position()+match.length();
615 }
616 if (p<sl)
617 {
618 result+="\n";
619 result+=s.substr(p);
620 }
621
622 qcs = result;
623 qcs=qcs.stripWhiteSpace();
624}

References end, QCString::isEmpty, QCString::mid, qstrlen, QCString::startsWith, QCString::str and QCString::stripWhiteSpace.

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

resetCodeVhdlParserState()

void VhdlDocGen::resetCodeVhdlParserState ()
static

Declaration at line 220 of file vhdldocgen.h, definition at line 2434 of file vhdldocgen.cpp.

2435{
2436 std::lock_guard lock(g_vhdlMutex);
2437 g_varMap.clear();
2438 g_classList.clear();
2439 g_packages.clear();
2440}

References g_classList, g_packages, g_varMap and g_vhdlMutex.

setFlowMember()

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

Declaration at line 209 of file vhdldocgen.h, definition at line 77 of file vhdldocgen.cpp.

78{
79 flowMember=mem;
80}

Reference flowMember.

Referenced by createFlowChart.

writeClassType()

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

Declaration at line 182 of file vhdldocgen.h, definition at line 1799 of file vhdldocgen.cpp.

1800 OutputList &ol ,QCString & cname)
1801{
1803 cname=VhdlDocGen::getClassName(cd);
1804 ol.startBold();
1805 ol.writeString(qcs);
1806 ol.writeString(" ");
1807 ol.endBold();
1808 //ol.insertMemberAlign();
1809 return FALSE;
1810}// writeClassLink

References OutputList::endBold, FALSE, getClassName, getSpecifierTypeFromClass, OutputList::startBold, theTranslator, TRUE and OutputList::writeString.

writeFormatString()

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

writes a colored and formatted string

Declaration at line 159 of file vhdldocgen.h, definition at line 770 of file vhdldocgen.cpp.

771{
772 static const reg::Ex reg(R"([\[\]./<>:\s,;'+*|&=()\"-])");
773 QCString qcs = s;
774 qcs+=QCString(" ");// parsing the last sign
775 QCString find=qcs;
776 QCString temp=qcs;
777 char buf[2];
778 buf[1]='\0';
779
780 int j = findIndex(temp.str(),reg);
781
782 ol.startBold();
783 if (j>=0)
784 {
785 while (j>=0)
786 {
787 find=find.left(j);
788 buf[0]=temp[j];
789 const char *ss=VhdlDocGen::findKeyWord(find);
790 bool k=isNumber(find.str()); // is this a number
791 if (k)
792 {
793 ol.docify(" ");
794 startFonts(find,"vhdldigit",ol);
795 ol.docify(" ");
796 }
797 else if (j != 0 && ss)
798 {
799 startFonts(find,ss,ol);
800 }
801 else
802 {
803 if (j>0)
804 {
805 VhdlDocGen::writeStringLink(mdef,find,ol);
806 }
807 }
808 startFonts(&buf[0],"vhdlchar",ol);
809
810 QCString st=temp.remove(0,j+1);
811 find=st;
812 if (!find.isEmpty() && find.at(0)=='"')
813 {
814 int ii=find.find('"',2);
815 if (ii>1)
816 {
817 QCString com=find.left(ii+1);
818 startFonts(com,"keyword",ol);
819 temp=find.remove(0,ii+1);
820 }
821 }
822 else
823 {
824 temp=st;
825 }
826 j = findIndex(temp.str(),reg);
827 }//while
828 }//if
829 else
830 {
831 startFonts(find,"vhdlchar",ol);
832 }
833 ol.endBold();
834}// writeFormatString

References QCString::at, OutputList::docify, OutputList::endBold, QCString::find, findIndex, findKeyWord, QCString::isEmpty, isNumber, QCString::left, QCString::remove, OutputList::startBold, startFonts, QCString::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

Declaration at line 163 of file vhdldocgen.h, definition at line 1067 of file vhdldocgen.cpp.

1068 const MemberDef *md,
1069 OutputList& ol,
1070 const ArgumentList &al,
1071 bool /*type*/)
1072{
1073 //bool sem=FALSE;
1074 ol.enableAll();
1075
1076 size_t index=al.size();
1077 if (index==0)
1078 {
1079 ol.docify(" ( ) ");
1080 return FALSE;
1081 }
1082 ol.endMemberDocName();
1084 //ol.startParameterName(FALSE);
1085 bool first=TRUE;
1086 for (const Argument &arg : al)
1087 {
1088 ol.startParameterType(first,"");
1089 // if (first) ol.writeChar('(');
1090 QCString attl=arg.defval;
1091
1092 //bool bGen=attl.stripPrefix("generic");
1093 //if (bGen)
1094 // VhdlDocGen::writeFormatString(QCString("generic "),ol,md);
1095
1096
1098 {
1099 startFonts(arg.defval,"keywordtype",ol);
1100 ol.docify(" ");
1101 }
1102 ol.endParameterType();
1103
1105 VhdlDocGen::writeFormatString(arg.name,ol,md);
1106
1108 {
1109 startFonts(arg.attrib,"stringliteral",ol);
1110 }
1111 else if (VhdlDocGen::isVhdlFunction(md))
1112 {
1113 startFonts(QCString("in"),"stringliteral",ol);
1114 }
1115
1116 ol.docify(" ");
1118 ol.startEmphasis();
1120 if (!VhdlDocGen::isProcess(md))
1121 {
1122 // startFonts(arg.type,"vhdlkeyword",ol);
1123 VhdlDocGen::writeFormatString(arg.type,ol,md);
1124 }
1126 ol.endEmphasis();
1128
1129 if (--index)
1130 {
1131 ol.docify(" , ");
1132 }
1133 else
1134 {
1135 // ol.docify(" ) ");
1136 ol.endParameterName();
1138 ol.endParameterExtra(true,false,true);
1139 break;
1140 }
1141 ol.endParameterName();
1143 ol.endParameterExtra(false,false,false);
1144
1145 //sem=TRUE;
1146 first=FALSE;
1147 }
1148 //ol.endParameterList();
1149 return TRUE;
1150
1151} // writeDocFunProc

References OutputList::disable, OutputList::docify, OutputList::enable, OutputList::enableAll, OutputList::endEmphasis, OutputList::endMemberDocName, OutputList::endParameterExtra, OutputList::endParameterName, OutputList::endParameterType, FALSE, isProcedure, isProcess, isVhdlFunction, Man, ArgumentList::size, OutputList::startEmphasis, startFonts, OutputList::startParameterExtra, OutputList::startParameterList, OutputList::startParameterName, OutputList::startParameterType, TRUE 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

Declaration at line 160 of file vhdldocgen.h, definition at line 963 of file vhdldocgen.cpp.

964{
965 if (!al.hasParameters()) return;
966 bool sem=FALSE;
967 size_t len=al.size();
968 ol.startBold();
969 ol.docify(" ( ");
970 ol.endBold();
971 if (len>2)
972 {
973 ol.lineBreak();
974 }
975 for (const Argument &arg : al)
976 {
977 ol.startBold();
978 QCString att=arg.defval;
979 bool bGen=att.stripPrefix("generic");
980
981 if (sem && len < 3)
982 {
983 ol.docify(" , ");
984 }
985
986 if (bGen)
987 {
988 VhdlDocGen::formatString(QCString("generic "),ol,mdef);
989 }
990 if (!att.isEmpty())
991 {
992 const char *str=VhdlDocGen::findKeyWord(att);
993 att+=" ";
994 if (str)
995 VhdlDocGen::formatString(att,ol,mdef);
996 else
997 startFonts(att,"vhdlchar",ol);
998 }
999
1000 QCString nn=arg.name;
1001 nn+=": ";
1002 QCString ss=arg.type.stripWhiteSpace(); //.lower();
1003 QCString w=ss.stripWhiteSpace();//.upper();
1004 startFonts(nn,"vhdlchar",ol);
1005 startFonts("in ","stringliteral",ol);
1006 const char *str=VhdlDocGen::findKeyWord(ss);
1007 if (str)
1008 VhdlDocGen::formatString(w,ol,mdef);
1009 else
1010 startFonts(w,"vhdlchar",ol);
1011
1012 if (!arg.attrib.isEmpty())
1013 startFonts(arg.attrib,"vhdlchar",ol);
1014
1015 sem=TRUE;
1016 ol.endBold();
1017 if (len > 2)
1018 {
1019 ol.lineBreak();
1020 }
1021 }
1022 ol.startBold();
1023 ol.docify(" )");
1024 QCString exp=mdef->excpString();
1025 if (!exp.isEmpty())
1026 {
1028 ol.startBold();
1029 ol.docify("[ ");
1030 ol.docify(exp);
1031 ol.docify(" ]");
1032 ol.endBold();
1033 }
1034 ol.endBold();
1035}

References OutputList::docify, OutputList::endBold, MemberDef::excpString, FALSE, findKeyWord, formatString, ArgumentList::hasParameters, OutputList::insertMemberAlign, QCString::isEmpty, OutputList::lineBreak, ArgumentList::size, OutputList::startBold, startFonts, QCString::stripPrefix, QCString::stripWhiteSpace and TRUE.

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

Declaration at line 122 of file vhdldocgen.h, definition at line 465 of file vhdldocgen.cpp.

466{
467 std::vector<QCString> ql;
468 QCString nn=cd->className();
470
472
473 //type=type.lower();
474 type+=" >> ";
477
479 {
480 nn.stripPrefix("_");
481 cd=getClass(nn);
482 }
483 else if (ii==VhdlDocGen::PACKAGECLASS)
484 {
485 nn.prepend("_");
486 cd=getClass(nn);
487 }
489 {
490 StringVector qlist=split(nn.str(),"-");
491 if (qlist.size()>1)
492 {
493 nn=qlist[1];
495 }
496 }
497
498 QCString opp;
500 {
502 for (const auto &s : ql)
503 {
504 StringVector qlist=split(s.str(),"-");
505 if (qlist.size()>2)
506 {
507 QCString s1(qlist[0]);
508 QCString s2(qlist[1]);
509 s1.stripPrefix("_");
510 if (ql.size()==1) s1.clear();
511 ClassDef *cc = getClass(s);
512 if (cc)
513 {
514 VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
515 }
516 }
517 }
518 }
519 else
520 {
521 VhdlDocGen::writeVhdlLink(cd,ol,type,nn,opp);
522 }
523
526
527}// write

References ARCHITECTURECLASS, ClassDef::className, QCString::clear, convert, OutputList::disable, OutputList::enable, ENTITYCLASS, findAllArchitectures, getClass, getSpecifierTypeFromClass, Man, PACKAGECLASS, PACKBODYCLASS, QCString::prepend, ClassDef::protection, RTF, split, QCString::str, QCString::stripPrefix, theTranslator_vhdlType, TRUE 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

Declaration at line 174 of file vhdldocgen.h, definition at line 1691 of file vhdldocgen.cpp.

1692 const MemberList* mlist,OutputList &ol,
1693 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
1694 VhdlSpecifier specifier)
1695{
1696
1697 StringSet pack;
1698
1699 bool first=TRUE;
1700 for (const auto &imd : *mlist)
1701 {
1703 if (md)
1704 {
1706 if (md->isBriefSectionVisible() && (mems==specifier) && (mems!=VhdlSpecifier::LIBRARY) )
1707 {
1708 if (first) { ol.startMemberList();first=FALSE; }
1709 VhdlDocGen::writeVHDLDeclaration(md,ol,cd,nd,fd,gd,mod,FALSE);
1710 } //if
1711 else if (md->isBriefSectionVisible() && (mems==specifier))
1712 {
1713 if (pack.find(md->name().str())==pack.end())
1714 {
1715 if (first) ol.startMemberList(),first=FALSE;
1716 VhdlDocGen::writeVHDLDeclaration(md,ol,cd,nd,fd,gd,mod,FALSE);
1717 pack.insert(md->name().str());
1718 }
1719 } //if
1720 } //if
1721 } //for
1722 if (!first) ol.endMemberList();
1723}//plainDeclaration

References OutputList::endMemberList, FALSE, MemberDef::getVhdlSpecifiers, MemberDef::isBriefSectionVisible, LIBRARY, Definition::name, OutputList::startMemberList, QCString::str, toMemberDefMutable, TRUE 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

Declaration at line 162 of file vhdldocgen.h, definition at line 908 of file vhdldocgen.cpp.

909{
910 bool sem=FALSE;
911 size_t len=al.size();
912 ol.docify("( ");
913 if (len > 2)
914 {
915 ol.lineBreak();
916 }
917 for (const Argument &arg : al)
918 {
919 ol.startBold();
920 if (sem && len <3)
921 ol.writeChar(',');
922
923 QCString nn=arg.name;
924 nn+=": ";
925
926 QCString defval = arg.defval;
927 const char *str=VhdlDocGen::findKeyWord(defval);
928 defval+=" ";
929 if (str)
930 {
931 startFonts(defval,str,ol);
932 }
933 else
934 {
935 startFonts(defval,"vhdlchar",ol); // write type (variable,constant etc.)
936 }
937
938 startFonts(nn,"vhdlchar",ol); // write name
939 if (qstricmp(arg.attrib,arg.type) != 0)
940 {
941 startFonts(arg.attrib.lower(),"stringliteral",ol); // write in|out
942 }
943 ol.docify(" ");
944 VhdlDocGen::formatString(arg.type,ol,mdef);
945 sem=TRUE;
946 ol.endBold();
947 if (len > 2)
948 {
949 ol.lineBreak();
950 ol.docify(" ");
951 }
952 }//for
953
954 ol.docify(" )");
955
956
957}

References OutputList::docify, OutputList::endBold, FALSE, findKeyWord, formatString, OutputList::lineBreak, qstricmp, ArgumentList::size, OutputList::startBold, startFonts, TRUE 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

Declaration at line 161 of file vhdldocgen.h, definition at line 1041 of file vhdldocgen.cpp.

1042{
1043 if (!al.hasParameters()) return;
1044 bool sem=FALSE;
1045 ol.startBold();
1046 ol.docify(" ( ");
1047 for (const Argument &arg : al)
1048 {
1049 if (sem)
1050 {
1051 ol.docify(" , ");
1052 }
1053 QCString nn=arg.name;
1054 // startFonts(nn,"vhdlchar",ol);
1056 sem=TRUE;
1057 }
1058 ol.docify(" )");
1059 ol.endBold();
1060}

References OutputList::docify, OutputList::endBold, FALSE, ArgumentList::hasParameters, OutputList::startBold, TRUE and writeFormatString.

Referenced by writeVHDLDeclaration.

writeRecordProto()

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

Definition at line 164 of file vhdldocgen.h.

Reference flowMember.

writeSource()

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

Declaration at line 198 of file vhdldocgen.h, definition at line 1839 of file vhdldocgen.cpp.

1839void VhdlDocGen::writeSource(const MemberDef* mdef,OutputList& ol,const QCString &cname)
1840{
1841 auto intf = Doxygen::parserManager->getCodeParser(".vhd");
1842 // pIntf->resetCodeParserState();
1843
1844 QCString codeFragment=mdef->documentation();
1845
1846 if (cname.isEmpty())
1847 {
1848 writeLink(mdef,ol);
1849 int fi=0;
1850 int j=0;
1851 do
1852 {
1853 fi=codeFragment.find("\n",++fi);
1854 } while(fi>=0 && j++ <3);
1855
1856 // show only the first four lines
1857 if (j==4)
1858 {
1859 codeFragment=codeFragment.left(fi);
1860 codeFragment.append("\n .... ");
1861 }
1862 }
1863
1864 codeFragment.prepend("\n");
1866 auto &codeOL = ol.codeGenerators();
1867 codeOL.startCodeFragment("DoxyCode");
1868 intf->parseCode( codeOL, // codeOutIntf
1869 QCString(), // scope
1870 codeFragment, // input
1871 SrcLangExt::VHDL, // lang
1872 Config_getBool(STRIP_CODE_COMMENTS),
1873 FALSE, // isExample
1874 QCString(), // exampleName
1875 mdef->getFileDef(), // fileDef
1876 mdef->getStartBodyLine(), // startLine
1877 mdef->getEndBodyLine(), // endLine
1878 TRUE, // inlineFragment
1879 mdef, // memberDef
1880 TRUE // show line numbers
1881 );
1882
1883 codeOL.endCodeFragment("DoxyCode");
1885
1886 if (cname.isEmpty()) return;
1887
1888 MemberDefMutable *mdm = toMemberDefMutable(const_cast<MemberDef*>(mdef));
1889 if (mdm)
1890 {
1891 mdm->writeSourceDef(ol);
1892 if (mdef->hasReferencesRelation()) mdm->writeSourceRefs(ol,cname);
1893 if (mdef->hasReferencedByRelation()) mdm->writeSourceReffedBy(ol,cname);
1894 }
1895}

References QCString::append, OutputList::codeGenerators, Config_getBool, Definition::documentation, FALSE, QCString::find, Definition::getEndBodyLine, MemberDef::getFileDef, Definition::getStartBodyLine, MemberDef::hasReferencedByRelation, MemberDef::hasReferencesRelation, QCString::isEmpty, QCString::left, Doxygen::parserManager, OutputList::popGeneratorState, QCString::prepend, OutputList::pushGeneratorState, OutputCodeList::startCodeFragment, toMemberDefMutable, TRUE, writeLink, DefinitionMutable::writeSourceDef, DefinitionMutable::writeSourceReffedBy and DefinitionMutable::writeSourceRefs.

Referenced by MemberDefImpl::writeDocumentation and writeVHDLDeclaration.

writeTagFile()

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

Declaration at line 124 of file vhdldocgen.h, definition at line 1346 of file vhdldocgen.cpp.

1347{
1348 tagFile << " <member kind=\"";
1349 if (VhdlDocGen::isGeneric(mdef)) tagFile << "generic";
1350 if (VhdlDocGen::isPort(mdef)) tagFile << "port";
1351 if (VhdlDocGen::isEntity(mdef)) tagFile << "entity";
1352 if (VhdlDocGen::isComponent(mdef)) tagFile << "component";
1353 if (VhdlDocGen::isVType(mdef)) tagFile << "type";
1354 if (VhdlDocGen::isConstant(mdef)) tagFile << "constant";
1355 if (VhdlDocGen::isSubType(mdef)) tagFile << "subtype";
1356 if (VhdlDocGen::isVhdlFunction(mdef)) tagFile << "function";
1357 if (VhdlDocGen::isProcedure(mdef)) tagFile << "procedure";
1358 if (VhdlDocGen::isProcess(mdef)) tagFile << "process";
1359 if (VhdlDocGen::isSignals(mdef)) tagFile << "signal";
1360 if (VhdlDocGen::isAttribute(mdef)) tagFile << "attribute";
1361 if (VhdlDocGen::isRecord(mdef)) tagFile << "record";
1362 if (VhdlDocGen::isLibrary(mdef)) tagFile << "library";
1363 if (VhdlDocGen::isPackage(mdef)) tagFile << "package";
1364 if (VhdlDocGen::isVariable(mdef)) tagFile << "shared variable";
1365 if (VhdlDocGen::isFile(mdef)) tagFile << "file";
1366 if (VhdlDocGen::isGroup(mdef)) tagFile << "group";
1367 if (VhdlDocGen::isCompInst(mdef)) tagFile << "instantiation";
1368 if (VhdlDocGen::isAlias(mdef)) tagFile << "alias";
1369 if (VhdlDocGen::isCompInst(mdef)) tagFile << "configuration";
1370
1371 QCString fn = mdef->getOutputFileBase();
1373 tagFile << "\">\n";
1374 tagFile << " <type>" << convertToXML(mdef->typeString()) << "</type>\n";
1375 tagFile << " <name>" << convertToXML(mdef->name()) << "</name>\n";
1376 tagFile << " <anchorfile>" << convertToXML(fn) << "</anchorfile>\n";
1377 tagFile << " <anchor>" << convertToXML(mdef->anchor()) << "</anchor>\n";
1378
1380 tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),TRUE)) << "</arglist>\n";
1381 else if (VhdlDocGen::isProcedure(mdef))
1382 tagFile << " <arglist>" << convertToXML(VhdlDocGen::convertArgumentListToString(mdef->argumentList(),FALSE)) << "</arglist>\n";
1383 else
1384 tagFile << " <arglist>" << convertToXML(mdef->argsString()) << "</arglist>\n";
1385
1386 mdef->writeDocAnchorsToTagFile(tagFile);
1387 tagFile << " </member>\n";
1388}

References addHtmlExtensionIfMissing, Definition::anchor, MemberDef::argsString, MemberDef::argumentList, convertArgumentListToString, convertToXML, FALSE, Definition::getOutputFileBase, isAlias, isAttribute, isCompInst, isComponent, isConstant, isEntity, isFile, isGeneric, isGroup, isLibrary, isPackage, isPort, isProcedure, isProcess, isRecord, isSignals, isSubType, isVariable, isVhdlFunction, isVType, Definition::name, TRUE, 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

Declaration at line 170 of file vhdldocgen.h, definition at line 1392 of file vhdldocgen.cpp.

1393 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
1394 bool /*inGroup*/)
1395{
1396 const Definition *d=nullptr;
1397
1398 ASSERT(cd!=nullptr || nd!=nullptr || fd!=nullptr || gd!=nullptr || mod!=nullptr ||
1401 ); // member should belong to something
1402 if (cd) d=cd;
1403 else if (nd) d=nd;
1404 else if (fd) d=fd;
1405 else if (mod) d=mod;
1406 else if (gd) d=gd;
1407 else d=mdef;
1408
1409 // write search index info
1410 if (Doxygen::searchIndex.enabled())
1411 {
1412 Doxygen::searchIndex.setCurrentDoc(mdef,mdef->anchor(),FALSE);
1413 Doxygen::searchIndex.addWord(mdef->localName(),TRUE);
1415 }
1416
1417 QCString cname = d->name();
1418 QCString cfname = d->getOutputFileBase();
1419
1420 //HtmlHelp *htmlHelp=nullptr;
1421 // bool hasHtmlHelp = Config_getBool(GENERATE_HTML) && Config_getBool(GENERATE_HTMLHELP);
1422 // if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance();
1423
1424 // search for the last anonymous scope in the member type
1425 ClassDef *annoClassDef=mdef->getClassDefOfAnonymousType();
1426
1427 // start a new member declaration
1430 ///printf("startMemberItem for %s\n",qPrint(name()));
1434
1435 ol.startMemberItem( mdef->anchor(), memType );
1436
1437 // If there is no detailed description we need to write the anchor here.
1438 bool detailsVisible = mdef->hasDetailedDescription();
1439 if (!detailsVisible)
1440 {
1441 QCString doxyName=mdef->name();
1442 if (!cname.isEmpty()) doxyName.prepend(cname+"::");
1443 QCString doxyArgs=mdef->argsString();
1444 ol.startDoxyAnchor(cfname,cname,mdef->anchor(),doxyName,doxyArgs);
1445 ol.addLabel(cfname,mdef->anchor());
1446
1450 ol.docify("\n");
1452
1453 }
1454 // *** write type
1455 /*VHDL CHANGE */
1456
1457 QCString ltype(mdef->typeString());
1458 QCString largs(mdef->argsString());
1459
1460 ClassDef *kl=nullptr;
1461 const ArgumentList &al = mdef->argumentList();
1462 QCString nn;
1463 //VhdlDocGen::adjustRecordMember(mdef);
1464 if (gd) gd=nullptr;
1465 switch (mm)
1466 {
1468 VhdlDocGen::writeSource(mdef,ol,nn);
1469 break;
1472 ol.startBold();
1473 VhdlDocGen::formatString(ltype,ol,mdef);
1474 ol.endBold();
1476 ol.docify(" ");
1477
1478 writeLink(mdef,ol);
1481
1484
1485 break;
1487 kl=VhdlDocGen::getClass(mdef->name());
1488 if (kl && (VhdlDocGen::convert(kl->protection())==VhdlDocGen::ENTITYCLASS)) break;
1489 writeLink(mdef,ol);
1491 ol.docify(" ");
1492
1493 if (kl)
1494 {
1495 nn=kl->getOutputFileBase();
1498 ol.docify(" ");
1500 ol.startBold();
1501 ol.docify(name);
1502 name.clear();
1503 ol.endBold();
1504 name+=" <"+mdef->name()+">";
1505 ol.startEmphasis();
1508 }
1509 break;
1511 writeLink(mdef,ol);
1513 if (largs=="context")
1514 {
1515 VhdlDocGen::writeRecordUnit(ltype,largs,ol,mdef);
1516 }
1517
1518 break;
1519
1523
1524 writeLink(mdef,ol);
1525 ol.docify(" ");
1527 {
1529 ol.startBold();
1530 VhdlDocGen::formatString(largs,ol,mdef);
1531 ol.endBold();
1532 }
1533 else
1534 {
1535 ol.insertMemberAlignLeft(memType, false);
1536 ol.docify(" ");
1537 ol.startBold();
1538 VhdlDocGen::formatString(ltype,ol,mdef);
1539 ol.endBold();
1541 ol.docify(" ");
1542 VhdlDocGen::formatString(largs,ol,mdef);
1543 }
1544 break;
1546 writeLink(mdef,ol);
1549 break;
1555 if (VhdlDocGen::isCompInst(mdef) )
1556 {
1557 nn=largs;
1558 if(nn.stripPrefix("function") || nn.stripPrefix("package"))
1559 {
1560 VhdlDocGen::formatString(largs,ol,mdef);
1562 writeLink(mdef,ol);
1563 ol.docify(" ");
1564 VhdlDocGen::formatString(ltype,ol,mdef);
1565 break;
1566 }
1567
1568 largs.prepend("::");
1569 largs.prepend(mdef->name());
1570 ol.writeObjectLink(mdef->getReference(),
1571 cfname,
1572 mdef->anchor(),
1573 mdef->name());
1574 }
1575 else
1576 writeLink(mdef,ol);
1577
1579 ol.docify(" ");
1580 ol.startBold();
1581 ol.docify(ltype);
1582 ol.endBold();
1583 ol.docify(" ");
1584 if (VhdlDocGen::isComponent(mdef) ||
1585 VhdlDocGen::isConfig(mdef) ||
1587 {
1589 {
1590 nn=ltype;
1591 }
1592 else
1593 {
1594 nn=mdef->name();
1595 }
1596 kl=getClass(nn);
1597 if (kl)
1598 {
1599 nn=kl->getOutputFileBase();
1602 ol.startEmphasis();
1603 QCString name("<Entity ");
1605 {
1606 name+=ltype+">";
1607 }
1608 else
1609 {
1610 name+=mdef->name()+"> ";
1611 }
1613 ol.endEmphasis();
1615 }
1616 }
1617 break;
1619 writeUCFLink(mdef,ol);
1620 break;
1629 writeLink(mdef,ol);
1630 ol.docify(" ");
1632 VhdlDocGen::formatString(ltype,ol,mdef);
1633 break;
1636 writeRecordUnit(largs,ltype,ol,mdef);
1637 break;
1638
1639 default: break;
1640 }
1641
1642 bool htmlOn = ol.isEnabled(OutputType::Html);
1643 if (htmlOn && /*Config_getBool(HTML_ALIGN_MEMBERS) &&*/ !ltype.isEmpty())
1644 {
1646 }
1647 if (!ltype.isEmpty()) ol.docify(" ");
1648
1649 if (htmlOn)
1650 {
1652 }
1653
1654 if (!detailsVisible)
1655 {
1656 ol.endDoxyAnchor(cfname,mdef->anchor());
1657 }
1658
1659 ol.endMemberItem(memType);
1660 if (!mdef->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC) /* && !annMemb */)
1661 {
1662 QCString s=mdef->briefDescription();
1664 ol.generateDoc(mdef->briefFile(),mdef->briefLine(),
1665 mdef->getOuterScope()?mdef->getOuterScope():d,
1666 mdef,s,TRUE,FALSE,
1668 if (detailsVisible)
1669 {
1672 ol.docify(" ");
1673 if (mdef->getGroupDef()!=nullptr && gd==nullptr) // forward link to the group
1674 {
1675 ol.startTextLink(mdef->getOutputFileBase(),mdef->anchor());
1676 }
1677 else // local link
1678 {
1679 ol.startTextLink(QCString(),mdef->anchor());
1680 }
1681 ol.endTextLink();
1683 }
1685 }
1686 mdef->warnIfUndocumented();
1687
1688}// end writeVhdlDeclaration

References OutputList::addLabel, ALIAS, Definition::anchor, OutputGenerator::AnonymousStart, MemberDef::argsString, MemberDef::argumentList, ASSERT, ATTRIBUTE, Definition::briefDescription, Definition::briefFile, Definition::briefLine, QCString::clear, COMPONENT, CONFIG, Config_getBool, CONSTANT, convert, OutputList::disable, OutputList::disableAllBut, OutputList::docify, OutputList::enable, OutputList::endBold, OutputList::endDoxyAnchor, OutputList::endEmphasis, OutputList::endMemberDescription, OutputList::endMemberItem, OutputList::endTextLink, ENTITY, ENTITYCLASS, FALSE, 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, QCString::isEmpty, OutputList::isEnabled, Latex, LIBRARY, Definition::localName, Man, MISCELLANEOUS, Definition::name, OutputGenerator::Normal, PACKAGE, OutputList::popGeneratorState, PORT, QCString::prepend, PROCEDURE, PROCESS, ClassDef::protection, OutputList::pushGeneratorState, Definition::qualifiedName, RECORD, Doxygen::searchIndex, SHAREDVARIABLE, SIGNAL, OutputList::startBold, OutputList::startDoxyAnchor, OutputList::startEmphasis, OutputList::startMemberDescription, OutputList::startMemberItem, OutputList::startTextLink, QCString::stripPrefix, SUBTYPE, OutputGenerator::Templated, theTranslator_vhdlType, TRUE, 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 GroupDef * gd, const ClassDef * cd, const FileDef * fd, const NamespaceDef * nd, const ModuleDef * mod)
static

Declaration at line 168 of file vhdldocgen.h, definition at line 1183 of file vhdldocgen.cpp.

1184 OutputList& ol,const GroupDef* gd,const ClassDef* cd,const FileDef *fd,const NamespaceDef* nd,const ModuleDef *mod)
1185{
1207
1208 // configurations must be added to global file definitions.
1211
1212}

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

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

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 QCString & title, const QCString & subtitle, bool showEnumValues, VhdlSpecifier type)
static

Declaration at line 178 of file vhdldocgen.h, definition at line 1745 of file vhdldocgen.cpp.

1746 const ClassDef *cd,const NamespaceDef *nd,const FileDef *fd,const GroupDef *gd,const ModuleDef *mod,
1747 const QCString &title,const QCString &subtitle,bool /*showEnumValues*/,VhdlSpecifier type)
1748{
1749 if (!membersHaveSpecificType(ml,type)) return;
1750
1751 if (!title.isEmpty())
1752 {
1753 ol.startMemberHeader(convertToId(title),type == VhdlSpecifier::PORT ? 3 : 2);
1754 ol.parseText(title);
1755 ol.endMemberHeader();
1756 ol.docify(" ");
1757 }
1758 if (!subtitle.isEmpty())
1759 {
1761 ol.generateDoc("[generated]",-1,nullptr,nullptr,subtitle,FALSE,FALSE,
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().isEmpty();
1775 QCString groupAnchor = QCString(ml->listType().toLabel())+"-"+QCString().setNum(groupId++);
1776 ol.startMemberGroupHeader(groupAnchor,hasHeader);
1777 if (hasHeader)
1778 {
1779 ol.parseText(mg->header());
1780 }
1782 if (!mg->documentation().isEmpty())
1783 {
1784 //printf("Member group has docs!\n");
1786 ol.generateDoc("[generated]",-1,nullptr,nullptr,mg->documentation()+"\n",FALSE,FALSE,
1789 }
1790 ol.startMemberGroup();
1791 //printf("--- mg->writePlainDeclarations ---\n");
1792 VhdlDocGen::writePlainVHDLDeclarations(&mg->members(),ol,cd,nd,fd,gd,mod,type);
1793 ol.endMemberGroup(hasHeader);
1794 }
1795 }
1796}// writeVHDLDeclarations

References convertToId, OutputList::docify, OutputList::endMemberGroup, OutputList::endMemberGroupDocs, OutputList::endMemberGroupHeader, OutputList::endMemberHeader, OutputList::endMemberSubtitle, FALSE, OutputList::generateDoc, MemberList::getMemberGroupList, QCString::isEmpty, MemberList::listType, membersHaveSpecificType, OutputList::parseText, PORT, QCString::setNum, OutputList::startMemberGroup, OutputList::startMemberGroupDocs, OutputList::startMemberGroupHeader, OutputList::startMemberHeader, OutputList::startMemberSubtitle, MemberListType::toLabel, TRUE and writePlainVHDLDeclarations.

Referenced by writeVhdlDeclarations.

writeVHDLTypeDocumentation()

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

Declaration at line 166 of file vhdldocgen.h, definition at line 1262 of file vhdldocgen.cpp.

1263{
1264 const ClassDef *cd=toClassDef(d);
1265 bool hasParams = FALSE;
1266
1267 if (cd==nullptr) return hasParams;
1268
1269 QCString ttype=mdef->typeString();
1270 QCString largs=mdef->argsString();
1271
1273 {
1274 QCString nn=mdef->typeString();
1275 nn=nn.stripWhiteSpace();
1276 QCString na=cd->name();
1277 const MemberDef* memdef=VhdlDocGen::findMember(na,nn);
1278 if (memdef && memdef->isLinkable())
1279 {
1280 ol.docify(" ");
1281
1282 ol.startBold();
1283 writeLink(memdef,ol);
1284 ol.endBold();
1285 ol.docify(" ");
1286 }
1287 else
1288 {
1289 ol.docify(" ");
1290 VhdlDocGen::formatString(ttype,ol,mdef);
1291 ol.docify(" ");
1292 }
1293 ol.docify(mdef->name());
1294 hasParams = VhdlDocGen::writeFuncProcDocu(mdef,ol, mdef->argumentList());
1295 }
1296
1297
1298 if (mdef->isVariable())
1299 {
1300 if (VhdlDocGen::isConstraint(mdef))
1301 {
1302 writeLink(mdef,ol);
1303 ol.docify(" ");
1304
1305 largs=substitute(largs,"#"," ");
1306 VhdlDocGen::formatString(largs,ol,mdef);
1307 return hasParams;
1308 }
1309 else
1310 {
1311 writeLink(mdef,ol);
1313 {
1314 return hasParams;
1315 }
1316 ol.docify(" ");
1317 }
1318
1319 // QCString largs=mdef->argsString();
1320
1321 bool c=largs=="context";
1322 bool brec=largs.stripPrefix("record") ;
1323
1324 if (!brec && !c)
1325 VhdlDocGen::formatString(ttype,ol,mdef);
1326
1327 if (c || brec || largs.stripPrefix("units"))
1328 {
1329 if (c)
1330 largs=ttype;
1331 VhdlDocGen::writeRecUnitDocu(mdef,ol,largs);
1332 return hasParams;
1333 }
1334
1335 ol.docify(" ");
1336 if (VhdlDocGen::isPort(mdef) || VhdlDocGen::isGeneric(mdef))
1337 {
1338 // QCString largs=mdef->argsString();
1339 VhdlDocGen::formatString(largs,ol,mdef);
1340 ol.docify(" ");
1341 }
1342 }
1343 return hasParams;
1344}

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

Referenced by MemberDefImpl::writeDocumentation.

Private Static Functions

compareArgList()

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

Definition at line 224 of file vhdldocgen.h.

findAllArchitectures()

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

Declaration at line 223 of file vhdldocgen.h, definition at line 532 of file vhdldocgen.cpp.

532void VhdlDocGen::findAllArchitectures(std::vector<QCString>& qll,const ClassDef *cd)
533{
534 for (const auto &citer : *Doxygen::classLinkedMap)
535 {
536 QCString className=citer->className();
537 int pos = -1;
538 if (cd != citer.get() && (pos=className.find('-'))!=-1)
539 {
540 QCString postfix=className.mid(pos+1);
541 if (qstricmp(cd->className(),postfix)==0)
542 {
543 qll.push_back(className);
544 }
545 }
546 }// for
547}//findAllArchitectures

References Doxygen::classLinkedMap, ClassDef::className, QCString::find, QCString::mid and qstricmp.

Referenced by writeInlineClassLink.

writeRecordUnit()

void VhdlDocGen::writeRecordUnit (QCString & largs, QCString & ltype, OutputList & ol, MemberDefMutable * mdef)
static

Declaration at line 228 of file vhdldocgen.h, definition at line 2266 of file vhdldocgen.cpp.

2267{
2268 int i=mdef->name().find('~');
2269 if (i>0)
2270 {
2271 //sets the real record member name
2272 mdef->setName(mdef->name().left(i));
2273 }
2274
2275 writeLink(mdef,ol);
2276 ol.startBold();
2278 if (!ltype.isEmpty())
2279 {
2280 VhdlDocGen::formatString(ltype,ol,mdef);
2281 }
2282 ol.endBold();
2283}

References OutputList::endBold, QCString::find, formatString, OutputList::insertMemberAlign, QCString::isEmpty, QCString::left, Definition::name, DefinitionMutable::setName, OutputList::startBold and writeLink.

Referenced by writeVHDLDeclaration.

writeRecUnitDocu()

void VhdlDocGen::writeRecUnitDocu (const MemberDef * md, OutputList & ol, QCString largs)
static

Declaration at line 227 of file vhdldocgen.h, definition at line 2286 of file vhdldocgen.cpp.

2287 const MemberDef *md,
2288 OutputList& ol,
2289 QCString largs)
2290{
2291
2292 StringVector ql=split(largs.str(),"#");
2293 size_t len=ql.size();
2295 bool first=TRUE;
2296
2297 for(size_t i=0;i<len;i++)
2298 {
2299 QCString n=QCString(ql[i]);
2300 ol.startParameterType(first,"");
2301 ol.endParameterType();
2304 ol.endParameterName();
2306 if ((len-i)>1)
2307 {
2308 ol.endParameterExtra(false,false,false);
2309 }
2310 else
2311 {
2312 ol.endParameterExtra(true,false,true);
2313 }
2314
2315 first=FALSE;
2316 }
2317
2318}//#

References OutputList::endParameterExtra, OutputList::endParameterName, OutputList::endParameterType, FALSE, formatString, split, OutputList::startParameterExtra, OutputList::startParameterList, OutputList::startParameterName, OutputList::startParameterType, QCString::str and TRUE.

Referenced by writeVHDLTypeDocumentation.

writeStringLink()

void VhdlDocGen::writeStringLink (const MemberDef * mdef, QCString mem, OutputList & ol)
static

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

Declaration at line 226 of file vhdldocgen.h, definition at line 1815 of file vhdldocgen.cpp.

1816{
1817 if (mdef)
1818 {
1819 const ClassDef *cd=mdef->getClassDef();
1820 if (cd)
1821 {
1822 QCString n=cd->name();
1823 const MemberDef* memdef=VhdlDocGen::findMember(n,mem);
1824 if (memdef && memdef->isLinkable())
1825 {
1826 ol.startBold();
1827 writeLink(memdef,ol);
1828 ol.endBold();
1829 ol.docify(" ");
1830 return;
1831 }
1832 }
1833 }
1834 startFonts(mem,"vhdlchar",ol);
1835}// found component

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

Referenced by writeFormatString.

writeVhdlLink()

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

Declaration at line 225 of file vhdldocgen.h, definition at line 570 of file vhdldocgen.cpp.

571{
572 if (ccd==nullptr) return;
573 ol.startBold();
574 ol.docify(type);
575 ol.endBold();
576 nn.stripPrefix("_");
578
579 if (!behav.isEmpty())
580 {
581 behav.prepend(" ");
582 ol.startBold();
583 ol.docify(behav);
584 ol.endBold();
585 }
586
587 ol.lineBreak();
588}

References OutputList::docify, OutputList::endBold, Definition::getOutputFileBase, Definition::getReference, QCString::isEmpty, OutputList::lineBreak, QCString::prepend, OutputList::startBold, QCString::stripPrefix and OutputList::writeObjectLink.

Referenced by writeInlineClassLink.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.