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>
209static const std::unordered_map< std::string, DocCmdMap >
docCmdMap =
415#define YY_NO_UNISTD_H 1
416#define YY_NEVER_INTERACTIVE 1
549 const QCString &listTitle,
bool append);
566#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
571#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
574static 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.
582TABLE ("table"|"TABLE")
583TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
593CAPTION ("caption"|"CAPTION")
594CENTER ("center"|"CENTER")
596DETAILS ("details"|"DETAILS")
597BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
598DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
599DETAILEDHTMLOPT {CODE}
600DETAILEDHTMLOPTEND {ENDCODE}
601SUMMARY ("summary"|"SUMMARY")
602REMARKS ("remarks"|"REMARKS")
604ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
609DOCNL "\n"|"\\ilinebr"
612FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
613FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
614FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
615ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
616LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
617REQID [a-z_A-Z0-9\x80-\xFF\-]+
618CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
619CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
620CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
621SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
622SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
623TMPLSPEC "<"{BN}*[^>]+{BN}*">"
624MAILADDR ("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\-]+
625RCSTAG "$"{ID}":"[^\n$]+"$"
626MODULE_ID ({ID}".")*{ID}
627LINENR {Bopt}[1-9][0-9]*
628IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
686%x ReadFormulaShortSection
688%x ReadFormulaRoundSection
702%x RaiseWarningSection
731<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
734<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
740<Comment>"\""[^"\n]*"\"" {
743<Comment>("\\"[a-z_A-Z]+)+"\\" {
746<Comment>"<"{DETAILEDHTML}{ATTR}">" {
748 int spacePos = htmlOpenTag.find(
' ');
749 if (spacePos==-1) spacePos=yyleng-1;
750 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
752 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
760<Comment>"</"{DETAILEDHTML}">" {
762 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
764 if (!yyextra->htmlContextStack.empty() &&
765 yyextra->htmlContextStack.back().tagName==htmlTagName)
772 yyextra->htmlContextStack.pop_back();
776<Comment>"<"{DETAILEDHTMLOPT}">" {
778 if (yyextra->current->lang==SrcLangExt::CSharp)
780 yyextra->CScode=
true;
790<Comment>"<"{DETAILEDHTMLOPTEND}">" {
794 yyextra->CScode=
false;
798 yyextra->CScode=
false;
803<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
805 if (yyextra->current->lang==SrcLangExt::CSharp)
812<Comment>"<"{DETAILS}{ATTR}">" {
813 yyextra->htmlDetailsStack.push_back(0);
814 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
821<Comment>"</"{DETAILS}">" {
822 if (!yyextra->htmlDetailsStack.empty())
824 yyextra->htmlDetailsStack.pop_back();
826 if (!yyextra->htmlContextStack.empty() &&
827 yyextra->htmlContextStack.back().tagName==
"details")
834 yyextra->htmlContextStack.pop_back();
839 yyextra->htmlAnchorStr = yytext;
840 yyextra->htmlAnchor =
false;
844 yyextra->htmlAnchorStr += yytext;
849 if (c==
'\'' || c==
'"')
851 int e=tag.find(c,s+2);
854 id=tag.mid(s+2,e-s-2);
863 if (!
id.isEmpty() && !yyextra->htmlAnchor)
869 yyextra->htmlAnchor =
true;
872<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
873 yyextra->htmlAnchorStr += yytext;
876 if (!yyextra->htmlAnchor)
878 addOutput(yyscanner,yyextra->htmlAnchorStr);
891 yyextra->htmlAnchorStr += yytext;
892 if (*yytext ==
'\n') yyextra->lineNr++;
895 yyextra->htmlAnchorStr += yytext;
897<Comment>"<"{SUMMARY}">" {
898 if (yyextra->htmlDetailsStack.empty())
907<Comment>"<"{REMARKS}">" {
911<Comment>"</"{SUMMARY}">" {
912 if (!yyextra->htmlDetailsStack.empty())
921<Comment>"</"{REMARKS}">" {
925<Comment>"<"{CAPTION}{ATTR}">" {
927 int s=tag.find(
"id=");
931 if (c==
'\'' || c==
'"')
933 int e=tag.find(c,s+4);
943<Comment>"<"{PRE}{ATTR}">" {
944 yyextra->insidePre=
TRUE;
947<Comment>"</"{PRE}">" {
948 yyextra->insidePre=
FALSE;
958<Comment>"<!\[CDATA\[" {
961<Comment>{B}*{CMD}"endinternal"{B}* {
963 if (!yyextra->inInternalDocs)
964 warn(yyextra->fileName,yyextra->lineNr,
965 "found \\endinternal without matching \\internal"
967 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
969<Comment>{B}*"\\ilinebr "{B}* {
972<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
982<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
983<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
986 int idx = fullMatch.
find(
'{');
988 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
989 int idxEnd = fullMatch.
find(
"}",idx+1);
1007 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
1008 yyextra->spaceBeforeCmd = fullMatch.
left(i);
1011 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1013 yyextra->briefEndsAtDot=
FALSE;
1019 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1024 yyextra->parseMore=
TRUE;
1026 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1029 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.
1041<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1044<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1051 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...
1057<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1059 yyextra->formulaText=
"";
1060 yyextra->formulaPreText=
"\\begin";
1061 yyextra->formulaPostText=
"";
1063 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1066 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1068 yyextra->formulaPreText+=yyextra->formulaEnv;
1069 yyextra->formulaNewLines=0;
1070 BEGIN(ReadFormulaLong);
1072<Comment>{B}*{CMD}"f$" {
1073 yyextra->formulaText=
"";
1074 yyextra->formulaPreText=
"$";
1075 yyextra->formulaPostText=
"";
1076 yyextra->formulaNewLines=0;
1077 BEGIN(ReadFormulaShort);
1079<Comment>{B}*{CMD}"f(" {
1080 yyextra->formulaText=
"";
1081 yyextra->formulaPreText=
"";
1082 yyextra->formulaPostText=
"";
1083 yyextra->formulaNewLines=0;
1084 BEGIN(ReadFormulaRound);
1086<Comment>{B}*{CMD}"f[" {
1088 yyextra->formulaText=
"";
1089 yyextra->formulaPreText=
"\\[";
1090 yyextra->formulaPostText=
"";
1091 yyextra->formulaNewLines=0;
1092 BEGIN(ReadFormulaLong);
1094<Comment>{B}*{CMD}"{" {
1096 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1098<Comment>{B}*{CMD}"}" {
1100 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1101 yyextra->docGroup.clearHeader();
1102 yyextra->parseMore=
TRUE;
1103 yyextra->needNewEntry =
TRUE;
1104 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1107<Comment>{B}*{CMD}[$@\\&~<>#%] {
1110<Comment>[a-z_A-Z]+ {
1113<Comment>^{B}*"."{Bopt}/\n {
1116<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1117<Comment>^{B}*[*+]{B}+ {
1118 if (!yyextra->markdownSupport)
1126 yyextra->briefEndsAtDot=
FALSE;
1132<Comment>^{B}*"-"{B}+ {
1135 yyextra->briefEndsAtDot=
FALSE;
1140<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1143<Comment>{CMD}"---" {
1150 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1153 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1158 yyextra->briefEndsAtDot=
FALSE;
1163<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1164<Comment>("."+)[a-z_A-Z0-9\)] {
1168<Comment>{CMD}[\.?!] {
1172<Comment>".\\"[ \t] {
1179<Comment>"...\\"[ \t] {
1182<Comment>"..."/[^\.] {
1185<Comment>".."[\.]?/[^ \t\n] {
1188<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1194 for (i=0;i<(yy_size_t)yyleng;)
1196 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1197 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1204 for (i=0;i<(yy_size_t)yyleng;)
1206 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1207 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1222 if (yyextra->briefEndsAtDot)
1225 yyextra->briefEndsAtDot=
FALSE;
1230 if (*yytext ==
'\n') yyextra->lineNr++;
1232<Comment>"<"[/]?{TABLEDEL}">" {
1250<HtmlComment>"---"[!]?">"{B}* {
1251 warn(yyextra->fileName,yyextra->lineNr,
1252 "incorrect HTML end comment --->"
1255<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1256<HtmlComment>{DOCNL} {
1263<HtmlComment>[^\\\n\-]+ {
1268<CdataSection>"\]\]>" {
1271<CdataSection>{DOCNL} {
1273 if (*yytext==
'\n') yyextra->lineNr++;
1275<CdataSection>[<>&] {
1279<CdataSection>[^\\\n\]<>&]+ {
1288<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1289 yyextra->formulaPostText+=
"$";
1292 if (YY_START == ReadFormulaShort)
1298 yyextra->sectionTitle+=
" "+form;
1299 BEGIN(SectionTitle);
1302<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1305 if (YY_START == ReadFormulaRound)
1311 yyextra->sectionTitle+=
" "+form;
1312 BEGIN(SectionTitle);
1315<ReadFormulaLong>{CMD}"f]" {
1316 yyextra->formulaPostText+=
"\\]";
1320<ReadFormulaLong>{CMD}"f}" {
1321 yyextra->formulaPostText+=
"\\end";
1322 yyextra->formulaPostText+=yyextra->formulaEnv;
1326<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1327 yyextra->formulaText+=yytext;
1329<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1330 yyextra->formulaNewLines++;
1331 yyextra->formulaText+=*yytext;
1333 addIline(yyscanner,yyextra->lineNr);
1335<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1336 yyextra->formulaText+=*yytext;
1341<EnumDocArg1>{SCOPEID} {
1343 yyextra->current->name = yytext;
1350<EnumDocArg1>{DOCNL} {
1351 warn(yyextra->fileName,yyextra->lineNr,
1352 "missing argument after '\\enum'."
1362<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)
1368<NameSpaceDocArg1>{LC} {
1372<NameSpaceDocArg1>{DOCNL} {
1373 warn(yyextra->fileName,yyextra->lineNr,
1374 "missing argument after '\\namespace'."
1379<NameSpaceDocArg1>. {
1384<PackageDocArg1>{ID}("."{ID})* {
1385 yyextra->current->name = yytext;
1388<PackageDocArg1>{LC} {
1392<PackageDocArg1>{DOCNL} {
1393 warn(yyextra->fileName,yyextra->lineNr,
1394 "missing argument after \\package."
1406<ConceptDocArg1>{SCOPEID} {
1408 yyextra->current->name = yytext;
1411<ConceptDocArg1>{LC} {
1415<ConceptDocArg1>{DOCNL} {
1416 warn(yyextra->fileName,yyextra->lineNr,
1417 "missing argument after '\\concept'."
1426<ModuleDocArg1>{MODULE_ID} {
1428 yyextra->current->name = yytext;
1431<ModuleDocArg1>{LC} {
1435<ModuleDocArg1>{DOCNL} {
1436 warn(yyextra->fileName,yyextra->lineNr,
1437 "missing argument after '\\module'."
1447<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1451 BEGIN( ClassDocArg2 );
1453<ClassDocArg1>{SCOPENAME} {
1456 yyextra->current->name =
substitute(yytext,
".",
"::");
1457 if (yyextra->current->section.isProtocolDoc())
1459 yyextra->current->name+=
"-p";
1462 BEGIN( ClassDocArg2 );
1464<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1467 yyextra->current->name =
substitute(yytext,
".",
"::");
1468 BEGIN( ClassDocArg2 );
1470<ClassDocArg1,CategoryDocArg1>{LC} {
1474<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1475 warn(yyextra->fileName,yyextra->lineNr,
1476 "missing argument after '\\{}'.",yyextra->currentCmd
1481<ClassDocArg1,CategoryDocArg1>. {
1484<ClassDocArg2>{DOCNL} {
1488<ClassDocArg2>{FILE}|"<>" {
1489 yyextra->current->includeFile = yytext;
1490 BEGIN( ClassDocArg3 );
1499<ClassDocArg3>[<"]?{FILE}?[">]? {
1500 yyextra->current->includeName = yytext;
1507<ClassDocArg3>{DOCNL} {
1517<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1518 yyextra->current->name = yytext;
1522 if (yyextra->current->name.endsWith(
".html"))
1524 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1526 else if (yyextra->current->name.endsWith(
".xhtml"))
1528 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1530 yyextra->current->type.clear();
1531 BEGIN(GroupDocArg2);
1533<GroupDocArg1>"\\"{B}*"\n" {
1537<GroupDocArg1>{DOCNL} {
1538 warn(yyextra->fileName,yyextra->lineNr,
1539 "missing group name after {}",
1540 yyextra->current->groupDocCmd()
1549<GroupDocArg2>"\\"{B}*"\n" {
1553<GroupDocArg2>[^\n\\]+ {
1554 yyextra->current->type += yytext;
1556<GroupDocArg2>{DOCNL}+ {
1557 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1559 yyextra->current->type.isEmpty()
1562 warn(yyextra->fileName,yyextra->lineNr,
1563 "missing title after "
1564 "\\defgroup {}", yyextra->current->name
1568 int extraLineNr = 0;
1571 for (
int i = 0; i < yyleng; i++)
1573 if (yytext[i]==
'\n') extraLineNr++;
1580 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1581 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1586 yyextra->current->type += yytext;
1591<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1595 int start = text.
find(
'{');
1596 int end = text.
find(
'}',start+1);
1597 yyextra->current->name = text.
mid(
end+2);
1598 int istart = yyextra->current->name.
find(
"\\ilinebr");
1601 QCString rest = yyextra->current->name.
mid(istart);
1603 yyextra->current->name = yyextra->current->name.mid(0,istart);
1605 yyextra->current->args = text.
mid(start+1,
end-start-1);
1607 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1609<PageDocArg1>{FILE} {
1611 yyextra->current->args =
"";
1612 BEGIN( PageDocArg2 );
1614<PageDocArg1>{LC} { yyextra->lineNr++;
1617<PageDocArg1>{DOCNL} {
1618 warn(yyextra->fileName,yyextra->lineNr,
1619 "missing argument after \\page."
1628<PageDocArg2>{DOCNL} {
1632 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1633 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1636<PageDocArg2>{CMD}[<>] {
1641 yyextra->current->args += tmp;
1644 yyextra->current->args += yytext;
1647<ParamArg1>{ID}/{B}*"," {
1654 if (*yytext==
'\n') yyextra->lineNr++;
1668<FileDocArg1>{DOCNL} {
1674<FileDocArg1>{FILE} {
1678<FileDocArg1>{LC} { yyextra->lineNr++;
1686<XRefItemParam1>{LABELID} {
1687 yyextra->newXRefItemKey=yytext;
1689 BEGIN(XRefItemParam2);
1691<XRefItemParam1>{LC} {
1695<XRefItemParam1>{DOCNL} {
1696 warn(yyextra->fileName,yyextra->lineNr,
1697 "Missing first argument of \\xrefitem"
1699 if (*yytext==
'\n') yyextra->lineNr++;
1707<XRefItemParam2>"\""[^\n\"]*"\"" {
1709 BEGIN(XRefItemParam3);
1711<XRefItemParam2>{LC} {
1715<XRefItemParam2>{DOCNL} {
1716 warn(yyextra->fileName,yyextra->lineNr,
1717 "Missing second argument of \\xrefitem"
1719 if (*yytext==
'\n') yyextra->lineNr++;
1727<XRefItemParam3>"\""[^\n\"]*"\"" {
1732<XRefItemParam2,XRefItemParam3>{LC} {
1736<XRefItemParam3>{DOCNL} {
1737 warn(yyextra->fileName,yyextra->lineNr,
1738 "Missing third argument of \\xrefitem"
1740 if (*yytext==
'\n') yyextra->lineNr++;
1751<RelatesParam1>({ID}("::"|"."))*{ID} {
1752 yyextra->current->relates = yytext;
1759<RelatesParam1>{LC} {
1763<RelatesParam1>{DOCNL} {
1764 warn(yyextra->fileName,yyextra->lineNr,
1765 "Missing argument of '\\{}' command",yyextra->currentCmd
1777<Qualifier>{LABELID} {
1778 yyextra->current->qualifiers.emplace_back(yytext);
1781<Qualifier>"\""[^\"]*"\"" {
1782 std::string inp(yytext);
1783 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1787 warn(yyextra->fileName,yyextra->lineNr,
1788 "Missing argument of '\\{}' command",yyextra->currentCmd
1794 warn(yyextra->fileName,yyextra->lineNr,
1795 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1801<ILine>{LINENR}/[\\@\n\.] |
1807 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1811 yyextra->lineNr = nr;
1814 if (YY_START == ILine)
1820 yyextra->sectionTitle+=yytext;
1821 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1824<ILine,ILineSection>. {
1826 if (YY_START == ILine)
1832 yyextra->sectionTitle+=yytext;
1833 BEGIN(SectionTitle);
1838<IRaise>{B}*[0-9]+/[\\@\n\.] |
1839<IRaise>{B}*[0-9]+{B} {
1844 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1848 yyextra->raiseLevel = nr;
1858<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1872<IFile,IFileSection>{FILE} {
1875 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1876 else yyextra->fileName = yytext;
1877 if (YY_START == IFile)
1883 yyextra->sectionTitle+=yytext;
1884 BEGIN(SectionTitle);
1888<LinkSection>[^\\@\n]* {
1889 yyextra->sectionTitle+=yytext;
1891<LinkSection>{CMD}{CMD} {
1892 yyextra->sectionTitle+=yytext;
1894<LinkSection>{DOCNL} {
1896 if (*yytext ==
'\n') yyextra->lineNr++;
1897 yyextra->sectionTitle+=yytext;
1899<LinkSection>{CMD}"endlink" {
1900 yyextra->sectionTitle+=yytext;
1901 BEGIN(SectionTitle);
1904 yyextra->sectionTitle+=yytext;
1906<LinkSection><<EOF>> {
1907 warn(yyextra->fileName,yyextra->lineNr,
1908 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1914<LineParam>{CMD}{CMD} {
1927<LineParam>({CMD}{CMD}){ID} {
1936<SectionLabel>{LABELID} {
1937 yyextra->sectionLabel+=yytext;
1939<SectionLabel>{CMD}"lineinfo"("{}")? {
QCString & setNum(short n)
1942<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1943 FileInfo fi(yyextra->fileName.str());
1944 bool hasOption =
false;
1946 if (yytext[yyleng-1] ==
'}')
1952 for (
const auto &opt_ : optList)
1955 std::string opt = optStripped.
lower().
str();
1961 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1971 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1983 label=yyextra->fileName;
1987 yyextra->sectionLabel+=label;
#define Config_getBool(name)
static QCString stripFromPath(const QCString &p, const StringVector &l)
1989<SectionLabel>{DOCNL} {
1990 yyextra->sectionTitle.clear();
1991 if (yyextra->sectionLabel.isEmpty())
1993 warn(yyextra->fileName,yyextra->lineNr,
1994 "\\section command has no label"
1999 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2000 addOutput(yyscanner,yyextra->sectionLabel.data());
2003 if (*yytext==
'\n') yyextra->lineNr++;
2008 if (yyextra->sectionLabel.isEmpty())
2010 warn(yyextra->fileName,yyextra->lineNr,
2011 "Invalid or missing section label"
2017 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2018 addOutput(yyscanner,yyextra->sectionLabel.data());
2019 yyextra->sectionTitle.clear();
2021 BEGIN(SectionTitle);
2024<SectionTitle>{STAopt}/"\n" {
2029<SectionTitle>{STopt}"\\\\ilinebr" {
2030 yyextra->sectionTitle+=yytext;
2032<SectionTitle>{STopt}/"\\ilinebr" {
2037<SectionTitle>{B}*{CMD}"f$" {
2038 yyextra->formulaText=
"";
2039 yyextra->formulaPreText=
"$";
2040 yyextra->formulaPostText=
"";
2041 yyextra->formulaNewLines=0;
2042 BEGIN(ReadFormulaShortSection);
2044<SectionTitle>{B}*{CMD}"f(" {
2045 yyextra->formulaText=
"";
2046 yyextra->formulaPreText=
"";
2047 yyextra->formulaPostText=
"";
2048 yyextra->formulaNewLines=0;
2049 BEGIN(ReadFormulaRoundSection);
2051<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2052<SectionTitle>{B}*{CMD}"f"[\[{] {
2056 warn(yyextra->fileName,yyextra->lineNr,
2057 "'\\{}' command is not allowed in section title, ending section title.",
2067<SectionTitle>[^\n@\\]* {
2068 yyextra->sectionTitle+=yytext;
2071<SectionTitle>{B}*{CMD}{CMD} {
2072 yyextra->sectionTitle+=yytext;
2075<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2076<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2078 int idx = fullMatch.
find(
'{');
2080 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2081 int idxEnd = fullMatch.
find(
"}",idx+1);
2097 switch (it->second.sectionHandling)
2102 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2103 yyextra->sectionTitle+=fullMatch.
left(i);
2104 yyextra->sectionTitle+=
'@';
2105 yyextra->sectionTitle+=fullMatch.
mid(i);
2109 warn(yyextra->fileName,yyextra->lineNr,
2110 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2118 warn(yyextra->fileName,yyextra->lineNr,
2119 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2127 if (cmdName ==
"fileinfo")
2130 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2131 yyextra->sectionTitle+=fullMatch.
left(i);
2136 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2141 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2145 else if (cmdName ==
"lineinfo")
2148 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2149 yyextra->sectionTitle+=fullMatch.
left(i);
2151 yyextra->sectionTitle+=
' ';
2152 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2158 else if (cmdName ==
"raisewarning")
2160 yyextra->raiseWarning =
"";
2161 BEGIN(RaiseWarningSection);
2163 else if (cmdName ==
"noop")
2168 else if (cmdName ==
"cite")
2170 yyextra->sectionTitle+=yytext;
2172 BEGIN(CiteLabelSection);
2174 else if (cmdName ==
"iline")
2176 yyextra->sectionTitle+=yytext;
2178 BEGIN(ILineSection);
2180 else if (cmdName ==
"ifile")
2182 yyextra->sectionTitle+=yytext;
2184 BEGIN(IFileSection);
2186 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2189 if (optList.empty())
2191 yyextra -> anchorTitle =
"";
2196 yyextra -> anchorTitle =
join(optList,
" ");
2199 BEGIN(AnchorLabelSection);
2201 else if (cmdName ==
"link")
2203 yyextra->sectionTitle+=yytext;
2208 yyextra->sectionTitle+=yytext;
2209 warn(yyextra->fileName,yyextra->lineNr,
2210 "internal error '\\{}' command is to be replaced in section title.",cmdName
2217 yyextra->sectionTitle+=yytext;
2225 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
2230 yyextra->sectionTitle+=yytext;
2236<SubpageLabel>{FILE} {
2240 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2241 BEGIN(SubpageTitle);
2243<SubpageLabel>{DOCNL} {
2244 warn(yyextra->fileName,yyextra->lineNr,
2245 "\\subpage command has no label"
2247 if (*yytext==
'\n') yyextra->lineNr++;
2255<SubpageTitle>{DOCNL} {
2259<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2270<AnchorLabel,AnchorLabelSection>{LABELID} {
2271 QCString lbl = yyextra->raisePrefix+yytext;
2272 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2274 if (YY_START == AnchorLabel)
2280 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2283<AnchorLabel,AnchorLabelSection>{DOCNL} {
2284 warn(yyextra->fileName,yyextra->lineNr,
2285 "\\anchor command has no label"
2287 if (*yytext==
'\n') yyextra->lineNr++;
2289 if (YY_START == AnchorLabel)
2295 BEGIN(SectionTitle);
2298<AnchorLabel,AnchorLabelSection>. {
2299 warn(yyextra->fileName,yyextra->lineNr,
2300 "Invalid or missing anchor label"
2303 if (YY_START == AnchorLabel)
2309 BEGIN(SectionTitle);
2315<RequirementLabel>{REQID} {
2316 yyextra->current->name = yytext;
2317 yyextra->current->type.clear();
2318 BEGIN( RequirementTitle );
2320<SatisfiesLabel>{REQID} {
2321 yyextra->reqId = yytext;
2322 yyextra->reqTitle.clear();
2323 BEGIN( SatisfiesTitle );
2325<VerifiesLabel>{REQID} {
2326 yyextra->reqId = yytext;
2327 yyextra->reqTitle.clear();
2328 BEGIN( VerifiesTitle );
2330<RequirementLabel,SatisfiesLabel,VerifiesLabel>"\\"{B}*"\n" {
2334<RequirementLabel,SatisfiesLabel,VerifiesLabel>{DOCNL} {
2335 warn(yyextra->fileName,yyextra->lineNr,
2336 "missing requirement ID after \\requirement command"
2341<RequirementLabel,SatisfiesLabel,VerifiesLabel>. {
2344<RequirementTitle,SatisfiesTitle,VerifiesTitle>"\\"{B}*"\n" {
2348<RequirementTitle>[^\n\\]+ {
2349 yyextra->current->type += yytext;
2351<SatisfiesTitle,VerifiesTitle>[^\n\\@]+ {
2352 yyextra->reqTitle += yytext;
2354<RequirementTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2355 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
2360<SatisfiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2361 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2363 if (yyextra->current->section.isRequirementDoc())
2365 warn(yyextra->fileName,yyextra->lineNr,
2366 "@satisfies command is not allowed in documentation of a requirement. Put in at the place where the requirement is implemented."
2379<VerifiesTitle>({CMD}("verifies"|"satisfies"|"requirement"){B}+)|{DOCNL}+ {
2380 yyextra->reqTitle = yyextra->reqTitle.stripWhiteSpace();
2382 if (yyextra->current->section.isRequirementDoc())
2384 warn(yyextra->fileName,yyextra->lineNr,
2385 "@verifies command is not allowed in documentation of a requirement. Put in at the place where the requirement is tested."
2398<RequirementTitle>. {
2399 yyextra->current->type += yytext;
2401<SatisfiesTitle,VerifiesTitle>. {
2402 yyextra->reqTitle += yytext;
2408<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2410 if (&yytext[4]==yyextra->blockName)
2415<FormatBlock>{CMD}"enduml" {
2417 if (yyextra->blockName==
"startuml")
2422<FormatBlock>[^ \@\*\/\\\n]* {
2425<FormatBlock>{DOCNL} {
2426 if (*yytext==
'\n') yyextra->lineNr++;
2430 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2431 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2432 yyextra->blockName==
"iliteral"
2434 ) yyextra->commentCount++;
2439 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2440 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2441 yyextra->blockName==
"iliteral"
2445 yyextra->commentCount--;
2446 if (yyextra->commentCount<0)
2448 QCString endTag =
"end"+yyextra->blockName;
2449 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2450 warn(yyextra->fileName,yyextra->lineNr,
2451 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2452 yyextra->blockName,endTag);
2459<FormatBlock><<EOF>> {
2460 QCString endTag =
"end"+yyextra->blockName;
2461 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2462 warn(yyextra->fileName,yyextra->lineNr,
2463 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2464 yyextra->blockName,endTag
2471<GuardParam>{B}*"(" {
2472 yyextra->guardExpr=yytext;
2473 yyextra->roundCount=1;
2477 yyextra->guardExpr+=yytext;
2481 yyextra->guardExpr+=yytext;
2482 yyextra->roundCount++;
2485 yyextra->guardExpr+=yytext;
2486 yyextra->roundCount--;
2487 if (yyextra->roundCount==0)
2493 warn(yyextra->fileName,yyextra->lineNr,
2494 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2498<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2501<GuardParam>{DOCNL} {
2516<GuardParamEnd>{B}*{DOCNL} {
2518 yyextra->spaceBeforeIf.clear();
2522<GuardParamEnd>{B}* {
2523 if (!yyextra->spaceBeforeIf.isEmpty())
2525 addOutput(yyscanner,yyextra->spaceBeforeIf);
2527 yyextra->spaceBeforeIf.clear();
2539<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2541 yyextra->guards->emplace(
false);
2542 BEGIN( GuardParam );
2544<SkipGuardedSection>{CMD}"if"/{NW} {
2546 yyextra->guards->emplace(
false);
2547 BEGIN( GuardParam );
2549<SkipGuardedSection>{CMD}"endif"/{NW} {
2550 if (yyextra->guards->empty())
2552 warn(yyextra->fileName,yyextra->lineNr,
2553 "found \\endif without matching start command");
2558 yyextra->guards->pop();
2559 if (yyextra->guards->empty())
2561 BEGIN( GuardParamEnd );
2565 if (yyextra->guards->top().isEnabled())
2567 BEGIN( GuardParamEnd );
2571 BEGIN( SkipGuardedSection );
2576<SkipGuardedSection>{CMD}"else"/{NW} {
2577 if (yyextra->guards->empty())
2579 warn(yyextra->fileName,yyextra->lineNr,
2580 "found \\else without matching start command");
2582 else if (yyextra->guards->top().hasElse())
2584 warn(yyextra->fileName,yyextra->lineNr,
2585 "found multiple \\else commands in same \\if construct");
2586 yyextra->guards->top().setEnabled(
false);
2587 BEGIN( SkipGuardedSection );
2589 else if (!yyextra->guards->top().parentVisible())
2591 yyextra->guards->top().setEnabled(
false);
2592 BEGIN( SkipGuardedSection );
2596 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2597 yyextra->guards->top().setElse();
2598 if (!yyextra->guards->top().parentVisible())
2600 yyextra->guards->top().setEnabled(
false);
2601 BEGIN( SkipGuardedSection );
2603 else if (yyextra->guards->top().isEnabledFound())
2605 yyextra->guards->top().setEnabled(
false);
2606 BEGIN( SkipGuardedSection );
2610 yyextra->guards->top().setEnabled(
true);
2611 BEGIN( GuardParamEnd );
2615<SkipGuardedSection>{CMD}"elseif"/{NW} {
2616 if (yyextra->guards->empty())
2618 warn(yyextra->fileName,yyextra->lineNr,
2619 "found \\elseif without matching start command");
2621 else if (yyextra->guards->top().hasElse())
2623 warn(yyextra->fileName,yyextra->lineNr,
2624 "found \\elseif command after \\else command was given in \\if construct");
2626 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2627 yyextra->guards->top().setEnabled(
false);
2628 BEGIN( GuardParam );
2633 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2634 yyextra->guards->top().setEnabled(
false);
2635 BEGIN( GuardParam );
2638<SkipGuardedSection>{DOCNL} {
2639 if (*yytext==
'\n') yyextra->lineNr++;
2642<SkipGuardedSection>[^ \\@\n]+ {
2644<SkipGuardedSection>{CMD}{CMD} |
2645<SkipGuardedSection>. {
2651<SkipInternal>{DOCNL} {
2652 if (*yytext==
'\n') yyextra->lineNr++;
2655<SkipInternal>{CMD}"if"/[ \t] {
2656 yyextra->condCount++;
2658<SkipInternal>{CMD}"ifnot"/[ \t] {
2659 yyextra->condCount++;
2661<SkipInternal>{CMD}/"endif" {
2662 yyextra->condCount--;
2663 if (yyextra->condCount<0)
2669<SkipInternal>{CMD}/"section"[ \t] {
2670 if (yyextra->sectionLevel>0)
2676<SkipInternal>{CMD}/"subsection"[ \t] {
2677 if (yyextra->sectionLevel>1)
2683<SkipInternal>{CMD}/"subsubsection"[ \t] {
2684 if (yyextra->sectionLevel>2)
2690<SkipInternal>{CMD}/"paragraph"[ \t] {
2691 if (yyextra->sectionLevel>3)
2697<SkipInternal>{CMD}/"subparagraph"[ \t] {
2698 if (yyextra->sectionLevel>4)
2704<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2705 if (yyextra->sectionLevel>5)
2711<SkipInternal>{CMD}"endinternal"[ \t]* {
2714<SkipInternal>[^ \\@\n]+ {
2731 yyextra->docGroup.appendHeader(
' ');
2734 yyextra->docGroup.appendHeader(*yytext);
2735 yyextra->current->name+=*yytext;
2750<RaiseWarning,RaiseWarningSection>{DOCNL} {
2752 "{}",yyextra->raiseWarning);
2753 yyextra->raiseWarning =
"";
2754 if (*yytext==
'\n') yyextra->lineNr++;
2756 if (YY_START == RaiseWarning)
2762 yyextra->sectionTitle+=yytext;
2763 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2766<RaiseWarning,RaiseWarningSection>. {
2767 yyextra->raiseWarning += yytext;
2771<InGroupParam>{LABELID} {
2772 yyextra->current->groups.emplace_back(
2775 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2777<InGroupParam>{DOCNL} {
2778 if (!yyextra->inGroupParamFound)
2780 warn(yyextra->fileName,yyextra->lineNr,
2781 "Missing group name for \\ingroup command"
2800 if (yyextra->braceCount==0)
2802 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2804 warn(yyextra->fileName,yyextra->lineNr,
2805 "missing argument after '\\{}'.",yyextra->currentCmd
2811 yyextra->langParser->parsePrototype(yyextra->functionProto);
2819 yyextra->functionProto+=
' ';
2821<FnParam>[^@\\\n()]+ {
2822 yyextra->functionProto+=yytext;
2825 yyextra->functionProto+=yytext;
2826 yyextra->braceCount++;
2829 yyextra->functionProto+=yytext;
2830 yyextra->braceCount--;
2833 yyextra->functionProto+=*yytext;
2840<OverloadParam>{DOCNL} {
2841 if (*yytext==
'\n') yyextra->lineNr++;
2842 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2850 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2854<OverloadParam>{LC} {
2856 yyextra->functionProto+=
' ';
2859 yyextra->functionProto+=*yytext;
2864<InheritParam>({ID}("::"|"."))*{ID} {
2865 yyextra->current->extends.emplace_back(
2870<InheritParam>{DOCNL} {
2871 warn(yyextra->fileName,yyextra->lineNr,
2872 "\\inherit command has no argument"
2874 if (*yytext==
'\n') yyextra->lineNr++;
2879 warn(yyextra->fileName,yyextra->lineNr,
2880 "Invalid or missing name for \\inherit command"
2887<ExtendsParam>({ID}("::"|"."))*{ID} {
2888 yyextra->current->extends.emplace_back(
2893<ExtendsParam>{DOCNL} {
2894 warn(yyextra->fileName,yyextra->lineNr,
2895 "'\\{}' command has no argument",yyextra->currentCmd
2907<SkipLang>{CMD}"~"[a-zA-Z-]* {
2911 warn(yyextra->fileName,yyextra->lineNr,
2920<SkipLang>[^*@\\\n]* {
2923 if (*yytext==
'\n') yyextra->lineNr++;
2930<CiteLabel,CiteLabelSection>{CITEID} {
2933 if (YY_START == CiteLabel)
2939 yyextra->sectionTitle+=yytext;
2940 BEGIN(SectionTitle);
2943<CiteLabel,CiteLabelSection>{DOCNL} {
2944 warn(yyextra->fileName,yyextra->lineNr,
2945 "\\cite command has no label"
2949 if (YY_START == CiteLabel)
2956 yyextra->sectionTitle+=yytext;
2958 BEGIN(SectionTitle);
2961<CiteLabel,CiteLabelSection>. {
2962 warn(yyextra->fileName,yyextra->lineNr,
2963 "Invalid or missing cite label"
2965 if (YY_START == CiteLabel)
2971 yyextra->sectionTitle+=yytext;
2972 BEGIN(SectionTitle);
2980 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2981 addOutput(yyscanner,yyextra->copyDocArg);
2985<CopyDoc>"<"[/]?{TABLEDEL}">" {
2986 if (yyextra->braceCount==0)
2989 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2990 addOutput(yyscanner,yyextra->copyDocArg);
2996 if (*yytext==
'\n') yyextra->lineNr++;
2997 if (yyextra->braceCount==0)
3000 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
3001 addOutput(yyscanner,yyextra->copyDocArg);
3009<CopyDoc>[^@\\\n()<]+ {
3010 yyextra->copyDocArg+=yytext;
3014 yyextra->copyDocArg+=yytext;
3016 yyextra->braceCount++;
3019 yyextra->copyDocArg+=yytext;
3021 yyextra->braceCount--;
3024 yyextra->copyDocArg+=yytext;
3046 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3047 yyextra->braceCount=0;
3048 yyextra->functionProto.clear();
3049 yyextra->currentCmd = cmd;
3050 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
3057 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3058 yyextra->functionProto.clear();
3059 yyextra->braceCount=0;
3060 yyextra->currentCmd = cmd;
3061 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
3068 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3069 yyextra->functionProto.clear();
3070 BEGIN(OverloadParam);
3076 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3077 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
3078 BEGIN( EnumDocArg1 );
3084 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3087 BEGIN( GroupDocArg1 );
3093 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3096 BEGIN( GroupDocArg1 );
3102 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3105 BEGIN( GroupDocArg1 );
3111 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3112 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3113 BEGIN( NameSpaceDocArg1 );
3119 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3121 BEGIN( PackageDocArg1 );
3127 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3128 yyextra->currentCmd = cmd;
3129 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3130 BEGIN( ClassDocArg1 );
3136 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3137 yyextra->currentCmd = cmd;
3138 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3139 BEGIN( ConceptDocArg1 );
3145 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3146 yyextra->currentCmd = cmd;
3147 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3148 BEGIN( ModuleDocArg1 );
3154 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3155 BEGIN( ClassDocArg2 );
3161 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3162 yyextra->currentCmd = cmd;
3163 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3164 BEGIN( ClassDocArg1 );
3170 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3171 yyextra->currentCmd = cmd;
3172 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3173 BEGIN( CategoryDocArg1 );
3179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3180 yyextra->currentCmd = cmd;
3181 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3182 BEGIN( ClassDocArg1 );
3188 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3189 yyextra->currentCmd = cmd;
3190 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3191 BEGIN( ClassDocArg1 );
3197 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3198 yyextra->currentCmd = cmd;
3199 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3200 BEGIN( ClassDocArg1 );
3206 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3207 yyextra->currentCmd = cmd;
3208 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3209 BEGIN( ClassDocArg1 );
3215 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3217 BEGIN( PageDocArg1 );
3223 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3227 yyextra->current->name =
"mainpage";
3230 BEGIN( PageDocArg2 );
3236 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3240 yyextra->current->name = yyextra->fileName;
3242 BEGIN( FileDocArg1 );
3248 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3258 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3266 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3268 if (!stop) yyextra->current->name = yyextra->fileName;
3269 BEGIN( FileDocArg1 );
3275 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3277 for (
const auto &opt : optList)
3281 sectionMaker=EntryType::makeExampleLineno;
3285 warn(yyextra->fileName,yyextra->lineNr,
3286 "unsupported option '{}' for command '\\{}'",opt,cmd);
3290 if (!stop) yyextra->current->name = yyextra->fileName;
3291 BEGIN( FileDocArg1 );
3297 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3300 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3309 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3310 yyextra->raiseWarning =
"";
3311 BEGIN( RaiseWarning );
3317 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3324 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3328 yyextra->docGroup.clearHeader();
3330 if (!yyextra->docGroup.isEmpty())
3332 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3340 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3349 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3358 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3367 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3376 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3378 BEGIN(XRefItemParam1);
3384 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3385 if (yyextra->insideParBlock)
3387 warn(yyextra->fileName,yyextra->lineNr,
3388 "found \\parblock command while already in a parblock!");
3390 if (!yyextra->spaceBeforeCmd.isEmpty())
3392 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3393 yyextra->spaceBeforeCmd.clear();
3396 yyextra->insideParBlock =
TRUE;
3402 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3403 if (!yyextra->insideParBlock)
3405 warn(yyextra->fileName,yyextra->lineNr,
3406 "found \\endparblock command without matching \\parblock!");
3410 yyextra->insideParBlock =
FALSE;
3416 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3417 if (!yyextra->current->relates.isEmpty())
3419 warn(yyextra->fileName,yyextra->lineNr,
3420 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3422 yyextra->current->relatesType = RelatesType::Simple;
3423 yyextra->currentCmd = cmd;
3424 BEGIN(RelatesParam1);
3430 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3431 if (!yyextra->current->relates.isEmpty())
3433 warn(yyextra->fileName,yyextra->lineNr,
3434 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3436 yyextra->current->relatesType = RelatesType::Duplicate;
3437 yyextra->currentCmd = cmd;
3438 BEGIN(RelatesParam1);
3444 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3445 if (!yyextra->current->relates.isEmpty())
3447 warn(yyextra->fileName,yyextra->lineNr,
3448 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3450 yyextra->current->relatesType = RelatesType::MemberOf;
3451 yyextra->currentCmd = cmd;
3452 BEGIN(RelatesParam1);
3458 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3466 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3469 BEGIN(SectionLabel);
3470 yyextra->sectionLabel.clear();
3479 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3481 switch (yyextra->sectionLevel)
3489 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3496 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3498 BEGIN( RequirementLabel );
3504 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3505 BEGIN( SatisfiesLabel );
3511 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3512 BEGIN( VerifiesLabel );
3518 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3519 if (!yyextra->current->section.isEmpty() &&
3520 !yyextra->current->section.isPageDoc() &&
3521 !yyextra->current->section.isMainpageDoc()
3524 warn(yyextra->fileName,yyextra->lineNr,
3525 "found \\subpage command in a comment block that is not marked as a page!");
3527 if (!yyextra->spaceBeforeCmd.isEmpty())
3529 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3530 yyextra->spaceBeforeCmd.clear();
3533 BEGIN(SubpageLabel);
3539 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3541 if (optList.empty())
3543 yyextra -> anchorTitle =
"";
3547 yyextra -> anchorTitle =
join(optList,
" ");
3555 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3556 for (
const auto &opt : optList)
3566 if (optList.empty())
3580 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3581 if (!yyextra->spaceBeforeCmd.isEmpty())
3583 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3584 yyextra->spaceBeforeCmd.clear();
3586 if (optList.empty())
3600 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3601 if (!yyextra->spaceBeforeCmd.isEmpty())
3603 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3604 yyextra->spaceBeforeCmd.clear();
3606 if (optList.empty())
3615 yyextra->blockName=s;
3616 yyextra->commentCount=0;
3623 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3641 static std::unordered_map<std::string,OptionFunc> options =
3644 {
"name", [](
const FileInfo &fi_) ->
QCString {
return fi_.baseName(); } },
3645 {
"extension", [](
const FileInfo &fi_) ->
QCString {
return fi_.extension(
true); } },
3646 {
"filename", [](
const FileInfo &fi_) ->
QCString {
return fi_.fileName(); } },
3647 {
"directory", [](
const FileInfo &fi_) ->
QCString {
return fi_.dirPath(); } },
3648 {
"full", [](
const FileInfo &fi_) ->
QCString {
return fi_.absFilePath(); } }
3650 auto it = options.
find(optionName);
3651 return (it!=options.end()) ? it->second(fi) :
QCString();
3656 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3657 if (!yyextra->spaceBeforeCmd.isEmpty())
3659 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3660 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3661 yyextra->spaceBeforeCmd.clear();
3664 FileInfo fi(yyextra->fileName.str());
3665 for (
const auto &opt_ : optList)
3668 std::string opt = optStripped.
lower().
str();
3674 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3681 yyextra->sectionTitle+=result;
3688 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3695 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3700 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3709 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3710 if (!yyextra->spaceBeforeCmd.isEmpty())
3712 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3713 yyextra->spaceBeforeCmd.clear();
3721 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3729 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3737 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3744 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3746 BEGIN(IRaisePrefix);
3752 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3754 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3755 if (yyextra->guards->empty())
3757 yyextra->guards->emplace(
true);
3761 bool enabled = yyextra->guards->top().isEnabled();
3762 yyextra->guards->emplace(enabled);
3770 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3772 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3773 if (yyextra->guards->empty())
3775 yyextra->guards->emplace(
true);
3779 bool enabled = yyextra->guards->top().isEnabled();
3780 yyextra->guards->emplace(enabled);
3788 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3789 if (yyextra->guards->empty())
3791 warn(yyextra->fileName,yyextra->lineNr,
3792 "found \\elseif without matching start command");
3794 else if (yyextra->guards->top().hasElse())
3796 warn(yyextra->fileName,yyextra->lineNr,
3797 "found \\elseif command after \\else command was given in \\if construct");
3799 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3800 yyextra->guards->top().setEnabled(
false);
3806 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3807 yyextra->guards->top().setEnabled(
false);
3815 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3816 if (yyextra->guards->empty())
3818 warn(yyextra->fileName,yyextra->lineNr,
3819 "found \\else without matching start command");
3821 else if (yyextra->guards->top().hasElse())
3823 warn(yyextra->fileName,yyextra->lineNr,
3824 "found multiple \\else commands in same \\if construct");
3825 yyextra->guards->top().setEnabled(
false);
3826 yyextra->guards->top().setElse();
3827 BEGIN( SkipGuardedSection );
3831 yyextra->guards->top().setElse();
3832 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3833 if (yyextra->guards->top().isEnabledFound())
3835 yyextra->guards->top().setEnabled(
false);
3836 BEGIN( SkipGuardedSection );
3840 yyextra->guards->top().setEnabled(
true);
3841 BEGIN( GuardParamEnd );
3849 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3850 if (yyextra->guards->empty())
3852 warn(yyextra->fileName,yyextra->lineNr,
3853 "found \\endif without matching start command");
3857 yyextra->guards->pop();
3859 if (!yyextra->spaceBeforeCmd.isEmpty())
3861 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3862 yyextra->spaceBeforeCmd.clear();
3864 if (yyextra->guards->empty())
3866 BEGIN( GuardParamEnd );
3870 if (yyextra->guards->top().isEnabled())
3872 BEGIN( GuardParamEnd );
3876 BEGIN( SkipGuardedSection );
3884 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3885 yyextra->inGroupParamFound=
FALSE;
3886 BEGIN( InGroupParam );
3892 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3893 yyextra->current->subGrouping =
FALSE;
3899 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3900 yyextra->current->initLines = 100000;
3906 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3907 yyextra->current->initLines = 0;
3913 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3914 yyextra->current->commandOverrides.override_callGraph(
true);
3920 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3921 yyextra->current->commandOverrides.override_callGraph(
false);
3927 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3928 yyextra->current->commandOverrides.override_callerGraph(
true);
3934 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3935 yyextra->current->commandOverrides.override_callerGraph(
false);
3941 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3942 yyextra->current->commandOverrides.override_enumValues(
true);
3948 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3949 yyextra->current->commandOverrides.override_enumValues(
false);
3955 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3956 yyextra->current->commandOverrides.override_inlineSource(
true);
3962 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3963 yyextra->current->commandOverrides.override_inlineSource(
false);
3969 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3970 yyextra->current->commandOverrides.override_includeGraph(
true);
3976 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3977 yyextra->current->commandOverrides.override_includedByGraph(
true);
3983 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3984 yyextra->current->commandOverrides.override_includeGraph(
false);
3990 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3991 yyextra->current->commandOverrides.override_includedByGraph(
false);
3997 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3998 yyextra->current->commandOverrides.override_directoryGraph(
true);
4004 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4005 yyextra->current->commandOverrides.override_directoryGraph(
false);
4011 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4012 yyextra->current->commandOverrides.override_collaborationGraph(
true);
4018 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4019 yyextra->current->commandOverrides.override_collaborationGraph(
false);
4025 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4026 yyextra->current->commandOverrides.override_groupGraph(
true);
4032 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4033 yyextra->current->commandOverrides.override_groupGraph(
false);
4039 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4040 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4041 for (
const auto &opt_ : optList)
4048 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
4050 else if (opt ==
"graph")
4052 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
4054 else if (opt ==
"builtin")
4056 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
4058 else if (opt ==
"text")
4060 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
4062 else if (opt ==
"no")
4064 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4068 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
4078 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4079 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
4085 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4086 yyextra->current->commandOverrides.override_referencedByRelation(
true);
4092 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4093 yyextra->current->commandOverrides.override_referencedByRelation(
false);
4099 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4100 yyextra->current->commandOverrides.override_referencesRelation(
true);
4106 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4107 yyextra->current->commandOverrides.override_referencesRelation(
false);
4113 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4114 yyextra->currentCmd = cmd;
4121 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4126 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4128 yyextra->current->doc.clear();
4130 yyextra->condCount=0;
4131 BEGIN( SkipInternal );
4137 yyextra->inInternalDocs =
TRUE;
4144 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4145 yyextra->current->isStatic =
TRUE;
4151 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4152 yyextra->current->virt = Specifier::Pure;
4158 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4159 yyextra->current->protection = Protection::Private;
4165 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4166 yyextra->current->protection = yyextra->protection = Protection::Private;
4172 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4173 yyextra->current->protection = Protection::Protected;
4179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4180 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4186 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4187 yyextra->current->protection = Protection::Public;
4193 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4194 yyextra->current->protection = yyextra->protection = Protection::Public;
4200 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4201 if (yyextra->current->section.isPageDoc() ||
4202 yyextra->current->section.isMainpageDoc())
4204 for (
const auto &opt_ : optList)
4208 int i = opt.
find(
':');
4212 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4214 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4228 yyextra->current->localToc.enableHtml(level);
4230 else if (opt ==
"latex")
4232 yyextra->current->localToc.enableLatex(level);
4234 else if (opt ==
"xml")
4236 yyextra->current->localToc.enableXml(level);
4238 else if (opt ==
"docbook")
4240 yyextra->current->localToc.enableDocbook(level);
4244 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4249 if (yyextra->current->localToc.nothingEnabled())
4261 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4262 BEGIN(InheritParam);
4268 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4269 yyextra->currentCmd = cmd;
4270 BEGIN(ExtendsParam);
4276 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4277 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4283 if (!yyextra->spaceBeforeCmd.isEmpty())
4285 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4286 yyextra->spaceBeforeCmd.clear();
4294 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4296 if (!yyextra->spaceBeforeCmd.isEmpty())
4298 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4299 yyextra->spaceBeforeCmd.clear();
4307 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4308 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4314 if (!yyextra->spaceBeforeCmd.isEmpty())
4316 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4317 yyextra->spaceBeforeCmd.clear();
4320 yyextra->copyDocArg.clear();
4321 yyextra->braceCount = 0;
4330 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4331 yyextra->sectionLabel.clear();
4332 yyextra->sectionTitle.clear();
4333 yyextra->docGroup.clearHeader();
4334 yyextra->insideParBlock =
FALSE;
4341 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4343 return yyextra->current->section.isDoc();
4348 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4349 assert(maker!=
nullptr);
4351 if (yyextra->current->section.isDoc())
4357 yyextra->needNewEntry =
true;
4358 yyextra->current->section = maker();
4359 yyextra->current->fileName = yyextra->fileName;
4360 yyextra->current->startLine = yyextra->lineNr;
4361 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4374 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4375 for(
const char* c = yytext ; *c ; ++c )
4376 yyextra->lineNr += (*c ==
'\n') ;
4384 if (s==
nullptr || *s==0)
return name;
4386 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4397 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4400 QCString reqId = yyextra->current->name;
4406 si = sm.
add(reqId,
"requirements",yyextra->lineNr,
4411 warn(yyextra->fileName,yyextra->lineNr,
"duplicate requirement ID '{}' found at {} line {}, (first occurrence: {}, line {})",
4413 yyextra->fileName,yyextra->lineNr,
4424 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4425 if (listName.
isEmpty())
return;
4432 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4445 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4453 item = refList->
add();
4457 item->
setText(yyextra->outputXRef);
4459 yyextra->current->sli.push_back(item);
4461 cmdString.
sprintf(
"\\ilinebr \\xrefitem %s %d.",
qPrint(listName),item->
id());
4462 if (yyextra->inBody)
4464 yyextra->current->inbodyDocs += cmdString;
4468 yyextra->current->doc += cmdString;
4478 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4480 yyextra->sectionLevel);
4481 yyextra->current->anchors.push_back(si);
4483 else if (si->
lineNr() != -1)
4485 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4490 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4496 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4498 yyextra->sectionLevel);
4499 yyextra->current->anchors.push_back(si);
4503 yyextra->outputXRef.clear();
4513 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4517 for (
size_t i=1; i<label.
size(); i++)
4520 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4535 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4537 QCString formula = (yyextra->formulaPreText +
4538 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4546 formLabel.
sprintf(
"\\_form#%d",
id);
4547 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4564 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4572 if (addYYtext) yyextra->sectionTitle+=yytext;
4573 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4574 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4576 yyextra->sectionLevel);
4579 yyextra->current->anchors.push_back(si);
4581 else if (si->
lineNr() != -1)
4583 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4588 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4589 yyextra->sectionLabel,si->
fileName());
4595 if (addYYtext) yyextra->sectionTitle+=yytext;
4596 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4597 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4599 yyextra->sectionLevel);
4602 yyextra->current->anchors.push_back(si);
4611 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4613 if (yytext[0] ==
'"')
4616 name=name.
left((
int)yyleng-2);
4622static const reg::Ex nonBrief_re(R
"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))");
4632 if (c==
' ' || c==
'\t' || c==
'\r')
4655 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4656 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4658 yyextra->xrefAppendFlag = !yyextra->inBody &&
4660 yyextra->newXRefKind==yyextra->xrefKind &&
4662 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4678 switch(yyextra->xrefKind)
4710 yyextra->xrefItemTitle,
4711 yyextra->xrefListTitle,
4720 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4722 int oldContext = yyextra->inContext;
4723 yyextra->inContext = ctx;
4725 switch(yyextra->inContext)
4728 if (oldContext!=yyextra->inContext)
4731 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4732 if (yyextra->current->docFile.isEmpty())
4734 yyextra->current->docFile = yyextra->fileName;
4735 yyextra->current->docLine = yyextra->lineNr;
4738 yyextra->pOutputString = &yyextra->current->doc;
4742 if (oldContext!=yyextra->inContext)
4744 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4745 if (yyextra->current->briefFile.isEmpty())
4747 yyextra->current->briefFile = yyextra->fileName;
4748 yyextra->current->briefLine = yyextra->lineNr;
4751 bool foundMatch =
false;
4752 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4760 std::string str = yyextra->current->brief.str();
4765 for (
size_t i = 0; i <
match[2].str().size(); i++)
4767 if (match[2].str()[i] ==
'\n') cnt++;
4771 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4773 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4780 yyextra->pOutputString = &yyextra->current->brief;
4784 if (!yyextra->current->doc.isEmpty())
4786 yyextra->current->doc +=
"\n";
4788 yyextra->pOutputString = &yyextra->current->doc;
4794 yyextra->pOutputString = &yyextra->outputXRef;
4799 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4808 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4816 yyextra->current->anchors.push_back(si);
4818 else if (si->
lineNr() != -1)
4820 warn(yyextra->fileName,yyextra->lineNr,
4821 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4826 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4833 yyextra->current->anchors.push_back(si);
4840 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4842 *yyextra->pOutputString+=s;
4848 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4850 *yyextra->pOutputString+=s;
4856 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4857 *yyextra->pOutputString+=c;
4863 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4870 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4876 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4877 std::string_view str = yyextra->current->brief.view();
4882 yyextra->briefEndsAtDot=
FALSE;
4884 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4886 yyextra->current->docLine = yyextra->lineNr;
4887 yyextra->current->doc =
"";
4891 addIline(yyscanner,yyextra->lineNr);
4897 int saveLineNr = yyextra->lineNr;
4899 yyextra->current->briefLine = yyextra->lineNr;
4900 yyextra->lineNr = saveLineNr;
4906 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4907 yyextra->prevPosition=yyextra->inputPosition;
4909 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4911 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4922 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4923 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4924 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4925 YY_START==ReadFormulaLong)
4927 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4941 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4949 commentscanYYlex_destroy(
p->yyscanner);
4962 bool &newEntryNeeded,
4963 bool markdownSupport,
4967 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4969 isAutoBriefOn,isInbody,prot,markdownSupport);
4971 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4974 yyextra->guards = guards;
4975 yyextra->langParser = parser;
4976 yyextra->current = curEntry;
4977 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4979 yyextra->inputString =
comment;
4980 yyextra->inputString.append(
" ");
4981 yyextra->inputPosition = position;
4982 yyextra->lineNr = lineNr;
4983 yyextra->fileName = fileName;
4984 yyextra->protection = prot;
4985 yyextra->needNewEntry =
FALSE;
4987 yyextra->xrefAppendFlag =
FALSE;
4988 yyextra->insidePre =
FALSE;
4989 yyextra->parseMore =
FALSE;
4990 yyextra->inBody = isInbody;
4991 yyextra->markdownSupport= markdownSupport;
4992 yyextra->outputXRef.clear();
4993 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4995 yyextra->current->doc +=
'\n';
4998 yyextra->briefEndsAtDot = isAutoBriefOn;
4999 yyextra->condCount = 0;
5000 yyextra->sectionLevel = 0;
5001 yyextra->spaceBeforeCmd.clear();
5002 yyextra->spaceBeforeIf.clear();
5003 yyextra->htmlContextStack.clear();
5006 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
5009 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
5010 yyextra->current->inbodyDocs+=cmd;
5014 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
5017 commentscanYYrestart(
nullptr, yyscanner );
5019 commentscanYYlex(yyscanner);
5022 if (YY_START==OverloadParam)
5027 if (yyextra->insideParBlock)
5029 warn(yyextra->fileName,yyextra->lineNr,
5030 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
5036 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
5039 yyextra->current->doc=
"\n\n";
5042 if (yyextra->current->section.isMemberGrp() &&
5043 yyextra->docGroup.isEmpty())
5045 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
5049 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
5051 yyextra->current->briefLine,yyextra->current->brief,
5052 yyextra->current->docLine,yyextra->current->doc,
5053 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
5057 prot = yyextra->protection;
5059 yyextra->docGroup.addDocs(curEntry);
5061 newEntryNeeded = yyextra->needNewEntry;
5066 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
5068 if (!yyextra->parseMore && !yyextra->guards->empty())
5070 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
5073 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
5075 lineNr = yyextra->lineNr;
5077 position,yyextra->parseMore,newEntryNeeded);
5079 return yyextra->parseMore;
5084 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
5086 bool sectionEnabled =
false;
5091 bool parentEnabled = yyextra->guards->top().parentVisible();
5095 (sectionEnabled && yyextra->guardType==
Guard_If) ||
5096 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
5100 yyextra->guards->top().setEnabled(
true);
5101 yyextra->guards->top().setEnabledFound();
5102 BEGIN( GuardParamEnd );
5106 if (yyextra->guards->top().isEnabledFound())
5108 yyextra->guards->top().setEnabled(
false);
5109 BEGIN( SkipGuardedSection );
5111 else if (sectionEnabled)
5113 yyextra->guards->top().setEnabled(
true);
5114 yyextra->guards->top().setEnabledFound();
5115 BEGIN( GuardParamEnd );
5119 yyextra->guards->top().setEnabled(
false);
5120 BEGIN( SkipGuardedSection );
5125 BEGIN( SkipGuardedSection );
5130 BEGIN( SkipGuardedSection );
5136 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5137 yyextra->docGroup.initGroupInfo(entry);
5142 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5143 yyextra->docGroup.enterFile(fileName,lineNr);
5148 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5149 yyextra->docGroup.leaveFile(fileName,lineNr);
5154 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5155 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5160 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5161 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5166 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5167 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5172 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5173 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5176#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.