16%option never-interactive
17%option prefix="commentscanYY"
19%option extra-type="struct commentscanYY_state *"
23#define YY_TYPEDEF_YY_SCANNER_T
24#define yyguts_t commentscanYYguts_t
44#include <unordered_map>
214static const std::unordered_map< std::string, DocCmdMap >
docCmdMap =
425#define YY_NO_UNISTD_H 1
426#define YY_NEVER_INTERACTIVE 1
560 const DString &listTitle,
bool append);
577#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
582#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Represents an unstructured piece of information, about an entity found in the sources.
Wrapper class for the Entry type.
Minimal replacement for QFileInfo.
Abstract interface for outline parsers.
std::vector< std::string > StringVector
#define lineCount(s, len)
Some helper functions for std::string.
DocCmdMap(DocCmdFunc h, CommandSpacing s, SectionHandling sh)
SectionHandling sectionHandling
HtmlContextInfo(const DString &tn, OutputContext ctx)
A bunch of utility functions.
593TABLE ("table"|"TABLE")
594TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
604CAPTION ("caption"|"CAPTION")
605CENTER ("center"|"CENTER")
607DETAILS ("details"|"DETAILS")
608BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
609DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
610DETAILEDHTMLOPT {CODE}
611DETAILEDHTMLOPTEND {ENDCODE}
612SUMMARY ("summary"|"SUMMARY")
613REMARKS ("remarks"|"REMARKS")
615ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
620DOCNL "\n"|"\\ilinebr"
623FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
624FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
625FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
626ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
627LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
628REQID [a-z_A-Z0-9\x80-\xFF\-]+
629CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
630CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
631CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
632SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
633SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
634TMPLSPEC "<"{BN}*[^>]+{BN}*">"
635MAILADDR ("mailto:")?[a-z_A-Z0-9\x80-\xff.+-]+"@"[a-z_A-Z0-9\x80-\xff-]+("."[a-z_A-Z0-9\x80-\xff\-]+)+[a-z_A-Z0-9\x80-\xff\-]+
636RCSTAG "$"{ID}":"[^\n$]+"$"
637MODULE_ID ({ID}".")*{ID}
638LINENR {Bopt}[1-9][0-9]*
639IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
640DOXYCFG [A-Z][A-Z_0-9]*
699%x ReadFormulaShortSection
701%x ReadFormulaRoundSection
715%x RaiseWarningSection
744<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
747<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
753<Comment>"\""[^"\n]*"\"" {
756<Comment>("\\"[a-z_A-Z]+)+"\\" {
759<Comment>"<"{DETAILEDHTML}{ATTR}">" {
761 size_t spacePos = htmlOpenTag.find(
' ');
763 DString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
765 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
DString mid(size_t index, size_t len=npos) const
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
773<Comment>"</"{DETAILEDHTML}">" {
775 DString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
777 if (!yyextra->htmlContextStack.empty() &&
778 yyextra->htmlContextStack.back().tagName==htmlTagName)
785 yyextra->htmlContextStack.pop_back();
789<Comment>"<"{DETAILEDHTMLOPT}">" {
791 if (yyextra->current->lang==SrcLangExt::CSharp)
793 yyextra->CScode=
true;
803<Comment>"<"{DETAILEDHTMLOPTEND}">" {
807 yyextra->CScode=
false;
811 yyextra->CScode=
false;
816<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
818 if (yyextra->current->lang==SrcLangExt::CSharp)
825<Comment>"<"{DETAILS}{ATTR}">" {
826 yyextra->htmlDetailsStack.push_back(0);
827 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
834<Comment>"</"{DETAILS}">" {
835 if (!yyextra->htmlDetailsStack.empty())
837 yyextra->htmlDetailsStack.pop_back();
839 if (!yyextra->htmlContextStack.empty() &&
840 yyextra->htmlContextStack.back().tagName==
"details")
847 yyextra->htmlContextStack.pop_back();
852 yyextra->htmlAnchorStr = yytext;
853 yyextra->htmlAnchor =
false;
857 yyextra->htmlAnchorStr += yytext;
859 size_t s=tag.find(
"=");
862 if (c==
'\'' || c==
'"')
864 size_t e=tag.find(c,s+2);
867 id=tag.mid(s+2,e-s-2);
876 if (!
id.empty() && !yyextra->htmlAnchor)
882 yyextra->htmlAnchor =
true;
885<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
886 yyextra->htmlAnchorStr += yytext;
889 if (!yyextra->htmlAnchor)
891 addOutput(yyscanner,yyextra->htmlAnchorStr);
904 yyextra->htmlAnchorStr += yytext;
905 if (*yytext ==
'\n') yyextra->lineNr++;
908 yyextra->htmlAnchorStr += yytext;
910<Comment>"<"{SUMMARY}">" {
911 if (yyextra->htmlDetailsStack.empty())
920<Comment>"<"{REMARKS}">" {
924<Comment>"</"{SUMMARY}">" {
925 if (!yyextra->htmlDetailsStack.empty())
934<Comment>"</"{REMARKS}">" {
938<Comment>"<"{CAPTION}{ATTR}">" {
940 size_t s=tag.find(
"id=");
944 if (c==
'\'' || c==
'"')
946 size_t e=tag.find(c,s+4);
956<Comment>"<"{PRE}{ATTR}">" {
957 yyextra->insidePre=
true;
960<Comment>"</"{PRE}">" {
961 yyextra->insidePre=
false;
971<Comment>"<!\[CDATA\[" {
974<Comment>{B}*{CMD}"endinternal"{B}* {
976 if (!yyextra->inInternalDocs)
977 warn(yyextra->fileName,yyextra->lineNr,
978 "found \\endinternal without matching \\internal"
980 yyextra->inInternalDocs =
false;
#define warn(file, line, fmt,...)
982<Comment>{B}*"\\ilinebr "{B}* {
985<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
995<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
996<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
999 size_t idx = fullMatch.
find(
'{');
1001 if ((idx !=
DString::npos) && (idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
1021 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1022 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1025 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1027 yyextra->briefEndsAtDot=
false;
1033 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1038 yyextra->parseMore=
true;
1040 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1043 else if (it->second.handler==
nullptr)
size_t find(char c, size_t pos=0) const
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
DString left(size_t len) const
const std::string & str() const
StringVector split(const std::string &s, const std::string &delimiter, bool retainEmpty=false)
split input string s by string delimiter delimiter.
1055<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1058<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1060 if (!langId.
empty() &&
1065 warn(yyextra->fileName,yyextra->lineNr,
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
#define Config_getEnumAsString(name)
#define Config_isAvailableEnum(name, value)
int dstricmp(const char *s1, const char *s2)
std::string_view stripWhiteSpace(std::string_view s)
Given a string view s, returns a new, narrower view on that string, skipping over any leading or trai...
1071<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1073 yyextra->formulaText=
"";
1074 yyextra->formulaPreText=
"\\begin";
1075 yyextra->formulaPostText=
"";
1077 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1080 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1082 yyextra->formulaPreText+=yyextra->formulaEnv;
1083 yyextra->formulaNewLines=0;
1084 BEGIN(ReadFormulaLong);
1086<Comment>{B}*{CMD}"f$" {
1087 yyextra->formulaText=
"";
1088 yyextra->formulaPreText=
"$";
1089 yyextra->formulaPostText=
"";
1090 yyextra->formulaNewLines=0;
1091 BEGIN(ReadFormulaShort);
1093<Comment>{B}*{CMD}"f(" {
1094 yyextra->formulaText=
"";
1095 yyextra->formulaPreText=
"";
1096 yyextra->formulaPostText=
"";
1097 yyextra->formulaNewLines=0;
1098 BEGIN(ReadFormulaRound);
1100<Comment>{B}*{CMD}"f[" {
1102 yyextra->formulaText=
"";
1103 yyextra->formulaPreText=
"\\[";
1104 yyextra->formulaPostText=
"";
1105 yyextra->formulaNewLines=0;
1106 BEGIN(ReadFormulaLong);
1108<Comment>{B}*{CMD}"{" {
1110 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1112<Comment>{B}*{CMD}"}" {
1114 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
1115 yyextra->docGroup.clearHeader();
1116 yyextra->parseMore=
true;
1117 yyextra->needNewEntry =
true;
1118 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1121<Comment>{B}*{CMD}[$@\\&~<>#%] {
1124<Comment>[a-z_A-Z]+ {
1127<Comment>^{B}*"."{Bopt}/\n {
1130<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1131<Comment>^{B}*[*+]{B}+ {
1132 if (!yyextra->markdownSupport)
1140 yyextra->briefEndsAtDot=
false;
1146<Comment>^{B}*"-"{B}+ {
1149 yyextra->briefEndsAtDot=
false;
1154<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1157<Comment>{CMD}"---" {
1164 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1167 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1172 yyextra->briefEndsAtDot=
false;
1177<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1178<Comment>("."+)[a-z_A-Z0-9\)] {
1182<Comment>{CMD}[\.?!] {
1186<Comment>".\\"[ \t] {
1193<Comment>"...\\"[ \t] {
1196<Comment>"..."/[^\.] {
1199<Comment>".."[\.]?/[^ \t\n] {
1202<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1208 for (i=0;i<(yy_size_t)yyleng;)
1210 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1211 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1218 for (i=0;i<(yy_size_t)yyleng;)
1220 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1221 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1236 if (yyextra->briefEndsAtDot)
1239 yyextra->briefEndsAtDot=
false;
1244 if (*yytext ==
'\n') yyextra->lineNr++;
1246<Comment>"<"[/]?{TABLEDEL}">" {
1264<HtmlComment>"---"[!]?">"{B}* {
1265 warn(yyextra->fileName,yyextra->lineNr,
1266 "incorrect HTML end comment --->"
1269<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1270<HtmlComment>{DOCNL} {
1277<HtmlComment>[^\\\n\-]+ {
1282<CdataSection>"\]\]>" {
1285<CdataSection>{DOCNL} {
1287 if (*yytext==
'\n') yyextra->lineNr++;
1289<CdataSection>[<>&] {
1293<CdataSection>[^\\\n\]<>&]+ {
1302<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1303 yyextra->formulaPostText+=
"$";
1306 if (YY_START == ReadFormulaShort)
1312 yyextra->sectionTitle+=
" "+form;
1313 BEGIN(SectionTitle);
1316<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1319 if (YY_START == ReadFormulaRound)
1325 yyextra->sectionTitle+=
" "+form;
1326 BEGIN(SectionTitle);
1329<ReadFormulaLong>{CMD}"f]" {
1330 yyextra->formulaPostText+=
"\\]";
1334<ReadFormulaLong>{CMD}"f}" {
1335 yyextra->formulaPostText+=
"\\end";
1336 yyextra->formulaPostText+=yyextra->formulaEnv;
1340<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1341 yyextra->formulaText+=yytext;
1343<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1344 yyextra->formulaNewLines++;
1345 yyextra->formulaText+=*yytext;
1347 addIline(yyscanner,yyextra->lineNr);
1349<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1350 yyextra->formulaText+=*yytext;
1355<EnumDocArg1>{SCOPEID} {
1357 yyextra->current->name = yytext;
1364<EnumDocArg1>{DOCNL} {
1365 warn(yyextra->fileName,yyextra->lineNr,
1366 "missing argument after '\\enum'."
1376<NameSpaceDocArg1>{SCOPENAME} {
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
DString removeRedundantWhiteSpace(const DString &s)
1382<NameSpaceDocArg1>{LC} {
1386<NameSpaceDocArg1>{DOCNL} {
1387 warn(yyextra->fileName,yyextra->lineNr,
1388 "missing argument after '\\namespace'."
1393<NameSpaceDocArg1>. {
1398<PackageDocArg1>{ID}("."{ID})* {
1399 yyextra->current->name = yytext;
1402<PackageDocArg1>{LC} {
1406<PackageDocArg1>{DOCNL} {
1407 warn(yyextra->fileName,yyextra->lineNr,
1408 "missing argument after \\package."
1420<ConceptDocArg1>{SCOPEID} {
1422 yyextra->current->name = yytext;
1425<ConceptDocArg1>{LC} {
1429<ConceptDocArg1>{DOCNL} {
1430 warn(yyextra->fileName,yyextra->lineNr,
1431 "missing argument after '\\concept'."
1440<ModuleDocArg1>{MODULE_ID} {
1442 yyextra->current->name = yytext;
1445<ModuleDocArg1>{LC} {
1449<ModuleDocArg1>{DOCNL} {
1450 warn(yyextra->fileName,yyextra->lineNr,
1451 "missing argument after '\\module'."
1461<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1465 BEGIN( ClassDocArg2 );
1467<ClassDocArg1>{SCOPENAME} {
1470 yyextra->current->name =
substitute(yytext,
".",
"::");
1471 if (yyextra->current->section.isProtocolDoc())
1473 yyextra->current->name+=
"-p";
1476 BEGIN( ClassDocArg2 );
1478<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1481 yyextra->current->name =
substitute(yytext,
".",
"::");
1482 BEGIN( ClassDocArg2 );
1484<ClassDocArg1,CategoryDocArg1>{LC} {
1488<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1489 warn(yyextra->fileName,yyextra->lineNr,
1490 "missing argument after '\\{}'.",yyextra->currentCmd
1495<ClassDocArg1,CategoryDocArg1>. {
1498<ClassDocArg2>{DOCNL} {
1502<ClassDocArg2>{FILE}|"<>" {
1503 yyextra->current->includeFile = yytext;
1504 BEGIN( ClassDocArg3 );
1513<ClassDocArg3>[<"]?{FILE}?[">]? {
1514 yyextra->current->includeName = yytext;
1521<ClassDocArg3>{DOCNL} {
1523 if (yyextra->current->includeFile!=
"<>")
1525 yyextra->current->includeName = yyextra->current->includeFile;
1535<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1536 yyextra->current->name = yytext;
1540 if (yyextra->current->name.endsWith(
".html"))
1542 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1544 else if (yyextra->current->name.endsWith(
".xhtml"))
1546 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1548 yyextra->current->type.clear();
1549 BEGIN(GroupDocArg2);
1551<GroupDocArg1>"\\"{B}*"\n" {
1555<GroupDocArg1>{DOCNL} {
1556 warn(yyextra->fileName,yyextra->lineNr,
1557 "missing group name after {}",
1558 yyextra->current->groupDocCmd()
1567<GroupDocArg2>"\\"{B}*"\n" {
1571<GroupDocArg2>[^\n\\]+ {
1572 yyextra->current->type += yytext;
1574<GroupDocArg2>{DOCNL}+ {
1575 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1577 yyextra->current->type.empty()
1580 warn(yyextra->fileName,yyextra->lineNr,
1581 "missing title after "
1582 "\\defgroup {}", yyextra->current->name
1586 int extraLineNr = 0;
1589 for (
int i = 0; i < yyleng; i++)
1591 if (yytext[i]==
'\n') extraLineNr++;
1598 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1599 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1604 yyextra->current->type += yytext;
1609<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1613 size_t start = text.
find(
'{');
1614 size_t end = text.
find(
'}',start+1);
1615 yyextra->current->name = text.
mid(
end+2);
1616 size_t istart = yyextra->current->name.
find(
"\\ilinebr");
1619 DString rest = yyextra->current->name.
mid(istart);
1621 yyextra->current->name = yyextra->current->name.left(istart);
1623 yyextra->current->args = text.
mid(start+1,
end-start-1);
1625 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1627<PageDocArg1>{FILE} {
1629 yyextra->current->args =
"";
1630 BEGIN( PageDocArg2 );
1632<PageDocArg1>{LC} { yyextra->lineNr++;
1635<PageDocArg1>{DOCNL} {
1636 warn(yyextra->fileName,yyextra->lineNr,
1637 "missing argument after \\page."
1646<PageDocArg2>{DOCNL} {
1650 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1651 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1654<PageDocArg2>{CMD}[<>] {
1659 yyextra->current->args += tmp;
1662 yyextra->current->args += yytext;
1665<FieldArg>("::")?{ID}("::"{ID})+|{ID} {
1666 yyextra->current->fieldDocs.push_back({yytext,{},yyextra->fileName,yyextra->lineNr});
1670<FieldArg>{DOCNL}|. {
1671 warn_doc_error(yyextra->fileName,yyextra->lineNr,
"expected a field name after \\field");
#define warn_doc_error(file, line, fmt,...)
1677<ParamArg1>{ID}/{B}*"," {
1684 if (*yytext==
'\n') yyextra->lineNr++;
1698<FileDocArg1>{DOCNL} {
1704<FileDocArg1>{FILE} {
1708<FileDocArg1>{LC} { yyextra->lineNr++;
1716<XRefItemParam1>{LABELID} {
1717 yyextra->newXRefItemKey=yytext;
1719 BEGIN(XRefItemParam2);
1721<XRefItemParam1>{LC} {
1725<XRefItemParam1>{DOCNL} {
1726 warn(yyextra->fileName,yyextra->lineNr,
1727 "Missing first argument of \\xrefitem"
1729 if (*yytext==
'\n') yyextra->lineNr++;
1737<XRefItemParam2>"\""[^\n\"]*"\"" {
1739 BEGIN(XRefItemParam3);
1741<XRefItemParam2>{LC} {
1745<XRefItemParam2>{DOCNL} {
1746 warn(yyextra->fileName,yyextra->lineNr,
1747 "Missing second argument of \\xrefitem"
1749 if (*yytext==
'\n') yyextra->lineNr++;
1757<XRefItemParam3>"\""[^\n\"]*"\"" {
1762<XRefItemParam2,XRefItemParam3>{LC} {
1766<XRefItemParam3>{DOCNL} {
1767 warn(yyextra->fileName,yyextra->lineNr,
1768 "Missing third argument of \\xrefitem"
1770 if (*yytext==
'\n') yyextra->lineNr++;
1781<RelatesParam1>({ID}("::"|"."))*{ID} {
1782 yyextra->current->relates = yytext;
1789<RelatesParam1>{LC} {
1793<RelatesParam1>{DOCNL} {
1794 warn(yyextra->fileName,yyextra->lineNr,
1795 "Missing argument of '\\{}' command",yyextra->currentCmd
1807<Qualifier>{LABELID} {
1808 yyextra->current->qualifiers.emplace_back(yytext);
1811<Qualifier>"\""[^\"]*"\"" {
1812 std::string inp(yytext);
1813 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1817 warn(yyextra->fileName,yyextra->lineNr,
1818 "Missing argument of '\\{}' command",yyextra->currentCmd
1824 warn(yyextra->fileName,yyextra->lineNr,
1825 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1831<ILine>{LINENR}/[\\@\n\.] |
1837 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1841 yyextra->lineNr = nr;
1844 if (YY_START == ILine)
1850 yyextra->sectionTitle+=yytext;
1851 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1854<ILine,ILineSection>. {
1856 if (YY_START == ILine)
1862 yyextra->sectionTitle+=yytext;
1863 BEGIN(SectionTitle);
1868<IRaise>{B}*[0-9]+/[\\@\n\.] |
1869<IRaise>{B}*[0-9]+{B} {
1874 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1878 yyextra->raiseLevel = nr;
1888<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1902<IFile,IFileSection>{FILE} {
1905 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1906 else yyextra->fileName = yytext;
1907 if (YY_START == IFile)
1913 yyextra->sectionTitle+=yytext;
1914 BEGIN(SectionTitle);
1918<LinkSection>[^\\@\n]* {
1919 yyextra->sectionTitle+=yytext;
1921<LinkSection>{CMD}{CMD} {
1922 yyextra->sectionTitle+=yytext;
1924<LinkSection>{DOCNL} {
1926 if (*yytext ==
'\n') yyextra->lineNr++;
1927 yyextra->sectionTitle+=yytext;
1929<LinkSection>{CMD}"endlink" {
1930 yyextra->sectionTitle+=yytext;
1931 BEGIN(SectionTitle);
1934 yyextra->sectionTitle+=yytext;
1936<LinkSection><<EOF>> {
1937 warn(yyextra->fileName,yyextra->lineNr,
1938 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1944<LineParam>{CMD}{CMD} {
1957<LineParam>({CMD}{CMD}){ID} {
1966<SectionLabel>{LABELID} {
1967 yyextra->sectionLabel+=yytext;
1969<SectionLabel>{CMD}"lineinfo"("{}")? {
DString & setNum(short n)
1972<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1973 FileInfo fi(yyextra->fileName.str());
1974 bool hasOption =
false;
1976 if (yytext[yyleng-1] ==
'}')
1982 for (
const auto &opt_ : optList)
1985 std::string opt = optStripped.
lower().
str();
1987 if (!result.
empty())
1991 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
2001 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
2013 label=yyextra->fileName;
2017 yyextra->sectionLabel+=label;
#define Config_getBool(name)
DString stripFromPath(const DString &path)
2019<SectionLabel>{DOCNL} {
2020 yyextra->sectionTitle.clear();
2021 if (yyextra->sectionLabel.empty())
2023 warn(yyextra->fileName,yyextra->lineNr,
2024 "\\section command has no label"
2029 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2030 addOutput(yyscanner,yyextra->sectionLabel.data());
2033 if (*yytext==
'\n') yyextra->lineNr++;
2038 if (yyextra->sectionLabel.empty())
2040 warn(yyextra->fileName,yyextra->lineNr,
2041 "Invalid or missing section label"
2047 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2048 addOutput(yyscanner,yyextra->sectionLabel.data());
2049 yyextra->sectionTitle.clear();
2051 BEGIN(SectionTitle);
2054<SectionTitle>{STAopt}/"\n" {
2059<SectionTitle>{STopt}"\\\\ilinebr" {
2060 yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
2062<SectionTitle>{STopt}/"\\ilinebr" {
2067<SectionTitle>{B}*{CMD}"f$" {
2068 yyextra->formulaText=
"";
2069 yyextra->formulaPreText=
"$";
2070 yyextra->formulaPostText=
"";
2071 yyextra->formulaNewLines=0;
2072 BEGIN(ReadFormulaShortSection);
2074<SectionTitle>{B}*{CMD}"f(" {
2075 yyextra->formulaText=
"";
2076 yyextra->formulaPreText=
"";
2077 yyextra->formulaPostText=
"";
2078 yyextra->formulaNewLines=0;
2079 BEGIN(ReadFormulaRoundSection);
2081<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2082<SectionTitle>{B}*{CMD}"f"[\[{] {
2086 warn(yyextra->fileName,yyextra->lineNr,
2087 "'\\{}' command is not allowed in section title, ending section title.",
2097<SectionTitle>[^\n@\\]* {
2098 yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
2101<SectionTitle>{B}*{CMD}{CMD} {
2102 yyextra->sectionTitle+=yytext;
2105<SectionTitle>{CMD}# {
2106 yyextra->sectionTitle+=yytext;
2109<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2110<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2112 size_t idx = fullMatch.
find(
'{');
2114 if ((idx !=
DString::npos) && (idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2132 switch (it->second.sectionHandling)
2137 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2138 yyextra->sectionTitle+=fullMatch.
left(i);
2139 yyextra->sectionTitle+=
'@';
2140 yyextra->sectionTitle+=fullMatch.
mid(i);
2144 warn(yyextra->fileName,yyextra->lineNr,
2145 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2153 warn(yyextra->fileName,yyextra->lineNr,
2154 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2162 if (cmdName ==
"fileinfo")
2165 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2166 yyextra->sectionTitle+=fullMatch.
left(i);
2170 else if (cmdName ==
"lineinfo")
2173 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2174 yyextra->sectionTitle+=fullMatch.
left(i);
2179 else if (cmdName ==
"raisewarning")
2181 yyextra->raiseWarning =
"";
2182 BEGIN(RaiseWarningSection);
2184 else if (cmdName ==
"noop")
2189 else if (cmdName ==
"cite")
2191 yyextra->sectionTitle+=yytext;
2193 BEGIN(CiteLabelSection);
2195 else if (cmdName ==
"iline")
2197 yyextra->sectionTitle+=yytext;
2199 BEGIN(ILineSection);
2201 else if (cmdName ==
"ifile")
2203 yyextra->sectionTitle+=yytext;
2205 BEGIN(IFileSection);
2207 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2210 if (optList.empty())
2212 yyextra -> anchorTitle =
"";
2217 yyextra -> anchorTitle =
join(optList,
" ");
2220 BEGIN(AnchorLabelSection);
2222 else if (cmdName ==
"link")
2224 yyextra->sectionTitle+=yytext;
2229 yyextra->sectionTitle+=yytext;
2230 warn(yyextra->fileName,yyextra->lineNr,
2231 "internal error '\\{}' command is to be replaced in section title.",cmdName
2238 yyextra->sectionTitle+=yytext;
2246 yyextra->sectionTitle+=yytext;
const char * qPrint(const char *s)
std::string join(const StringVector &sv, const std::string &delimiter)
create a string where the string in the vector are joined by the given delimiter
2251 yyextra->sectionTitle+=yytext;
2257<SubpageLabel>{FILE} {
2261 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2262 BEGIN(SubpageTitle);
2264<SubpageLabel>{DOCNL} {
2265 warn(yyextra->fileName,yyextra->lineNr,
2266 "\\subpage command has no label"
2268 if (*yytext==
'\n') yyextra->lineNr++;
2276<SubpageTitle>{DOCNL} {
2280<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2291<AnchorLabel,AnchorLabelSection>{LABELID} {
2292 DString lbl = yyextra->raisePrefix+yytext;
2293 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2295 if (YY_START == AnchorLabel)
2301 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2304<AnchorLabel,AnchorLabelSection>{DOCNL} {
2305 warn(yyextra->fileName,yyextra->lineNr,
2306 "\\anchor command has no label"
2308 if (*yytext==
'\n') yyextra->lineNr++;
2310 if (YY_START == AnchorLabel)
2316 BEGIN(SectionTitle);
2319<AnchorLabel,AnchorLabelSection>. {
2320 warn(yyextra->fileName,yyextra->lineNr,
2321 "Invalid or missing anchor label"
2324 if (YY_START == AnchorLabel)
2330 BEGIN(SectionTitle);
2336<RequirementLabel>{REQID} {
2337 yyextra->current->name = yytext;
2338 yyextra->current->type.clear();
2339 BEGIN( RequirementTitle );
2341<SatisfiesLabel>{REQID} {
2342 yyextra->reqId = yytext;
2343 yyextra->reqTitle.clear();
2344 BEGIN( SatisfiesTitle );
2346<VerifiesLabel>{REQID} {
2347 yyextra->reqId = yytext;
2348 yyextra->reqTitle.clear();
2349 BEGIN( VerifiesTitle );
2351<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2355<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2356 warn(yyextra->fileName,yyextra->lineNr,
2357 "missing requirement ID after \\requirement command"
2362<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2365<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2369<RequirementTitle>[^\n\\]+ {
2370 yyextra->current->type += yytext;
2372<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2373 yyextra->reqTitle += yytext;
2375<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2376 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2381<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2382 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2384 if (yyextra->current->section.isRequirementDoc())
2386 warn(yyextra->fileName,yyextra->lineNr,
2387 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2400<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2401 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2403 if (yyextra->current->section.isRequirementDoc())
2405 warn(yyextra->fileName,yyextra->lineNr,
2406 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2419<RequirementTitle>. {
2420 yyextra->current->type += yytext;
2422<SatisfiesTitle,VerifiesTitle>. {
2423 yyextra->reqTitle += yytext;
2429<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2431 if (&yytext[4]==yyextra->blockName)
2436<FormatBlock>{CMD}"enduml" {
2438 if (yyextra->blockName==
"startuml")
2443<FormatBlock>[^ \@\*\/\\\n]* {
2446<FormatBlock>{DOCNL} {
2447 if (*yytext==
'\n') yyextra->lineNr++;
2451 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2452 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2453 yyextra->blockName==
"iliteral"
2455 ) yyextra->commentCount++;
2460 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2461 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2462 yyextra->blockName==
"iliteral"
2466 yyextra->commentCount--;
2467 if (yyextra->commentCount<0)
2469 DString endTag =
"end"+yyextra->blockName;
2470 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2471 warn(yyextra->fileName,yyextra->lineNr,
2472 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2473 yyextra->blockName,endTag);
2480<FormatBlock><<EOF>> {
2481 DString endTag =
"end"+yyextra->blockName;
2482 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2483 warn(yyextra->fileName,yyextra->lineNr,
2484 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2485 yyextra->blockName,endTag
2492<GuardParam>{B}*"(" {
2493 yyextra->guardExpr=yytext;
2494 yyextra->roundCount=1;
2498 yyextra->guardExpr+=yytext;
2502 yyextra->guardExpr+=yytext;
2503 yyextra->roundCount++;
2506 yyextra->guardExpr+=yytext;
2507 yyextra->roundCount--;
2508 if (yyextra->roundCount==0)
2514 warn(yyextra->fileName,yyextra->lineNr,
2515 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2519<GuardParam>{B}*{CMD}doxyconfig{B}+{DOXYCFG} {
2522<GuardParam>{B}*[a-z_A-Z0-9.\-]+({B}*{CMD}doxyconfig{B}+{DOXYCFG})? {
2525<GuardParam>{DOCNL} {
2540<GuardParamEnd>{B}*{DOCNL} {
2542 yyextra->spaceBeforeIf.clear();
2546<GuardParamEnd>{B}* {
2547 if (!yyextra->spaceBeforeIf.empty())
2549 addOutput(yyscanner,yyextra->spaceBeforeIf);
2551 yyextra->spaceBeforeIf.clear();
2563<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2565 yyextra->guards->emplace(
false);
2566 BEGIN( GuardParam );
2568<SkipGuardedSection>{CMD}"if"/{NW} {
2570 yyextra->guards->emplace(
false);
2571 BEGIN( GuardParam );
2573<SkipGuardedSection>{CMD}"endif"/{NW} {
2574 if (yyextra->guards->empty())
2576 warn(yyextra->fileName,yyextra->lineNr,
2577 "found \\endif without matching start command");
2582 yyextra->guards->pop();
2583 if (yyextra->guards->empty())
2585 BEGIN( GuardParamEnd );
2589 if (yyextra->guards->top().isEnabled())
2591 BEGIN( GuardParamEnd );
2595 BEGIN( SkipGuardedSection );
2600<SkipGuardedSection>{CMD}"else"/{NW} {
2601 if (yyextra->guards->empty())
2603 warn(yyextra->fileName,yyextra->lineNr,
2604 "found \\else without matching start command");
2606 else if (yyextra->guards->top().hasElse())
2608 warn(yyextra->fileName,yyextra->lineNr,
2609 "found multiple \\else commands in same \\if construct");
2610 yyextra->guards->top().setEnabled(
false);
2611 BEGIN( SkipGuardedSection );
2613 else if (!yyextra->guards->top().parentVisible())
2615 yyextra->guards->top().setEnabled(
false);
2616 BEGIN( SkipGuardedSection );
2620 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2621 yyextra->guards->top().setElse();
2622 if (!yyextra->guards->top().parentVisible())
2624 yyextra->guards->top().setEnabled(
false);
2625 BEGIN( SkipGuardedSection );
2627 else if (yyextra->guards->top().isEnabledFound())
2629 yyextra->guards->top().setEnabled(
false);
2630 BEGIN( SkipGuardedSection );
2634 yyextra->guards->top().setEnabled(
true);
2635 BEGIN( GuardParamEnd );
2639<SkipGuardedSection>{CMD}"elseif"/{NW} {
2640 if (yyextra->guards->empty())
2642 warn(yyextra->fileName,yyextra->lineNr,
2643 "found \\elseif without matching start command");
2645 else if (yyextra->guards->top().hasElse())
2647 warn(yyextra->fileName,yyextra->lineNr,
2648 "found \\elseif command after \\else command was given in \\if construct");
2650 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2651 yyextra->guards->top().setEnabled(
false);
2652 BEGIN( GuardParam );
2657 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2658 yyextra->guards->top().setEnabled(
false);
2659 BEGIN( GuardParam );
2662<SkipGuardedSection>{DOCNL} {
2663 if (*yytext==
'\n') yyextra->lineNr++;
2666<SkipGuardedSection>[^ \\@\n]+ {
2668<SkipGuardedSection>{CMD}{CMD} |
2669<SkipGuardedSection>. {
2675<SkipInternal>{DOCNL} {
2676 if (*yytext==
'\n') yyextra->lineNr++;
2679<SkipInternal>{CMD}"if"/[ \t] {
2680 yyextra->condCount++;
2682<SkipInternal>{CMD}"ifnot"/[ \t] {
2683 yyextra->condCount++;
2685<SkipInternal>{CMD}/"endif" {
2686 yyextra->condCount--;
2687 if (yyextra->condCount<0)
2693<SkipInternal>{CMD}/"section"[ \t] {
2694 if (yyextra->sectionLevel>0)
2700<SkipInternal>{CMD}/"subsection"[ \t] {
2701 if (yyextra->sectionLevel>1)
2707<SkipInternal>{CMD}/"subsubsection"[ \t] {
2708 if (yyextra->sectionLevel>2)
2714<SkipInternal>{CMD}/"paragraph"[ \t] {
2715 if (yyextra->sectionLevel>3)
2721<SkipInternal>{CMD}/"subparagraph"[ \t] {
2722 if (yyextra->sectionLevel>4)
2728<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2729 if (yyextra->sectionLevel>5)
2735<SkipInternal>{CMD}"endinternal"[ \t]* {
2738<SkipInternal>[^ \\@\n]+ {
2755 yyextra->docGroup.appendHeader(
' ');
2758 yyextra->docGroup.appendHeader(*yytext);
2759 yyextra->current->name+=*yytext;
2774<RaiseWarning,RaiseWarningSection>{DOCNL} {
2776 "{}",yyextra->raiseWarning);
2777 yyextra->raiseWarning =
"";
2778 if (*yytext==
'\n') yyextra->lineNr++;
2780 if (YY_START == RaiseWarning)
2786 yyextra->sectionTitle+=yytext;
2787 BEGIN(SectionTitle);
2790<RaiseWarning,RaiseWarningSection>. {
2791 yyextra->raiseWarning += yytext;
2795<InGroupParam>{LABELID} {
2796 yyextra->current->groups.emplace_back(
2799 yyextra->inGroupParamFound=
true;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2801<InGroupParam>{DOCNL} {
2802 if (!yyextra->inGroupParamFound)
2804 warn(yyextra->fileName,yyextra->lineNr,
2805 "Missing group name for \\ingroup command"
2824 if (yyextra->braceCount==0)
2826 if (yyextra->functionProto.stripWhiteSpace().empty())
2828 warn(yyextra->fileName,yyextra->lineNr,
2829 "missing argument after '\\{}'.",yyextra->currentCmd
2835 yyextra->langParser->parsePrototype(yyextra->functionProto);
2843 yyextra->functionProto+=
' ';
2845<FnParam>[^@\\\n()]+ {
2846 yyextra->functionProto+=yytext;
2849 yyextra->functionProto+=yytext;
2850 yyextra->braceCount++;
2853 yyextra->functionProto+=yytext;
2854 yyextra->braceCount--;
2857 yyextra->functionProto+=*yytext;
2864<OverloadParam>{DOCNL} {
2865 if (*yytext==
'\n') yyextra->lineNr++;
2866 if (yyextra->functionProto.stripWhiteSpace().empty())
2874 yyextra->langParser->parsePrototype(yyextra->functionProto);
virtual DString trOverloadText()=0
Translator * theTranslator
2878<OverloadParam>{LC} {
2880 yyextra->functionProto+=
' ';
2883 yyextra->functionProto+=*yytext;
2888<InheritParam>({ID}("::"|"."))*{ID} {
2889 yyextra->current->extends.emplace_back(
2894<InheritParam>{DOCNL} {
2895 warn(yyextra->fileName,yyextra->lineNr,
2896 "\\inherit command has no argument"
2898 if (*yytext==
'\n') yyextra->lineNr++;
2903 warn(yyextra->fileName,yyextra->lineNr,
2904 "Invalid or missing name for \\inherit command"
2911<ExtendsParam>({ID}("::"|"."))*{ID} {
2912 yyextra->current->extends.emplace_back(
2917<ExtendsParam>{DOCNL} {
2918 warn(yyextra->fileName,yyextra->lineNr,
2919 "'\\{}' command has no argument",yyextra->currentCmd
2931<SkipLang>{CMD}"~"[a-zA-Z-]* {
2935 warn(yyextra->fileName,yyextra->lineNr,
2938 else if (langId.
empty() ||
2944<SkipLang>[^*@\\\n]* {
2947 if (*yytext==
'\n') yyextra->lineNr++;
2954<CiteLabel,CiteLabelSection>{CITEID} {
2957 if (YY_START == CiteLabel)
2963 yyextra->sectionTitle+=yytext;
2964 BEGIN(SectionTitle);
2967<CiteLabel,CiteLabelSection>{DOCNL} {
2968 warn(yyextra->fileName,yyextra->lineNr,
2969 "\\cite command has no label"
2973 if (YY_START == CiteLabel)
2980 yyextra->sectionTitle+=yytext;
2982 BEGIN(SectionTitle);
2985<CiteLabel,CiteLabelSection>. {
2986 warn(yyextra->fileName,yyextra->lineNr,
2987 "Invalid or missing cite label"
2989 if (YY_START == CiteLabel)
2995 yyextra->sectionTitle+=yytext;
2996 BEGIN(SectionTitle);
3004 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3005 addOutput(yyscanner,yyextra->copyDocArg);
3009<CopyDoc>"<"[/]?{TABLEDEL}">" {
3010 if (yyextra->braceCount==0)
3013 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3014 addOutput(yyscanner,yyextra->copyDocArg);
3020 if (*yytext==
'\n') yyextra->lineNr++;
3021 if (yyextra->braceCount==0)
3024 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3025 addOutput(yyscanner,yyextra->copyDocArg);
3033<CopyDoc>[^@\\\n()<]+ {
3034 yyextra->copyDocArg+=yytext;
3038 yyextra->copyDocArg+=yytext;
3040 yyextra->braceCount++;
3043 yyextra->copyDocArg+=yytext;
3045 yyextra->braceCount--;
3048 yyextra->copyDocArg+=yytext;
3071 yyextra->braceCount=0;
3072 yyextra->functionProto.clear();
3073 yyextra->currentCmd = cmd;
3074 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3082 yyextra->functionProto.clear();
3083 yyextra->braceCount=0;
3084 yyextra->currentCmd = cmd;
3085 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3093 yyextra->functionProto.clear();
3094 BEGIN(OverloadParam);
3101 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3102 BEGIN( EnumDocArg1 );
3111 BEGIN( GroupDocArg1 );
3120 BEGIN( GroupDocArg1 );
3129 BEGIN( GroupDocArg1 );
3136 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3137 BEGIN( NameSpaceDocArg1 );
3145 BEGIN( PackageDocArg1 );
3152 yyextra->currentCmd = cmd;
3153 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3154 BEGIN( ClassDocArg1 );
3161 yyextra->currentCmd = cmd;
3162 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3163 BEGIN( ConceptDocArg1 );
3170 yyextra->currentCmd = cmd;
3171 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3172 BEGIN( ModuleDocArg1 );
3179 BEGIN( ClassDocArg2 );
3186 yyextra->currentCmd = cmd;
3187 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3188 BEGIN( ClassDocArg1 );
3195 yyextra->currentCmd = cmd;
3196 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3197 BEGIN( CategoryDocArg1 );
3204 yyextra->currentCmd = cmd;
3205 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3206 BEGIN( ClassDocArg1 );
3213 yyextra->currentCmd = cmd;
3214 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3215 BEGIN( ClassDocArg1 );
3221 yyextra->currentCmd = cmd;
3222 yyextra->currentMakeEntryType = EntryType::makeRecordDoc;
3223 BEGIN( ClassDocArg1 );
3230 yyextra->currentCmd = cmd;
3231 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3232 BEGIN( ClassDocArg1 );
3239 yyextra->currentCmd = cmd;
3240 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3241 BEGIN( ClassDocArg1 );
3249 BEGIN( PageDocArg1 );
3259 yyextra->current->name =
"mainpage";
3262 BEGIN( PageDocArg2 );
3272 yyextra->current->name = yyextra->fileName;
3274 BEGIN( FileDocArg1 );
3307 if (!stop) yyextra->current->name = yyextra->fileName;
3308 BEGIN( FileDocArg1 );
3316 for (
const auto &opt : optList)
3320 sectionMaker=EntryType::makeExampleLineno;
3324 warn(yyextra->fileName,yyextra->lineNr,
3325 "unsupported option '{}' for command '\\{}'",opt,cmd);
3329 if (!stop) yyextra->current->name = yyextra->fileName;
3330 BEGIN( FileDocArg1 );
3339 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3349 yyextra->raiseWarning =
"";
3350 BEGIN( RaiseWarning );
3367 yyextra->docGroup.clearHeader();
3369 if (!yyextra->docGroup.empty())
3371 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true,
true);
3410 yyextra->current->spec.setDeprDoc(
true);
3418 BEGIN(XRefItemParam1);
3425 if (yyextra->insideParBlock)
3427 warn(yyextra->fileName,yyextra->lineNr,
3428 "found \\parblock command while already in a parblock!");
3430 if (!yyextra->spaceBeforeCmd.empty())
3432 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3433 yyextra->spaceBeforeCmd.clear();
3436 yyextra->insideParBlock =
true;
3443 if (!yyextra->insideParBlock)
3445 warn(yyextra->fileName,yyextra->lineNr,
3446 "found \\endparblock command without matching \\parblock!");
3450 yyextra->insideParBlock =
false;
3457 if (!yyextra->current->relates.empty())
3459 warn(yyextra->fileName,yyextra->lineNr,
3460 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3462 yyextra->current->relatesType = RelatesType::Simple;
3463 yyextra->currentCmd = cmd;
3464 BEGIN(RelatesParam1);
3471 if (!yyextra->current->relates.empty())
3473 warn(yyextra->fileName,yyextra->lineNr,
3474 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3476 yyextra->current->relatesType = RelatesType::Duplicate;
3477 yyextra->currentCmd = cmd;
3478 BEGIN(RelatesParam1);
3485 if (!yyextra->current->relates.empty())
3487 warn(yyextra->fileName,yyextra->lineNr,
3488 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3490 yyextra->current->relatesType = RelatesType::MemberOf;
3491 yyextra->currentCmd = cmd;
3492 BEGIN(RelatesParam1);
3509 BEGIN(SectionLabel);
3510 yyextra->sectionLabel.clear();
3519 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3521 switch (yyextra->sectionLevel)
3529 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3538 BEGIN( RequirementLabel );
3545 BEGIN( SatisfiesLabel );
3552 BEGIN( VerifiesLabel );
3559 if (!yyextra->current->section.isEmpty() &&
3560 !yyextra->current->section.isPageDoc() &&
3561 !yyextra->current->section.isMainpageDoc()
3564 warn(yyextra->fileName,yyextra->lineNr,
3565 "found \\subpage command in a comment block that is not marked as a page!");
3567 if (!yyextra->spaceBeforeCmd.empty())
3569 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3570 yyextra->spaceBeforeCmd.clear();
3573 BEGIN(SubpageLabel);
3581 if (optList.empty())
3583 yyextra -> anchorTitle =
"";
3587 yyextra -> anchorTitle =
join(optList,
" ");
3596 for (
const auto &opt : optList)
3606 if (!yyextra->spaceBeforeCmd.empty())
3608 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3609 yyextra->spaceBeforeCmd.clear();
3611 if (optList.empty())
3626 if (!yyextra->spaceBeforeCmd.empty())
3628 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3629 yyextra->spaceBeforeCmd.clear();
3631 if (optList.empty())
3646 if (!yyextra->spaceBeforeCmd.empty())
3648 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3649 yyextra->spaceBeforeCmd.clear();
3655 if (optList.empty())
3664 yyextra->blockName=s;
3665 yyextra->commentCount=0;
3698 static std::unordered_map<std::string,OptionFunc> options =
3701 {
"name", [](
const FileInfo &fi_) ->
DString {
return fi_.baseName(); } },
3702 {
"extension", [](
const FileInfo &fi_) ->
DString {
return fi_.extension(
true); } },
3703 {
"filename", [](
const FileInfo &fi_) ->
DString {
return fi_.fileName(); } },
3704 {
"directory", [](
const FileInfo &fi_) ->
DString {
return fi_.dirPath(); } },
3705 {
"full", [](
const FileInfo &fi_) ->
DString {
return fi_.absFilePath(); } }
3707 auto it = options.
find(optionName);
3708 return (it!=options.end()) ? it->second(fi) :
DString();
3714 if (!yyextra->spaceBeforeCmd.empty())
3716 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3717 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3718 yyextra->spaceBeforeCmd.clear();
3721 FileInfo fi(yyextra->fileName.str());
3722 for (
const auto &opt_ : optList)
3725 std::string opt = optStripped.
lower().
str();
3727 if (!result.
empty())
3731 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3738 yyextra->sectionTitle+=result;
3745 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3752 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3757 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3767 if (!yyextra->spaceBeforeCmd.empty())
3769 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3770 yyextra->spaceBeforeCmd.clear();
3803 BEGIN(IRaisePrefix);
3811 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3812 if (yyextra->guards->empty())
3814 yyextra->guards->emplace(
true);
3818 bool enabled = yyextra->guards->top().isEnabled();
3819 yyextra->guards->emplace(enabled);
3829 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3830 if (yyextra->guards->empty())
3832 yyextra->guards->emplace(
true);
3836 bool enabled = yyextra->guards->top().isEnabled();
3837 yyextra->guards->emplace(enabled);
3846 if (yyextra->guards->empty())
3848 warn(yyextra->fileName,yyextra->lineNr,
3849 "found \\elseif without matching start command");
3851 else if (yyextra->guards->top().hasElse())
3853 warn(yyextra->fileName,yyextra->lineNr,
3854 "found \\elseif command after \\else command was given in \\if construct");
3856 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3857 yyextra->guards->top().setEnabled(
false);
3863 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3864 yyextra->guards->top().setEnabled(
false);
3873 if (yyextra->guards->empty())
3875 warn(yyextra->fileName,yyextra->lineNr,
3876 "found \\else without matching start command");
3878 else if (yyextra->guards->top().hasElse())
3880 warn(yyextra->fileName,yyextra->lineNr,
3881 "found multiple \\else commands in same \\if construct");
3882 yyextra->guards->top().setEnabled(
false);
3883 yyextra->guards->top().setElse();
3884 BEGIN( SkipGuardedSection );
3888 yyextra->guards->top().setElse();
3889 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3890 if (yyextra->guards->top().isEnabledFound())
3892 yyextra->guards->top().setEnabled(
false);
3893 BEGIN( SkipGuardedSection );
3897 yyextra->guards->top().setEnabled(
true);
3898 BEGIN( GuardParamEnd );
3907 if (yyextra->guards->empty())
3909 warn(yyextra->fileName,yyextra->lineNr,
3910 "found \\endif without matching start command");
3914 yyextra->guards->pop();
3916 if (!yyextra->spaceBeforeCmd.empty())
3918 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3919 yyextra->spaceBeforeCmd.clear();
3921 if (yyextra->guards->empty())
3923 BEGIN( GuardParamEnd );
3927 if (yyextra->guards->top().isEnabled())
3929 BEGIN( GuardParamEnd );
3933 BEGIN( SkipGuardedSection );
3942 yyextra->inGroupParamFound=
false;
3943 BEGIN( InGroupParam );
3950 yyextra->current->subGrouping =
false;
3957 yyextra->current->initLines = 100000;
3964 yyextra->current->initLines = 0;
3971 yyextra->current->commandOverrides.override_callGraph(
true);
3978 yyextra->current->commandOverrides.override_callGraph(
false);
3985 yyextra->current->commandOverrides.override_callerGraph(
true);
3992 yyextra->current->commandOverrides.override_callerGraph(
false);
3999 yyextra->current->commandOverrides.override_enumValues(
true);
4006 yyextra->current->commandOverrides.override_enumValues(
false);
4013 yyextra->current->commandOverrides.override_inlineSource(
true);
4020 yyextra->current->commandOverrides.override_inlineSource(
false);
4027 yyextra->current->commandOverrides.override_includeGraph(
true);
4034 yyextra->current->commandOverrides.override_includedByGraph(
true);
4041 yyextra->current->commandOverrides.override_includeGraph(
false);
4048 yyextra->current->commandOverrides.override_includedByGraph(
false);
4055 yyextra->current->commandOverrides.override_directoryGraph(
true);
4062 yyextra->current->commandOverrides.override_directoryGraph(
false);
4069 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4076 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4083 yyextra->current->commandOverrides.override_groupGraph(
true);
4090 yyextra->current->commandOverrides.override_groupGraph(
false);
4097 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4098 for (
const auto &opt_ : optList)
4105 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4107 else if (opt ==
"graph")
4109 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4111 else if (opt ==
"builtin")
4113 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4115 else if (opt ==
"text")
4117 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4119 else if (opt ==
"no")
4121 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4125 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4136 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4143 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4150 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4157 yyextra->current->commandOverrides.override_referencesRelation(
true);
4164 yyextra->current->commandOverrides.override_referencesRelation(
false);
4171 yyextra->currentCmd = cmd;
4183 if (yyextra->current->doc.stripWhiteSpace().empty())
4185 yyextra->current->doc.clear();
4187 yyextra->condCount=0;
4188 BEGIN( SkipInternal );
4194 yyextra->inInternalDocs =
true;
4202 yyextra->current->isStatic =
true;
4209 yyextra->current->virt = Specifier::Pure;
4216 yyextra->current->protection = Protection::Private;
4223 yyextra->current->protection = yyextra->protection = Protection::Private;
4230 yyextra->current->protection = Protection::Protected;
4237 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4244 yyextra->current->protection = Protection::Public;
4251 yyextra->current->protection = yyextra->protection = Protection::Public;
4258 if (yyextra->current->section.isPageDoc() ||
4259 yyextra->current->section.isMainpageDoc())
4261 for (
const auto &opt_ : optList)
4265 size_t i = opt.
find(
':');
4269 if (sscanf(opt.
mid(i+1).
data(),
"%d%c",&level,&dum) != 1)
4271 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4285 yyextra->current->localToc.enableHtml(level);
4287 else if (opt ==
"latex")
4289 yyextra->current->localToc.enableLatex(level);
4291 else if (opt ==
"xml")
4293 yyextra->current->localToc.enableXml(level);
4295 else if (opt ==
"docbook")
4297 yyextra->current->localToc.enableDocbook(level);
4301 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4306 if (yyextra->current->localToc.nothingEnabled())
4319 BEGIN(InheritParam);
4326 yyextra->currentCmd = cmd;
4327 BEGIN(ExtendsParam);
4334 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4340 if (!yyextra->spaceBeforeCmd.empty())
4342 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4343 yyextra->spaceBeforeCmd.clear();
4353 if (!yyextra->spaceBeforeCmd.empty())
4355 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4356 yyextra->spaceBeforeCmd.clear();
4365 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4371 if (!yyextra->spaceBeforeCmd.empty())
4373 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4374 yyextra->spaceBeforeCmd.clear();
4377 yyextra->copyDocArg.clear();
4378 yyextra->braceCount = 0;
4388 yyextra->sectionLabel.clear();
4389 yyextra->sectionTitle.clear();
4390 yyextra->docGroup.clearHeader();
4391 yyextra->insideParBlock =
false;
4400 return yyextra->current->section.isDoc();
4408 if (yyextra->current->section.isDoc())
4414 yyextra->needNewEntry =
true;
4415 yyextra->current->section = maker();
4416 yyextra->current->fileName = yyextra->fileName;
4417 yyextra->current->startLine = yyextra->lineNr;
4418 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4432 for(
const char* c = yytext ; *c ; ++c )
4433 yyextra->lineNr += (*c ==
'\n') ;
4441 if (s==
nullptr || *s==0)
return name;
4443 if (name.at(0)==
'"' && name.at(name.length()-1)==
'"')
4445 name=name.mid(1,name.length()-2);
4457 DString reqId = yyextra->current->name;
4463 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4468 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4470 yyextra->fileName,yyextra->lineNr,
4479 const DString &listTitle,
bool append,
bool inBody,
int lineNr)
4481 if (baseName.
empty())
return;
4488 if (
Config_getEnum(MARKDOWN_ID_STYLE) == MARKDOWN_ID_STYLE_t::GITHUB) listName = doxygenList + listName;
4491 for (
auto it = current->
sli.rbegin(); it != current->
sli.rend(); ++it)
4511 item = refList->
add();
4517 current->
sli.push_back(item);
4519 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4526 current->
doc += cmdString;
4537 current->
anchors.push_back(si);
4539 else if (si->
lineNr() != -1)
4541 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4546 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4553 current->
anchors.push_back(si);
4563 const DString &listTitle,
bool append)
4566 addXRefItemToEntry(yyextra->current,yyextra->outputXRef,listName,itemTitle,listTitle,append,yyextra->inBody,yyextra->lineNr);
4567 yyextra->outputXRef.clear();
4575 if (label.
empty())
return;
4576 signed char c =
static_cast<signed char>(label[0]);
4577 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4581 for (
size_t i=1; i<label.
size(); i++)
4583 c =
static_cast<signed char>(label[i]);
4584 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4601 DString formula = (yyextra->formulaPreText +
4602 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4610 formLabel.
sprintf(
"\\_form#%d",
id);
4611 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4636 if (addYYtext) yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
4637 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4638 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4640 yyextra->sectionLevel);
4643 yyextra->current->anchors.push_back(si);
4645 else if (si->
lineNr() != -1)
4647 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4652 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4653 yyextra->sectionLabel,si->
fileName());
4659 if (addYYtext) yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
4660 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4661 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4663 yyextra->sectionLevel);
4666 yyextra->current->anchors.push_back(si);
4677 if (yytext[0] ==
'"')
4680 name=name.left((
int)yyleng-2);
4696 if (c==
' ' || c==
'\t' || c==
'\r')
4720 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4722 yyextra->xrefAppendFlag = !yyextra->inBody &&
4724 yyextra->newXRefKind==yyextra->xrefKind &&
4726 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4742 switch(yyextra->xrefKind)
4769 xrefAppendToPrev || yyextra->current->spec.isDeprAttr()
4774 yyextra->xrefItemTitle,
4775 yyextra->xrefListTitle,
4784 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4786 int oldContext = yyextra->inContext;
4787 yyextra->inContext = ctx;
4789 switch(yyextra->inContext)
4792 if (oldContext!=yyextra->inContext)
4796 if (!yyextra->current->doc.empty()) yyextra->current->doc +=
'\n';
4802 if (yyextra->current->doc.empty()) yyextra->current->docLine = yyextra->lineNr;
4803 if (yyextra->current->docFile.empty())
4805 yyextra->current->docFile = yyextra->fileName;
4806 yyextra->current->docLine = yyextra->lineNr;
4809 yyextra->pOutputString = &yyextra->current->doc;
4813 if (oldContext!=yyextra->inContext)
4815 if (yyextra->current->brief.empty()) yyextra->current->briefLine = yyextra->lineNr;
4816 if (yyextra->current->briefFile.empty())
4818 yyextra->current->briefFile = yyextra->fileName;
4819 yyextra->current->briefLine = yyextra->lineNr;
4822 bool foundMatch =
false;
4823 if (yyextra->current->brief.stripWhiteSpace().empty())
4831 std::string str = yyextra->current->brief.str();
4836 for (
size_t i = 0; i < match[2].str().size(); i++)
4838 if (match[2].str()[i] ==
'\n') cnt++;
4842 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4844 yyextra->current->brief +=
" \\iline " +
DString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4851 yyextra->pOutputString = &yyextra->current->brief;
4855 if (!yyextra->current->doc.empty())
4857 yyextra->current->doc +=
"\n";
4859 yyextra->pOutputString = &yyextra->current->doc;
4865 yyextra->pOutputString = &yyextra->current->fieldDocs.back().doc;
4868 yyextra->pOutputString = &yyextra->outputXRef;
4873 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4890 yyextra->current->anchors.push_back(si);
4892 else if (si->
lineNr() != -1)
4894 warn(yyextra->fileName,yyextra->lineNr,
4895 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4900 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4907 yyextra->current->anchors.push_back(si);
4916 *yyextra->pOutputString+=s;
4924 *yyextra->pOutputString+=s;
4931 *yyextra->pOutputString+=c;
4937 snprintf(cmd,30,
" \\iline %d ",lineNr);
4944 snprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4951 std::string_view str = yyextra->current->brief.view();
4956 yyextra->briefEndsAtDot=
false;
4958 if (yyextra->current->doc.stripWhiteSpace().empty())
4960 yyextra->current->docLine = yyextra->lineNr;
4961 yyextra->current->doc =
"";
4965 addIline(yyscanner,yyextra->lineNr);
4971 int saveLineNr = yyextra->lineNr;
4973 yyextra->current->briefLine = yyextra->lineNr;
4974 yyextra->lineNr = saveLineNr;
4981 yyextra->prevPosition=yyextra->inputPosition;
4983 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4985 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4997 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4998 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4999 YY_START==ReadFormulaLong)
5001 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
5015 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
5023 commentscanYYlex_destroy(
p->yyscanner);
5036 bool &newEntryNeeded,
5037 bool markdownSupport,
5041 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
5042 " prot={} markdownSupport={}",
Trace::trunc(comment),fileName,lineNr,isBrief,
5043 isAutoBriefOn,isInbody,prot,markdownSupport);
5048 yyextra->guards = guards;
5049 yyextra->langParser = parser;
5050 yyextra->current = curEntry;
5051 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
5052 if (comment.
empty())
return false;
5053 yyextra->inputString = comment;
5054 yyextra->inputString.
append(
" ");
5055 yyextra->inputPosition = position;
5056 yyextra->lineNr = lineNr;
5057 yyextra->fileName = fileName;
5058 yyextra->protection = prot;
5059 yyextra->needNewEntry =
false;
5061 yyextra->xrefAppendFlag =
false;
5062 yyextra->insidePre =
false;
5063 yyextra->parseMore =
false;
5064 yyextra->inBody = isInbody;
5065 yyextra->markdownSupport= markdownSupport;
5066 yyextra->outputXRef.clear();
5067 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.empty())
5069 yyextra->current->doc +=
'\n';
5072 yyextra->briefEndsAtDot = isAutoBriefOn;
5073 yyextra->condCount = 0;
5074 yyextra->sectionLevel = 0;
5075 yyextra->spaceBeforeCmd.clear();
5076 yyextra->spaceBeforeIf.clear();
5077 yyextra->htmlContextStack.clear();
5080 if (!yyextra->current->inbodyDocs.empty() && isInbody)
5083 snprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5084 yyextra->current->inbodyDocs+=cmd;
5088 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5091 commentscanYYrestart(
nullptr, yyscanner );
5093 commentscanYYlex(yyscanner);
5096 if (YY_START==OverloadParam)
5101 if (yyextra->insideParBlock)
5103 warn(yyextra->fileName,yyextra->lineNr,
5104 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5110 if (!isInbody && yyextra->current->section.isEmpty() &&
5111 yyextra->current->doc.stripWhiteSpace().empty() &&
5112 yyextra->current->brief.stripWhiteSpace().empty() &&
5113 !yyextra->current->fieldDocs.empty())
5115 bool allQualified =
true;
5116 for (
const auto &fieldDoc : yyextra->current->fieldDocs)
5120 allQualified =
false;
5127 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.empty())
5130 yyextra->current->doc=
"\n\n";
5133 if (yyextra->current->section.isMemberGrp() &&
5134 yyextra->docGroup.empty())
5136 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5140 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5142 yyextra->current->briefLine,yyextra->current->brief,
5143 yyextra->current->docLine,yyextra->current->doc,
5144 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5148 prot = yyextra->protection;
5150 yyextra->docGroup.addDocs(curEntry);
5152 newEntryNeeded = yyextra->needNewEntry;
5157 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
false;
5159 if (!yyextra->parseMore && !yyextra->guards->empty())
5161 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5164 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5166 lineNr = yyextra->lineNr;
5168 position,yyextra->parseMore,newEntryNeeded);
5170 return yyextra->parseMore;
5177 bool sectionEnabled =
false;
5182 bool parentEnabled = yyextra->guards->top().parentVisible();
5186 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5187 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5191 yyextra->guards->top().setEnabled(
true);
5192 yyextra->guards->top().setEnabledFound();
5193 BEGIN( GuardParamEnd );
5197 if (yyextra->guards->top().isEnabledFound())
5199 yyextra->guards->top().setEnabled(
false);
5200 BEGIN( SkipGuardedSection );
5202 else if (sectionEnabled)
5204 yyextra->guards->top().setEnabled(
true);
5205 yyextra->guards->top().setEnabledFound();
5206 BEGIN( GuardParamEnd );
5210 yyextra->guards->top().setEnabled(
false);
5211 BEGIN( SkipGuardedSection );
5216 BEGIN( SkipGuardedSection );
5221 BEGIN( SkipGuardedSection );
5228 yyextra->docGroup.initGroupInfo(entry);
5234 yyextra->docGroup.enterFile(fileName,lineNr);
5240 yyextra->docGroup.leaveFile(fileName,lineNr);
5246 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5252 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5258 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5264 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5274 static reg::Ex deprecated_re(R
"(deprecated\s*(\(\s*\"([^\"]*)\"\s*\))?)");
5280 if (match.size()==3)
5283 DString rawDoc = match[2].str();
5285 std::shared_ptr<Entry> docEntry = std::make_shared<Entry>();
5287 bool newEntryNeeded =
false;
5303 docs = docEntry->doc;
5308 current->
spec.setDeprAttr(
true);
5310 if (!docs.
empty() || !current->
spec.isDeprDoc())
5331#include "commentscan.l.h"
void insert(const DString &label)
Insert a citation identified by label into the database.
static CitationManager & instance()
Copyright (C) 1997-2026 by Dimitri van Heesch.
bool parse(const DString &fileName, int lineNr, const DString &expr)
parses and evaluates the given expression.
void resize(size_t newlen)
char & at(size_t i)
Returns a reference to the character at index i.
size_t size() const
Returns the length of the string, not counting the 0-terminator.
DString & sprintf(const char *format,...)
bool startsWith(const char *s) const
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
int docLine
line number at which the documentation was found
DString doc
documentation block (partly parsed)
std::vector< const SectionInfo * > anchors
list of anchors defined in this entry
DString attributes
member's attributes (e.g. [[nodiscard]])
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
DString inbodyDocs
documentation inside the body of a function
TypeSpecifier spec
class/member specifiers
T * add(const char *k, Args &&... args)
const T * find(const std::string &key) const
Helper class to process markdown formatted text.
DString process(const DString &input, int &startNewlines, bool fromParseInput=false)
static MermaidManager & instance()
void setHasInlineDiagrams()
This struct represents an item in the list of references.
void setText(const DString &text)
void setAnchor(const DString &anchor)
List of cross-referenced items.
static RefListManager & instance()
class that provide information about a section.
singleton class that owns the list of all sections
SectionInfo * replace(const DString &label, const DString &fileName, int lineNr, const DString &title, SectionType type, int level, const DString &ref=DString())
SectionInfo * add(const SectionInfo &si)
static SectionManager & instance()
returns a reference to the singleton
static constexpr int Anchor
static constexpr int Section
static constexpr int MaxLevel
static constexpr int Subsection
static constexpr int Subsubsection
static constexpr int Requirement
static constexpr int Paragraph
static constexpr int Subsubparagraph
static constexpr int Subparagraph
virtual DString trTestList()=0
virtual DString trBugList()=0
virtual DString trBug()=0
virtual DString trTodoList()=0
virtual DString trDeprecatedList()=0
virtual DString trDeprecated()=0
virtual DString trTodo()=0
virtual DString trTest()=0
Class representing a regular expression.
Object representing the matching results.
#define Config_getEnum(name)
#define AUTO_TRACE_EXIT(...)
DString trunc(const DString &s, size_t numChars=15)
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
bool literal_at(const char *data, const char(&str)[N])
returns true iff data points to a substring that matches string literal str
DString stripLeadingAndTrailingEmptyLines(const DString &s, int &docLine)
Special version of DString::stripWhiteSpace() that only strips completely blank lines.