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} {
1524<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1525 yyextra->current->name = yytext;
1529 if (yyextra->current->name.endsWith(
".html"))
1531 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1533 else if (yyextra->current->name.endsWith(
".xhtml"))
1535 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1537 yyextra->current->type.clear();
1538 BEGIN(GroupDocArg2);
1540<GroupDocArg1>"\\"{B}*"\n" {
1544<GroupDocArg1>{DOCNL} {
1545 warn(yyextra->fileName,yyextra->lineNr,
1546 "missing group name after {}",
1547 yyextra->current->groupDocCmd()
1556<GroupDocArg2>"\\"{B}*"\n" {
1560<GroupDocArg2>[^\n\\]+ {
1561 yyextra->current->type += yytext;
1563<GroupDocArg2>{DOCNL}+ {
1564 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1566 yyextra->current->type.empty()
1569 warn(yyextra->fileName,yyextra->lineNr,
1570 "missing title after "
1571 "\\defgroup {}", yyextra->current->name
1575 int extraLineNr = 0;
1578 for (
int i = 0; i < yyleng; i++)
1580 if (yytext[i]==
'\n') extraLineNr++;
1587 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1588 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1593 yyextra->current->type += yytext;
1598<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1602 size_t start = text.
find(
'{');
1603 size_t end = text.
find(
'}',start+1);
1604 yyextra->current->name = text.
mid(
end+2);
1605 size_t istart = yyextra->current->name.
find(
"\\ilinebr");
1608 DString rest = yyextra->current->name.
mid(istart);
1610 yyextra->current->name = yyextra->current->name.left(istart);
1612 yyextra->current->args = text.
mid(start+1,
end-start-1);
1614 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1616<PageDocArg1>{FILE} {
1618 yyextra->current->args =
"";
1619 BEGIN( PageDocArg2 );
1621<PageDocArg1>{LC} { yyextra->lineNr++;
1624<PageDocArg1>{DOCNL} {
1625 warn(yyextra->fileName,yyextra->lineNr,
1626 "missing argument after \\page."
1635<PageDocArg2>{DOCNL} {
1639 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1640 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1643<PageDocArg2>{CMD}[<>] {
1648 yyextra->current->args += tmp;
1651 yyextra->current->args += yytext;
1654<ParamArg1>{ID}/{B}*"," {
1661 if (*yytext==
'\n') yyextra->lineNr++;
1675<FileDocArg1>{DOCNL} {
1681<FileDocArg1>{FILE} {
1685<FileDocArg1>{LC} { yyextra->lineNr++;
1693<XRefItemParam1>{LABELID} {
1694 yyextra->newXRefItemKey=yytext;
1696 BEGIN(XRefItemParam2);
1698<XRefItemParam1>{LC} {
1702<XRefItemParam1>{DOCNL} {
1703 warn(yyextra->fileName,yyextra->lineNr,
1704 "Missing first argument of \\xrefitem"
1706 if (*yytext==
'\n') yyextra->lineNr++;
1714<XRefItemParam2>"\""[^\n\"]*"\"" {
1716 BEGIN(XRefItemParam3);
1718<XRefItemParam2>{LC} {
1722<XRefItemParam2>{DOCNL} {
1723 warn(yyextra->fileName,yyextra->lineNr,
1724 "Missing second argument of \\xrefitem"
1726 if (*yytext==
'\n') yyextra->lineNr++;
1734<XRefItemParam3>"\""[^\n\"]*"\"" {
1739<XRefItemParam2,XRefItemParam3>{LC} {
1743<XRefItemParam3>{DOCNL} {
1744 warn(yyextra->fileName,yyextra->lineNr,
1745 "Missing third argument of \\xrefitem"
1747 if (*yytext==
'\n') yyextra->lineNr++;
1758<RelatesParam1>({ID}("::"|"."))*{ID} {
1759 yyextra->current->relates = yytext;
1766<RelatesParam1>{LC} {
1770<RelatesParam1>{DOCNL} {
1771 warn(yyextra->fileName,yyextra->lineNr,
1772 "Missing argument of '\\{}' command",yyextra->currentCmd
1784<Qualifier>{LABELID} {
1785 yyextra->current->qualifiers.emplace_back(yytext);
1788<Qualifier>"\""[^\"]*"\"" {
1789 std::string inp(yytext);
1790 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1794 warn(yyextra->fileName,yyextra->lineNr,
1795 "Missing argument of '\\{}' command",yyextra->currentCmd
1801 warn(yyextra->fileName,yyextra->lineNr,
1802 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1808<ILine>{LINENR}/[\\@\n\.] |
1814 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1818 yyextra->lineNr = nr;
1821 if (YY_START == ILine)
1827 yyextra->sectionTitle+=yytext;
1828 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1831<ILine,ILineSection>. {
1833 if (YY_START == ILine)
1839 yyextra->sectionTitle+=yytext;
1840 BEGIN(SectionTitle);
1845<IRaise>{B}*[0-9]+/[\\@\n\.] |
1846<IRaise>{B}*[0-9]+{B} {
1851 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1855 yyextra->raiseLevel = nr;
1865<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1879<IFile,IFileSection>{FILE} {
1882 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1883 else yyextra->fileName = yytext;
1884 if (YY_START == IFile)
1890 yyextra->sectionTitle+=yytext;
1891 BEGIN(SectionTitle);
1895<LinkSection>[^\\@\n]* {
1896 yyextra->sectionTitle+=yytext;
1898<LinkSection>{CMD}{CMD} {
1899 yyextra->sectionTitle+=yytext;
1901<LinkSection>{DOCNL} {
1903 if (*yytext ==
'\n') yyextra->lineNr++;
1904 yyextra->sectionTitle+=yytext;
1906<LinkSection>{CMD}"endlink" {
1907 yyextra->sectionTitle+=yytext;
1908 BEGIN(SectionTitle);
1911 yyextra->sectionTitle+=yytext;
1913<LinkSection><<EOF>> {
1914 warn(yyextra->fileName,yyextra->lineNr,
1915 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1921<LineParam>{CMD}{CMD} {
1934<LineParam>({CMD}{CMD}){ID} {
1943<SectionLabel>{LABELID} {
1944 yyextra->sectionLabel+=yytext;
1946<SectionLabel>{CMD}"lineinfo"("{}")? {
DString & setNum(short n)
1949<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1950 FileInfo fi(yyextra->fileName.str());
1951 bool hasOption =
false;
1953 if (yytext[yyleng-1] ==
'}')
1959 for (
const auto &opt_ : optList)
1962 std::string opt = optStripped.
lower().
str();
1964 if (!result.
empty())
1968 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1978 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1990 label=yyextra->fileName;
1994 yyextra->sectionLabel+=label;
#define Config_getBool(name)
DString stripFromPath(const DString &path)
1996<SectionLabel>{DOCNL} {
1997 yyextra->sectionTitle.clear();
1998 if (yyextra->sectionLabel.empty())
2000 warn(yyextra->fileName,yyextra->lineNr,
2001 "\\section command has no label"
2006 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2007 addOutput(yyscanner,yyextra->sectionLabel.data());
2010 if (*yytext==
'\n') yyextra->lineNr++;
2015 if (yyextra->sectionLabel.empty())
2017 warn(yyextra->fileName,yyextra->lineNr,
2018 "Invalid or missing section label"
2024 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2025 addOutput(yyscanner,yyextra->sectionLabel.data());
2026 yyextra->sectionTitle.clear();
2028 BEGIN(SectionTitle);
2031<SectionTitle>{STAopt}/"\n" {
2036<SectionTitle>{STopt}"\\\\ilinebr" {
2037 yyextra->sectionTitle+=yytext;
2039<SectionTitle>{STopt}/"\\ilinebr" {
2044<SectionTitle>{B}*{CMD}"f$" {
2045 yyextra->formulaText=
"";
2046 yyextra->formulaPreText=
"$";
2047 yyextra->formulaPostText=
"";
2048 yyextra->formulaNewLines=0;
2049 BEGIN(ReadFormulaShortSection);
2051<SectionTitle>{B}*{CMD}"f(" {
2052 yyextra->formulaText=
"";
2053 yyextra->formulaPreText=
"";
2054 yyextra->formulaPostText=
"";
2055 yyextra->formulaNewLines=0;
2056 BEGIN(ReadFormulaRoundSection);
2058<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2059<SectionTitle>{B}*{CMD}"f"[\[{] {
2063 warn(yyextra->fileName,yyextra->lineNr,
2064 "'\\{}' command is not allowed in section title, ending section title.",
2074<SectionTitle>[^\n@\\]* {
2075 yyextra->sectionTitle+=yytext;
2078<SectionTitle>{B}*{CMD}{CMD} {
2079 yyextra->sectionTitle+=yytext;
2082<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2083<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2085 size_t idx = fullMatch.
find(
'{');
2087 if ((idx !=
DString::npos) && (idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2105 switch (it->second.sectionHandling)
2110 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2111 yyextra->sectionTitle+=fullMatch.
left(i);
2112 yyextra->sectionTitle+=
'@';
2113 yyextra->sectionTitle+=fullMatch.
mid(i);
2117 warn(yyextra->fileName,yyextra->lineNr,
2118 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2126 warn(yyextra->fileName,yyextra->lineNr,
2127 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2135 if (cmdName ==
"fileinfo")
2138 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2139 yyextra->sectionTitle+=fullMatch.
left(i);
2144 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2149 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2153 else if (cmdName ==
"lineinfo")
2156 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2157 yyextra->sectionTitle+=fullMatch.
left(i);
2159 yyextra->sectionTitle+=
' ';
2160 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2166 else if (cmdName ==
"raisewarning")
2168 yyextra->raiseWarning =
"";
2169 BEGIN(RaiseWarningSection);
2171 else if (cmdName ==
"noop")
2176 else if (cmdName ==
"cite")
2178 yyextra->sectionTitle+=yytext;
2180 BEGIN(CiteLabelSection);
2182 else if (cmdName ==
"iline")
2184 yyextra->sectionTitle+=yytext;
2186 BEGIN(ILineSection);
2188 else if (cmdName ==
"ifile")
2190 yyextra->sectionTitle+=yytext;
2192 BEGIN(IFileSection);
2194 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2197 if (optList.empty())
2199 yyextra -> anchorTitle =
"";
2204 yyextra -> anchorTitle =
join(optList,
" ");
2207 BEGIN(AnchorLabelSection);
2209 else if (cmdName ==
"link")
2211 yyextra->sectionTitle+=yytext;
2216 yyextra->sectionTitle+=yytext;
2217 warn(yyextra->fileName,yyextra->lineNr,
2218 "internal error '\\{}' command is to be replaced in section title.",cmdName
2225 yyextra->sectionTitle+=yytext;
2233 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
2238 yyextra->sectionTitle+=yytext;
2244<SubpageLabel>{FILE} {
2248 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2249 BEGIN(SubpageTitle);
2251<SubpageLabel>{DOCNL} {
2252 warn(yyextra->fileName,yyextra->lineNr,
2253 "\\subpage command has no label"
2255 if (*yytext==
'\n') yyextra->lineNr++;
2263<SubpageTitle>{DOCNL} {
2267<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2278<AnchorLabel,AnchorLabelSection>{LABELID} {
2279 DString lbl = yyextra->raisePrefix+yytext;
2280 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2282 if (YY_START == AnchorLabel)
2288 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2291<AnchorLabel,AnchorLabelSection>{DOCNL} {
2292 warn(yyextra->fileName,yyextra->lineNr,
2293 "\\anchor command has no label"
2295 if (*yytext==
'\n') yyextra->lineNr++;
2297 if (YY_START == AnchorLabel)
2303 BEGIN(SectionTitle);
2306<AnchorLabel,AnchorLabelSection>. {
2307 warn(yyextra->fileName,yyextra->lineNr,
2308 "Invalid or missing anchor label"
2311 if (YY_START == AnchorLabel)
2317 BEGIN(SectionTitle);
2323<RequirementLabel>{REQID} {
2324 yyextra->current->name = yytext;
2325 yyextra->current->type.clear();
2326 BEGIN( RequirementTitle );
2328<SatisfiesLabel>{REQID} {
2329 yyextra->reqId = yytext;
2330 yyextra->reqTitle.clear();
2331 BEGIN( SatisfiesTitle );
2333<VerifiesLabel>{REQID} {
2334 yyextra->reqId = yytext;
2335 yyextra->reqTitle.clear();
2336 BEGIN( VerifiesTitle );
2338<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2342<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2343 warn(yyextra->fileName,yyextra->lineNr,
2344 "missing requirement ID after \\requirement command"
2349<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2352<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2356<RequirementTitle>[^\n\\]+ {
2357 yyextra->current->type += yytext;
2359<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2360 yyextra->reqTitle += yytext;
2362<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2363 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2368<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2369 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2371 if (yyextra->current->section.isRequirementDoc())
2373 warn(yyextra->fileName,yyextra->lineNr,
2374 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2387<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2388 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2390 if (yyextra->current->section.isRequirementDoc())
2392 warn(yyextra->fileName,yyextra->lineNr,
2393 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2406<RequirementTitle>. {
2407 yyextra->current->type += yytext;
2409<SatisfiesTitle,VerifiesTitle>. {
2410 yyextra->reqTitle += yytext;
2416<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2418 if (&yytext[4]==yyextra->blockName)
2423<FormatBlock>{CMD}"enduml" {
2425 if (yyextra->blockName==
"startuml")
2430<FormatBlock>[^ \@\*\/\\\n]* {
2433<FormatBlock>{DOCNL} {
2434 if (*yytext==
'\n') yyextra->lineNr++;
2438 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2439 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2440 yyextra->blockName==
"iliteral"
2442 ) yyextra->commentCount++;
2447 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2448 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2449 yyextra->blockName==
"iliteral"
2453 yyextra->commentCount--;
2454 if (yyextra->commentCount<0)
2456 DString endTag =
"end"+yyextra->blockName;
2457 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2458 warn(yyextra->fileName,yyextra->lineNr,
2459 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2460 yyextra->blockName,endTag);
2467<FormatBlock><<EOF>> {
2468 DString endTag =
"end"+yyextra->blockName;
2469 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2470 warn(yyextra->fileName,yyextra->lineNr,
2471 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2472 yyextra->blockName,endTag
2479<GuardParam>{B}*"(" {
2480 yyextra->guardExpr=yytext;
2481 yyextra->roundCount=1;
2485 yyextra->guardExpr+=yytext;
2489 yyextra->guardExpr+=yytext;
2490 yyextra->roundCount++;
2493 yyextra->guardExpr+=yytext;
2494 yyextra->roundCount--;
2495 if (yyextra->roundCount==0)
2501 warn(yyextra->fileName,yyextra->lineNr,
2502 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2506<GuardParam>{B}*{CMD}doxyconfig{B}+{DOXYCFG} {
2509<GuardParam>{B}*[a-z_A-Z0-9.\-]+({B}*{CMD}doxyconfig{B}+{DOXYCFG})? {
2512<GuardParam>{DOCNL} {
2527<GuardParamEnd>{B}*{DOCNL} {
2529 yyextra->spaceBeforeIf.clear();
2533<GuardParamEnd>{B}* {
2534 if (!yyextra->spaceBeforeIf.empty())
2536 addOutput(yyscanner,yyextra->spaceBeforeIf);
2538 yyextra->spaceBeforeIf.clear();
2550<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2552 yyextra->guards->emplace(
false);
2553 BEGIN( GuardParam );
2555<SkipGuardedSection>{CMD}"if"/{NW} {
2557 yyextra->guards->emplace(
false);
2558 BEGIN( GuardParam );
2560<SkipGuardedSection>{CMD}"endif"/{NW} {
2561 if (yyextra->guards->empty())
2563 warn(yyextra->fileName,yyextra->lineNr,
2564 "found \\endif without matching start command");
2569 yyextra->guards->pop();
2570 if (yyextra->guards->empty())
2572 BEGIN( GuardParamEnd );
2576 if (yyextra->guards->top().isEnabled())
2578 BEGIN( GuardParamEnd );
2582 BEGIN( SkipGuardedSection );
2587<SkipGuardedSection>{CMD}"else"/{NW} {
2588 if (yyextra->guards->empty())
2590 warn(yyextra->fileName,yyextra->lineNr,
2591 "found \\else without matching start command");
2593 else if (yyextra->guards->top().hasElse())
2595 warn(yyextra->fileName,yyextra->lineNr,
2596 "found multiple \\else commands in same \\if construct");
2597 yyextra->guards->top().setEnabled(
false);
2598 BEGIN( SkipGuardedSection );
2600 else if (!yyextra->guards->top().parentVisible())
2602 yyextra->guards->top().setEnabled(
false);
2603 BEGIN( SkipGuardedSection );
2607 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2608 yyextra->guards->top().setElse();
2609 if (!yyextra->guards->top().parentVisible())
2611 yyextra->guards->top().setEnabled(
false);
2612 BEGIN( SkipGuardedSection );
2614 else if (yyextra->guards->top().isEnabledFound())
2616 yyextra->guards->top().setEnabled(
false);
2617 BEGIN( SkipGuardedSection );
2621 yyextra->guards->top().setEnabled(
true);
2622 BEGIN( GuardParamEnd );
2626<SkipGuardedSection>{CMD}"elseif"/{NW} {
2627 if (yyextra->guards->empty())
2629 warn(yyextra->fileName,yyextra->lineNr,
2630 "found \\elseif without matching start command");
2632 else if (yyextra->guards->top().hasElse())
2634 warn(yyextra->fileName,yyextra->lineNr,
2635 "found \\elseif command after \\else command was given in \\if construct");
2637 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2638 yyextra->guards->top().setEnabled(
false);
2639 BEGIN( GuardParam );
2644 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2645 yyextra->guards->top().setEnabled(
false);
2646 BEGIN( GuardParam );
2649<SkipGuardedSection>{DOCNL} {
2650 if (*yytext==
'\n') yyextra->lineNr++;
2653<SkipGuardedSection>[^ \\@\n]+ {
2655<SkipGuardedSection>{CMD}{CMD} |
2656<SkipGuardedSection>. {
2662<SkipInternal>{DOCNL} {
2663 if (*yytext==
'\n') yyextra->lineNr++;
2666<SkipInternal>{CMD}"if"/[ \t] {
2667 yyextra->condCount++;
2669<SkipInternal>{CMD}"ifnot"/[ \t] {
2670 yyextra->condCount++;
2672<SkipInternal>{CMD}/"endif" {
2673 yyextra->condCount--;
2674 if (yyextra->condCount<0)
2680<SkipInternal>{CMD}/"section"[ \t] {
2681 if (yyextra->sectionLevel>0)
2687<SkipInternal>{CMD}/"subsection"[ \t] {
2688 if (yyextra->sectionLevel>1)
2694<SkipInternal>{CMD}/"subsubsection"[ \t] {
2695 if (yyextra->sectionLevel>2)
2701<SkipInternal>{CMD}/"paragraph"[ \t] {
2702 if (yyextra->sectionLevel>3)
2708<SkipInternal>{CMD}/"subparagraph"[ \t] {
2709 if (yyextra->sectionLevel>4)
2715<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2716 if (yyextra->sectionLevel>5)
2722<SkipInternal>{CMD}"endinternal"[ \t]* {
2725<SkipInternal>[^ \\@\n]+ {
2742 yyextra->docGroup.appendHeader(
' ');
2745 yyextra->docGroup.appendHeader(*yytext);
2746 yyextra->current->name+=*yytext;
2761<RaiseWarning,RaiseWarningSection>{DOCNL} {
2763 "{}",yyextra->raiseWarning);
2764 yyextra->raiseWarning =
"";
2765 if (*yytext==
'\n') yyextra->lineNr++;
2767 if (YY_START == RaiseWarning)
2773 yyextra->sectionTitle+=yytext;
2774 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2777<RaiseWarning,RaiseWarningSection>. {
2778 yyextra->raiseWarning += yytext;
2782<InGroupParam>{LABELID} {
2783 yyextra->current->groups.emplace_back(
2786 yyextra->inGroupParamFound=
true;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2788<InGroupParam>{DOCNL} {
2789 if (!yyextra->inGroupParamFound)
2791 warn(yyextra->fileName,yyextra->lineNr,
2792 "Missing group name for \\ingroup command"
2811 if (yyextra->braceCount==0)
2813 if (yyextra->functionProto.stripWhiteSpace().empty())
2815 warn(yyextra->fileName,yyextra->lineNr,
2816 "missing argument after '\\{}'.",yyextra->currentCmd
2822 yyextra->langParser->parsePrototype(yyextra->functionProto);
2830 yyextra->functionProto+=
' ';
2832<FnParam>[^@\\\n()]+ {
2833 yyextra->functionProto+=yytext;
2836 yyextra->functionProto+=yytext;
2837 yyextra->braceCount++;
2840 yyextra->functionProto+=yytext;
2841 yyextra->braceCount--;
2844 yyextra->functionProto+=*yytext;
2851<OverloadParam>{DOCNL} {
2852 if (*yytext==
'\n') yyextra->lineNr++;
2853 if (yyextra->functionProto.stripWhiteSpace().empty())
2861 yyextra->langParser->parsePrototype(yyextra->functionProto);
virtual DString trOverloadText()=0
Translator * theTranslator
2865<OverloadParam>{LC} {
2867 yyextra->functionProto+=
' ';
2870 yyextra->functionProto+=*yytext;
2875<InheritParam>({ID}("::"|"."))*{ID} {
2876 yyextra->current->extends.emplace_back(
2881<InheritParam>{DOCNL} {
2882 warn(yyextra->fileName,yyextra->lineNr,
2883 "\\inherit command has no argument"
2885 if (*yytext==
'\n') yyextra->lineNr++;
2890 warn(yyextra->fileName,yyextra->lineNr,
2891 "Invalid or missing name for \\inherit command"
2898<ExtendsParam>({ID}("::"|"."))*{ID} {
2899 yyextra->current->extends.emplace_back(
2904<ExtendsParam>{DOCNL} {
2905 warn(yyextra->fileName,yyextra->lineNr,
2906 "'\\{}' command has no argument",yyextra->currentCmd
2918<SkipLang>{CMD}"~"[a-zA-Z-]* {
2922 warn(yyextra->fileName,yyextra->lineNr,
2925 else if (langId.
empty() ||
2931<SkipLang>[^*@\\\n]* {
2934 if (*yytext==
'\n') yyextra->lineNr++;
2941<CiteLabel,CiteLabelSection>{CITEID} {
2944 if (YY_START == CiteLabel)
2950 yyextra->sectionTitle+=yytext;
2951 BEGIN(SectionTitle);
2954<CiteLabel,CiteLabelSection>{DOCNL} {
2955 warn(yyextra->fileName,yyextra->lineNr,
2956 "\\cite command has no label"
2960 if (YY_START == CiteLabel)
2967 yyextra->sectionTitle+=yytext;
2969 BEGIN(SectionTitle);
2972<CiteLabel,CiteLabelSection>. {
2973 warn(yyextra->fileName,yyextra->lineNr,
2974 "Invalid or missing cite label"
2976 if (YY_START == CiteLabel)
2982 yyextra->sectionTitle+=yytext;
2983 BEGIN(SectionTitle);
2991 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2992 addOutput(yyscanner,yyextra->copyDocArg);
2996<CopyDoc>"<"[/]?{TABLEDEL}">" {
2997 if (yyextra->braceCount==0)
3000 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3001 addOutput(yyscanner,yyextra->copyDocArg);
3007 if (*yytext==
'\n') yyextra->lineNr++;
3008 if (yyextra->braceCount==0)
3011 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3012 addOutput(yyscanner,yyextra->copyDocArg);
3020<CopyDoc>[^@\\\n()<]+ {
3021 yyextra->copyDocArg+=yytext;
3025 yyextra->copyDocArg+=yytext;
3027 yyextra->braceCount++;
3030 yyextra->copyDocArg+=yytext;
3032 yyextra->braceCount--;
3035 yyextra->copyDocArg+=yytext;
3057 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3058 yyextra->braceCount=0;
3059 yyextra->functionProto.clear();
3060 yyextra->currentCmd = cmd;
3061 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3068 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3069 yyextra->functionProto.clear();
3070 yyextra->braceCount=0;
3071 yyextra->currentCmd = cmd;
3072 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3079 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3080 yyextra->functionProto.clear();
3081 BEGIN(OverloadParam);
3087 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3088 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3089 BEGIN( EnumDocArg1 );
3095 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3098 BEGIN( GroupDocArg1 );
3104 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3107 BEGIN( GroupDocArg1 );
3113 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3116 BEGIN( GroupDocArg1 );
3122 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3123 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3124 BEGIN( NameSpaceDocArg1 );
3130 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3132 BEGIN( PackageDocArg1 );
3138 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3139 yyextra->currentCmd = cmd;
3140 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3141 BEGIN( ClassDocArg1 );
3147 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3148 yyextra->currentCmd = cmd;
3149 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3150 BEGIN( ConceptDocArg1 );
3156 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3157 yyextra->currentCmd = cmd;
3158 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3159 BEGIN( ModuleDocArg1 );
3165 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3166 BEGIN( ClassDocArg2 );
3172 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3173 yyextra->currentCmd = cmd;
3174 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3175 BEGIN( ClassDocArg1 );
3181 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3182 yyextra->currentCmd = cmd;
3183 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3184 BEGIN( CategoryDocArg1 );
3190 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3191 yyextra->currentCmd = cmd;
3192 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3193 BEGIN( ClassDocArg1 );
3199 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3200 yyextra->currentCmd = cmd;
3201 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3202 BEGIN( ClassDocArg1 );
3208 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3209 yyextra->currentCmd = cmd;
3210 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3211 BEGIN( ClassDocArg1 );
3217 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3218 yyextra->currentCmd = cmd;
3219 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3220 BEGIN( ClassDocArg1 );
3226 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3228 BEGIN( PageDocArg1 );
3234 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3238 yyextra->current->name =
"mainpage";
3241 BEGIN( PageDocArg2 );
3247 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3251 yyextra->current->name = yyextra->fileName;
3253 BEGIN( FileDocArg1 );
3259 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3269 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3277 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3279 if (!stop) yyextra->current->name = yyextra->fileName;
3280 BEGIN( FileDocArg1 );
3286 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3288 for (
const auto &opt : optList)
3292 sectionMaker=EntryType::makeExampleLineno;
3296 warn(yyextra->fileName,yyextra->lineNr,
3297 "unsupported option '{}' for command '\\{}'",opt,cmd);
3301 if (!stop) yyextra->current->name = yyextra->fileName;
3302 BEGIN( FileDocArg1 );
3308 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3311 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3320 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3321 yyextra->raiseWarning =
"";
3322 BEGIN( RaiseWarning );
3328 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3335 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3339 yyextra->docGroup.clearHeader();
3341 if (!yyextra->docGroup.empty())
3343 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true,
true);
3351 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3360 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3369 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3378 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3382 yyextra->current->spec.setDeprDoc(
true);
3388 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3390 BEGIN(XRefItemParam1);
3396 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3397 if (yyextra->insideParBlock)
3399 warn(yyextra->fileName,yyextra->lineNr,
3400 "found \\parblock command while already in a parblock!");
3402 if (!yyextra->spaceBeforeCmd.empty())
3404 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3405 yyextra->spaceBeforeCmd.clear();
3408 yyextra->insideParBlock =
true;
3414 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3415 if (!yyextra->insideParBlock)
3417 warn(yyextra->fileName,yyextra->lineNr,
3418 "found \\endparblock command without matching \\parblock!");
3422 yyextra->insideParBlock =
false;
3428 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3429 if (!yyextra->current->relates.empty())
3431 warn(yyextra->fileName,yyextra->lineNr,
3432 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3434 yyextra->current->relatesType = RelatesType::Simple;
3435 yyextra->currentCmd = cmd;
3436 BEGIN(RelatesParam1);
3442 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3443 if (!yyextra->current->relates.empty())
3445 warn(yyextra->fileName,yyextra->lineNr,
3446 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3448 yyextra->current->relatesType = RelatesType::Duplicate;
3449 yyextra->currentCmd = cmd;
3450 BEGIN(RelatesParam1);
3456 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
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::MemberOf;
3463 yyextra->currentCmd = cmd;
3464 BEGIN(RelatesParam1);
3470 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3478 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3481 BEGIN(SectionLabel);
3482 yyextra->sectionLabel.clear();
3491 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3493 switch (yyextra->sectionLevel)
3501 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3508 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3510 BEGIN( RequirementLabel );
3516 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3517 BEGIN( SatisfiesLabel );
3523 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3524 BEGIN( VerifiesLabel );
3530 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3531 if (!yyextra->current->section.isEmpty() &&
3532 !yyextra->current->section.isPageDoc() &&
3533 !yyextra->current->section.isMainpageDoc()
3536 warn(yyextra->fileName,yyextra->lineNr,
3537 "found \\subpage command in a comment block that is not marked as a page!");
3539 if (!yyextra->spaceBeforeCmd.empty())
3541 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3542 yyextra->spaceBeforeCmd.clear();
3545 BEGIN(SubpageLabel);
3551 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3553 if (optList.empty())
3555 yyextra -> anchorTitle =
"";
3559 yyextra -> anchorTitle =
join(optList,
" ");
3567 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3568 for (
const auto &opt : optList)
3578 if (optList.empty())
3592 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3593 if (!yyextra->spaceBeforeCmd.empty())
3595 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3596 yyextra->spaceBeforeCmd.clear();
3598 if (optList.empty())
3612 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3613 if (!yyextra->spaceBeforeCmd.empty())
3615 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3616 yyextra->spaceBeforeCmd.clear();
3622 if (optList.empty())
3631 yyextra->blockName=s;
3632 yyextra->commentCount=0;
3639 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3647 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3665 static std::unordered_map<std::string,OptionFunc> options =
3668 {
"name", [](
const FileInfo &fi_) ->
DString {
return fi_.baseName(); } },
3669 {
"extension", [](
const FileInfo &fi_) ->
DString {
return fi_.extension(
true); } },
3670 {
"filename", [](
const FileInfo &fi_) ->
DString {
return fi_.fileName(); } },
3671 {
"directory", [](
const FileInfo &fi_) ->
DString {
return fi_.dirPath(); } },
3672 {
"full", [](
const FileInfo &fi_) ->
DString {
return fi_.absFilePath(); } }
3674 auto it = options.
find(optionName);
3675 return (it!=options.end()) ? it->second(fi) :
DString();
3680 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3681 if (!yyextra->spaceBeforeCmd.empty())
3683 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3684 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3685 yyextra->spaceBeforeCmd.clear();
3688 FileInfo fi(yyextra->fileName.str());
3689 for (
const auto &opt_ : optList)
3692 std::string opt = optStripped.
lower().
str();
3694 if (!result.
empty())
3698 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3705 yyextra->sectionTitle+=result;
3712 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3719 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3724 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3733 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3734 if (!yyextra->spaceBeforeCmd.empty())
3736 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3737 yyextra->spaceBeforeCmd.clear();
3745 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3753 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3761 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3768 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3770 BEGIN(IRaisePrefix);
3776 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3778 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3779 if (yyextra->guards->empty())
3781 yyextra->guards->emplace(
true);
3785 bool enabled = yyextra->guards->top().isEnabled();
3786 yyextra->guards->emplace(enabled);
3794 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3796 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3797 if (yyextra->guards->empty())
3799 yyextra->guards->emplace(
true);
3803 bool enabled = yyextra->guards->top().isEnabled();
3804 yyextra->guards->emplace(enabled);
3812 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3813 if (yyextra->guards->empty())
3815 warn(yyextra->fileName,yyextra->lineNr,
3816 "found \\elseif without matching start command");
3818 else if (yyextra->guards->top().hasElse())
3820 warn(yyextra->fileName,yyextra->lineNr,
3821 "found \\elseif command after \\else command was given in \\if construct");
3823 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3824 yyextra->guards->top().setEnabled(
false);
3830 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3831 yyextra->guards->top().setEnabled(
false);
3839 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3840 if (yyextra->guards->empty())
3842 warn(yyextra->fileName,yyextra->lineNr,
3843 "found \\else without matching start command");
3845 else if (yyextra->guards->top().hasElse())
3847 warn(yyextra->fileName,yyextra->lineNr,
3848 "found multiple \\else commands in same \\if construct");
3849 yyextra->guards->top().setEnabled(
false);
3850 yyextra->guards->top().setElse();
3851 BEGIN( SkipGuardedSection );
3855 yyextra->guards->top().setElse();
3856 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3857 if (yyextra->guards->top().isEnabledFound())
3859 yyextra->guards->top().setEnabled(
false);
3860 BEGIN( SkipGuardedSection );
3864 yyextra->guards->top().setEnabled(
true);
3865 BEGIN( GuardParamEnd );
3873 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3874 if (yyextra->guards->empty())
3876 warn(yyextra->fileName,yyextra->lineNr,
3877 "found \\endif without matching start command");
3881 yyextra->guards->pop();
3883 if (!yyextra->spaceBeforeCmd.empty())
3885 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3886 yyextra->spaceBeforeCmd.clear();
3888 if (yyextra->guards->empty())
3890 BEGIN( GuardParamEnd );
3894 if (yyextra->guards->top().isEnabled())
3896 BEGIN( GuardParamEnd );
3900 BEGIN( SkipGuardedSection );
3908 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3909 yyextra->inGroupParamFound=
false;
3910 BEGIN( InGroupParam );
3916 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3917 yyextra->current->subGrouping =
false;
3923 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3924 yyextra->current->initLines = 100000;
3930 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3931 yyextra->current->initLines = 0;
3937 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3938 yyextra->current->commandOverrides.override_callGraph(
true);
3944 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3945 yyextra->current->commandOverrides.override_callGraph(
false);
3951 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3952 yyextra->current->commandOverrides.override_callerGraph(
true);
3958 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3959 yyextra->current->commandOverrides.override_callerGraph(
false);
3965 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3966 yyextra->current->commandOverrides.override_enumValues(
true);
3972 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3973 yyextra->current->commandOverrides.override_enumValues(
false);
3979 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3980 yyextra->current->commandOverrides.override_inlineSource(
true);
3986 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3987 yyextra->current->commandOverrides.override_inlineSource(
false);
3993 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3994 yyextra->current->commandOverrides.override_includeGraph(
true);
4000 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4001 yyextra->current->commandOverrides.override_includedByGraph(
true);
4007 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4008 yyextra->current->commandOverrides.override_includeGraph(
false);
4014 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4015 yyextra->current->commandOverrides.override_includedByGraph(
false);
4021 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4022 yyextra->current->commandOverrides.override_directoryGraph(
true);
4028 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4029 yyextra->current->commandOverrides.override_directoryGraph(
false);
4035 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4036 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4042 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4043 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4049 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4050 yyextra->current->commandOverrides.override_groupGraph(
true);
4056 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4057 yyextra->current->commandOverrides.override_groupGraph(
false);
4063 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4064 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4065 for (
const auto &opt_ : optList)
4072 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4074 else if (opt ==
"graph")
4076 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4078 else if (opt ==
"builtin")
4080 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4082 else if (opt ==
"text")
4084 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4086 else if (opt ==
"no")
4088 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4092 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4102 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4103 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4109 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4110 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4116 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4117 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4123 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4124 yyextra->current->commandOverrides.override_referencesRelation(
true);
4130 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4131 yyextra->current->commandOverrides.override_referencesRelation(
false);
4137 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4138 yyextra->currentCmd = cmd;
4145 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4150 if (yyextra->current->doc.stripWhiteSpace().empty())
4152 yyextra->current->doc.clear();
4154 yyextra->condCount=0;
4155 BEGIN( SkipInternal );
4161 yyextra->inInternalDocs =
true;
4168 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4169 yyextra->current->isStatic =
true;
4175 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4176 yyextra->current->virt = Specifier::Pure;
4182 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4183 yyextra->current->protection = Protection::Private;
4189 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4190 yyextra->current->protection = yyextra->protection = Protection::Private;
4196 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4197 yyextra->current->protection = Protection::Protected;
4203 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4204 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4210 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4211 yyextra->current->protection = Protection::Public;
4217 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4218 yyextra->current->protection = yyextra->protection = Protection::Public;
4224 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4225 if (yyextra->current->section.isPageDoc() ||
4226 yyextra->current->section.isMainpageDoc())
4228 for (
const auto &opt_ : optList)
4232 size_t i = opt.
find(
':');
4236 if (sscanf(opt.
mid(i+1).
data(),
"%d%c",&level,&dum) != 1)
4238 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4252 yyextra->current->localToc.enableHtml(level);
4254 else if (opt ==
"latex")
4256 yyextra->current->localToc.enableLatex(level);
4258 else if (opt ==
"xml")
4260 yyextra->current->localToc.enableXml(level);
4262 else if (opt ==
"docbook")
4264 yyextra->current->localToc.enableDocbook(level);
4268 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4273 if (yyextra->current->localToc.nothingEnabled())
4285 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4286 BEGIN(InheritParam);
4292 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4293 yyextra->currentCmd = cmd;
4294 BEGIN(ExtendsParam);
4300 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4301 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4307 if (!yyextra->spaceBeforeCmd.empty())
4309 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4310 yyextra->spaceBeforeCmd.clear();
4318 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4320 if (!yyextra->spaceBeforeCmd.empty())
4322 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4323 yyextra->spaceBeforeCmd.clear();
4331 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4332 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4338 if (!yyextra->spaceBeforeCmd.empty())
4340 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4341 yyextra->spaceBeforeCmd.clear();
4344 yyextra->copyDocArg.clear();
4345 yyextra->braceCount = 0;
4354 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4355 yyextra->sectionLabel.clear();
4356 yyextra->sectionTitle.clear();
4357 yyextra->docGroup.clearHeader();
4358 yyextra->insideParBlock =
false;
4365 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4367 return yyextra->current->section.isDoc();
4372 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4375 if (yyextra->current->section.isDoc())
4381 yyextra->needNewEntry =
true;
4382 yyextra->current->section = maker();
4383 yyextra->current->fileName = yyextra->fileName;
4384 yyextra->current->startLine = yyextra->lineNr;
4385 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4398 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4399 for(
const char* c = yytext ; *c ; ++c )
4400 yyextra->lineNr += (*c ==
'\n') ;
4408 if (s==
nullptr || *s==0)
return name;
4410 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4421 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4424 DString reqId = yyextra->current->name;
4430 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4435 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4437 yyextra->fileName,yyextra->lineNr,
4446 const DString &listTitle,
bool append,
bool inBody,
int lineNr)
4448 if (baseName.
empty())
return;
4455 if (
Config_getEnum(MARKDOWN_ID_STYLE) == MARKDOWN_ID_STYLE_t::GITHUB) listName =
"Doxygen_List_" + listName;
4458 for (
auto it = current->
sli.rbegin(); it != current->
sli.rend(); ++it)
4478 item = refList->
add();
4484 current->
sli.push_back(item);
4486 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4493 current->
doc += cmdString;
4504 current->
anchors.push_back(si);
4506 else if (si->
lineNr() != -1)
4508 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4513 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4520 current->
anchors.push_back(si);
4530 const DString &listTitle,
bool append)
4532 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4533 addXRefItemToEntry(yyextra->current,yyextra->outputXRef,listName,itemTitle,listTitle,append,yyextra->inBody,yyextra->lineNr);
4534 yyextra->outputXRef.clear();
4542 if (label.
empty())
return;
4543 signed char c =
static_cast<signed char>(label[0]);
4544 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4548 for (
size_t i=1; i<label.
size(); i++)
4550 c =
static_cast<signed char>(label[i]);
4551 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4566 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4568 DString formula = (yyextra->formulaPreText +
4569 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4577 formLabel.
sprintf(
"\\_form#%d",
id);
4578 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4595 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4603 if (addYYtext) yyextra->sectionTitle+=yytext;
4604 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4605 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4607 yyextra->sectionLevel);
4610 yyextra->current->anchors.push_back(si);
4612 else if (si->
lineNr() != -1)
4614 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4619 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4620 yyextra->sectionLabel,si->
fileName());
4626 if (addYYtext) yyextra->sectionTitle+=yytext;
4627 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4628 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4630 yyextra->sectionLevel);
4633 yyextra->current->anchors.push_back(si);
4642 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4644 if (yytext[0] ==
'"')
4647 name=name.
left((
int)yyleng-2);
4663 if (c==
' ' || c==
'\t' || c==
'\r')
4686 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4687 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4689 yyextra->xrefAppendFlag = !yyextra->inBody &&
4691 yyextra->newXRefKind==yyextra->xrefKind &&
4693 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4709 switch(yyextra->xrefKind)
4736 xrefAppendToPrev || yyextra->current->spec.isDeprAttr()
4741 yyextra->xrefItemTitle,
4742 yyextra->xrefListTitle,
4751 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4753 int oldContext = yyextra->inContext;
4754 yyextra->inContext = ctx;
4756 switch(yyextra->inContext)
4759 if (oldContext!=yyextra->inContext)
4762 if (yyextra->current->doc.empty()) yyextra->current->docLine = yyextra->lineNr;
4763 if (yyextra->current->docFile.empty())
4765 yyextra->current->docFile = yyextra->fileName;
4766 yyextra->current->docLine = yyextra->lineNr;
4769 yyextra->pOutputString = &yyextra->current->doc;
4773 if (oldContext!=yyextra->inContext)
4775 if (yyextra->current->brief.empty()) yyextra->current->briefLine = yyextra->lineNr;
4776 if (yyextra->current->briefFile.empty())
4778 yyextra->current->briefFile = yyextra->fileName;
4779 yyextra->current->briefLine = yyextra->lineNr;
4782 bool foundMatch =
false;
4783 if (yyextra->current->brief.stripWhiteSpace().empty())
4791 std::string str = yyextra->current->brief.str();
4796 for (
size_t i = 0; i < match[2].str().size(); i++)
4798 if (match[2].str()[i] ==
'\n') cnt++;
4802 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4804 yyextra->current->brief +=
" \\iline " +
DString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4811 yyextra->pOutputString = &yyextra->current->brief;
4815 if (!yyextra->current->doc.empty())
4817 yyextra->current->doc +=
"\n";
4819 yyextra->pOutputString = &yyextra->current->doc;
4825 yyextra->pOutputString = &yyextra->outputXRef;
4830 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4839 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4847 yyextra->current->anchors.push_back(si);
4849 else if (si->
lineNr() != -1)
4851 warn(yyextra->fileName,yyextra->lineNr,
4852 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4857 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4864 yyextra->current->anchors.push_back(si);
4871 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4873 *yyextra->pOutputString+=s;
4879 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4881 *yyextra->pOutputString+=s;
4887 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4888 *yyextra->pOutputString+=c;
4894 snprintf(cmd,30,
" \\iline %d ",lineNr);
4901 snprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4907 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4908 std::string_view str = yyextra->current->brief.view();
4913 yyextra->briefEndsAtDot=
false;
4915 if (yyextra->current->doc.stripWhiteSpace().empty())
4917 yyextra->current->docLine = yyextra->lineNr;
4918 yyextra->current->doc =
"";
4922 addIline(yyscanner,yyextra->lineNr);
4928 int saveLineNr = yyextra->lineNr;
4930 yyextra->current->briefLine = yyextra->lineNr;
4931 yyextra->lineNr = saveLineNr;
4937 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4938 yyextra->prevPosition=yyextra->inputPosition;
4940 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4942 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4953 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4954 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4955 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4956 YY_START==ReadFormulaLong)
4958 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4972 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4980 commentscanYYlex_destroy(
p->yyscanner);
4993 bool &newEntryNeeded,
4994 bool markdownSupport,
4998 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4999 " prot={} markdownSupport={}",
Trace::trunc(comment),fileName,lineNr,isBrief,
5000 isAutoBriefOn,isInbody,prot,markdownSupport);
5002 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5005 yyextra->guards = guards;
5006 yyextra->langParser = parser;
5007 yyextra->current = curEntry;
5008 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
5009 if (comment.
empty())
return false;
5010 yyextra->inputString = comment;
5011 yyextra->inputString.
append(
" ");
5012 yyextra->inputPosition = position;
5013 yyextra->lineNr = lineNr;
5014 yyextra->fileName = fileName;
5015 yyextra->protection = prot;
5016 yyextra->needNewEntry =
false;
5018 yyextra->xrefAppendFlag =
false;
5019 yyextra->insidePre =
false;
5020 yyextra->parseMore =
false;
5021 yyextra->inBody = isInbody;
5022 yyextra->markdownSupport= markdownSupport;
5023 yyextra->outputXRef.clear();
5024 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.empty())
5026 yyextra->current->doc +=
'\n';
5029 yyextra->briefEndsAtDot = isAutoBriefOn;
5030 yyextra->condCount = 0;
5031 yyextra->sectionLevel = 0;
5032 yyextra->spaceBeforeCmd.clear();
5033 yyextra->spaceBeforeIf.clear();
5034 yyextra->htmlContextStack.clear();
5037 if (!yyextra->current->inbodyDocs.empty() && isInbody)
5040 snprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5041 yyextra->current->inbodyDocs+=cmd;
5045 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5048 commentscanYYrestart(
nullptr, yyscanner );
5050 commentscanYYlex(yyscanner);
5053 if (YY_START==OverloadParam)
5058 if (yyextra->insideParBlock)
5060 warn(yyextra->fileName,yyextra->lineNr,
5061 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5067 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.empty())
5070 yyextra->current->doc=
"\n\n";
5073 if (yyextra->current->section.isMemberGrp() &&
5074 yyextra->docGroup.empty())
5076 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5080 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5082 yyextra->current->briefLine,yyextra->current->brief,
5083 yyextra->current->docLine,yyextra->current->doc,
5084 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5088 prot = yyextra->protection;
5090 yyextra->docGroup.addDocs(curEntry);
5092 newEntryNeeded = yyextra->needNewEntry;
5097 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
false;
5099 if (!yyextra->parseMore && !yyextra->guards->empty())
5101 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5104 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5106 lineNr = yyextra->lineNr;
5108 position,yyextra->parseMore,newEntryNeeded);
5110 return yyextra->parseMore;
5115 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5117 bool sectionEnabled =
false;
5122 bool parentEnabled = yyextra->guards->top().parentVisible();
5126 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5127 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5131 yyextra->guards->top().setEnabled(
true);
5132 yyextra->guards->top().setEnabledFound();
5133 BEGIN( GuardParamEnd );
5137 if (yyextra->guards->top().isEnabledFound())
5139 yyextra->guards->top().setEnabled(
false);
5140 BEGIN( SkipGuardedSection );
5142 else if (sectionEnabled)
5144 yyextra->guards->top().setEnabled(
true);
5145 yyextra->guards->top().setEnabledFound();
5146 BEGIN( GuardParamEnd );
5150 yyextra->guards->top().setEnabled(
false);
5151 BEGIN( SkipGuardedSection );
5156 BEGIN( SkipGuardedSection );
5161 BEGIN( SkipGuardedSection );
5167 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5168 yyextra->docGroup.initGroupInfo(entry);
5173 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5174 yyextra->docGroup.enterFile(fileName,lineNr);
5179 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5180 yyextra->docGroup.leaveFile(fileName,lineNr);
5185 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5186 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5191 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5192 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5197 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5198 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5203 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5204 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5214 static reg::Ex deprecated_re(R
"(deprecated\s*(\(\s*\"([^\"]*)\"\s*\))?)");
5220 if (match.size()==3)
5223 DString rawDoc = match[2].str();
5225 std::shared_ptr<Entry> docEntry = std::make_shared<Entry>();
5227 bool newEntryNeeded =
false;
5243 docs = docEntry->doc;
5248 current->
spec.setDeprAttr(
true);
5250 if (!docs.
empty() || !current->
spec.isDeprDoc())
5271#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.