16%option never-interactive
17%option prefix="commentscanYY"
19%option extra-type="struct commentscanYY_state *"
23#define YY_TYPEDEF_YY_SCANNER_T
39#include <unordered_map>
210static const std::map< std::string, DocCmdMap >
docCmdMap =
413#define YY_NO_UNISTD_H 1
414#define YY_NEVER_INTERACTIVE 1
544 const QCString &listTitle,
bool append);
561#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
566#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
Represents an unstructured piece of information, about an entity found in the sources.
Wrapper class for the Entry type.
Minimal replacement for QFileInfo.
Abstract interface for outline parsers.
This is an alternative implementation of QCString.
std::vector< std::string > StringVector
#define lineCount(s, len)
Some helper functions for std::string.
DocCmdMap(DocCmdFunc h, CommandSpacing s, SectionHandling sh)
SectionHandling sectionHandling
HtmlContextInfo(const QCString &tn, OutputContext ctx)
A bunch of utility functions.
577TABLE ("table"|"TABLE")
578TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
588CAPTION ("caption"|"CAPTION")
589CENTER ("center"|"CENTER")
591DETAILS ("details"|"DETAILS")
592BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
593DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
594DETAILEDHTMLOPT {CODE}
595DETAILEDHTMLOPTEND {ENDCODE}
596SUMMARY ("summary"|"SUMMARY")
597REMARKS ("remarks"|"REMARKS")
599ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
604DOCNL "\n"|"\\ilinebr"
607FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
608FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
609FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
610ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
611LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
612CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
613CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
614CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
615SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
616SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
617TMPLSPEC "<"{BN}*[^>]+{BN}*">"
618MAILADDR ("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\-]+
619RCSTAG "$"{ID}":"[^\n$]+"$"
620MODULE_ID ({ID}".")*{ID}
621LINENR {Bopt}[1-9][0-9]*
622IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
674%x ReadFormulaShortSection
676%x ReadFormulaRoundSection
690%x RaiseWarningSection
719<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
722<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
728<Comment>"\""[^"\n]*"\"" {
731<Comment>("\\"[a-z_A-Z]+)+"\\" {
734<Comment>"<"{DETAILEDHTML}{ATTR}">" {
736 int spacePos = htmlOpenTag.find(
' ');
737 if (spacePos==-1) spacePos=yyleng-1;
738 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
740 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
748<Comment>"</"{DETAILEDHTML}">" {
750 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
752 if (!yyextra->htmlContextStack.empty() &&
753 yyextra->htmlContextStack.back().tagName==htmlTagName)
760 yyextra->htmlContextStack.pop_back();
764<Comment>"<"{DETAILEDHTMLOPT}">" {
766 if (yyextra->current->lang==SrcLangExt::CSharp)
768 yyextra->CScode=
true;
778<Comment>"<"{DETAILEDHTMLOPTEND}">" {
782 yyextra->CScode=
false;
786 yyextra->CScode=
false;
791<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
793 if (yyextra->current->lang==SrcLangExt::CSharp)
800<Comment>"<"{DETAILS}{ATTR}">" {
801 yyextra->htmlDetailsStack.push_back(0);
802 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
809<Comment>"</"{DETAILS}">" {
810 if (!yyextra->htmlDetailsStack.empty())
812 yyextra->htmlDetailsStack.pop_back();
814 if (!yyextra->htmlContextStack.empty() &&
815 yyextra->htmlContextStack.back().tagName==
"details")
822 yyextra->htmlContextStack.pop_back();
827 yyextra->htmlAnchorStr = yytext;
828 yyextra->htmlAnchor =
false;
832 yyextra->htmlAnchorStr += yytext;
837 if (c==
'\'' || c==
'"')
839 int e=tag.find(c,s+2);
842 id=tag.mid(s+2,e-s-2);
851 if (!
id.isEmpty() && !yyextra->htmlAnchor)
857 yyextra->htmlAnchor =
true;
860<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
861 yyextra->htmlAnchorStr += yytext;
864 if (!yyextra->htmlAnchor)
866 addOutput(yyscanner,yyextra->htmlAnchorStr);
879 yyextra->htmlAnchorStr += yytext;
880 if (*yytext ==
'\n') yyextra->lineNr++;
883 yyextra->htmlAnchorStr += yytext;
885<Comment>"<"{SUMMARY}">" {
886 if (yyextra->htmlDetailsStack.empty())
895<Comment>"<"{REMARKS}">" {
899<Comment>"</"{SUMMARY}">" {
900 if (!yyextra->htmlDetailsStack.empty())
909<Comment>"</"{REMARKS}">" {
913<Comment>"<"{CAPTION}{ATTR}">" {
915 int s=tag.find(
"id=");
919 if (c==
'\'' || c==
'"')
921 int e=tag.find(c,s+4);
931<Comment>"<"{PRE}{ATTR}">" {
932 yyextra->insidePre=
TRUE;
935<Comment>"</"{PRE}">" {
936 yyextra->insidePre=
FALSE;
946<Comment>"<!\[CDATA\[" {
949<Comment>{B}*{CMD}"endinternal"{B}* {
951 if (!yyextra->inInternalDocs)
952 warn(yyextra->fileName,yyextra->lineNr,
953 "found \\endinternal without matching \\internal"
955 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
957<Comment>{B}*"\\ilinebr "{B}* {
960<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
970<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
971<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
974 int idx = fullMatch.
find(
'{');
976 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
977 int idxEnd = fullMatch.
find(
"}",idx+1);
995 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
996 yyextra->spaceBeforeCmd = fullMatch.
left(i);
999 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
1001 yyextra->briefEndsAtDot=
FALSE;
1007 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1012 yyextra->parseMore=
TRUE;
1014 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1017 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.
1029<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1032<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1039 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...
1045<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1047 yyextra->formulaText=
"";
1048 yyextra->formulaPreText=
"\\begin";
1049 yyextra->formulaPostText=
"";
1051 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1054 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1056 yyextra->formulaPreText+=yyextra->formulaEnv;
1057 yyextra->formulaNewLines=0;
1058 BEGIN(ReadFormulaLong);
1060<Comment>{B}*{CMD}"f$" {
1061 yyextra->formulaText=
"";
1062 yyextra->formulaPreText=
"$";
1063 yyextra->formulaPostText=
"";
1064 yyextra->formulaNewLines=0;
1065 BEGIN(ReadFormulaShort);
1067<Comment>{B}*{CMD}"f(" {
1068 yyextra->formulaText=
"";
1069 yyextra->formulaPreText=
"";
1070 yyextra->formulaPostText=
"";
1071 yyextra->formulaNewLines=0;
1072 BEGIN(ReadFormulaRound);
1074<Comment>{B}*{CMD}"f[" {
1076 yyextra->formulaText=
"";
1077 yyextra->formulaPreText=
"\\[";
1078 yyextra->formulaPostText=
"";
1079 yyextra->formulaNewLines=0;
1080 BEGIN(ReadFormulaLong);
1082<Comment>{B}*{CMD}"{" {
1084 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1086<Comment>{B}*{CMD}"}" {
1088 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1089 yyextra->docGroup.clearHeader();
1090 yyextra->parseMore=
TRUE;
1091 yyextra->needNewEntry =
TRUE;
1092 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1095<Comment>{B}*{CMD}[$@\\&~<>#%] {
1098<Comment>[a-z_A-Z]+ {
1101<Comment>^{B}*"."{Bopt}/\n {
1104<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1105<Comment>^{B}*[*+]{B}+ {
1106 if (!yyextra->markdownSupport)
1114 yyextra->briefEndsAtDot=
FALSE;
1120<Comment>^{B}*"-"{B}+ {
1123 yyextra->briefEndsAtDot=
FALSE;
1128<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1131<Comment>{CMD}"---" {
1138 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1141 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1146 yyextra->briefEndsAtDot=
FALSE;
1151<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1152<Comment>("."+)[a-z_A-Z0-9\)] {
1156<Comment>{CMD}[\.?!] {
1160<Comment>".\\"[ \t] {
1167<Comment>"...\\"[ \t] {
1170<Comment>"..."/[^\.] {
1173<Comment>".."[\.]?/[^ \t\n] {
1176<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1182 for (i=0;i<(yy_size_t)yyleng;)
1184 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1185 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1192 for (i=0;i<(yy_size_t)yyleng;)
1194 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1195 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1210 if (yyextra->briefEndsAtDot)
1213 yyextra->briefEndsAtDot=
FALSE;
1218 if (*yytext ==
'\n') yyextra->lineNr++;
1220<Comment>"<"[/]?{TABLEDEL}">" {
1238<HtmlComment>"---"[!]?">"{B}* {
1239 warn(yyextra->fileName,yyextra->lineNr,
1240 "incorrect HTML end comment --->"
1243<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1244<HtmlComment>{DOCNL} {
1251<HtmlComment>[^\\\n\-]+ {
1256<CdataSection>"\]\]>" {
1259<CdataSection>{DOCNL} {
1261 if (*yytext==
'\n') yyextra->lineNr++;
1263<CdataSection>[<>&] {
1267<CdataSection>[^\\\n\]<>&]+ {
1276<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1277 yyextra->formulaPostText+=
"$";
1280 if (YY_START == ReadFormulaShort)
1286 yyextra->sectionTitle+=
" "+form;
1287 BEGIN(SectionTitle);
1290<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1293 if (YY_START == ReadFormulaRound)
1299 yyextra->sectionTitle+=
" "+form;
1300 BEGIN(SectionTitle);
1303<ReadFormulaLong>{CMD}"f]" {
1304 yyextra->formulaPostText+=
"\\]";
1308<ReadFormulaLong>{CMD}"f}" {
1309 yyextra->formulaPostText+=
"\\end";
1310 yyextra->formulaPostText+=yyextra->formulaEnv;
1314<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1315 yyextra->formulaText+=yytext;
1317<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1318 yyextra->formulaNewLines++;
1319 yyextra->formulaText+=*yytext;
1321 addIline(yyscanner,yyextra->lineNr);
1323<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1324 yyextra->formulaText+=*yytext;
1329<EnumDocArg1>{SCOPEID} {
1331 yyextra->current->name = yytext;
1338<EnumDocArg1>{DOCNL} {
1339 warn(yyextra->fileName,yyextra->lineNr,
1340 "missing argument after '\\enum'."
1350<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)
1356<NameSpaceDocArg1>{LC} {
1360<NameSpaceDocArg1>{DOCNL} {
1361 warn(yyextra->fileName,yyextra->lineNr,
1362 "missing argument after '\\namespace'."
1367<NameSpaceDocArg1>. {
1372<PackageDocArg1>{ID}("."{ID})* {
1373 yyextra->current->name = yytext;
1376<PackageDocArg1>{LC} {
1380<PackageDocArg1>{DOCNL} {
1381 warn(yyextra->fileName,yyextra->lineNr,
1382 "missing argument after \\package."
1394<ConceptDocArg1>{SCOPEID} {
1396 yyextra->current->name = yytext;
1399<ConceptDocArg1>{LC} {
1403<ConceptDocArg1>{DOCNL} {
1404 warn(yyextra->fileName,yyextra->lineNr,
1405 "missing argument after '\\concept'."
1414<ModuleDocArg1>{MODULE_ID} {
1416 yyextra->current->name = yytext;
1419<ModuleDocArg1>{LC} {
1423<ModuleDocArg1>{DOCNL} {
1424 warn(yyextra->fileName,yyextra->lineNr,
1425 "missing argument after '\\module'."
1435<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1439 BEGIN( ClassDocArg2 );
1441<ClassDocArg1>{SCOPENAME} {
1444 yyextra->current->name =
substitute(yytext,
".",
"::");
1445 if (yyextra->current->section.isProtocolDoc())
1447 yyextra->current->name+=
"-p";
1450 BEGIN( ClassDocArg2 );
1452<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1455 yyextra->current->name =
substitute(yytext,
".",
"::");
1456 BEGIN( ClassDocArg2 );
1458<ClassDocArg1,CategoryDocArg1>{LC} {
1462<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1463 warn(yyextra->fileName,yyextra->lineNr,
1464 "missing argument after '\\{}'.",yyextra->currentCmd
1469<ClassDocArg1,CategoryDocArg1>. {
1472<ClassDocArg2>{DOCNL} {
1476<ClassDocArg2>{FILE}|"<>" {
1477 yyextra->current->includeFile = yytext;
1478 BEGIN( ClassDocArg3 );
1487<ClassDocArg3>[<"]?{FILE}?[">]? {
1488 yyextra->current->includeName = yytext;
1495<ClassDocArg3>{DOCNL} {
1505<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1506 yyextra->current->name = yytext;
1510 if (yyextra->current->name.endsWith(
".html"))
1512 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1514 else if (yyextra->current->name.endsWith(
".xhtml"))
1516 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1518 yyextra->current->type.clear();
1519 BEGIN(GroupDocArg2);
1521<GroupDocArg1>"\\"{B}*"\n" {
1525<GroupDocArg1>{DOCNL} {
1526 warn(yyextra->fileName,yyextra->lineNr,
1527 "missing group name after {}",
1528 yyextra->current->groupDocCmd()
1537<GroupDocArg2>"\\"{B}*"\n" {
1541<GroupDocArg2>[^\n\\]+ {
1542 yyextra->current->type += yytext;
1544<GroupDocArg2>{DOCNL}+ {
1545 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1547 yyextra->current->type.isEmpty()
1550 warn(yyextra->fileName,yyextra->lineNr,
1551 "missing title after "
1552 "\\defgroup {}", yyextra->current->name
1556 int extraLineNr = 0;
1559 for (
int i = 0; i < yyleng; i++)
1561 if (yytext[i]==
'\n') extraLineNr++;
1568 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1569 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1574 yyextra->current->type += yytext;
1579<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1583 int start = text.
find(
'{');
1584 int end = text.
find(
'}',start+1);
1585 yyextra->current->name = text.
mid(
end+2);
1586 int istart = yyextra->current->name.
find(
"\\ilinebr");
1589 QCString rest = yyextra->current->name.
mid(istart);
1591 yyextra->current->name = yyextra->current->name.mid(0,istart);
1593 yyextra->current->args = text.
mid(start+1,
end-start-1);
1595 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1597<PageDocArg1>{FILE} {
1599 yyextra->current->args =
"";
1600 BEGIN( PageDocArg2 );
1602<PageDocArg1>{LC} { yyextra->lineNr++;
1605<PageDocArg1>{DOCNL} {
1606 warn(yyextra->fileName,yyextra->lineNr,
1607 "missing argument after \\page."
1616<PageDocArg2>{DOCNL} {
1620 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1621 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1624<PageDocArg2>{CMD}[<>] {
1629 yyextra->current->args += tmp;
1632 yyextra->current->args += yytext;
1635<ParamArg1>{ID}/{B}*"," {
1642 if (*yytext==
'\n') yyextra->lineNr++;
1656<FileDocArg1>{DOCNL} {
1662<FileDocArg1>{FILE} {
1666<FileDocArg1>{LC} { yyextra->lineNr++;
1674<XRefItemParam1>{LABELID} {
1675 yyextra->newXRefItemKey=yytext;
1677 BEGIN(XRefItemParam2);
1679<XRefItemParam1>{LC} {
1683<XRefItemParam1>{DOCNL} {
1684 warn(yyextra->fileName,yyextra->lineNr,
1685 "Missing first argument of \\xrefitem"
1687 if (*yytext==
'\n') yyextra->lineNr++;
1695<XRefItemParam2>"\""[^\n\"]*"\"" {
1697 BEGIN(XRefItemParam3);
1699<XRefItemParam2>{LC} {
1703<XRefItemParam2>{DOCNL} {
1704 warn(yyextra->fileName,yyextra->lineNr,
1705 "Missing second argument of \\xrefitem"
1707 if (*yytext==
'\n') yyextra->lineNr++;
1715<XRefItemParam3>"\""[^\n\"]*"\"" {
1720<XRefItemParam2,XRefItemParam3>{LC} {
1724<XRefItemParam3>{DOCNL} {
1725 warn(yyextra->fileName,yyextra->lineNr,
1726 "Missing third argument of \\xrefitem"
1728 if (*yytext==
'\n') yyextra->lineNr++;
1739<RelatesParam1>({ID}("::"|"."))*{ID} {
1740 yyextra->current->relates = yytext;
1747<RelatesParam1>{LC} {
1751<RelatesParam1>{DOCNL} {
1752 warn(yyextra->fileName,yyextra->lineNr,
1753 "Missing argument of '\\{}' command",yyextra->currentCmd
1765<Qualifier>{LABELID} {
1766 yyextra->current->qualifiers.emplace_back(yytext);
1769<Qualifier>"\""[^\"]*"\"" {
1770 std::string inp(yytext);
1771 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1775 warn(yyextra->fileName,yyextra->lineNr,
1776 "Missing argument of '\\{}' command",yyextra->currentCmd
1782 warn(yyextra->fileName,yyextra->lineNr,
1783 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1789<ILine>{LINENR}/[\\@\n\.] |
1795 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1799 yyextra->lineNr = nr;
1802 if (YY_START == ILine)
1808 yyextra->sectionTitle+=yytext;
1809 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1812<ILine,ILineSection>. {
1814 if (YY_START == ILine)
1820 yyextra->sectionTitle+=yytext;
1821 BEGIN(SectionTitle);
1826<IRaise>{B}*[0-9]+/[\\@\n\.] |
1827<IRaise>{B}*[0-9]+{B} {
1832 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1836 yyextra->raiseLevel = nr;
1846<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1860<IFile,IFileSection>{FILE} {
1863 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1864 else yyextra->fileName = yytext;
1865 if (YY_START == IFile)
1871 yyextra->sectionTitle+=yytext;
1872 BEGIN(SectionTitle);
1876<LinkSection>[^\\@\n]* {
1877 yyextra->sectionTitle+=yytext;
1879<LinkSection>{CMD}{CMD} {
1880 yyextra->sectionTitle+=yytext;
1882<LinkSection>{DOCNL} {
1884 if (*yytext ==
'\n') yyextra->lineNr++;
1885 yyextra->sectionTitle+=yytext;
1887<LinkSection>{CMD}"endlink" {
1888 yyextra->sectionTitle+=yytext;
1889 BEGIN(SectionTitle);
1892 yyextra->sectionTitle+=yytext;
1894<LinkSection><<EOF>> {
1895 warn(yyextra->fileName,yyextra->lineNr,
1896 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1902<LineParam>{CMD}{CMD} {
1915<LineParam>({CMD}{CMD}){ID} {
1924<SectionLabel>{LABELID} {
1925 yyextra->sectionLabel+=yytext;
1927<SectionLabel>{CMD}"lineinfo"("{}")? {
QCString & setNum(short n)
1930<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1931 FileInfo fi(yyextra->fileName.str());
1932 bool hasOption =
false;
1934 if (yytext[yyleng-1] ==
'}')
1940 for (
const auto &opt_ : optList)
1943 std::string opt = optStripped.
lower().
str();
1949 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1959 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1971 label=yyextra->fileName;
1975 yyextra->sectionLabel+=label;
#define Config_getBool(name)
static QCString stripFromPath(const QCString &p, const StringVector &l)
1977<SectionLabel>{DOCNL} {
1978 yyextra->sectionTitle.clear();
1979 if (yyextra->sectionLabel.isEmpty())
1981 warn(yyextra->fileName,yyextra->lineNr,
1982 "\\section command has no label"
1987 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
1988 addOutput(yyscanner,yyextra->sectionLabel.data());
1991 if (*yytext==
'\n') yyextra->lineNr++;
1996 if (yyextra->sectionLabel.isEmpty())
1998 warn(yyextra->fileName,yyextra->lineNr,
1999 "Invalid or missing section label"
2005 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2006 addOutput(yyscanner,yyextra->sectionLabel.data());
2007 yyextra->sectionTitle.clear();
2009 BEGIN(SectionTitle);
2012<SectionTitle>{STAopt}/"\n" {
2017<SectionTitle>{STopt}"\\\\ilinebr" {
2018 yyextra->sectionTitle+=yytext;
2020<SectionTitle>{STopt}/"\\ilinebr" {
2025<SectionTitle>{B}*{CMD}"f$" {
2026 yyextra->formulaText=
"";
2027 yyextra->formulaPreText=
"$";
2028 yyextra->formulaPostText=
"";
2029 yyextra->formulaNewLines=0;
2030 BEGIN(ReadFormulaShortSection);
2032<SectionTitle>{B}*{CMD}"f(" {
2033 yyextra->formulaText=
"";
2034 yyextra->formulaPreText=
"";
2035 yyextra->formulaPostText=
"";
2036 yyextra->formulaNewLines=0;
2037 BEGIN(ReadFormulaRoundSection);
2039<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2040<SectionTitle>{B}*{CMD}"f"[\[{] {
2044 warn(yyextra->fileName,yyextra->lineNr,
2045 "'\\{}' command is not allowed in section title, ending section title.",
2055<SectionTitle>[^\n@\\]* {
2056 yyextra->sectionTitle+=yytext;
2059<SectionTitle>{B}*{CMD}{CMD} {
2060 yyextra->sectionTitle+=yytext;
2063<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2064<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2066 int idx = fullMatch.
find(
'{');
2068 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2069 int idxEnd = fullMatch.
find(
"}",idx+1);
2085 switch (it->second.sectionHandling)
2090 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2091 yyextra->sectionTitle+=fullMatch.
left(i);
2092 yyextra->sectionTitle+=
'@';
2093 yyextra->sectionTitle+=fullMatch.
mid(i);
2097 warn(yyextra->fileName,yyextra->lineNr,
2098 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2106 warn(yyextra->fileName,yyextra->lineNr,
2107 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2115 if (cmdName ==
"fileinfo")
2118 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2119 yyextra->sectionTitle+=fullMatch.
left(i);
2124 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2129 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2133 else if (cmdName ==
"lineinfo")
2136 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2137 yyextra->sectionTitle+=fullMatch.
left(i);
2139 yyextra->sectionTitle+=
' ';
2140 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2146 else if (cmdName ==
"raisewarning")
2148 yyextra->raiseWarning =
"";
2149 BEGIN(RaiseWarningSection);
2151 else if (cmdName ==
"noop")
2156 else if (cmdName ==
"cite")
2158 yyextra->sectionTitle+=yytext;
2160 BEGIN(CiteLabelSection);
2162 else if (cmdName ==
"iline")
2164 yyextra->sectionTitle+=yytext;
2166 BEGIN(ILineSection);
2168 else if (cmdName ==
"ifile")
2170 yyextra->sectionTitle+=yytext;
2172 BEGIN(IFileSection);
2174 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2177 if (optList.empty())
2179 yyextra -> anchorTitle =
"";
2184 yyextra -> anchorTitle =
join(optList,
" ");
2187 BEGIN(AnchorLabelSection);
2189 else if (cmdName ==
"link")
2191 yyextra->sectionTitle+=yytext;
2196 yyextra->sectionTitle+=yytext;
2197 warn(yyextra->fileName,yyextra->lineNr,
2198 "internal error '\\{}' command is to be replaced in section title.",cmdName
2205 yyextra->sectionTitle+=yytext;
2213 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
2218 yyextra->sectionTitle+=yytext;
2224<SubpageLabel>{FILE} {
2228 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2229 BEGIN(SubpageTitle);
2231<SubpageLabel>{DOCNL} {
2232 warn(yyextra->fileName,yyextra->lineNr,
2233 "\\subpage command has no label"
2235 if (*yytext==
'\n') yyextra->lineNr++;
2243<SubpageTitle>{DOCNL} {
2247<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2258<AnchorLabel,AnchorLabelSection>{LABELID} {
2259 QCString lbl = yyextra->raisePrefix+yytext;
2260 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2262 if (YY_START == AnchorLabel)
2268 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2271<AnchorLabel,AnchorLabelSection>{DOCNL} {
2272 warn(yyextra->fileName,yyextra->lineNr,
2273 "\\anchor command has no label"
2275 if (*yytext==
'\n') yyextra->lineNr++;
2277 if (YY_START == AnchorLabel)
2283 BEGIN(SectionTitle);
2286<AnchorLabel,AnchorLabelSection>. {
2287 warn(yyextra->fileName,yyextra->lineNr,
2288 "Invalid or missing anchor label"
2291 if (YY_START == AnchorLabel)
2297 BEGIN(SectionTitle);
2304<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2306 if (&yytext[4]==yyextra->blockName)
2311<FormatBlock>{CMD}"enduml" {
2313 if (yyextra->blockName==
"startuml")
2318<FormatBlock>[^ \@\*\/\\\n]* {
2321<FormatBlock>{DOCNL} {
2322 if (*yytext==
'\n') yyextra->lineNr++;
2326 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2327 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2328 yyextra->blockName==
"iliteral"
2330 ) yyextra->commentCount++;
2335 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2336 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2337 yyextra->blockName==
"iliteral"
2341 yyextra->commentCount--;
2342 if (yyextra->commentCount<0)
2344 QCString endTag =
"end"+yyextra->blockName;
2345 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2346 warn(yyextra->fileName,yyextra->lineNr,
2347 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2348 yyextra->blockName,endTag);
2355<FormatBlock><<EOF>> {
2356 QCString endTag =
"end"+yyextra->blockName;
2357 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2358 warn(yyextra->fileName,yyextra->lineNr,
2359 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2360 yyextra->blockName,endTag
2367<GuardParam>{B}*"(" {
2368 yyextra->guardExpr=yytext;
2369 yyextra->roundCount=1;
2373 yyextra->guardExpr+=yytext;
2377 yyextra->guardExpr+=yytext;
2378 yyextra->roundCount++;
2381 yyextra->guardExpr+=yytext;
2382 yyextra->roundCount--;
2383 if (yyextra->roundCount==0)
2389 warn(yyextra->fileName,yyextra->lineNr,
2390 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2394<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2397<GuardParam>{DOCNL} {
2412<GuardParamEnd>{B}*{DOCNL} {
2414 yyextra->spaceBeforeIf.clear();
2418<GuardParamEnd>{B}* {
2419 if (!yyextra->spaceBeforeIf.isEmpty())
2421 addOutput(yyscanner,yyextra->spaceBeforeIf);
2423 yyextra->spaceBeforeIf.clear();
2435<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2437 yyextra->guards->emplace(
false);
2438 BEGIN( GuardParam );
2440<SkipGuardedSection>{CMD}"if"/{NW} {
2442 yyextra->guards->emplace(
false);
2443 BEGIN( GuardParam );
2445<SkipGuardedSection>{CMD}"endif"/{NW} {
2446 if (yyextra->guards->empty())
2448 warn(yyextra->fileName,yyextra->lineNr,
2449 "found \\endif without matching start command");
2454 yyextra->guards->pop();
2455 if (yyextra->guards->empty())
2457 BEGIN( GuardParamEnd );
2461 if (yyextra->guards->top().isEnabled())
2463 BEGIN( GuardParamEnd );
2467 BEGIN( SkipGuardedSection );
2472<SkipGuardedSection>{CMD}"else"/{NW} {
2473 if (yyextra->guards->empty())
2475 warn(yyextra->fileName,yyextra->lineNr,
2476 "found \\else without matching start command");
2478 else if (yyextra->guards->top().hasElse())
2480 warn(yyextra->fileName,yyextra->lineNr,
2481 "found multiple \\else commands in same \\if construct");
2482 yyextra->guards->top().setEnabled(
false);
2483 BEGIN( SkipGuardedSection );
2485 else if (!yyextra->guards->top().parentVisible())
2487 yyextra->guards->top().setEnabled(
false);
2488 BEGIN( SkipGuardedSection );
2492 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2493 yyextra->guards->top().setElse();
2494 if (!yyextra->guards->top().parentVisible())
2496 yyextra->guards->top().setEnabled(
false);
2497 BEGIN( SkipGuardedSection );
2499 else if (yyextra->guards->top().isEnabledFound())
2501 yyextra->guards->top().setEnabled(
false);
2502 BEGIN( SkipGuardedSection );
2506 yyextra->guards->top().setEnabled(
true);
2507 BEGIN( GuardParamEnd );
2511<SkipGuardedSection>{CMD}"elseif"/{NW} {
2512 if (yyextra->guards->empty())
2514 warn(yyextra->fileName,yyextra->lineNr,
2515 "found \\elseif without matching start command");
2517 else if (yyextra->guards->top().hasElse())
2519 warn(yyextra->fileName,yyextra->lineNr,
2520 "found \\elseif command after \\else command was given in \\if construct");
2522 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2523 yyextra->guards->top().setEnabled(
false);
2524 BEGIN( GuardParam );
2529 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2530 yyextra->guards->top().setEnabled(
false);
2531 BEGIN( GuardParam );
2534<SkipGuardedSection>{DOCNL} {
2535 if (*yytext==
'\n') yyextra->lineNr++;
2538<SkipGuardedSection>[^ \\@\n]+ {
2540<SkipGuardedSection>{CMD}{CMD} |
2541<SkipGuardedSection>. {
2547<SkipInternal>{DOCNL} {
2548 if (*yytext==
'\n') yyextra->lineNr++;
2551<SkipInternal>{CMD}"if"/[ \t] {
2552 yyextra->condCount++;
2554<SkipInternal>{CMD}"ifnot"/[ \t] {
2555 yyextra->condCount++;
2557<SkipInternal>{CMD}/"endif" {
2558 yyextra->condCount--;
2559 if (yyextra->condCount<0)
2565<SkipInternal>{CMD}/"section"[ \t] {
2566 if (yyextra->sectionLevel>0)
2572<SkipInternal>{CMD}/"subsection"[ \t] {
2573 if (yyextra->sectionLevel>1)
2579<SkipInternal>{CMD}/"subsubsection"[ \t] {
2580 if (yyextra->sectionLevel>2)
2586<SkipInternal>{CMD}/"paragraph"[ \t] {
2587 if (yyextra->sectionLevel>3)
2593<SkipInternal>{CMD}/"subparagraph"[ \t] {
2594 if (yyextra->sectionLevel>4)
2600<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2601 if (yyextra->sectionLevel>5)
2607<SkipInternal>{CMD}"endinternal"[ \t]* {
2610<SkipInternal>[^ \\@\n]+ {
2627 yyextra->docGroup.appendHeader(
' ');
2630 yyextra->docGroup.appendHeader(*yytext);
2631 yyextra->current->name+=*yytext;
2646<RaiseWarning,RaiseWarningSection>{DOCNL} {
2648 "{}",yyextra->raiseWarning);
2649 yyextra->raiseWarning =
"";
2650 if (*yytext==
'\n') yyextra->lineNr++;
2652 if (YY_START == RaiseWarning)
2658 yyextra->sectionTitle+=yytext;
2659 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2662<RaiseWarning,RaiseWarningSection>. {
2663 yyextra->raiseWarning += yytext;
2667<InGroupParam>{LABELID} {
2668 yyextra->current->groups.emplace_back(
2671 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2673<InGroupParam>{DOCNL} {
2674 if (!yyextra->inGroupParamFound)
2676 warn(yyextra->fileName,yyextra->lineNr,
2677 "Missing group name for \\ingroup command"
2696 if (yyextra->braceCount==0)
2698 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2700 warn(yyextra->fileName,yyextra->lineNr,
2701 "missing argument after '\\{}'.",yyextra->currentCmd
2707 yyextra->langParser->parsePrototype(yyextra->functionProto);
2715 yyextra->functionProto+=
' ';
2717<FnParam>[^@\\\n()]+ {
2718 yyextra->functionProto+=yytext;
2721 yyextra->functionProto+=yytext;
2722 yyextra->braceCount++;
2725 yyextra->functionProto+=yytext;
2726 yyextra->braceCount--;
2729 yyextra->functionProto+=*yytext;
2736<OverloadParam>{DOCNL} {
2737 if (*yytext==
'\n') yyextra->lineNr++;
2738 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2746 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2750<OverloadParam>{LC} {
2752 yyextra->functionProto+=
' ';
2755 yyextra->functionProto+=*yytext;
2760<InheritParam>({ID}("::"|"."))*{ID} {
2761 yyextra->current->extends.emplace_back(
2766<InheritParam>{DOCNL} {
2767 warn(yyextra->fileName,yyextra->lineNr,
2768 "\\inherit command has no argument"
2770 if (*yytext==
'\n') yyextra->lineNr++;
2775 warn(yyextra->fileName,yyextra->lineNr,
2776 "Invalid or missing name for \\inherit command"
2783<ExtendsParam>({ID}("::"|"."))*{ID} {
2784 yyextra->current->extends.emplace_back(
2789<ExtendsParam>{DOCNL} {
2790 warn(yyextra->fileName,yyextra->lineNr,
2791 "'\\{}' command has no argument",yyextra->currentCmd
2803<SkipLang>{CMD}"~"[a-zA-Z-]* {
2807 warn(yyextra->fileName,yyextra->lineNr,
2816<SkipLang>[^*@\\\n]* {
2819 if (*yytext==
'\n') yyextra->lineNr++;
2826<CiteLabel,CiteLabelSection>{CITEID} {
2829 if (YY_START == CiteLabel)
2835 yyextra->sectionTitle+=yytext;
2836 BEGIN(SectionTitle);
2839<CiteLabel,CiteLabelSection>{DOCNL} {
2840 warn(yyextra->fileName,yyextra->lineNr,
2841 "\\cite command has no label"
2845 if (YY_START == CiteLabel)
2852 yyextra->sectionTitle+=yytext;
2854 BEGIN(SectionTitle);
2857<CiteLabel,CiteLabelSection>. {
2858 warn(yyextra->fileName,yyextra->lineNr,
2859 "Invalid or missing cite label"
2861 if (YY_START == CiteLabel)
2867 yyextra->sectionTitle+=yytext;
2868 BEGIN(SectionTitle);
2876 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2877 addOutput(yyscanner,yyextra->copyDocArg);
2881<CopyDoc>"<"[/]?{TABLEDEL}">" {
2882 if (yyextra->braceCount==0)
2885 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2886 addOutput(yyscanner,yyextra->copyDocArg);
2892 if (*yytext==
'\n') yyextra->lineNr++;
2893 if (yyextra->braceCount==0)
2896 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2897 addOutput(yyscanner,yyextra->copyDocArg);
2905<CopyDoc>[^@\\\n()<]+ {
2906 yyextra->copyDocArg+=yytext;
2910 yyextra->copyDocArg+=yytext;
2912 yyextra->braceCount++;
2915 yyextra->copyDocArg+=yytext;
2917 yyextra->braceCount--;
2920 yyextra->copyDocArg+=yytext;
2942 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2943 yyextra->braceCount=0;
2944 yyextra->functionProto.clear();
2945 yyextra->currentCmd = cmd;
2946 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2953 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2954 yyextra->functionProto.clear();
2955 yyextra->braceCount=0;
2956 yyextra->currentCmd = cmd;
2957 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2964 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2965 yyextra->functionProto.clear();
2966 BEGIN(OverloadParam);
2972 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2973 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2974 BEGIN( EnumDocArg1 );
2980 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2983 BEGIN( GroupDocArg1 );
2989 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2992 BEGIN( GroupDocArg1 );
2998 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3001 BEGIN( GroupDocArg1 );
3007 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3008 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3009 BEGIN( NameSpaceDocArg1 );
3015 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3017 BEGIN( PackageDocArg1 );
3023 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3024 yyextra->currentCmd = cmd;
3025 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3026 BEGIN( ClassDocArg1 );
3032 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3033 yyextra->currentCmd = cmd;
3034 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3035 BEGIN( ConceptDocArg1 );
3041 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3042 yyextra->currentCmd = cmd;
3043 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3044 BEGIN( ModuleDocArg1 );
3050 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3051 BEGIN( ClassDocArg2 );
3057 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3058 yyextra->currentCmd = cmd;
3059 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3060 BEGIN( ClassDocArg1 );
3066 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3067 yyextra->currentCmd = cmd;
3068 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3069 BEGIN( CategoryDocArg1 );
3075 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3076 yyextra->currentCmd = cmd;
3077 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3078 BEGIN( ClassDocArg1 );
3084 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3085 yyextra->currentCmd = cmd;
3086 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3087 BEGIN( ClassDocArg1 );
3093 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3094 yyextra->currentCmd = cmd;
3095 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3096 BEGIN( ClassDocArg1 );
3102 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3103 yyextra->currentCmd = cmd;
3104 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3105 BEGIN( ClassDocArg1 );
3111 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3113 BEGIN( PageDocArg1 );
3119 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3123 yyextra->current->name =
"mainpage";
3126 BEGIN( PageDocArg2 );
3132 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3136 yyextra->current->name = yyextra->fileName;
3138 BEGIN( FileDocArg1 );
3144 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3154 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3162 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3164 if (!stop) yyextra->current->name = yyextra->fileName;
3165 BEGIN( FileDocArg1 );
3171 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3173 for (
const auto &opt : optList)
3177 sectionMaker=EntryType::makeExampleLineno;
3181 warn(yyextra->fileName,yyextra->lineNr,
3182 "unsupported option '{}' for command '\\{}'",opt,cmd);
3186 if (!stop) yyextra->current->name = yyextra->fileName;
3187 BEGIN( FileDocArg1 );
3193 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3196 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3205 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3206 yyextra->raiseWarning =
"";
3207 BEGIN( RaiseWarning );
3213 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3220 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3224 yyextra->docGroup.clearHeader();
3226 if (!yyextra->docGroup.isEmpty())
3228 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3236 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3245 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3254 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3263 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3272 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3274 BEGIN(XRefItemParam1);
3280 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3281 if (yyextra->insideParBlock)
3283 warn(yyextra->fileName,yyextra->lineNr,
3284 "found \\parblock command while already in a parblock!");
3286 if (!yyextra->spaceBeforeCmd.isEmpty())
3288 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3289 yyextra->spaceBeforeCmd.clear();
3292 yyextra->insideParBlock =
TRUE;
3298 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3299 if (!yyextra->insideParBlock)
3301 warn(yyextra->fileName,yyextra->lineNr,
3302 "found \\endparblock command without matching \\parblock!");
3306 yyextra->insideParBlock =
FALSE;
3312 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3313 if (!yyextra->current->relates.isEmpty())
3315 warn(yyextra->fileName,yyextra->lineNr,
3316 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3318 yyextra->current->relatesType = RelatesType::Simple;
3319 yyextra->currentCmd = cmd;
3320 BEGIN(RelatesParam1);
3326 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3327 if (!yyextra->current->relates.isEmpty())
3329 warn(yyextra->fileName,yyextra->lineNr,
3330 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3332 yyextra->current->relatesType = RelatesType::Duplicate;
3333 yyextra->currentCmd = cmd;
3334 BEGIN(RelatesParam1);
3340 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3341 if (!yyextra->current->relates.isEmpty())
3343 warn(yyextra->fileName,yyextra->lineNr,
3344 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3346 yyextra->current->relatesType = RelatesType::MemberOf;
3347 yyextra->currentCmd = cmd;
3348 BEGIN(RelatesParam1);
3354 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3362 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3365 BEGIN(SectionLabel);
3366 yyextra->sectionLabel.clear();
3375 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3377 switch (yyextra->sectionLevel)
3385 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3392 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3393 if (!yyextra->current->section.isEmpty() &&
3394 !yyextra->current->section.isPageDoc() &&
3395 !yyextra->current->section.isMainpageDoc()
3398 warn(yyextra->fileName,yyextra->lineNr,
3399 "found \\subpage command in a comment block that is not marked as a page!");
3401 if (!yyextra->spaceBeforeCmd.isEmpty())
3403 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3404 yyextra->spaceBeforeCmd.clear();
3407 BEGIN(SubpageLabel);
3413 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3415 if (optList.empty())
3417 yyextra -> anchorTitle =
"";
3421 yyextra -> anchorTitle =
join(optList,
" ");
3429 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3430 for (
const auto &opt : optList)
3440 if (optList.empty())
3454 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3455 if (!yyextra->spaceBeforeCmd.isEmpty())
3457 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3458 yyextra->spaceBeforeCmd.clear();
3460 if (optList.empty())
3474 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3475 if (!yyextra->spaceBeforeCmd.isEmpty())
3477 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3478 yyextra->spaceBeforeCmd.clear();
3480 if (optList.empty())
3489 yyextra->blockName=s;
3490 yyextra->commentCount=0;
3497 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3515 static std::unordered_map<std::string,OptionFunc> options =
3518 {
"name", [](
const FileInfo &fi_) ->
QCString {
return fi_.baseName(); } },
3519 {
"extension", [](
const FileInfo &fi_) ->
QCString {
return fi_.extension(
true); } },
3520 {
"filename", [](
const FileInfo &fi_) ->
QCString {
return fi_.fileName(); } },
3521 {
"directory", [](
const FileInfo &fi_) ->
QCString {
return fi_.dirPath(); } },
3522 {
"full", [](
const FileInfo &fi_) ->
QCString {
return fi_.absFilePath(); } }
3524 auto it = options.
find(optionName);
3525 return (it!=options.end()) ? it->second(fi) :
QCString();
3530 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3531 if (!yyextra->spaceBeforeCmd.isEmpty())
3533 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3534 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3535 yyextra->spaceBeforeCmd.clear();
3538 FileInfo fi(yyextra->fileName.str());
3539 for (
const auto &opt_ : optList)
3542 std::string opt = optStripped.
lower().
str();
3548 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3555 yyextra->sectionTitle+=result;
3562 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3569 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3574 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3583 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3584 if (!yyextra->spaceBeforeCmd.isEmpty())
3586 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3587 yyextra->spaceBeforeCmd.clear();
3595 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3603 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3611 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3618 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3620 BEGIN(IRaisePrefix);
3626 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3628 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3629 if (yyextra->guards->empty())
3631 yyextra->guards->emplace(
true);
3635 bool enabled = yyextra->guards->top().isEnabled();
3636 yyextra->guards->emplace(enabled);
3644 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3646 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3647 if (yyextra->guards->empty())
3649 yyextra->guards->emplace(
true);
3653 bool enabled = yyextra->guards->top().isEnabled();
3654 yyextra->guards->emplace(enabled);
3662 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3663 if (yyextra->guards->empty())
3665 warn(yyextra->fileName,yyextra->lineNr,
3666 "found \\elseif without matching start command");
3668 else if (yyextra->guards->top().hasElse())
3670 warn(yyextra->fileName,yyextra->lineNr,
3671 "found \\elseif command after \\else command was given in \\if construct");
3673 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3674 yyextra->guards->top().setEnabled(
false);
3680 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3681 yyextra->guards->top().setEnabled(
false);
3689 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3690 if (yyextra->guards->empty())
3692 warn(yyextra->fileName,yyextra->lineNr,
3693 "found \\else without matching start command");
3695 else if (yyextra->guards->top().hasElse())
3697 warn(yyextra->fileName,yyextra->lineNr,
3698 "found multiple \\else commands in same \\if construct");
3699 yyextra->guards->top().setEnabled(
false);
3700 yyextra->guards->top().setElse();
3701 BEGIN( SkipGuardedSection );
3705 yyextra->guards->top().setElse();
3706 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3707 if (yyextra->guards->top().isEnabledFound())
3709 yyextra->guards->top().setEnabled(
false);
3710 BEGIN( SkipGuardedSection );
3714 yyextra->guards->top().setEnabled(
true);
3715 BEGIN( GuardParamEnd );
3723 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3724 if (yyextra->guards->empty())
3726 warn(yyextra->fileName,yyextra->lineNr,
3727 "found \\endif without matching start command");
3731 yyextra->guards->pop();
3733 if (!yyextra->spaceBeforeCmd.isEmpty())
3735 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3736 yyextra->spaceBeforeCmd.clear();
3738 if (yyextra->guards->empty())
3740 BEGIN( GuardParamEnd );
3744 if (yyextra->guards->top().isEnabled())
3746 BEGIN( GuardParamEnd );
3750 BEGIN( SkipGuardedSection );
3758 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3759 yyextra->inGroupParamFound=
FALSE;
3760 BEGIN( InGroupParam );
3766 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3767 yyextra->current->subGrouping =
FALSE;
3773 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3774 yyextra->current->initLines = 100000;
3780 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3781 yyextra->current->initLines = 0;
3787 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3788 yyextra->current->commandOverrides.override_callGraph(
true);
3794 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3795 yyextra->current->commandOverrides.override_callGraph(
false);
3801 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3802 yyextra->current->commandOverrides.override_callerGraph(
true);
3808 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3809 yyextra->current->commandOverrides.override_callerGraph(
false);
3815 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3816 yyextra->current->commandOverrides.override_enumValues(
true);
3822 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3823 yyextra->current->commandOverrides.override_enumValues(
false);
3829 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3830 yyextra->current->commandOverrides.override_inlineSource(
true);
3836 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3837 yyextra->current->commandOverrides.override_inlineSource(
false);
3843 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3844 yyextra->current->commandOverrides.override_includeGraph(
true);
3850 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3851 yyextra->current->commandOverrides.override_includedByGraph(
true);
3857 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3858 yyextra->current->commandOverrides.override_includeGraph(
false);
3864 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3865 yyextra->current->commandOverrides.override_includedByGraph(
false);
3871 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3872 yyextra->current->commandOverrides.override_directoryGraph(
true);
3878 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3879 yyextra->current->commandOverrides.override_directoryGraph(
false);
3885 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3886 yyextra->current->commandOverrides.override_collaborationGraph(
true);
3892 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3893 yyextra->current->commandOverrides.override_collaborationGraph(
false);
3899 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3900 yyextra->current->commandOverrides.override_groupGraph(
true);
3906 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3907 yyextra->current->commandOverrides.override_groupGraph(
false);
3913 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3914 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3915 for (
const auto &opt_ : optList)
3922 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3924 else if (opt ==
"graph")
3926 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3928 else if (opt ==
"builtin")
3930 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3932 else if (opt ==
"text")
3934 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3936 else if (opt ==
"no")
3938 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3942 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
3952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3953 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3959 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3960 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3966 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3967 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3973 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3974 yyextra->current->commandOverrides.override_referencesRelation(
true);
3980 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3981 yyextra->current->commandOverrides.override_referencesRelation(
false);
3987 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3988 yyextra->currentCmd = cmd;
3995 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4000 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4002 yyextra->current->doc.clear();
4004 yyextra->condCount=0;
4005 BEGIN( SkipInternal );
4011 yyextra->inInternalDocs =
TRUE;
4018 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4019 yyextra->current->isStatic =
TRUE;
4025 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4026 yyextra->current->virt = Specifier::Pure;
4032 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4033 yyextra->current->protection = Protection::Private;
4039 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4040 yyextra->current->protection = yyextra->protection = Protection::Private;
4046 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4047 yyextra->current->protection = Protection::Protected;
4053 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4054 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4060 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4061 yyextra->current->protection = Protection::Public;
4067 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4068 yyextra->current->protection = yyextra->protection = Protection::Public;
4074 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4075 if (yyextra->current->section.isPageDoc() ||
4076 yyextra->current->section.isMainpageDoc())
4078 for (
const auto &opt_ : optList)
4082 int i = opt.
find(
':');
4086 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4088 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4102 yyextra->current->localToc.enableHtml(level);
4104 else if (opt ==
"latex")
4106 yyextra->current->localToc.enableLatex(level);
4108 else if (opt ==
"xml")
4110 yyextra->current->localToc.enableXml(level);
4112 else if (opt ==
"docbook")
4114 yyextra->current->localToc.enableDocbook(level);
4118 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4123 if (yyextra->current->localToc.nothingEnabled())
4135 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4136 BEGIN(InheritParam);
4142 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4143 yyextra->currentCmd = cmd;
4144 BEGIN(ExtendsParam);
4150 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4151 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4157 if (!yyextra->spaceBeforeCmd.isEmpty())
4159 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4160 yyextra->spaceBeforeCmd.clear();
4168 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4170 if (!yyextra->spaceBeforeCmd.isEmpty())
4172 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4173 yyextra->spaceBeforeCmd.clear();
4181 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4182 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4188 if (!yyextra->spaceBeforeCmd.isEmpty())
4190 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4191 yyextra->spaceBeforeCmd.clear();
4194 yyextra->copyDocArg.clear();
4195 yyextra->braceCount = 0;
4204 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4205 yyextra->sectionLabel.clear();
4206 yyextra->sectionTitle.clear();
4207 yyextra->docGroup.clearHeader();
4208 yyextra->insideParBlock =
FALSE;
4215 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4217 return yyextra->current->section.isDoc();
4222 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4223 assert(maker!=
nullptr);
4225 if (yyextra->current->section.isDoc())
4231 yyextra->needNewEntry =
true;
4232 yyextra->current->section = maker();
4233 yyextra->current->fileName = yyextra->fileName;
4234 yyextra->current->startLine = yyextra->lineNr;
4235 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4248 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4249 for(
const char* c = yytext ; *c ; ++c )
4250 yyextra->lineNr += (*c ==
'\n') ;
4258 if (s==
nullptr || *s==0)
return name;
4260 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4271 const QCString &listTitle,
bool append)
4273 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4274 if (listName.
isEmpty())
return;
4281 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4294 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4302 item = refList->
add();
4306 item->
setText(yyextra->outputXRef);
4308 yyextra->current->sli.push_back(item);
4311 if (yyextra->inBody)
4313 yyextra->current->inbodyDocs += cmdString;
4317 yyextra->current->doc += cmdString;
4327 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4329 yyextra->sectionLevel);
4330 yyextra->current->anchors.push_back(si);
4332 else if (si->
lineNr() != -1)
4334 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4339 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4345 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4347 yyextra->sectionLevel);
4348 yyextra->current->anchors.push_back(si);
4352 yyextra->outputXRef.clear();
4362 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4366 for (
size_t i=1; i<label.
size(); i++)
4369 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4384 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4386 QCString formula = (yyextra->formulaPreText +
4387 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4395 formLabel.
sprintf(
"\\_form#%d",
id);
4396 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4413 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4421 if (addYYtext) yyextra->sectionTitle+=yytext;
4422 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4423 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4425 yyextra->sectionLevel);
4428 yyextra->current->anchors.push_back(si);
4430 else if (si->
lineNr() != -1)
4432 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4437 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4438 yyextra->sectionLabel,si->
fileName());
4444 if (addYYtext) yyextra->sectionTitle+=yytext;
4445 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4446 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4448 yyextra->sectionLevel);
4451 yyextra->current->anchors.push_back(si);
4460 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4462 if (yytext[0] ==
'"')
4465 name=name.
left((
int)yyleng-2);
4481 if (c==
' ' || c==
'\t' || c==
'\r')
4504 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4505 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4507 yyextra->xrefAppendFlag = !yyextra->inBody &&
4509 yyextra->newXRefKind==yyextra->xrefKind &&
4511 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4527 switch(yyextra->xrefKind)
4559 yyextra->xrefItemTitle,
4560 yyextra->xrefListTitle,
4569 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4571 int oldContext = yyextra->inContext;
4572 yyextra->inContext = ctx;
4574 switch(yyextra->inContext)
4577 if (oldContext!=yyextra->inContext)
4580 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4581 if (yyextra->current->docFile.isEmpty())
4583 yyextra->current->docFile = yyextra->fileName;
4584 yyextra->current->docLine = yyextra->lineNr;
4587 yyextra->pOutputString = &yyextra->current->doc;
4591 if (oldContext!=yyextra->inContext)
4593 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4594 if (yyextra->current->briefFile.isEmpty())
4596 yyextra->current->briefFile = yyextra->fileName;
4597 yyextra->current->briefLine = yyextra->lineNr;
4600 bool foundMatch =
false;
4601 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4609 std::string str = yyextra->current->brief.str();
4614 for (
size_t i = 0; i < match[2].str().size(); i++)
4616 if (match[2].str()[i] ==
'\n') cnt++;
4620 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4622 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4629 yyextra->pOutputString = &yyextra->current->brief;
4633 if (!yyextra->current->doc.isEmpty())
4635 yyextra->current->doc +=
"\n";
4637 yyextra->pOutputString = &yyextra->current->doc;
4643 yyextra->pOutputString = &yyextra->outputXRef;
4648 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4657 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4665 yyextra->current->anchors.push_back(si);
4667 else if (si->
lineNr() != -1)
4669 warn(yyextra->fileName,yyextra->lineNr,
4670 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4675 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4682 yyextra->current->anchors.push_back(si);
4689 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4691 *yyextra->pOutputString+=s;
4697 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4699 *yyextra->pOutputString+=s;
4705 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4706 *yyextra->pOutputString+=c;
4712 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4719 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4725 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4726 std::string_view str = yyextra->current->brief.view();
4731 yyextra->briefEndsAtDot=
FALSE;
4733 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4735 yyextra->current->docLine = yyextra->lineNr;
4736 yyextra->current->doc =
"";
4740 addIline(yyscanner,yyextra->lineNr);
4746 int saveLineNr = yyextra->lineNr;
4748 yyextra->current->briefLine = yyextra->lineNr;
4749 yyextra->lineNr = saveLineNr;
4755 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4756 yyextra->prevPosition=yyextra->inputPosition;
4758 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4760 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4771 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4772 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4773 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4774 YY_START==ReadFormulaLong)
4776 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4790 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4798 commentscanYYlex_destroy(
p->yyscanner);
4811 bool &newEntryNeeded,
4812 bool markdownSupport,
4816 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4818 isAutoBriefOn,isInbody,prot,markdownSupport);
4820 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4823 yyextra->guards = guards;
4824 yyextra->langParser = parser;
4825 yyextra->current = curEntry;
4826 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4828 yyextra->inputString =
comment;
4829 yyextra->inputString.append(
" ");
4830 yyextra->inputPosition = position;
4831 yyextra->lineNr = lineNr;
4832 yyextra->fileName = fileName;
4833 yyextra->protection = prot;
4834 yyextra->needNewEntry =
FALSE;
4836 yyextra->xrefAppendFlag =
FALSE;
4837 yyextra->insidePre =
FALSE;
4838 yyextra->parseMore =
FALSE;
4839 yyextra->inBody = isInbody;
4840 yyextra->markdownSupport= markdownSupport;
4841 yyextra->outputXRef.clear();
4842 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4844 yyextra->current->doc +=
'\n';
4847 yyextra->briefEndsAtDot = isAutoBriefOn;
4848 yyextra->condCount = 0;
4849 yyextra->sectionLevel = 0;
4850 yyextra->spaceBeforeCmd.clear();
4851 yyextra->spaceBeforeIf.clear();
4852 yyextra->htmlContextStack.clear();
4855 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4858 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4859 yyextra->current->inbodyDocs+=cmd;
4863 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
4866 commentscanYYrestart(
nullptr, yyscanner );
4868 commentscanYYlex(yyscanner);
4871 if (YY_START==OverloadParam)
4876 if (yyextra->insideParBlock)
4878 warn(yyextra->fileName,yyextra->lineNr,
4879 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4885 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4888 yyextra->current->doc=
"\n\n";
4891 if (yyextra->current->section.isMemberGrp() &&
4892 yyextra->docGroup.isEmpty())
4894 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4898 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
4900 yyextra->current->briefLine,yyextra->current->brief,
4901 yyextra->current->docLine,yyextra->current->doc,
4902 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
4906 prot = yyextra->protection;
4908 yyextra->docGroup.addDocs(curEntry);
4910 newEntryNeeded = yyextra->needNewEntry;
4915 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4917 if (!yyextra->parseMore && !yyextra->guards->empty())
4919 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4922 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4924 lineNr = yyextra->lineNr;
4926 position,yyextra->parseMore,newEntryNeeded);
4928 return yyextra->parseMore;
4933 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4935 bool sectionEnabled =
false;
4940 bool parentEnabled = yyextra->guards->top().parentVisible();
4944 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4945 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4949 yyextra->guards->top().setEnabled(
true);
4950 yyextra->guards->top().setEnabledFound();
4951 BEGIN( GuardParamEnd );
4955 if (yyextra->guards->top().isEnabledFound())
4957 yyextra->guards->top().setEnabled(
false);
4958 BEGIN( SkipGuardedSection );
4960 else if (sectionEnabled)
4962 yyextra->guards->top().setEnabled(
true);
4963 yyextra->guards->top().setEnabledFound();
4964 BEGIN( GuardParamEnd );
4968 yyextra->guards->top().setEnabled(
false);
4969 BEGIN( SkipGuardedSection );
4974 BEGIN( SkipGuardedSection );
4979 BEGIN( SkipGuardedSection );
4985 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4986 yyextra->docGroup.initGroupInfo(entry);
4991 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4992 yyextra->docGroup.enterFile(fileName,lineNr);
4997 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4998 yyextra->docGroup.leaveFile(fileName,lineNr);
5003 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5004 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5009 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5010 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5015 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5016 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5021 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5022 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5025#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 Paragraph
static constexpr int Subsubparagraph
static constexpr int Subparagraph
Class representing a regular expression.
Object representing the matching results.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
#define AUTO_TRACE_EXIT(...)
Translator * theTranslator
QCString trunc(const QCString &s, size_t numChars=15)
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.