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 QCString &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);
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.
This is an alternative implementation of QCString.
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 QCString &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]+" ")?)
694%x ReadFormulaShortSection
696%x ReadFormulaRoundSection
710%x RaiseWarningSection
739<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
742<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
748<Comment>"\""[^"\n]*"\"" {
751<Comment>("\\"[a-z_A-Z]+)+"\\" {
754<Comment>"<"{DETAILEDHTML}{ATTR}">" {
756 int spacePos = htmlOpenTag.find(
' ');
757 if (spacePos==-1) spacePos=yyleng-1;
758 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
760 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
768<Comment>"</"{DETAILEDHTML}">" {
770 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
772 if (!yyextra->htmlContextStack.empty() &&
773 yyextra->htmlContextStack.back().tagName==htmlTagName)
780 yyextra->htmlContextStack.pop_back();
784<Comment>"<"{DETAILEDHTMLOPT}">" {
786 if (yyextra->current->lang==SrcLangExt::CSharp)
788 yyextra->CScode=
true;
798<Comment>"<"{DETAILEDHTMLOPTEND}">" {
802 yyextra->CScode=
false;
806 yyextra->CScode=
false;
811<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
813 if (yyextra->current->lang==SrcLangExt::CSharp)
820<Comment>"<"{DETAILS}{ATTR}">" {
821 yyextra->htmlDetailsStack.push_back(0);
822 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
829<Comment>"</"{DETAILS}">" {
830 if (!yyextra->htmlDetailsStack.empty())
832 yyextra->htmlDetailsStack.pop_back();
834 if (!yyextra->htmlContextStack.empty() &&
835 yyextra->htmlContextStack.back().tagName==
"details")
842 yyextra->htmlContextStack.pop_back();
847 yyextra->htmlAnchorStr = yytext;
848 yyextra->htmlAnchor =
false;
852 yyextra->htmlAnchorStr += yytext;
857 if (c==
'\'' || c==
'"')
859 int e=tag.find(c,s+2);
862 id=tag.mid(s+2,e-s-2);
871 if (!
id.isEmpty() && !yyextra->htmlAnchor)
877 yyextra->htmlAnchor =
true;
880<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
881 yyextra->htmlAnchorStr += yytext;
884 if (!yyextra->htmlAnchor)
886 addOutput(yyscanner,yyextra->htmlAnchorStr);
899 yyextra->htmlAnchorStr += yytext;
900 if (*yytext ==
'\n') yyextra->lineNr++;
903 yyextra->htmlAnchorStr += yytext;
905<Comment>"<"{SUMMARY}">" {
906 if (yyextra->htmlDetailsStack.empty())
915<Comment>"<"{REMARKS}">" {
919<Comment>"</"{SUMMARY}">" {
920 if (!yyextra->htmlDetailsStack.empty())
929<Comment>"</"{REMARKS}">" {
933<Comment>"<"{CAPTION}{ATTR}">" {
935 int s=tag.find(
"id=");
939 if (c==
'\'' || c==
'"')
941 int e=tag.find(c,s+4);
951<Comment>"<"{PRE}{ATTR}">" {
952 yyextra->insidePre=
true;
955<Comment>"</"{PRE}">" {
956 yyextra->insidePre=
false;
966<Comment>"<!\[CDATA\[" {
969<Comment>{B}*{CMD}"endinternal"{B}* {
971 if (!yyextra->inInternalDocs)
972 warn(yyextra->fileName,yyextra->lineNr,
973 "found \\endinternal without matching \\internal"
975 yyextra->inInternalDocs =
false;
#define warn(file, line, fmt,...)
977<Comment>{B}*"\\ilinebr "{B}* {
980<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
990<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
991<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
994 int idx = fullMatch.
find(
'{');
996 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
997 int idxEnd = fullMatch.
find(
"}",idx+1);
1015 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1016 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1019 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1021 yyextra->briefEndsAtDot=
false;
1027 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1032 yyextra->parseMore=
true;
1034 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1037 else if (it->second.handler==
nullptr)
int find(char c, int index=0, bool cs=true) const
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const std::string & str() const
QCString left(size_t len) const
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
1049<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1052<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1059 warn(yyextra->fileName,yyextra->lineNr,
bool isEmpty() const
Returns true iff the string is empty.
#define Config_getEnumAsString(name)
#define Config_isAvailableEnum(name, value)
int qstricmp(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...
1065<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1067 yyextra->formulaText=
"";
1068 yyextra->formulaPreText=
"\\begin";
1069 yyextra->formulaPostText=
"";
1071 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1074 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1076 yyextra->formulaPreText+=yyextra->formulaEnv;
1077 yyextra->formulaNewLines=0;
1078 BEGIN(ReadFormulaLong);
1080<Comment>{B}*{CMD}"f$" {
1081 yyextra->formulaText=
"";
1082 yyextra->formulaPreText=
"$";
1083 yyextra->formulaPostText=
"";
1084 yyextra->formulaNewLines=0;
1085 BEGIN(ReadFormulaShort);
1087<Comment>{B}*{CMD}"f(" {
1088 yyextra->formulaText=
"";
1089 yyextra->formulaPreText=
"";
1090 yyextra->formulaPostText=
"";
1091 yyextra->formulaNewLines=0;
1092 BEGIN(ReadFormulaRound);
1094<Comment>{B}*{CMD}"f[" {
1096 yyextra->formulaText=
"";
1097 yyextra->formulaPreText=
"\\[";
1098 yyextra->formulaPostText=
"";
1099 yyextra->formulaNewLines=0;
1100 BEGIN(ReadFormulaLong);
1102<Comment>{B}*{CMD}"{" {
1104 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1106<Comment>{B}*{CMD}"}" {
1108 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
1109 yyextra->docGroup.clearHeader();
1110 yyextra->parseMore=
true;
1111 yyextra->needNewEntry =
true;
1112 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1115<Comment>{B}*{CMD}[$@\\&~<>#%] {
1118<Comment>[a-z_A-Z]+ {
1121<Comment>^{B}*"."{Bopt}/\n {
1124<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1125<Comment>^{B}*[*+]{B}+ {
1126 if (!yyextra->markdownSupport)
1134 yyextra->briefEndsAtDot=
false;
1140<Comment>^{B}*"-"{B}+ {
1143 yyextra->briefEndsAtDot=
false;
1148<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1151<Comment>{CMD}"---" {
1158 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1161 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1166 yyextra->briefEndsAtDot=
false;
1171<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1172<Comment>("."+)[a-z_A-Z0-9\)] {
1176<Comment>{CMD}[\.?!] {
1180<Comment>".\\"[ \t] {
1187<Comment>"...\\"[ \t] {
1190<Comment>"..."/[^\.] {
1193<Comment>".."[\.]?/[^ \t\n] {
1196<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1202 for (i=0;i<(yy_size_t)yyleng;)
1204 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1205 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1212 for (i=0;i<(yy_size_t)yyleng;)
1214 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1215 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1230 if (yyextra->briefEndsAtDot)
1233 yyextra->briefEndsAtDot=
false;
1238 if (*yytext ==
'\n') yyextra->lineNr++;
1240<Comment>"<"[/]?{TABLEDEL}">" {
1258<HtmlComment>"---"[!]?">"{B}* {
1259 warn(yyextra->fileName,yyextra->lineNr,
1260 "incorrect HTML end comment --->"
1263<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1264<HtmlComment>{DOCNL} {
1271<HtmlComment>[^\\\n\-]+ {
1276<CdataSection>"\]\]>" {
1279<CdataSection>{DOCNL} {
1281 if (*yytext==
'\n') yyextra->lineNr++;
1283<CdataSection>[<>&] {
1287<CdataSection>[^\\\n\]<>&]+ {
1296<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1297 yyextra->formulaPostText+=
"$";
1300 if (YY_START == ReadFormulaShort)
1306 yyextra->sectionTitle+=
" "+form;
1307 BEGIN(SectionTitle);
1310<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1313 if (YY_START == ReadFormulaRound)
1319 yyextra->sectionTitle+=
" "+form;
1320 BEGIN(SectionTitle);
1323<ReadFormulaLong>{CMD}"f]" {
1324 yyextra->formulaPostText+=
"\\]";
1328<ReadFormulaLong>{CMD}"f}" {
1329 yyextra->formulaPostText+=
"\\end";
1330 yyextra->formulaPostText+=yyextra->formulaEnv;
1334<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1335 yyextra->formulaText+=yytext;
1337<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1338 yyextra->formulaNewLines++;
1339 yyextra->formulaText+=*yytext;
1341 addIline(yyscanner,yyextra->lineNr);
1343<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1344 yyextra->formulaText+=*yytext;
1349<EnumDocArg1>{SCOPEID} {
1351 yyextra->current->name = yytext;
1358<EnumDocArg1>{DOCNL} {
1359 warn(yyextra->fileName,yyextra->lineNr,
1360 "missing argument after '\\enum'."
1370<NameSpaceDocArg1>{SCOPENAME} {
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
QCString removeRedundantWhiteSpace(const QCString &s)
1376<NameSpaceDocArg1>{LC} {
1380<NameSpaceDocArg1>{DOCNL} {
1381 warn(yyextra->fileName,yyextra->lineNr,
1382 "missing argument after '\\namespace'."
1387<NameSpaceDocArg1>. {
1392<PackageDocArg1>{ID}("."{ID})* {
1393 yyextra->current->name = yytext;
1396<PackageDocArg1>{LC} {
1400<PackageDocArg1>{DOCNL} {
1401 warn(yyextra->fileName,yyextra->lineNr,
1402 "missing argument after \\package."
1414<ConceptDocArg1>{SCOPEID} {
1416 yyextra->current->name = yytext;
1419<ConceptDocArg1>{LC} {
1423<ConceptDocArg1>{DOCNL} {
1424 warn(yyextra->fileName,yyextra->lineNr,
1425 "missing argument after '\\concept'."
1434<ModuleDocArg1>{MODULE_ID} {
1436 yyextra->current->name = yytext;
1439<ModuleDocArg1>{LC} {
1443<ModuleDocArg1>{DOCNL} {
1444 warn(yyextra->fileName,yyextra->lineNr,
1445 "missing argument after '\\module'."
1455<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1459 BEGIN( ClassDocArg2 );
1461<ClassDocArg1>{SCOPENAME} {
1464 yyextra->current->name =
substitute(yytext,
".",
"::");
1465 if (yyextra->current->section.isProtocolDoc())
1467 yyextra->current->name+=
"-p";
1470 BEGIN( ClassDocArg2 );
1472<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1475 yyextra->current->name =
substitute(yytext,
".",
"::");
1476 BEGIN( ClassDocArg2 );
1478<ClassDocArg1,CategoryDocArg1>{LC} {
1482<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1483 warn(yyextra->fileName,yyextra->lineNr,
1484 "missing argument after '\\{}'.",yyextra->currentCmd
1489<ClassDocArg1,CategoryDocArg1>. {
1492<ClassDocArg2>{DOCNL} {
1496<ClassDocArg2>{FILE}|"<>" {
1497 yyextra->current->includeFile = yytext;
1498 BEGIN( ClassDocArg3 );
1507<ClassDocArg3>[<"]?{FILE}?[">]? {
1508 yyextra->current->includeName = yytext;
1515<ClassDocArg3>{DOCNL} {
1525<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1526 yyextra->current->name = yytext;
1530 if (yyextra->current->name.endsWith(
".html"))
1532 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1534 else if (yyextra->current->name.endsWith(
".xhtml"))
1536 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1538 yyextra->current->type.clear();
1539 BEGIN(GroupDocArg2);
1541<GroupDocArg1>"\\"{B}*"\n" {
1545<GroupDocArg1>{DOCNL} {
1546 warn(yyextra->fileName,yyextra->lineNr,
1547 "missing group name after {}",
1548 yyextra->current->groupDocCmd()
1557<GroupDocArg2>"\\"{B}*"\n" {
1561<GroupDocArg2>[^\n\\]+ {
1562 yyextra->current->type += yytext;
1564<GroupDocArg2>{DOCNL}+ {
1565 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1567 yyextra->current->type.isEmpty()
1570 warn(yyextra->fileName,yyextra->lineNr,
1571 "missing title after "
1572 "\\defgroup {}", yyextra->current->name
1576 int extraLineNr = 0;
1579 for (
int i = 0; i < yyleng; i++)
1581 if (yytext[i]==
'\n') extraLineNr++;
1588 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1589 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1594 yyextra->current->type += yytext;
1599<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1603 int start = text.
find(
'{');
1604 int end = text.
find(
'}',start+1);
1605 yyextra->current->name = text.
mid(
end+2);
1606 int istart = yyextra->current->name.
find(
"\\ilinebr");
1609 QCString rest = yyextra->current->name.
mid(istart);
1611 yyextra->current->name = yyextra->current->name.mid(0,istart);
1613 yyextra->current->args = text.
mid(start+1,
end-start-1);
1615 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1617<PageDocArg1>{FILE} {
1619 yyextra->current->args =
"";
1620 BEGIN( PageDocArg2 );
1622<PageDocArg1>{LC} { yyextra->lineNr++;
1625<PageDocArg1>{DOCNL} {
1626 warn(yyextra->fileName,yyextra->lineNr,
1627 "missing argument after \\page."
1636<PageDocArg2>{DOCNL} {
1640 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1641 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1644<PageDocArg2>{CMD}[<>] {
1649 yyextra->current->args += tmp;
1652 yyextra->current->args += yytext;
1655<ParamArg1>{ID}/{B}*"," {
1662 if (*yytext==
'\n') yyextra->lineNr++;
1676<FileDocArg1>{DOCNL} {
1682<FileDocArg1>{FILE} {
1686<FileDocArg1>{LC} { yyextra->lineNr++;
1694<XRefItemParam1>{LABELID} {
1695 yyextra->newXRefItemKey=yytext;
1697 BEGIN(XRefItemParam2);
1699<XRefItemParam1>{LC} {
1703<XRefItemParam1>{DOCNL} {
1704 warn(yyextra->fileName,yyextra->lineNr,
1705 "Missing first argument of \\xrefitem"
1707 if (*yytext==
'\n') yyextra->lineNr++;
1715<XRefItemParam2>"\""[^\n\"]*"\"" {
1717 BEGIN(XRefItemParam3);
1719<XRefItemParam2>{LC} {
1723<XRefItemParam2>{DOCNL} {
1724 warn(yyextra->fileName,yyextra->lineNr,
1725 "Missing second argument of \\xrefitem"
1727 if (*yytext==
'\n') yyextra->lineNr++;
1735<XRefItemParam3>"\""[^\n\"]*"\"" {
1740<XRefItemParam2,XRefItemParam3>{LC} {
1744<XRefItemParam3>{DOCNL} {
1745 warn(yyextra->fileName,yyextra->lineNr,
1746 "Missing third argument of \\xrefitem"
1748 if (*yytext==
'\n') yyextra->lineNr++;
1759<RelatesParam1>({ID}("::"|"."))*{ID} {
1760 yyextra->current->relates = yytext;
1767<RelatesParam1>{LC} {
1771<RelatesParam1>{DOCNL} {
1772 warn(yyextra->fileName,yyextra->lineNr,
1773 "Missing argument of '\\{}' command",yyextra->currentCmd
1785<Qualifier>{LABELID} {
1786 yyextra->current->qualifiers.emplace_back(yytext);
1789<Qualifier>"\""[^\"]*"\"" {
1790 std::string inp(yytext);
1791 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1795 warn(yyextra->fileName,yyextra->lineNr,
1796 "Missing argument of '\\{}' command",yyextra->currentCmd
1802 warn(yyextra->fileName,yyextra->lineNr,
1803 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1809<ILine>{LINENR}/[\\@\n\.] |
1815 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1819 yyextra->lineNr = nr;
1822 if (YY_START == ILine)
1828 yyextra->sectionTitle+=yytext;
1829 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1832<ILine,ILineSection>. {
1834 if (YY_START == ILine)
1840 yyextra->sectionTitle+=yytext;
1841 BEGIN(SectionTitle);
1846<IRaise>{B}*[0-9]+/[\\@\n\.] |
1847<IRaise>{B}*[0-9]+{B} {
1852 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1856 yyextra->raiseLevel = nr;
1866<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1880<IFile,IFileSection>{FILE} {
1883 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1884 else yyextra->fileName = yytext;
1885 if (YY_START == IFile)
1891 yyextra->sectionTitle+=yytext;
1892 BEGIN(SectionTitle);
1896<LinkSection>[^\\@\n]* {
1897 yyextra->sectionTitle+=yytext;
1899<LinkSection>{CMD}{CMD} {
1900 yyextra->sectionTitle+=yytext;
1902<LinkSection>{DOCNL} {
1904 if (*yytext ==
'\n') yyextra->lineNr++;
1905 yyextra->sectionTitle+=yytext;
1907<LinkSection>{CMD}"endlink" {
1908 yyextra->sectionTitle+=yytext;
1909 BEGIN(SectionTitle);
1912 yyextra->sectionTitle+=yytext;
1914<LinkSection><<EOF>> {
1915 warn(yyextra->fileName,yyextra->lineNr,
1916 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1922<LineParam>{CMD}{CMD} {
1935<LineParam>({CMD}{CMD}){ID} {
1944<SectionLabel>{LABELID} {
1945 yyextra->sectionLabel+=yytext;
1947<SectionLabel>{CMD}"lineinfo"("{}")? {
QCString & setNum(short n)
1950<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1951 FileInfo fi(yyextra->fileName.str());
1952 bool hasOption =
false;
1954 if (yytext[yyleng-1] ==
'}')
1960 for (
const auto &opt_ : optList)
1963 std::string opt = optStripped.
lower().
str();
1969 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1979 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1991 label=yyextra->fileName;
1995 yyextra->sectionLabel+=label;
#define Config_getBool(name)
QCString stripFromPath(const QCString &path)
1997<SectionLabel>{DOCNL} {
1998 yyextra->sectionTitle.clear();
1999 if (yyextra->sectionLabel.isEmpty())
2001 warn(yyextra->fileName,yyextra->lineNr,
2002 "\\section command has no label"
2007 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2008 addOutput(yyscanner,yyextra->sectionLabel.data());
2011 if (*yytext==
'\n') yyextra->lineNr++;
2016 if (yyextra->sectionLabel.isEmpty())
2018 warn(yyextra->fileName,yyextra->lineNr,
2019 "Invalid or missing section label"
2025 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2026 addOutput(yyscanner,yyextra->sectionLabel.data());
2027 yyextra->sectionTitle.clear();
2029 BEGIN(SectionTitle);
2032<SectionTitle>{STAopt}/"\n" {
2037<SectionTitle>{STopt}"\\\\ilinebr" {
2038 yyextra->sectionTitle+=yytext;
2040<SectionTitle>{STopt}/"\\ilinebr" {
2045<SectionTitle>{B}*{CMD}"f$" {
2046 yyextra->formulaText=
"";
2047 yyextra->formulaPreText=
"$";
2048 yyextra->formulaPostText=
"";
2049 yyextra->formulaNewLines=0;
2050 BEGIN(ReadFormulaShortSection);
2052<SectionTitle>{B}*{CMD}"f(" {
2053 yyextra->formulaText=
"";
2054 yyextra->formulaPreText=
"";
2055 yyextra->formulaPostText=
"";
2056 yyextra->formulaNewLines=0;
2057 BEGIN(ReadFormulaRoundSection);
2059<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2060<SectionTitle>{B}*{CMD}"f"[\[{] {
2064 warn(yyextra->fileName,yyextra->lineNr,
2065 "'\\{}' command is not allowed in section title, ending section title.",
2075<SectionTitle>[^\n@\\]* {
2076 yyextra->sectionTitle+=yytext;
2079<SectionTitle>{B}*{CMD}{CMD} {
2080 yyextra->sectionTitle+=yytext;
2083<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2084<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2086 int idx = fullMatch.
find(
'{');
2088 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2089 int idxEnd = fullMatch.
find(
"}",idx+1);
2105 switch (it->second.sectionHandling)
2110 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2111 yyextra->sectionTitle+=fullMatch.
left(i);
2112 yyextra->sectionTitle+=
'@';
2113 yyextra->sectionTitle+=fullMatch.
mid(i);
2117 warn(yyextra->fileName,yyextra->lineNr,
2118 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2126 warn(yyextra->fileName,yyextra->lineNr,
2127 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2135 if (cmdName ==
"fileinfo")
2138 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2139 yyextra->sectionTitle+=fullMatch.
left(i);
2144 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2149 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2153 else if (cmdName ==
"lineinfo")
2156 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2157 yyextra->sectionTitle+=fullMatch.
left(i);
2159 yyextra->sectionTitle+=
' ';
2160 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2166 else if (cmdName ==
"raisewarning")
2168 yyextra->raiseWarning =
"";
2169 BEGIN(RaiseWarningSection);
2171 else if (cmdName ==
"noop")
2176 else if (cmdName ==
"cite")
2178 yyextra->sectionTitle+=yytext;
2180 BEGIN(CiteLabelSection);
2182 else if (cmdName ==
"iline")
2184 yyextra->sectionTitle+=yytext;
2186 BEGIN(ILineSection);
2188 else if (cmdName ==
"ifile")
2190 yyextra->sectionTitle+=yytext;
2192 BEGIN(IFileSection);
2194 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2197 if (optList.empty())
2199 yyextra -> anchorTitle =
"";
2204 yyextra -> anchorTitle =
join(optList,
" ");
2207 BEGIN(AnchorLabelSection);
2209 else if (cmdName ==
"link")
2211 yyextra->sectionTitle+=yytext;
2216 yyextra->sectionTitle+=yytext;
2217 warn(yyextra->fileName,yyextra->lineNr,
2218 "internal error '\\{}' command is to be replaced in section title.",cmdName
2225 yyextra->sectionTitle+=yytext;
2233 yyextra->sectionTitle+=yytext;
const char * qPrint(const char *s)
std::string join(const StringVector &sv, const std::string &delimiter)
create a string where the string in the vector are joined by the given delimiter
2238 yyextra->sectionTitle+=yytext;
2244<SubpageLabel>{FILE} {
2248 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2249 BEGIN(SubpageTitle);
2251<SubpageLabel>{DOCNL} {
2252 warn(yyextra->fileName,yyextra->lineNr,
2253 "\\subpage command has no label"
2255 if (*yytext==
'\n') yyextra->lineNr++;
2263<SubpageTitle>{DOCNL} {
2267<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2278<AnchorLabel,AnchorLabelSection>{LABELID} {
2279 QCString lbl = yyextra->raisePrefix+yytext;
2280 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2282 if (YY_START == AnchorLabel)
2288 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2291<AnchorLabel,AnchorLabelSection>{DOCNL} {
2292 warn(yyextra->fileName,yyextra->lineNr,
2293 "\\anchor command has no label"
2295 if (*yytext==
'\n') yyextra->lineNr++;
2297 if (YY_START == AnchorLabel)
2303 BEGIN(SectionTitle);
2306<AnchorLabel,AnchorLabelSection>. {
2307 warn(yyextra->fileName,yyextra->lineNr,
2308 "Invalid or missing anchor label"
2311 if (YY_START == AnchorLabel)
2317 BEGIN(SectionTitle);
2323<RequirementLabel>{REQID} {
2324 yyextra->current->name = yytext;
2325 yyextra->current->type.clear();
2326 BEGIN( RequirementTitle );
2328<SatisfiesLabel>{REQID} {
2329 yyextra->reqId = yytext;
2330 yyextra->reqTitle.clear();
2331 BEGIN( SatisfiesTitle );
2333<VerifiesLabel>{REQID} {
2334 yyextra->reqId = yytext;
2335 yyextra->reqTitle.clear();
2336 BEGIN( VerifiesTitle );
2338<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2342<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2343 warn(yyextra->fileName,yyextra->lineNr,
2344 "missing requirement ID after \\requirement command"
2349<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2352<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2356<RequirementTitle>[^\n\\]+ {
2357 yyextra->current->type += yytext;
2359<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2360 yyextra->reqTitle += yytext;
2362<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2363 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2368<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2369 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2371 if (yyextra->current->section.isRequirementDoc())
2373 warn(yyextra->fileName,yyextra->lineNr,
2374 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2387<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2388 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2390 if (yyextra->current->section.isRequirementDoc())
2392 warn(yyextra->fileName,yyextra->lineNr,
2393 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2406<RequirementTitle>. {
2407 yyextra->current->type += yytext;
2409<SatisfiesTitle,VerifiesTitle>. {
2410 yyextra->reqTitle += yytext;
2416<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2418 if (&yytext[4]==yyextra->blockName)
2423<FormatBlock>{CMD}"enduml" {
2425 if (yyextra->blockName==
"startuml")
2430<FormatBlock>[^ \@\*\/\\\n]* {
2433<FormatBlock>{DOCNL} {
2434 if (*yytext==
'\n') yyextra->lineNr++;
2438 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2439 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2440 yyextra->blockName==
"iliteral"
2442 ) yyextra->commentCount++;
2447 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2448 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2449 yyextra->blockName==
"iliteral"
2453 yyextra->commentCount--;
2454 if (yyextra->commentCount<0)
2456 QCString endTag =
"end"+yyextra->blockName;
2457 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2458 warn(yyextra->fileName,yyextra->lineNr,
2459 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2460 yyextra->blockName,endTag);
2467<FormatBlock><<EOF>> {
2468 QCString endTag =
"end"+yyextra->blockName;
2469 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2470 warn(yyextra->fileName,yyextra->lineNr,
2471 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2472 yyextra->blockName,endTag
2479<GuardParam>{B}*"(" {
2480 yyextra->guardExpr=yytext;
2481 yyextra->roundCount=1;
2485 yyextra->guardExpr+=yytext;
2489 yyextra->guardExpr+=yytext;
2490 yyextra->roundCount++;
2493 yyextra->guardExpr+=yytext;
2494 yyextra->roundCount--;
2495 if (yyextra->roundCount==0)
2501 warn(yyextra->fileName,yyextra->lineNr,
2502 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2506<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2509<GuardParam>{DOCNL} {
2524<GuardParamEnd>{B}*{DOCNL} {
2526 yyextra->spaceBeforeIf.clear();
2530<GuardParamEnd>{B}* {
2531 if (!yyextra->spaceBeforeIf.isEmpty())
2533 addOutput(yyscanner,yyextra->spaceBeforeIf);
2535 yyextra->spaceBeforeIf.clear();
2547<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2549 yyextra->guards->emplace(
false);
2550 BEGIN( GuardParam );
2552<SkipGuardedSection>{CMD}"if"/{NW} {
2554 yyextra->guards->emplace(
false);
2555 BEGIN( GuardParam );
2557<SkipGuardedSection>{CMD}"endif"/{NW} {
2558 if (yyextra->guards->empty())
2560 warn(yyextra->fileName,yyextra->lineNr,
2561 "found \\endif without matching start command");
2566 yyextra->guards->pop();
2567 if (yyextra->guards->empty())
2569 BEGIN( GuardParamEnd );
2573 if (yyextra->guards->top().isEnabled())
2575 BEGIN( GuardParamEnd );
2579 BEGIN( SkipGuardedSection );
2584<SkipGuardedSection>{CMD}"else"/{NW} {
2585 if (yyextra->guards->empty())
2587 warn(yyextra->fileName,yyextra->lineNr,
2588 "found \\else without matching start command");
2590 else if (yyextra->guards->top().hasElse())
2592 warn(yyextra->fileName,yyextra->lineNr,
2593 "found multiple \\else commands in same \\if construct");
2594 yyextra->guards->top().setEnabled(
false);
2595 BEGIN( SkipGuardedSection );
2597 else if (!yyextra->guards->top().parentVisible())
2599 yyextra->guards->top().setEnabled(
false);
2600 BEGIN( SkipGuardedSection );
2604 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2605 yyextra->guards->top().setElse();
2606 if (!yyextra->guards->top().parentVisible())
2608 yyextra->guards->top().setEnabled(
false);
2609 BEGIN( SkipGuardedSection );
2611 else if (yyextra->guards->top().isEnabledFound())
2613 yyextra->guards->top().setEnabled(
false);
2614 BEGIN( SkipGuardedSection );
2618 yyextra->guards->top().setEnabled(
true);
2619 BEGIN( GuardParamEnd );
2623<SkipGuardedSection>{CMD}"elseif"/{NW} {
2624 if (yyextra->guards->empty())
2626 warn(yyextra->fileName,yyextra->lineNr,
2627 "found \\elseif without matching start command");
2629 else if (yyextra->guards->top().hasElse())
2631 warn(yyextra->fileName,yyextra->lineNr,
2632 "found \\elseif command after \\else command was given in \\if construct");
2634 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2635 yyextra->guards->top().setEnabled(
false);
2636 BEGIN( GuardParam );
2641 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2642 yyextra->guards->top().setEnabled(
false);
2643 BEGIN( GuardParam );
2646<SkipGuardedSection>{DOCNL} {
2647 if (*yytext==
'\n') yyextra->lineNr++;
2650<SkipGuardedSection>[^ \\@\n]+ {
2652<SkipGuardedSection>{CMD}{CMD} |
2653<SkipGuardedSection>. {
2659<SkipInternal>{DOCNL} {
2660 if (*yytext==
'\n') yyextra->lineNr++;
2663<SkipInternal>{CMD}"if"/[ \t] {
2664 yyextra->condCount++;
2666<SkipInternal>{CMD}"ifnot"/[ \t] {
2667 yyextra->condCount++;
2669<SkipInternal>{CMD}/"endif" {
2670 yyextra->condCount--;
2671 if (yyextra->condCount<0)
2677<SkipInternal>{CMD}/"section"[ \t] {
2678 if (yyextra->sectionLevel>0)
2684<SkipInternal>{CMD}/"subsection"[ \t] {
2685 if (yyextra->sectionLevel>1)
2691<SkipInternal>{CMD}/"subsubsection"[ \t] {
2692 if (yyextra->sectionLevel>2)
2698<SkipInternal>{CMD}/"paragraph"[ \t] {
2699 if (yyextra->sectionLevel>3)
2705<SkipInternal>{CMD}/"subparagraph"[ \t] {
2706 if (yyextra->sectionLevel>4)
2712<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2713 if (yyextra->sectionLevel>5)
2719<SkipInternal>{CMD}"endinternal"[ \t]* {
2722<SkipInternal>[^ \\@\n]+ {
2739 yyextra->docGroup.appendHeader(
' ');
2742 yyextra->docGroup.appendHeader(*yytext);
2743 yyextra->current->name+=*yytext;
2758<RaiseWarning,RaiseWarningSection>{DOCNL} {
2760 "{}",yyextra->raiseWarning);
2761 yyextra->raiseWarning =
"";
2762 if (*yytext==
'\n') yyextra->lineNr++;
2764 if (YY_START == RaiseWarning)
2770 yyextra->sectionTitle+=yytext;
2771 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2774<RaiseWarning,RaiseWarningSection>. {
2775 yyextra->raiseWarning += yytext;
2779<InGroupParam>{LABELID} {
2780 yyextra->current->groups.emplace_back(
2783 yyextra->inGroupParamFound=
true;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2785<InGroupParam>{DOCNL} {
2786 if (!yyextra->inGroupParamFound)
2788 warn(yyextra->fileName,yyextra->lineNr,
2789 "Missing group name for \\ingroup command"
2808 if (yyextra->braceCount==0)
2810 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2812 warn(yyextra->fileName,yyextra->lineNr,
2813 "missing argument after '\\{}'.",yyextra->currentCmd
2819 yyextra->langParser->parsePrototype(yyextra->functionProto);
2827 yyextra->functionProto+=
' ';
2829<FnParam>[^@\\\n()]+ {
2830 yyextra->functionProto+=yytext;
2833 yyextra->functionProto+=yytext;
2834 yyextra->braceCount++;
2837 yyextra->functionProto+=yytext;
2838 yyextra->braceCount--;
2841 yyextra->functionProto+=*yytext;
2848<OverloadParam>{DOCNL} {
2849 if (*yytext==
'\n') yyextra->lineNr++;
2850 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2858 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2862<OverloadParam>{LC} {
2864 yyextra->functionProto+=
' ';
2867 yyextra->functionProto+=*yytext;
2872<InheritParam>({ID}("::"|"."))*{ID} {
2873 yyextra->current->extends.emplace_back(
2878<InheritParam>{DOCNL} {
2879 warn(yyextra->fileName,yyextra->lineNr,
2880 "\\inherit command has no argument"
2882 if (*yytext==
'\n') yyextra->lineNr++;
2887 warn(yyextra->fileName,yyextra->lineNr,
2888 "Invalid or missing name for \\inherit command"
2895<ExtendsParam>({ID}("::"|"."))*{ID} {
2896 yyextra->current->extends.emplace_back(
2901<ExtendsParam>{DOCNL} {
2902 warn(yyextra->fileName,yyextra->lineNr,
2903 "'\\{}' command has no argument",yyextra->currentCmd
2915<SkipLang>{CMD}"~"[a-zA-Z-]* {
2919 warn(yyextra->fileName,yyextra->lineNr,
2928<SkipLang>[^*@\\\n]* {
2931 if (*yytext==
'\n') yyextra->lineNr++;
2938<CiteLabel,CiteLabelSection>{CITEID} {
2941 if (YY_START == CiteLabel)
2947 yyextra->sectionTitle+=yytext;
2948 BEGIN(SectionTitle);
2951<CiteLabel,CiteLabelSection>{DOCNL} {
2952 warn(yyextra->fileName,yyextra->lineNr,
2953 "\\cite command has no label"
2957 if (YY_START == CiteLabel)
2964 yyextra->sectionTitle+=yytext;
2966 BEGIN(SectionTitle);
2969<CiteLabel,CiteLabelSection>. {
2970 warn(yyextra->fileName,yyextra->lineNr,
2971 "Invalid or missing cite label"
2973 if (YY_START == CiteLabel)
2979 yyextra->sectionTitle+=yytext;
2980 BEGIN(SectionTitle);
2988 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2989 addOutput(yyscanner,yyextra->copyDocArg);
2993<CopyDoc>"<"[/]?{TABLEDEL}">" {
2994 if (yyextra->braceCount==0)
2997 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2998 addOutput(yyscanner,yyextra->copyDocArg);
3004 if (*yytext==
'\n') yyextra->lineNr++;
3005 if (yyextra->braceCount==0)
3008 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3009 addOutput(yyscanner,yyextra->copyDocArg);
3017<CopyDoc>[^@\\\n()<]+ {
3018 yyextra->copyDocArg+=yytext;
3022 yyextra->copyDocArg+=yytext;
3024 yyextra->braceCount++;
3027 yyextra->copyDocArg+=yytext;
3029 yyextra->braceCount--;
3032 yyextra->copyDocArg+=yytext;
3054 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3055 yyextra->braceCount=0;
3056 yyextra->functionProto.clear();
3057 yyextra->currentCmd = cmd;
3058 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3065 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3066 yyextra->functionProto.clear();
3067 yyextra->braceCount=0;
3068 yyextra->currentCmd = cmd;
3069 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3076 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3077 yyextra->functionProto.clear();
3078 BEGIN(OverloadParam);
3084 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3085 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3086 BEGIN( EnumDocArg1 );
3092 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3095 BEGIN( GroupDocArg1 );
3101 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3104 BEGIN( GroupDocArg1 );
3110 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3113 BEGIN( GroupDocArg1 );
3119 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3120 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3121 BEGIN( NameSpaceDocArg1 );
3127 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3129 BEGIN( PackageDocArg1 );
3135 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3136 yyextra->currentCmd = cmd;
3137 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3138 BEGIN( ClassDocArg1 );
3144 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3145 yyextra->currentCmd = cmd;
3146 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3147 BEGIN( ConceptDocArg1 );
3153 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3154 yyextra->currentCmd = cmd;
3155 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3156 BEGIN( ModuleDocArg1 );
3162 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3163 BEGIN( ClassDocArg2 );
3169 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3170 yyextra->currentCmd = cmd;
3171 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3172 BEGIN( ClassDocArg1 );
3178 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3179 yyextra->currentCmd = cmd;
3180 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3181 BEGIN( CategoryDocArg1 );
3187 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3188 yyextra->currentCmd = cmd;
3189 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3190 BEGIN( ClassDocArg1 );
3196 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3197 yyextra->currentCmd = cmd;
3198 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3199 BEGIN( ClassDocArg1 );
3205 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3206 yyextra->currentCmd = cmd;
3207 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3208 BEGIN( ClassDocArg1 );
3214 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3215 yyextra->currentCmd = cmd;
3216 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3217 BEGIN( ClassDocArg1 );
3223 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3225 BEGIN( PageDocArg1 );
3231 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3235 yyextra->current->name =
"mainpage";
3238 BEGIN( PageDocArg2 );
3244 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3248 yyextra->current->name = yyextra->fileName;
3250 BEGIN( FileDocArg1 );
3256 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3266 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3274 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3276 if (!stop) yyextra->current->name = yyextra->fileName;
3277 BEGIN( FileDocArg1 );
3283 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3285 for (
const auto &opt : optList)
3289 sectionMaker=EntryType::makeExampleLineno;
3293 warn(yyextra->fileName,yyextra->lineNr,
3294 "unsupported option '{}' for command '\\{}'",opt,cmd);
3298 if (!stop) yyextra->current->name = yyextra->fileName;
3299 BEGIN( FileDocArg1 );
3305 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3308 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3317 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3318 yyextra->raiseWarning =
"";
3319 BEGIN( RaiseWarning );
3325 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3332 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3336 yyextra->docGroup.clearHeader();
3338 if (!yyextra->docGroup.isEmpty())
3340 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
true,
true);
3348 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3357 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3366 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3375 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3379 yyextra->current->spec.setDeprDoc(
true);
3385 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3387 BEGIN(XRefItemParam1);
3393 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3394 if (yyextra->insideParBlock)
3396 warn(yyextra->fileName,yyextra->lineNr,
3397 "found \\parblock command while already in a parblock!");
3399 if (!yyextra->spaceBeforeCmd.isEmpty())
3401 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3402 yyextra->spaceBeforeCmd.clear();
3405 yyextra->insideParBlock =
true;
3411 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3412 if (!yyextra->insideParBlock)
3414 warn(yyextra->fileName,yyextra->lineNr,
3415 "found \\endparblock command without matching \\parblock!");
3419 yyextra->insideParBlock =
false;
3425 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3426 if (!yyextra->current->relates.isEmpty())
3428 warn(yyextra->fileName,yyextra->lineNr,
3429 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3431 yyextra->current->relatesType = RelatesType::Simple;
3432 yyextra->currentCmd = cmd;
3433 BEGIN(RelatesParam1);
3439 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3440 if (!yyextra->current->relates.isEmpty())
3442 warn(yyextra->fileName,yyextra->lineNr,
3443 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3445 yyextra->current->relatesType = RelatesType::Duplicate;
3446 yyextra->currentCmd = cmd;
3447 BEGIN(RelatesParam1);
3453 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3454 if (!yyextra->current->relates.isEmpty())
3456 warn(yyextra->fileName,yyextra->lineNr,
3457 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3459 yyextra->current->relatesType = RelatesType::MemberOf;
3460 yyextra->currentCmd = cmd;
3461 BEGIN(RelatesParam1);
3467 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3475 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3478 BEGIN(SectionLabel);
3479 yyextra->sectionLabel.clear();
3488 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3490 switch (yyextra->sectionLevel)
3498 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3505 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3507 BEGIN( RequirementLabel );
3513 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3514 BEGIN( SatisfiesLabel );
3520 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3521 BEGIN( VerifiesLabel );
3527 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3528 if (!yyextra->current->section.isEmpty() &&
3529 !yyextra->current->section.isPageDoc() &&
3530 !yyextra->current->section.isMainpageDoc()
3533 warn(yyextra->fileName,yyextra->lineNr,
3534 "found \\subpage command in a comment block that is not marked as a page!");
3536 if (!yyextra->spaceBeforeCmd.isEmpty())
3538 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3539 yyextra->spaceBeforeCmd.clear();
3542 BEGIN(SubpageLabel);
3548 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3550 if (optList.empty())
3552 yyextra -> anchorTitle =
"";
3556 yyextra -> anchorTitle =
join(optList,
" ");
3564 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3565 for (
const auto &opt : optList)
3575 if (optList.empty())
3589 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3590 if (!yyextra->spaceBeforeCmd.isEmpty())
3592 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3593 yyextra->spaceBeforeCmd.clear();
3595 if (optList.empty())
3609 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3610 if (!yyextra->spaceBeforeCmd.isEmpty())
3612 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3613 yyextra->spaceBeforeCmd.clear();
3619 if (optList.empty())
3628 yyextra->blockName=s;
3629 yyextra->commentCount=0;
3636 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3644 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3662 static std::unordered_map<std::string,OptionFunc> options =
3665 {
"name", [](
const FileInfo &fi_) ->
QCString {
return fi_.baseName(); } },
3666 {
"extension", [](
const FileInfo &fi_) ->
QCString {
return fi_.extension(
true); } },
3667 {
"filename", [](
const FileInfo &fi_) ->
QCString {
return fi_.fileName(); } },
3668 {
"directory", [](
const FileInfo &fi_) ->
QCString {
return fi_.dirPath(); } },
3669 {
"full", [](
const FileInfo &fi_) ->
QCString {
return fi_.absFilePath(); } }
3671 auto it = options.
find(optionName);
3672 return (it!=options.end()) ? it->second(fi) :
QCString();
3677 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3678 if (!yyextra->spaceBeforeCmd.isEmpty())
3680 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3681 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3682 yyextra->spaceBeforeCmd.clear();
3685 FileInfo fi(yyextra->fileName.str());
3686 for (
const auto &opt_ : optList)
3689 std::string opt = optStripped.
lower().
str();
3695 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3702 yyextra->sectionTitle+=result;
3709 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3716 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3721 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3730 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3731 if (!yyextra->spaceBeforeCmd.isEmpty())
3733 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3734 yyextra->spaceBeforeCmd.clear();
3742 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3750 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3758 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3765 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3767 BEGIN(IRaisePrefix);
3773 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3775 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3776 if (yyextra->guards->empty())
3778 yyextra->guards->emplace(
true);
3782 bool enabled = yyextra->guards->top().isEnabled();
3783 yyextra->guards->emplace(enabled);
3791 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3793 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3794 if (yyextra->guards->empty())
3796 yyextra->guards->emplace(
true);
3800 bool enabled = yyextra->guards->top().isEnabled();
3801 yyextra->guards->emplace(enabled);
3809 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3810 if (yyextra->guards->empty())
3812 warn(yyextra->fileName,yyextra->lineNr,
3813 "found \\elseif without matching start command");
3815 else if (yyextra->guards->top().hasElse())
3817 warn(yyextra->fileName,yyextra->lineNr,
3818 "found \\elseif command after \\else command was given in \\if construct");
3820 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3821 yyextra->guards->top().setEnabled(
false);
3827 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3828 yyextra->guards->top().setEnabled(
false);
3836 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3837 if (yyextra->guards->empty())
3839 warn(yyextra->fileName,yyextra->lineNr,
3840 "found \\else without matching start command");
3842 else if (yyextra->guards->top().hasElse())
3844 warn(yyextra->fileName,yyextra->lineNr,
3845 "found multiple \\else commands in same \\if construct");
3846 yyextra->guards->top().setEnabled(
false);
3847 yyextra->guards->top().setElse();
3848 BEGIN( SkipGuardedSection );
3852 yyextra->guards->top().setElse();
3853 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3854 if (yyextra->guards->top().isEnabledFound())
3856 yyextra->guards->top().setEnabled(
false);
3857 BEGIN( SkipGuardedSection );
3861 yyextra->guards->top().setEnabled(
true);
3862 BEGIN( GuardParamEnd );
3870 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3871 if (yyextra->guards->empty())
3873 warn(yyextra->fileName,yyextra->lineNr,
3874 "found \\endif without matching start command");
3878 yyextra->guards->pop();
3880 if (!yyextra->spaceBeforeCmd.isEmpty())
3882 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3883 yyextra->spaceBeforeCmd.clear();
3885 if (yyextra->guards->empty())
3887 BEGIN( GuardParamEnd );
3891 if (yyextra->guards->top().isEnabled())
3893 BEGIN( GuardParamEnd );
3897 BEGIN( SkipGuardedSection );
3905 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3906 yyextra->inGroupParamFound=
false;
3907 BEGIN( InGroupParam );
3913 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3914 yyextra->current->subGrouping =
false;
3920 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3921 yyextra->current->initLines = 100000;
3927 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3928 yyextra->current->initLines = 0;
3934 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3935 yyextra->current->commandOverrides.override_callGraph(
true);
3941 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3942 yyextra->current->commandOverrides.override_callGraph(
false);
3948 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3949 yyextra->current->commandOverrides.override_callerGraph(
true);
3955 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3956 yyextra->current->commandOverrides.override_callerGraph(
false);
3962 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3963 yyextra->current->commandOverrides.override_enumValues(
true);
3969 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3970 yyextra->current->commandOverrides.override_enumValues(
false);
3976 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3977 yyextra->current->commandOverrides.override_inlineSource(
true);
3983 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3984 yyextra->current->commandOverrides.override_inlineSource(
false);
3990 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3991 yyextra->current->commandOverrides.override_includeGraph(
true);
3997 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3998 yyextra->current->commandOverrides.override_includedByGraph(
true);
4004 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4005 yyextra->current->commandOverrides.override_includeGraph(
false);
4011 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4012 yyextra->current->commandOverrides.override_includedByGraph(
false);
4018 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4019 yyextra->current->commandOverrides.override_directoryGraph(
true);
4025 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4026 yyextra->current->commandOverrides.override_directoryGraph(
false);
4032 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4033 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4039 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4040 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4046 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4047 yyextra->current->commandOverrides.override_groupGraph(
true);
4053 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4054 yyextra->current->commandOverrides.override_groupGraph(
false);
4060 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4061 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4062 for (
const auto &opt_ : optList)
4069 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4071 else if (opt ==
"graph")
4073 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4075 else if (opt ==
"builtin")
4077 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4079 else if (opt ==
"text")
4081 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4083 else if (opt ==
"no")
4085 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4089 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4099 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4100 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4106 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4107 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4113 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4114 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4120 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4121 yyextra->current->commandOverrides.override_referencesRelation(
true);
4127 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4128 yyextra->current->commandOverrides.override_referencesRelation(
false);
4134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4135 yyextra->currentCmd = cmd;
4142 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4147 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4149 yyextra->current->doc.clear();
4151 yyextra->condCount=0;
4152 BEGIN( SkipInternal );
4158 yyextra->inInternalDocs =
true;
4165 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4166 yyextra->current->isStatic =
true;
4172 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4173 yyextra->current->virt = Specifier::Pure;
4179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4180 yyextra->current->protection = Protection::Private;
4186 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4187 yyextra->current->protection = yyextra->protection = Protection::Private;
4193 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4194 yyextra->current->protection = Protection::Protected;
4200 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4201 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4207 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4208 yyextra->current->protection = Protection::Public;
4214 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4215 yyextra->current->protection = yyextra->protection = Protection::Public;
4221 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4222 if (yyextra->current->section.isPageDoc() ||
4223 yyextra->current->section.isMainpageDoc())
4225 for (
const auto &opt_ : optList)
4229 int i = opt.
find(
':');
4233 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4235 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4249 yyextra->current->localToc.enableHtml(level);
4251 else if (opt ==
"latex")
4253 yyextra->current->localToc.enableLatex(level);
4255 else if (opt ==
"xml")
4257 yyextra->current->localToc.enableXml(level);
4259 else if (opt ==
"docbook")
4261 yyextra->current->localToc.enableDocbook(level);
4265 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4270 if (yyextra->current->localToc.nothingEnabled())
4282 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4283 BEGIN(InheritParam);
4289 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4290 yyextra->currentCmd = cmd;
4291 BEGIN(ExtendsParam);
4297 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4298 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4304 if (!yyextra->spaceBeforeCmd.isEmpty())
4306 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4307 yyextra->spaceBeforeCmd.clear();
4315 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4317 if (!yyextra->spaceBeforeCmd.isEmpty())
4319 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4320 yyextra->spaceBeforeCmd.clear();
4328 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4329 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4335 if (!yyextra->spaceBeforeCmd.isEmpty())
4337 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4338 yyextra->spaceBeforeCmd.clear();
4341 yyextra->copyDocArg.clear();
4342 yyextra->braceCount = 0;
4351 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4352 yyextra->sectionLabel.clear();
4353 yyextra->sectionTitle.clear();
4354 yyextra->docGroup.clearHeader();
4355 yyextra->insideParBlock =
false;
4362 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4364 return yyextra->current->section.isDoc();
4369 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4370 assert(maker!=
nullptr);
4372 if (yyextra->current->section.isDoc())
4378 yyextra->needNewEntry =
true;
4379 yyextra->current->section = maker();
4380 yyextra->current->fileName = yyextra->fileName;
4381 yyextra->current->startLine = yyextra->lineNr;
4382 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4395 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4396 for(
const char* c = yytext ; *c ; ++c )
4397 yyextra->lineNr += (*c ==
'\n') ;
4405 if (s==
nullptr || *s==0)
return name;
4407 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4418 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4421 QCString reqId = yyextra->current->name;
4427 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4432 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4434 yyextra->fileName,yyextra->lineNr,
4443 const QCString &listTitle,
bool append,
bool inBody,
int lineNr)
4445 if (listName.
isEmpty())
return;
4453 for (
auto it = current->
sli.rbegin(); it != current->
sli.rend(); ++it)
4473 item = refList->
add();
4479 current->
sli.push_back(item);
4481 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4488 current->
doc += cmdString;
4499 current->
anchors.push_back(si);
4501 else if (si->
lineNr() != -1)
4503 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4508 warn(listName,lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4515 current->
anchors.push_back(si);
4525 const QCString &listTitle,
bool append)
4527 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4528 addXRefItemToEntry(yyextra->current,yyextra->outputXRef,listName,itemTitle,listTitle,append,yyextra->inBody,yyextra->lineNr);
4529 yyextra->outputXRef.clear();
4539 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4543 for (
size_t i=1; i<label.
size(); i++)
4546 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4561 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4563 QCString formula = (yyextra->formulaPreText +
4564 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4572 formLabel.
sprintf(
"\\_form#%d",
id);
4573 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4590 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4598 if (addYYtext) yyextra->sectionTitle+=yytext;
4599 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4600 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4602 yyextra->sectionLevel);
4605 yyextra->current->anchors.push_back(si);
4607 else if (si->
lineNr() != -1)
4609 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4614 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4615 yyextra->sectionLabel,si->
fileName());
4621 if (addYYtext) yyextra->sectionTitle+=yytext;
4622 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4623 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4625 yyextra->sectionLevel);
4628 yyextra->current->anchors.push_back(si);
4637 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4639 if (yytext[0] ==
'"')
4642 name=name.
left((
int)yyleng-2);
4658 if (c==
' ' || c==
'\t' || c==
'\r')
4681 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4682 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4684 yyextra->xrefAppendFlag = !yyextra->inBody &&
4686 yyextra->newXRefKind==yyextra->xrefKind &&
4688 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4704 switch(yyextra->xrefKind)
4731 xrefAppendToPrev || yyextra->current->spec.isDeprAttr()
4736 yyextra->xrefItemTitle,
4737 yyextra->xrefListTitle,
4746 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4748 int oldContext = yyextra->inContext;
4749 yyextra->inContext = ctx;
4751 switch(yyextra->inContext)
4754 if (oldContext!=yyextra->inContext)
4757 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4758 if (yyextra->current->docFile.isEmpty())
4760 yyextra->current->docFile = yyextra->fileName;
4761 yyextra->current->docLine = yyextra->lineNr;
4764 yyextra->pOutputString = &yyextra->current->doc;
4768 if (oldContext!=yyextra->inContext)
4770 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4771 if (yyextra->current->briefFile.isEmpty())
4773 yyextra->current->briefFile = yyextra->fileName;
4774 yyextra->current->briefLine = yyextra->lineNr;
4777 bool foundMatch =
false;
4778 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4786 std::string str = yyextra->current->brief.str();
4791 for (
size_t i = 0; i < match[2].str().size(); i++)
4793 if (match[2].str()[i] ==
'\n') cnt++;
4797 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4799 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4806 yyextra->pOutputString = &yyextra->current->brief;
4810 if (!yyextra->current->doc.isEmpty())
4812 yyextra->current->doc +=
"\n";
4814 yyextra->pOutputString = &yyextra->current->doc;
4820 yyextra->pOutputString = &yyextra->outputXRef;
4825 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4834 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4842 yyextra->current->anchors.push_back(si);
4844 else if (si->
lineNr() != -1)
4846 warn(yyextra->fileName,yyextra->lineNr,
4847 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4852 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4859 yyextra->current->anchors.push_back(si);
4866 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4868 *yyextra->pOutputString+=s;
4874 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4876 *yyextra->pOutputString+=s;
4882 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4883 *yyextra->pOutputString+=c;
4889 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4896 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4902 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4903 std::string_view str = yyextra->current->brief.view();
4908 yyextra->briefEndsAtDot=
false;
4910 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4912 yyextra->current->docLine = yyextra->lineNr;
4913 yyextra->current->doc =
"";
4917 addIline(yyscanner,yyextra->lineNr);
4923 int saveLineNr = yyextra->lineNr;
4925 yyextra->current->briefLine = yyextra->lineNr;
4926 yyextra->lineNr = saveLineNr;
4932 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4933 yyextra->prevPosition=yyextra->inputPosition;
4935 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4937 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4948 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4949 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4950 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4951 YY_START==ReadFormulaLong)
4953 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4967 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4975 commentscanYYlex_destroy(
p->yyscanner);
4988 bool &newEntryNeeded,
4989 bool markdownSupport,
4993 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4994 " prot={} markdownSupport={}",
Trace::trunc(comment),fileName,lineNr,isBrief,
4995 isAutoBriefOn,isInbody,prot,markdownSupport);
4997 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5000 yyextra->guards = guards;
5001 yyextra->langParser = parser;
5002 yyextra->current = curEntry;
5003 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
5004 if (comment.
isEmpty())
return false;
5005 yyextra->inputString = comment;
5006 yyextra->inputString.
append(
" ");
5007 yyextra->inputPosition = position;
5008 yyextra->lineNr = lineNr;
5009 yyextra->fileName = fileName;
5010 yyextra->protection = prot;
5011 yyextra->needNewEntry =
false;
5013 yyextra->xrefAppendFlag =
false;
5014 yyextra->insidePre =
false;
5015 yyextra->parseMore =
false;
5016 yyextra->inBody = isInbody;
5017 yyextra->markdownSupport= markdownSupport;
5018 yyextra->outputXRef.clear();
5019 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
5021 yyextra->current->doc +=
'\n';
5024 yyextra->briefEndsAtDot = isAutoBriefOn;
5025 yyextra->condCount = 0;
5026 yyextra->sectionLevel = 0;
5027 yyextra->spaceBeforeCmd.clear();
5028 yyextra->spaceBeforeIf.clear();
5029 yyextra->htmlContextStack.clear();
5032 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
5035 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5036 yyextra->current->inbodyDocs+=cmd;
5040 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5043 commentscanYYrestart(
nullptr, yyscanner );
5045 commentscanYYlex(yyscanner);
5048 if (YY_START==OverloadParam)
5053 if (yyextra->insideParBlock)
5055 warn(yyextra->fileName,yyextra->lineNr,
5056 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5062 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
5065 yyextra->current->doc=
"\n\n";
5068 if (yyextra->current->section.isMemberGrp() &&
5069 yyextra->docGroup.isEmpty())
5071 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5075 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5077 yyextra->current->briefLine,yyextra->current->brief,
5078 yyextra->current->docLine,yyextra->current->doc,
5079 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5083 prot = yyextra->protection;
5085 yyextra->docGroup.addDocs(curEntry);
5087 newEntryNeeded = yyextra->needNewEntry;
5092 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
false;
5094 if (!yyextra->parseMore && !yyextra->guards->empty())
5096 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5099 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5101 lineNr = yyextra->lineNr;
5103 position,yyextra->parseMore,newEntryNeeded);
5105 return yyextra->parseMore;
5110 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5112 bool sectionEnabled =
false;
5117 bool parentEnabled = yyextra->guards->top().parentVisible();
5121 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5122 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5126 yyextra->guards->top().setEnabled(
true);
5127 yyextra->guards->top().setEnabledFound();
5128 BEGIN( GuardParamEnd );
5132 if (yyextra->guards->top().isEnabledFound())
5134 yyextra->guards->top().setEnabled(
false);
5135 BEGIN( SkipGuardedSection );
5137 else if (sectionEnabled)
5139 yyextra->guards->top().setEnabled(
true);
5140 yyextra->guards->top().setEnabledFound();
5141 BEGIN( GuardParamEnd );
5145 yyextra->guards->top().setEnabled(
false);
5146 BEGIN( SkipGuardedSection );
5151 BEGIN( SkipGuardedSection );
5156 BEGIN( SkipGuardedSection );
5162 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5163 yyextra->docGroup.initGroupInfo(entry);
5168 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5169 yyextra->docGroup.enterFile(fileName,lineNr);
5174 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5175 yyextra->docGroup.leaveFile(fileName,lineNr);
5180 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5181 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5186 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5187 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5192 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5193 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5198 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5199 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5209 static reg::Ex deprecated_re(R
"(deprecated\s*(\(\s*\"([^\"]*)\"\s*\))?)");
5215 if (match.size()==3)
5220 std::shared_ptr<Entry> docEntry = std::make_shared<Entry>();
5222 bool newEntryNeeded =
false;
5238 docs = docEntry->doc;
5243 current->
spec.setDeprAttr(
true);
5245 if (!docs.
isEmpty() || !current->
spec.isDeprDoc())
5266#include "commentscan.l.h"
static CitationManager & instance()
void insert(const QCString &label)
Insert a citation identified by label into the database.
Copyright (C) 1997-2015 by Dimitri van Heesch.
bool parse(const QCString &fileName, int lineNr, const QCString &expr)
Copyright (C) 1997-2015 by Dimitri van Heesch.
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
QCString attributes
member's attributes (e.g. [[nodiscard]])
QCString inbodyDocs
documentation inside the body of a function
std::vector< const SectionInfo * > anchors
list of anchors defined in this entry
QCString doc
documentation block (partly parsed)
RefItemVector sli
special lists (test/todo/bug/deprecated/..) this entry is in
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.
QCString process(const QCString &input, int &startNewlines, bool fromParseInput=false)
static MermaidManager & instance()
void setHasInlineDiagrams()
bool startsWith(const char *s) const
char & at(size_t i)
Returns a reference to the character at index i.
void resize(size_t newlen)
QCString & append(char c)
QCString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
QCString & sprintf(const char *format,...)
This struct represents an item in the list of references.
void setAnchor(const QCString &anchor)
void setText(const QCString &text)
List of cross-referenced items.
QCString listName() const
static RefListManager & instance()
class that provide information about a section.
QCString fileName() const
singleton class that owns the list of all sections
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
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 QCString trTest()=0
virtual QCString trBug()=0
virtual QCString trDeprecatedList()=0
virtual QCString trTodo()=0
virtual QCString trBugList()=0
virtual QCString trDeprecated()=0
virtual QCString trTestList()=0
virtual QCString trTodoList()=0
Class representing a regular expression.
Object representing the matching results.
#define AUTO_TRACE_EXIT(...)
Translator * theTranslator
QCString trunc(const QCString &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
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.