14%option never-interactive
15%option prefix="commentscanYY"
17%option extra-type="struct commentscanYY_state *"
21#define YY_TYPEDEF_YY_SCANNER_T
37#include <unordered_map>
211static const std::unordered_map< std::string, DocCmdMap >
docCmdMap =
417#define YY_NO_UNISTD_H 1
418#define YY_NEVER_INTERACTIVE 1
551 const QCString &listTitle,
bool append);
568#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
573#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
576static inline const char *
getLexerFILE() {
return __FILE__;}
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.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static const char * stateToString(int state)
static const char * getLexerFILE()
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.
584TABLE ("table"|"TABLE")
585TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
595CAPTION ("caption"|"CAPTION")
596CENTER ("center"|"CENTER")
598DETAILS ("details"|"DETAILS")
599BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
600DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
601DETAILEDHTMLOPT {CODE}
602DETAILEDHTMLOPTEND {ENDCODE}
603SUMMARY ("summary"|"SUMMARY")
604REMARKS ("remarks"|"REMARKS")
606ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
611DOCNL "\n"|"\\ilinebr"
614FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
615FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
616FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
617ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
618LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
619REQID [a-z_A-Z0-9\x80-\xFF\-]+
620CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
621CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
622CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
623SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
624SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
625TMPLSPEC "<"{BN}*[^>]+{BN}*">"
626MAILADDR ("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\-]+
627RCSTAG "$"{ID}":"[^\n$]+"$"
628MODULE_ID ({ID}".")*{ID}
629LINENR {Bopt}[1-9][0-9]*
630IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
688%x ReadFormulaShortSection
690%x ReadFormulaRoundSection
704%x RaiseWarningSection
733<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
736<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
742<Comment>"\""[^"\n]*"\"" {
745<Comment>("\\"[a-z_A-Z]+)+"\\" {
748<Comment>"<"{DETAILEDHTML}{ATTR}">" {
750 int spacePos = htmlOpenTag.find(
' ');
751 if (spacePos==-1) spacePos=yyleng-1;
752 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
754 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
762<Comment>"</"{DETAILEDHTML}">" {
764 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
766 if (!yyextra->htmlContextStack.empty() &&
767 yyextra->htmlContextStack.back().tagName==htmlTagName)
774 yyextra->htmlContextStack.pop_back();
778<Comment>"<"{DETAILEDHTMLOPT}">" {
780 if (yyextra->current->lang==SrcLangExt::CSharp)
782 yyextra->CScode=
true;
792<Comment>"<"{DETAILEDHTMLOPTEND}">" {
796 yyextra->CScode=
false;
800 yyextra->CScode=
false;
805<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
807 if (yyextra->current->lang==SrcLangExt::CSharp)
814<Comment>"<"{DETAILS}{ATTR}">" {
815 yyextra->htmlDetailsStack.push_back(0);
816 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
823<Comment>"</"{DETAILS}">" {
824 if (!yyextra->htmlDetailsStack.empty())
826 yyextra->htmlDetailsStack.pop_back();
828 if (!yyextra->htmlContextStack.empty() &&
829 yyextra->htmlContextStack.back().tagName==
"details")
836 yyextra->htmlContextStack.pop_back();
841 yyextra->htmlAnchorStr = yytext;
842 yyextra->htmlAnchor =
false;
846 yyextra->htmlAnchorStr += yytext;
851 if (c==
'\'' || c==
'"')
853 int e=tag.find(c,s+2);
856 id=tag.mid(s+2,e-s-2);
865 if (!
id.isEmpty() && !yyextra->htmlAnchor)
871 yyextra->htmlAnchor =
true;
874<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
875 yyextra->htmlAnchorStr += yytext;
878 if (!yyextra->htmlAnchor)
880 addOutput(yyscanner,yyextra->htmlAnchorStr);
893 yyextra->htmlAnchorStr += yytext;
894 if (*yytext ==
'\n') yyextra->lineNr++;
897 yyextra->htmlAnchorStr += yytext;
899<Comment>"<"{SUMMARY}">" {
900 if (yyextra->htmlDetailsStack.empty())
909<Comment>"<"{REMARKS}">" {
913<Comment>"</"{SUMMARY}">" {
914 if (!yyextra->htmlDetailsStack.empty())
923<Comment>"</"{REMARKS}">" {
927<Comment>"<"{CAPTION}{ATTR}">" {
929 int s=tag.find(
"id=");
933 if (c==
'\'' || c==
'"')
935 int e=tag.find(c,s+4);
945<Comment>"<"{PRE}{ATTR}">" {
946 yyextra->insidePre=
TRUE;
949<Comment>"</"{PRE}">" {
950 yyextra->insidePre=
FALSE;
960<Comment>"<!\[CDATA\[" {
963<Comment>{B}*{CMD}"endinternal"{B}* {
965 if (!yyextra->inInternalDocs)
966 warn(yyextra->fileName,yyextra->lineNr,
967 "found \\endinternal without matching \\internal"
969 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
971<Comment>{B}*"\\ilinebr "{B}* {
974<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
984<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
985<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
988 int idx = fullMatch.
find(
'{');
990 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
991 int idxEnd = fullMatch.
find(
"}",idx+1);
1009 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1010 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1013 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1015 yyextra->briefEndsAtDot=
FALSE;
1021 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1026 yyextra->parseMore=
TRUE;
1028 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1031 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.
1043<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1046<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1053 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...
1059<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1061 yyextra->formulaText=
"";
1062 yyextra->formulaPreText=
"\\begin";
1063 yyextra->formulaPostText=
"";
1065 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1068 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1070 yyextra->formulaPreText+=yyextra->formulaEnv;
1071 yyextra->formulaNewLines=0;
1072 BEGIN(ReadFormulaLong);
1074<Comment>{B}*{CMD}"f$" {
1075 yyextra->formulaText=
"";
1076 yyextra->formulaPreText=
"$";
1077 yyextra->formulaPostText=
"";
1078 yyextra->formulaNewLines=0;
1079 BEGIN(ReadFormulaShort);
1081<Comment>{B}*{CMD}"f(" {
1082 yyextra->formulaText=
"";
1083 yyextra->formulaPreText=
"";
1084 yyextra->formulaPostText=
"";
1085 yyextra->formulaNewLines=0;
1086 BEGIN(ReadFormulaRound);
1088<Comment>{B}*{CMD}"f[" {
1090 yyextra->formulaText=
"";
1091 yyextra->formulaPreText=
"\\[";
1092 yyextra->formulaPostText=
"";
1093 yyextra->formulaNewLines=0;
1094 BEGIN(ReadFormulaLong);
1096<Comment>{B}*{CMD}"{" {
1098 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1100<Comment>{B}*{CMD}"}" {
1102 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1103 yyextra->docGroup.clearHeader();
1104 yyextra->parseMore=
TRUE;
1105 yyextra->needNewEntry =
TRUE;
1106 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1109<Comment>{B}*{CMD}[$@\\&~<>#%] {
1112<Comment>[a-z_A-Z]+ {
1115<Comment>^{B}*"."{Bopt}/\n {
1118<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1119<Comment>^{B}*[*+]{B}+ {
1120 if (!yyextra->markdownSupport)
1128 yyextra->briefEndsAtDot=
FALSE;
1134<Comment>^{B}*"-"{B}+ {
1137 yyextra->briefEndsAtDot=
FALSE;
1142<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1145<Comment>{CMD}"---" {
1152 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1155 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1160 yyextra->briefEndsAtDot=
FALSE;
1165<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1166<Comment>("."+)[a-z_A-Z0-9\)] {
1170<Comment>{CMD}[\.?!] {
1174<Comment>".\\"[ \t] {
1181<Comment>"...\\"[ \t] {
1184<Comment>"..."/[^\.] {
1187<Comment>".."[\.]?/[^ \t\n] {
1190<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1196 for (i=0;i<(yy_size_t)yyleng;)
1198 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1199 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1206 for (i=0;i<(yy_size_t)yyleng;)
1208 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1209 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1224 if (yyextra->briefEndsAtDot)
1227 yyextra->briefEndsAtDot=
FALSE;
1232 if (*yytext ==
'\n') yyextra->lineNr++;
1234<Comment>"<"[/]?{TABLEDEL}">" {
1252<HtmlComment>"---"[!]?">"{B}* {
1253 warn(yyextra->fileName,yyextra->lineNr,
1254 "incorrect HTML end comment --->"
1257<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1258<HtmlComment>{DOCNL} {
1265<HtmlComment>[^\\\n\-]+ {
1270<CdataSection>"\]\]>" {
1273<CdataSection>{DOCNL} {
1275 if (*yytext==
'\n') yyextra->lineNr++;
1277<CdataSection>[<>&] {
1281<CdataSection>[^\\\n\]<>&]+ {
1290<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1291 yyextra->formulaPostText+=
"$";
1294 if (YY_START == ReadFormulaShort)
1300 yyextra->sectionTitle+=
" "+form;
1301 BEGIN(SectionTitle);
1304<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1307 if (YY_START == ReadFormulaRound)
1313 yyextra->sectionTitle+=
" "+form;
1314 BEGIN(SectionTitle);
1317<ReadFormulaLong>{CMD}"f]" {
1318 yyextra->formulaPostText+=
"\\]";
1322<ReadFormulaLong>{CMD}"f}" {
1323 yyextra->formulaPostText+=
"\\end";
1324 yyextra->formulaPostText+=yyextra->formulaEnv;
1328<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1329 yyextra->formulaText+=yytext;
1331<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1332 yyextra->formulaNewLines++;
1333 yyextra->formulaText+=*yytext;
1335 addIline(yyscanner,yyextra->lineNr);
1337<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1338 yyextra->formulaText+=*yytext;
1343<EnumDocArg1>{SCOPEID} {
1345 yyextra->current->name = yytext;
1352<EnumDocArg1>{DOCNL} {
1353 warn(yyextra->fileName,yyextra->lineNr,
1354 "missing argument after '\\enum'."
1364<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)
1370<NameSpaceDocArg1>{LC} {
1374<NameSpaceDocArg1>{DOCNL} {
1375 warn(yyextra->fileName,yyextra->lineNr,
1376 "missing argument after '\\namespace'."
1381<NameSpaceDocArg1>. {
1386<PackageDocArg1>{ID}("."{ID})* {
1387 yyextra->current->name = yytext;
1390<PackageDocArg1>{LC} {
1394<PackageDocArg1>{DOCNL} {
1395 warn(yyextra->fileName,yyextra->lineNr,
1396 "missing argument after \\package."
1408<ConceptDocArg1>{SCOPEID} {
1410 yyextra->current->name = yytext;
1413<ConceptDocArg1>{LC} {
1417<ConceptDocArg1>{DOCNL} {
1418 warn(yyextra->fileName,yyextra->lineNr,
1419 "missing argument after '\\concept'."
1428<ModuleDocArg1>{MODULE_ID} {
1430 yyextra->current->name = yytext;
1433<ModuleDocArg1>{LC} {
1437<ModuleDocArg1>{DOCNL} {
1438 warn(yyextra->fileName,yyextra->lineNr,
1439 "missing argument after '\\module'."
1449<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1453 BEGIN( ClassDocArg2 );
1455<ClassDocArg1>{SCOPENAME} {
1458 yyextra->current->name =
substitute(yytext,
".",
"::");
1459 if (yyextra->current->section.isProtocolDoc())
1461 yyextra->current->name+=
"-p";
1464 BEGIN( ClassDocArg2 );
1466<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1469 yyextra->current->name =
substitute(yytext,
".",
"::");
1470 BEGIN( ClassDocArg2 );
1472<ClassDocArg1,CategoryDocArg1>{LC} {
1476<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1477 warn(yyextra->fileName,yyextra->lineNr,
1478 "missing argument after '\\{}'.",yyextra->currentCmd
1483<ClassDocArg1,CategoryDocArg1>. {
1486<ClassDocArg2>{DOCNL} {
1490<ClassDocArg2>{FILE}|"<>" {
1491 yyextra->current->includeFile = yytext;
1492 BEGIN( ClassDocArg3 );
1501<ClassDocArg3>[<"]?{FILE}?[">]? {
1502 yyextra->current->includeName = yytext;
1509<ClassDocArg3>{DOCNL} {
1519<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1520 yyextra->current->name = yytext;
1524 if (yyextra->current->name.endsWith(
".html"))
1526 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1528 else if (yyextra->current->name.endsWith(
".xhtml"))
1530 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1532 yyextra->current->type.clear();
1533 BEGIN(GroupDocArg2);
1535<GroupDocArg1>"\\"{B}*"\n" {
1539<GroupDocArg1>{DOCNL} {
1540 warn(yyextra->fileName,yyextra->lineNr,
1541 "missing group name after {}",
1542 yyextra->current->groupDocCmd()
1551<GroupDocArg2>"\\"{B}*"\n" {
1555<GroupDocArg2>[^\n\\]+ {
1556 yyextra->current->type += yytext;
1558<GroupDocArg2>{DOCNL}+ {
1559 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1561 yyextra->current->type.isEmpty()
1564 warn(yyextra->fileName,yyextra->lineNr,
1565 "missing title after "
1566 "\\defgroup {}", yyextra->current->name
1570 int extraLineNr = 0;
1573 for (
int i = 0; i < yyleng; i++)
1575 if (yytext[i]==
'\n') extraLineNr++;
1582 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1583 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1588 yyextra->current->type += yytext;
1593<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1597 int start = text.
find(
'{');
1598 int end = text.
find(
'}',start+1);
1599 yyextra->current->name = text.
mid(
end+2);
1600 int istart = yyextra->current->name.
find(
"\\ilinebr");
1603 QCString rest = yyextra->current->name.
mid(istart);
1605 yyextra->current->name = yyextra->current->name.mid(0,istart);
1607 yyextra->current->args = text.
mid(start+1,
end-start-1);
1609 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1611<PageDocArg1>{FILE} {
1613 yyextra->current->args =
"";
1614 BEGIN( PageDocArg2 );
1616<PageDocArg1>{LC} { yyextra->lineNr++;
1619<PageDocArg1>{DOCNL} {
1620 warn(yyextra->fileName,yyextra->lineNr,
1621 "missing argument after \\page."
1630<PageDocArg2>{DOCNL} {
1634 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1635 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1638<PageDocArg2>{CMD}[<>] {
1643 yyextra->current->args += tmp;
1646 yyextra->current->args += yytext;
1649<ParamArg1>{ID}/{B}*"," {
1656 if (*yytext==
'\n') yyextra->lineNr++;
1670<FileDocArg1>{DOCNL} {
1676<FileDocArg1>{FILE} {
1680<FileDocArg1>{LC} { yyextra->lineNr++;
1688<XRefItemParam1>{LABELID} {
1689 yyextra->newXRefItemKey=yytext;
1691 BEGIN(XRefItemParam2);
1693<XRefItemParam1>{LC} {
1697<XRefItemParam1>{DOCNL} {
1698 warn(yyextra->fileName,yyextra->lineNr,
1699 "Missing first argument of \\xrefitem"
1701 if (*yytext==
'\n') yyextra->lineNr++;
1709<XRefItemParam2>"\""[^\n\"]*"\"" {
1711 BEGIN(XRefItemParam3);
1713<XRefItemParam2>{LC} {
1717<XRefItemParam2>{DOCNL} {
1718 warn(yyextra->fileName,yyextra->lineNr,
1719 "Missing second argument of \\xrefitem"
1721 if (*yytext==
'\n') yyextra->lineNr++;
1729<XRefItemParam3>"\""[^\n\"]*"\"" {
1734<XRefItemParam2,XRefItemParam3>{LC} {
1738<XRefItemParam3>{DOCNL} {
1739 warn(yyextra->fileName,yyextra->lineNr,
1740 "Missing third argument of \\xrefitem"
1742 if (*yytext==
'\n') yyextra->lineNr++;
1753<RelatesParam1>({ID}("::"|"."))*{ID} {
1754 yyextra->current->relates = yytext;
1761<RelatesParam1>{LC} {
1765<RelatesParam1>{DOCNL} {
1766 warn(yyextra->fileName,yyextra->lineNr,
1767 "Missing argument of '\\{}' command",yyextra->currentCmd
1779<Qualifier>{LABELID} {
1780 yyextra->current->qualifiers.emplace_back(yytext);
1783<Qualifier>"\""[^\"]*"\"" {
1784 std::string inp(yytext);
1785 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1789 warn(yyextra->fileName,yyextra->lineNr,
1790 "Missing argument of '\\{}' command",yyextra->currentCmd
1796 warn(yyextra->fileName,yyextra->lineNr,
1797 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1803<ILine>{LINENR}/[\\@\n\.] |
1809 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1813 yyextra->lineNr = nr;
1816 if (YY_START == ILine)
1822 yyextra->sectionTitle+=yytext;
1823 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1826<ILine,ILineSection>. {
1828 if (YY_START == ILine)
1834 yyextra->sectionTitle+=yytext;
1835 BEGIN(SectionTitle);
1840<IRaise>{B}*[0-9]+/[\\@\n\.] |
1841<IRaise>{B}*[0-9]+{B} {
1846 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1850 yyextra->raiseLevel = nr;
1860<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1874<IFile,IFileSection>{FILE} {
1877 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1878 else yyextra->fileName = yytext;
1879 if (YY_START == IFile)
1885 yyextra->sectionTitle+=yytext;
1886 BEGIN(SectionTitle);
1890<LinkSection>[^\\@\n]* {
1891 yyextra->sectionTitle+=yytext;
1893<LinkSection>{CMD}{CMD} {
1894 yyextra->sectionTitle+=yytext;
1896<LinkSection>{DOCNL} {
1898 if (*yytext ==
'\n') yyextra->lineNr++;
1899 yyextra->sectionTitle+=yytext;
1901<LinkSection>{CMD}"endlink" {
1902 yyextra->sectionTitle+=yytext;
1903 BEGIN(SectionTitle);
1906 yyextra->sectionTitle+=yytext;
1908<LinkSection><<EOF>> {
1909 warn(yyextra->fileName,yyextra->lineNr,
1910 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1916<LineParam>{CMD}{CMD} {
1929<LineParam>({CMD}{CMD}){ID} {
1938<SectionLabel>{LABELID} {
1939 yyextra->sectionLabel+=yytext;
1941<SectionLabel>{CMD}"lineinfo"("{}")? {
QCString & setNum(short n)
1944<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1945 FileInfo fi(yyextra->fileName.str());
1946 bool hasOption =
false;
1948 if (yytext[yyleng-1] ==
'}')
1954 for (
const auto &opt_ : optList)
1957 std::string opt = optStripped.
lower().
str();
1963 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1973 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1985 label=yyextra->fileName;
1989 yyextra->sectionLabel+=label;
#define Config_getBool(name)
static QCString stripFromPath(const QCString &p, const StringVector &l)
1991<SectionLabel>{DOCNL} {
1992 yyextra->sectionTitle.clear();
1993 if (yyextra->sectionLabel.isEmpty())
1995 warn(yyextra->fileName,yyextra->lineNr,
1996 "\\section command has no label"
2001 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2002 addOutput(yyscanner,yyextra->sectionLabel.data());
2005 if (*yytext==
'\n') yyextra->lineNr++;
2010 if (yyextra->sectionLabel.isEmpty())
2012 warn(yyextra->fileName,yyextra->lineNr,
2013 "Invalid or missing section label"
2019 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2020 addOutput(yyscanner,yyextra->sectionLabel.data());
2021 yyextra->sectionTitle.clear();
2023 BEGIN(SectionTitle);
2026<SectionTitle>{STAopt}/"\n" {
2031<SectionTitle>{STopt}"\\\\ilinebr" {
2032 yyextra->sectionTitle+=yytext;
2034<SectionTitle>{STopt}/"\\ilinebr" {
2039<SectionTitle>{B}*{CMD}"f$" {
2040 yyextra->formulaText=
"";
2041 yyextra->formulaPreText=
"$";
2042 yyextra->formulaPostText=
"";
2043 yyextra->formulaNewLines=0;
2044 BEGIN(ReadFormulaShortSection);
2046<SectionTitle>{B}*{CMD}"f(" {
2047 yyextra->formulaText=
"";
2048 yyextra->formulaPreText=
"";
2049 yyextra->formulaPostText=
"";
2050 yyextra->formulaNewLines=0;
2051 BEGIN(ReadFormulaRoundSection);
2053<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2054<SectionTitle>{B}*{CMD}"f"[\[{] {
2058 warn(yyextra->fileName,yyextra->lineNr,
2059 "'\\{}' command is not allowed in section title, ending section title.",
2069<SectionTitle>[^\n@\\]* {
2070 yyextra->sectionTitle+=yytext;
2073<SectionTitle>{B}*{CMD}{CMD} {
2074 yyextra->sectionTitle+=yytext;
2077<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2078<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2080 int idx = fullMatch.
find(
'{');
2082 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2083 int idxEnd = fullMatch.
find(
"}",idx+1);
2099 switch (it->second.sectionHandling)
2104 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2105 yyextra->sectionTitle+=fullMatch.
left(i);
2106 yyextra->sectionTitle+=
'@';
2107 yyextra->sectionTitle+=fullMatch.
mid(i);
2111 warn(yyextra->fileName,yyextra->lineNr,
2112 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2120 warn(yyextra->fileName,yyextra->lineNr,
2121 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2129 if (cmdName ==
"fileinfo")
2132 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2133 yyextra->sectionTitle+=fullMatch.
left(i);
2138 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2143 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2147 else if (cmdName ==
"lineinfo")
2150 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2151 yyextra->sectionTitle+=fullMatch.
left(i);
2153 yyextra->sectionTitle+=
' ';
2154 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2160 else if (cmdName ==
"raisewarning")
2162 yyextra->raiseWarning =
"";
2163 BEGIN(RaiseWarningSection);
2165 else if (cmdName ==
"noop")
2170 else if (cmdName ==
"cite")
2172 yyextra->sectionTitle+=yytext;
2174 BEGIN(CiteLabelSection);
2176 else if (cmdName ==
"iline")
2178 yyextra->sectionTitle+=yytext;
2180 BEGIN(ILineSection);
2182 else if (cmdName ==
"ifile")
2184 yyextra->sectionTitle+=yytext;
2186 BEGIN(IFileSection);
2188 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2191 if (optList.empty())
2193 yyextra -> anchorTitle =
"";
2198 yyextra -> anchorTitle =
join(optList,
" ");
2201 BEGIN(AnchorLabelSection);
2203 else if (cmdName ==
"link")
2205 yyextra->sectionTitle+=yytext;
2210 yyextra->sectionTitle+=yytext;
2211 warn(yyextra->fileName,yyextra->lineNr,
2212 "internal error '\\{}' command is to be replaced in section title.",cmdName
2219 yyextra->sectionTitle+=yytext;
2227 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
2232 yyextra->sectionTitle+=yytext;
2238<SubpageLabel>{FILE} {
2242 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2243 BEGIN(SubpageTitle);
2245<SubpageLabel>{DOCNL} {
2246 warn(yyextra->fileName,yyextra->lineNr,
2247 "\\subpage command has no label"
2249 if (*yytext==
'\n') yyextra->lineNr++;
2257<SubpageTitle>{DOCNL} {
2261<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2272<AnchorLabel,AnchorLabelSection>{LABELID} {
2273 QCString lbl = yyextra->raisePrefix+yytext;
2274 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2276 if (YY_START == AnchorLabel)
2282 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2285<AnchorLabel,AnchorLabelSection>{DOCNL} {
2286 warn(yyextra->fileName,yyextra->lineNr,
2287 "\\anchor command has no label"
2289 if (*yytext==
'\n') yyextra->lineNr++;
2291 if (YY_START == AnchorLabel)
2297 BEGIN(SectionTitle);
2300<AnchorLabel,AnchorLabelSection>. {
2301 warn(yyextra->fileName,yyextra->lineNr,
2302 "Invalid or missing anchor label"
2305 if (YY_START == AnchorLabel)
2311 BEGIN(SectionTitle);
2317<RequirementLabel>{REQID} {
2318 yyextra->current->name = yytext;
2319 yyextra->current->type.clear();
2320 BEGIN( RequirementTitle );
2322<SatisfiesLabel>{REQID} {
2323 yyextra->reqId = yytext;
2324 yyextra->reqTitle.clear();
2325 BEGIN( SatisfiesTitle );
2327<VerifiesLabel>{REQID} {
2328 yyextra->reqId = yytext;
2329 yyextra->reqTitle.clear();
2330 BEGIN( VerifiesTitle );
2332<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2336<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2337 warn(yyextra->fileName,yyextra->lineNr,
2338 "missing requirement ID after \\requirement command"
2343<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2346<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2350<RequirementTitle>[^\n\\]+ {
2351 yyextra->current->type += yytext;
2353<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2354 yyextra->reqTitle += yytext;
2356<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2357 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2362<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2363 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2365 if (yyextra->current->section.isRequirementDoc())
2367 warn(yyextra->fileName,yyextra->lineNr,
2368 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2381<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2382 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2384 if (yyextra->current->section.isRequirementDoc())
2386 warn(yyextra->fileName,yyextra->lineNr,
2387 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2400<RequirementTitle>. {
2401 yyextra->current->type += yytext;
2403<SatisfiesTitle,VerifiesTitle>. {
2404 yyextra->reqTitle += yytext;
2410<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2412 if (&yytext[4]==yyextra->blockName)
2417<FormatBlock>{CMD}"enduml" {
2419 if (yyextra->blockName==
"startuml")
2424<FormatBlock>[^ \@\*\/\\\n]* {
2427<FormatBlock>{DOCNL} {
2428 if (*yytext==
'\n') yyextra->lineNr++;
2432 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2433 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2434 yyextra->blockName==
"iliteral"
2436 ) yyextra->commentCount++;
2441 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2442 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2443 yyextra->blockName==
"iliteral"
2447 yyextra->commentCount--;
2448 if (yyextra->commentCount<0)
2450 QCString endTag =
"end"+yyextra->blockName;
2451 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2452 warn(yyextra->fileName,yyextra->lineNr,
2453 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2454 yyextra->blockName,endTag);
2461<FormatBlock><<EOF>> {
2462 QCString endTag =
"end"+yyextra->blockName;
2463 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2464 warn(yyextra->fileName,yyextra->lineNr,
2465 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2466 yyextra->blockName,endTag
2473<GuardParam>{B}*"(" {
2474 yyextra->guardExpr=yytext;
2475 yyextra->roundCount=1;
2479 yyextra->guardExpr+=yytext;
2483 yyextra->guardExpr+=yytext;
2484 yyextra->roundCount++;
2487 yyextra->guardExpr+=yytext;
2488 yyextra->roundCount--;
2489 if (yyextra->roundCount==0)
2495 warn(yyextra->fileName,yyextra->lineNr,
2496 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2500<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2503<GuardParam>{DOCNL} {
2518<GuardParamEnd>{B}*{DOCNL} {
2520 yyextra->spaceBeforeIf.clear();
2524<GuardParamEnd>{B}* {
2525 if (!yyextra->spaceBeforeIf.isEmpty())
2527 addOutput(yyscanner,yyextra->spaceBeforeIf);
2529 yyextra->spaceBeforeIf.clear();
2541<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2543 yyextra->guards->emplace(
false);
2544 BEGIN( GuardParam );
2546<SkipGuardedSection>{CMD}"if"/{NW} {
2548 yyextra->guards->emplace(
false);
2549 BEGIN( GuardParam );
2551<SkipGuardedSection>{CMD}"endif"/{NW} {
2552 if (yyextra->guards->empty())
2554 warn(yyextra->fileName,yyextra->lineNr,
2555 "found \\endif without matching start command");
2560 yyextra->guards->pop();
2561 if (yyextra->guards->empty())
2563 BEGIN( GuardParamEnd );
2567 if (yyextra->guards->top().isEnabled())
2569 BEGIN( GuardParamEnd );
2573 BEGIN( SkipGuardedSection );
2578<SkipGuardedSection>{CMD}"else"/{NW} {
2579 if (yyextra->guards->empty())
2581 warn(yyextra->fileName,yyextra->lineNr,
2582 "found \\else without matching start command");
2584 else if (yyextra->guards->top().hasElse())
2586 warn(yyextra->fileName,yyextra->lineNr,
2587 "found multiple \\else commands in same \\if construct");
2588 yyextra->guards->top().setEnabled(
false);
2589 BEGIN( SkipGuardedSection );
2591 else if (!yyextra->guards->top().parentVisible())
2593 yyextra->guards->top().setEnabled(
false);
2594 BEGIN( SkipGuardedSection );
2598 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2599 yyextra->guards->top().setElse();
2600 if (!yyextra->guards->top().parentVisible())
2602 yyextra->guards->top().setEnabled(
false);
2603 BEGIN( SkipGuardedSection );
2605 else if (yyextra->guards->top().isEnabledFound())
2607 yyextra->guards->top().setEnabled(
false);
2608 BEGIN( SkipGuardedSection );
2612 yyextra->guards->top().setEnabled(
true);
2613 BEGIN( GuardParamEnd );
2617<SkipGuardedSection>{CMD}"elseif"/{NW} {
2618 if (yyextra->guards->empty())
2620 warn(yyextra->fileName,yyextra->lineNr,
2621 "found \\elseif without matching start command");
2623 else if (yyextra->guards->top().hasElse())
2625 warn(yyextra->fileName,yyextra->lineNr,
2626 "found \\elseif command after \\else command was given in \\if construct");
2628 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2629 yyextra->guards->top().setEnabled(
false);
2630 BEGIN( GuardParam );
2635 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2636 yyextra->guards->top().setEnabled(
false);
2637 BEGIN( GuardParam );
2640<SkipGuardedSection>{DOCNL} {
2641 if (*yytext==
'\n') yyextra->lineNr++;
2644<SkipGuardedSection>[^ \\@\n]+ {
2646<SkipGuardedSection>{CMD}{CMD} |
2647<SkipGuardedSection>. {
2653<SkipInternal>{DOCNL} {
2654 if (*yytext==
'\n') yyextra->lineNr++;
2657<SkipInternal>{CMD}"if"/[ \t] {
2658 yyextra->condCount++;
2660<SkipInternal>{CMD}"ifnot"/[ \t] {
2661 yyextra->condCount++;
2663<SkipInternal>{CMD}/"endif" {
2664 yyextra->condCount--;
2665 if (yyextra->condCount<0)
2671<SkipInternal>{CMD}/"section"[ \t] {
2672 if (yyextra->sectionLevel>0)
2678<SkipInternal>{CMD}/"subsection"[ \t] {
2679 if (yyextra->sectionLevel>1)
2685<SkipInternal>{CMD}/"subsubsection"[ \t] {
2686 if (yyextra->sectionLevel>2)
2692<SkipInternal>{CMD}/"paragraph"[ \t] {
2693 if (yyextra->sectionLevel>3)
2699<SkipInternal>{CMD}/"subparagraph"[ \t] {
2700 if (yyextra->sectionLevel>4)
2706<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2707 if (yyextra->sectionLevel>5)
2713<SkipInternal>{CMD}"endinternal"[ \t]* {
2716<SkipInternal>[^ \\@\n]+ {
2733 yyextra->docGroup.appendHeader(
' ');
2736 yyextra->docGroup.appendHeader(*yytext);
2737 yyextra->current->name+=*yytext;
2752<RaiseWarning,RaiseWarningSection>{DOCNL} {
2754 "{}",yyextra->raiseWarning);
2755 yyextra->raiseWarning =
"";
2756 if (*yytext==
'\n') yyextra->lineNr++;
2758 if (YY_START == RaiseWarning)
2764 yyextra->sectionTitle+=yytext;
2765 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2768<RaiseWarning,RaiseWarningSection>. {
2769 yyextra->raiseWarning += yytext;
2773<InGroupParam>{LABELID} {
2774 yyextra->current->groups.emplace_back(
2777 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2779<InGroupParam>{DOCNL} {
2780 if (!yyextra->inGroupParamFound)
2782 warn(yyextra->fileName,yyextra->lineNr,
2783 "Missing group name for \\ingroup command"
2802 if (yyextra->braceCount==0)
2804 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2806 warn(yyextra->fileName,yyextra->lineNr,
2807 "missing argument after '\\{}'.",yyextra->currentCmd
2813 yyextra->langParser->parsePrototype(yyextra->functionProto);
2821 yyextra->functionProto+=
' ';
2823<FnParam>[^@\\\n()]+ {
2824 yyextra->functionProto+=yytext;
2827 yyextra->functionProto+=yytext;
2828 yyextra->braceCount++;
2831 yyextra->functionProto+=yytext;
2832 yyextra->braceCount--;
2835 yyextra->functionProto+=*yytext;
2842<OverloadParam>{DOCNL} {
2843 if (*yytext==
'\n') yyextra->lineNr++;
2844 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2852 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2856<OverloadParam>{LC} {
2858 yyextra->functionProto+=
' ';
2861 yyextra->functionProto+=*yytext;
2866<InheritParam>({ID}("::"|"."))*{ID} {
2867 yyextra->current->extends.emplace_back(
2872<InheritParam>{DOCNL} {
2873 warn(yyextra->fileName,yyextra->lineNr,
2874 "\\inherit command has no argument"
2876 if (*yytext==
'\n') yyextra->lineNr++;
2881 warn(yyextra->fileName,yyextra->lineNr,
2882 "Invalid or missing name for \\inherit command"
2889<ExtendsParam>({ID}("::"|"."))*{ID} {
2890 yyextra->current->extends.emplace_back(
2895<ExtendsParam>{DOCNL} {
2896 warn(yyextra->fileName,yyextra->lineNr,
2897 "'\\{}' command has no argument",yyextra->currentCmd
2909<SkipLang>{CMD}"~"[a-zA-Z-]* {
2913 warn(yyextra->fileName,yyextra->lineNr,
2922<SkipLang>[^*@\\\n]* {
2925 if (*yytext==
'\n') yyextra->lineNr++;
2932<CiteLabel,CiteLabelSection>{CITEID} {
2935 if (YY_START == CiteLabel)
2941 yyextra->sectionTitle+=yytext;
2942 BEGIN(SectionTitle);
2945<CiteLabel,CiteLabelSection>{DOCNL} {
2946 warn(yyextra->fileName,yyextra->lineNr,
2947 "\\cite command has no label"
2951 if (YY_START == CiteLabel)
2958 yyextra->sectionTitle+=yytext;
2960 BEGIN(SectionTitle);
2963<CiteLabel,CiteLabelSection>. {
2964 warn(yyextra->fileName,yyextra->lineNr,
2965 "Invalid or missing cite label"
2967 if (YY_START == CiteLabel)
2973 yyextra->sectionTitle+=yytext;
2974 BEGIN(SectionTitle);
2982 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2983 addOutput(yyscanner,yyextra->copyDocArg);
2987<CopyDoc>"<"[/]?{TABLEDEL}">" {
2988 if (yyextra->braceCount==0)
2991 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2992 addOutput(yyscanner,yyextra->copyDocArg);
2998 if (*yytext==
'\n') yyextra->lineNr++;
2999 if (yyextra->braceCount==0)
3002 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3003 addOutput(yyscanner,yyextra->copyDocArg);
3011<CopyDoc>[^@\\\n()<]+ {
3012 yyextra->copyDocArg+=yytext;
3016 yyextra->copyDocArg+=yytext;
3018 yyextra->braceCount++;
3021 yyextra->copyDocArg+=yytext;
3023 yyextra->braceCount--;
3026 yyextra->copyDocArg+=yytext;
3048 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3049 yyextra->braceCount=0;
3050 yyextra->functionProto.clear();
3051 yyextra->currentCmd = cmd;
3052 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3059 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3060 yyextra->functionProto.clear();
3061 yyextra->braceCount=0;
3062 yyextra->currentCmd = cmd;
3063 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3070 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3071 yyextra->functionProto.clear();
3072 BEGIN(OverloadParam);
3078 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3079 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3080 BEGIN( EnumDocArg1 );
3086 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3089 BEGIN( GroupDocArg1 );
3095 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3098 BEGIN( GroupDocArg1 );
3104 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3107 BEGIN( GroupDocArg1 );
3113 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3114 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3115 BEGIN( NameSpaceDocArg1 );
3121 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3123 BEGIN( PackageDocArg1 );
3129 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3130 yyextra->currentCmd = cmd;
3131 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3132 BEGIN( ClassDocArg1 );
3138 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3139 yyextra->currentCmd = cmd;
3140 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3141 BEGIN( ConceptDocArg1 );
3147 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3148 yyextra->currentCmd = cmd;
3149 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3150 BEGIN( ModuleDocArg1 );
3156 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3157 BEGIN( ClassDocArg2 );
3163 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3164 yyextra->currentCmd = cmd;
3165 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3166 BEGIN( ClassDocArg1 );
3172 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3173 yyextra->currentCmd = cmd;
3174 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3175 BEGIN( CategoryDocArg1 );
3181 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3182 yyextra->currentCmd = cmd;
3183 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3184 BEGIN( ClassDocArg1 );
3190 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3191 yyextra->currentCmd = cmd;
3192 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3193 BEGIN( ClassDocArg1 );
3199 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3200 yyextra->currentCmd = cmd;
3201 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3202 BEGIN( ClassDocArg1 );
3208 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3209 yyextra->currentCmd = cmd;
3210 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3211 BEGIN( ClassDocArg1 );
3217 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3219 BEGIN( PageDocArg1 );
3225 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3229 yyextra->current->name =
"mainpage";
3232 BEGIN( PageDocArg2 );
3238 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3242 yyextra->current->name = yyextra->fileName;
3244 BEGIN( FileDocArg1 );
3250 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3260 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3268 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3270 if (!stop) yyextra->current->name = yyextra->fileName;
3271 BEGIN( FileDocArg1 );
3277 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3279 for (
const auto &opt : optList)
3283 sectionMaker=EntryType::makeExampleLineno;
3287 warn(yyextra->fileName,yyextra->lineNr,
3288 "unsupported option '{}' for command '\\{}'",opt,cmd);
3292 if (!stop) yyextra->current->name = yyextra->fileName;
3293 BEGIN( FileDocArg1 );
3299 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3302 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3311 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3312 yyextra->raiseWarning =
"";
3313 BEGIN( RaiseWarning );
3319 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3326 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3330 yyextra->docGroup.clearHeader();
3332 if (!yyextra->docGroup.isEmpty())
3334 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3342 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3351 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3360 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3369 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3378 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3380 BEGIN(XRefItemParam1);
3386 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3387 if (yyextra->insideParBlock)
3389 warn(yyextra->fileName,yyextra->lineNr,
3390 "found \\parblock command while already in a parblock!");
3392 if (!yyextra->spaceBeforeCmd.isEmpty())
3394 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3395 yyextra->spaceBeforeCmd.clear();
3398 yyextra->insideParBlock =
TRUE;
3404 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3405 if (!yyextra->insideParBlock)
3407 warn(yyextra->fileName,yyextra->lineNr,
3408 "found \\endparblock command without matching \\parblock!");
3412 yyextra->insideParBlock =
FALSE;
3418 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3419 if (!yyextra->current->relates.isEmpty())
3421 warn(yyextra->fileName,yyextra->lineNr,
3422 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3424 yyextra->current->relatesType = RelatesType::Simple;
3425 yyextra->currentCmd = cmd;
3426 BEGIN(RelatesParam1);
3432 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3433 if (!yyextra->current->relates.isEmpty())
3435 warn(yyextra->fileName,yyextra->lineNr,
3436 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3438 yyextra->current->relatesType = RelatesType::Duplicate;
3439 yyextra->currentCmd = cmd;
3440 BEGIN(RelatesParam1);
3446 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3447 if (!yyextra->current->relates.isEmpty())
3449 warn(yyextra->fileName,yyextra->lineNr,
3450 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3452 yyextra->current->relatesType = RelatesType::MemberOf;
3453 yyextra->currentCmd = cmd;
3454 BEGIN(RelatesParam1);
3460 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3468 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3471 BEGIN(SectionLabel);
3472 yyextra->sectionLabel.clear();
3481 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3483 switch (yyextra->sectionLevel)
3491 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3498 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3500 BEGIN( RequirementLabel );
3506 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3507 BEGIN( SatisfiesLabel );
3513 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3514 BEGIN( VerifiesLabel );
3520 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3521 if (!yyextra->current->section.isEmpty() &&
3522 !yyextra->current->section.isPageDoc() &&
3523 !yyextra->current->section.isMainpageDoc()
3526 warn(yyextra->fileName,yyextra->lineNr,
3527 "found \\subpage command in a comment block that is not marked as a page!");
3529 if (!yyextra->spaceBeforeCmd.isEmpty())
3531 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3532 yyextra->spaceBeforeCmd.clear();
3535 BEGIN(SubpageLabel);
3541 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3543 if (optList.empty())
3545 yyextra -> anchorTitle =
"";
3549 yyextra -> anchorTitle =
join(optList,
" ");
3557 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3558 for (
const auto &opt : optList)
3568 if (optList.empty())
3582 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3583 if (!yyextra->spaceBeforeCmd.isEmpty())
3585 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3586 yyextra->spaceBeforeCmd.clear();
3588 if (optList.empty())
3602 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3603 if (!yyextra->spaceBeforeCmd.isEmpty())
3605 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3606 yyextra->spaceBeforeCmd.clear();
3608 if (optList.empty())
3617 yyextra->blockName=s;
3618 yyextra->commentCount=0;
3625 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3643 static std::unordered_map<std::string,OptionFunc> options =
3646 {
"name", [](
const FileInfo &fi_) ->
QCString {
return fi_.baseName(); } },
3647 {
"extension", [](
const FileInfo &fi_) ->
QCString {
return fi_.extension(
true); } },
3648 {
"filename", [](
const FileInfo &fi_) ->
QCString {
return fi_.fileName(); } },
3649 {
"directory", [](
const FileInfo &fi_) ->
QCString {
return fi_.dirPath(); } },
3650 {
"full", [](
const FileInfo &fi_) ->
QCString {
return fi_.absFilePath(); } }
3652 auto it = options.
find(optionName);
3653 return (it!=options.end()) ? it->second(fi) :
QCString();
3658 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3659 if (!yyextra->spaceBeforeCmd.isEmpty())
3661 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3662 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3663 yyextra->spaceBeforeCmd.clear();
3666 FileInfo fi(yyextra->fileName.str());
3667 for (
const auto &opt_ : optList)
3670 std::string opt = optStripped.
lower().
str();
3676 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3683 yyextra->sectionTitle+=result;
3690 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3697 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3702 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3711 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3712 if (!yyextra->spaceBeforeCmd.isEmpty())
3714 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3715 yyextra->spaceBeforeCmd.clear();
3723 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3731 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3739 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3746 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3748 BEGIN(IRaisePrefix);
3754 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3756 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3757 if (yyextra->guards->empty())
3759 yyextra->guards->emplace(
true);
3763 bool enabled = yyextra->guards->top().isEnabled();
3764 yyextra->guards->emplace(enabled);
3772 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3774 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3775 if (yyextra->guards->empty())
3777 yyextra->guards->emplace(
true);
3781 bool enabled = yyextra->guards->top().isEnabled();
3782 yyextra->guards->emplace(enabled);
3790 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3791 if (yyextra->guards->empty())
3793 warn(yyextra->fileName,yyextra->lineNr,
3794 "found \\elseif without matching start command");
3796 else if (yyextra->guards->top().hasElse())
3798 warn(yyextra->fileName,yyextra->lineNr,
3799 "found \\elseif command after \\else command was given in \\if construct");
3801 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3802 yyextra->guards->top().setEnabled(
false);
3808 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3809 yyextra->guards->top().setEnabled(
false);
3817 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3818 if (yyextra->guards->empty())
3820 warn(yyextra->fileName,yyextra->lineNr,
3821 "found \\else without matching start command");
3823 else if (yyextra->guards->top().hasElse())
3825 warn(yyextra->fileName,yyextra->lineNr,
3826 "found multiple \\else commands in same \\if construct");
3827 yyextra->guards->top().setEnabled(
false);
3828 yyextra->guards->top().setElse();
3829 BEGIN( SkipGuardedSection );
3833 yyextra->guards->top().setElse();
3834 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3835 if (yyextra->guards->top().isEnabledFound())
3837 yyextra->guards->top().setEnabled(
false);
3838 BEGIN( SkipGuardedSection );
3842 yyextra->guards->top().setEnabled(
true);
3843 BEGIN( GuardParamEnd );
3851 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3852 if (yyextra->guards->empty())
3854 warn(yyextra->fileName,yyextra->lineNr,
3855 "found \\endif without matching start command");
3859 yyextra->guards->pop();
3861 if (!yyextra->spaceBeforeCmd.isEmpty())
3863 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3864 yyextra->spaceBeforeCmd.clear();
3866 if (yyextra->guards->empty())
3868 BEGIN( GuardParamEnd );
3872 if (yyextra->guards->top().isEnabled())
3874 BEGIN( GuardParamEnd );
3878 BEGIN( SkipGuardedSection );
3886 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3887 yyextra->inGroupParamFound=
FALSE;
3888 BEGIN( InGroupParam );
3894 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3895 yyextra->current->subGrouping =
FALSE;
3901 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3902 yyextra->current->initLines = 100000;
3908 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3909 yyextra->current->initLines = 0;
3915 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3916 yyextra->current->commandOverrides.override_callGraph(
true);
3922 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3923 yyextra->current->commandOverrides.override_callGraph(
false);
3929 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3930 yyextra->current->commandOverrides.override_callerGraph(
true);
3936 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3937 yyextra->current->commandOverrides.override_callerGraph(
false);
3943 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3944 yyextra->current->commandOverrides.override_enumValues(
true);
3950 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3951 yyextra->current->commandOverrides.override_enumValues(
false);
3957 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3958 yyextra->current->commandOverrides.override_inlineSource(
true);
3964 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3965 yyextra->current->commandOverrides.override_inlineSource(
false);
3971 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3972 yyextra->current->commandOverrides.override_includeGraph(
true);
3978 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3979 yyextra->current->commandOverrides.override_includedByGraph(
true);
3985 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3986 yyextra->current->commandOverrides.override_includeGraph(
false);
3992 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3993 yyextra->current->commandOverrides.override_includedByGraph(
false);
3999 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4000 yyextra->current->commandOverrides.override_directoryGraph(
true);
4006 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4007 yyextra->current->commandOverrides.override_directoryGraph(
false);
4013 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4014 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4020 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4021 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4027 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4028 yyextra->current->commandOverrides.override_groupGraph(
true);
4034 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4035 yyextra->current->commandOverrides.override_groupGraph(
false);
4041 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4042 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4043 for (
const auto &opt_ : optList)
4050 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4052 else if (opt ==
"graph")
4054 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4056 else if (opt ==
"builtin")
4058 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4060 else if (opt ==
"text")
4062 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4064 else if (opt ==
"no")
4066 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4070 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4080 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4081 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4087 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4088 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4094 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4095 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4101 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4102 yyextra->current->commandOverrides.override_referencesRelation(
true);
4108 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4109 yyextra->current->commandOverrides.override_referencesRelation(
false);
4115 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4116 yyextra->currentCmd = cmd;
4123 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4128 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4130 yyextra->current->doc.clear();
4132 yyextra->condCount=0;
4133 BEGIN( SkipInternal );
4139 yyextra->inInternalDocs =
TRUE;
4146 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4147 yyextra->current->isStatic =
TRUE;
4153 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4154 yyextra->current->virt = Specifier::Pure;
4160 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4161 yyextra->current->protection = Protection::Private;
4167 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4168 yyextra->current->protection = yyextra->protection = Protection::Private;
4174 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4175 yyextra->current->protection = Protection::Protected;
4181 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4182 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4188 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4189 yyextra->current->protection = Protection::Public;
4195 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4196 yyextra->current->protection = yyextra->protection = Protection::Public;
4202 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4203 if (yyextra->current->section.isPageDoc() ||
4204 yyextra->current->section.isMainpageDoc())
4206 for (
const auto &opt_ : optList)
4210 int i = opt.
find(
':');
4214 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4216 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4230 yyextra->current->localToc.enableHtml(level);
4232 else if (opt ==
"latex")
4234 yyextra->current->localToc.enableLatex(level);
4236 else if (opt ==
"xml")
4238 yyextra->current->localToc.enableXml(level);
4240 else if (opt ==
"docbook")
4242 yyextra->current->localToc.enableDocbook(level);
4246 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4251 if (yyextra->current->localToc.nothingEnabled())
4263 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4264 BEGIN(InheritParam);
4270 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4271 yyextra->currentCmd = cmd;
4272 BEGIN(ExtendsParam);
4278 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4279 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4285 if (!yyextra->spaceBeforeCmd.isEmpty())
4287 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4288 yyextra->spaceBeforeCmd.clear();
4296 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4298 if (!yyextra->spaceBeforeCmd.isEmpty())
4300 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4301 yyextra->spaceBeforeCmd.clear();
4309 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4310 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4316 if (!yyextra->spaceBeforeCmd.isEmpty())
4318 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4319 yyextra->spaceBeforeCmd.clear();
4322 yyextra->copyDocArg.clear();
4323 yyextra->braceCount = 0;
4332 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4333 yyextra->sectionLabel.clear();
4334 yyextra->sectionTitle.clear();
4335 yyextra->docGroup.clearHeader();
4336 yyextra->insideParBlock =
FALSE;
4343 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4345 return yyextra->current->section.isDoc();
4350 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4351 assert(maker!=
nullptr);
4353 if (yyextra->current->section.isDoc())
4359 yyextra->needNewEntry =
true;
4360 yyextra->current->section = maker();
4361 yyextra->current->fileName = yyextra->fileName;
4362 yyextra->current->startLine = yyextra->lineNr;
4363 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4376 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4377 for(
const char* c = yytext ; *c ; ++c )
4378 yyextra->lineNr += (*c ==
'\n') ;
4386 if (s==
nullptr || *s==0)
return name;
4388 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4399 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4402 QCString reqId = yyextra->current->name;
4408 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4413 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4415 yyextra->fileName,yyextra->lineNr,
4426 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4427 if (listName.
isEmpty())
return;
4434 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4447 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4455 item = refList->
add();
4459 item->
setText(yyextra->outputXRef);
4461 yyextra->current->sli.push_back(item);
4464 if (yyextra->inBody)
4466 yyextra->current->inbodyDocs += cmdString;
4470 yyextra->current->doc += cmdString;
4480 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4482 yyextra->sectionLevel);
4483 yyextra->current->anchors.push_back(si);
4485 else if (si->
lineNr() != -1)
4487 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4492 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4498 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4500 yyextra->sectionLevel);
4501 yyextra->current->anchors.push_back(si);
4505 yyextra->outputXRef.clear();
4515 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4519 for (
size_t i=1; i<label.
size(); i++)
4522 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4537 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4539 QCString formula = (yyextra->formulaPreText +
4540 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4548 formLabel.
sprintf(
"\\_form#%d",
id);
4549 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4566 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4574 if (addYYtext) yyextra->sectionTitle+=yytext;
4575 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4576 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4578 yyextra->sectionLevel);
4581 yyextra->current->anchors.push_back(si);
4583 else if (si->
lineNr() != -1)
4585 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4590 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4591 yyextra->sectionLabel,si->
fileName());
4597 if (addYYtext) yyextra->sectionTitle+=yytext;
4598 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4599 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4601 yyextra->sectionLevel);
4604 yyextra->current->anchors.push_back(si);
4613 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4615 if (yytext[0] ==
'"')
4618 name=name.
left((
int)yyleng-2);
4624static const reg::Ex nonBrief_re(R
"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))");
4634 if (c==
' ' || c==
'\t' || c==
'\r')
4657 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4658 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4660 yyextra->xrefAppendFlag = !yyextra->inBody &&
4662 yyextra->newXRefKind==yyextra->xrefKind &&
4664 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4680 switch(yyextra->xrefKind)
4712 yyextra->xrefItemTitle,
4713 yyextra->xrefListTitle,
4722 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4724 int oldContext = yyextra->inContext;
4725 yyextra->inContext = ctx;
4727 switch(yyextra->inContext)
4730 if (oldContext!=yyextra->inContext)
4733 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4734 if (yyextra->current->docFile.isEmpty())
4736 yyextra->current->docFile = yyextra->fileName;
4737 yyextra->current->docLine = yyextra->lineNr;
4740 yyextra->pOutputString = &yyextra->current->doc;
4744 if (oldContext!=yyextra->inContext)
4746 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4747 if (yyextra->current->briefFile.isEmpty())
4749 yyextra->current->briefFile = yyextra->fileName;
4750 yyextra->current->briefLine = yyextra->lineNr;
4753 bool foundMatch =
false;
4754 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4762 std::string str = yyextra->current->brief.str();
4767 for (
size_t i = 0; i <
match[2].str().size(); i++)
4769 if (match[2].str()[i] ==
'\n') cnt++;
4773 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4775 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4782 yyextra->pOutputString = &yyextra->current->brief;
4786 if (!yyextra->current->doc.isEmpty())
4788 yyextra->current->doc +=
"\n";
4790 yyextra->pOutputString = &yyextra->current->doc;
4796 yyextra->pOutputString = &yyextra->outputXRef;
4801 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4810 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4818 yyextra->current->anchors.push_back(si);
4820 else if (si->
lineNr() != -1)
4822 warn(yyextra->fileName,yyextra->lineNr,
4823 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4828 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4835 yyextra->current->anchors.push_back(si);
4842 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4844 *yyextra->pOutputString+=s;
4850 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4852 *yyextra->pOutputString+=s;
4858 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4859 *yyextra->pOutputString+=c;
4865 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4872 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4878 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4879 std::string_view str = yyextra->current->brief.view();
4884 yyextra->briefEndsAtDot=
FALSE;
4886 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4888 yyextra->current->docLine = yyextra->lineNr;
4889 yyextra->current->doc =
"";
4893 addIline(yyscanner,yyextra->lineNr);
4899 int saveLineNr = yyextra->lineNr;
4901 yyextra->current->briefLine = yyextra->lineNr;
4902 yyextra->lineNr = saveLineNr;
4908 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4909 yyextra->prevPosition=yyextra->inputPosition;
4911 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4913 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4924 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4925 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4926 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4927 YY_START==ReadFormulaLong)
4929 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4943 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4951 commentscanYYlex_destroy(
p->yyscanner);
4964 bool &newEntryNeeded,
4965 bool markdownSupport,
4969 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4971 isAutoBriefOn,isInbody,prot,markdownSupport);
4973 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4976 yyextra->guards = guards;
4977 yyextra->langParser = parser;
4978 yyextra->current = curEntry;
4979 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4981 yyextra->inputString =
comment;
4982 yyextra->inputString.append(
" ");
4983 yyextra->inputPosition = position;
4984 yyextra->lineNr = lineNr;
4985 yyextra->fileName = fileName;
4986 yyextra->protection = prot;
4987 yyextra->needNewEntry =
FALSE;
4989 yyextra->xrefAppendFlag =
FALSE;
4990 yyextra->insidePre =
FALSE;
4991 yyextra->parseMore =
FALSE;
4992 yyextra->inBody = isInbody;
4993 yyextra->markdownSupport= markdownSupport;
4994 yyextra->outputXRef.clear();
4995 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4997 yyextra->current->doc +=
'\n';
5000 yyextra->briefEndsAtDot = isAutoBriefOn;
5001 yyextra->condCount = 0;
5002 yyextra->sectionLevel = 0;
5003 yyextra->spaceBeforeCmd.clear();
5004 yyextra->spaceBeforeIf.clear();
5005 yyextra->htmlContextStack.clear();
5008 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
5011 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5012 yyextra->current->inbodyDocs+=cmd;
5016 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5019 commentscanYYrestart(
nullptr, yyscanner );
5021 commentscanYYlex(yyscanner);
5024 if (YY_START==OverloadParam)
5029 if (yyextra->insideParBlock)
5031 warn(yyextra->fileName,yyextra->lineNr,
5032 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5038 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
5041 yyextra->current->doc=
"\n\n";
5044 if (yyextra->current->section.isMemberGrp() &&
5045 yyextra->docGroup.isEmpty())
5047 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5051 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5053 yyextra->current->briefLine,yyextra->current->brief,
5054 yyextra->current->docLine,yyextra->current->doc,
5055 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5059 prot = yyextra->protection;
5061 yyextra->docGroup.addDocs(curEntry);
5063 newEntryNeeded = yyextra->needNewEntry;
5068 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
5070 if (!yyextra->parseMore && !yyextra->guards->empty())
5072 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5075 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5077 lineNr = yyextra->lineNr;
5079 position,yyextra->parseMore,newEntryNeeded);
5081 return yyextra->parseMore;
5086 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5088 bool sectionEnabled =
false;
5093 bool parentEnabled = yyextra->guards->top().parentVisible();
5097 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5098 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5102 yyextra->guards->top().setEnabled(
true);
5103 yyextra->guards->top().setEnabledFound();
5104 BEGIN( GuardParamEnd );
5108 if (yyextra->guards->top().isEnabledFound())
5110 yyextra->guards->top().setEnabled(
false);
5111 BEGIN( SkipGuardedSection );
5113 else if (sectionEnabled)
5115 yyextra->guards->top().setEnabled(
true);
5116 yyextra->guards->top().setEnabledFound();
5117 BEGIN( GuardParamEnd );
5121 yyextra->guards->top().setEnabled(
false);
5122 BEGIN( SkipGuardedSection );
5127 BEGIN( SkipGuardedSection );
5132 BEGIN( SkipGuardedSection );
5138 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5139 yyextra->docGroup.initGroupInfo(entry);
5144 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5145 yyextra->docGroup.enterFile(fileName,lineNr);
5150 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5151 yyextra->docGroup.leaveFile(fileName,lineNr);
5156 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5157 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5162 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5163 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5168 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5169 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5174 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5175 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5178#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
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.
#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.