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>
213static const std::unordered_map< std::string, DocCmdMap >
docCmdMap =
422#define YY_NO_UNISTD_H 1
423#define YY_NEVER_INTERACTIVE 1
556 const QCString &listTitle,
bool append);
573#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
578#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.
589TABLE ("table"|"TABLE")
590TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
600CAPTION ("caption"|"CAPTION")
601CENTER ("center"|"CENTER")
603DETAILS ("details"|"DETAILS")
604BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
605DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
606DETAILEDHTMLOPT {CODE}
607DETAILEDHTMLOPTEND {ENDCODE}
608SUMMARY ("summary"|"SUMMARY")
609REMARKS ("remarks"|"REMARKS")
611ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
616DOCNL "\n"|"\\ilinebr"
619FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
620FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
621FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
622ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
623LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
624REQID [a-z_A-Z0-9\x80-\xFF\-]+
625CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
626CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
627CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
628SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
629SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
630TMPLSPEC "<"{BN}*[^>]+{BN}*">"
631MAILADDR ("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\-]+
632RCSTAG "$"{ID}":"[^\n$]+"$"
633MODULE_ID ({ID}".")*{ID}
634LINENR {Bopt}[1-9][0-9]*
635IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
693%x ReadFormulaShortSection
695%x ReadFormulaRoundSection
709%x RaiseWarningSection
738<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
741<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
747<Comment>"\""[^"\n]*"\"" {
750<Comment>("\\"[a-z_A-Z]+)+"\\" {
753<Comment>"<"{DETAILEDHTML}{ATTR}">" {
755 int spacePos = htmlOpenTag.find(
' ');
756 if (spacePos==-1) spacePos=yyleng-1;
757 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
759 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
767<Comment>"</"{DETAILEDHTML}">" {
769 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
771 if (!yyextra->htmlContextStack.empty() &&
772 yyextra->htmlContextStack.back().tagName==htmlTagName)
779 yyextra->htmlContextStack.pop_back();
783<Comment>"<"{DETAILEDHTMLOPT}">" {
785 if (yyextra->current->lang==SrcLangExt::CSharp)
787 yyextra->CScode=
true;
797<Comment>"<"{DETAILEDHTMLOPTEND}">" {
801 yyextra->CScode=
false;
805 yyextra->CScode=
false;
810<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
812 if (yyextra->current->lang==SrcLangExt::CSharp)
819<Comment>"<"{DETAILS}{ATTR}">" {
820 yyextra->htmlDetailsStack.push_back(0);
821 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
828<Comment>"</"{DETAILS}">" {
829 if (!yyextra->htmlDetailsStack.empty())
831 yyextra->htmlDetailsStack.pop_back();
833 if (!yyextra->htmlContextStack.empty() &&
834 yyextra->htmlContextStack.back().tagName==
"details")
841 yyextra->htmlContextStack.pop_back();
846 yyextra->htmlAnchorStr = yytext;
847 yyextra->htmlAnchor =
false;
851 yyextra->htmlAnchorStr += yytext;
856 if (c==
'\'' || c==
'"')
858 int e=tag.find(c,s+2);
861 id=tag.mid(s+2,e-s-2);
870 if (!
id.isEmpty() && !yyextra->htmlAnchor)
876 yyextra->htmlAnchor =
true;
879<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
880 yyextra->htmlAnchorStr += yytext;
883 if (!yyextra->htmlAnchor)
885 addOutput(yyscanner,yyextra->htmlAnchorStr);
898 yyextra->htmlAnchorStr += yytext;
899 if (*yytext ==
'\n') yyextra->lineNr++;
902 yyextra->htmlAnchorStr += yytext;
904<Comment>"<"{SUMMARY}">" {
905 if (yyextra->htmlDetailsStack.empty())
914<Comment>"<"{REMARKS}">" {
918<Comment>"</"{SUMMARY}">" {
919 if (!yyextra->htmlDetailsStack.empty())
928<Comment>"</"{REMARKS}">" {
932<Comment>"<"{CAPTION}{ATTR}">" {
934 int s=tag.find(
"id=");
938 if (c==
'\'' || c==
'"')
940 int e=tag.find(c,s+4);
950<Comment>"<"{PRE}{ATTR}">" {
951 yyextra->insidePre=
TRUE;
954<Comment>"</"{PRE}">" {
955 yyextra->insidePre=
FALSE;
965<Comment>"<!\[CDATA\[" {
968<Comment>{B}*{CMD}"endinternal"{B}* {
970 if (!yyextra->inInternalDocs)
971 warn(yyextra->fileName,yyextra->lineNr,
972 "found \\endinternal without matching \\internal"
974 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
976<Comment>{B}*"\\ilinebr "{B}* {
979<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
989<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
990<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
993 int idx = fullMatch.
find(
'{');
995 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
996 int idxEnd = fullMatch.
find(
"}",idx+1);
1014 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1015 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1018 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1020 yyextra->briefEndsAtDot=
FALSE;
1026 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1031 yyextra->parseMore=
TRUE;
1033 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1036 else if (it->second.handler==
nullptr)
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.
1048<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1051<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1058 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...
1064<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1066 yyextra->formulaText=
"";
1067 yyextra->formulaPreText=
"\\begin";
1068 yyextra->formulaPostText=
"";
1070 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1073 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1075 yyextra->formulaPreText+=yyextra->formulaEnv;
1076 yyextra->formulaNewLines=0;
1077 BEGIN(ReadFormulaLong);
1079<Comment>{B}*{CMD}"f$" {
1080 yyextra->formulaText=
"";
1081 yyextra->formulaPreText=
"$";
1082 yyextra->formulaPostText=
"";
1083 yyextra->formulaNewLines=0;
1084 BEGIN(ReadFormulaShort);
1086<Comment>{B}*{CMD}"f(" {
1087 yyextra->formulaText=
"";
1088 yyextra->formulaPreText=
"";
1089 yyextra->formulaPostText=
"";
1090 yyextra->formulaNewLines=0;
1091 BEGIN(ReadFormulaRound);
1093<Comment>{B}*{CMD}"f[" {
1095 yyextra->formulaText=
"";
1096 yyextra->formulaPreText=
"\\[";
1097 yyextra->formulaPostText=
"";
1098 yyextra->formulaNewLines=0;
1099 BEGIN(ReadFormulaLong);
1101<Comment>{B}*{CMD}"{" {
1103 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1105<Comment>{B}*{CMD}"}" {
1107 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1108 yyextra->docGroup.clearHeader();
1109 yyextra->parseMore=
TRUE;
1110 yyextra->needNewEntry =
TRUE;
1111 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1114<Comment>{B}*{CMD}[$@\\&~<>#%] {
1117<Comment>[a-z_A-Z]+ {
1120<Comment>^{B}*"."{Bopt}/\n {
1123<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1124<Comment>^{B}*[*+]{B}+ {
1125 if (!yyextra->markdownSupport)
1133 yyextra->briefEndsAtDot=
FALSE;
1139<Comment>^{B}*"-"{B}+ {
1142 yyextra->briefEndsAtDot=
FALSE;
1147<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1150<Comment>{CMD}"---" {
1157 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1160 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1165 yyextra->briefEndsAtDot=
FALSE;
1170<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1171<Comment>("."+)[a-z_A-Z0-9\)] {
1175<Comment>{CMD}[\.?!] {
1179<Comment>".\\"[ \t] {
1186<Comment>"...\\"[ \t] {
1189<Comment>"..."/[^\.] {
1192<Comment>".."[\.]?/[^ \t\n] {
1195<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1201 for (i=0;i<(yy_size_t)yyleng;)
1203 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1204 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1211 for (i=0;i<(yy_size_t)yyleng;)
1213 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1214 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1229 if (yyextra->briefEndsAtDot)
1232 yyextra->briefEndsAtDot=
FALSE;
1237 if (*yytext ==
'\n') yyextra->lineNr++;
1239<Comment>"<"[/]?{TABLEDEL}">" {
1257<HtmlComment>"---"[!]?">"{B}* {
1258 warn(yyextra->fileName,yyextra->lineNr,
1259 "incorrect HTML end comment --->"
1262<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1263<HtmlComment>{DOCNL} {
1270<HtmlComment>[^\\\n\-]+ {
1275<CdataSection>"\]\]>" {
1278<CdataSection>{DOCNL} {
1280 if (*yytext==
'\n') yyextra->lineNr++;
1282<CdataSection>[<>&] {
1286<CdataSection>[^\\\n\]<>&]+ {
1295<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1296 yyextra->formulaPostText+=
"$";
1299 if (YY_START == ReadFormulaShort)
1305 yyextra->sectionTitle+=
" "+form;
1306 BEGIN(SectionTitle);
1309<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1312 if (YY_START == ReadFormulaRound)
1318 yyextra->sectionTitle+=
" "+form;
1319 BEGIN(SectionTitle);
1322<ReadFormulaLong>{CMD}"f]" {
1323 yyextra->formulaPostText+=
"\\]";
1327<ReadFormulaLong>{CMD}"f}" {
1328 yyextra->formulaPostText+=
"\\end";
1329 yyextra->formulaPostText+=yyextra->formulaEnv;
1333<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1334 yyextra->formulaText+=yytext;
1336<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1337 yyextra->formulaNewLines++;
1338 yyextra->formulaText+=*yytext;
1340 addIline(yyscanner,yyextra->lineNr);
1342<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1343 yyextra->formulaText+=*yytext;
1348<EnumDocArg1>{SCOPEID} {
1350 yyextra->current->name = yytext;
1357<EnumDocArg1>{DOCNL} {
1358 warn(yyextra->fileName,yyextra->lineNr,
1359 "missing argument after '\\enum'."
1369<NameSpaceDocArg1>{SCOPENAME} {
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)
1375<NameSpaceDocArg1>{LC} {
1379<NameSpaceDocArg1>{DOCNL} {
1380 warn(yyextra->fileName,yyextra->lineNr,
1381 "missing argument after '\\namespace'."
1386<NameSpaceDocArg1>. {
1391<PackageDocArg1>{ID}("."{ID})* {
1392 yyextra->current->name = yytext;
1395<PackageDocArg1>{LC} {
1399<PackageDocArg1>{DOCNL} {
1400 warn(yyextra->fileName,yyextra->lineNr,
1401 "missing argument after \\package."
1413<ConceptDocArg1>{SCOPEID} {
1415 yyextra->current->name = yytext;
1418<ConceptDocArg1>{LC} {
1422<ConceptDocArg1>{DOCNL} {
1423 warn(yyextra->fileName,yyextra->lineNr,
1424 "missing argument after '\\concept'."
1433<ModuleDocArg1>{MODULE_ID} {
1435 yyextra->current->name = yytext;
1438<ModuleDocArg1>{LC} {
1442<ModuleDocArg1>{DOCNL} {
1443 warn(yyextra->fileName,yyextra->lineNr,
1444 "missing argument after '\\module'."
1454<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1458 BEGIN( ClassDocArg2 );
1460<ClassDocArg1>{SCOPENAME} {
1463 yyextra->current->name =
substitute(yytext,
".",
"::");
1464 if (yyextra->current->section.isProtocolDoc())
1466 yyextra->current->name+=
"-p";
1469 BEGIN( ClassDocArg2 );
1471<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1474 yyextra->current->name =
substitute(yytext,
".",
"::");
1475 BEGIN( ClassDocArg2 );
1477<ClassDocArg1,CategoryDocArg1>{LC} {
1481<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1482 warn(yyextra->fileName,yyextra->lineNr,
1483 "missing argument after '\\{}'.",yyextra->currentCmd
1488<ClassDocArg1,CategoryDocArg1>. {
1491<ClassDocArg2>{DOCNL} {
1495<ClassDocArg2>{FILE}|"<>" {
1496 yyextra->current->includeFile = yytext;
1497 BEGIN( ClassDocArg3 );
1506<ClassDocArg3>[<"]?{FILE}?[">]? {
1507 yyextra->current->includeName = yytext;
1514<ClassDocArg3>{DOCNL} {
1524<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1525 yyextra->current->name = yytext;
1529 if (yyextra->current->name.endsWith(
".html"))
1531 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1533 else if (yyextra->current->name.endsWith(
".xhtml"))
1535 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1537 yyextra->current->type.clear();
1538 BEGIN(GroupDocArg2);
1540<GroupDocArg1>"\\"{B}*"\n" {
1544<GroupDocArg1>{DOCNL} {
1545 warn(yyextra->fileName,yyextra->lineNr,
1546 "missing group name after {}",
1547 yyextra->current->groupDocCmd()
1556<GroupDocArg2>"\\"{B}*"\n" {
1560<GroupDocArg2>[^\n\\]+ {
1561 yyextra->current->type += yytext;
1563<GroupDocArg2>{DOCNL}+ {
1564 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1566 yyextra->current->type.isEmpty()
1569 warn(yyextra->fileName,yyextra->lineNr,
1570 "missing title after "
1571 "\\defgroup {}", yyextra->current->name
1575 int extraLineNr = 0;
1578 for (
int i = 0; i < yyleng; i++)
1580 if (yytext[i]==
'\n') extraLineNr++;
1587 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1588 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1593 yyextra->current->type += yytext;
1598<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1602 int start = text.
find(
'{');
1603 int end = text.
find(
'}',start+1);
1604 yyextra->current->name = text.
mid(
end+2);
1605 int istart = yyextra->current->name.
find(
"\\ilinebr");
1608 QCString rest = yyextra->current->name.
mid(istart);
1610 yyextra->current->name = yyextra->current->name.mid(0,istart);
1612 yyextra->current->args = text.
mid(start+1,
end-start-1);
1614 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1616<PageDocArg1>{FILE} {
1618 yyextra->current->args =
"";
1619 BEGIN( PageDocArg2 );
1621<PageDocArg1>{LC} { yyextra->lineNr++;
1624<PageDocArg1>{DOCNL} {
1625 warn(yyextra->fileName,yyextra->lineNr,
1626 "missing argument after \\page."
1635<PageDocArg2>{DOCNL} {
1639 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1640 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1643<PageDocArg2>{CMD}[<>] {
1648 yyextra->current->args += tmp;
1651 yyextra->current->args += yytext;
1654<ParamArg1>{ID}/{B}*"," {
1661 if (*yytext==
'\n') yyextra->lineNr++;
1675<FileDocArg1>{DOCNL} {
1681<FileDocArg1>{FILE} {
1685<FileDocArg1>{LC} { yyextra->lineNr++;
1693<XRefItemParam1>{LABELID} {
1694 yyextra->newXRefItemKey=yytext;
1696 BEGIN(XRefItemParam2);
1698<XRefItemParam1>{LC} {
1702<XRefItemParam1>{DOCNL} {
1703 warn(yyextra->fileName,yyextra->lineNr,
1704 "Missing first argument of \\xrefitem"
1706 if (*yytext==
'\n') yyextra->lineNr++;
1714<XRefItemParam2>"\""[^\n\"]*"\"" {
1716 BEGIN(XRefItemParam3);
1718<XRefItemParam2>{LC} {
1722<XRefItemParam2>{DOCNL} {
1723 warn(yyextra->fileName,yyextra->lineNr,
1724 "Missing second argument of \\xrefitem"
1726 if (*yytext==
'\n') yyextra->lineNr++;
1734<XRefItemParam3>"\""[^\n\"]*"\"" {
1739<XRefItemParam2,XRefItemParam3>{LC} {
1743<XRefItemParam3>{DOCNL} {
1744 warn(yyextra->fileName,yyextra->lineNr,
1745 "Missing third argument of \\xrefitem"
1747 if (*yytext==
'\n') yyextra->lineNr++;
1758<RelatesParam1>({ID}("::"|"."))*{ID} {
1759 yyextra->current->relates = yytext;
1766<RelatesParam1>{LC} {
1770<RelatesParam1>{DOCNL} {
1771 warn(yyextra->fileName,yyextra->lineNr,
1772 "Missing argument of '\\{}' command",yyextra->currentCmd
1784<Qualifier>{LABELID} {
1785 yyextra->current->qualifiers.emplace_back(yytext);
1788<Qualifier>"\""[^\"]*"\"" {
1789 std::string inp(yytext);
1790 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1794 warn(yyextra->fileName,yyextra->lineNr,
1795 "Missing argument of '\\{}' command",yyextra->currentCmd
1801 warn(yyextra->fileName,yyextra->lineNr,
1802 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1808<ILine>{LINENR}/[\\@\n\.] |
1814 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1818 yyextra->lineNr = nr;
1821 if (YY_START == ILine)
1827 yyextra->sectionTitle+=yytext;
1828 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1831<ILine,ILineSection>. {
1833 if (YY_START == ILine)
1839 yyextra->sectionTitle+=yytext;
1840 BEGIN(SectionTitle);
1845<IRaise>{B}*[0-9]+/[\\@\n\.] |
1846<IRaise>{B}*[0-9]+{B} {
1851 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1855 yyextra->raiseLevel = nr;
1865<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1879<IFile,IFileSection>{FILE} {
1882 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1883 else yyextra->fileName = yytext;
1884 if (YY_START == IFile)
1890 yyextra->sectionTitle+=yytext;
1891 BEGIN(SectionTitle);
1895<LinkSection>[^\\@\n]* {
1896 yyextra->sectionTitle+=yytext;
1898<LinkSection>{CMD}{CMD} {
1899 yyextra->sectionTitle+=yytext;
1901<LinkSection>{DOCNL} {
1903 if (*yytext ==
'\n') yyextra->lineNr++;
1904 yyextra->sectionTitle+=yytext;
1906<LinkSection>{CMD}"endlink" {
1907 yyextra->sectionTitle+=yytext;
1908 BEGIN(SectionTitle);
1911 yyextra->sectionTitle+=yytext;
1913<LinkSection><<EOF>> {
1914 warn(yyextra->fileName,yyextra->lineNr,
1915 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1921<LineParam>{CMD}{CMD} {
1934<LineParam>({CMD}{CMD}){ID} {
1943<SectionLabel>{LABELID} {
1944 yyextra->sectionLabel+=yytext;
1946<SectionLabel>{CMD}"lineinfo"("{}")? {
QCString & setNum(short n)
1949<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1950 FileInfo fi(yyextra->fileName.str());
1951 bool hasOption =
false;
1953 if (yytext[yyleng-1] ==
'}')
1959 for (
const auto &opt_ : optList)
1962 std::string opt = optStripped.
lower().
str();
1968 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1978 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1990 label=yyextra->fileName;
1994 yyextra->sectionLabel+=label;
#define Config_getBool(name)
static QCString stripFromPath(const QCString &p, const StringVector &l)
1996<SectionLabel>{DOCNL} {
1997 yyextra->sectionTitle.clear();
1998 if (yyextra->sectionLabel.isEmpty())
2000 warn(yyextra->fileName,yyextra->lineNr,
2001 "\\section command has no label"
2006 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2007 addOutput(yyscanner,yyextra->sectionLabel.data());
2010 if (*yytext==
'\n') yyextra->lineNr++;
2015 if (yyextra->sectionLabel.isEmpty())
2017 warn(yyextra->fileName,yyextra->lineNr,
2018 "Invalid or missing section label"
2024 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2025 addOutput(yyscanner,yyextra->sectionLabel.data());
2026 yyextra->sectionTitle.clear();
2028 BEGIN(SectionTitle);
2031<SectionTitle>{STAopt}/"\n" {
2036<SectionTitle>{STopt}"\\\\ilinebr" {
2037 yyextra->sectionTitle+=yytext;
2039<SectionTitle>{STopt}/"\\ilinebr" {
2044<SectionTitle>{B}*{CMD}"f$" {
2045 yyextra->formulaText=
"";
2046 yyextra->formulaPreText=
"$";
2047 yyextra->formulaPostText=
"";
2048 yyextra->formulaNewLines=0;
2049 BEGIN(ReadFormulaShortSection);
2051<SectionTitle>{B}*{CMD}"f(" {
2052 yyextra->formulaText=
"";
2053 yyextra->formulaPreText=
"";
2054 yyextra->formulaPostText=
"";
2055 yyextra->formulaNewLines=0;
2056 BEGIN(ReadFormulaRoundSection);
2058<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2059<SectionTitle>{B}*{CMD}"f"[\[{] {
2063 warn(yyextra->fileName,yyextra->lineNr,
2064 "'\\{}' command is not allowed in section title, ending section title.",
2074<SectionTitle>[^\n@\\]* {
2075 yyextra->sectionTitle+=yytext;
2078<SectionTitle>{B}*{CMD}{CMD} {
2079 yyextra->sectionTitle+=yytext;
2082<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2083<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2085 int idx = fullMatch.
find(
'{');
2087 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2088 int idxEnd = fullMatch.
find(
"}",idx+1);
2104 switch (it->second.sectionHandling)
2109 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2110 yyextra->sectionTitle+=fullMatch.
left(i);
2111 yyextra->sectionTitle+=
'@';
2112 yyextra->sectionTitle+=fullMatch.
mid(i);
2116 warn(yyextra->fileName,yyextra->lineNr,
2117 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2125 warn(yyextra->fileName,yyextra->lineNr,
2126 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2134 if (cmdName ==
"fileinfo")
2137 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2138 yyextra->sectionTitle+=fullMatch.
left(i);
2143 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2148 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2152 else if (cmdName ==
"lineinfo")
2155 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2156 yyextra->sectionTitle+=fullMatch.
left(i);
2158 yyextra->sectionTitle+=
' ';
2159 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2165 else if (cmdName ==
"raisewarning")
2167 yyextra->raiseWarning =
"";
2168 BEGIN(RaiseWarningSection);
2170 else if (cmdName ==
"noop")
2175 else if (cmdName ==
"cite")
2177 yyextra->sectionTitle+=yytext;
2179 BEGIN(CiteLabelSection);
2181 else if (cmdName ==
"iline")
2183 yyextra->sectionTitle+=yytext;
2185 BEGIN(ILineSection);
2187 else if (cmdName ==
"ifile")
2189 yyextra->sectionTitle+=yytext;
2191 BEGIN(IFileSection);
2193 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2196 if (optList.empty())
2198 yyextra -> anchorTitle =
"";
2203 yyextra -> anchorTitle =
join(optList,
" ");
2206 BEGIN(AnchorLabelSection);
2208 else if (cmdName ==
"link")
2210 yyextra->sectionTitle+=yytext;
2215 yyextra->sectionTitle+=yytext;
2216 warn(yyextra->fileName,yyextra->lineNr,
2217 "internal error '\\{}' command is to be replaced in section title.",cmdName
2224 yyextra->sectionTitle+=yytext;
2232 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
2237 yyextra->sectionTitle+=yytext;
2243<SubpageLabel>{FILE} {
2247 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2248 BEGIN(SubpageTitle);
2250<SubpageLabel>{DOCNL} {
2251 warn(yyextra->fileName,yyextra->lineNr,
2252 "\\subpage command has no label"
2254 if (*yytext==
'\n') yyextra->lineNr++;
2262<SubpageTitle>{DOCNL} {
2266<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2277<AnchorLabel,AnchorLabelSection>{LABELID} {
2278 QCString lbl = yyextra->raisePrefix+yytext;
2279 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2281 if (YY_START == AnchorLabel)
2287 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2290<AnchorLabel,AnchorLabelSection>{DOCNL} {
2291 warn(yyextra->fileName,yyextra->lineNr,
2292 "\\anchor command has no label"
2294 if (*yytext==
'\n') yyextra->lineNr++;
2296 if (YY_START == AnchorLabel)
2302 BEGIN(SectionTitle);
2305<AnchorLabel,AnchorLabelSection>. {
2306 warn(yyextra->fileName,yyextra->lineNr,
2307 "Invalid or missing anchor label"
2310 if (YY_START == AnchorLabel)
2316 BEGIN(SectionTitle);
2322<RequirementLabel>{REQID} {
2323 yyextra->current->name = yytext;
2324 yyextra->current->type.clear();
2325 BEGIN( RequirementTitle );
2327<SatisfiesLabel>{REQID} {
2328 yyextra->reqId = yytext;
2329 yyextra->reqTitle.clear();
2330 BEGIN( SatisfiesTitle );
2332<VerifiesLabel>{REQID} {
2333 yyextra->reqId = yytext;
2334 yyextra->reqTitle.clear();
2335 BEGIN( VerifiesTitle );
2337<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2341<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2342 warn(yyextra->fileName,yyextra->lineNr,
2343 "missing requirement ID after \\requirement command"
2348<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2351<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2355<RequirementTitle>[^\n\\]+ {
2356 yyextra->current->type += yytext;
2358<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2359 yyextra->reqTitle += yytext;
2361<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2362 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2367<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2368 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2370 if (yyextra->current->section.isRequirementDoc())
2372 warn(yyextra->fileName,yyextra->lineNr,
2373 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2386<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2387 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2389 if (yyextra->current->section.isRequirementDoc())
2391 warn(yyextra->fileName,yyextra->lineNr,
2392 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2405<RequirementTitle>. {
2406 yyextra->current->type += yytext;
2408<SatisfiesTitle,VerifiesTitle>. {
2409 yyextra->reqTitle += yytext;
2415<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc"|"endmermaid")/{NW} {
2417 if (&yytext[4]==yyextra->blockName)
2422<FormatBlock>{CMD}"enduml" {
2424 if (yyextra->blockName==
"startuml")
2429<FormatBlock>[^ \@\*\/\\\n]* {
2432<FormatBlock>{DOCNL} {
2433 if (*yytext==
'\n') yyextra->lineNr++;
2437 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2438 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2439 yyextra->blockName==
"iliteral"
2441 ) yyextra->commentCount++;
2446 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2447 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2448 yyextra->blockName==
"iliteral"
2452 yyextra->commentCount--;
2453 if (yyextra->commentCount<0)
2455 QCString endTag =
"end"+yyextra->blockName;
2456 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2457 warn(yyextra->fileName,yyextra->lineNr,
2458 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2459 yyextra->blockName,endTag);
2466<FormatBlock><<EOF>> {
2467 QCString endTag =
"end"+yyextra->blockName;
2468 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2469 warn(yyextra->fileName,yyextra->lineNr,
2470 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2471 yyextra->blockName,endTag
2478<GuardParam>{B}*"(" {
2479 yyextra->guardExpr=yytext;
2480 yyextra->roundCount=1;
2484 yyextra->guardExpr+=yytext;
2488 yyextra->guardExpr+=yytext;
2489 yyextra->roundCount++;
2492 yyextra->guardExpr+=yytext;
2493 yyextra->roundCount--;
2494 if (yyextra->roundCount==0)
2500 warn(yyextra->fileName,yyextra->lineNr,
2501 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2505<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2508<GuardParam>{DOCNL} {
2523<GuardParamEnd>{B}*{DOCNL} {
2525 yyextra->spaceBeforeIf.clear();
2529<GuardParamEnd>{B}* {
2530 if (!yyextra->spaceBeforeIf.isEmpty())
2532 addOutput(yyscanner,yyextra->spaceBeforeIf);
2534 yyextra->spaceBeforeIf.clear();
2546<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2548 yyextra->guards->emplace(
false);
2549 BEGIN( GuardParam );
2551<SkipGuardedSection>{CMD}"if"/{NW} {
2553 yyextra->guards->emplace(
false);
2554 BEGIN( GuardParam );
2556<SkipGuardedSection>{CMD}"endif"/{NW} {
2557 if (yyextra->guards->empty())
2559 warn(yyextra->fileName,yyextra->lineNr,
2560 "found \\endif without matching start command");
2565 yyextra->guards->pop();
2566 if (yyextra->guards->empty())
2568 BEGIN( GuardParamEnd );
2572 if (yyextra->guards->top().isEnabled())
2574 BEGIN( GuardParamEnd );
2578 BEGIN( SkipGuardedSection );
2583<SkipGuardedSection>{CMD}"else"/{NW} {
2584 if (yyextra->guards->empty())
2586 warn(yyextra->fileName,yyextra->lineNr,
2587 "found \\else without matching start command");
2589 else if (yyextra->guards->top().hasElse())
2591 warn(yyextra->fileName,yyextra->lineNr,
2592 "found multiple \\else commands in same \\if construct");
2593 yyextra->guards->top().setEnabled(
false);
2594 BEGIN( SkipGuardedSection );
2596 else if (!yyextra->guards->top().parentVisible())
2598 yyextra->guards->top().setEnabled(
false);
2599 BEGIN( SkipGuardedSection );
2603 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2604 yyextra->guards->top().setElse();
2605 if (!yyextra->guards->top().parentVisible())
2607 yyextra->guards->top().setEnabled(
false);
2608 BEGIN( SkipGuardedSection );
2610 else if (yyextra->guards->top().isEnabledFound())
2612 yyextra->guards->top().setEnabled(
false);
2613 BEGIN( SkipGuardedSection );
2617 yyextra->guards->top().setEnabled(
true);
2618 BEGIN( GuardParamEnd );
2622<SkipGuardedSection>{CMD}"elseif"/{NW} {
2623 if (yyextra->guards->empty())
2625 warn(yyextra->fileName,yyextra->lineNr,
2626 "found \\elseif without matching start command");
2628 else if (yyextra->guards->top().hasElse())
2630 warn(yyextra->fileName,yyextra->lineNr,
2631 "found \\elseif command after \\else command was given in \\if construct");
2633 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2634 yyextra->guards->top().setEnabled(
false);
2635 BEGIN( GuardParam );
2640 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2641 yyextra->guards->top().setEnabled(
false);
2642 BEGIN( GuardParam );
2645<SkipGuardedSection>{DOCNL} {
2646 if (*yytext==
'\n') yyextra->lineNr++;
2649<SkipGuardedSection>[^ \\@\n]+ {
2651<SkipGuardedSection>{CMD}{CMD} |
2652<SkipGuardedSection>. {
2658<SkipInternal>{DOCNL} {
2659 if (*yytext==
'\n') yyextra->lineNr++;
2662<SkipInternal>{CMD}"if"/[ \t] {
2663 yyextra->condCount++;
2665<SkipInternal>{CMD}"ifnot"/[ \t] {
2666 yyextra->condCount++;
2668<SkipInternal>{CMD}/"endif" {
2669 yyextra->condCount--;
2670 if (yyextra->condCount<0)
2676<SkipInternal>{CMD}/"section"[ \t] {
2677 if (yyextra->sectionLevel>0)
2683<SkipInternal>{CMD}/"subsection"[ \t] {
2684 if (yyextra->sectionLevel>1)
2690<SkipInternal>{CMD}/"subsubsection"[ \t] {
2691 if (yyextra->sectionLevel>2)
2697<SkipInternal>{CMD}/"paragraph"[ \t] {
2698 if (yyextra->sectionLevel>3)
2704<SkipInternal>{CMD}/"subparagraph"[ \t] {
2705 if (yyextra->sectionLevel>4)
2711<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2712 if (yyextra->sectionLevel>5)
2718<SkipInternal>{CMD}"endinternal"[ \t]* {
2721<SkipInternal>[^ \\@\n]+ {
2738 yyextra->docGroup.appendHeader(
' ');
2741 yyextra->docGroup.appendHeader(*yytext);
2742 yyextra->current->name+=*yytext;
2757<RaiseWarning,RaiseWarningSection>{DOCNL} {
2759 "{}",yyextra->raiseWarning);
2760 yyextra->raiseWarning =
"";
2761 if (*yytext==
'\n') yyextra->lineNr++;
2763 if (YY_START == RaiseWarning)
2769 yyextra->sectionTitle+=yytext;
2770 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2773<RaiseWarning,RaiseWarningSection>. {
2774 yyextra->raiseWarning += yytext;
2778<InGroupParam>{LABELID} {
2779 yyextra->current->groups.emplace_back(
2782 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2784<InGroupParam>{DOCNL} {
2785 if (!yyextra->inGroupParamFound)
2787 warn(yyextra->fileName,yyextra->lineNr,
2788 "Missing group name for \\ingroup command"
2807 if (yyextra->braceCount==0)
2809 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2811 warn(yyextra->fileName,yyextra->lineNr,
2812 "missing argument after '\\{}'.",yyextra->currentCmd
2818 yyextra->langParser->parsePrototype(yyextra->functionProto);
2826 yyextra->functionProto+=
' ';
2828<FnParam>[^@\\\n()]+ {
2829 yyextra->functionProto+=yytext;
2832 yyextra->functionProto+=yytext;
2833 yyextra->braceCount++;
2836 yyextra->functionProto+=yytext;
2837 yyextra->braceCount--;
2840 yyextra->functionProto+=*yytext;
2847<OverloadParam>{DOCNL} {
2848 if (*yytext==
'\n') yyextra->lineNr++;
2849 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2857 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2861<OverloadParam>{LC} {
2863 yyextra->functionProto+=
' ';
2866 yyextra->functionProto+=*yytext;
2871<InheritParam>({ID}("::"|"."))*{ID} {
2872 yyextra->current->extends.emplace_back(
2877<InheritParam>{DOCNL} {
2878 warn(yyextra->fileName,yyextra->lineNr,
2879 "\\inherit command has no argument"
2881 if (*yytext==
'\n') yyextra->lineNr++;
2886 warn(yyextra->fileName,yyextra->lineNr,
2887 "Invalid or missing name for \\inherit command"
2894<ExtendsParam>({ID}("::"|"."))*{ID} {
2895 yyextra->current->extends.emplace_back(
2900<ExtendsParam>{DOCNL} {
2901 warn(yyextra->fileName,yyextra->lineNr,
2902 "'\\{}' command has no argument",yyextra->currentCmd
2914<SkipLang>{CMD}"~"[a-zA-Z-]* {
2918 warn(yyextra->fileName,yyextra->lineNr,
2927<SkipLang>[^*@\\\n]* {
2930 if (*yytext==
'\n') yyextra->lineNr++;
2937<CiteLabel,CiteLabelSection>{CITEID} {
2940 if (YY_START == CiteLabel)
2946 yyextra->sectionTitle+=yytext;
2947 BEGIN(SectionTitle);
2950<CiteLabel,CiteLabelSection>{DOCNL} {
2951 warn(yyextra->fileName,yyextra->lineNr,
2952 "\\cite command has no label"
2956 if (YY_START == CiteLabel)
2963 yyextra->sectionTitle+=yytext;
2965 BEGIN(SectionTitle);
2968<CiteLabel,CiteLabelSection>. {
2969 warn(yyextra->fileName,yyextra->lineNr,
2970 "Invalid or missing cite label"
2972 if (YY_START == CiteLabel)
2978 yyextra->sectionTitle+=yytext;
2979 BEGIN(SectionTitle);
2987 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2988 addOutput(yyscanner,yyextra->copyDocArg);
2992<CopyDoc>"<"[/]?{TABLEDEL}">" {
2993 if (yyextra->braceCount==0)
2996 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2997 addOutput(yyscanner,yyextra->copyDocArg);
3003 if (*yytext==
'\n') yyextra->lineNr++;
3004 if (yyextra->braceCount==0)
3007 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3008 addOutput(yyscanner,yyextra->copyDocArg);
3016<CopyDoc>[^@\\\n()<]+ {
3017 yyextra->copyDocArg+=yytext;
3021 yyextra->copyDocArg+=yytext;
3023 yyextra->braceCount++;
3026 yyextra->copyDocArg+=yytext;
3028 yyextra->braceCount--;
3031 yyextra->copyDocArg+=yytext;
3053 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3054 yyextra->braceCount=0;
3055 yyextra->functionProto.clear();
3056 yyextra->currentCmd = cmd;
3057 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3064 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3065 yyextra->functionProto.clear();
3066 yyextra->braceCount=0;
3067 yyextra->currentCmd = cmd;
3068 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3075 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3076 yyextra->functionProto.clear();
3077 BEGIN(OverloadParam);
3083 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3084 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3085 BEGIN( EnumDocArg1 );
3091 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3094 BEGIN( GroupDocArg1 );
3100 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3103 BEGIN( GroupDocArg1 );
3109 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3112 BEGIN( GroupDocArg1 );
3118 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3119 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3120 BEGIN( NameSpaceDocArg1 );
3126 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3128 BEGIN( PackageDocArg1 );
3134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3135 yyextra->currentCmd = cmd;
3136 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3137 BEGIN( ClassDocArg1 );
3143 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3144 yyextra->currentCmd = cmd;
3145 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3146 BEGIN( ConceptDocArg1 );
3152 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3153 yyextra->currentCmd = cmd;
3154 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3155 BEGIN( ModuleDocArg1 );
3161 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3162 BEGIN( ClassDocArg2 );
3168 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3169 yyextra->currentCmd = cmd;
3170 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3171 BEGIN( ClassDocArg1 );
3177 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3178 yyextra->currentCmd = cmd;
3179 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3180 BEGIN( CategoryDocArg1 );
3186 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3187 yyextra->currentCmd = cmd;
3188 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3189 BEGIN( ClassDocArg1 );
3195 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3196 yyextra->currentCmd = cmd;
3197 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3198 BEGIN( ClassDocArg1 );
3204 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3205 yyextra->currentCmd = cmd;
3206 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3207 BEGIN( ClassDocArg1 );
3213 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3214 yyextra->currentCmd = cmd;
3215 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3216 BEGIN( ClassDocArg1 );
3222 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3224 BEGIN( PageDocArg1 );
3230 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3234 yyextra->current->name =
"mainpage";
3237 BEGIN( PageDocArg2 );
3243 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3247 yyextra->current->name = yyextra->fileName;
3249 BEGIN( FileDocArg1 );
3255 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3265 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3273 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3275 if (!stop) yyextra->current->name = yyextra->fileName;
3276 BEGIN( FileDocArg1 );
3282 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3284 for (
const auto &opt : optList)
3288 sectionMaker=EntryType::makeExampleLineno;
3292 warn(yyextra->fileName,yyextra->lineNr,
3293 "unsupported option '{}' for command '\\{}'",opt,cmd);
3297 if (!stop) yyextra->current->name = yyextra->fileName;
3298 BEGIN( FileDocArg1 );
3304 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3307 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3316 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3317 yyextra->raiseWarning =
"";
3318 BEGIN( RaiseWarning );
3324 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3331 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3335 yyextra->docGroup.clearHeader();
3337 if (!yyextra->docGroup.isEmpty())
3339 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3347 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3356 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3365 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3374 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3383 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3385 BEGIN(XRefItemParam1);
3391 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3392 if (yyextra->insideParBlock)
3394 warn(yyextra->fileName,yyextra->lineNr,
3395 "found \\parblock command while already in a parblock!");
3397 if (!yyextra->spaceBeforeCmd.isEmpty())
3399 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3400 yyextra->spaceBeforeCmd.clear();
3403 yyextra->insideParBlock =
TRUE;
3409 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3410 if (!yyextra->insideParBlock)
3412 warn(yyextra->fileName,yyextra->lineNr,
3413 "found \\endparblock command without matching \\parblock!");
3417 yyextra->insideParBlock =
FALSE;
3423 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3424 if (!yyextra->current->relates.isEmpty())
3426 warn(yyextra->fileName,yyextra->lineNr,
3427 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3429 yyextra->current->relatesType = RelatesType::Simple;
3430 yyextra->currentCmd = cmd;
3431 BEGIN(RelatesParam1);
3437 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3438 if (!yyextra->current->relates.isEmpty())
3440 warn(yyextra->fileName,yyextra->lineNr,
3441 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3443 yyextra->current->relatesType = RelatesType::Duplicate;
3444 yyextra->currentCmd = cmd;
3445 BEGIN(RelatesParam1);
3451 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3452 if (!yyextra->current->relates.isEmpty())
3454 warn(yyextra->fileName,yyextra->lineNr,
3455 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3457 yyextra->current->relatesType = RelatesType::MemberOf;
3458 yyextra->currentCmd = cmd;
3459 BEGIN(RelatesParam1);
3465 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3473 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3476 BEGIN(SectionLabel);
3477 yyextra->sectionLabel.clear();
3486 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3488 switch (yyextra->sectionLevel)
3496 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3503 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3505 BEGIN( RequirementLabel );
3511 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3512 BEGIN( SatisfiesLabel );
3518 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3519 BEGIN( VerifiesLabel );
3525 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3526 if (!yyextra->current->section.isEmpty() &&
3527 !yyextra->current->section.isPageDoc() &&
3528 !yyextra->current->section.isMainpageDoc()
3531 warn(yyextra->fileName,yyextra->lineNr,
3532 "found \\subpage command in a comment block that is not marked as a page!");
3534 if (!yyextra->spaceBeforeCmd.isEmpty())
3536 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3537 yyextra->spaceBeforeCmd.clear();
3540 BEGIN(SubpageLabel);
3546 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3548 if (optList.empty())
3550 yyextra -> anchorTitle =
"";
3554 yyextra -> anchorTitle =
join(optList,
" ");
3562 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3563 for (
const auto &opt : optList)
3573 if (optList.empty())
3587 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3588 if (!yyextra->spaceBeforeCmd.isEmpty())
3590 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3591 yyextra->spaceBeforeCmd.clear();
3593 if (optList.empty())
3607 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3608 if (!yyextra->spaceBeforeCmd.isEmpty())
3610 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3611 yyextra->spaceBeforeCmd.clear();
3617 if (optList.empty())
3626 yyextra->blockName=s;
3627 yyextra->commentCount=0;
3634 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3642 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3660 static std::unordered_map<std::string,OptionFunc> options =
3663 {
"name", [](
const FileInfo &fi_) ->
QCString {
return fi_.baseName(); } },
3664 {
"extension", [](
const FileInfo &fi_) ->
QCString {
return fi_.extension(
true); } },
3665 {
"filename", [](
const FileInfo &fi_) ->
QCString {
return fi_.fileName(); } },
3666 {
"directory", [](
const FileInfo &fi_) ->
QCString {
return fi_.dirPath(); } },
3667 {
"full", [](
const FileInfo &fi_) ->
QCString {
return fi_.absFilePath(); } }
3669 auto it = options.
find(optionName);
3670 return (it!=options.end()) ? it->second(fi) :
QCString();
3675 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3676 if (!yyextra->spaceBeforeCmd.isEmpty())
3678 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3679 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3680 yyextra->spaceBeforeCmd.clear();
3683 FileInfo fi(yyextra->fileName.str());
3684 for (
const auto &opt_ : optList)
3687 std::string opt = optStripped.
lower().
str();
3693 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3700 yyextra->sectionTitle+=result;
3707 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3714 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3719 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3728 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3729 if (!yyextra->spaceBeforeCmd.isEmpty())
3731 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3732 yyextra->spaceBeforeCmd.clear();
3740 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3748 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3756 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3763 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3765 BEGIN(IRaisePrefix);
3771 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3773 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3774 if (yyextra->guards->empty())
3776 yyextra->guards->emplace(
true);
3780 bool enabled = yyextra->guards->top().isEnabled();
3781 yyextra->guards->emplace(enabled);
3789 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3791 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3792 if (yyextra->guards->empty())
3794 yyextra->guards->emplace(
true);
3798 bool enabled = yyextra->guards->top().isEnabled();
3799 yyextra->guards->emplace(enabled);
3807 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3808 if (yyextra->guards->empty())
3810 warn(yyextra->fileName,yyextra->lineNr,
3811 "found \\elseif without matching start command");
3813 else if (yyextra->guards->top().hasElse())
3815 warn(yyextra->fileName,yyextra->lineNr,
3816 "found \\elseif command after \\else command was given in \\if construct");
3818 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3819 yyextra->guards->top().setEnabled(
false);
3825 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3826 yyextra->guards->top().setEnabled(
false);
3834 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3835 if (yyextra->guards->empty())
3837 warn(yyextra->fileName,yyextra->lineNr,
3838 "found \\else without matching start command");
3840 else if (yyextra->guards->top().hasElse())
3842 warn(yyextra->fileName,yyextra->lineNr,
3843 "found multiple \\else commands in same \\if construct");
3844 yyextra->guards->top().setEnabled(
false);
3845 yyextra->guards->top().setElse();
3846 BEGIN( SkipGuardedSection );
3850 yyextra->guards->top().setElse();
3851 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3852 if (yyextra->guards->top().isEnabledFound())
3854 yyextra->guards->top().setEnabled(
false);
3855 BEGIN( SkipGuardedSection );
3859 yyextra->guards->top().setEnabled(
true);
3860 BEGIN( GuardParamEnd );
3868 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3869 if (yyextra->guards->empty())
3871 warn(yyextra->fileName,yyextra->lineNr,
3872 "found \\endif without matching start command");
3876 yyextra->guards->pop();
3878 if (!yyextra->spaceBeforeCmd.isEmpty())
3880 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3881 yyextra->spaceBeforeCmd.clear();
3883 if (yyextra->guards->empty())
3885 BEGIN( GuardParamEnd );
3889 if (yyextra->guards->top().isEnabled())
3891 BEGIN( GuardParamEnd );
3895 BEGIN( SkipGuardedSection );
3903 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3904 yyextra->inGroupParamFound=
FALSE;
3905 BEGIN( InGroupParam );
3911 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3912 yyextra->current->subGrouping =
FALSE;
3918 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3919 yyextra->current->initLines = 100000;
3925 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3926 yyextra->current->initLines = 0;
3932 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3933 yyextra->current->commandOverrides.override_callGraph(
true);
3939 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3940 yyextra->current->commandOverrides.override_callGraph(
false);
3946 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3947 yyextra->current->commandOverrides.override_callerGraph(
true);
3953 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3954 yyextra->current->commandOverrides.override_callerGraph(
false);
3960 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3961 yyextra->current->commandOverrides.override_enumValues(
true);
3967 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3968 yyextra->current->commandOverrides.override_enumValues(
false);
3974 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3975 yyextra->current->commandOverrides.override_inlineSource(
true);
3981 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3982 yyextra->current->commandOverrides.override_inlineSource(
false);
3988 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3989 yyextra->current->commandOverrides.override_includeGraph(
true);
3995 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3996 yyextra->current->commandOverrides.override_includedByGraph(
true);
4002 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4003 yyextra->current->commandOverrides.override_includeGraph(
false);
4009 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4010 yyextra->current->commandOverrides.override_includedByGraph(
false);
4016 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4017 yyextra->current->commandOverrides.override_directoryGraph(
true);
4023 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4024 yyextra->current->commandOverrides.override_directoryGraph(
false);
4030 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4031 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4037 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4038 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4044 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4045 yyextra->current->commandOverrides.override_groupGraph(
true);
4051 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4052 yyextra->current->commandOverrides.override_groupGraph(
false);
4058 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4059 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4060 for (
const auto &opt_ : optList)
4067 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4069 else if (opt ==
"graph")
4071 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4073 else if (opt ==
"builtin")
4075 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4077 else if (opt ==
"text")
4079 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4081 else if (opt ==
"no")
4083 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4087 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4097 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4098 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4104 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4105 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4111 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4112 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4118 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4119 yyextra->current->commandOverrides.override_referencesRelation(
true);
4125 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4126 yyextra->current->commandOverrides.override_referencesRelation(
false);
4132 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4133 yyextra->currentCmd = cmd;
4140 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4145 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4147 yyextra->current->doc.clear();
4149 yyextra->condCount=0;
4150 BEGIN( SkipInternal );
4156 yyextra->inInternalDocs =
TRUE;
4163 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4164 yyextra->current->isStatic =
TRUE;
4170 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4171 yyextra->current->virt = Specifier::Pure;
4177 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4178 yyextra->current->protection = Protection::Private;
4184 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4185 yyextra->current->protection = yyextra->protection = Protection::Private;
4191 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4192 yyextra->current->protection = Protection::Protected;
4198 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4199 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4205 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4206 yyextra->current->protection = Protection::Public;
4212 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4213 yyextra->current->protection = yyextra->protection = Protection::Public;
4219 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4220 if (yyextra->current->section.isPageDoc() ||
4221 yyextra->current->section.isMainpageDoc())
4223 for (
const auto &opt_ : optList)
4227 int i = opt.
find(
':');
4231 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4233 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4247 yyextra->current->localToc.enableHtml(level);
4249 else if (opt ==
"latex")
4251 yyextra->current->localToc.enableLatex(level);
4253 else if (opt ==
"xml")
4255 yyextra->current->localToc.enableXml(level);
4257 else if (opt ==
"docbook")
4259 yyextra->current->localToc.enableDocbook(level);
4263 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4268 if (yyextra->current->localToc.nothingEnabled())
4280 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4281 BEGIN(InheritParam);
4287 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4288 yyextra->currentCmd = cmd;
4289 BEGIN(ExtendsParam);
4295 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4296 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4302 if (!yyextra->spaceBeforeCmd.isEmpty())
4304 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4305 yyextra->spaceBeforeCmd.clear();
4313 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4315 if (!yyextra->spaceBeforeCmd.isEmpty())
4317 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4318 yyextra->spaceBeforeCmd.clear();
4326 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4327 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4333 if (!yyextra->spaceBeforeCmd.isEmpty())
4335 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4336 yyextra->spaceBeforeCmd.clear();
4339 yyextra->copyDocArg.clear();
4340 yyextra->braceCount = 0;
4349 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4350 yyextra->sectionLabel.clear();
4351 yyextra->sectionTitle.clear();
4352 yyextra->docGroup.clearHeader();
4353 yyextra->insideParBlock =
FALSE;
4360 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4362 return yyextra->current->section.isDoc();
4367 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4368 assert(maker!=
nullptr);
4370 if (yyextra->current->section.isDoc())
4376 yyextra->needNewEntry =
true;
4377 yyextra->current->section = maker();
4378 yyextra->current->fileName = yyextra->fileName;
4379 yyextra->current->startLine = yyextra->lineNr;
4380 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4393 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4394 for(
const char* c = yytext ; *c ; ++c )
4395 yyextra->lineNr += (*c ==
'\n') ;
4403 if (s==
nullptr || *s==0)
return name;
4405 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4416 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4419 QCString reqId = yyextra->current->name;
4425 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4430 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4432 yyextra->fileName,yyextra->lineNr,
4441 const QCString &listTitle,
bool append)
4443 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4444 if (listName.
isEmpty())
return;
4451 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4464 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4472 item = refList->
add();
4476 item->
setText(yyextra->outputXRef);
4478 yyextra->current->sli.push_back(item);
4480 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4481 if (yyextra->inBody)
4483 yyextra->current->inbodyDocs += cmdString;
4487 yyextra->current->doc += cmdString;
4497 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4499 yyextra->sectionLevel);
4500 yyextra->current->anchors.push_back(si);
4502 else if (si->
lineNr() != -1)
4504 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4509 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4515 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4517 yyextra->sectionLevel);
4518 yyextra->current->anchors.push_back(si);
4522 yyextra->outputXRef.clear();
4532 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4536 for (
size_t i=1; i<label.
size(); i++)
4539 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4554 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4556 QCString formula = (yyextra->formulaPreText +
4557 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4565 formLabel.
sprintf(
"\\_form#%d",
id);
4566 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4583 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4591 if (addYYtext) yyextra->sectionTitle+=yytext;
4592 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4593 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4595 yyextra->sectionLevel);
4598 yyextra->current->anchors.push_back(si);
4600 else if (si->
lineNr() != -1)
4602 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4607 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4608 yyextra->sectionLabel,si->
fileName());
4614 if (addYYtext) yyextra->sectionTitle+=yytext;
4615 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4616 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4618 yyextra->sectionLevel);
4621 yyextra->current->anchors.push_back(si);
4630 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4632 if (yytext[0] ==
'"')
4635 name=name.
left((
int)yyleng-2);
4651 if (c==
' ' || c==
'\t' || c==
'\r')
4674 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4675 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4677 yyextra->xrefAppendFlag = !yyextra->inBody &&
4679 yyextra->newXRefKind==yyextra->xrefKind &&
4681 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4697 switch(yyextra->xrefKind)
4729 yyextra->xrefItemTitle,
4730 yyextra->xrefListTitle,
4739 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4741 int oldContext = yyextra->inContext;
4742 yyextra->inContext = ctx;
4744 switch(yyextra->inContext)
4747 if (oldContext!=yyextra->inContext)
4750 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4751 if (yyextra->current->docFile.isEmpty())
4753 yyextra->current->docFile = yyextra->fileName;
4754 yyextra->current->docLine = yyextra->lineNr;
4757 yyextra->pOutputString = &yyextra->current->doc;
4761 if (oldContext!=yyextra->inContext)
4763 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4764 if (yyextra->current->briefFile.isEmpty())
4766 yyextra->current->briefFile = yyextra->fileName;
4767 yyextra->current->briefLine = yyextra->lineNr;
4770 bool foundMatch =
false;
4771 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4779 std::string str = yyextra->current->brief.str();
4784 for (
size_t i = 0; i < match[2].str().size(); i++)
4786 if (match[2].str()[i] ==
'\n') cnt++;
4790 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4792 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4799 yyextra->pOutputString = &yyextra->current->brief;
4803 if (!yyextra->current->doc.isEmpty())
4805 yyextra->current->doc +=
"\n";
4807 yyextra->pOutputString = &yyextra->current->doc;
4813 yyextra->pOutputString = &yyextra->outputXRef;
4818 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4827 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4835 yyextra->current->anchors.push_back(si);
4837 else if (si->
lineNr() != -1)
4839 warn(yyextra->fileName,yyextra->lineNr,
4840 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4845 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4852 yyextra->current->anchors.push_back(si);
4859 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4861 *yyextra->pOutputString+=s;
4867 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4869 *yyextra->pOutputString+=s;
4875 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4876 *yyextra->pOutputString+=c;
4882 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4889 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4895 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4896 std::string_view str = yyextra->current->brief.view();
4901 yyextra->briefEndsAtDot=
FALSE;
4903 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4905 yyextra->current->docLine = yyextra->lineNr;
4906 yyextra->current->doc =
"";
4910 addIline(yyscanner,yyextra->lineNr);
4916 int saveLineNr = yyextra->lineNr;
4918 yyextra->current->briefLine = yyextra->lineNr;
4919 yyextra->lineNr = saveLineNr;
4925 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4926 yyextra->prevPosition=yyextra->inputPosition;
4928 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4930 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4941 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4942 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4943 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4944 YY_START==ReadFormulaLong)
4946 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4960 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4968 commentscanYYlex_destroy(
p->yyscanner);
4981 bool &newEntryNeeded,
4982 bool markdownSupport,
4986 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4988 isAutoBriefOn,isInbody,prot,markdownSupport);
4990 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4993 yyextra->guards = guards;
4994 yyextra->langParser = parser;
4995 yyextra->current = curEntry;
4996 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4998 yyextra->inputString =
comment;
4999 yyextra->inputString.append(
" ");
5000 yyextra->inputPosition = position;
5001 yyextra->lineNr = lineNr;
5002 yyextra->fileName = fileName;
5003 yyextra->protection = prot;
5004 yyextra->needNewEntry =
FALSE;
5006 yyextra->xrefAppendFlag =
FALSE;
5007 yyextra->insidePre =
FALSE;
5008 yyextra->parseMore =
FALSE;
5009 yyextra->inBody = isInbody;
5010 yyextra->markdownSupport= markdownSupport;
5011 yyextra->outputXRef.clear();
5012 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
5014 yyextra->current->doc +=
'\n';
5017 yyextra->briefEndsAtDot = isAutoBriefOn;
5018 yyextra->condCount = 0;
5019 yyextra->sectionLevel = 0;
5020 yyextra->spaceBeforeCmd.clear();
5021 yyextra->spaceBeforeIf.clear();
5022 yyextra->htmlContextStack.clear();
5025 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
5028 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5029 yyextra->current->inbodyDocs+=cmd;
5033 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5036 commentscanYYrestart(
nullptr, yyscanner );
5038 commentscanYYlex(yyscanner);
5041 if (YY_START==OverloadParam)
5046 if (yyextra->insideParBlock)
5048 warn(yyextra->fileName,yyextra->lineNr,
5049 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5055 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
5058 yyextra->current->doc=
"\n\n";
5061 if (yyextra->current->section.isMemberGrp() &&
5062 yyextra->docGroup.isEmpty())
5064 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5068 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5070 yyextra->current->briefLine,yyextra->current->brief,
5071 yyextra->current->docLine,yyextra->current->doc,
5072 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5076 prot = yyextra->protection;
5078 yyextra->docGroup.addDocs(curEntry);
5080 newEntryNeeded = yyextra->needNewEntry;
5085 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
5087 if (!yyextra->parseMore && !yyextra->guards->empty())
5089 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5092 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5094 lineNr = yyextra->lineNr;
5096 position,yyextra->parseMore,newEntryNeeded);
5098 return yyextra->parseMore;
5103 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5105 bool sectionEnabled =
false;
5110 bool parentEnabled = yyextra->guards->top().parentVisible();
5114 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5115 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5119 yyextra->guards->top().setEnabled(
true);
5120 yyextra->guards->top().setEnabledFound();
5121 BEGIN( GuardParamEnd );
5125 if (yyextra->guards->top().isEnabledFound())
5127 yyextra->guards->top().setEnabled(
false);
5128 BEGIN( SkipGuardedSection );
5130 else if (sectionEnabled)
5132 yyextra->guards->top().setEnabled(
true);
5133 yyextra->guards->top().setEnabledFound();
5134 BEGIN( GuardParamEnd );
5138 yyextra->guards->top().setEnabled(
false);
5139 BEGIN( SkipGuardedSection );
5144 BEGIN( SkipGuardedSection );
5149 BEGIN( SkipGuardedSection );
5155 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5156 yyextra->docGroup.initGroupInfo(entry);
5161 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5162 yyextra->docGroup.enterFile(fileName,lineNr);
5167 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5168 yyextra->docGroup.leaveFile(fileName,lineNr);
5173 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5174 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5179 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5180 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5185 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5186 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5191 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5192 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5201#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
T * add(const char *k, Args &&... args)
const T * find(const std::string &key) const
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 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
Class representing a regular expression.
Object representing the matching results.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
#define AUTO_TRACE_EXIT(...)
Translator * theTranslator
QCString trunc(const QCString &s, size_t numChars=15)
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.