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+=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+=yytext;
2082<SectionTitle>{B}*{CMD}{CMD} {
2083 yyextra->sectionTitle+=yytext;
2086<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2087<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2089 size_t idx = fullMatch.
find(
'{');
2091 if ((idx !=
DString::npos) && (idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2109 switch (it->second.sectionHandling)
2114 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2115 yyextra->sectionTitle+=fullMatch.
left(i);
2116 yyextra->sectionTitle+=
'@';
2117 yyextra->sectionTitle+=fullMatch.
mid(i);
2121 warn(yyextra->fileName,yyextra->lineNr,
2122 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2130 warn(yyextra->fileName,yyextra->lineNr,
2131 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2139 if (cmdName ==
"fileinfo")
2142 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2143 yyextra->sectionTitle+=fullMatch.
left(i);
2148 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2153 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2157 else if (cmdName ==
"lineinfo")
2160 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2161 yyextra->sectionTitle+=fullMatch.
left(i);
2163 yyextra->sectionTitle+=
' ';
2164 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2170 else if (cmdName ==
"raisewarning")
2172 yyextra->raiseWarning =
"";
2173 BEGIN(RaiseWarningSection);
2175 else if (cmdName ==
"noop")
2180 else if (cmdName ==
"cite")
2182 yyextra->sectionTitle+=yytext;
2184 BEGIN(CiteLabelSection);
2186 else if (cmdName ==
"iline")
2188 yyextra->sectionTitle+=yytext;
2190 BEGIN(ILineSection);
2192 else if (cmdName ==
"ifile")
2194 yyextra->sectionTitle+=yytext;
2196 BEGIN(IFileSection);
2198 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2201 if (optList.empty())
2203 yyextra -> anchorTitle =
"";
2208 yyextra -> anchorTitle =
join(optList,
" ");
2211 BEGIN(AnchorLabelSection);
2213 else if (cmdName ==
"link")
2215 yyextra->sectionTitle+=yytext;
2220 yyextra->sectionTitle+=yytext;
2221 warn(yyextra->fileName,yyextra->lineNr,
2222 "internal error '\\{}' command is to be replaced in section title.",cmdName
2229 yyextra->sectionTitle+=yytext;
2237 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
2242 yyextra->sectionTitle+=yytext;
2248<SubpageLabel>{FILE} {
2252 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2253 BEGIN(SubpageTitle);
2255<SubpageLabel>{DOCNL} {
2256 warn(yyextra->fileName,yyextra->lineNr,
2257 "\\subpage command has no label"
2259 if (*yytext==
'\n') yyextra->lineNr++;
2267<SubpageTitle>{DOCNL} {
2271<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2282<AnchorLabel,AnchorLabelSection>{LABELID} {
2283 DString lbl = yyextra->raisePrefix+yytext;
2284 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2286 if (YY_START == AnchorLabel)
2292 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2295<AnchorLabel,AnchorLabelSection>{DOCNL} {
2296 warn(yyextra->fileName,yyextra->lineNr,
2297 "\\anchor command has no label"
2299 if (*yytext==
'\n') yyextra->lineNr++;
2301 if (YY_START == AnchorLabel)
2307 BEGIN(SectionTitle);
2310<AnchorLabel,AnchorLabelSection>. {
2311 warn(yyextra->fileName,yyextra->lineNr,
2312 "Invalid or missing anchor label"
2315 if (YY_START == AnchorLabel)
2321 BEGIN(SectionTitle);
2327<RequirementLabel>{REQID} {
2328 yyextra->current->name = yytext;
2329 yyextra->current->type.clear();
2330 BEGIN( RequirementTitle );
2332<SatisfiesLabel>{REQID} {
2333 yyextra->reqId = yytext;
2334 yyextra->reqTitle.clear();
2335 BEGIN( SatisfiesTitle );
2337<VerifiesLabel>{REQID} {
2338 yyextra->reqId = yytext;
2339 yyextra->reqTitle.clear();
2340 BEGIN( VerifiesTitle );
2342<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2346<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2347 warn(yyextra->fileName,yyextra->lineNr,
2348 "missing requirement ID after \\requirement command"
2353<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2356<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2360<RequirementTitle>[^\n\\]+ {
2361 yyextra->current->type += yytext;
2363<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2364 yyextra->reqTitle += yytext;
2366<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2367 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2372<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2373 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2375 if (yyextra->current->section.isRequirementDoc())
2377 warn(yyextra->fileName,yyextra->lineNr,
2378 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2391<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2392 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2394 if (yyextra->current->section.isRequirementDoc())
2396 warn(yyextra->fileName,yyextra->lineNr,
2397 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2410<RequirementTitle>. {
2411 yyextra->current->type += yytext;
2413<SatisfiesTitle,VerifiesTitle>. {
2414 yyextra->reqTitle += yytext;
2420<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2422 if (&yytext[4]==yyextra->blockName)
2427<FormatBlock>{CMD}"enduml" {
2429 if (yyextra->blockName==
"startuml")
2434<FormatBlock>[^ \@\*\/\\\n]* {
2437<FormatBlock>{DOCNL} {
2438 if (*yytext==
'\n') yyextra->lineNr++;
2442 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2443 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2444 yyextra->blockName==
"iliteral"
2446 ) yyextra->commentCount++;
2451 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2452 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2453 yyextra->blockName==
"iliteral"
2457 yyextra->commentCount--;
2458 if (yyextra->commentCount<0)
2460 DString endTag =
"end"+yyextra->blockName;
2461 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2462 warn(yyextra->fileName,yyextra->lineNr,
2463 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2464 yyextra->blockName,endTag);
2471<FormatBlock><<EOF>> {
2472 DString endTag =
"end"+yyextra->blockName;
2473 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2474 warn(yyextra->fileName,yyextra->lineNr,
2475 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2476 yyextra->blockName,endTag
2483<GuardParam>{B}*"(" {
2484 yyextra->guardExpr=yytext;
2485 yyextra->roundCount=1;
2489 yyextra->guardExpr+=yytext;
2493 yyextra->guardExpr+=yytext;
2494 yyextra->roundCount++;
2497 yyextra->guardExpr+=yytext;
2498 yyextra->roundCount--;
2499 if (yyextra->roundCount==0)
2505 warn(yyextra->fileName,yyextra->lineNr,
2506 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2510<GuardParam>{B}*{CMD}doxyconfig{B}+{DOXYCFG} {
2513<GuardParam>{B}*[a-z_A-Z0-9.\-]+({B}*{CMD}doxyconfig{B}+{DOXYCFG})? {
2516<GuardParam>{DOCNL} {
2531<GuardParamEnd>{B}*{DOCNL} {
2533 yyextra->spaceBeforeIf.clear();
2537<GuardParamEnd>{B}* {
2538 if (!yyextra->spaceBeforeIf.empty())
2540 addOutput(yyscanner,yyextra->spaceBeforeIf);
2542 yyextra->spaceBeforeIf.clear();
2554<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2556 yyextra->guards->emplace(
false);
2557 BEGIN( GuardParam );
2559<SkipGuardedSection>{CMD}"if"/{NW} {
2561 yyextra->guards->emplace(
false);
2562 BEGIN( GuardParam );
2564<SkipGuardedSection>{CMD}"endif"/{NW} {
2565 if (yyextra->guards->empty())
2567 warn(yyextra->fileName,yyextra->lineNr,
2568 "found \\endif without matching start command");
2573 yyextra->guards->pop();
2574 if (yyextra->guards->empty())
2576 BEGIN( GuardParamEnd );
2580 if (yyextra->guards->top().isEnabled())
2582 BEGIN( GuardParamEnd );
2586 BEGIN( SkipGuardedSection );
2591<SkipGuardedSection>{CMD}"else"/{NW} {
2592 if (yyextra->guards->empty())
2594 warn(yyextra->fileName,yyextra->lineNr,
2595 "found \\else without matching start command");
2597 else if (yyextra->guards->top().hasElse())
2599 warn(yyextra->fileName,yyextra->lineNr,
2600 "found multiple \\else commands in same \\if construct");
2601 yyextra->guards->top().setEnabled(
false);
2602 BEGIN( SkipGuardedSection );
2604 else if (!yyextra->guards->top().parentVisible())
2606 yyextra->guards->top().setEnabled(
false);
2607 BEGIN( SkipGuardedSection );
2611 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2612 yyextra->guards->top().setElse();
2613 if (!yyextra->guards->top().parentVisible())
2615 yyextra->guards->top().setEnabled(
false);
2616 BEGIN( SkipGuardedSection );
2618 else if (yyextra->guards->top().isEnabledFound())
2620 yyextra->guards->top().setEnabled(
false);
2621 BEGIN( SkipGuardedSection );
2625 yyextra->guards->top().setEnabled(
true);
2626 BEGIN( GuardParamEnd );
2630<SkipGuardedSection>{CMD}"elseif"/{NW} {
2631 if (yyextra->guards->empty())
2633 warn(yyextra->fileName,yyextra->lineNr,
2634 "found \\elseif without matching start command");
2636 else if (yyextra->guards->top().hasElse())
2638 warn(yyextra->fileName,yyextra->lineNr,
2639 "found \\elseif command after \\else command was given in \\if construct");
2641 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2642 yyextra->guards->top().setEnabled(
false);
2643 BEGIN( GuardParam );
2648 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2649 yyextra->guards->top().setEnabled(
false);
2650 BEGIN( GuardParam );
2653<SkipGuardedSection>{DOCNL} {
2654 if (*yytext==
'\n') yyextra->lineNr++;
2657<SkipGuardedSection>[^ \\@\n]+ {
2659<SkipGuardedSection>{CMD}{CMD} |
2660<SkipGuardedSection>. {
2666<SkipInternal>{DOCNL} {
2667 if (*yytext==
'\n') yyextra->lineNr++;
2670<SkipInternal>{CMD}"if"/[ \t] {
2671 yyextra->condCount++;
2673<SkipInternal>{CMD}"ifnot"/[ \t] {
2674 yyextra->condCount++;
2676<SkipInternal>{CMD}/"endif" {
2677 yyextra->condCount--;
2678 if (yyextra->condCount<0)
2684<SkipInternal>{CMD}/"section"[ \t] {
2685 if (yyextra->sectionLevel>0)
2691<SkipInternal>{CMD}/"subsection"[ \t] {
2692 if (yyextra->sectionLevel>1)
2698<SkipInternal>{CMD}/"subsubsection"[ \t] {
2699 if (yyextra->sectionLevel>2)
2705<SkipInternal>{CMD}/"paragraph"[ \t] {
2706 if (yyextra->sectionLevel>3)
2712<SkipInternal>{CMD}/"subparagraph"[ \t] {
2713 if (yyextra->sectionLevel>4)
2719<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2720 if (yyextra->sectionLevel>5)
2726<SkipInternal>{CMD}"endinternal"[ \t]* {
2729<SkipInternal>[^ \\@\n]+ {
2746 yyextra->docGroup.appendHeader(
' ');
2749 yyextra->docGroup.appendHeader(*yytext);
2750 yyextra->current->name+=*yytext;
2765<RaiseWarning,RaiseWarningSection>{DOCNL} {
2767 "{}",yyextra->raiseWarning);
2768 yyextra->raiseWarning =
"";
2769 if (*yytext==
'\n') yyextra->lineNr++;
2771 if (YY_START == RaiseWarning)
2777 yyextra->sectionTitle+=yytext;
2778 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2781<RaiseWarning,RaiseWarningSection>. {
2782 yyextra->raiseWarning += yytext;
2786<InGroupParam>{LABELID} {
2787 yyextra->current->groups.emplace_back(
2790 yyextra->inGroupParamFound=
true;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2792<InGroupParam>{DOCNL} {
2793 if (!yyextra->inGroupParamFound)
2795 warn(yyextra->fileName,yyextra->lineNr,
2796 "Missing group name for \\ingroup command"
2815 if (yyextra->braceCount==0)
2817 if (yyextra->functionProto.stripWhiteSpace().empty())
2819 warn(yyextra->fileName,yyextra->lineNr,
2820 "missing argument after '\\{}'.",yyextra->currentCmd
2826 yyextra->langParser->parsePrototype(yyextra->functionProto);
2834 yyextra->functionProto+=
' ';
2836<FnParam>[^@\\\n()]+ {
2837 yyextra->functionProto+=yytext;
2840 yyextra->functionProto+=yytext;
2841 yyextra->braceCount++;
2844 yyextra->functionProto+=yytext;
2845 yyextra->braceCount--;
2848 yyextra->functionProto+=*yytext;
2855<OverloadParam>{DOCNL} {
2856 if (*yytext==
'\n') yyextra->lineNr++;
2857 if (yyextra->functionProto.stripWhiteSpace().empty())
2865 yyextra->langParser->parsePrototype(yyextra->functionProto);
virtual DString trOverloadText()=0
Translator * theTranslator
2869<OverloadParam>{LC} {
2871 yyextra->functionProto+=
' ';
2874 yyextra->functionProto+=*yytext;
2879<InheritParam>({ID}("::"|"."))*{ID} {
2880 yyextra->current->extends.emplace_back(
2885<InheritParam>{DOCNL} {
2886 warn(yyextra->fileName,yyextra->lineNr,
2887 "\\inherit command has no argument"
2889 if (*yytext==
'\n') yyextra->lineNr++;
2894 warn(yyextra->fileName,yyextra->lineNr,
2895 "Invalid or missing name for \\inherit command"
2902<ExtendsParam>({ID}("::"|"."))*{ID} {
2903 yyextra->current->extends.emplace_back(
2908<ExtendsParam>{DOCNL} {
2909 warn(yyextra->fileName,yyextra->lineNr,
2910 "'\\{}' command has no argument",yyextra->currentCmd
2922<SkipLang>{CMD}"~"[a-zA-Z-]* {
2926 warn(yyextra->fileName,yyextra->lineNr,
2929 else if (langId.
empty() ||
2935<SkipLang>[^*@\\\n]* {
2938 if (*yytext==
'\n') yyextra->lineNr++;
2945<CiteLabel,CiteLabelSection>{CITEID} {
2948 if (YY_START == CiteLabel)
2954 yyextra->sectionTitle+=yytext;
2955 BEGIN(SectionTitle);
2958<CiteLabel,CiteLabelSection>{DOCNL} {
2959 warn(yyextra->fileName,yyextra->lineNr,
2960 "\\cite command has no label"
2964 if (YY_START == CiteLabel)
2971 yyextra->sectionTitle+=yytext;
2973 BEGIN(SectionTitle);
2976<CiteLabel,CiteLabelSection>. {
2977 warn(yyextra->fileName,yyextra->lineNr,
2978 "Invalid or missing cite label"
2980 if (YY_START == CiteLabel)
2986 yyextra->sectionTitle+=yytext;
2987 BEGIN(SectionTitle);
2995 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2996 addOutput(yyscanner,yyextra->copyDocArg);
3000<CopyDoc>"<"[/]?{TABLEDEL}">" {
3001 if (yyextra->braceCount==0)
3004 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3005 addOutput(yyscanner,yyextra->copyDocArg);
3011 if (*yytext==
'\n') yyextra->lineNr++;
3012 if (yyextra->braceCount==0)
3015 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3016 addOutput(yyscanner,yyextra->copyDocArg);
3024<CopyDoc>[^@\\\n()<]+ {
3025 yyextra->copyDocArg+=yytext;
3029 yyextra->copyDocArg+=yytext;
3031 yyextra->braceCount++;
3034 yyextra->copyDocArg+=yytext;
3036 yyextra->braceCount--;
3039 yyextra->copyDocArg+=yytext;
3061 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3062 yyextra->braceCount=0;
3063 yyextra->functionProto.clear();
3064 yyextra->currentCmd = cmd;
3065 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3072 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3073 yyextra->functionProto.clear();
3074 yyextra->braceCount=0;
3075 yyextra->currentCmd = cmd;
3076 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3083 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3084 yyextra->functionProto.clear();
3085 BEGIN(OverloadParam);
3091 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3092 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3093 BEGIN( EnumDocArg1 );
3099 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3102 BEGIN( GroupDocArg1 );
3108 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3111 BEGIN( GroupDocArg1 );
3117 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3120 BEGIN( GroupDocArg1 );
3126 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3127 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3128 BEGIN( NameSpaceDocArg1 );
3134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3136 BEGIN( PackageDocArg1 );
3142 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3143 yyextra->currentCmd = cmd;
3144 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3145 BEGIN( ClassDocArg1 );
3151 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3152 yyextra->currentCmd = cmd;
3153 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3154 BEGIN( ConceptDocArg1 );
3160 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3161 yyextra->currentCmd = cmd;
3162 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3163 BEGIN( ModuleDocArg1 );
3169 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3170 BEGIN( ClassDocArg2 );
3176 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3177 yyextra->currentCmd = cmd;
3178 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3179 BEGIN( ClassDocArg1 );
3185 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3186 yyextra->currentCmd = cmd;
3187 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3188 BEGIN( CategoryDocArg1 );
3194 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3195 yyextra->currentCmd = cmd;
3196 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3197 BEGIN( ClassDocArg1 );
3203 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3204 yyextra->currentCmd = cmd;
3205 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3206 BEGIN( ClassDocArg1 );
3212 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3213 yyextra->currentCmd = cmd;
3214 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3215 BEGIN( ClassDocArg1 );
3221 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3222 yyextra->currentCmd = cmd;
3223 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3224 BEGIN( ClassDocArg1 );
3230 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3232 BEGIN( PageDocArg1 );
3238 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3242 yyextra->current->name =
"mainpage";
3245 BEGIN( PageDocArg2 );
3251 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3255 yyextra->current->name = yyextra->fileName;
3257 BEGIN( FileDocArg1 );
3263 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3273 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3281 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3283 if (!stop) yyextra->current->name = yyextra->fileName;
3284 BEGIN( FileDocArg1 );
3290 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3292 for (
const auto &opt : optList)
3296 sectionMaker=EntryType::makeExampleLineno;
3300 warn(yyextra->fileName,yyextra->lineNr,
3301 "unsupported option '{}' for command '\\{}'",opt,cmd);
3305 if (!stop) yyextra->current->name = yyextra->fileName;
3306 BEGIN( FileDocArg1 );
3312 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3315 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3324 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3325 yyextra->raiseWarning =
"";
3326 BEGIN( RaiseWarning );
3332 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3339 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3343 yyextra->docGroup.clearHeader();
3345 if (!yyextra->docGroup.empty())
3347 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true,
true);
3355 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3364 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3373 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3382 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3386 yyextra->current->spec.setDeprDoc(
true);
3392 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3394 BEGIN(XRefItemParam1);
3400 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3401 if (yyextra->insideParBlock)
3403 warn(yyextra->fileName,yyextra->lineNr,
3404 "found \\parblock command while already in a parblock!");
3406 if (!yyextra->spaceBeforeCmd.empty())
3408 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3409 yyextra->spaceBeforeCmd.clear();
3412 yyextra->insideParBlock =
true;
3418 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3419 if (!yyextra->insideParBlock)
3421 warn(yyextra->fileName,yyextra->lineNr,
3422 "found \\endparblock command without matching \\parblock!");
3426 yyextra->insideParBlock =
false;
3432 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3433 if (!yyextra->current->relates.empty())
3435 warn(yyextra->fileName,yyextra->lineNr,
3436 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3438 yyextra->current->relatesType = RelatesType::Simple;
3439 yyextra->currentCmd = cmd;
3440 BEGIN(RelatesParam1);
3446 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3447 if (!yyextra->current->relates.empty())
3449 warn(yyextra->fileName,yyextra->lineNr,
3450 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3452 yyextra->current->relatesType = RelatesType::Duplicate;
3453 yyextra->currentCmd = cmd;
3454 BEGIN(RelatesParam1);
3460 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3461 if (!yyextra->current->relates.empty())
3463 warn(yyextra->fileName,yyextra->lineNr,
3464 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3466 yyextra->current->relatesType = RelatesType::MemberOf;
3467 yyextra->currentCmd = cmd;
3468 BEGIN(RelatesParam1);
3474 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3482 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3485 BEGIN(SectionLabel);
3486 yyextra->sectionLabel.clear();
3495 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3497 switch (yyextra->sectionLevel)
3505 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3512 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3514 BEGIN( RequirementLabel );
3520 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3521 BEGIN( SatisfiesLabel );
3527 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3528 BEGIN( VerifiesLabel );
3534 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3535 if (!yyextra->current->section.isEmpty() &&
3536 !yyextra->current->section.isPageDoc() &&
3537 !yyextra->current->section.isMainpageDoc()
3540 warn(yyextra->fileName,yyextra->lineNr,
3541 "found \\subpage command in a comment block that is not marked as a page!");
3543 if (!yyextra->spaceBeforeCmd.empty())
3545 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3546 yyextra->spaceBeforeCmd.clear();
3549 BEGIN(SubpageLabel);
3555 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3557 if (optList.empty())
3559 yyextra -> anchorTitle =
"";
3563 yyextra -> anchorTitle =
join(optList,
" ");
3571 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3572 for (
const auto &opt : optList)
3582 if (optList.empty())
3596 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3597 if (!yyextra->spaceBeforeCmd.empty())
3599 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3600 yyextra->spaceBeforeCmd.clear();
3602 if (optList.empty())
3616 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3617 if (!yyextra->spaceBeforeCmd.empty())
3619 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3620 yyextra->spaceBeforeCmd.clear();
3626 if (optList.empty())
3635 yyextra->blockName=s;
3636 yyextra->commentCount=0;
3643 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3651 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3669 static std::unordered_map<std::string,OptionFunc> options =
3672 {
"name", [](
const FileInfo &fi_) ->
DString {
return fi_.baseName(); } },
3673 {
"extension", [](
const FileInfo &fi_) ->
DString {
return fi_.extension(
true); } },
3674 {
"filename", [](
const FileInfo &fi_) ->
DString {
return fi_.fileName(); } },
3675 {
"directory", [](
const FileInfo &fi_) ->
DString {
return fi_.dirPath(); } },
3676 {
"full", [](
const FileInfo &fi_) ->
DString {
return fi_.absFilePath(); } }
3678 auto it = options.
find(optionName);
3679 return (it!=options.end()) ? it->second(fi) :
DString();
3684 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3685 if (!yyextra->spaceBeforeCmd.empty())
3687 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3688 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3689 yyextra->spaceBeforeCmd.clear();
3692 FileInfo fi(yyextra->fileName.str());
3693 for (
const auto &opt_ : optList)
3696 std::string opt = optStripped.
lower().
str();
3698 if (!result.
empty())
3702 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3709 yyextra->sectionTitle+=result;
3716 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3723 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3728 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3737 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3738 if (!yyextra->spaceBeforeCmd.empty())
3740 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3741 yyextra->spaceBeforeCmd.clear();
3749 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3757 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3765 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3772 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3774 BEGIN(IRaisePrefix);
3780 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3782 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3783 if (yyextra->guards->empty())
3785 yyextra->guards->emplace(
true);
3789 bool enabled = yyextra->guards->top().isEnabled();
3790 yyextra->guards->emplace(enabled);
3798 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3800 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3801 if (yyextra->guards->empty())
3803 yyextra->guards->emplace(
true);
3807 bool enabled = yyextra->guards->top().isEnabled();
3808 yyextra->guards->emplace(enabled);
3816 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3817 if (yyextra->guards->empty())
3819 warn(yyextra->fileName,yyextra->lineNr,
3820 "found \\elseif without matching start command");
3822 else if (yyextra->guards->top().hasElse())
3824 warn(yyextra->fileName,yyextra->lineNr,
3825 "found \\elseif command after \\else command was given in \\if construct");
3827 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3828 yyextra->guards->top().setEnabled(
false);
3834 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3835 yyextra->guards->top().setEnabled(
false);
3843 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3844 if (yyextra->guards->empty())
3846 warn(yyextra->fileName,yyextra->lineNr,
3847 "found \\else without matching start command");
3849 else if (yyextra->guards->top().hasElse())
3851 warn(yyextra->fileName,yyextra->lineNr,
3852 "found multiple \\else commands in same \\if construct");
3853 yyextra->guards->top().setEnabled(
false);
3854 yyextra->guards->top().setElse();
3855 BEGIN( SkipGuardedSection );
3859 yyextra->guards->top().setElse();
3860 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3861 if (yyextra->guards->top().isEnabledFound())
3863 yyextra->guards->top().setEnabled(
false);
3864 BEGIN( SkipGuardedSection );
3868 yyextra->guards->top().setEnabled(
true);
3869 BEGIN( GuardParamEnd );
3877 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3878 if (yyextra->guards->empty())
3880 warn(yyextra->fileName,yyextra->lineNr,
3881 "found \\endif without matching start command");
3885 yyextra->guards->pop();
3887 if (!yyextra->spaceBeforeCmd.empty())
3889 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3890 yyextra->spaceBeforeCmd.clear();
3892 if (yyextra->guards->empty())
3894 BEGIN( GuardParamEnd );
3898 if (yyextra->guards->top().isEnabled())
3900 BEGIN( GuardParamEnd );
3904 BEGIN( SkipGuardedSection );
3912 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3913 yyextra->inGroupParamFound=
false;
3914 BEGIN( InGroupParam );
3920 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3921 yyextra->current->subGrouping =
false;
3927 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3928 yyextra->current->initLines = 100000;
3934 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3935 yyextra->current->initLines = 0;
3941 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3942 yyextra->current->commandOverrides.override_callGraph(
true);
3948 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3949 yyextra->current->commandOverrides.override_callGraph(
false);
3955 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3956 yyextra->current->commandOverrides.override_callerGraph(
true);
3962 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3963 yyextra->current->commandOverrides.override_callerGraph(
false);
3969 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3970 yyextra->current->commandOverrides.override_enumValues(
true);
3976 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3977 yyextra->current->commandOverrides.override_enumValues(
false);
3983 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3984 yyextra->current->commandOverrides.override_inlineSource(
true);
3990 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3991 yyextra->current->commandOverrides.override_inlineSource(
false);
3997 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3998 yyextra->current->commandOverrides.override_includeGraph(
true);
4004 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4005 yyextra->current->commandOverrides.override_includedByGraph(
true);
4011 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4012 yyextra->current->commandOverrides.override_includeGraph(
false);
4018 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4019 yyextra->current->commandOverrides.override_includedByGraph(
false);
4025 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4026 yyextra->current->commandOverrides.override_directoryGraph(
true);
4032 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4033 yyextra->current->commandOverrides.override_directoryGraph(
false);
4039 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4040 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4046 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4047 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4053 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4054 yyextra->current->commandOverrides.override_groupGraph(
true);
4060 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4061 yyextra->current->commandOverrides.override_groupGraph(
false);
4067 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4068 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4069 for (
const auto &opt_ : optList)
4076 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4078 else if (opt ==
"graph")
4080 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4082 else if (opt ==
"builtin")
4084 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4086 else if (opt ==
"text")
4088 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4090 else if (opt ==
"no")
4092 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4096 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4106 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4107 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4113 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4114 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4120 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4121 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4127 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4128 yyextra->current->commandOverrides.override_referencesRelation(
true);
4134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4135 yyextra->current->commandOverrides.override_referencesRelation(
false);
4141 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4142 yyextra->currentCmd = cmd;
4149 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4154 if (yyextra->current->doc.stripWhiteSpace().empty())
4156 yyextra->current->doc.clear();
4158 yyextra->condCount=0;
4159 BEGIN( SkipInternal );
4165 yyextra->inInternalDocs =
true;
4172 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4173 yyextra->current->isStatic =
true;
4179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4180 yyextra->current->virt = Specifier::Pure;
4186 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4187 yyextra->current->protection = Protection::Private;
4193 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4194 yyextra->current->protection = yyextra->protection = Protection::Private;
4200 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4201 yyextra->current->protection = Protection::Protected;
4207 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4208 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4214 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4215 yyextra->current->protection = Protection::Public;
4221 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4222 yyextra->current->protection = yyextra->protection = Protection::Public;
4228 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4229 if (yyextra->current->section.isPageDoc() ||
4230 yyextra->current->section.isMainpageDoc())
4232 for (
const auto &opt_ : optList)
4236 size_t i = opt.
find(
':');
4240 if (sscanf(opt.
mid(i+1).
data(),
"%d%c",&level,&dum) != 1)
4242 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4256 yyextra->current->localToc.enableHtml(level);
4258 else if (opt ==
"latex")
4260 yyextra->current->localToc.enableLatex(level);
4262 else if (opt ==
"xml")
4264 yyextra->current->localToc.enableXml(level);
4266 else if (opt ==
"docbook")
4268 yyextra->current->localToc.enableDocbook(level);
4272 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4277 if (yyextra->current->localToc.nothingEnabled())
4289 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4290 BEGIN(InheritParam);
4296 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4297 yyextra->currentCmd = cmd;
4298 BEGIN(ExtendsParam);
4304 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4305 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4311 if (!yyextra->spaceBeforeCmd.empty())
4313 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4314 yyextra->spaceBeforeCmd.clear();
4322 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4324 if (!yyextra->spaceBeforeCmd.empty())
4326 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4327 yyextra->spaceBeforeCmd.clear();
4335 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4336 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4342 if (!yyextra->spaceBeforeCmd.empty())
4344 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4345 yyextra->spaceBeforeCmd.clear();
4348 yyextra->copyDocArg.clear();
4349 yyextra->braceCount = 0;
4358 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4359 yyextra->sectionLabel.clear();
4360 yyextra->sectionTitle.clear();
4361 yyextra->docGroup.clearHeader();
4362 yyextra->insideParBlock =
false;
4369 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4371 return yyextra->current->section.isDoc();
4376 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4379 if (yyextra->current->section.isDoc())
4385 yyextra->needNewEntry =
true;
4386 yyextra->current->section = maker();
4387 yyextra->current->fileName = yyextra->fileName;
4388 yyextra->current->startLine = yyextra->lineNr;
4389 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4402 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4403 for(
const char* c = yytext ; *c ; ++c )
4404 yyextra->lineNr += (*c ==
'\n') ;
4412 if (s==
nullptr || *s==0)
return name;
4414 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4425 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4428 DString reqId = yyextra->current->name;
4434 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4439 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4441 yyextra->fileName,yyextra->lineNr,
4450 const DString &listTitle,
bool append,
bool inBody,
int lineNr)
4452 if (baseName.
empty())
return;
4459 if (
Config_getEnum(MARKDOWN_ID_STYLE) == MARKDOWN_ID_STYLE_t::GITHUB) listName = doxygenList + listName;
4462 for (
auto it = current->
sli.rbegin(); it != current->
sli.rend(); ++it)
4482 item = refList->
add();
4488 current->
sli.push_back(item);
4490 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4497 current->
doc += cmdString;
4508 current->
anchors.push_back(si);
4510 else if (si->
lineNr() != -1)
4512 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4517 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4524 current->
anchors.push_back(si);
4534 const DString &listTitle,
bool append)
4536 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4537 addXRefItemToEntry(yyextra->current,yyextra->outputXRef,listName,itemTitle,listTitle,append,yyextra->inBody,yyextra->lineNr);
4538 yyextra->outputXRef.clear();
4546 if (label.
empty())
return;
4547 signed char c =
static_cast<signed char>(label[0]);
4548 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4552 for (
size_t i=1; i<label.
size(); i++)
4554 c =
static_cast<signed char>(label[i]);
4555 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4570 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4572 DString formula = (yyextra->formulaPreText +
4573 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4581 formLabel.
sprintf(
"\\_form#%d",
id);
4582 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4599 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4607 if (addYYtext) yyextra->sectionTitle+=yytext;
4608 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4609 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4611 yyextra->sectionLevel);
4614 yyextra->current->anchors.push_back(si);
4616 else if (si->
lineNr() != -1)
4618 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4623 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4624 yyextra->sectionLabel,si->
fileName());
4630 if (addYYtext) yyextra->sectionTitle+=yytext;
4631 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4632 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4634 yyextra->sectionLevel);
4637 yyextra->current->anchors.push_back(si);
4646 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4648 if (yytext[0] ==
'"')
4651 name=name.
left((
int)yyleng-2);
4667 if (c==
' ' || c==
'\t' || c==
'\r')
4690 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4691 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4693 yyextra->xrefAppendFlag = !yyextra->inBody &&
4695 yyextra->newXRefKind==yyextra->xrefKind &&
4697 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4713 switch(yyextra->xrefKind)
4740 xrefAppendToPrev || yyextra->current->spec.isDeprAttr()
4745 yyextra->xrefItemTitle,
4746 yyextra->xrefListTitle,
4755 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4757 int oldContext = yyextra->inContext;
4758 yyextra->inContext = ctx;
4760 switch(yyextra->inContext)
4763 if (oldContext!=yyextra->inContext)
4766 if (yyextra->current->doc.empty()) yyextra->current->docLine = yyextra->lineNr;
4767 if (yyextra->current->docFile.empty())
4769 yyextra->current->docFile = yyextra->fileName;
4770 yyextra->current->docLine = yyextra->lineNr;
4773 yyextra->pOutputString = &yyextra->current->doc;
4777 if (oldContext!=yyextra->inContext)
4779 if (yyextra->current->brief.empty()) yyextra->current->briefLine = yyextra->lineNr;
4780 if (yyextra->current->briefFile.empty())
4782 yyextra->current->briefFile = yyextra->fileName;
4783 yyextra->current->briefLine = yyextra->lineNr;
4786 bool foundMatch =
false;
4787 if (yyextra->current->brief.stripWhiteSpace().empty())
4795 std::string str = yyextra->current->brief.str();
4800 for (
size_t i = 0; i < match[2].str().size(); i++)
4802 if (match[2].str()[i] ==
'\n') cnt++;
4806 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4808 yyextra->current->brief +=
" \\iline " +
DString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4815 yyextra->pOutputString = &yyextra->current->brief;
4819 if (!yyextra->current->doc.empty())
4821 yyextra->current->doc +=
"\n";
4823 yyextra->pOutputString = &yyextra->current->doc;
4829 yyextra->pOutputString = &yyextra->outputXRef;
4834 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4843 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4851 yyextra->current->anchors.push_back(si);
4853 else if (si->
lineNr() != -1)
4855 warn(yyextra->fileName,yyextra->lineNr,
4856 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4861 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4868 yyextra->current->anchors.push_back(si);
4875 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4877 *yyextra->pOutputString+=s;
4883 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4885 *yyextra->pOutputString+=s;
4891 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4892 *yyextra->pOutputString+=c;
4898 snprintf(cmd,30,
" \\iline %d ",lineNr);
4905 snprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4911 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4912 std::string_view str = yyextra->current->brief.view();
4917 yyextra->briefEndsAtDot=
false;
4919 if (yyextra->current->doc.stripWhiteSpace().empty())
4921 yyextra->current->docLine = yyextra->lineNr;
4922 yyextra->current->doc =
"";
4926 addIline(yyscanner,yyextra->lineNr);
4932 int saveLineNr = yyextra->lineNr;
4934 yyextra->current->briefLine = yyextra->lineNr;
4935 yyextra->lineNr = saveLineNr;
4941 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4942 yyextra->prevPosition=yyextra->inputPosition;
4944 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4946 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4957 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4958 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4959 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4960 YY_START==ReadFormulaLong)
4962 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4976 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4984 commentscanYYlex_destroy(
p->yyscanner);
4997 bool &newEntryNeeded,
4998 bool markdownSupport,
5002 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
5003 " prot={} markdownSupport={}",
Trace::trunc(comment),fileName,lineNr,isBrief,
5004 isAutoBriefOn,isInbody,prot,markdownSupport);
5006 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5009 yyextra->guards = guards;
5010 yyextra->langParser = parser;
5011 yyextra->current = curEntry;
5012 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
5013 if (comment.
empty())
return false;
5014 yyextra->inputString = comment;
5015 yyextra->inputString.
append(
" ");
5016 yyextra->inputPosition = position;
5017 yyextra->lineNr = lineNr;
5018 yyextra->fileName = fileName;
5019 yyextra->protection = prot;
5020 yyextra->needNewEntry =
false;
5022 yyextra->xrefAppendFlag =
false;
5023 yyextra->insidePre =
false;
5024 yyextra->parseMore =
false;
5025 yyextra->inBody = isInbody;
5026 yyextra->markdownSupport= markdownSupport;
5027 yyextra->outputXRef.clear();
5028 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.empty())
5030 yyextra->current->doc +=
'\n';
5033 yyextra->briefEndsAtDot = isAutoBriefOn;
5034 yyextra->condCount = 0;
5035 yyextra->sectionLevel = 0;
5036 yyextra->spaceBeforeCmd.clear();
5037 yyextra->spaceBeforeIf.clear();
5038 yyextra->htmlContextStack.clear();
5041 if (!yyextra->current->inbodyDocs.empty() && isInbody)
5044 snprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5045 yyextra->current->inbodyDocs+=cmd;
5049 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5052 commentscanYYrestart(
nullptr, yyscanner );
5054 commentscanYYlex(yyscanner);
5057 if (YY_START==OverloadParam)
5062 if (yyextra->insideParBlock)
5064 warn(yyextra->fileName,yyextra->lineNr,
5065 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5071 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.empty())
5074 yyextra->current->doc=
"\n\n";
5077 if (yyextra->current->section.isMemberGrp() &&
5078 yyextra->docGroup.empty())
5080 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5084 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5086 yyextra->current->briefLine,yyextra->current->brief,
5087 yyextra->current->docLine,yyextra->current->doc,
5088 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5092 prot = yyextra->protection;
5094 yyextra->docGroup.addDocs(curEntry);
5096 newEntryNeeded = yyextra->needNewEntry;
5101 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
false;
5103 if (!yyextra->parseMore && !yyextra->guards->empty())
5105 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5108 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5110 lineNr = yyextra->lineNr;
5112 position,yyextra->parseMore,newEntryNeeded);
5114 return yyextra->parseMore;
5119 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5121 bool sectionEnabled =
false;
5126 bool parentEnabled = yyextra->guards->top().parentVisible();
5130 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5131 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5135 yyextra->guards->top().setEnabled(
true);
5136 yyextra->guards->top().setEnabledFound();
5137 BEGIN( GuardParamEnd );
5141 if (yyextra->guards->top().isEnabledFound())
5143 yyextra->guards->top().setEnabled(
false);
5144 BEGIN( SkipGuardedSection );
5146 else if (sectionEnabled)
5148 yyextra->guards->top().setEnabled(
true);
5149 yyextra->guards->top().setEnabledFound();
5150 BEGIN( GuardParamEnd );
5154 yyextra->guards->top().setEnabled(
false);
5155 BEGIN( SkipGuardedSection );
5160 BEGIN( SkipGuardedSection );
5165 BEGIN( SkipGuardedSection );
5171 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5172 yyextra->docGroup.initGroupInfo(entry);
5177 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5178 yyextra->docGroup.enterFile(fileName,lineNr);
5183 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5184 yyextra->docGroup.leaveFile(fileName,lineNr);
5189 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5190 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5195 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5196 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5201 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5202 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5207 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5208 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5218 static reg::Ex deprecated_re(R
"(deprecated\s*(\(\s*\"([^\"]*)\"\s*\))?)");
5224 if (match.size()==3)
5227 DString rawDoc = match[2].str();
5229 std::shared_ptr<Entry> docEntry = std::make_shared<Entry>();
5231 bool newEntryNeeded =
false;
5247 docs = docEntry->doc;
5252 current->
spec.setDeprAttr(
true);
5254 if (!docs.
empty() || !current->
spec.isDeprDoc())
5275#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.