16%option never-interactive
17%option prefix="commentscanYY"
19%option extra-type="struct commentscanYY_state *"
23#define YY_TYPEDEF_YY_SCANNER_T
43#include <unordered_map>
211static const std::unordered_map< std::string, DocCmdMap >
docCmdMap =
420#define YY_NO_UNISTD_H 1
421#define YY_NEVER_INTERACTIVE 1
554 const DString &listTitle,
bool append);
571#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
576#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.
587TABLE ("table"|"TABLE")
588TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
598CAPTION ("caption"|"CAPTION")
599CENTER ("center"|"CENTER")
601DETAILS ("details"|"DETAILS")
602BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
603DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
604DETAILEDHTMLOPT {CODE}
605DETAILEDHTMLOPTEND {ENDCODE}
606SUMMARY ("summary"|"SUMMARY")
607REMARKS ("remarks"|"REMARKS")
609ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
614DOCNL "\n"|"\\ilinebr"
617FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
618FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
619FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
620ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
621LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
622REQID [a-z_A-Z0-9\x80-\xFF\-]+
623CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
624CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
625CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
626SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
627SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
628TMPLSPEC "<"{BN}*[^>]+{BN}*">"
629MAILADDR ("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\-]+
630RCSTAG "$"{ID}":"[^\n$]+"$"
631MODULE_ID ({ID}".")*{ID}
632LINENR {Bopt}[1-9][0-9]*
633IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
634DOXYCFG [A-Z][A-Z_0-9]*
692%x ReadFormulaShortSection
694%x ReadFormulaRoundSection
708%x RaiseWarningSection
737<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
740<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
746<Comment>"\""[^"\n]*"\"" {
749<Comment>("\\"[a-z_A-Z]+)+"\\" {
752<Comment>"<"{DETAILEDHTML}{ATTR}">" {
754 size_t spacePos = htmlOpenTag.find(
' ');
756 DString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
758 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
766<Comment>"</"{DETAILEDHTML}">" {
768 DString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
770 if (!yyextra->htmlContextStack.empty() &&
771 yyextra->htmlContextStack.back().tagName==htmlTagName)
778 yyextra->htmlContextStack.pop_back();
782<Comment>"<"{DETAILEDHTMLOPT}">" {
784 if (yyextra->current->lang==SrcLangExt::CSharp)
786 yyextra->CScode=
true;
796<Comment>"<"{DETAILEDHTMLOPTEND}">" {
800 yyextra->CScode=
false;
804 yyextra->CScode=
false;
809<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
811 if (yyextra->current->lang==SrcLangExt::CSharp)
818<Comment>"<"{DETAILS}{ATTR}">" {
819 yyextra->htmlDetailsStack.push_back(0);
820 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
827<Comment>"</"{DETAILS}">" {
828 if (!yyextra->htmlDetailsStack.empty())
830 yyextra->htmlDetailsStack.pop_back();
832 if (!yyextra->htmlContextStack.empty() &&
833 yyextra->htmlContextStack.back().tagName==
"details")
840 yyextra->htmlContextStack.pop_back();
845 yyextra->htmlAnchorStr = yytext;
846 yyextra->htmlAnchor =
false;
850 yyextra->htmlAnchorStr += yytext;
852 size_t s=tag.find(
"=");
855 if (c==
'\'' || c==
'"')
857 size_t e=tag.find(c,s+2);
860 id=tag.mid(s+2,e-s-2);
869 if (!
id.empty() && !yyextra->htmlAnchor)
875 yyextra->htmlAnchor =
true;
878<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
879 yyextra->htmlAnchorStr += yytext;
882 if (!yyextra->htmlAnchor)
884 addOutput(yyscanner,yyextra->htmlAnchorStr);
897 yyextra->htmlAnchorStr += yytext;
898 if (*yytext ==
'\n') yyextra->lineNr++;
901 yyextra->htmlAnchorStr += yytext;
903<Comment>"<"{SUMMARY}">" {
904 if (yyextra->htmlDetailsStack.empty())
913<Comment>"<"{REMARKS}">" {
917<Comment>"</"{SUMMARY}">" {
918 if (!yyextra->htmlDetailsStack.empty())
927<Comment>"</"{REMARKS}">" {
931<Comment>"<"{CAPTION}{ATTR}">" {
933 size_t s=tag.find(
"id=");
937 if (c==
'\'' || c==
'"')
939 size_t e=tag.find(c,s+4);
949<Comment>"<"{PRE}{ATTR}">" {
950 yyextra->insidePre=
true;
953<Comment>"</"{PRE}">" {
954 yyextra->insidePre=
false;
964<Comment>"<!\[CDATA\[" {
967<Comment>{B}*{CMD}"endinternal"{B}* {
969 if (!yyextra->inInternalDocs)
970 warn(yyextra->fileName,yyextra->lineNr,
971 "found \\endinternal without matching \\internal"
973 yyextra->inInternalDocs =
false;
#define warn(file, line, fmt,...)
975<Comment>{B}*"\\ilinebr "{B}* {
978<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
988<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
989<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
992 size_t idx = fullMatch.
find(
'{');
994 if ((idx !=
DString::npos) && (idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
1014 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1015 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1018 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1020 yyextra->briefEndsAtDot=
false;
1026 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1031 yyextra->parseMore=
true;
1033 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1036 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)
split input string s by string delimiter delimiter.
1048<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1051<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1053 if (!langId.
empty() &&
1058 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...
1064<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1066 yyextra->formulaText=
"";
1067 yyextra->formulaPreText=
"\\begin";
1068 yyextra->formulaPostText=
"";
1070 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1073 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1075 yyextra->formulaPreText+=yyextra->formulaEnv;
1076 yyextra->formulaNewLines=0;
1077 BEGIN(ReadFormulaLong);
1079<Comment>{B}*{CMD}"f$" {
1080 yyextra->formulaText=
"";
1081 yyextra->formulaPreText=
"$";
1082 yyextra->formulaPostText=
"";
1083 yyextra->formulaNewLines=0;
1084 BEGIN(ReadFormulaShort);
1086<Comment>{B}*{CMD}"f(" {
1087 yyextra->formulaText=
"";
1088 yyextra->formulaPreText=
"";
1089 yyextra->formulaPostText=
"";
1090 yyextra->formulaNewLines=0;
1091 BEGIN(ReadFormulaRound);
1093<Comment>{B}*{CMD}"f[" {
1095 yyextra->formulaText=
"";
1096 yyextra->formulaPreText=
"\\[";
1097 yyextra->formulaPostText=
"";
1098 yyextra->formulaNewLines=0;
1099 BEGIN(ReadFormulaLong);
1101<Comment>{B}*{CMD}"{" {
1103 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1105<Comment>{B}*{CMD}"}" {
1107 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
1108 yyextra->docGroup.clearHeader();
1109 yyextra->parseMore=
true;
1110 yyextra->needNewEntry =
true;
1111 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1114<Comment>{B}*{CMD}[$@\\&~<>#%] {
1117<Comment>[a-z_A-Z]+ {
1120<Comment>^{B}*"."{Bopt}/\n {
1123<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1124<Comment>^{B}*[*+]{B}+ {
1125 if (!yyextra->markdownSupport)
1133 yyextra->briefEndsAtDot=
false;
1139<Comment>^{B}*"-"{B}+ {
1142 yyextra->briefEndsAtDot=
false;
1147<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1150<Comment>{CMD}"---" {
1157 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1160 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1165 yyextra->briefEndsAtDot=
false;
1170<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1171<Comment>("."+)[a-z_A-Z0-9\)] {
1175<Comment>{CMD}[\.?!] {
1179<Comment>".\\"[ \t] {
1186<Comment>"...\\"[ \t] {
1189<Comment>"..."/[^\.] {
1192<Comment>".."[\.]?/[^ \t\n] {
1195<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1201 for (i=0;i<(yy_size_t)yyleng;)
1203 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1204 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1211 for (i=0;i<(yy_size_t)yyleng;)
1213 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1214 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1229 if (yyextra->briefEndsAtDot)
1232 yyextra->briefEndsAtDot=
false;
1237 if (*yytext ==
'\n') yyextra->lineNr++;
1239<Comment>"<"[/]?{TABLEDEL}">" {
1257<HtmlComment>"---"[!]?">"{B}* {
1258 warn(yyextra->fileName,yyextra->lineNr,
1259 "incorrect HTML end comment --->"
1262<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1263<HtmlComment>{DOCNL} {
1270<HtmlComment>[^\\\n\-]+ {
1275<CdataSection>"\]\]>" {
1278<CdataSection>{DOCNL} {
1280 if (*yytext==
'\n') yyextra->lineNr++;
1282<CdataSection>[<>&] {
1286<CdataSection>[^\\\n\]<>&]+ {
1295<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1296 yyextra->formulaPostText+=
"$";
1299 if (YY_START == ReadFormulaShort)
1305 yyextra->sectionTitle+=
" "+form;
1306 BEGIN(SectionTitle);
1309<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1312 if (YY_START == ReadFormulaRound)
1318 yyextra->sectionTitle+=
" "+form;
1319 BEGIN(SectionTitle);
1322<ReadFormulaLong>{CMD}"f]" {
1323 yyextra->formulaPostText+=
"\\]";
1327<ReadFormulaLong>{CMD}"f}" {
1328 yyextra->formulaPostText+=
"\\end";
1329 yyextra->formulaPostText+=yyextra->formulaEnv;
1333<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1334 yyextra->formulaText+=yytext;
1336<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1337 yyextra->formulaNewLines++;
1338 yyextra->formulaText+=*yytext;
1340 addIline(yyscanner,yyextra->lineNr);
1342<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1343 yyextra->formulaText+=*yytext;
1348<EnumDocArg1>{SCOPEID} {
1350 yyextra->current->name = yytext;
1357<EnumDocArg1>{DOCNL} {
1358 warn(yyextra->fileName,yyextra->lineNr,
1359 "missing argument after '\\enum'."
1369<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)
1375<NameSpaceDocArg1>{LC} {
1379<NameSpaceDocArg1>{DOCNL} {
1380 warn(yyextra->fileName,yyextra->lineNr,
1381 "missing argument after '\\namespace'."
1386<NameSpaceDocArg1>. {
1391<PackageDocArg1>{ID}("."{ID})* {
1392 yyextra->current->name = yytext;
1395<PackageDocArg1>{LC} {
1399<PackageDocArg1>{DOCNL} {
1400 warn(yyextra->fileName,yyextra->lineNr,
1401 "missing argument after \\package."
1413<ConceptDocArg1>{SCOPEID} {
1415 yyextra->current->name = yytext;
1418<ConceptDocArg1>{LC} {
1422<ConceptDocArg1>{DOCNL} {
1423 warn(yyextra->fileName,yyextra->lineNr,
1424 "missing argument after '\\concept'."
1433<ModuleDocArg1>{MODULE_ID} {
1435 yyextra->current->name = yytext;
1438<ModuleDocArg1>{LC} {
1442<ModuleDocArg1>{DOCNL} {
1443 warn(yyextra->fileName,yyextra->lineNr,
1444 "missing argument after '\\module'."
1454<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1458 BEGIN( ClassDocArg2 );
1460<ClassDocArg1>{SCOPENAME} {
1463 yyextra->current->name =
substitute(yytext,
".",
"::");
1464 if (yyextra->current->section.isProtocolDoc())
1466 yyextra->current->name+=
"-p";
1469 BEGIN( ClassDocArg2 );
1471<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1474 yyextra->current->name =
substitute(yytext,
".",
"::");
1475 BEGIN( ClassDocArg2 );
1477<ClassDocArg1,CategoryDocArg1>{LC} {
1481<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1482 warn(yyextra->fileName,yyextra->lineNr,
1483 "missing argument after '\\{}'.",yyextra->currentCmd
1488<ClassDocArg1,CategoryDocArg1>. {
1491<ClassDocArg2>{DOCNL} {
1495<ClassDocArg2>{FILE}|"<>" {
1496 yyextra->current->includeFile = yytext;
1497 BEGIN( ClassDocArg3 );
1506<ClassDocArg3>[<"]?{FILE}?[">]? {
1507 yyextra->current->includeName = yytext;
1514<ClassDocArg3>{DOCNL} {
1516 if (yyextra->current->includeFile!=
"<>")
1518 yyextra->current->includeName = yyextra->current->includeFile;
1528<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1529 yyextra->current->name = yytext;
1533 if (yyextra->current->name.endsWith(
".html"))
1535 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1537 else if (yyextra->current->name.endsWith(
".xhtml"))
1539 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1541 yyextra->current->type.clear();
1542 BEGIN(GroupDocArg2);
1544<GroupDocArg1>"\\"{B}*"\n" {
1548<GroupDocArg1>{DOCNL} {
1549 warn(yyextra->fileName,yyextra->lineNr,
1550 "missing group name after {}",
1551 yyextra->current->groupDocCmd()
1560<GroupDocArg2>"\\"{B}*"\n" {
1564<GroupDocArg2>[^\n\\]+ {
1565 yyextra->current->type += yytext;
1567<GroupDocArg2>{DOCNL}+ {
1568 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1570 yyextra->current->type.empty()
1573 warn(yyextra->fileName,yyextra->lineNr,
1574 "missing title after "
1575 "\\defgroup {}", yyextra->current->name
1579 int extraLineNr = 0;
1582 for (
int i = 0; i < yyleng; i++)
1584 if (yytext[i]==
'\n') extraLineNr++;
1591 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1592 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1597 yyextra->current->type += yytext;
1602<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1606 size_t start = text.
find(
'{');
1607 size_t end = text.
find(
'}',start+1);
1608 yyextra->current->name = text.
mid(
end+2);
1609 size_t istart = yyextra->current->name.
find(
"\\ilinebr");
1612 DString rest = yyextra->current->name.
mid(istart);
1614 yyextra->current->name = yyextra->current->name.left(istart);
1616 yyextra->current->args = text.
mid(start+1,
end-start-1);
1618 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1620<PageDocArg1>{FILE} {
1622 yyextra->current->args =
"";
1623 BEGIN( PageDocArg2 );
1625<PageDocArg1>{LC} { yyextra->lineNr++;
1628<PageDocArg1>{DOCNL} {
1629 warn(yyextra->fileName,yyextra->lineNr,
1630 "missing argument after \\page."
1639<PageDocArg2>{DOCNL} {
1643 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1644 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1647<PageDocArg2>{CMD}[<>] {
1652 yyextra->current->args += tmp;
1655 yyextra->current->args += yytext;
1658<ParamArg1>{ID}/{B}*"," {
1665 if (*yytext==
'\n') yyextra->lineNr++;
1679<FileDocArg1>{DOCNL} {
1685<FileDocArg1>{FILE} {
1689<FileDocArg1>{LC} { yyextra->lineNr++;
1697<XRefItemParam1>{LABELID} {
1698 yyextra->newXRefItemKey=yytext;
1700 BEGIN(XRefItemParam2);
1702<XRefItemParam1>{LC} {
1706<XRefItemParam1>{DOCNL} {
1707 warn(yyextra->fileName,yyextra->lineNr,
1708 "Missing first argument of \\xrefitem"
1710 if (*yytext==
'\n') yyextra->lineNr++;
1718<XRefItemParam2>"\""[^\n\"]*"\"" {
1720 BEGIN(XRefItemParam3);
1722<XRefItemParam2>{LC} {
1726<XRefItemParam2>{DOCNL} {
1727 warn(yyextra->fileName,yyextra->lineNr,
1728 "Missing second argument of \\xrefitem"
1730 if (*yytext==
'\n') yyextra->lineNr++;
1738<XRefItemParam3>"\""[^\n\"]*"\"" {
1743<XRefItemParam2,XRefItemParam3>{LC} {
1747<XRefItemParam3>{DOCNL} {
1748 warn(yyextra->fileName,yyextra->lineNr,
1749 "Missing third argument of \\xrefitem"
1751 if (*yytext==
'\n') yyextra->lineNr++;
1762<RelatesParam1>({ID}("::"|"."))*{ID} {
1763 yyextra->current->relates = yytext;
1770<RelatesParam1>{LC} {
1774<RelatesParam1>{DOCNL} {
1775 warn(yyextra->fileName,yyextra->lineNr,
1776 "Missing argument of '\\{}' command",yyextra->currentCmd
1788<Qualifier>{LABELID} {
1789 yyextra->current->qualifiers.emplace_back(yytext);
1792<Qualifier>"\""[^\"]*"\"" {
1793 std::string inp(yytext);
1794 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1798 warn(yyextra->fileName,yyextra->lineNr,
1799 "Missing argument of '\\{}' command",yyextra->currentCmd
1805 warn(yyextra->fileName,yyextra->lineNr,
1806 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1812<ILine>{LINENR}/[\\@\n\.] |
1818 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1822 yyextra->lineNr = nr;
1825 if (YY_START == ILine)
1831 yyextra->sectionTitle+=yytext;
1832 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1835<ILine,ILineSection>. {
1837 if (YY_START == ILine)
1843 yyextra->sectionTitle+=yytext;
1844 BEGIN(SectionTitle);
1849<IRaise>{B}*[0-9]+/[\\@\n\.] |
1850<IRaise>{B}*[0-9]+{B} {
1855 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1859 yyextra->raiseLevel = nr;
1869<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1883<IFile,IFileSection>{FILE} {
1886 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1887 else yyextra->fileName = yytext;
1888 if (YY_START == IFile)
1894 yyextra->sectionTitle+=yytext;
1895 BEGIN(SectionTitle);
1899<LinkSection>[^\\@\n]* {
1900 yyextra->sectionTitle+=yytext;
1902<LinkSection>{CMD}{CMD} {
1903 yyextra->sectionTitle+=yytext;
1905<LinkSection>{DOCNL} {
1907 if (*yytext ==
'\n') yyextra->lineNr++;
1908 yyextra->sectionTitle+=yytext;
1910<LinkSection>{CMD}"endlink" {
1911 yyextra->sectionTitle+=yytext;
1912 BEGIN(SectionTitle);
1915 yyextra->sectionTitle+=yytext;
1917<LinkSection><<EOF>> {
1918 warn(yyextra->fileName,yyextra->lineNr,
1919 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1925<LineParam>{CMD}{CMD} {
1938<LineParam>({CMD}{CMD}){ID} {
1947<SectionLabel>{LABELID} {
1948 yyextra->sectionLabel+=yytext;
1950<SectionLabel>{CMD}"lineinfo"("{}")? {
DString & setNum(short n)
1953<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1954 FileInfo fi(yyextra->fileName.str());
1955 bool hasOption =
false;
1957 if (yytext[yyleng-1] ==
'}')
1963 for (
const auto &opt_ : optList)
1966 std::string opt = optStripped.
lower().
str();
1968 if (!result.
empty())
1972 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1982 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1994 label=yyextra->fileName;
1998 yyextra->sectionLabel+=label;
#define Config_getBool(name)
DString stripFromPath(const DString &path)
2000<SectionLabel>{DOCNL} {
2001 yyextra->sectionTitle.clear();
2002 if (yyextra->sectionLabel.empty())
2004 warn(yyextra->fileName,yyextra->lineNr,
2005 "\\section command has no label"
2010 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2011 addOutput(yyscanner,yyextra->sectionLabel.data());
2014 if (*yytext==
'\n') yyextra->lineNr++;
2019 if (yyextra->sectionLabel.empty())
2021 warn(yyextra->fileName,yyextra->lineNr,
2022 "Invalid or missing section label"
2028 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2029 addOutput(yyscanner,yyextra->sectionLabel.data());
2030 yyextra->sectionTitle.clear();
2032 BEGIN(SectionTitle);
2035<SectionTitle>{STAopt}/"\n" {
2040<SectionTitle>{STopt}"\\\\ilinebr" {
2041 yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
2043<SectionTitle>{STopt}/"\\ilinebr" {
2048<SectionTitle>{B}*{CMD}"f$" {
2049 yyextra->formulaText=
"";
2050 yyextra->formulaPreText=
"$";
2051 yyextra->formulaPostText=
"";
2052 yyextra->formulaNewLines=0;
2053 BEGIN(ReadFormulaShortSection);
2055<SectionTitle>{B}*{CMD}"f(" {
2056 yyextra->formulaText=
"";
2057 yyextra->formulaPreText=
"";
2058 yyextra->formulaPostText=
"";
2059 yyextra->formulaNewLines=0;
2060 BEGIN(ReadFormulaRoundSection);
2062<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2063<SectionTitle>{B}*{CMD}"f"[\[{] {
2067 warn(yyextra->fileName,yyextra->lineNr,
2068 "'\\{}' command is not allowed in section title, ending section title.",
2078<SectionTitle>[^\n@\\]* {
2079 yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
2082<SectionTitle>{B}*{CMD}{CMD} {
2083 yyextra->sectionTitle+=yytext;
2086<SectionTitle>{CMD}# {
2087 yyextra->sectionTitle+=yytext;
2090<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2091<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2093 size_t idx = fullMatch.
find(
'{');
2095 if ((idx !=
DString::npos) && (idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2113 switch (it->second.sectionHandling)
2118 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2119 yyextra->sectionTitle+=fullMatch.
left(i);
2120 yyextra->sectionTitle+=
'@';
2121 yyextra->sectionTitle+=fullMatch.
mid(i);
2125 warn(yyextra->fileName,yyextra->lineNr,
2126 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2134 warn(yyextra->fileName,yyextra->lineNr,
2135 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2143 if (cmdName ==
"fileinfo")
2146 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2147 yyextra->sectionTitle+=fullMatch.
left(i);
2151 else if (cmdName ==
"lineinfo")
2154 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2155 yyextra->sectionTitle+=fullMatch.
left(i);
2160 else if (cmdName ==
"raisewarning")
2162 yyextra->raiseWarning =
"";
2163 BEGIN(RaiseWarningSection);
2165 else if (cmdName ==
"noop")
2170 else if (cmdName ==
"cite")
2172 yyextra->sectionTitle+=yytext;
2174 BEGIN(CiteLabelSection);
2176 else if (cmdName ==
"iline")
2178 yyextra->sectionTitle+=yytext;
2180 BEGIN(ILineSection);
2182 else if (cmdName ==
"ifile")
2184 yyextra->sectionTitle+=yytext;
2186 BEGIN(IFileSection);
2188 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2191 if (optList.empty())
2193 yyextra -> anchorTitle =
"";
2198 yyextra -> anchorTitle =
join(optList,
" ");
2201 BEGIN(AnchorLabelSection);
2203 else if (cmdName ==
"link")
2205 yyextra->sectionTitle+=yytext;
2210 yyextra->sectionTitle+=yytext;
2211 warn(yyextra->fileName,yyextra->lineNr,
2212 "internal error '\\{}' command is to be replaced in section title.",cmdName
2219 yyextra->sectionTitle+=yytext;
2227 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
2232 yyextra->sectionTitle+=yytext;
2238<SubpageLabel>{FILE} {
2242 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2243 BEGIN(SubpageTitle);
2245<SubpageLabel>{DOCNL} {
2246 warn(yyextra->fileName,yyextra->lineNr,
2247 "\\subpage command has no label"
2249 if (*yytext==
'\n') yyextra->lineNr++;
2257<SubpageTitle>{DOCNL} {
2261<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2272<AnchorLabel,AnchorLabelSection>{LABELID} {
2273 DString lbl = yyextra->raisePrefix+yytext;
2274 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2276 if (YY_START == AnchorLabel)
2282 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2285<AnchorLabel,AnchorLabelSection>{DOCNL} {
2286 warn(yyextra->fileName,yyextra->lineNr,
2287 "\\anchor command has no label"
2289 if (*yytext==
'\n') yyextra->lineNr++;
2291 if (YY_START == AnchorLabel)
2297 BEGIN(SectionTitle);
2300<AnchorLabel,AnchorLabelSection>. {
2301 warn(yyextra->fileName,yyextra->lineNr,
2302 "Invalid or missing anchor label"
2305 if (YY_START == AnchorLabel)
2311 BEGIN(SectionTitle);
2317<RequirementLabel>{REQID} {
2318 yyextra->current->name = yytext;
2319 yyextra->current->type.clear();
2320 BEGIN( RequirementTitle );
2322<SatisfiesLabel>{REQID} {
2323 yyextra->reqId = yytext;
2324 yyextra->reqTitle.clear();
2325 BEGIN( SatisfiesTitle );
2327<VerifiesLabel>{REQID} {
2328 yyextra->reqId = yytext;
2329 yyextra->reqTitle.clear();
2330 BEGIN( VerifiesTitle );
2332<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2336<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2337 warn(yyextra->fileName,yyextra->lineNr,
2338 "missing requirement ID after \\requirement command"
2343<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2346<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2350<RequirementTitle>[^\n\\]+ {
2351 yyextra->current->type += yytext;
2353<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2354 yyextra->reqTitle += yytext;
2356<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2357 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2362<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2363 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2365 if (yyextra->current->section.isRequirementDoc())
2367 warn(yyextra->fileName,yyextra->lineNr,
2368 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2381<VerifiesTitle>({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 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2400<RequirementTitle>. {
2401 yyextra->current->type += yytext;
2403<SatisfiesTitle,VerifiesTitle>. {
2404 yyextra->reqTitle += yytext;
2410<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2412 if (&yytext[4]==yyextra->blockName)
2417<FormatBlock>{CMD}"enduml" {
2419 if (yyextra->blockName==
"startuml")
2424<FormatBlock>[^ \@\*\/\\\n]* {
2427<FormatBlock>{DOCNL} {
2428 if (*yytext==
'\n') yyextra->lineNr++;
2432 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2433 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2434 yyextra->blockName==
"iliteral"
2436 ) yyextra->commentCount++;
2441 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2442 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2443 yyextra->blockName==
"iliteral"
2447 yyextra->commentCount--;
2448 if (yyextra->commentCount<0)
2450 DString endTag =
"end"+yyextra->blockName;
2451 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2452 warn(yyextra->fileName,yyextra->lineNr,
2453 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2454 yyextra->blockName,endTag);
2461<FormatBlock><<EOF>> {
2462 DString endTag =
"end"+yyextra->blockName;
2463 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2464 warn(yyextra->fileName,yyextra->lineNr,
2465 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2466 yyextra->blockName,endTag
2473<GuardParam>{B}*"(" {
2474 yyextra->guardExpr=yytext;
2475 yyextra->roundCount=1;
2479 yyextra->guardExpr+=yytext;
2483 yyextra->guardExpr+=yytext;
2484 yyextra->roundCount++;
2487 yyextra->guardExpr+=yytext;
2488 yyextra->roundCount--;
2489 if (yyextra->roundCount==0)
2495 warn(yyextra->fileName,yyextra->lineNr,
2496 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2500<GuardParam>{B}*{CMD}doxyconfig{B}+{DOXYCFG} {
2503<GuardParam>{B}*[a-z_A-Z0-9.\-]+({B}*{CMD}doxyconfig{B}+{DOXYCFG})? {
2506<GuardParam>{DOCNL} {
2521<GuardParamEnd>{B}*{DOCNL} {
2523 yyextra->spaceBeforeIf.clear();
2527<GuardParamEnd>{B}* {
2528 if (!yyextra->spaceBeforeIf.empty())
2530 addOutput(yyscanner,yyextra->spaceBeforeIf);
2532 yyextra->spaceBeforeIf.clear();
2544<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2546 yyextra->guards->emplace(
false);
2547 BEGIN( GuardParam );
2549<SkipGuardedSection>{CMD}"if"/{NW} {
2551 yyextra->guards->emplace(
false);
2552 BEGIN( GuardParam );
2554<SkipGuardedSection>{CMD}"endif"/{NW} {
2555 if (yyextra->guards->empty())
2557 warn(yyextra->fileName,yyextra->lineNr,
2558 "found \\endif without matching start command");
2563 yyextra->guards->pop();
2564 if (yyextra->guards->empty())
2566 BEGIN( GuardParamEnd );
2570 if (yyextra->guards->top().isEnabled())
2572 BEGIN( GuardParamEnd );
2576 BEGIN( SkipGuardedSection );
2581<SkipGuardedSection>{CMD}"else"/{NW} {
2582 if (yyextra->guards->empty())
2584 warn(yyextra->fileName,yyextra->lineNr,
2585 "found \\else without matching start command");
2587 else if (yyextra->guards->top().hasElse())
2589 warn(yyextra->fileName,yyextra->lineNr,
2590 "found multiple \\else commands in same \\if construct");
2591 yyextra->guards->top().setEnabled(
false);
2592 BEGIN( SkipGuardedSection );
2594 else if (!yyextra->guards->top().parentVisible())
2596 yyextra->guards->top().setEnabled(
false);
2597 BEGIN( SkipGuardedSection );
2601 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2602 yyextra->guards->top().setElse();
2603 if (!yyextra->guards->top().parentVisible())
2605 yyextra->guards->top().setEnabled(
false);
2606 BEGIN( SkipGuardedSection );
2608 else if (yyextra->guards->top().isEnabledFound())
2610 yyextra->guards->top().setEnabled(
false);
2611 BEGIN( SkipGuardedSection );
2615 yyextra->guards->top().setEnabled(
true);
2616 BEGIN( GuardParamEnd );
2620<SkipGuardedSection>{CMD}"elseif"/{NW} {
2621 if (yyextra->guards->empty())
2623 warn(yyextra->fileName,yyextra->lineNr,
2624 "found \\elseif without matching start command");
2626 else if (yyextra->guards->top().hasElse())
2628 warn(yyextra->fileName,yyextra->lineNr,
2629 "found \\elseif command after \\else command was given in \\if construct");
2631 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2632 yyextra->guards->top().setEnabled(
false);
2633 BEGIN( GuardParam );
2638 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2639 yyextra->guards->top().setEnabled(
false);
2640 BEGIN( GuardParam );
2643<SkipGuardedSection>{DOCNL} {
2644 if (*yytext==
'\n') yyextra->lineNr++;
2647<SkipGuardedSection>[^ \\@\n]+ {
2649<SkipGuardedSection>{CMD}{CMD} |
2650<SkipGuardedSection>. {
2656<SkipInternal>{DOCNL} {
2657 if (*yytext==
'\n') yyextra->lineNr++;
2660<SkipInternal>{CMD}"if"/[ \t] {
2661 yyextra->condCount++;
2663<SkipInternal>{CMD}"ifnot"/[ \t] {
2664 yyextra->condCount++;
2666<SkipInternal>{CMD}/"endif" {
2667 yyextra->condCount--;
2668 if (yyextra->condCount<0)
2674<SkipInternal>{CMD}/"section"[ \t] {
2675 if (yyextra->sectionLevel>0)
2681<SkipInternal>{CMD}/"subsection"[ \t] {
2682 if (yyextra->sectionLevel>1)
2688<SkipInternal>{CMD}/"subsubsection"[ \t] {
2689 if (yyextra->sectionLevel>2)
2695<SkipInternal>{CMD}/"paragraph"[ \t] {
2696 if (yyextra->sectionLevel>3)
2702<SkipInternal>{CMD}/"subparagraph"[ \t] {
2703 if (yyextra->sectionLevel>4)
2709<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2710 if (yyextra->sectionLevel>5)
2716<SkipInternal>{CMD}"endinternal"[ \t]* {
2719<SkipInternal>[^ \\@\n]+ {
2736 yyextra->docGroup.appendHeader(
' ');
2739 yyextra->docGroup.appendHeader(*yytext);
2740 yyextra->current->name+=*yytext;
2755<RaiseWarning,RaiseWarningSection>{DOCNL} {
2757 "{}",yyextra->raiseWarning);
2758 yyextra->raiseWarning =
"";
2759 if (*yytext==
'\n') yyextra->lineNr++;
2761 if (YY_START == RaiseWarning)
2767 yyextra->sectionTitle+=yytext;
2768 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2771<RaiseWarning,RaiseWarningSection>. {
2772 yyextra->raiseWarning += yytext;
2776<InGroupParam>{LABELID} {
2777 yyextra->current->groups.emplace_back(
2780 yyextra->inGroupParamFound=
true;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2782<InGroupParam>{DOCNL} {
2783 if (!yyextra->inGroupParamFound)
2785 warn(yyextra->fileName,yyextra->lineNr,
2786 "Missing group name for \\ingroup command"
2805 if (yyextra->braceCount==0)
2807 if (yyextra->functionProto.stripWhiteSpace().empty())
2809 warn(yyextra->fileName,yyextra->lineNr,
2810 "missing argument after '\\{}'.",yyextra->currentCmd
2816 yyextra->langParser->parsePrototype(yyextra->functionProto);
2824 yyextra->functionProto+=
' ';
2826<FnParam>[^@\\\n()]+ {
2827 yyextra->functionProto+=yytext;
2830 yyextra->functionProto+=yytext;
2831 yyextra->braceCount++;
2834 yyextra->functionProto+=yytext;
2835 yyextra->braceCount--;
2838 yyextra->functionProto+=*yytext;
2845<OverloadParam>{DOCNL} {
2846 if (*yytext==
'\n') yyextra->lineNr++;
2847 if (yyextra->functionProto.stripWhiteSpace().empty())
2855 yyextra->langParser->parsePrototype(yyextra->functionProto);
virtual DString trOverloadText()=0
Translator * theTranslator
2859<OverloadParam>{LC} {
2861 yyextra->functionProto+=
' ';
2864 yyextra->functionProto+=*yytext;
2869<InheritParam>({ID}("::"|"."))*{ID} {
2870 yyextra->current->extends.emplace_back(
2875<InheritParam>{DOCNL} {
2876 warn(yyextra->fileName,yyextra->lineNr,
2877 "\\inherit command has no argument"
2879 if (*yytext==
'\n') yyextra->lineNr++;
2884 warn(yyextra->fileName,yyextra->lineNr,
2885 "Invalid or missing name for \\inherit command"
2892<ExtendsParam>({ID}("::"|"."))*{ID} {
2893 yyextra->current->extends.emplace_back(
2898<ExtendsParam>{DOCNL} {
2899 warn(yyextra->fileName,yyextra->lineNr,
2900 "'\\{}' command has no argument",yyextra->currentCmd
2912<SkipLang>{CMD}"~"[a-zA-Z-]* {
2916 warn(yyextra->fileName,yyextra->lineNr,
2919 else if (langId.
empty() ||
2925<SkipLang>[^*@\\\n]* {
2928 if (*yytext==
'\n') yyextra->lineNr++;
2935<CiteLabel,CiteLabelSection>{CITEID} {
2938 if (YY_START == CiteLabel)
2944 yyextra->sectionTitle+=yytext;
2945 BEGIN(SectionTitle);
2948<CiteLabel,CiteLabelSection>{DOCNL} {
2949 warn(yyextra->fileName,yyextra->lineNr,
2950 "\\cite command has no label"
2954 if (YY_START == CiteLabel)
2961 yyextra->sectionTitle+=yytext;
2963 BEGIN(SectionTitle);
2966<CiteLabel,CiteLabelSection>. {
2967 warn(yyextra->fileName,yyextra->lineNr,
2968 "Invalid or missing cite label"
2970 if (YY_START == CiteLabel)
2976 yyextra->sectionTitle+=yytext;
2977 BEGIN(SectionTitle);
2985 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2986 addOutput(yyscanner,yyextra->copyDocArg);
2990<CopyDoc>"<"[/]?{TABLEDEL}">" {
2991 if (yyextra->braceCount==0)
2994 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2995 addOutput(yyscanner,yyextra->copyDocArg);
3001 if (*yytext==
'\n') yyextra->lineNr++;
3002 if (yyextra->braceCount==0)
3005 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3006 addOutput(yyscanner,yyextra->copyDocArg);
3014<CopyDoc>[^@\\\n()<]+ {
3015 yyextra->copyDocArg+=yytext;
3019 yyextra->copyDocArg+=yytext;
3021 yyextra->braceCount++;
3024 yyextra->copyDocArg+=yytext;
3026 yyextra->braceCount--;
3029 yyextra->copyDocArg+=yytext;
3051 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3052 yyextra->braceCount=0;
3053 yyextra->functionProto.clear();
3054 yyextra->currentCmd = cmd;
3055 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3062 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3063 yyextra->functionProto.clear();
3064 yyextra->braceCount=0;
3065 yyextra->currentCmd = cmd;
3066 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3074 yyextra->functionProto.clear();
3075 BEGIN(OverloadParam);
3081 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3082 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3083 BEGIN( EnumDocArg1 );
3089 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3092 BEGIN( GroupDocArg1 );
3098 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3101 BEGIN( GroupDocArg1 );
3107 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3110 BEGIN( GroupDocArg1 );
3116 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3117 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3118 BEGIN( NameSpaceDocArg1 );
3124 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3126 BEGIN( PackageDocArg1 );
3132 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3133 yyextra->currentCmd = cmd;
3134 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3135 BEGIN( ClassDocArg1 );
3141 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3142 yyextra->currentCmd = cmd;
3143 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3144 BEGIN( ConceptDocArg1 );
3150 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3151 yyextra->currentCmd = cmd;
3152 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3153 BEGIN( ModuleDocArg1 );
3159 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3160 BEGIN( ClassDocArg2 );
3166 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3167 yyextra->currentCmd = cmd;
3168 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3169 BEGIN( ClassDocArg1 );
3175 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3176 yyextra->currentCmd = cmd;
3177 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3178 BEGIN( CategoryDocArg1 );
3184 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3185 yyextra->currentCmd = cmd;
3186 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3187 BEGIN( ClassDocArg1 );
3193 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3194 yyextra->currentCmd = cmd;
3195 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3196 BEGIN( ClassDocArg1 );
3202 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3203 yyextra->currentCmd = cmd;
3204 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3205 BEGIN( ClassDocArg1 );
3211 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3212 yyextra->currentCmd = cmd;
3213 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3214 BEGIN( ClassDocArg1 );
3220 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3222 BEGIN( PageDocArg1 );
3228 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3232 yyextra->current->name =
"mainpage";
3235 BEGIN( PageDocArg2 );
3241 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3245 yyextra->current->name = yyextra->fileName;
3247 BEGIN( FileDocArg1 );
3253 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3263 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3271 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3273 if (!stop) yyextra->current->name = yyextra->fileName;
3274 BEGIN( FileDocArg1 );
3280 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3282 for (
const auto &opt : optList)
3286 sectionMaker=EntryType::makeExampleLineno;
3290 warn(yyextra->fileName,yyextra->lineNr,
3291 "unsupported option '{}' for command '\\{}'",opt,cmd);
3295 if (!stop) yyextra->current->name = yyextra->fileName;
3296 BEGIN( FileDocArg1 );
3302 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3305 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3314 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3315 yyextra->raiseWarning =
"";
3316 BEGIN( RaiseWarning );
3322 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3329 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3333 yyextra->docGroup.clearHeader();
3335 if (!yyextra->docGroup.empty())
3337 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true,
true);
3345 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3354 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3363 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3372 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3376 yyextra->current->spec.setDeprDoc(
true);
3382 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3384 BEGIN(XRefItemParam1);
3390 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3391 if (yyextra->insideParBlock)
3393 warn(yyextra->fileName,yyextra->lineNr,
3394 "found \\parblock command while already in a parblock!");
3396 if (!yyextra->spaceBeforeCmd.empty())
3398 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3399 yyextra->spaceBeforeCmd.clear();
3402 yyextra->insideParBlock =
true;
3408 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3409 if (!yyextra->insideParBlock)
3411 warn(yyextra->fileName,yyextra->lineNr,
3412 "found \\endparblock command without matching \\parblock!");
3416 yyextra->insideParBlock =
false;
3422 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3423 if (!yyextra->current->relates.empty())
3425 warn(yyextra->fileName,yyextra->lineNr,
3426 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3428 yyextra->current->relatesType = RelatesType::Simple;
3429 yyextra->currentCmd = cmd;
3430 BEGIN(RelatesParam1);
3436 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3437 if (!yyextra->current->relates.empty())
3439 warn(yyextra->fileName,yyextra->lineNr,
3440 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3442 yyextra->current->relatesType = RelatesType::Duplicate;
3443 yyextra->currentCmd = cmd;
3444 BEGIN(RelatesParam1);
3450 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3451 if (!yyextra->current->relates.empty())
3453 warn(yyextra->fileName,yyextra->lineNr,
3454 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3456 yyextra->current->relatesType = RelatesType::MemberOf;
3457 yyextra->currentCmd = cmd;
3458 BEGIN(RelatesParam1);
3464 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3472 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3475 BEGIN(SectionLabel);
3476 yyextra->sectionLabel.clear();
3485 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3487 switch (yyextra->sectionLevel)
3495 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3502 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3504 BEGIN( RequirementLabel );
3510 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3511 BEGIN( SatisfiesLabel );
3517 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3518 BEGIN( VerifiesLabel );
3524 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3525 if (!yyextra->current->section.isEmpty() &&
3526 !yyextra->current->section.isPageDoc() &&
3527 !yyextra->current->section.isMainpageDoc()
3530 warn(yyextra->fileName,yyextra->lineNr,
3531 "found \\subpage command in a comment block that is not marked as a page!");
3533 if (!yyextra->spaceBeforeCmd.empty())
3535 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3536 yyextra->spaceBeforeCmd.clear();
3539 BEGIN(SubpageLabel);
3545 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3547 if (optList.empty())
3549 yyextra -> anchorTitle =
"";
3553 yyextra -> anchorTitle =
join(optList,
" ");
3561 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3562 for (
const auto &opt : optList)
3572 if (!yyextra->spaceBeforeCmd.empty())
3574 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3575 yyextra->spaceBeforeCmd.clear();
3577 if (optList.empty())
3591 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3592 if (!yyextra->spaceBeforeCmd.empty())
3594 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3595 yyextra->spaceBeforeCmd.clear();
3597 if (optList.empty())
3611 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3612 if (!yyextra->spaceBeforeCmd.empty())
3614 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3615 yyextra->spaceBeforeCmd.clear();
3621 if (optList.empty())
3630 yyextra->blockName=s;
3631 yyextra->commentCount=0;
3638 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3646 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3664 static std::unordered_map<std::string,OptionFunc> options =
3667 {
"name", [](
const FileInfo &fi_) ->
DString {
return fi_.baseName(); } },
3668 {
"extension", [](
const FileInfo &fi_) ->
DString {
return fi_.extension(
true); } },
3669 {
"filename", [](
const FileInfo &fi_) ->
DString {
return fi_.fileName(); } },
3670 {
"directory", [](
const FileInfo &fi_) ->
DString {
return fi_.dirPath(); } },
3671 {
"full", [](
const FileInfo &fi_) ->
DString {
return fi_.absFilePath(); } }
3673 auto it = options.
find(optionName);
3674 return (it!=options.end()) ? it->second(fi) :
DString();
3679 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3680 if (!yyextra->spaceBeforeCmd.empty())
3682 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3683 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3684 yyextra->spaceBeforeCmd.clear();
3687 FileInfo fi(yyextra->fileName.str());
3688 for (
const auto &opt_ : optList)
3691 std::string opt = optStripped.
lower().
str();
3693 if (!result.
empty())
3697 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3704 yyextra->sectionTitle+=result;
3711 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3718 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3723 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3732 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3733 if (!yyextra->spaceBeforeCmd.empty())
3735 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3736 yyextra->spaceBeforeCmd.clear();
3744 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3752 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3760 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3767 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3769 BEGIN(IRaisePrefix);
3775 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3777 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3778 if (yyextra->guards->empty())
3780 yyextra->guards->emplace(
true);
3784 bool enabled = yyextra->guards->top().isEnabled();
3785 yyextra->guards->emplace(enabled);
3793 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3795 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3796 if (yyextra->guards->empty())
3798 yyextra->guards->emplace(
true);
3802 bool enabled = yyextra->guards->top().isEnabled();
3803 yyextra->guards->emplace(enabled);
3811 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3812 if (yyextra->guards->empty())
3814 warn(yyextra->fileName,yyextra->lineNr,
3815 "found \\elseif without matching start command");
3817 else if (yyextra->guards->top().hasElse())
3819 warn(yyextra->fileName,yyextra->lineNr,
3820 "found \\elseif command after \\else command was given in \\if construct");
3822 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3823 yyextra->guards->top().setEnabled(
false);
3829 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3830 yyextra->guards->top().setEnabled(
false);
3838 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3839 if (yyextra->guards->empty())
3841 warn(yyextra->fileName,yyextra->lineNr,
3842 "found \\else without matching start command");
3844 else if (yyextra->guards->top().hasElse())
3846 warn(yyextra->fileName,yyextra->lineNr,
3847 "found multiple \\else commands in same \\if construct");
3848 yyextra->guards->top().setEnabled(
false);
3849 yyextra->guards->top().setElse();
3850 BEGIN( SkipGuardedSection );
3854 yyextra->guards->top().setElse();
3855 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3856 if (yyextra->guards->top().isEnabledFound())
3858 yyextra->guards->top().setEnabled(
false);
3859 BEGIN( SkipGuardedSection );
3863 yyextra->guards->top().setEnabled(
true);
3864 BEGIN( GuardParamEnd );
3872 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3873 if (yyextra->guards->empty())
3875 warn(yyextra->fileName,yyextra->lineNr,
3876 "found \\endif without matching start command");
3880 yyextra->guards->pop();
3882 if (!yyextra->spaceBeforeCmd.empty())
3884 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3885 yyextra->spaceBeforeCmd.clear();
3887 if (yyextra->guards->empty())
3889 BEGIN( GuardParamEnd );
3893 if (yyextra->guards->top().isEnabled())
3895 BEGIN( GuardParamEnd );
3899 BEGIN( SkipGuardedSection );
3907 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3908 yyextra->inGroupParamFound=
false;
3909 BEGIN( InGroupParam );
3915 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3916 yyextra->current->subGrouping =
false;
3922 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3923 yyextra->current->initLines = 100000;
3929 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3930 yyextra->current->initLines = 0;
3936 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3937 yyextra->current->commandOverrides.override_callGraph(
true);
3943 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3944 yyextra->current->commandOverrides.override_callGraph(
false);
3950 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3951 yyextra->current->commandOverrides.override_callerGraph(
true);
3957 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3958 yyextra->current->commandOverrides.override_callerGraph(
false);
3964 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3965 yyextra->current->commandOverrides.override_enumValues(
true);
3971 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3972 yyextra->current->commandOverrides.override_enumValues(
false);
3978 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3979 yyextra->current->commandOverrides.override_inlineSource(
true);
3985 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3986 yyextra->current->commandOverrides.override_inlineSource(
false);
3992 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3993 yyextra->current->commandOverrides.override_includeGraph(
true);
3999 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4000 yyextra->current->commandOverrides.override_includedByGraph(
true);
4006 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4007 yyextra->current->commandOverrides.override_includeGraph(
false);
4013 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4014 yyextra->current->commandOverrides.override_includedByGraph(
false);
4020 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4021 yyextra->current->commandOverrides.override_directoryGraph(
true);
4027 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4028 yyextra->current->commandOverrides.override_directoryGraph(
false);
4034 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4035 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4041 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4042 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4048 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4049 yyextra->current->commandOverrides.override_groupGraph(
true);
4055 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4056 yyextra->current->commandOverrides.override_groupGraph(
false);
4062 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4063 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4064 for (
const auto &opt_ : optList)
4071 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4073 else if (opt ==
"graph")
4075 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4077 else if (opt ==
"builtin")
4079 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4081 else if (opt ==
"text")
4083 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4085 else if (opt ==
"no")
4087 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4091 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4101 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4102 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4108 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4109 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4115 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4116 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4122 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4123 yyextra->current->commandOverrides.override_referencesRelation(
true);
4129 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4130 yyextra->current->commandOverrides.override_referencesRelation(
false);
4136 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4137 yyextra->currentCmd = cmd;
4144 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4149 if (yyextra->current->doc.stripWhiteSpace().empty())
4151 yyextra->current->doc.clear();
4153 yyextra->condCount=0;
4154 BEGIN( SkipInternal );
4160 yyextra->inInternalDocs =
true;
4167 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4168 yyextra->current->isStatic =
true;
4174 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4175 yyextra->current->virt = Specifier::Pure;
4181 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4182 yyextra->current->protection = Protection::Private;
4188 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4189 yyextra->current->protection = yyextra->protection = Protection::Private;
4195 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4196 yyextra->current->protection = Protection::Protected;
4202 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4203 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4209 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4210 yyextra->current->protection = Protection::Public;
4216 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4217 yyextra->current->protection = yyextra->protection = Protection::Public;
4223 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4224 if (yyextra->current->section.isPageDoc() ||
4225 yyextra->current->section.isMainpageDoc())
4227 for (
const auto &opt_ : optList)
4231 size_t i = opt.
find(
':');
4235 if (sscanf(opt.
mid(i+1).
data(),
"%d%c",&level,&dum) != 1)
4237 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4251 yyextra->current->localToc.enableHtml(level);
4253 else if (opt ==
"latex")
4255 yyextra->current->localToc.enableLatex(level);
4257 else if (opt ==
"xml")
4259 yyextra->current->localToc.enableXml(level);
4261 else if (opt ==
"docbook")
4263 yyextra->current->localToc.enableDocbook(level);
4267 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4272 if (yyextra->current->localToc.nothingEnabled())
4284 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4285 BEGIN(InheritParam);
4291 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4292 yyextra->currentCmd = cmd;
4293 BEGIN(ExtendsParam);
4299 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4300 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4306 if (!yyextra->spaceBeforeCmd.empty())
4308 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4309 yyextra->spaceBeforeCmd.clear();
4317 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4319 if (!yyextra->spaceBeforeCmd.empty())
4321 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4322 yyextra->spaceBeforeCmd.clear();
4330 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4331 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4337 if (!yyextra->spaceBeforeCmd.empty())
4339 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4340 yyextra->spaceBeforeCmd.clear();
4343 yyextra->copyDocArg.clear();
4344 yyextra->braceCount = 0;
4353 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4354 yyextra->sectionLabel.clear();
4355 yyextra->sectionTitle.clear();
4356 yyextra->docGroup.clearHeader();
4357 yyextra->insideParBlock =
false;
4364 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4366 return yyextra->current->section.isDoc();
4371 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4374 if (yyextra->current->section.isDoc())
4380 yyextra->needNewEntry =
true;
4381 yyextra->current->section = maker();
4382 yyextra->current->fileName = yyextra->fileName;
4383 yyextra->current->startLine = yyextra->lineNr;
4384 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4397 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4398 for(
const char* c = yytext ; *c ; ++c )
4399 yyextra->lineNr += (*c ==
'\n') ;
4407 if (s==
nullptr || *s==0)
return name;
4409 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4420 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4423 DString reqId = yyextra->current->name;
4429 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4434 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4436 yyextra->fileName,yyextra->lineNr,
4445 const DString &listTitle,
bool append,
bool inBody,
int lineNr)
4447 if (baseName.
empty())
return;
4454 if (
Config_getEnum(MARKDOWN_ID_STYLE) == MARKDOWN_ID_STYLE_t::GITHUB) listName = doxygenList + listName;
4457 for (
auto it = current->
sli.rbegin(); it != current->
sli.rend(); ++it)
4477 item = refList->
add();
4483 current->
sli.push_back(item);
4485 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4492 current->
doc += cmdString;
4503 current->
anchors.push_back(si);
4505 else if (si->
lineNr() != -1)
4507 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4512 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4519 current->
anchors.push_back(si);
4529 const DString &listTitle,
bool append)
4531 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4532 addXRefItemToEntry(yyextra->current,yyextra->outputXRef,listName,itemTitle,listTitle,append,yyextra->inBody,yyextra->lineNr);
4533 yyextra->outputXRef.clear();
4541 if (label.
empty())
return;
4542 signed char c =
static_cast<signed char>(label[0]);
4543 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4547 for (
size_t i=1; i<label.
size(); i++)
4549 c =
static_cast<signed char>(label[i]);
4550 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4565 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4567 DString formula = (yyextra->formulaPreText +
4568 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4576 formLabel.
sprintf(
"\\_form#%d",
id);
4577 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4594 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4602 if (addYYtext) yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
4603 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4604 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4606 yyextra->sectionLevel);
4609 yyextra->current->anchors.push_back(si);
4611 else if (si->
lineNr() != -1)
4613 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4618 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4619 yyextra->sectionLabel,si->
fileName());
4625 if (addYYtext) yyextra->sectionTitle+=
substitute(yytext,
"#",
"@#");
4626 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4627 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4629 yyextra->sectionLevel);
4632 yyextra->current->anchors.push_back(si);
4641 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4643 if (yytext[0] ==
'"')
4646 name=name.
left((
int)yyleng-2);
4662 if (c==
' ' || c==
'\t' || c==
'\r')
4685 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4686 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4688 yyextra->xrefAppendFlag = !yyextra->inBody &&
4690 yyextra->newXRefKind==yyextra->xrefKind &&
4692 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4708 switch(yyextra->xrefKind)
4735 xrefAppendToPrev || yyextra->current->spec.isDeprAttr()
4740 yyextra->xrefItemTitle,
4741 yyextra->xrefListTitle,
4750 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4752 int oldContext = yyextra->inContext;
4753 yyextra->inContext = ctx;
4755 switch(yyextra->inContext)
4758 if (oldContext!=yyextra->inContext)
4761 if (yyextra->current->doc.empty()) yyextra->current->docLine = yyextra->lineNr;
4762 if (yyextra->current->docFile.empty())
4764 yyextra->current->docFile = yyextra->fileName;
4765 yyextra->current->docLine = yyextra->lineNr;
4768 yyextra->pOutputString = &yyextra->current->doc;
4772 if (oldContext!=yyextra->inContext)
4774 if (yyextra->current->brief.empty()) yyextra->current->briefLine = yyextra->lineNr;
4775 if (yyextra->current->briefFile.empty())
4777 yyextra->current->briefFile = yyextra->fileName;
4778 yyextra->current->briefLine = yyextra->lineNr;
4781 bool foundMatch =
false;
4782 if (yyextra->current->brief.stripWhiteSpace().empty())
4790 std::string str = yyextra->current->brief.str();
4795 for (
size_t i = 0; i < match[2].str().size(); i++)
4797 if (match[2].str()[i] ==
'\n') cnt++;
4801 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4803 yyextra->current->brief +=
" \\iline " +
DString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4810 yyextra->pOutputString = &yyextra->current->brief;
4814 if (!yyextra->current->doc.empty())
4816 yyextra->current->doc +=
"\n";
4818 yyextra->pOutputString = &yyextra->current->doc;
4824 yyextra->pOutputString = &yyextra->outputXRef;
4829 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4838 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4846 yyextra->current->anchors.push_back(si);
4848 else if (si->
lineNr() != -1)
4850 warn(yyextra->fileName,yyextra->lineNr,
4851 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4856 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4863 yyextra->current->anchors.push_back(si);
4870 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4872 *yyextra->pOutputString+=s;
4878 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4880 *yyextra->pOutputString+=s;
4886 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4887 *yyextra->pOutputString+=c;
4893 snprintf(cmd,30,
" \\iline %d ",lineNr);
4900 snprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4906 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4907 std::string_view str = yyextra->current->brief.view();
4912 yyextra->briefEndsAtDot=
false;
4914 if (yyextra->current->doc.stripWhiteSpace().empty())
4916 yyextra->current->docLine = yyextra->lineNr;
4917 yyextra->current->doc =
"";
4921 addIline(yyscanner,yyextra->lineNr);
4927 int saveLineNr = yyextra->lineNr;
4929 yyextra->current->briefLine = yyextra->lineNr;
4930 yyextra->lineNr = saveLineNr;
4936 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4937 yyextra->prevPosition=yyextra->inputPosition;
4939 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4941 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4953 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4954 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4955 YY_START==ReadFormulaLong)
4957 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4971 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4979 commentscanYYlex_destroy(
p->yyscanner);
4992 bool &newEntryNeeded,
4993 bool markdownSupport,
4997 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4998 " prot={} markdownSupport={}",
Trace::trunc(comment),fileName,lineNr,isBrief,
4999 isAutoBriefOn,isInbody,prot,markdownSupport);
5001 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5004 yyextra->guards = guards;
5005 yyextra->langParser = parser;
5006 yyextra->current = curEntry;
5007 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
5008 if (comment.
empty())
return false;
5009 yyextra->inputString = comment;
5010 yyextra->inputString.
append(
" ");
5011 yyextra->inputPosition = position;
5012 yyextra->lineNr = lineNr;
5013 yyextra->fileName = fileName;
5014 yyextra->protection = prot;
5015 yyextra->needNewEntry =
false;
5017 yyextra->xrefAppendFlag =
false;
5018 yyextra->insidePre =
false;
5019 yyextra->parseMore =
false;
5020 yyextra->inBody = isInbody;
5021 yyextra->markdownSupport= markdownSupport;
5022 yyextra->outputXRef.clear();
5023 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.empty())
5025 yyextra->current->doc +=
'\n';
5028 yyextra->briefEndsAtDot = isAutoBriefOn;
5029 yyextra->condCount = 0;
5030 yyextra->sectionLevel = 0;
5031 yyextra->spaceBeforeCmd.clear();
5032 yyextra->spaceBeforeIf.clear();
5033 yyextra->htmlContextStack.clear();
5036 if (!yyextra->current->inbodyDocs.empty() && isInbody)
5039 snprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5040 yyextra->current->inbodyDocs+=cmd;
5044 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5047 commentscanYYrestart(
nullptr, yyscanner );
5049 commentscanYYlex(yyscanner);
5052 if (YY_START==OverloadParam)
5057 if (yyextra->insideParBlock)
5059 warn(yyextra->fileName,yyextra->lineNr,
5060 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5066 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.empty())
5069 yyextra->current->doc=
"\n\n";
5072 if (yyextra->current->section.isMemberGrp() &&
5073 yyextra->docGroup.empty())
5075 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5079 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5081 yyextra->current->briefLine,yyextra->current->brief,
5082 yyextra->current->docLine,yyextra->current->doc,
5083 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5087 prot = yyextra->protection;
5089 yyextra->docGroup.addDocs(curEntry);
5091 newEntryNeeded = yyextra->needNewEntry;
5096 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
false;
5098 if (!yyextra->parseMore && !yyextra->guards->empty())
5100 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5103 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5105 lineNr = yyextra->lineNr;
5107 position,yyextra->parseMore,newEntryNeeded);
5109 return yyextra->parseMore;
5114 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5116 bool sectionEnabled =
false;
5121 bool parentEnabled = yyextra->guards->top().parentVisible();
5125 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5126 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5130 yyextra->guards->top().setEnabled(
true);
5131 yyextra->guards->top().setEnabledFound();
5132 BEGIN( GuardParamEnd );
5136 if (yyextra->guards->top().isEnabledFound())
5138 yyextra->guards->top().setEnabled(
false);
5139 BEGIN( SkipGuardedSection );
5141 else if (sectionEnabled)
5143 yyextra->guards->top().setEnabled(
true);
5144 yyextra->guards->top().setEnabledFound();
5145 BEGIN( GuardParamEnd );
5149 yyextra->guards->top().setEnabled(
false);
5150 BEGIN( SkipGuardedSection );
5155 BEGIN( SkipGuardedSection );
5160 BEGIN( SkipGuardedSection );
5166 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5167 yyextra->docGroup.initGroupInfo(entry);
5172 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5173 yyextra->docGroup.enterFile(fileName,lineNr);
5178 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5179 yyextra->docGroup.leaveFile(fileName,lineNr);
5184 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5185 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5190 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5191 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5196 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5197 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5202 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5203 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5213 static reg::Ex deprecated_re(R
"(deprecated\s*(\(\s*\"([^\"]*)\"\s*\))?)");
5219 if (match.size()==3)
5222 DString rawDoc = match[2].str();
5224 std::shared_ptr<Entry> docEntry = std::make_shared<Entry>();
5226 bool newEntryNeeded =
false;
5242 docs = docEntry->doc;
5247 current->
spec.setDeprAttr(
true);
5249 if (!docs.
empty() || !current->
spec.isDeprDoc())
5270#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.