16%option never-interactive
17%option prefix="commentscanYY"
19%option extra-type="struct commentscanYY_state *"
23#define YY_TYPEDEF_YY_SCANNER_T
39#include <unordered_map>
214static const std::unordered_map< std::string, DocCmdMap >
docCmdMap =
423#define YY_NO_UNISTD_H 1
424#define YY_NEVER_INTERACTIVE 1
557 const DString &listTitle,
bool append);
574#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
579#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.
constexpr EntryType(int t) noexcept
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.
590TABLE ("table"|"TABLE")
591TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
601CAPTION ("caption"|"CAPTION")
602CENTER ("center"|"CENTER")
604DETAILS ("details"|"DETAILS")
605BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
606DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
607DETAILEDHTMLOPT {CODE}
608DETAILEDHTMLOPTEND {ENDCODE}
609SUMMARY ("summary"|"SUMMARY")
610REMARKS ("remarks"|"REMARKS")
612ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
617DOCNL "\n"|"\\ilinebr"
620FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
621FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
622FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
623ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
624LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
625REQID [a-z_A-Z0-9\x80-\xFF\-]+
626CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
627CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
628CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
629SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
630SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
631TMPLSPEC "<"{BN}*[^>]+{BN}*">"
632MAILADDR ("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\-]+
633RCSTAG "$"{ID}":"[^\n$]+"$"
634MODULE_ID ({ID}".")*{ID}
635LINENR {Bopt}[1-9][0-9]*
636IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
637DOXYCFG [A-Z][A-Z_0-9]*
695%x ReadFormulaShortSection
697%x ReadFormulaRoundSection
711%x RaiseWarningSection
740<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
743<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
749<Comment>"\""[^"\n]*"\"" {
752<Comment>("\\"[a-z_A-Z]+)+"\\" {
755<Comment>"<"{DETAILEDHTML}{ATTR}">" {
757 size_t spacePos = htmlOpenTag.find(
' ');
759 DString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
761 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
769<Comment>"</"{DETAILEDHTML}">" {
771 DString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
773 if (!yyextra->htmlContextStack.empty() &&
774 yyextra->htmlContextStack.back().tagName==htmlTagName)
781 yyextra->htmlContextStack.pop_back();
785<Comment>"<"{DETAILEDHTMLOPT}">" {
787 if (yyextra->current->lang==SrcLangExt::CSharp)
789 yyextra->CScode=
true;
799<Comment>"<"{DETAILEDHTMLOPTEND}">" {
803 yyextra->CScode=
false;
807 yyextra->CScode=
false;
812<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
814 if (yyextra->current->lang==SrcLangExt::CSharp)
821<Comment>"<"{DETAILS}{ATTR}">" {
822 yyextra->htmlDetailsStack.push_back(0);
823 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
830<Comment>"</"{DETAILS}">" {
831 if (!yyextra->htmlDetailsStack.empty())
833 yyextra->htmlDetailsStack.pop_back();
835 if (!yyextra->htmlContextStack.empty() &&
836 yyextra->htmlContextStack.back().tagName==
"details")
843 yyextra->htmlContextStack.pop_back();
848 yyextra->htmlAnchorStr = yytext;
849 yyextra->htmlAnchor =
false;
853 yyextra->htmlAnchorStr += yytext;
855 size_t s=tag.find(
"=");
858 if (c==
'\'' || c==
'"')
860 size_t e=tag.find(c,s+2);
863 id=tag.mid(s+2,e-s-2);
872 if (!
id.empty() && !yyextra->htmlAnchor)
878 yyextra->htmlAnchor =
true;
881<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
882 yyextra->htmlAnchorStr += yytext;
885 if (!yyextra->htmlAnchor)
887 addOutput(yyscanner,yyextra->htmlAnchorStr);
900 yyextra->htmlAnchorStr += yytext;
901 if (*yytext ==
'\n') yyextra->lineNr++;
904 yyextra->htmlAnchorStr += yytext;
906<Comment>"<"{SUMMARY}">" {
907 if (yyextra->htmlDetailsStack.empty())
916<Comment>"<"{REMARKS}">" {
920<Comment>"</"{SUMMARY}">" {
921 if (!yyextra->htmlDetailsStack.empty())
930<Comment>"</"{REMARKS}">" {
934<Comment>"<"{CAPTION}{ATTR}">" {
936 size_t s=tag.find(
"id=");
940 if (c==
'\'' || c==
'"')
942 size_t e=tag.find(c,s+4);
952<Comment>"<"{PRE}{ATTR}">" {
953 yyextra->insidePre=
true;
956<Comment>"</"{PRE}">" {
957 yyextra->insidePre=
false;
967<Comment>"<!\[CDATA\[" {
970<Comment>{B}*{CMD}"endinternal"{B}* {
972 if (!yyextra->inInternalDocs)
973 warn(yyextra->fileName,yyextra->lineNr,
974 "found \\endinternal without matching \\internal"
976 yyextra->inInternalDocs =
false;
#define warn(file, line, fmt,...)
978<Comment>{B}*"\\ilinebr "{B}* {
981<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
991<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
992<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
995 size_t idx = fullMatch.
find(
'{');
997 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
998 size_t idxEnd = fullMatch.
find(
'}',idx+1);
1016 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1017 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1020 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1022 yyextra->briefEndsAtDot=
false;
1028 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1033 yyextra->parseMore=
true;
1035 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1038 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.
1050<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1053<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1055 if (!langId.
empty() &&
1060 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...
1066<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1068 yyextra->formulaText=
"";
1069 yyextra->formulaPreText=
"\\begin";
1070 yyextra->formulaPostText=
"";
1071 yyextra->formulaEnv=
DString(yytext).stripWhiteSpace().mid(2);
1072 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1075 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1077 yyextra->formulaPreText+=yyextra->formulaEnv;
1078 yyextra->formulaNewLines=0;
1079 BEGIN(ReadFormulaLong);
1081<Comment>{B}*{CMD}"f$" {
1082 yyextra->formulaText=
"";
1083 yyextra->formulaPreText=
"$";
1084 yyextra->formulaPostText=
"";
1085 yyextra->formulaNewLines=0;
1086 BEGIN(ReadFormulaShort);
1088<Comment>{B}*{CMD}"f(" {
1089 yyextra->formulaText=
"";
1090 yyextra->formulaPreText=
"";
1091 yyextra->formulaPostText=
"";
1092 yyextra->formulaNewLines=0;
1093 BEGIN(ReadFormulaRound);
1095<Comment>{B}*{CMD}"f[" {
1097 yyextra->formulaText=
"";
1098 yyextra->formulaPreText=
"\\[";
1099 yyextra->formulaPostText=
"";
1100 yyextra->formulaNewLines=0;
1101 BEGIN(ReadFormulaLong);
1103<Comment>{B}*{CMD}"{" {
1105 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1107<Comment>{B}*{CMD}"}" {
1109 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
1110 yyextra->docGroup.clearHeader();
1111 yyextra->parseMore=
true;
1112 yyextra->needNewEntry =
true;
1113 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1116<Comment>{B}*{CMD}[$@\\&~<>#%] {
1119<Comment>[a-z_A-Z]+ {
1122<Comment>^{B}*"."{Bopt}/\n {
1125<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1126<Comment>^{B}*[*+]{B}+ {
1127 if (!yyextra->markdownSupport)
1135 yyextra->briefEndsAtDot=
false;
1141<Comment>^{B}*"-"{B}+ {
1144 yyextra->briefEndsAtDot=
false;
1149<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1152<Comment>{CMD}"---" {
1159 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1162 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1167 yyextra->briefEndsAtDot=
false;
1172<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1173<Comment>("."+)[a-z_A-Z0-9\)] {
1177<Comment>{CMD}[\.?!] {
1181<Comment>".\\"[ \t] {
1188<Comment>"...\\"[ \t] {
1191<Comment>"..."/[^\.] {
1194<Comment>".."[\.]?/[^ \t\n] {
1197<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1203 for (i=0;i<(yy_size_t)yyleng;)
1205 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1206 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1213 for (i=0;i<(yy_size_t)yyleng;)
1215 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1216 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1231 if (yyextra->briefEndsAtDot)
1234 yyextra->briefEndsAtDot=
false;
1239 if (*yytext ==
'\n') yyextra->lineNr++;
1241<Comment>"<"[/]?{TABLEDEL}">" {
1259<HtmlComment>"---"[!]?">"{B}* {
1260 warn(yyextra->fileName,yyextra->lineNr,
1261 "incorrect HTML end comment --->"
1264<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1265<HtmlComment>{DOCNL} {
1272<HtmlComment>[^\\\n\-]+ {
1277<CdataSection>"\]\]>" {
1280<CdataSection>{DOCNL} {
1282 if (*yytext==
'\n') yyextra->lineNr++;
1284<CdataSection>[<>&] {
1288<CdataSection>[^\\\n\]<>&]+ {
1297<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1298 yyextra->formulaPostText+=
"$";
1301 if (YY_START == ReadFormulaShort)
1307 yyextra->sectionTitle+=
" "+form;
1308 BEGIN(SectionTitle);
1311<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1314 if (YY_START == ReadFormulaRound)
1320 yyextra->sectionTitle+=
" "+form;
1321 BEGIN(SectionTitle);
1324<ReadFormulaLong>{CMD}"f]" {
1325 yyextra->formulaPostText+=
"\\]";
1329<ReadFormulaLong>{CMD}"f}" {
1330 yyextra->formulaPostText+=
"\\end";
1331 yyextra->formulaPostText+=yyextra->formulaEnv;
1335<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1336 yyextra->formulaText+=yytext;
1338<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1339 yyextra->formulaNewLines++;
1340 yyextra->formulaText+=*yytext;
1342 addIline(yyscanner,yyextra->lineNr);
1344<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1345 yyextra->formulaText+=*yytext;
1350<EnumDocArg1>{SCOPEID} {
1352 yyextra->current->name = yytext;
1359<EnumDocArg1>{DOCNL} {
1360 warn(yyextra->fileName,yyextra->lineNr,
1361 "missing argument after '\\enum'."
1371<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)
1377<NameSpaceDocArg1>{LC} {
1381<NameSpaceDocArg1>{DOCNL} {
1382 warn(yyextra->fileName,yyextra->lineNr,
1383 "missing argument after '\\namespace'."
1388<NameSpaceDocArg1>. {
1393<PackageDocArg1>{ID}("."{ID})* {
1394 yyextra->current->name = yytext;
1397<PackageDocArg1>{LC} {
1401<PackageDocArg1>{DOCNL} {
1402 warn(yyextra->fileName,yyextra->lineNr,
1403 "missing argument after \\package."
1415<ConceptDocArg1>{SCOPEID} {
1417 yyextra->current->name = yytext;
1420<ConceptDocArg1>{LC} {
1424<ConceptDocArg1>{DOCNL} {
1425 warn(yyextra->fileName,yyextra->lineNr,
1426 "missing argument after '\\concept'."
1435<ModuleDocArg1>{MODULE_ID} {
1437 yyextra->current->name = yytext;
1440<ModuleDocArg1>{LC} {
1444<ModuleDocArg1>{DOCNL} {
1445 warn(yyextra->fileName,yyextra->lineNr,
1446 "missing argument after '\\module'."
1456<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1460 BEGIN( ClassDocArg2 );
1462<ClassDocArg1>{SCOPENAME} {
1465 yyextra->current->name =
substitute(yytext,
".",
"::");
1466 if (yyextra->current->section.isProtocolDoc())
1468 yyextra->current->name+=
"-p";
1471 BEGIN( ClassDocArg2 );
1473<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1476 yyextra->current->name =
substitute(yytext,
".",
"::");
1477 BEGIN( ClassDocArg2 );
1479<ClassDocArg1,CategoryDocArg1>{LC} {
1483<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1484 warn(yyextra->fileName,yyextra->lineNr,
1485 "missing argument after '\\{}'.",yyextra->currentCmd
1490<ClassDocArg1,CategoryDocArg1>. {
1493<ClassDocArg2>{DOCNL} {
1497<ClassDocArg2>{FILE}|"<>" {
1498 yyextra->current->includeFile = yytext;
1499 BEGIN( ClassDocArg3 );
1508<ClassDocArg3>[<"]?{FILE}?[">]? {
1509 yyextra->current->includeName = yytext;
1516<ClassDocArg3>{DOCNL} {
1526<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1527 yyextra->current->name = yytext;
1531 if (yyextra->current->name.endsWith(
".html"))
1533 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1535 else if (yyextra->current->name.endsWith(
".xhtml"))
1537 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1539 yyextra->current->type.clear();
1540 BEGIN(GroupDocArg2);
1542<GroupDocArg1>"\\"{B}*"\n" {
1546<GroupDocArg1>{DOCNL} {
1547 warn(yyextra->fileName,yyextra->lineNr,
1548 "missing group name after {}",
1549 yyextra->current->groupDocCmd()
1558<GroupDocArg2>"\\"{B}*"\n" {
1562<GroupDocArg2>[^\n\\]+ {
1563 yyextra->current->type += yytext;
1565<GroupDocArg2>{DOCNL}+ {
1566 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1568 yyextra->current->type.empty()
1571 warn(yyextra->fileName,yyextra->lineNr,
1572 "missing title after "
1573 "\\defgroup {}", yyextra->current->name
1577 int extraLineNr = 0;
1580 for (
int i = 0; i < yyleng; i++)
1582 if (yytext[i]==
'\n') extraLineNr++;
1589 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1590 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1595 yyextra->current->type += yytext;
1600<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1604 size_t start = text.
find(
'{');
1605 size_t end = text.
find(
'}',start+1);
1606 yyextra->current->name = text.
mid(
end+2);
1607 size_t istart = yyextra->current->name.
find(
"\\ilinebr");
1610 DString rest = yyextra->current->name.
mid(istart);
1612 yyextra->current->name = yyextra->current->name.left(istart);
1614 yyextra->current->args = text.
mid(start+1,
end-start-1);
1616 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1618<PageDocArg1>{FILE} {
1620 yyextra->current->args =
"";
1621 BEGIN( PageDocArg2 );
1623<PageDocArg1>{LC} { yyextra->lineNr++;
1626<PageDocArg1>{DOCNL} {
1627 warn(yyextra->fileName,yyextra->lineNr,
1628 "missing argument after \\page."
1637<PageDocArg2>{DOCNL} {
1641 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1642 addOutput(yyscanner,
"\" \\iline " +
DString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1645<PageDocArg2>{CMD}[<>] {
1650 yyextra->current->args += tmp;
1653 yyextra->current->args += yytext;
1656<ParamArg1>{ID}/{B}*"," {
1663 if (*yytext==
'\n') yyextra->lineNr++;
1677<FileDocArg1>{DOCNL} {
1683<FileDocArg1>{FILE} {
1687<FileDocArg1>{LC} { yyextra->lineNr++;
1695<XRefItemParam1>{LABELID} {
1696 yyextra->newXRefItemKey=yytext;
1698 BEGIN(XRefItemParam2);
1700<XRefItemParam1>{LC} {
1704<XRefItemParam1>{DOCNL} {
1705 warn(yyextra->fileName,yyextra->lineNr,
1706 "Missing first argument of \\xrefitem"
1708 if (*yytext==
'\n') yyextra->lineNr++;
1716<XRefItemParam2>"\""[^\n\"]*"\"" {
1718 BEGIN(XRefItemParam3);
1720<XRefItemParam2>{LC} {
1724<XRefItemParam2>{DOCNL} {
1725 warn(yyextra->fileName,yyextra->lineNr,
1726 "Missing second argument of \\xrefitem"
1728 if (*yytext==
'\n') yyextra->lineNr++;
1736<XRefItemParam3>"\""[^\n\"]*"\"" {
1741<XRefItemParam2,XRefItemParam3>{LC} {
1745<XRefItemParam3>{DOCNL} {
1746 warn(yyextra->fileName,yyextra->lineNr,
1747 "Missing third argument of \\xrefitem"
1749 if (*yytext==
'\n') yyextra->lineNr++;
1760<RelatesParam1>({ID}("::"|"."))*{ID} {
1761 yyextra->current->relates = yytext;
1768<RelatesParam1>{LC} {
1772<RelatesParam1>{DOCNL} {
1773 warn(yyextra->fileName,yyextra->lineNr,
1774 "Missing argument of '\\{}' command",yyextra->currentCmd
1786<Qualifier>{LABELID} {
1787 yyextra->current->qualifiers.emplace_back(yytext);
1790<Qualifier>"\""[^\"]*"\"" {
1791 std::string inp(yytext);
1792 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1796 warn(yyextra->fileName,yyextra->lineNr,
1797 "Missing argument of '\\{}' command",yyextra->currentCmd
1803 warn(yyextra->fileName,yyextra->lineNr,
1804 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1810<ILine>{LINENR}/[\\@\n\.] |
1813 int nr =
DString(yytext).toInt(&ok);
1816 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1820 yyextra->lineNr = nr;
1823 if (YY_START == ILine)
1829 yyextra->sectionTitle+=yytext;
1830 BEGIN(SectionTitle);
1833<ILine,ILineSection>. {
1835 if (YY_START == ILine)
1841 yyextra->sectionTitle+=yytext;
1842 BEGIN(SectionTitle);
1847<IRaise>{B}*[0-9]+/[\\@\n\.] |
1848<IRaise>{B}*[0-9]+{B} {
1850 int nr =
DString(yytext).toInt(&ok);
1853 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1857 yyextra->raiseLevel = nr;
1867<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1881<IFile,IFileSection>{FILE} {
1884 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1885 else yyextra->fileName = yytext;
1886 if (YY_START == IFile)
1892 yyextra->sectionTitle+=yytext;
1893 BEGIN(SectionTitle);
1897<LinkSection>[^\\@\n]* {
1898 yyextra->sectionTitle+=yytext;
1900<LinkSection>{CMD}{CMD} {
1901 yyextra->sectionTitle+=yytext;
1903<LinkSection>{DOCNL} {
1905 if (*yytext ==
'\n') yyextra->lineNr++;
1906 yyextra->sectionTitle+=yytext;
1908<LinkSection>{CMD}"endlink" {
1909 yyextra->sectionTitle+=yytext;
1910 BEGIN(SectionTitle);
1913 yyextra->sectionTitle+=yytext;
1915<LinkSection><<EOF>> {
1916 warn(yyextra->fileName,yyextra->lineNr,
1917 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1923<LineParam>{CMD}{CMD} {
1936<LineParam>({CMD}{CMD}){ID} {
1945<SectionLabel>{LABELID} {
1946 yyextra->sectionLabel+=yytext;
1948<SectionLabel>{CMD}"lineinfo"("{}")? {
1949 yyextra->sectionLabel +=
DString().setNum(yyextra->lineNr);
1951<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1952 FileInfo fi(yyextra->fileName.str());
1953 bool hasOption =
false;
1955 if (yytext[yyleng-1] ==
'}')
1961 for (
const auto &opt_ : optList)
1964 std::string opt = optStripped.
lower().
str();
1966 if (!result.
empty())
1970 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1980 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1992 label=yyextra->fileName;
1996 yyextra->sectionLabel+=label;
#define Config_getBool(name)
DString stripFromPath(const DString &path)
1998<SectionLabel>{DOCNL} {
1999 yyextra->sectionTitle.clear();
2000 if (yyextra->sectionLabel.empty())
2002 warn(yyextra->fileName,yyextra->lineNr,
2003 "\\section command has no label"
2008 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2009 addOutput(yyscanner,yyextra->sectionLabel.data());
2012 if (*yytext==
'\n') yyextra->lineNr++;
2017 if (yyextra->sectionLabel.empty())
2019 warn(yyextra->fileName,yyextra->lineNr,
2020 "Invalid or missing section label"
2026 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2027 addOutput(yyscanner,yyextra->sectionLabel.data());
2028 yyextra->sectionTitle.clear();
2030 BEGIN(SectionTitle);
2033<SectionTitle>{STAopt}/"\n" {
2038<SectionTitle>{STopt}"\\\\ilinebr" {
2039 yyextra->sectionTitle+=yytext;
2041<SectionTitle>{STopt}/"\\ilinebr" {
2046<SectionTitle>{B}*{CMD}"f$" {
2047 yyextra->formulaText=
"";
2048 yyextra->formulaPreText=
"$";
2049 yyextra->formulaPostText=
"";
2050 yyextra->formulaNewLines=0;
2051 BEGIN(ReadFormulaShortSection);
2053<SectionTitle>{B}*{CMD}"f(" {
2054 yyextra->formulaText=
"";
2055 yyextra->formulaPreText=
"";
2056 yyextra->formulaPostText=
"";
2057 yyextra->formulaNewLines=0;
2058 BEGIN(ReadFormulaRoundSection);
2060<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2061<SectionTitle>{B}*{CMD}"f"[\[{] {
2065 warn(yyextra->fileName,yyextra->lineNr,
2066 "'\\{}' command is not allowed in section title, ending section title.",
2076<SectionTitle>[^\n@\\]* {
2077 yyextra->sectionTitle+=yytext;
2080<SectionTitle>{B}*{CMD}{CMD} {
2081 yyextra->sectionTitle+=yytext;
2084<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2085<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2087 size_t idx = fullMatch.
find(
'{');
2089 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2090 size_t idxEnd = fullMatch.
find(
"}",idx+1);
2106 switch (it->second.sectionHandling)
2111 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2112 yyextra->sectionTitle+=fullMatch.
left(i);
2113 yyextra->sectionTitle+=
'@';
2114 yyextra->sectionTitle+=fullMatch.
mid(i);
2118 warn(yyextra->fileName,yyextra->lineNr,
2119 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2127 warn(yyextra->fileName,yyextra->lineNr,
2128 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2136 if (cmdName ==
"fileinfo")
2139 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2140 yyextra->sectionTitle+=fullMatch.
left(i);
2145 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2150 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2154 else if (cmdName ==
"lineinfo")
2157 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2158 yyextra->sectionTitle+=fullMatch.
left(i);
2160 yyextra->sectionTitle+=
' ';
2161 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2167 else if (cmdName ==
"raisewarning")
2169 yyextra->raiseWarning =
"";
2170 BEGIN(RaiseWarningSection);
2172 else if (cmdName ==
"noop")
2177 else if (cmdName ==
"cite")
2179 yyextra->sectionTitle+=yytext;
2181 BEGIN(CiteLabelSection);
2183 else if (cmdName ==
"iline")
2185 yyextra->sectionTitle+=yytext;
2187 BEGIN(ILineSection);
2189 else if (cmdName ==
"ifile")
2191 yyextra->sectionTitle+=yytext;
2193 BEGIN(IFileSection);
2195 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2198 if (optList.empty())
2200 yyextra -> anchorTitle =
"";
2205 yyextra -> anchorTitle =
join(optList,
" ");
2208 BEGIN(AnchorLabelSection);
2210 else if (cmdName ==
"link")
2212 yyextra->sectionTitle+=yytext;
2217 yyextra->sectionTitle+=yytext;
2218 warn(yyextra->fileName,yyextra->lineNr,
2219 "internal error '\\{}' command is to be replaced in section title.",cmdName
2226 yyextra->sectionTitle+=yytext;
2234 yyextra->sectionTitle+=yytext;
DString & setNum(short n)
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
2239 yyextra->sectionTitle+=yytext;
2245<SubpageLabel>{FILE} {
2249 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2250 BEGIN(SubpageTitle);
2252<SubpageLabel>{DOCNL} {
2253 warn(yyextra->fileName,yyextra->lineNr,
2254 "\\subpage command has no label"
2256 if (*yytext==
'\n') yyextra->lineNr++;
2264<SubpageTitle>{DOCNL} {
2268<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2279<AnchorLabel,AnchorLabelSection>{LABELID} {
2280 DString lbl = yyextra->raisePrefix+yytext;
2281 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2283 if (YY_START == AnchorLabel)
2289 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2292<AnchorLabel,AnchorLabelSection>{DOCNL} {
2293 warn(yyextra->fileName,yyextra->lineNr,
2294 "\\anchor command has no label"
2296 if (*yytext==
'\n') yyextra->lineNr++;
2298 if (YY_START == AnchorLabel)
2304 BEGIN(SectionTitle);
2307<AnchorLabel,AnchorLabelSection>. {
2308 warn(yyextra->fileName,yyextra->lineNr,
2309 "Invalid or missing anchor label"
2312 if (YY_START == AnchorLabel)
2318 BEGIN(SectionTitle);
2324<RequirementLabel>{REQID} {
2325 yyextra->current->name = yytext;
2326 yyextra->current->type.clear();
2327 BEGIN( RequirementTitle );
2329<SatisfiesLabel>{REQID} {
2330 yyextra->reqId = yytext;
2331 yyextra->reqTitle.clear();
2332 BEGIN( SatisfiesTitle );
2334<VerifiesLabel>{REQID} {
2335 yyextra->reqId = yytext;
2336 yyextra->reqTitle.clear();
2337 BEGIN( VerifiesTitle );
2339<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2343<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2344 warn(yyextra->fileName,yyextra->lineNr,
2345 "missing requirement ID after \\requirement command"
2350<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2353<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2357<RequirementTitle>[^\n\\]+ {
2358 yyextra->current->type += yytext;
2360<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2361 yyextra->reqTitle += yytext;
2363<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2364 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2369<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2370 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2372 if (yyextra->current->section.isRequirementDoc())
2374 warn(yyextra->fileName,yyextra->lineNr,
2375 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2388<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2389 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2391 if (yyextra->current->section.isRequirementDoc())
2393 warn(yyextra->fileName,yyextra->lineNr,
2394 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2407<RequirementTitle>. {
2408 yyextra->current->type += yytext;
2410<SatisfiesTitle,VerifiesTitle>. {
2411 yyextra->reqTitle += yytext;
2417<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2419 if (&yytext[4]==yyextra->blockName)
2424<FormatBlock>{CMD}"enduml" {
2426 if (yyextra->blockName==
"startuml")
2431<FormatBlock>[^ \@\*\/\\\n]* {
2434<FormatBlock>{DOCNL} {
2435 if (*yytext==
'\n') yyextra->lineNr++;
2439 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2440 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2441 yyextra->blockName==
"iliteral"
2443 ) yyextra->commentCount++;
2448 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2449 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2450 yyextra->blockName==
"iliteral"
2454 yyextra->commentCount--;
2455 if (yyextra->commentCount<0)
2457 DString endTag =
"end"+yyextra->blockName;
2458 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2459 warn(yyextra->fileName,yyextra->lineNr,
2460 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2461 yyextra->blockName,endTag);
2468<FormatBlock><<EOF>> {
2469 DString endTag =
"end"+yyextra->blockName;
2470 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2471 warn(yyextra->fileName,yyextra->lineNr,
2472 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2473 yyextra->blockName,endTag
2480<GuardParam>{B}*"(" {
2481 yyextra->guardExpr=yytext;
2482 yyextra->roundCount=1;
2486 yyextra->guardExpr+=yytext;
2490 yyextra->guardExpr+=yytext;
2491 yyextra->roundCount++;
2494 yyextra->guardExpr+=yytext;
2495 yyextra->roundCount--;
2496 if (yyextra->roundCount==0)
2502 warn(yyextra->fileName,yyextra->lineNr,
2503 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2507<GuardParam>{B}*{CMD}doxyconfig{B}+{DOXYCFG} {
2510<GuardParam>{B}*[a-z_A-Z0-9.\-]+({B}*{CMD}doxyconfig{B}+{DOXYCFG})? {
2513<GuardParam>{DOCNL} {
2528<GuardParamEnd>{B}*{DOCNL} {
2530 yyextra->spaceBeforeIf.clear();
2534<GuardParamEnd>{B}* {
2535 if (!yyextra->spaceBeforeIf.empty())
2537 addOutput(yyscanner,yyextra->spaceBeforeIf);
2539 yyextra->spaceBeforeIf.clear();
2551<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2553 yyextra->guards->emplace(
false);
2554 BEGIN( GuardParam );
2556<SkipGuardedSection>{CMD}"if"/{NW} {
2558 yyextra->guards->emplace(
false);
2559 BEGIN( GuardParam );
2561<SkipGuardedSection>{CMD}"endif"/{NW} {
2562 if (yyextra->guards->empty())
2564 warn(yyextra->fileName,yyextra->lineNr,
2565 "found \\endif without matching start command");
2570 yyextra->guards->pop();
2571 if (yyextra->guards->empty())
2573 BEGIN( GuardParamEnd );
2577 if (yyextra->guards->top().isEnabled())
2579 BEGIN( GuardParamEnd );
2583 BEGIN( SkipGuardedSection );
2588<SkipGuardedSection>{CMD}"else"/{NW} {
2589 if (yyextra->guards->empty())
2591 warn(yyextra->fileName,yyextra->lineNr,
2592 "found \\else without matching start command");
2594 else if (yyextra->guards->top().hasElse())
2596 warn(yyextra->fileName,yyextra->lineNr,
2597 "found multiple \\else commands in same \\if construct");
2598 yyextra->guards->top().setEnabled(
false);
2599 BEGIN( SkipGuardedSection );
2601 else if (!yyextra->guards->top().parentVisible())
2603 yyextra->guards->top().setEnabled(
false);
2604 BEGIN( SkipGuardedSection );
2608 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2609 yyextra->guards->top().setElse();
2610 if (!yyextra->guards->top().parentVisible())
2612 yyextra->guards->top().setEnabled(
false);
2613 BEGIN( SkipGuardedSection );
2615 else if (yyextra->guards->top().isEnabledFound())
2617 yyextra->guards->top().setEnabled(
false);
2618 BEGIN( SkipGuardedSection );
2622 yyextra->guards->top().setEnabled(
true);
2623 BEGIN( GuardParamEnd );
2627<SkipGuardedSection>{CMD}"elseif"/{NW} {
2628 if (yyextra->guards->empty())
2630 warn(yyextra->fileName,yyextra->lineNr,
2631 "found \\elseif without matching start command");
2633 else if (yyextra->guards->top().hasElse())
2635 warn(yyextra->fileName,yyextra->lineNr,
2636 "found \\elseif command after \\else command was given in \\if construct");
2638 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2639 yyextra->guards->top().setEnabled(
false);
2640 BEGIN( GuardParam );
2645 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2646 yyextra->guards->top().setEnabled(
false);
2647 BEGIN( GuardParam );
2650<SkipGuardedSection>{DOCNL} {
2651 if (*yytext==
'\n') yyextra->lineNr++;
2654<SkipGuardedSection>[^ \\@\n]+ {
2656<SkipGuardedSection>{CMD}{CMD} |
2657<SkipGuardedSection>. {
2663<SkipInternal>{DOCNL} {
2664 if (*yytext==
'\n') yyextra->lineNr++;
2667<SkipInternal>{CMD}"if"/[ \t] {
2668 yyextra->condCount++;
2670<SkipInternal>{CMD}"ifnot"/[ \t] {
2671 yyextra->condCount++;
2673<SkipInternal>{CMD}/"endif" {
2674 yyextra->condCount--;
2675 if (yyextra->condCount<0)
2681<SkipInternal>{CMD}/"section"[ \t] {
2682 if (yyextra->sectionLevel>0)
2688<SkipInternal>{CMD}/"subsection"[ \t] {
2689 if (yyextra->sectionLevel>1)
2695<SkipInternal>{CMD}/"subsubsection"[ \t] {
2696 if (yyextra->sectionLevel>2)
2702<SkipInternal>{CMD}/"paragraph"[ \t] {
2703 if (yyextra->sectionLevel>3)
2709<SkipInternal>{CMD}/"subparagraph"[ \t] {
2710 if (yyextra->sectionLevel>4)
2716<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2717 if (yyextra->sectionLevel>5)
2723<SkipInternal>{CMD}"endinternal"[ \t]* {
2726<SkipInternal>[^ \\@\n]+ {
2743 yyextra->docGroup.appendHeader(
' ');
2746 yyextra->docGroup.appendHeader(*yytext);
2747 yyextra->current->name+=*yytext;
2762<RaiseWarning,RaiseWarningSection>{DOCNL} {
2764 "{}",yyextra->raiseWarning);
2765 yyextra->raiseWarning =
"";
2766 if (*yytext==
'\n') yyextra->lineNr++;
2768 if (YY_START == RaiseWarning)
2774 yyextra->sectionTitle+=yytext;
2775 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2778<RaiseWarning,RaiseWarningSection>. {
2779 yyextra->raiseWarning += yytext;
2783<InGroupParam>{LABELID} {
2784 yyextra->current->groups.emplace_back(
2787 yyextra->inGroupParamFound=
true;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2789<InGroupParam>{DOCNL} {
2790 if (!yyextra->inGroupParamFound)
2792 warn(yyextra->fileName,yyextra->lineNr,
2793 "Missing group name for \\ingroup command"
2812 if (yyextra->braceCount==0)
2814 if (yyextra->functionProto.stripWhiteSpace().empty())
2816 warn(yyextra->fileName,yyextra->lineNr,
2817 "missing argument after '\\{}'.",yyextra->currentCmd
2823 yyextra->langParser->parsePrototype(yyextra->functionProto);
2831 yyextra->functionProto+=
' ';
2833<FnParam>[^@\\\n()]+ {
2834 yyextra->functionProto+=yytext;
2837 yyextra->functionProto+=yytext;
2838 yyextra->braceCount++;
2841 yyextra->functionProto+=yytext;
2842 yyextra->braceCount--;
2845 yyextra->functionProto+=*yytext;
2852<OverloadParam>{DOCNL} {
2853 if (*yytext==
'\n') yyextra->lineNr++;
2854 if (yyextra->functionProto.stripWhiteSpace().empty())
2862 yyextra->langParser->parsePrototype(yyextra->functionProto);
virtual DString trOverloadText()=0
Translator * theTranslator
2866<OverloadParam>{LC} {
2868 yyextra->functionProto+=
' ';
2871 yyextra->functionProto+=*yytext;
2876<InheritParam>({ID}("::"|"."))*{ID} {
2877 yyextra->current->extends.emplace_back(
2882<InheritParam>{DOCNL} {
2883 warn(yyextra->fileName,yyextra->lineNr,
2884 "\\inherit command has no argument"
2886 if (*yytext==
'\n') yyextra->lineNr++;
2891 warn(yyextra->fileName,yyextra->lineNr,
2892 "Invalid or missing name for \\inherit command"
2899<ExtendsParam>({ID}("::"|"."))*{ID} {
2900 yyextra->current->extends.emplace_back(
2905<ExtendsParam>{DOCNL} {
2906 warn(yyextra->fileName,yyextra->lineNr,
2907 "'\\{}' command has no argument",yyextra->currentCmd
2919<SkipLang>{CMD}"~"[a-zA-Z-]* {
2923 warn(yyextra->fileName,yyextra->lineNr,
2926 else if (langId.
empty() ||
2932<SkipLang>[^*@\\\n]* {
2935 if (*yytext==
'\n') yyextra->lineNr++;
2942<CiteLabel,CiteLabelSection>{CITEID} {
2945 if (YY_START == CiteLabel)
2951 yyextra->sectionTitle+=yytext;
2952 BEGIN(SectionTitle);
2955<CiteLabel,CiteLabelSection>{DOCNL} {
2956 warn(yyextra->fileName,yyextra->lineNr,
2957 "\\cite command has no label"
2961 if (YY_START == CiteLabel)
2968 yyextra->sectionTitle+=yytext;
2970 BEGIN(SectionTitle);
2973<CiteLabel,CiteLabelSection>. {
2974 warn(yyextra->fileName,yyextra->lineNr,
2975 "Invalid or missing cite label"
2977 if (YY_START == CiteLabel)
2983 yyextra->sectionTitle+=yytext;
2984 BEGIN(SectionTitle);
2992 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2993 addOutput(yyscanner,yyextra->copyDocArg);
2997<CopyDoc>"<"[/]?{TABLEDEL}">" {
2998 if (yyextra->braceCount==0)
3001 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3002 addOutput(yyscanner,yyextra->copyDocArg);
3008 if (*yytext==
'\n') yyextra->lineNr++;
3009 if (yyextra->braceCount==0)
3012 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3013 addOutput(yyscanner,yyextra->copyDocArg);
3021<CopyDoc>[^@\\\n()<]+ {
3022 yyextra->copyDocArg+=yytext;
3026 yyextra->copyDocArg+=yytext;
3028 yyextra->braceCount++;
3031 yyextra->copyDocArg+=yytext;
3033 yyextra->braceCount--;
3036 yyextra->copyDocArg+=yytext;
3058 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3059 yyextra->braceCount=0;
3060 yyextra->functionProto.clear();
3061 yyextra->currentCmd = cmd;
3062 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3069 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3070 yyextra->functionProto.clear();
3071 yyextra->braceCount=0;
3072 yyextra->currentCmd = cmd;
3073 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3080 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3081 yyextra->functionProto.clear();
3082 BEGIN(OverloadParam);
3088 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3089 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3090 BEGIN( EnumDocArg1 );
3096 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3099 BEGIN( GroupDocArg1 );
3105 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3108 BEGIN( GroupDocArg1 );
3114 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3117 BEGIN( GroupDocArg1 );
3123 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3124 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3125 BEGIN( NameSpaceDocArg1 );
3131 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3133 BEGIN( PackageDocArg1 );
3139 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3140 yyextra->currentCmd = cmd;
3141 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3142 BEGIN( ClassDocArg1 );
3148 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3149 yyextra->currentCmd = cmd;
3150 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3151 BEGIN( ConceptDocArg1 );
3157 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3158 yyextra->currentCmd = cmd;
3159 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3160 BEGIN( ModuleDocArg1 );
3166 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3167 BEGIN( ClassDocArg2 );
3173 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3174 yyextra->currentCmd = cmd;
3175 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3176 BEGIN( ClassDocArg1 );
3182 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3183 yyextra->currentCmd = cmd;
3184 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3185 BEGIN( CategoryDocArg1 );
3191 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3192 yyextra->currentCmd = cmd;
3193 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3194 BEGIN( ClassDocArg1 );
3200 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3201 yyextra->currentCmd = cmd;
3202 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3203 BEGIN( ClassDocArg1 );
3209 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3210 yyextra->currentCmd = cmd;
3211 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3212 BEGIN( ClassDocArg1 );
3218 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3219 yyextra->currentCmd = cmd;
3220 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3221 BEGIN( ClassDocArg1 );
3227 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3229 BEGIN( PageDocArg1 );
3235 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3239 yyextra->current->name =
"mainpage";
3242 BEGIN( PageDocArg2 );
3248 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3252 yyextra->current->name = yyextra->fileName;
3254 BEGIN( FileDocArg1 );
3260 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3270 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3278 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3280 if (!stop) yyextra->current->name = yyextra->fileName;
3281 BEGIN( FileDocArg1 );
3287 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3289 for (
const auto &opt : optList)
3293 sectionMaker=EntryType::makeExampleLineno;
3297 warn(yyextra->fileName,yyextra->lineNr,
3298 "unsupported option '{}' for command '\\{}'",opt,cmd);
3302 if (!stop) yyextra->current->name = yyextra->fileName;
3303 BEGIN( FileDocArg1 );
3309 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3312 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3321 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3322 yyextra->raiseWarning =
"";
3323 BEGIN( RaiseWarning );
3329 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3336 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3340 yyextra->docGroup.clearHeader();
3342 if (!yyextra->docGroup.empty())
3344 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true,
true);
3352 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3361 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3370 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3379 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3383 yyextra->current->spec.setDeprDoc(
true);
3389 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3391 BEGIN(XRefItemParam1);
3397 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3398 if (yyextra->insideParBlock)
3400 warn(yyextra->fileName,yyextra->lineNr,
3401 "found \\parblock command while already in a parblock!");
3403 if (!yyextra->spaceBeforeCmd.empty())
3405 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3406 yyextra->spaceBeforeCmd.clear();
3409 yyextra->insideParBlock =
true;
3415 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3416 if (!yyextra->insideParBlock)
3418 warn(yyextra->fileName,yyextra->lineNr,
3419 "found \\endparblock command without matching \\parblock!");
3423 yyextra->insideParBlock =
false;
3429 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3430 if (!yyextra->current->relates.empty())
3432 warn(yyextra->fileName,yyextra->lineNr,
3433 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3435 yyextra->current->relatesType = RelatesType::Simple;
3436 yyextra->currentCmd = cmd;
3437 BEGIN(RelatesParam1);
3443 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3444 if (!yyextra->current->relates.empty())
3446 warn(yyextra->fileName,yyextra->lineNr,
3447 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3449 yyextra->current->relatesType = RelatesType::Duplicate;
3450 yyextra->currentCmd = cmd;
3451 BEGIN(RelatesParam1);
3457 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3458 if (!yyextra->current->relates.empty())
3460 warn(yyextra->fileName,yyextra->lineNr,
3461 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3463 yyextra->current->relatesType = RelatesType::MemberOf;
3464 yyextra->currentCmd = cmd;
3465 BEGIN(RelatesParam1);
3471 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3479 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3482 BEGIN(SectionLabel);
3483 yyextra->sectionLabel.clear();
3492 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3494 switch (yyextra->sectionLevel)
3502 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3509 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3511 BEGIN( RequirementLabel );
3517 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3518 BEGIN( SatisfiesLabel );
3524 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3525 BEGIN( VerifiesLabel );
3531 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3532 if (!yyextra->current->section.isEmpty() &&
3533 !yyextra->current->section.isPageDoc() &&
3534 !yyextra->current->section.isMainpageDoc()
3537 warn(yyextra->fileName,yyextra->lineNr,
3538 "found \\subpage command in a comment block that is not marked as a page!");
3540 if (!yyextra->spaceBeforeCmd.empty())
3542 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3543 yyextra->spaceBeforeCmd.clear();
3546 BEGIN(SubpageLabel);
3552 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3554 if (optList.empty())
3556 yyextra -> anchorTitle =
"";
3560 yyextra -> anchorTitle =
join(optList,
" ");
3568 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3569 for (
const auto &opt : optList)
3579 if (optList.empty())
3593 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3594 if (!yyextra->spaceBeforeCmd.empty())
3596 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3597 yyextra->spaceBeforeCmd.clear();
3599 if (optList.empty())
3613 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3614 if (!yyextra->spaceBeforeCmd.empty())
3616 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3617 yyextra->spaceBeforeCmd.clear();
3623 if (optList.empty())
3632 yyextra->blockName=s;
3633 yyextra->commentCount=0;
3640 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3648 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3666 static std::unordered_map<std::string,OptionFunc> options =
3669 {
"name", [](
const FileInfo &fi_) ->
DString {
return fi_.baseName(); } },
3670 {
"extension", [](
const FileInfo &fi_) ->
DString {
return fi_.extension(
true); } },
3671 {
"filename", [](
const FileInfo &fi_) ->
DString {
return fi_.fileName(); } },
3672 {
"directory", [](
const FileInfo &fi_) ->
DString {
return fi_.dirPath(); } },
3673 {
"full", [](
const FileInfo &fi_) ->
DString {
return fi_.absFilePath(); } }
3675 auto it = options.
find(optionName);
3676 return (it!=options.end()) ? it->second(fi) :
DString();
3681 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3682 if (!yyextra->spaceBeforeCmd.empty())
3684 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3685 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3686 yyextra->spaceBeforeCmd.clear();
3689 FileInfo fi(yyextra->fileName.str());
3690 for (
const auto &opt_ : optList)
3693 std::string opt = optStripped.
lower().
str();
3695 if (!result.
empty())
3699 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3706 yyextra->sectionTitle+=result;
3713 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3720 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3725 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3734 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3735 if (!yyextra->spaceBeforeCmd.empty())
3737 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3738 yyextra->spaceBeforeCmd.clear();
3746 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3754 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3762 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3769 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3771 BEGIN(IRaisePrefix);
3777 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3779 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3780 if (yyextra->guards->empty())
3782 yyextra->guards->emplace(
true);
3786 bool enabled = yyextra->guards->top().isEnabled();
3787 yyextra->guards->emplace(enabled);
3795 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3797 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3798 if (yyextra->guards->empty())
3800 yyextra->guards->emplace(
true);
3804 bool enabled = yyextra->guards->top().isEnabled();
3805 yyextra->guards->emplace(enabled);
3813 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3814 if (yyextra->guards->empty())
3816 warn(yyextra->fileName,yyextra->lineNr,
3817 "found \\elseif without matching start command");
3819 else if (yyextra->guards->top().hasElse())
3821 warn(yyextra->fileName,yyextra->lineNr,
3822 "found \\elseif command after \\else command was given in \\if construct");
3824 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3825 yyextra->guards->top().setEnabled(
false);
3831 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3832 yyextra->guards->top().setEnabled(
false);
3840 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3841 if (yyextra->guards->empty())
3843 warn(yyextra->fileName,yyextra->lineNr,
3844 "found \\else without matching start command");
3846 else if (yyextra->guards->top().hasElse())
3848 warn(yyextra->fileName,yyextra->lineNr,
3849 "found multiple \\else commands in same \\if construct");
3850 yyextra->guards->top().setEnabled(
false);
3851 yyextra->guards->top().setElse();
3852 BEGIN( SkipGuardedSection );
3856 yyextra->guards->top().setElse();
3857 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3858 if (yyextra->guards->top().isEnabledFound())
3860 yyextra->guards->top().setEnabled(
false);
3861 BEGIN( SkipGuardedSection );
3865 yyextra->guards->top().setEnabled(
true);
3866 BEGIN( GuardParamEnd );
3874 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3875 if (yyextra->guards->empty())
3877 warn(yyextra->fileName,yyextra->lineNr,
3878 "found \\endif without matching start command");
3882 yyextra->guards->pop();
3884 if (!yyextra->spaceBeforeCmd.empty())
3886 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3887 yyextra->spaceBeforeCmd.clear();
3889 if (yyextra->guards->empty())
3891 BEGIN( GuardParamEnd );
3895 if (yyextra->guards->top().isEnabled())
3897 BEGIN( GuardParamEnd );
3901 BEGIN( SkipGuardedSection );
3909 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3910 yyextra->inGroupParamFound=
false;
3911 BEGIN( InGroupParam );
3917 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3918 yyextra->current->subGrouping =
false;
3924 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3925 yyextra->current->initLines = 100000;
3931 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3932 yyextra->current->initLines = 0;
3938 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3939 yyextra->current->commandOverrides.override_callGraph(
true);
3945 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3946 yyextra->current->commandOverrides.override_callGraph(
false);
3952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3953 yyextra->current->commandOverrides.override_callerGraph(
true);
3959 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3960 yyextra->current->commandOverrides.override_callerGraph(
false);
3966 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3967 yyextra->current->commandOverrides.override_enumValues(
true);
3973 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3974 yyextra->current->commandOverrides.override_enumValues(
false);
3980 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3981 yyextra->current->commandOverrides.override_inlineSource(
true);
3987 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3988 yyextra->current->commandOverrides.override_inlineSource(
false);
3994 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3995 yyextra->current->commandOverrides.override_includeGraph(
true);
4001 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4002 yyextra->current->commandOverrides.override_includedByGraph(
true);
4008 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4009 yyextra->current->commandOverrides.override_includeGraph(
false);
4015 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4016 yyextra->current->commandOverrides.override_includedByGraph(
false);
4022 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4023 yyextra->current->commandOverrides.override_directoryGraph(
true);
4029 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4030 yyextra->current->commandOverrides.override_directoryGraph(
false);
4036 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4037 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4043 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4044 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4050 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4051 yyextra->current->commandOverrides.override_groupGraph(
true);
4057 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4058 yyextra->current->commandOverrides.override_groupGraph(
false);
4064 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4065 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4066 for (
const auto &opt_ : optList)
4073 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4075 else if (opt ==
"graph")
4077 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4079 else if (opt ==
"builtin")
4081 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4083 else if (opt ==
"text")
4085 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4087 else if (opt ==
"no")
4089 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4093 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4103 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4104 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4110 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4111 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4117 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4118 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4124 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4125 yyextra->current->commandOverrides.override_referencesRelation(
true);
4131 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4132 yyextra->current->commandOverrides.override_referencesRelation(
false);
4138 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4139 yyextra->currentCmd = cmd;
4146 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4151 if (yyextra->current->doc.stripWhiteSpace().empty())
4153 yyextra->current->doc.clear();
4155 yyextra->condCount=0;
4156 BEGIN( SkipInternal );
4162 yyextra->inInternalDocs =
true;
4169 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4170 yyextra->current->isStatic =
true;
4176 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4177 yyextra->current->virt = Specifier::Pure;
4183 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4184 yyextra->current->protection = Protection::Private;
4190 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4191 yyextra->current->protection = yyextra->protection = Protection::Private;
4197 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4198 yyextra->current->protection = Protection::Protected;
4204 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4205 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4211 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4212 yyextra->current->protection = Protection::Public;
4218 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4219 yyextra->current->protection = yyextra->protection = Protection::Public;
4225 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4226 if (yyextra->current->section.isPageDoc() ||
4227 yyextra->current->section.isMainpageDoc())
4229 for (
const auto &opt_ : optList)
4233 size_t i = opt.
find(
':');
4237 if (sscanf(opt.
mid(i+1).
data(),
"%d%c",&level,&dum) != 1)
4239 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4253 yyextra->current->localToc.enableHtml(level);
4255 else if (opt ==
"latex")
4257 yyextra->current->localToc.enableLatex(level);
4259 else if (opt ==
"xml")
4261 yyextra->current->localToc.enableXml(level);
4263 else if (opt ==
"docbook")
4265 yyextra->current->localToc.enableDocbook(level);
4269 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4274 if (yyextra->current->localToc.nothingEnabled())
4286 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4287 BEGIN(InheritParam);
4293 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4294 yyextra->currentCmd = cmd;
4295 BEGIN(ExtendsParam);
4301 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4302 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4308 if (!yyextra->spaceBeforeCmd.empty())
4310 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4311 yyextra->spaceBeforeCmd.clear();
4319 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4321 if (!yyextra->spaceBeforeCmd.empty())
4323 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4324 yyextra->spaceBeforeCmd.clear();
4332 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4333 if (yyextra->current->brief.stripWhiteSpace().empty() && yyextra->current->doc.stripWhiteSpace().empty())
4339 if (!yyextra->spaceBeforeCmd.empty())
4341 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4342 yyextra->spaceBeforeCmd.clear();
4345 yyextra->copyDocArg.clear();
4346 yyextra->braceCount = 0;
4355 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4356 yyextra->sectionLabel.clear();
4357 yyextra->sectionTitle.clear();
4358 yyextra->docGroup.clearHeader();
4359 yyextra->insideParBlock =
false;
4366 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4368 return yyextra->current->section.isDoc();
4373 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4374 assert(maker!=
nullptr);
4376 if (yyextra->current->section.isDoc())
4382 yyextra->needNewEntry =
true;
4383 yyextra->current->section = maker();
4384 yyextra->current->fileName = yyextra->fileName;
4385 yyextra->current->startLine = yyextra->lineNr;
4386 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4399 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4400 for(
const char* c = yytext ; *c ; ++c )
4401 yyextra->lineNr += (*c ==
'\n') ;
4409 if (s==
nullptr || *s==0)
return name;
4411 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4422 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4425 DString reqId = yyextra->current->name;
4431 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4436 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4438 yyextra->fileName,yyextra->lineNr,
4447 const DString &listTitle,
bool append,
bool inBody,
int lineNr)
4449 if (listName.
empty())
return;
4457 for (
auto it = current->
sli.rbegin(); it != current->
sli.rend(); ++it)
4477 item = refList->
add();
4483 current->
sli.push_back(item);
4485 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4492 current->
doc += cmdString;
4503 current->
anchors.push_back(si);
4505 else if (si->
lineNr() != -1)
4507 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4512 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4519 current->
anchors.push_back(si);
4529 const DString &listTitle,
bool append)
4531 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4532 addXRefItemToEntry(yyextra->current,yyextra->outputXRef,listName,itemTitle,listTitle,append,yyextra->inBody,yyextra->lineNr);
4533 yyextra->outputXRef.clear();
4541 if (label.
empty())
return;
4543 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4547 for (
size_t i=1; i<label.
size(); i++)
4550 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4565 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4567 DString formula = (yyextra->formulaPreText +
4568 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4576 formLabel.
sprintf(
"\\_form#%d",
id);
4577 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4594 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4602 if (addYYtext) yyextra->sectionTitle+=yytext;
4603 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4604 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4606 yyextra->sectionLevel);
4609 yyextra->current->anchors.push_back(si);
4611 else if (si->
lineNr() != -1)
4613 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4618 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4619 yyextra->sectionLabel,si->
fileName());
4625 if (addYYtext) yyextra->sectionTitle+=yytext;
4626 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4627 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4629 yyextra->sectionLevel);
4632 yyextra->current->anchors.push_back(si);
4641 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4643 if (yytext[0] ==
'"')
4646 name=name.
left((
int)yyleng-2);
4662 if (c==
' ' || c==
'\t' || c==
'\r')
4685 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4686 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4688 yyextra->xrefAppendFlag = !yyextra->inBody &&
4690 yyextra->newXRefKind==yyextra->xrefKind &&
4692 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4708 switch(yyextra->xrefKind)
4735 xrefAppendToPrev || yyextra->current->spec.isDeprAttr()
4740 yyextra->xrefItemTitle,
4741 yyextra->xrefListTitle,
4750 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4752 int oldContext = yyextra->inContext;
4753 yyextra->inContext = ctx;
4755 switch(yyextra->inContext)
4758 if (oldContext!=yyextra->inContext)
4761 if (yyextra->current->doc.empty()) yyextra->current->docLine = yyextra->lineNr;
4762 if (yyextra->current->docFile.empty())
4764 yyextra->current->docFile = yyextra->fileName;
4765 yyextra->current->docLine = yyextra->lineNr;
4768 yyextra->pOutputString = &yyextra->current->doc;
4772 if (oldContext!=yyextra->inContext)
4774 if (yyextra->current->brief.empty()) yyextra->current->briefLine = yyextra->lineNr;
4775 if (yyextra->current->briefFile.empty())
4777 yyextra->current->briefFile = yyextra->fileName;
4778 yyextra->current->briefLine = yyextra->lineNr;
4781 bool foundMatch =
false;
4782 if (yyextra->current->brief.stripWhiteSpace().empty())
4790 std::string str = yyextra->current->brief.str();
4795 for (
size_t i = 0; i < match[2].str().size(); i++)
4797 if (match[2].str()[i] ==
'\n') cnt++;
4801 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4803 yyextra->current->brief +=
" \\iline " +
DString().setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4810 yyextra->pOutputString = &yyextra->current->brief;
4814 if (!yyextra->current->doc.empty())
4816 yyextra->current->doc +=
"\n";
4818 yyextra->pOutputString = &yyextra->current->doc;
4824 yyextra->pOutputString = &yyextra->outputXRef;
4829 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4838 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4846 yyextra->current->anchors.push_back(si);
4848 else if (si->
lineNr() != -1)
4850 warn(yyextra->fileName,yyextra->lineNr,
4851 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4856 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4863 yyextra->current->anchors.push_back(si);
4870 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4872 *yyextra->pOutputString+=s;
4878 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4880 *yyextra->pOutputString+=s;
4886 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4887 *yyextra->pOutputString+=c;
4893 snprintf(cmd,30,
" \\iline %d ",lineNr);
4900 snprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4906 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4907 std::string_view str = yyextra->current->brief.view();
4912 yyextra->briefEndsAtDot=
false;
4914 if (yyextra->current->doc.stripWhiteSpace().empty())
4916 yyextra->current->docLine = yyextra->lineNr;
4917 yyextra->current->doc =
"";
4921 addIline(yyscanner,yyextra->lineNr);
4927 int saveLineNr = yyextra->lineNr;
4929 yyextra->current->briefLine = yyextra->lineNr;
4930 yyextra->lineNr = saveLineNr;
4936 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4937 yyextra->prevPosition=yyextra->inputPosition;
4939 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4941 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4953 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4954 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4955 YY_START==ReadFormulaLong)
4957 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4971 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4979 commentscanYYlex_destroy(
p->yyscanner);
4992 bool &newEntryNeeded,
4993 bool markdownSupport,
4997 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4998 " prot={} markdownSupport={}",
Trace::trunc(comment),fileName,lineNr,isBrief,
4999 isAutoBriefOn,isInbody,prot,markdownSupport);
5001 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5004 yyextra->guards = guards;
5005 yyextra->langParser = parser;
5006 yyextra->current = curEntry;
5007 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
5008 if (comment.
empty())
return false;
5009 yyextra->inputString = comment;
5010 yyextra->inputString.
append(
" ");
5011 yyextra->inputPosition = position;
5012 yyextra->lineNr = lineNr;
5013 yyextra->fileName = fileName;
5014 yyextra->protection = prot;
5015 yyextra->needNewEntry =
false;
5017 yyextra->xrefAppendFlag =
false;
5018 yyextra->insidePre =
false;
5019 yyextra->parseMore =
false;
5020 yyextra->inBody = isInbody;
5021 yyextra->markdownSupport= markdownSupport;
5022 yyextra->outputXRef.clear();
5023 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.empty())
5025 yyextra->current->doc +=
'\n';
5028 yyextra->briefEndsAtDot = isAutoBriefOn;
5029 yyextra->condCount = 0;
5030 yyextra->sectionLevel = 0;
5031 yyextra->spaceBeforeCmd.clear();
5032 yyextra->spaceBeforeIf.clear();
5033 yyextra->htmlContextStack.clear();
5036 if (!yyextra->current->inbodyDocs.empty() && isInbody)
5039 snprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5040 yyextra->current->inbodyDocs+=cmd;
5044 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5047 commentscanYYrestart(
nullptr, yyscanner );
5049 commentscanYYlex(yyscanner);
5052 if (YY_START==OverloadParam)
5057 if (yyextra->insideParBlock)
5059 warn(yyextra->fileName,yyextra->lineNr,
5060 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5066 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.empty())
5069 yyextra->current->doc=
"\n\n";
5072 if (yyextra->current->section.isMemberGrp() &&
5073 yyextra->docGroup.empty())
5075 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5079 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5081 yyextra->current->briefLine,yyextra->current->brief,
5082 yyextra->current->docLine,yyextra->current->doc,
5083 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5087 prot = yyextra->protection;
5089 yyextra->docGroup.addDocs(curEntry);
5091 newEntryNeeded = yyextra->needNewEntry;
5096 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
false;
5098 if (!yyextra->parseMore && !yyextra->guards->empty())
5100 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5103 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5105 lineNr = yyextra->lineNr;
5107 position,yyextra->parseMore,newEntryNeeded);
5109 return yyextra->parseMore;
5114 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5116 bool sectionEnabled =
false;
5121 bool parentEnabled = yyextra->guards->top().parentVisible();
5125 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5126 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5130 yyextra->guards->top().setEnabled(
true);
5131 yyextra->guards->top().setEnabledFound();
5132 BEGIN( GuardParamEnd );
5136 if (yyextra->guards->top().isEnabledFound())
5138 yyextra->guards->top().setEnabled(
false);
5139 BEGIN( SkipGuardedSection );
5141 else if (sectionEnabled)
5143 yyextra->guards->top().setEnabled(
true);
5144 yyextra->guards->top().setEnabledFound();
5145 BEGIN( GuardParamEnd );
5149 yyextra->guards->top().setEnabled(
false);
5150 BEGIN( SkipGuardedSection );
5155 BEGIN( SkipGuardedSection );
5160 BEGIN( SkipGuardedSection );
5166 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5167 yyextra->docGroup.initGroupInfo(entry);
5172 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5173 yyextra->docGroup.enterFile(fileName,lineNr);
5178 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5179 yyextra->docGroup.leaveFile(fileName,lineNr);
5184 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5185 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5190 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5191 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5196 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5197 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5202 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5203 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5213 static reg::Ex deprecated_re(R
"(deprecated\s*(\(\s*\"([^\"]*)\"\s*\))?)");
5219 if (match.size()==3)
5222 DString rawDoc = match[2].str();
5224 std::shared_ptr<Entry> docEntry = std::make_shared<Entry>();
5226 bool newEntryNeeded =
false;
5242 docs = docEntry->doc;
5247 current->
spec.setDeprAttr(
true);
5249 if (!docs.
empty() || !current->
spec.isDeprDoc())
5270#include "commentscan.l.h"
void insert(const DString &label)
Insert a citation identified by label into the database.
static CitationManager & instance()
Copyright (C) 1997-2015 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 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.