浏览该文件的文档.
55 #define TK_COMMAND_CHAR(token) ((token)==TK_COMMAND_AT ? "@" : "\\")
58 #define DBG(x) do {} while(0)
67 #define INTERNAL_ASSERT(x) do {} while(0)
83 "uml",
"bpm",
"wire",
"dot",
"ditaa",
84 "salt",
"math",
"latex",
"gantt",
"mindmap",
85 "wbs",
"yaml",
"creole",
"json",
"flow",
181 return std::make_unique<DocParser>();
244 const char *p = s.
data();
250 if (c==
'{') c=
'<';
else if (c==
'}') c=
'>';
277 text.
sprintf(
"image file name %s is ambiguous.\n",
qPrint(fileName));
278 text+=
"Possible candidates:\n";
318 QCString outputFile = outputDir+
"/"+result;
324 "destination of image %s is a symlink, replacing with image",
327 if (outputFile!=inputFile)
338 "could not open image %s",
qPrint(fileName));
348 epstopdfArgs.
sprintf(
"\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
354 err(
"Problems running epstopdf. Check your TeX installation!\n");
363 if (result.
left(5)!=
"http:" && result.
left(6)!=
"https:" && doWarn)
366 "image file %s is not found in IMAGE_PATH: "
367 "assuming external image.",
qPrint(fileName)
390 if (al.
empty())
return;
392 static const reg::Ex re(R
"(\$?\w+\.*)");
395 for (; it!=
end ; ++it)
397 const auto &
match = *it;
420 if (!scope.
isEmpty()) scope+=
"::";
else scope=
"";
427 inheritedFrom.
sprintf(
" inherited from member %s at line "
435 "argument '%s' of command @param "
436 "is not found in the argument list of %s%s%s%s",
455 qPrint(
"return value '" + name +
"' of " +
457 " has multiple documentation sections"));
493 if (count==0 && a.docs.isEmpty())
502 qPrint(
"argument '" + aName +
503 "' from the argument list of " +
505 " has multiple @param documentation sections"));
512 QCString errMsg =
"The following parameter";
513 if (undocParams.
size()>1) errMsg+=
"s";
517 (undocParams.
size()>1 ?
" are" :
" is") +
" not documented:\n";
518 for (
const Argument &a : undocParams)
523 if (!first) errMsg+=
"\n";
525 errMsg+=
" parameter '"+argName+
"'";
542 if (result.
right(4)==
".tex")
678 size_t rightBracePos = cmdArg.
find(
"}",
static_cast<int>(
qstrlen(
"anonymous_namespace{")));
682 cmdArg = leftPart + rightPart;
689 int l=(int)cmdArg.
length();
691 int funcStart=cmdArg.
find(
'(');
700 int secondParen = cmdArg.
find(
'(', funcStart+1);
701 int leftParen = cmdArg.
find(
')', funcStart+1);
702 if (leftParen!=-1 && secondParen!=-1)
704 if (leftParen<secondParen)
706 funcStart=secondParen;
766 if (scopeOffset==-1) scopeOffset=0;
768 }
while (scopeOffset>=0);
778 const char *cmd_start =
"\\";
794 children.push_back(std::make_unique<DocWord>(*
this,parent,
context.
token->
name));
805 DBG((
"handleStyleArgument(%s)\n",
qPrint(cmdName)));
821 static const reg::Ex specialChar(R
"([.,|()\[\]:;?])");
858 DBG((
"HandleStyleEnter\n"));
860 children.push_back(std::unique_ptr<DocStyleChange>(sc));
870 DBG((
"HandleStyleLeave\n"));
902 std::make_unique<DocStyleChange>(
942 for (
const auto &opt : tagHtmlAttribs)
944 if (opt.name==
"name" || opt.name==
"id")
946 if (!opt.value.isEmpty())
948 children.push_back(std::make_unique<DocAnchor>(*
this,parent,opt.value,
TRUE));
956 else if (opt.name==
"href")
961 attrList.erase(attrList.begin()+index);
965 children.push_back(std::unique_ptr<DocHRef>(href));
967 retval = href->
parse();
1010 "end of comment block while expecting "
1019 if (!autolinkSupport && !ignoreAutoLinkFlag)
1021 children.push_back(std::make_unique<DocWord>(*
this,parent,name));
1050 std::make_unique<DocLinkedWord>(
1069 std::make_unique<DocLinkedWord>(
1077 (
toFileDef(compound))->generateSourceFile()
1081 std::make_unique<DocLinkedWord>(
1090 children.push_back(std::make_unique<DocWord>(*
this,parent,name));
1099 children.push_back(std::make_unique<DocWord>(*
this,parent,
":"));
1106 std::make_unique<DocLinkedWord>(
1118 children.push_back(std::make_unique<DocWord>(*
this,parent,
context.
token->
name));
1122 children.push_back(std::make_unique<DocWord>(*
this,parent,name));
1132 while ((i=paramTypes.
find(
'|',p))!=-1)
1134 name1 = paramTypes.
mid(p,i-p);
1138 if (ii!=-1) children.push_back(std::make_unique<DocWord>(*
this,parent,name1.
mid(ii)));
1140 children.push_back(std::make_unique<DocSeparator>(*
this,parent,
"|"));
1142 name1 = paramTypes.
mid(p);
1146 if (ii!=-1) children.push_back(std::make_unique<DocWord>(*
this,parent,name1.
mid(ii)));
1300 children.push_back(std::make_unique<DocSymbol>(*
this,parent,
DocSymbol::Sym_At));
1352 if (tok!=
TK_WORD) children.push_back(std::make_unique<DocWhiteSpace>(*
this,parent,
" "));
1366 if (tok!=
TK_WORD) children.push_back(std::make_unique<DocWhiteSpace>(*
this,parent,
" "));
1380 if (tok!=
TK_WORD) children.push_back(std::make_unique<DocWhiteSpace>(*
this,parent,
" "));
1445 children.push_back(std::make_unique<DocFormula>(*
this,parent,
context.
token->
id));
1453 children.push_back(std::unique_ptr<DocAnchor>(anchor));
1462 children.push_back(std::unique_ptr<DocInternalRef>(ref));
1480 ((
DocPara *)parent) -> handleImage(
"image");
1632 children.push_back(std::make_unique<DocSymbol>(*
this,parent,s));
1643 if (
insidePRE(parent) || !children.empty())
1645 children.push_back(std::make_unique<DocWhiteSpace>(*
this,parent,
context.
token->
chars));
1659 children.push_back(std::make_unique<DocWord>(*
this,parent,
context.
token->
name));
1667 children.push_back(std::make_unique<DocWord>(*
this,parent,
context.
token->
name));
1686 for (
const auto &opt : tagHtmlAttribs)
1689 if (opt.name==
"src" && !opt.value.isEmpty())
1694 attrList.erase(attrList.begin()+index);
1697 std::make_unique<DocImage>(
1698 *
this,parent,attrList,
1715 DBG((
"decodeSymbol(%s)\n",
qPrint(symName)));
1722 DocNode(parser), m_symName(symName), m_index(-1)
1729 if (locSymName.
at(len-1)!=
':') locSymName.
append(
":");
1730 if (locSymName.
at(0)!=
':') locSymName.
prepend(
":");
1747 if (doc.
isEmpty())
return retval;
1756 lastPar = (
DocPara*)children.back().get();
1763 retval=par->
parse();
1766 children.push_back(std::unique_ptr<DocNode>(par));
1797 for (
const auto &s : examplePathList)
1817 "Possible candidates:\n%s",
qPrint(file),
1825 "Check your EXAMPLE_PATH",
qPrint(file));
1847 DocNode(parser), m_word(word), m_ref(ref),
1848 m_file(file), m_relPath(parser.context.relPath), m_anchor(anchor),
1873 if (
id.left(anchorPrefix.
length()) == anchorPrefix)
1915 :
DocNode(parser), m_context(context), m_text(text), m_type(t),
1916 m_isExample(isExample), m_exampleFile(exampleFile),
1917 m_relPath(parser.context.relPath), m_lang(lang), m_isBlock(isBlock)
1970 err(
"Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
1971 "Please create a bug report\n",__FILE__);
1983 "No previous '\\include' or '\\dontinclude' command for '\\%s' present",
1992 DBG((
"DocIncOperator::parse() text=%s off=%d len=%d\n",p,o,l));
1994 bool nonEmpty =
FALSE;
2004 if (nonEmpty)
break;
2032 if (nonEmpty)
break;
2063 if (nonEmpty)
break;
2092 if (nonEmpty)
break;
2162 m_relPath(parser.context.relPath)
2214 DBG((
"DocSecRefItem::parse() start\n"));
2246 switch (sec->
type())
2281 DBG((
"DocSecRefItem::parse() end\n"));
2288 DBG((
"DocSecRefList::parse() start\n"));
2319 m_children.push_back(std::unique_ptr<DocSecRefItem>(item));
2345 DBG((
"DocSecRefList::parse() end\n"));
2354 int i=ref.
find(
'#');
2369 DBG((
"DocInternalRef::parse() start\n"));
2381 DBG((
"DocInternalRef::parse() end\n"));
2433 bool isFile = compound ?
2443 !
toGroupDef(compound)->groupTitle().isEmpty()
2464 toFileDef(compound)->generateSourceFile()
2480 for (
const auto &dn : children)
2486 newChildren.insert(newChildren.end(),
2487 std::make_move_iterator(para->
children().begin()),
2488 std::make_move_iterator(para->
children().end()));
2494 children.insert(children.end(),
2495 std::make_move_iterator(newChildren.begin()),
2496 std::make_move_iterator(newChildren.end()));
2498 for (
const auto &cn : children)
2507 DBG((
"DocRef::parse() start\n"));
2550 if (numBibFiles>0 && cite && !cite->
text().
isEmpty())
2599 (
toFileDef(compound))->generateSourceFile()
2618 DBG((
"DocLink::parse() start\n"));
2625 const char *cmd_start =
"\\";
2667 else if ((p=w.
find(
'}'))!=-1)
2673 result=w.
right((
int)l-p-1);
2700 DBG((
"DocLink::parse() end\n"));
2708 const QCString &srcFile,
int srcLine) :
2741 "in any of the paths specified via DOTFILE_DIRS!",
qPrint(
m_name));
2747 const QCString &srcFile,
int srcLine) :
2780 "in any of the paths specified via MSCFILE_DIRS!",
qPrint(
m_name));
2788 const QCString &srcFile,
int srcLine) :
2821 "in any of the paths specified via DIAFILE_DIRS!",
qPrint(
m_name));
2836 DBG((
"DocVhdlFlow::parse() start\n"));
2852 DBG((
"DocVhdlFlow::parse() end\n"));
2862 m_type(t), m_relPath(parser.context.relPath),
2863 m_url(url), m_inlineImage(inlineImage)
2871 int len = (int)locName.
length();
2872 int fnd = locName.
find(
'?');
2873 if (fnd==-1) fnd=len;
2874 return fnd>=4 && locName.
mid(fnd-4,4)==
".svg";
2889 DBG((
"DocHtmlHeader::parse() start\n"));
2975 sprintf(tmp,
"<h%d>tag",
m_level);
2987 DBG((
"DocHtmlHeader::parse() end\n"));
2997 DBG((
"DocHRef::parse() start\n"));
3033 " <a href=...> tag");
3037 DBG((
"DocHRef::parse() end\n"));
3047 DBG((
"DocInternal::parse() start\n"));
3056 retval=par->
parse();
3059 m_children.push_back(std::unique_ptr<DocPara>(par));
3070 }
while (retval!=0 &&
3088 m_children.push_back(std::unique_ptr<DocSection>(s));
3089 retval = s->
parse();
3107 DBG((
"DocIndexEntry::parse() start\n"));
3200 for (
const auto &opt :
attribs)
3202 if (opt.name==
"id" && !opt.value.isEmpty())
3229 DBG((
"DocHtmlCaption::parse() start\n"));
3265 DBG((
"DocHtmlCaption::parse() end\n"));
3275 DBG((
"DocHtmlCell::parse() start\n"));
3284 m_children.push_back(std::unique_ptr<DocPara>(par));
3285 retval=par->
parse();
3302 DBG((
"DocHtmlCell::parse() end\n"));
3310 DBG((
"DocHtmlCell::parseXml() start\n"));
3319 m_children.push_back(std::unique_ptr<DocPara>(par));
3320 retval=par->
parse();
3337 DBG((
"DocHtmlCell::parseXml() end\n"));
3343 for (
const auto &attr :
attribs())
3345 if (attr.name.lower()==
"rowspan")
3347 return attr.value.toUInt();
3355 for (
const auto &attr :
attribs())
3357 if (attr.name.lower()==
"colspan")
3359 return std::max(1u,attr.value.toUInt());
3367 for (
const auto &attr :
attribs())
3371 if (attrName==
"align")
3373 if (attrValue==
"center")
3375 else if (attrValue==
"right")
3379 else if (attrName==
"class" && attrValue.
startsWith(
"markdowntable"))
3381 if (attrValue==
"markdowntableheadcenter")
3383 else if (attrValue==
"markdowntableheadright")
3385 else if (attrValue==
"markdowntableheadleft")
3387 else if (attrValue==
"markdowntableheadnone")
3389 else if (attrValue==
"markdowntablebodycenter")
3391 else if (attrValue==
"markdowntablebodyright")
3393 else if (attrValue==
"markdowntablebodyleft")
3395 else if (attrValue==
"markdowntablebodynone")
3405 for (
const auto &attr :
attribs())
3409 if (attrName==
"valign")
3411 if (attrValue==
"top")
3413 else if (attrValue==
"bottom")
3415 else if (attrValue==
"middle")
3429 DBG((
"DocHtmlRow::parse() start\n"));
3461 " for a html description title");
3477 m_children.push_back(std::unique_ptr<DocHtmlCell>(cell));
3478 retval=cell->
parse();
3485 DBG((
"DocHtmlRow::parse() end\n"));
3493 DBG((
"DocHtmlRow::parseXml() start\n"));
3523 " for a html description title");
3538 m_children.push_back(std::unique_ptr<DocHtmlCell>(cell));
3545 DBG((
"DocHtmlRow::parseXml() end\n"));
3555 DBG((
"DocHtmlTable::parse() start\n"));
3597 " for a <tr> or <caption> tag");
3609 m_children.push_back(std::unique_ptr<DocHtmlRow>(tr));
3615 DBG((
"DocHtmlTable::parse() end\n"));
3623 DBG((
"DocHtmlTable::parseXml() start\n"));
3631 bool isHeader=
FALSE;
3650 m_children.push_back(std::unique_ptr<DocHtmlRow>(tr));
3657 DBG((
"DocHtmlTable::parseXml() end\n"));
3683 for (
const auto &rowNode :
children())
3691 for (
const auto &cellNode : row->
children())
3699 for (i=0;i<rowSpans.size();i++)
3701 if (rowSpans[i].rowsLeft>0 &&
3702 rowSpans[i].column==colIdx)
3704 colIdx=rowSpans[i].column+1;
3708 if (rs>0) rowSpans.emplace_back(rs,colIdx);
3716 for (i=0;i<rowSpans.size();i++)
3718 if (rowSpans[i].rowsLeft>0) rowSpans[i].rowsLeft--;
3724 if (colIdx-1>maxCols) maxCols=colIdx-1;
3736 for (
const auto &n :
m_children) n->accept(v);
3748 DBG((
"DocHtmlDescTitle::parse() start\n"));
3755 const char *cmd_start =
"\\";
3764 bool isJavaLink=
FALSE;
3787 m_children.push_back(std::unique_ptr<DocRef>(ref));
3818 m_children.push_back(std::unique_ptr<DocLink>(lnk));
3890 DBG((
"DocHtmlDescTitle::parse() end\n"));
3901 DBG((
"DocHtmlDescData::parse() start\n"));
3909 m_children.push_back(std::unique_ptr<DocPara>(par));
3910 retval=par->
parse();
3915 DBG((
"DocHtmlDescData::parse() end\n"));
3925 DBG((
"DocHtmlDescList::parse() start\n"));
3950 " for a html description title");
3963 m_children.push_back(std::unique_ptr<DocHtmlDescTitle>(dt));
3965 m_children.push_back(std::unique_ptr<DocHtmlDescData>(dd));
3985 DBG((
"DocHtmlDescList::parse() end\n"));
3993 DBG((
"DocHtmlListItem::parse() start\n"));
4004 m_children.push_back(std::unique_ptr<DocPara>(par));
4005 retval=par->
parse();
4016 DBG((
"DocHtmlListItem::parseXml() start\n"));
4027 m_children.push_back(std::unique_ptr<DocPara>(par));
4028 retval=par->
parse();
4029 if (retval==0)
break;
4050 DBG((
"DocHtmlList::parse() start\n"));
4093 " for a html list item");
4108 m_children.push_back(std::unique_ptr<DocHtmlListItem>(li));
4125 DBG((
"DocHtmlList::parseXml() start\n"));
4154 " for a html list item");
4167 m_children.push_back(std::unique_ptr<DocHtmlListItem>(li));
4169 if (retval==0)
break;
4190 DBG((
"DocHtmlBlockQuote::parse() start\n"));
4201 m_children.push_back(std::unique_ptr<DocPara>(par));
4202 retval=par->
parse();
4215 DBG((
"DocParBlock::parse() start\n"));
4226 m_children.push_back(std::unique_ptr<DocPara>(par));
4227 retval=par->
parse();
4256 m_children.push_back(std::unique_ptr<DocSimpleListItem>(li));
4282 retval=par->
parse();
4285 m_children.push_back(std::unique_ptr<DocPara>(par));
4326 m_children.push_back(std::unique_ptr<DocAutoListItem>(li));
4348 DBG((
"DocTitle::parse() start\n"));
4361 DBG((
"DocTitle::parse() end\n"));
4387 for (
const auto &n :
m_children) n->accept(v);
4393 DBG((
"DocSimpleSect::parse() start\n"));
4415 if (needsSeparator)
m_children.push_back(std::make_unique<DocSimpleSectSep>(
m_parser,
this));
4416 m_children.push_back(std::unique_ptr<DocPara>(par));
4419 int retval = par->
parse();
4421 DBG((
"DocSimpleSect::parse() end retval=%d\n",retval));
4427 DBG((
"DocSimpleSect::parseRcs() start\n"));
4438 DBG((
"DocSimpleSect::parseRcs()\n"));
4444 DBG((
"DocSimpleSect::parse() start\n"));
4462 m_children.push_back(std::unique_ptr<DocPara>(par));
4465 retval = par->
parse();
4466 if (retval == 0)
break;
4474 DBG((
"DocSimpleSect::parseXml() end retval=%d\n",retval));
4484 m_children.push_back(std::unique_ptr<DocPara>(p));
4505 case See:
return "see";
4506 case Return:
return "return";
4508 case Authors:
return "author";
4509 case Version:
return "version";
4510 case Since:
return "since";
4511 case Date:
return "date";
4512 case Note:
return "note";
4513 case Warning:
return "warning";
4514 case Pre:
return "pre";
4515 case Post:
return "post";
4517 case Invar:
return "invariant";
4518 case Remark:
return "remark";
4520 case User:
return "user";
4521 case Rcs:
return "rcs";
4531 DBG((
"DocParamList::parse() start\n"));
4551 if (typeSeparator!=-1)
4578 "argument of command %s",
qPrint(saveCmdName));
4595 retval = par->
parse();
4600 DBG((
"DocParamList::parse() end retval=%d\n",retval));
4607 DBG((
"DocParamList::parseXml() start\n"));
4627 retval = par->
parse();
4648 if (retval == 0)
break;
4666 DBG((
"DocParamList::parse() end retval=%d\n",retval));
4675 DBG((
"DocParamSect::parse() start\n"));
4695 m_children.push_back(std::unique_ptr<DocParamList>(pl));
4702 retval = pl->
parse(cmdName);
4709 DBG((
"DocParamSect::parse() end retval=%d\n",retval));
4718 bool needsSeparator =
FALSE;
4726 needsSeparator =
TRUE;
4731 m_children.push_back(std::unique_ptr<DocSimpleSect>(ss));
4747 bool xmlContext=
FALSE,
4761 m_children.push_back(std::unique_ptr<DocParamSect>(ps));
4782 "argument of command %s\n",
qPrint(
"cite"));
4793 std::make_unique<DocCite>(
4814 "argument of command %s\n",
qPrint(
"emoji"));
4824 std::make_unique<DocEmoji>(
4840 m_children.push_back(std::unique_ptr<DocXRefItem>(ref));
4866 DBG((
"handleIncludeOperator(%s)\n",
qPrint(saveCmdName)));
4880 "argument of command %s",
qPrint(saveCmdName));
4911 m_children.push_back(std::unique_ptr<DocIncOperator>(op));
4918 bool inlineImage =
false;
4932 for (
const auto &opt : optList)
4934 if (opt.empty())
continue;
4938 locOptLow = locOpt.
lower();
4939 if (locOptLow ==
"inline")
4948 "multiple use of option 'anchor' for '%s' command, ignoring: '%s'",
4953 anchorStr = locOpt.
mid(7);
4959 "unknown option '%s' for '%s' command specified",
5003 "%s command is not valid",
5019 m_children.push_back(std::unique_ptr<DocAnchor>(anchor));
5024 m_children.push_back(std::unique_ptr<DocImage>(img));
5059 m_children.push_back(std::unique_ptr<DocVhdlFlow>(vf));
5083 m_children.push_back(std::unique_ptr<DocLink>(lnk));
5094 DBG((
"handleRef(%s)\n",
qPrint(saveCmdName)));
5112 m_children.push_back(std::unique_ptr<DocRef>(ref));
5120 DBG((
"handleInclude(%s)\n",
qPrint(cmdName)));
5123 bool isBlock =
false;
5130 auto contains = [&optList](
const char *kw)
5132 return std::find(optList.begin(),optList.end(),kw)!=optList.end();
5182 "argument of command %s",
qPrint(saveCmdName));
5223 inc_line =
lineBlock(inc_text, blockId);
5227 Markdown markdown(fileName,inc_line);
5240 m_children.push_back(std::unique_ptr<DocInclude>(inc));
5260 "argument of command %s\n",
qPrint(saveCmdName));
5278 m_children.push_back(std::unique_ptr<DocHtmlHeader>(header));
5279 int retval = header->
parse();
5356 DBG((
"handleCommand(%s)\n",
qPrint(cmdName)));
5491 m_children.push_back(std::unique_ptr<DocSimpleList>(sl));
5492 retval = sl->
parse();
5597 dv->setWidth(width);
5598 dv->setHeight(height);
5621 dv->setWidth(width);
5622 dv->setHeight(height);
5637 int idx = fullMatch.
find(
'{');
5638 int idxEnd = fullMatch.
find(
"}",idx+1);
5645 for (
const auto &opt : optList)
5647 if (opt.empty())
continue;
5677 if (engine.
isEmpty()) engine =
"uml";
5699 if (engine ==
"ditaa")
5703 else if (engine ==
"uml")
5705 int i = trimmedVerb.
find(
'\n');
5706 QCString firstLine = i==-1 ? trimmedVerb : trimmedVerb.
left(i);
5720 m_children.push_back(std::unique_ptr<DocVerbatim>(dv));
5768 m_children.push_back(std::unique_ptr<DocAnchor>(anchor));
5777 m_children.push_back(std::unique_ptr<DocIndexEntry>(ie));
5778 retval = ie->
parse();
5790 m_children.push_back(std::unique_ptr<DocParBlock>(block));
5791 retval = block->
parse();
5861 "ignoring \\dotfile command because HAVE_DOT is not set");
5865 handleFile<DocDotFile>(cmdName);
5872 handleFile<DocMscFile>(cmdName);
5875 handleFile<DocDiaFile>(cmdName);
5896 m_children.push_back(std::unique_ptr<DocSecRefList>(list));
5909 std::make_unique<DocFormula>(
5922 m_children.push_back(std::unique_ptr<DocInternalRef>(ref));
5950 const char *attrName,
5954 for (
const auto &opt : tagHtmlAttribs)
5956 if (opt.name==attrName)
5958 *result = opt.value;
5967 DBG((
"handleHtmlStartTag(%s,%d)\n",
qPrint(tagName),tagHtmlAttribs.size()));
5982 m_children.push_back(std::unique_ptr<DocHtmlList>(list));
5983 retval=list->
parse();
5990 m_children.push_back(std::unique_ptr<DocHtmlList>(list));
5991 retval=list->
parse();
6071 m_children.push_back(std::unique_ptr<DocHtmlDescList>(list));
6072 retval=list->
parse();
6085 m_children.push_back(std::unique_ptr<DocHtmlTable>(table));
6086 retval=table->
parse();
6141 m_children.push_back(std::unique_ptr<DocHtmlBlockQuote>(block));
6142 retval = block->
parse();
6280 m_children.push_back(std::unique_ptr<DocLink>(lnk));
6324 m_children.push_back(std::unique_ptr<DocSimpleSect>(ss));
6349 m_children.push_back(std::unique_ptr<DocHtmlTable>(table));
6355 m_children.push_back(std::unique_ptr<DocHtmlList>(list));
6382 DBG((
"handleHtmlEndTag(%s)\n",
qPrint(tagName)));
6581 DBG((
"DocPara::parse() start\n"));
6644 DBG((
"previous list item at %d\n",al->
indent()));
6669 m_children.push_back(std::unique_ptr<DocAutoList>(al));
6670 retval = al->
parse();
6726 "has invalid indent level");
6875 m_children.push_back(std::unique_ptr<DocSimpleSect>(ss));
6929 retval=par->
parse();
6932 m_children.push_back(std::unique_ptr<DocPara>(par));
6946 m_children.push_back(std::unique_ptr<DocInternal>(in));
6953 }
while (retval!=0 &&
6974 m_children.push_back(std::unique_ptr<DocSection>(s));
6975 retval = s->
parse();
6988 m_children.push_back(std::unique_ptr<DocSection>(s));
6989 retval = s->
parse();
7002 m_children.push_back(std::unique_ptr<DocSection>(s));
7003 retval = s->
parse();
7030 DBG((
"DocText::parse() start\n"));
7130 DBG((
"DocText::parse() end\n"));
7138 DBG((
"DocRoot::parse() start\n"));
7150 retval=par->
parse();
7153 m_children.push_back(std::unique_ptr<DocPara>(par));
7175 m_children.push_back(std::unique_ptr<DocSection>(s));
7176 retval = s->
parse();
7204 m_children.push_back(std::unique_ptr<DocSection>(s));
7205 retval = s->
parse();
7235 m_children.push_back(std::unique_ptr<DocSection>(s));
7236 retval = s->
parse();
7258 m_children.push_back(std::unique_ptr<DocInternal>(in));
7259 retval = in->
parse(1);
7275 m_children.push_back(std::unique_ptr<DocSection>(s));
7276 retval = s->
parse();
7293 DBG((
"DocRoot::parse() end\n"));
7301 bool insideDQuote=
FALSE;
7302 bool insideSQuote=
FALSE;
7304 while (j<len && !found)
7306 if (!insideSQuote && !insideDQuote)
7310 case '(': round++;
break;
7311 case ')': round--;
break;
7312 case '"': insideDQuote=
TRUE;
break;
7313 case '\'': insideSQuote=
TRUE;
break;
7321 else if (insideSQuote)
7323 if (data[j]==
'\'' && (j==0 || data[j]!=
'\\'))
7328 else if (insideDQuote)
7330 if (data[j]==
'"' && (j==0 || data[j]!=
'\\'))
7337 if (
qstrncmp(data+j,
" const",6)==0)
7341 else if (
qstrncmp(data+j,
" volatile",9)==0)
7355 #define CHECK_FOR_COMMAND(str,action) \
7356 do if ((i+sizeof(str)<len) && qstrncmp(data+i+1,str,sizeof(str)-1)==0) \
7357 { j=i+sizeof(str); action; } while(0)
7362 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
7373 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
7395 if ((data[i]==
'@' || data[i]==
'\\') &&
7396 (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\')))
7400 return i+endMarker.
length()+1;
7406 return i<len ? i+1 : len;
7417 if (c==
'@' || c==
'\\')
7424 while (j<len && (data[j]==
' ' || data[j]==
'\t')) j++;
7452 "Found recursive @copy%s or @copydoc relation for argument '%s'.\n",
7453 isBrief?
"brief":
"details",
qPrint(
id));
7459 "@copy%s or @copydoc target '%s' not found", isBrief?
"brief":
"details",
7473 buf.
addStr(data+orgPos,i-orgPos);
7496 const QCString &fileName,
int startLine,
7498 const QCString &input,
bool indexWords,
7499 bool isExample,
const QCString &exampleName,
7500 bool singleLine,
bool linkFromIndex,
7501 bool markdownSupport)
7678 return new DocRef(parser,0,target,context);
Node representing an HTML blockquote
Node representing an item of a auto list
virtual QCString getSourceFileBase() const =0
Node representing a Hypertext reference
Node representing a style change
std::vector< std::string > StringVector
DocInternalRef(DocParser &parser, DocNode *parent, const QCString &target)
void handleLink(const QCString &cmdName, bool isJavaLink)
Node representing a verbatim, unparsed text fragment
DocSymbol::SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name
int handleCommand(const QCString &cmdName, const int tok)
static bool insideUL(DocNode *n)
void appendLinkWord(const QCString &word)
Parser's context to store all global variables.
std::stack< const DocStyleChange * > DocStyleChangeStack
Node representing a simple section title
Node representing a paragraph in the documentation tree
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
void warn_incomplete_doc(const QCString &file, int line, const char *fmt,...)
GroupDef * toGroupDef(Definition *d)
QCString markdownFileNameToId(const QCString &fileName)
processes string s and converts markdown into doxygen/html commands.
virtual int docLine() const =0
static RefListManager & instance()
Alignment alignment() const
bool getDefs(const QCString &scName, const QCString &mbName, const QCString &args, const MemberDef *&md, const ClassDef *&cd, const FileDef *&fd, const NamespaceDef *&nd, const GroupDef *&gd, bool forceEmptyScope, const FileDef *currentFile, bool checkCV)
bool resolveLink(const QCString &scName, const QCString &lr, bool, const Definition **resContext, QCString &resAnchor)
bool isPreformatted() const
static const char * tokToString(int token)
static bool insideOL(DocNode *n)
void push_back(const Argument &a)
Node representing a HTML table
void setStateInternalRef()
void handleInclude(const QCString &cmdName, DocInclude::Type t)
virtual QCString briefDescription(bool abbr=FALSE) const =0
std::stack< const DocNode * > DocNodeStack
DocCite(DocParser &parser, DocNode *parent, const QCString &target, const QCString &context)
The common base class of all entity definitions found in the sources.
const HtmlAttribList & attribs() const
static void createFlowChart(const MemberDef *)
virtual QCString documentation() const =0
QCString process(const QCString &input, int &startNewlines, bool fromParseInput=false)
const CiteInfo * find(const QCString &label) const
Return the citation info for a given label.
Default accept implementation for compound nodes in the abstract syntax tree.
void handleParameterType(DocNode *parent, DocNodeList &children, const QCString ¶mTypes)
static FileNameLinkedMap * imageNameLinkedMap
bool remove(const std::string &path, bool acceptsAbsPath=true) const
QCString relativePathToRoot(const QCString &name)
DocAutoList(DocParser &parser, DocNode *parent, int indent, bool isEnumList, int depth)
An abstract interface of a namespace symbol.
Class representing a directory in the file system
StringMultiSet retvalsFound
std::stack< DocParserContext > contextStack
Helper class to compute the grid for an HTML style table
void handleIncludeOperator(const QCString &cmdName, DocIncOperator::Type t)
virtual bool isLinkable() const =0
DocSection(DocParser &parser, DocNode *parent, int level, const QCString &id)
const HtmlAttribList & attribs() const
Root node of documentation tree
static FileNameLinkedMap * diaFileNameLinkedMap
uint length() const
Returns the length of the string, not counting the 0-terminator.
Class representing a list of HTML attributes.
std::vector< ActiveRowSpan > RowSpanList
List of ActiveRowSpan classes.
This class represents an function or template argument list.
QCString m_includeFileName
void findSections(const QCString &input, const Definition *d, const QCString &fileName)
@ RetVal_OK
Command starting with \
void markLast(bool b=TRUE)
int internalValidatingParseDoc(DocNode *parent, DocNodeList &children, const QCString &doc)
void markFirst(bool v=TRUE)
virtual int getDefLine() const =0
int findRev(char c, int index=-1, bool cs=TRUE) const
void handleInitialStyleCommands(DocPara *parent, DocNodeList &children)
Node representing a HTML list item
static FileNameLinkedMap * dotFileNameLinkedMap
bool isEmpty() const
Returns TRUE iff the string is empty
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
void handlePendingStyleCommands(DocNode *parent, DocNodeList &children)
Node representing a VHDL flow chart
Abstract node interface with type information.
int parse(const QCString &cmdName)
static PageLinkedMap * pageLinkedMap
QCString findAndCopyImage(const QCString &fileName, DocImage::Type type, bool doWarn=true)
static IndexList * indexList
virtual QCString groupTitle() const =0
virtual const MemberDef * inheritsDocsFrom() const =0
int parse(bool userTitle, bool needsSeparator)
Node representing a HTML description data
void handleSection(const QCString &cmdName)
void handleLinkedWord(DocNode *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE)
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
uint size() const
Returns the length of the string, not counting the 0-terminator.
This struct represents an item in the list of references.
Node representing a Html description item
void handleStyleEnter(DocNode *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName, const HtmlAttribList *attribs)
static std::vector< QCString > split(const QCString &str, const QCString &sep, bool allowEmptyEntries=FALSE, bool cleanup=TRUE)
MemberDef * toMemberDef(Definition *d)
SrcLangExt
Language as given by extension
void init(const char *input, const QCString &fileName, bool markdownSupport)
bool includeFileShowLineNo
static NamespaceDefMutable * globalScope
static SymType decodeSymbol(const QCString &symName)
Node representing a reference to a section
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Node representing an anchor
std::vector< const Definition * > DefinitionStack
void err(const char *fmt,...)
static const char * g_sectionLevelToName[]
char & at(size_t i)
Returns a reference to the character at index i.
int handleHtmlEndTag(const QCString &tagName)
void accept(DocVisitor *v) override
void addStr(const QCString &s)
int find(char c, int index=0, bool cs=TRUE) const
Root node of a text fragment
int handleAHref(DocNode *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
const char * styleString() const
static CitationManager & instance()
void defaultHandleTitleAndSize(const int cmd, DocNode *parent, DocNodeList &children, QCString &width, QCString &height)
int parse(const QCString &cmdName, bool xmlContext, Direction d)
Abstract visitor that participates in the visitor pattern.
ClassDef * getClass(const QCString &n)
int qstrncmp(const char *str1, const char *str2, size_t len)
QCString processCopyDoc(const char *data, uint &len)
void replaceToken(TokenInfo *newToken)
static FileNameLinkedMap * exampleNameLinkedMap
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
virtual QCString docFile() const =0
virtual QCString getReference() const =0
DocRef(DocParser &parser, DocNode *parent, const QCString &target, const QCString &context)
void setRowIndex(uint idx)
void warn(const QCString &file, int line, const char *fmt,...)
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
DocInternalRef * handleInternalRef(DocNode *parent)
static bool isFlagSet(DebugMask mask)
Iterator class to iterator through matches.
virtual bool isObjCMethod() const =0
Node representing a Html description list
int handleParamSection(const QCString &cmdName, DocParamSect::Type t, bool xmlContext, int direction)
Class representing a string buffer optimised for growing.
DirIterator end(const DirIterator &) noexcept
Node representing a include/dontinclude operator block
void accept(DocVisitor *v) override
DocLinkedWord(DocParser &parser, DocNode *parent, const QCString &word, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &tooltip)
int contains(char c, bool cs=TRUE) const
PageDef * toPageDef(Definition *d)
virtual bool isLinkable() const =0
Node representing an entry in the index.
A model of a page symbol.
A model of a group of symbols.
const MemberDef * memberDef
Node representing a list of section references
static FileNameLinkedMap * inputNameLinkedMap
DocDotFile(DocParser &parser, DocNode *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
DocVerbatim(DocParser &parser, DocNode *parent, const QCString &context, const QCString &text, Type t, bool isExample, const QCString &exampleFile, bool isBlock=FALSE, const QCString &lang=QCString())
ActiveRowSpan(uint rows, uint col)
bool injectToken(int tok, const QCString &tokText)
void setStatePlantUMLOpt()
void pushBackHtmlTag(const QCString &tag)
virtual QCString anchor() const =0
bool defaultHandleToken(DocNode *parent, int tok, DocNodeList &children, bool handleWord=TRUE)
static Mapper * htmlTagMapper
QCString extractBlock(const QCString &text, const QCString &marker)
Returns the section of text, in between a pair of markers.
static bool insideLI(DocNode *n)
A model of a class/file/namespace member symbol.
Node representing an item of a cross-referenced list
static uint skipToEndMarker(const char *data, uint i, uint len, const QCString &endMarker)
static bool insidePRE(DocNode *n)
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
Node representing an image
static int subpageNestingLevel
A abstract class representing of a compound symbol.
const HtmlAttribList & attribs() const
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
virtual Kind kind() const =0
static bool isspace(char c)
List of cross-referenced items
std::vector< std::unique_ptr< DocNode > > DocNodeList
void handleFile(const QCString &cmdName)
QCString left(size_t len) const
Kind kind() const override
virtual QCString name() const =0
virtual bool isDefine() const =0
void addImageFile(const QCString &name)
void accept(DocVisitor *v) override
RefItem * find(int itemId)
void errorHandleDefaultToken(DocNode *parent, int tok, DocNodeList &children, const QCString &txt)
Node representing a HTML table caption
DocLink(DocParser &parser, DocNode *parent, const QCString &target)
virtual QCString getOutputFileBase() const =0
Returns the unique base name (without extension) of the class's file on disk
Data associated with a token used by the comment block parser.
void setVisibleCells(uint n)
void setRowIndex(uint idx)
const char * typeAsString() const
Node representing a parameter list.
virtual QCString label() const =0
int handleStyleArgument(DocNode *parent, DocNodeList &children, const QCString &cmdName)
QCString removeRedundantWhiteSpace(const QCString &s)
void markFirst(bool b=TRUE)
static const char * retvalToString(int retval)
virtual QCString name() const =0
DocMscFile(DocParser &parser, DocNode *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
static GroupLinkedMap * groupLinkedMap
void setParent(DocNode *parent)
virtual void addWord(const QCString &word, bool hiPriority)=0
DocVhdlFlow(DocParser &parser, DocNode *parent)
DocHtmlCaption(DocParser &parser, DocNode *parent, const HtmlAttribList &attribs)
DocAutoListItem(DocParser &parser, DocNode *parent, int indent, int num)
void markLast(bool v=TRUE)
This class contains the information about the argument of a function or template
Node representing an block of paragraphs
virtual const ClassDef * getClassDef() const =0
int symbol2index(const std::string &symName) const
Returns a code for the requested Emoji entity name
DocRoot * validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
void handleUnclosedStyleCommands()
void computeTableGrid()
determines the location of all cells in a grid, resolving row and column spans.
QCString fileName() const
Node representing a reference to some item
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
QCString typeString() const
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
QCString showFileDefMatches(const FileNameLinkedMap *fnMap, const QCString &n)
DocStyleChangeStack styleStack
virtual QCString getOutputFileBase() const =0
Node representing a parameter section
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
DocParamSect::Type m_type
const DocNodeList & children() const
static const std::set< std::string > g_plantumlEngine
int parseXml(const QCString ¶mName)
Node representing a Html list
virtual void detectUndocumentedParams(bool hasParamCommand, bool hasReturnCommand) const =0
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
virtual const MemberDef * reimplements() const =0
const T * find(const std::string &key) const
Find an object given the key.
Node representing a simple section
Node representing a normal section
DocText * validatingParseText(IDocParser &parserIntf, const QCString &input)
void markLast(bool v=TRUE)
virtual DefType definitionType() const =0
static void unescapeCRef(QCString &s)
Node representing an included text block from file
void markFirst(bool v=TRUE)
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
void handleRef(const QCString &cmdName)
DocImage(DocParser &parser, DocNode *parent, const HtmlAttribList &attribs, const QCString &name, Type t, const QCString &url=QCString(), bool inlineImage=TRUE)
Node representing an auto List
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
Node representing an internal section of documentation
friend class DocParamList
virtual QCString getReference() const =0
void setInsidePreformatted(bool p)
virtual QCString qualifiedName() const =0
void setLocation(const QCString &file, int line)
QCString stripIndentation(const QCString &s)
DocStyleChangeStack initialStyleStack
static SearchIndexIntf * searchIndex
DocSimpleSect(DocParser &parser, DocNode *parent, Type t)
DocDiaFile(DocParser &parser, DocNode *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
DocRef * createRef(IDocParser &parserIntf, const QCString &target, const QCString &context)
DocHtmlCaption * m_caption
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
void setInsidePre(bool b)
static QCString stripKnownExtensions(const QCString &text)
virtual void visitPost(DocAutoList *)=0
static QCString extractCopyDocId(const char *data, uint &j, uint len)
virtual QCString getOutputFileBase() const =0
void markFirst(bool v=TRUE)
virtual QCString anchor() const =0
int handleHtmlStartTag(const QCString &tagName, const HtmlAttribList &tagHtmlAttribs)
DocAnchor * handleAnchor(DocNode *parent)
#define Config_getBool(name)
QCString & append(char c)
void checkUnOrMultipleDocumentedParams()
void handleImg(DocNode *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
static QCString htmlFileExtension
virtual QCString objCMethodName(bool localLink, bool showStatic) const =0
virtual bool isDocsForDefinition() const =0
virtual QCString getScopeString() const =0
static SectionManager & instance()
returns a reference to the singleton
Class representing a regular expression.
Helper class to process markdown formatted text
virtual QCString getReference() const =0
If this class originated from a tagfile, this will return the tag file reference
DocEmoji(DocParser &parser, DocNode *parent, const QCString &symName)
static bool insideTable(DocNode *n)
virtual QCString documentation() const =0
QCString fileName() const
virtual const ArgumentList & declArgumentList() const =0
void setLineNr(int lineno)
void setUseBitmap(const bool &u)
virtual void setCurrentDoc(const Definition *ctx, const QCString &anchor, bool isSourceFile)=0
Node representing a link to some item
virtual Definition * getOuterScope() const =0
@ TK_HTMLTAG
Command starting with @
void setEngine(const QCString &e)
void setColumnIndex(uint idx)
bool startsWith(const char *s) const
Minimal replacement for QFileInfo.
static void flattenParagraphs(DocNode *root, DocNodeList &children)
DocSecRefItem(DocParser &parser, DocNode *parent, const QCString &target)
virtual QCString absFilePath() const =0
const char * qPrint(const char *s)
#define INTERNAL_ASSERT(x)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
#define Config_getString(name)
StringMultiSet paramsFound
std::multiset< std::string > StringMultiSet
virtual QCString getDefFileName() const =0
class that provide information about a section.
int handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs, int level)
static Mapper * cmdMapper
int parseXml(bool header)
virtual const ArgumentList & argumentList() const =0
bool resolveRef(const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, bool lookForSpecialization, const FileDef *currentFile, bool checkScope)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
static bool findAttribute(const HtmlAttribList &tagHtmlAttribs, const char *attrName, QCString *result)
static NamespaceLinkedMap * namespaceLinkedMap
int handleSimpleSection(DocSimpleSect::Type t, bool xmlContext=FALSE)
Node representing a simple list
DefinitionStack copyStack
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
static FileNameLinkedMap * mscFileNameLinkedMap
int map(const QCString &n)
Node representing a simple list item
A model of a file symbol.
const DocNodeList & children() const
FileDef * toFileDef(Definition *d)
virtual QCString text() const =0
const HtmlAttribList & attribs() const
bool isAbsolutePath(const QCString &fileName)
DocAnchor(DocParser &parser, DocNode *parent, const QCString &id, bool newAnchor)
static EmojiEntityMapper * instance()
Returns the one and only instance of the Emoji entity mapper
void readTextFileByName(const QCString &file, QCString &text)
#define TK_COMMAND_CHAR(token)
Node representing a HTML table cell
Portable versions of functions that are platform dependent.
void markLast(bool v=TRUE)
QCString sectionTitle() const
virtual QCString briefDescriptionAsTooltip() const =0
void setStateTitleAttrValue()
Node representing an internal reference to some item
AutoNodeStack(DocParser &parser, const DocNode *node)
void setText(const QCString &t)
static ClassLinkedMap * classLinkedMap
DocXRefItem(DocParser &parser, DocNode *parent, int id, const QCString &key)
A bunch of utility functions.
Valignment valignment() const
void setHeight(const QCString &h)
#define CHECK_FOR_COMMAND(str, action)
Node representing a HTML table row
void setWidth(const QCString &w)
void handleStyleLeave(DocNode *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName)
DocWord(DocParser &parser, DocNode *parent, const QCString &word)
void handleImage(const QCString &cmdName)
static uint isCopyBriefOrDetailsCmd(const char *data, uint i, uint len, bool &brief)
QCString right(size_t len) const
QCString & prepend(const char *s)
virtual void visitPre(DocAutoList *)=0
bool findDocsForMemberOrCompound(const QCString &commandName, QCString *pDoc, QCString *pBrief, const Definition **pDef)
uint qstrlen(const char *str)
QCString & sprintf(const char *format,...)
void parseFromString(const QCString &title)
QCString anchorPrefix() const
QCString parse(bool, bool isXmlLink=FALSE)
std::unique_ptr< IDocParser > createDocParser()
#define Config_getList(name)
virtual bool hasParentPage() const =0
QCString fileName() const
virtual QCString anchor() const =0
static uint isVerbatimSection(const char *data, uint i, uint len, QCString &endMarker)
This is an alternative implementation of QCString.