28 #include <qfileinfo.h>
29 #include <qstringlist.h>
60 #include "VhdlParser.h"
64 #define theTranslator_vhdlType VhdlDocGen::trVhdlType
71 static void initUCF(
Entry* root,
const char* type,QCString & qcs,
int line,QCString & fileName,QCString &
brief);
114 case '<': t <<
"<";
116 case '>': t <<
">";
118 case '&': t <<
"&";
120 case '\'': t <<
"'";
122 case '"': t <<
""";
153 str=str.remove(0,i+1);
160 return qstricmp(s1.stripWhiteSpace(),s2.stripWhiteSpace());
166 QCString dir=
"-o \""+ov+
"/vhdl_design_overview.html\"";
167 ov+=
"/vhdl_design.dot";
169 QCString vlargs=
"-Tsvg \""+ov+
"\" "+dir ;
173 err(
"could not create dot file");
184 for ( ; (cd=cli.current()) ; ++cli )
196 QCString fileName=ov+
"/vhdl_design.dot";
200 if (!f.open(IO_WriteOnly))
202 fprintf(stderr,
"Warning: Cannot open file %s for writing\n",fileName.data());
208 for (cli.toFirst() ; (cd=cli.current()) ; ++cli )
215 QList<MemberDef>* port=
getPorts(cd);
220 if (port->count()==0)
241 for ( ; (bcd=bcli.current()) ; ++bcli )
244 QCString dotn=cd->
name()+
":";
246 QCString csc=bClass->
name()+
":";
264 t <<
" digraph G { \n";
265 t <<
"rankdir=LR \n";
266 t <<
"concentrate=TRUE\n";
267 t <<
"stylesheet=\"doxygen.css\"\n";
277 t << className <<
" [ shape=none , fontname=\"arial\", fontcolor=\"blue\" , \n";
278 t <<
"label=<<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\">\n";
282 const QCString &a,
const QCString &b,
const QCString &style)
285 if (!style.isEmpty())
287 t <<
"[style=" << style <<
"];\n";
297 QCString repl(
"<BR ALIGN=\"LEFT\"/>");
303 for(uint j=0;j<qsl.count();j++)
305 QCString qcs=qsl[j].data();
311 vForm.replace(ep,repl.data());
348 if (brief.isEmpty())
return;
352 QCString node=
"node";
354 t << node <<
"[shape=none margin=0.1, label=<\n";
355 t <<
"<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
356 t <<
"<TR><TD BGCOLOR=\"lightcyan\"> ";
358 t <<
" </TD></TR></TABLE>>];";
359 QCString dotn=cd->
name()+
":";
368 static QRegExp reg(
"[%]");
369 bool bidir=(md!=0 &&( qstricmp(md->
typeString(),
"inout")==0));
374 if (!toolTip.isEmpty())
377 if (!largs.isEmpty())
378 largs=largs.replace(reg,
" ");
389 t <<
"<TD ALIGN=\"LEFT\" ";
398 if (!toolTip.isEmpty())
405 if (!largs.isEmpty())
407 largs=largs.replace(reg,
" ");
417 if (!toolTip.isEmpty())
422 t <<
"BGCOLOR=\"orange\">";
424 t <<
"BGCOLOR=\"azure\">";
428 t <<
"BGCOLOR=\"pink\">";
432 t <<
"BGCOLOR=\"lightgrey\">";
458 t <<
"<TR><TD COLSPAN=\"2\" BGCOLOR=\"yellow\" ";
467 t <<
" </TD></TR>\n";
473 QList<MemberDef> *portList=
new QList<MemberDef>;
484 for (fmni.toFirst();(md=fmni.current());++fmni)
488 portList->append(md);
500 uint len=port->count();
502 QList<MemberDef> inPorts;
503 QList<MemberDef> outPorts;
520 int inp = inPorts.count();
521 int outp = outPorts.count();
534 for(i=0;i<maxLen;i++)
574 const char* g_vhdlKeyWordMap0[] =
576 "abs",
"access",
"after",
"alias",
"all",
"and",
"architecture",
"array",
"assert",
"assume",
"assume_guarantee",
"attribute",
577 "begin",
"block",
"body",
"buffer",
"bus",
578 "case",
"component",
"configuration",
"constant",
"context",
"cover",
579 "default",
"disconnect",
"downto",
580 "else",
"elsif",
"end",
"entity",
"exit",
581 "fairness",
"file",
"for",
"force",
"function",
582 "generate",
"generic",
"group",
"guarded",
583 "if",
"impure",
"in",
"inertial",
"inout",
"is",
584 "label",
"library",
"linkage",
"literal",
"loop",
586 "nand",
"new",
"next",
"nor",
"not",
"null",
587 "of",
"on",
"open",
"or",
"others",
"out",
588 "package",
"parameter",
"port",
"postponed",
"procedure",
"process",
"property",
"proctected",
"pure",
589 "range",
"record",
"register",
"reject",
"release",
"restrict",
"restrict_guarantee",
"rem",
"report",
"rol",
"ror",
"return",
590 "select",
"sequence",
"severity",
"signal",
"shared",
"sla",
"sll",
"sra",
"srl",
"strong",
"subtype",
591 "then",
"to",
"transport",
"type",
592 "unaffected",
"units",
"until",
"use",
593 "variable",
"vmode",
"vprop",
"vunit",
594 "wait",
"when",
"while",
"with",
601 const char* g_vhdlKeyWordMap1[] =
603 "natural",
"unsigned",
"signed",
"string",
"boolean",
"bit",
"bit_vector",
"character",
604 "std_ulogic",
"std_ulogic_vector",
"std_logic",
"std_logic_vector",
"integer",
605 "real",
"float",
"ufixed",
"sfixed",
"time",0
609 const char* g_vhdlKeyWordMap2[] =
611 "abs",
"and",
"or",
"not",
"mod",
"xor",
"rem",
"xnor",
"ror",
"rol",
"sla",
616 const char* g_vhdlKeyWordMap3[] =
618 "base",
"left",
"right",
"high",
"low",
"ascending",
619 "image",
"value",
"pos",
"val",
"succ",
"pred",
"leftof",
"rightof",
"left",
"right",
"high",
"low",
620 "range",
"reverse_range",
"length",
"ascending",
"delayed",
"stable",
"quiet",
"transaction",
"event",
621 "active",
"last_event",
"last_active",
"last_value",
"driving",
"driving_value",
"simple_name",
"instance_name",
"path_name",0
630 while (g_vhdlKeyWordMap0[j])
633 new QCString(g_vhdlKeyWordMap0[j]));
638 while (g_vhdlKeyWordMap1[j])
641 new QCString(g_vhdlKeyWordMap1[j]));
646 while (g_vhdlKeyWordMap2[j])
649 new QCString(g_vhdlKeyWordMap2[j]));
654 while (g_vhdlKeyWordMap3[j])
657 new QCString(g_vhdlKeyWordMap3[j]));
669 static QCString vhdlkeyword(
"vhdlkeyword");
670 static QCString vhdltype(
"comment");
671 static QCString vhdllogic(
"vhdllogic");
672 static QCString preprocessor(
"keywordflow");
674 QCString word=tmp.lower();
676 if (word.isEmpty() || word.at(0)==
'\0')
return 0;
679 return &preprocessor;
695 if (name==0 || name[0]==
'\0')
return 0;
700 temp=temp.stripWhiteSpace();
714 static QList<ClassDef>
qli;
727 if (mdef)
return mdef;
729 if (mdef)
return mdef;
740 QCString tt=d->
name();
757 if (mdef)
return mdef;
759 if (mdef)
return mdef;
769 QCString tt=d->
name();
795 QMap<ClassDef*,QList<ClassDef> >::Iterator cList=
packages.find(ecd);
798 QList<ClassDef> mlist=cList.data();
799 for (uint j=0;j<mlist.count();j++)
802 if (mdef)
return mdef;
804 if (mdef)
return mdef;
822 QMap<QCString, MemberDef*>::Iterator it =
varMap.find(keyType);
831 if (
qli.contains(cd))
845 for (fmni.toFirst();(md=fmni.current());++fmni)
848 if (
varMap.contains(tkey))
852 varMap.insert(tkey.data(),md);
854 it=
varMap.find(keyType.data());
872 QList<ClassDef> cList;
873 if (
packages.contains(cdef))
return;
880 for (fmni.toFirst();(md=fmni.current());++fmni)
902 const QCString& funcname,
903 const QCString& package,
bool )
908 if (cdef==0)
return 0;
915 for (fmni.toFirst();(mdef=fmni.current());++fmni)
917 QCString mname=mdef->
name();
927 if (ali.count() != ali1.count())
break;
932 for (;(arg=ali.current()) && (arg1=ali1.current());++ali,++ali1)
936 QCString s1=arg->
type;
937 QCString s2=arg1->
type;
949 if (equ==0)
return mdef;
966 if (cd==0)
return "";
980 if (cd==0)
return "";
985 temp.stripPrefix(
"_");
999 ql.setAutoDelete(TRUE);
1022 nn.stripPrefix(
"_");
1042 for (
int i=0;i<j;i++)
1044 QCString *temp=ql.at(i);
1046 QCString s1=qlist[0].utf8();
1047 QCString s2=qlist[1].utf8();
1048 s1.stripPrefix(
"_");
1049 if (j==1) s1.resize(0);
1074 for ( ; (citer=cli.current()) ; ++cli )
1077 if (cd != citer && jj.contains(
'-')!=-1)
1080 QCString temp=ql[1].utf8();
1083 QCString *cl=
new QCString(jj);
1093 QCString nn=cd->
name();
1096 for ( ; (citer=cli.current()) ; ++cli )
1098 QCString jj=citer->
name();
1102 if (ql[0].utf8()==nn )
1120 nn.stripPrefix(
"_");
1123 if (!behav.isEmpty())
1140 const char* s=
"--!";
1145 index=qcs.find(s,0,TRUE);
1147 qcs=qcs.remove(index,qstrlen(s));
1149 qcs=qcs.stripWhiteSpace();
1162 QCString&
name,QCString& ret,
bool doc)
1170 end=s1.findRev(
")");
1174 temp=s1.mid(index+1,(end-index-1));
1179 name=s1.left(index);
1180 name=name.stripWhiteSpace();
1190 s1=s1.stripWhiteSpace();
1191 int i=s1.find(
"(",0,FALSE);
1192 int s=s1.find(QRegExp(
"[ \\t]"));
1198 name=s1.stripWhiteSpace();
1200 index=s1.findRev(
"return",-1,FALSE);
1203 ret=s1.mid(index+6,s1.length());
1204 ret=ret.stripWhiteSpace();
1217 QRegExp reg(
"[\\s:|]");
1221 if (ql.count() > (
unsigned int)index)
1223 return ql[index].utf8();
1235 return "architecture";
1239 return "package body";
1286 int index=s.findRev(c,-1,FALSE);
1289 QCString qcs=s.remove(index,1);
1298 int index=s.findRev(c,-1,FALSE);
1301 QCString qcs=s.remove(index,1);
1303 index=s.findRev(c,-1,FALSE);
1318 QCString qcs(&buf[0]);
1328 static int stringCounter;
1330 QCString qcs(
"PROCESS_");
1331 sprintf(buf,
"%d",stringCounter++);
1332 qcs.append(&buf[0]);
1342 QRegExp reg(
"[\\[\\]\\.\\/\\:\\<\\>\\:\\s\\,\\;\\'\\+\\-\\*\\|\\&\\=\\(\\)\"]");
1353 j = reg.match(temp.data(),0,&len);
1370 else if (j != 0 && ss)
1383 QCString st=temp.remove(0,j+1);
1385 if (!find.isEmpty() && find.at(0)==
'"')
1387 int ii=find.find(
'"',2);
1390 QCString com=find.left(ii+1);
1392 temp=find.remove(0,ii+1);
1399 j = reg.match(temp.data(),0,&len);
1414 static QRegExp regg(
"[0-9][0-9eEfFbBcCdDaA_.#-+?xXzZ]*");
1416 if (s.isEmpty())
return FALSE;
1418 j = regg.match(s.data(),0,&len);
1419 if ((j==0) && (len==(int)s.length()))
return TRUE;
1434 qcs.stripPrefix(
":");
1435 qcs.stripPrefix(
"is");
1436 qcs.stripPrefix(
"IS");
1437 qcs.stripPrefix(
"of");
1438 qcs.stripPrefix(
"OF");
1442 int len = qcs.length();
1443 unsigned int index=1;
1445 for (
int j=0;j<len;j++)
1449 if (j>0) b=qcs[j-1];
1450 if (c==
'"' || c==
',' || c==
'\''|| c==
'(' || c==
')' || c==
':' || c==
'[' || c==
']' )
1452 if (temp.length()>=index && temp.at(index-1) !=
' ')
1463 temp.replace(index-1,1,
"=");
1478 index=temp.length();
1480 temp=temp.stripWhiteSpace();
1494 int len=al->count();
1500 for (;(arg=ali.current());++ali)
1506 QCString nn=arg->
name;
1551 int len=al->count();
1559 for (;(arg=ali.current());++ali)
1562 QCString att=arg->
defval;
1563 bool bGen=att.stripPrefix(
"gen!");
1584 QCString nn=arg->
name;
1586 QCString ss=arg->
type.stripWhiteSpace();
1587 QCString w=ss.stripWhiteSpace();
1634 for (;(arg=ali.current());++ali)
1640 QCString nn=arg->
name;
1660 if (al==0)
return FALSE;
1665 int index=ali.count();
1676 for (;(arg=ali.current());++ali)
1680 QCString attl=arg->
defval;
1681 bool bGen=attl.stripPrefix(
"gen!");
1702 startFonts(QCString(
"in"),
"stringliteral",ol);
1748 for (;(arg=ali.current());++ali)
1750 if (sem) argString.append(
", ");
1753 argString+=arg->
name;
1755 argString+=arg->
type;
1759 argString+=arg->
defval+
" ";
1760 argString+=arg->
name+
" :";
1761 argString+=arg->
attrib+
" ";
1762 argString+=arg->
type;
1773 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::LIBRARY,FALSE),0,FALSE,
VhdlDocGen::LIBRARY);
1774 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::USE,FALSE),0,FALSE,
VhdlDocGen::USE);
1775 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::FUNCTION,FALSE),0,FALSE,
VhdlDocGen::FUNCTION);
1776 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::COMPONENT,FALSE),0,FALSE,
VhdlDocGen::COMPONENT);
1777 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::CONSTANT,FALSE),0,FALSE,
VhdlDocGen::CONSTANT);
1778 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::TYPE,FALSE),0,FALSE,
VhdlDocGen::TYPE);
1779 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::SUBTYPE,FALSE),0,FALSE,
VhdlDocGen::SUBTYPE);
1780 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::GENERIC,FALSE),0,FALSE,
VhdlDocGen::GENERIC);
1781 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::PORT,FALSE),0,FALSE,
VhdlDocGen::PORT);
1782 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::PROCESS,FALSE),0,FALSE,
VhdlDocGen::PROCESS);
1783 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::SIGNAL,FALSE),0,FALSE,
VhdlDocGen::SIGNAL);
1784 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::ATTRIBUTE,FALSE),0,FALSE,
VhdlDocGen::ATTRIBUTE);
1785 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::PROCEDURE,FALSE),0,FALSE,
VhdlDocGen::PROCEDURE);
1786 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::RECORD,FALSE),0,FALSE,
VhdlDocGen::RECORD);
1787 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::UNITS,FALSE),0,FALSE,
VhdlDocGen::UNITS);
1788 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::SHAREDVARIABLE,FALSE),0,FALSE,
VhdlDocGen::SHAREDVARIABLE);
1789 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::VFILE,FALSE),0,FALSE,
VhdlDocGen::VFILE);
1790 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::GROUP,FALSE),0,FALSE,
VhdlDocGen::GROUP);
1791 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::INSTANTIATION,FALSE),0,FALSE,
VhdlDocGen::INSTANTIATION);
1792 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::ALIAS,FALSE),0,FALSE,
VhdlDocGen::ALIAS);
1796 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::CONFIG,FALSE),0,FALSE,
VhdlDocGen::CONFIG);
1797 VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,nd,fd,gd,
theTranslator_vhdlType(
VhdlDocGen::UCF_CONST,FALSE),0,FALSE,
VhdlDocGen::UCF_CONST);
1806 for ( ; (mdd=mmli.current()); ++mmli )
1812 else if (qstrcmp(mdd->
argsString(),
"configuration")==0)
1816 else if (qstrcmp(mdd->
typeString(),
"library")==0)
1820 else if (qstrcmp(mdd->
typeString(),
"use")==0)
1824 else if (qstricmp(mdd->
typeString(),
"misc")==0)
1828 else if (qstricmp(mdd->
typeString(),
"ucf_const")==0)
1839 bool hasParams = FALSE;
1841 if (cd==0)
return hasParams;
1849 nn=nn.stripWhiteSpace();
1850 QCString na=cd->
name();
1879 largs=largs.replace(QRegExp(
"#"),
" ");
1895 bool c=largs==
"context";
1896 bool brec=largs.stripPrefix(
"record") ;
1901 if (c || brec || largs.stripPrefix(
"units"))
1922 tagFile <<
" <member kind=\"";
1945 tagFile <<
"\">" <<
endl;
1959 tagFile <<
" </member>" <<
endl;
1970 ASSERT(cd!=0 || nd!=0 || fd!=0 || gd!=0 ||
1988 QCString cname = d->
name();
1999 uint isAnonymous = (bool)(annoClassDef);
2009 if (!detailsVisible)
2011 QCString doxyName=mdef->
name().copy();
2012 if (!cname.isEmpty()) doxyName.prepend(cname+
"::");
2077 name+=
" <"+mdef->
name()+
">";
2086 if (largs==
"context")
2129 if(nn.stripPrefix(
"function") || nn.stripPrefix(
"package"))
2139 largs.prepend(
"::");
2140 largs.prepend(mdef->
name().data());
2175 QCString
name(
"<Entity ");
2182 name+=mdef->
name()+
"> ";
2191 mm=mdef->
name().findRev(
'_');
2215 if (ltype.isEmpty()) {
2219 if (!ltype.isEmpty())
2224 bRec=largs.stripPrefix(
"record") ;
2225 bUnit=largs.stripPrefix(
"units") ;
2227 if (bRec) ol.
docify(
"record: ");
2228 if (bUnit) ol.
docify(
"units: ");
2245 if (htmlOn && !ltype.isEmpty())
2249 if (!ltype.isEmpty()) ol.
docify(
" ");
2256 if (!detailsVisible)
2270 mdef,s.data(),TRUE,FALSE,0,TRUE,FALSE);
2277 if (mdef->getGroupDef()!=0 && gd==0)
2308 for ( ; (md=mli.current()); ++mli )
2332 if (ml==0)
return FALSE;
2335 for ( ; (mdd=mmli.current()); ++mmli )
2346 while ((mg=mgli.current()))
2360 const char *title,
const char *subtitle,
bool ,
int type)
2372 if (subtitle && subtitle[0]!=0)
2375 ol.
generateDoc(
"[generated]",-1,0,0,subtitle,FALSE,FALSE,0,TRUE,FALSE);
2385 while ((mg=mgli.current()))
2390 bool hasHeader=mg->
header()!=
"[NOHEADER]";
2397 if (!mg->documentation().isEmpty())
2401 ol.
generateDoc(
"[generated]",-1,0,0,mg->documentation()+
"\n",FALSE,FALSE);
2434 if (sing)
return "Library";
2435 else return "Libraries";
2437 if (sing)
return "Package";
2438 else return "Packages";
2440 if (sing)
return "Signal";
2441 else return "Signals";
2443 if (sing)
return "Component";
2444 else return "Components";
2446 if (sing)
return "Constant";
2447 else return "Constants";
2449 if (sing)
return "Entity";
2450 else return "Entities";
2452 if (sing)
return "Type";
2453 else return "Types";
2455 if (sing)
return "Subtype";
2456 else return "Subtypes";
2458 if (sing)
return "Function";
2459 else return "Functions";
2461 if (sing)
return "Record";
2462 else return "Records";
2464 if (sing)
return "Procedure";
2465 else return "Procedures";
2467 if (sing)
return "Architecture";
2468 else return "Architectures";
2470 if (sing)
return "Attribute";
2471 else return "Attributes";
2473 if (sing)
return "Process";
2474 else return "Processes";
2476 if (sing)
return "Port";
2477 else return "Ports";
2479 if (sing)
return "use clause";
2480 else return "Use Clauses";
2482 if (sing)
return "Generic";
2483 else return "Generics";
2485 return "Package Body";
2489 if (sing)
return "Shared Variable";
2490 return "Shared Variables";
2492 if (sing)
return "File";
2495 if (sing)
return "Group";
2498 if (sing)
return "Instantiation";
2499 else return "Instantiations";
2501 if (sing)
return "Alias";
2504 if (sing)
return "Configuration";
2505 return "Configurations";
2507 return "Miscellaneous";
2509 return "Constraints";
2517 return "Design Unit Hierarchy";
2522 return "Design Unit List";
2527 return "Design Unit Members";
2532 return "Here is a list of all design unit members with links to "
2533 "the Entities they belong to:";
2538 return "Design Unit Index";
2543 return "Design Units";
2548 return "Functions/Procedures/Processes";
2561 QCString n=cd->
name();
2585 if (cname.isEmpty())
2592 fi=codeFragment.find(
"\n",++fi);
2593 }
while(fi>=0 && j++ <3);
2598 codeFragment=codeFragment.left(fi);
2599 codeFragment.append(
"\n .... ");
2603 codeFragment.prepend(
"\n");
2623 if (cname.isEmpty())
return;
2625 mdef->writeSourceDef(ol,cname);
2626 mdef->writeSourceRefs(ol,cname);
2627 mdef->writeSourceReffedBy(ol,cname);
2640 while((i=n.find(
"__"))>0)
2645 while((i=n.find(
"_1"))>0)
2647 n=n.replace(i,2,
":");
2655 QCString ucFile(input);
2660 while (!ucFile.isEmpty())
2662 int i=ucFile.find(
"\n");
2665 QCString temp=ucFile.left(i);
2666 temp=temp.stripWhiteSpace();
2667 bool bb=temp.stripPrefix(
"//");
2669 if (!temp.isEmpty())
2671 if (temp.stripPrefix(comment) )
2674 brief.append(
"\\n");
2676 else if (!temp.stripPrefix(
"#") && !bb)
2680 int i=temp.find(
"-name");
2683 temp=temp.remove(0,i+5);
2686 temp.stripPrefix(
"set_location_assignment");
2688 initUCF(entity,0,temp,lineNo,fileName,brief);
2692 QRegExp ee(
"[\\s=]");
2693 int i=temp.find(ee);
2694 QCString ff=temp.left(i);
2695 temp.stripPrefix(ff.data());
2697 if (!temp.isEmpty())
2705 ucFile=ucFile.remove(0,i+1);
2709 static void initUCF(
Entry* root,
const char* type,QCString & qcs,
int line,QCString & fileName,QCString &
brief)
2711 if (qcs.isEmpty())
return;
2712 QRegExp reg(
"[\\s=]");
2717 qcs=qcs.stripWhiteSpace();
2719 int i= qcs.find(reg);
2731 qcs=qcs.remove(0,i+1);
2734 qcs.stripPrefix(
"=");
2741 current->
type=
"ucf_const";
2752 current->
name= n+
"_";
2755 if (!brief.isEmpty())
2773 bool equ=(n.length()==largs.length());
2782 if (mdef->
name().contains(
"dummy")==0)
2802 QCString co(
"Constraints");
2808 QCString ofile(
"vhdl_design_overview");
2817 if (fd->
name().contains(
".ucf") || fd->
name().contains(
".qsf"))
2835 if (!entity.contains(
":"))
return "";
2837 QRegExp exp(
"[:()\\s]");
2840 assert(ql.count()>=2);
2841 label = ql[0].utf8();
2842 entity = ql[1].utf8();
2843 if ((index=entity.findRev(
"."))>=0)
2845 entity.remove(0,index+1);
2865 QRegExp exp(
"[()\\s]");
2870 if (ql.contains(
"open"))
2877 entity = ql[1].utf8();
2878 if ((index=entity.findRev(
"."))>=0)
2880 entity.remove(0,index+1);
2898 for (;(cd=cli.current());++cli)
2900 if (qstricmp(className,cd->
name().data())==0)
2921 QListIterator<Entry> eli(instList);
2925 QCString arcBind,entBind;
2931 if (qstricmp(conf2,
"configuration")==0)
2936 for (uint iter=0;iter<confList.count(); iter++)
2971 QCString label=conf->
compSpec.lower();
2980 archName=archClass->
name();
2982 all=allOt.lower()==
"all" ;
2983 others= allOt.lower()==
"others";
2985 for (;(cur=eli.current());++eli)
3005 for (uint j=0;j<ql.count();j++)
3007 QCString archy1,sign1;
3015 archy1=comp+
":"+ql[j].utf8();
3019 if (archy1==sign1.lower() && !cur->
stat)
3024 if (entClass==0 || ent==0)
3055 QCString entity,arch,inst;
3058 for (uint iter=0;iter<confList.count(); iter++)
3069 QListIterator<Entry> eli(qsl);
3072 for (eli.toFirst();(cur=eli.current());++eli)
3121 if (classEntity==cd)
return;
3123 bName=classEntity->
name();
3125 n1=classEntity->
name().data();
3143 QCString uu=cur->
name;
3172 QCString info=
"Info: Elaborating entity "+n1;
3174 info+=
" for hierarchy ";
3177 label.replace(epr,
":");
3179 fprintf(stderr,
"\n[%s:%d:%s]\n",fd->
fileName().data(),cur->
startLine,info.data());
3190 uint len=ql.count();
3191 for(uint i=0;i<len;i++)
3193 QCString n=ql[i].utf8();
3207 uint len=ql.count();
3211 for(uint i=0;i<len;i++)
3213 QCString n=ql[i].utf8();
3240 err(
"Possible recursive class relation while inside %s and looking for %s\n",qPrint(cd->
name()),qPrint(scd->
name()));
3248 for ( ; bcli.current() && !found ; ++bcli)
3250 ClassDef *ccd=bcli.current()->classDef;
3261 found=ccd->
isBaseClass(scd,followInstances,level+1);
3274 for ( ; bcli.current() ; ++bcli)
3276 ClassDef *ccd=bcli.current()->classDef;
3279 QCString n = bcli.current()->usedName;
3280 int i = n.find(
'(');
3283 bcli.current()->usedName.append(
"(2)");
3286 static QRegExp reg(
"[0-9]+");
3287 QCString s=n.left(i);
3288 QCString r=n.right(n.length()-i);
3292 r.setNum(r.toInt()+1);
3293 t.replace(reg,r.data());
3295 bcli.current()->usedName=s;
3296 bcli.current()->templSpecifiers=t;
3307 for(uint j=0;j<
mdList.count();j++)
3318 if (mdef==0)
return;
3320 QCString codeFragment;
3344 QStrList filesInSameTu;
3346 pIntf->
parseInput(
"",codeFragment.data(),&root,FALSE,filesInSameTu);
3416 #define STARTL (FlowChart::WHILE_NO | FlowChart::IF_NO | \
3417 FlowChart::FOR_NO | FlowChart::CASE_NO | \
3418 FlowChart::LOOP_NO | WHEN_NO)
3419 #define DECLN (FlowChart::WHEN_NO | \
3420 FlowChart::ELSIF_NO | FlowChart::IF_NO | \
3421 FlowChart::FOR_NO | FlowChart::WHILE_NO | \
3422 FlowChart::CASE_NO | FlowChart::LOOP_NO )
3423 #define STARTFIN (FlowChart::START_NO | FlowChart::END_NO)
3424 #define LOOP (FlowChart::FOR_NO | FlowChart::WHILE_NO | \
3425 FlowChart::LOOP_NO )
3426 #define ENDCL (FlowChart::END_CASE | FlowChart::END_LOOP)
3427 #define EEND (FlowChart::ENDIF_NO | FlowChart::ELSE_NO )
3428 #define IFF (FlowChart::ELSIF_NO | FlowChart::IF_NO)
3429 #define EXITNEXT (FlowChart::EXIT_NO | FlowChart::NEXT_NO )
3430 #define EMPTY (EEND | FlowChart::ELSIF_NO)
3431 #define EE (FlowChart::ELSE_NO | FlowChart::ELSIF_NO)
3432 #define EMPTNODE (ENDCL | EEND | FlowChart::ELSIF_NO)
3433 #define FLOWLEN (flowList.count()-1)
3465 static QMap<QCString,int> keyMap;
3470 if (q.length()<=80)
return;
3479 QRegExp reg(
"[\\s|]");
3480 QCString str(q.data());
3483 while (str.length()>80)
3485 int j=str.findRev(reg,80);
3494 QCString qcs=str.left(j);
3510 QRegExp ep(
"[\t\n\r]");
3518 q=ui.left(2*flo->
stamp);
3524 QCString nn=flo->
exp.stripWhiteSpace();
3525 printf(
"\nYES: %s%s[%d,%d]",q.data(),nn.data(),flo->
stamp,flo->
id);
3544 q=ui.left(2*flo->
stamp);
3560 printf(
"\n NO: %s[%d,%d]",t.data(),flo->
stamp,flo->
id);
3568 for (uint j=0;j<size;j++)
3579 for (uint j=0;j<
flowList.count();j++)
3584 text+=flo->
text+
'\n';
3603 for (uint j=0;j<
flowList.count()-1;j++)
3625 return node.prepend(
"node");
3634 for (uint j=0;j <size ;j++)
3647 for (uint j=0;j<ql.count();j++)
3649 s=(QCString)ql[j].utf8();
3650 if (max<s.length()) max=s.length();
3654 int diff=max-s.length();
3662 ql.remove(ql.last());
3666 for (uint j=0;j<ql.count();j++)
3668 s=(QCString)ql[j].utf8();
3683 for (uint j=0;j < size-1 ;j++)
3701 for (uint j=0;j <
flowList.count() ;j++)
3727 t <<
"[shape=none, label=<\n";
3728 t <<
"<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
3729 t <<
"<TR><TD BGCOLOR=\"";
3734 t <<
" </TD></TR></TABLE>>];";
3741 for (uint j=0;j < size;j++)
3771 case '<': t <<
"<";
break;
3772 case '>': t <<
">";
break;
3773 case '&': t <<
"&";
break;
3774 case '\'': t <<
"'";
break;
3775 case '"': t <<
""";
break;
3776 case '\n': t <<
"<BR ALIGN=\"LEFT\"/>";
break;
3777 default: t << c;
break;
3816 static QRegExp reg(
"[;]");
3817 static QRegExp reg1(
"[\"]");
3822 QCString expression(exp);
3827 typeString=typeString.replace(reg,
"\n");
3832 expression=expression.replace(reg1,
"\\\"");
3837 fl->
line=vhdl::parser::VhdlParser::getLine();
3858 QCString
exp=flo->
exp.stripWhiteSpace();
3859 QCString
text=flo->
text.stripWhiteSpace();
3862 case START_NO: t=
":"+text+
"|";
break;
3863 case IF_NO : t=
"\nif ("+exp+
") then (yes)";
break;
3864 case ELSIF_NO: t=
"\nelseif ("+exp+
") then (yes)";
break;
3865 case ELSE_NO: t=
"\nelse";
break;
3866 case CASE_NO: t=
"\n:"+exp+
";";
break;
3869 t+=
"if ("+exp+
") then (yes)";
3872 case END_NO:
if (text.contains(
" function")==0) t=
"\n:"+text+
";";
3874 case TEXT_NO: t=
"\n:"+text+
"]";
break;
3876 case FOR_NO: t=
"\nwhile ("+exp+
") is (yes)";
break;
3877 case WHILE_NO: t=
"\nwhile ("+exp+
") is (yes)";
break;
3878 case END_LOOP: t=
"\nendwhile";
break;
3879 case END_CASE: t=
"\nendif\n:end case;";
break;
3882 if (!endL) t+=
"\nstop";
3884 case LOOP_NO: t=
"\nwhile (infinite loop)";
break;
3887 case COMMENT_NO: t=
"\n note left \n "+flo->
label+
"\nend note \n";
break;
3888 case BEGIN_NO: t=
"\n:begin;";
break;
3889 default: assert(
false);
break;
3896 int caseCounter = 0;
3897 int whenCounter = 0;
3902 for (uint j=0;j<size;j++)
3917 bool ca = (caseCounter>0 && whenCounter==0);
3932 QCString
tmp=htmlOutDir;
3939 static QRegExp
exp (
"[^][a-z_A-Z0-9]");
3947 if (qcs.find(exp,0)>=0)
3950 qcs=qcs.replace(exp,
"_");
3962 case IF_NO:
return "if ";
3968 case END_NO:
return "end ";
3972 case FOR_NO:
return "for ";
3978 case LOOP_NO:
return "infinite loop ";
3983 default:
return "--failure--";
3998 QCString dir=
" -o "+ov+qcs;
3999 ov+=
"/flow_design.dot";
4001 QCString vlargs=
"-Tsvg "+ov+dir ;
4005 err(
"could not create dot file");
4011 t <<
" digraph G { \n";
4012 t <<
"rankdir=TB \n";
4013 t <<
"concentrate=true\n";
4014 t <<
"stylesheet=\"doxygen.css\"\n";
4027 QCString fileName = ov+
"/flow_design.dot";
4031 if (!f.open(IO_WriteOnly))
4033 err(
"Cannot open file %s for writing\n",fileName.data());
4057 for (uint j=0;j <size ;j++)
4091 keyMap.insert(qq,fl->
id);
4096 if (exit && !fl->
exp.isEmpty())
4105 t <<
" [shape=diamond,style=filled,color=\"";
4107 t <<
"\",label=\" ";
4109 if (exit) kl=fl->
text+
" ";
4113 kl+=fl->
label+
":"+exp+var;
4125 QCString val=fl->
text;
4126 t <<
" [shape=ellipse ,label=\""+val+
"\"]\n";
4130 QCString val=fl->
text;
4131 t <<
"[shape=box , style=rounded label=<\n";
4132 t <<
"<TABLE BORDER=\"0\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" >\n ";
4133 t <<
"<TR><TD BGCOLOR=\"";
4137 t <<
" </TD></TR></TABLE>>];";
4141 if (fl->
text.isEmpty())
return;
4143 QCString q=fl->
text;
4150 int z=q.findRev(
"\n");
4152 if (z==(
int)q.length()-1)
4156 t <<
"[shape=none margin=0.1, label=<\n";
4157 t <<
"<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
4160 t <<
"<TR><TD BGCOLOR=\"" <<
flowCol.varNode <<
"\" > ";
4164 t <<
"<TR><TD BGCOLOR=\"" <<
flowCol.textNode <<
"\" > ";
4167 t <<
" </TD></TR></TABLE>>];";
4180 QMap<QCString, int>::Iterator it = keyMap.find(s1);
4181 QMap<QCString, int>::Iterator it1 = keyMap.find(s2);
4210 t <<
"edge [color=\""+col+
"\",label=\""+label+
"\"]\n";
4212 if (bFrom) t <<
":s";
4224 int index=ali.count();
4225 if (index==0)
return;
4229 prev.fill(
' ',len+1);
4233 for (;(arg=ali.current());++ali)
4235 QCString attl=arg->
defval+
" ";
4236 attl+=arg->
name+
" ";
4247 if (--index) attl+=
",\n";
else attl+=
"\n";
4249 attl.prepend(prev.data());
4258 for (uint j=index+1;j<
flowList.count();j++)
4261 if (flo->
stamp==stamp)
4275 for (uint j=index;j>0;j--)
4280 if (flo->
stamp==stamp && endif)
4286 if (flo->
stamp<stamp)
4298 for (uint j=index;j>0;j--)
4306 err(
"could not find label: ",label.data());
4312 for (uint j=index+1;j<
flowList.count();j++)
4315 if (flo->
type==type && flo->
stamp==stamp)
4325 for (uint j=index+1;j<
flowList.count();j++)
4336 if (s<stamp && stamp>0)
4344 if (s<stamp && stamp>0)
4353 if (s<stamp && stamp>0)
4367 uint start = index+1;
4372 assert(endifNode>-1);
4374 if (elseifNode>0 && elseifNode<endifNode)
4379 if (elseNode>0 && elseNode<endifNode)
4384 stamp=
flowList.at(endifNode)->stamp;
4396 for (uint j=0;j<size;j++)
4446 if (qstricmp(fll->
text.simplifyWhiteSpace().data(),
"others")==0)
4488 if (!fll->
label.isEmpty())
4524 const char *scopeName,
4525 const QCString &input,
4527 bool isExampleBlock,
4528 const char *exampleName,
4532 bool inlineFragment,
4534 bool showLineNumbers,