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>
208static const std::map< std::string, DocCmdMap >
docCmdMap =
411#define YY_NO_UNISTD_H 1
412#define YY_NEVER_INTERACTIVE 1
542 const QCString &listTitle,
bool append);
558#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
563#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.
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.
574TABLE ("table"|"TABLE")
575TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
585CAPTION ("caption"|"CAPTION")
586CENTER ("center"|"CENTER")
588DETAILS ("details"|"DETAILS")
589BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
590DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
591DETAILEDHTMLOPT {CODE}
592DETAILEDHTMLOPTEND {ENDCODE}
593SUMMARY ("summary"|"SUMMARY")
594REMARKS ("remarks"|"REMARKS")
596ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
601DOCNL "\n"|"\\ilinebr"
604FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
605FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
606FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
607ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
608LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
609CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
610CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
611CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
612SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
613SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
614TMPLSPEC "<"{BN}*[^>]+{BN}*">"
615MAILADDR ("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\-]+
616RCSTAG "$"{ID}":"[^\n$]+"$"
617MODULE_ID ({ID}".")*{ID}
618LINENR {Bopt}[1-9][0-9]*
619IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
671%x ReadFormulaShortSection
673%x ReadFormulaRoundSection
687%x RaiseWarningSection
716<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
719<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
725<Comment>"\""[^"\n]*"\"" {
728<Comment>("\\"[a-z_A-Z]+)+"\\" {
731<Comment>"<"{DETAILEDHTML}{ATTR}">" {
733 int spacePos = htmlOpenTag.find(
' ');
734 if (spacePos==-1) spacePos=yyleng-1;
735 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
737 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
745<Comment>"</"{DETAILEDHTML}">" {
747 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
749 if (!yyextra->htmlContextStack.empty() &&
750 yyextra->htmlContextStack.back().tagName==htmlTagName)
757 yyextra->htmlContextStack.pop_back();
761<Comment>"<"{DETAILEDHTMLOPT}">" {
763 if (yyextra->current->lang==SrcLangExt::CSharp)
765 yyextra->CScode=
true;
775<Comment>"<"{DETAILEDHTMLOPTEND}">" {
779 yyextra->CScode=
false;
783 yyextra->CScode=
false;
788<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
790 if (yyextra->current->lang==SrcLangExt::CSharp)
797<Comment>"<"{DETAILS}{ATTR}">" {
798 yyextra->htmlDetailsStack.push_back(0);
799 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
806<Comment>"</"{DETAILS}">" {
807 if (!yyextra->htmlDetailsStack.empty())
809 yyextra->htmlDetailsStack.pop_back();
811 if (!yyextra->htmlContextStack.empty() &&
812 yyextra->htmlContextStack.back().tagName==
"details")
819 yyextra->htmlContextStack.pop_back();
824 yyextra->htmlAnchorStr = yytext;
825 yyextra->htmlAnchor =
false;
829 yyextra->htmlAnchorStr += yytext;
834 if (c==
'\'' || c==
'"')
836 int e=tag.find(c,s+2);
839 id=tag.mid(s+2,e-s-2);
848 if (!
id.isEmpty() && !yyextra->htmlAnchor)
854 yyextra->htmlAnchor =
true;
857<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
858 yyextra->htmlAnchorStr += yytext;
861 if (!yyextra->htmlAnchor)
863 addOutput(yyscanner,yyextra->htmlAnchorStr);
876 yyextra->htmlAnchorStr += yytext;
877 if (*yytext ==
'\n') yyextra->lineNr++;
880 yyextra->htmlAnchorStr += yytext;
882<Comment>"<"{SUMMARY}">" {
883 if (yyextra->htmlDetailsStack.empty())
892<Comment>"<"{REMARKS}">" {
896<Comment>"</"{SUMMARY}">" {
897 if (!yyextra->htmlDetailsStack.empty())
906<Comment>"</"{REMARKS}">" {
910<Comment>"<"{CAPTION}{ATTR}">" {
912 int s=tag.find(
"id=");
916 if (c==
'\'' || c==
'"')
918 int e=tag.find(c,s+4);
928<Comment>"<"{PRE}{ATTR}">" {
929 yyextra->insidePre=
TRUE;
932<Comment>"</"{PRE}">" {
933 yyextra->insidePre=
FALSE;
943<Comment>"<!\[CDATA\[" {
946<Comment>{B}*{CMD}"endinternal"{B}* {
948 if (!yyextra->inInternalDocs)
949 warn(yyextra->fileName,yyextra->lineNr,
950 "found \\endinternal without matching \\internal"
952 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
954<Comment>{B}*"\\ilinebr "{B}* {
957<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
967<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
968<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
971 int idx = fullMatch.
find(
'{');
973 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
974 int idxEnd = fullMatch.
find(
"}",idx+1);
992 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
996 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
998 yyextra->briefEndsAtDot=
FALSE;
1004 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1009 yyextra->parseMore=
TRUE;
1011 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1014 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.
1026<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1029<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1036 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...
1042<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1044 yyextra->formulaText=
"";
1045 yyextra->formulaPreText=
"\\begin";
1046 yyextra->formulaPostText=
"";
1048 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1051 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1053 yyextra->formulaPreText+=yyextra->formulaEnv;
1054 yyextra->formulaNewLines=0;
1055 BEGIN(ReadFormulaLong);
1057<Comment>{B}*{CMD}"f$" {
1058 yyextra->formulaText=
"";
1059 yyextra->formulaPreText=
"$";
1060 yyextra->formulaPostText=
"";
1061 yyextra->formulaNewLines=0;
1062 BEGIN(ReadFormulaShort);
1064<Comment>{B}*{CMD}"f(" {
1065 yyextra->formulaText=
"";
1066 yyextra->formulaPreText=
"";
1067 yyextra->formulaPostText=
"";
1068 yyextra->formulaNewLines=0;
1069 BEGIN(ReadFormulaRound);
1071<Comment>{B}*{CMD}"f[" {
1073 yyextra->formulaText=
"";
1074 yyextra->formulaPreText=
"\\[";
1075 yyextra->formulaPostText=
"";
1076 yyextra->formulaNewLines=0;
1077 BEGIN(ReadFormulaLong);
1079<Comment>{B}*{CMD}"{" {
1081 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1083<Comment>{B}*{CMD}"}" {
1085 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1086 yyextra->docGroup.clearHeader();
1087 yyextra->parseMore=
TRUE;
1088 yyextra->needNewEntry =
TRUE;
1089 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1092<Comment>{B}*{CMD}[$@\\&~<>#%] {
1095<Comment>[a-z_A-Z]+ {
1098<Comment>^{B}*"."{Bopt}/\n {
1101<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1102<Comment>^{B}*[*+]{B}+ {
1103 if (!yyextra->markdownSupport)
1111 yyextra->briefEndsAtDot=
FALSE;
1117<Comment>^{B}*"-"{B}+ {
1120 yyextra->briefEndsAtDot=
FALSE;
1125<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1128<Comment>{CMD}"---" {
1135 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1138 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1143 yyextra->briefEndsAtDot=
FALSE;
1148<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1149<Comment>("."+)[a-z_A-Z0-9\)] {
1153<Comment>{CMD}[\.?!] {
1157<Comment>".\\"[ \t] {
1164<Comment>"...\\"[ \t] {
1167<Comment>"..."/[^\.] {
1170<Comment>".."[\.]?/[^ \t\n] {
1173<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1179 for (i=0;i<(yy_size_t)yyleng;)
1181 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1182 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1189 for (i=0;i<(yy_size_t)yyleng;)
1191 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1192 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1207 if (yyextra->briefEndsAtDot)
1210 yyextra->briefEndsAtDot=
FALSE;
1215 if (*yytext ==
'\n') yyextra->lineNr++;
1217<Comment>"<"[/]?{TABLEDEL}">" {
1235<HtmlComment>"---"[!]?">"{B}* {
1236 warn(yyextra->fileName,yyextra->lineNr,
1237 "incorrect HTML end comment --->"
1240<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1241<HtmlComment>{DOCNL} {
1248<HtmlComment>[^\\\n\-]+ {
1253<CdataSection>"\]\]>" {
1256<CdataSection>{DOCNL} {
1258 if (*yytext==
'\n') yyextra->lineNr++;
1260<CdataSection>[<>&] {
1264<CdataSection>[^\\\n\]<>&]+ {
1273<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1274 yyextra->formulaPostText+=
"$";
1277 if (YY_START == ReadFormulaShort)
1283 yyextra->sectionTitle+=
" "+form;
1284 BEGIN(SectionTitle);
1287<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1290 if (YY_START == ReadFormulaRound)
1296 yyextra->sectionTitle+=
" "+form;
1297 BEGIN(SectionTitle);
1300<ReadFormulaLong>{CMD}"f]" {
1301 yyextra->formulaPostText+=
"\\]";
1305<ReadFormulaLong>{CMD}"f}" {
1306 yyextra->formulaPostText+=
"\\end";
1307 yyextra->formulaPostText+=yyextra->formulaEnv;
1311<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1312 yyextra->formulaText+=yytext;
1314<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1315 yyextra->formulaNewLines++;
1316 yyextra->formulaText+=*yytext;
1318 addIline(yyscanner,yyextra->lineNr);
1320<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1321 yyextra->formulaText+=*yytext;
1326<EnumDocArg1>{SCOPEID} {
1328 yyextra->current->name = yytext;
1335<EnumDocArg1>{DOCNL} {
1336 warn(yyextra->fileName,yyextra->lineNr,
1337 "missing argument after '\\enum'."
1347<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)
1353<NameSpaceDocArg1>{LC} {
1357<NameSpaceDocArg1>{DOCNL} {
1358 warn(yyextra->fileName,yyextra->lineNr,
1359 "missing argument after '\\namespace'."
1364<NameSpaceDocArg1>. {
1369<PackageDocArg1>{ID}("."{ID})* {
1370 yyextra->current->name = yytext;
1373<PackageDocArg1>{LC} {
1377<PackageDocArg1>{DOCNL} {
1378 warn(yyextra->fileName,yyextra->lineNr,
1379 "missing argument after \\package."
1391<ConceptDocArg1>{SCOPEID} {
1393 yyextra->current->name = yytext;
1396<ConceptDocArg1>{LC} {
1400<ConceptDocArg1>{DOCNL} {
1401 warn(yyextra->fileName,yyextra->lineNr,
1402 "missing argument after '\\concept'."
1411<ModuleDocArg1>{MODULE_ID} {
1413 yyextra->current->name = yytext;
1416<ModuleDocArg1>{LC} {
1420<ModuleDocArg1>{DOCNL} {
1421 warn(yyextra->fileName,yyextra->lineNr,
1422 "missing argument after '\\module'."
1432<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1436 BEGIN( ClassDocArg2 );
1438<ClassDocArg1>{SCOPENAME} {
1442 if (yyextra->current->section.isProtocolDoc())
1444 yyextra->current->name+=
"-p";
1447 BEGIN( ClassDocArg2 );
1449<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1453 BEGIN( ClassDocArg2 );
1455<ClassDocArg1,CategoryDocArg1>{LC} {
1459<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1460 warn(yyextra->fileName,yyextra->lineNr,
1461 "missing argument after '\\{}'.",yyextra->currentCmd
1466<ClassDocArg1,CategoryDocArg1>. {
1469<ClassDocArg2>{DOCNL} {
1473<ClassDocArg2>{FILE}|"<>" {
1474 yyextra->current->includeFile = yytext;
1475 BEGIN( ClassDocArg3 );
1484<ClassDocArg3>[<"]?{FILE}?[">]? {
1485 yyextra->current->includeName = yytext;
1492<ClassDocArg3>{DOCNL} {
1502<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1503 yyextra->current->name = yytext;
1507 if (yyextra->current->name.endsWith(
".html"))
1509 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1511 else if (yyextra->current->name.endsWith(
".xhtml"))
1513 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1515 yyextra->current->type.clear();
1516 BEGIN(GroupDocArg2);
1518<GroupDocArg1>"\\"{B}*"\n" {
1522<GroupDocArg1>{DOCNL} {
1523 warn(yyextra->fileName,yyextra->lineNr,
1524 "missing group name after {}",
1525 yyextra->current->groupDocCmd()
1534<GroupDocArg2>"\\"{B}*"\n" {
1538<GroupDocArg2>[^\n\\]+ {
1539 yyextra->current->type += yytext;
1540 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1542<GroupDocArg2>{DOCNL}+ {
1544 yyextra->current->type.isEmpty()
1547 warn(yyextra->fileName,yyextra->lineNr,
1548 "missing title after "
1549 "\\defgroup {}", yyextra->current->name
1553 int extraLineNr = 0;
1556 for (
int i = 0; i < yyleng; i++)
1558 if (yytext[i]==
'\n') extraLineNr++;
1565 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1566 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1571 yyextra->current->type += yytext;
1572 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1577<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1581 int start = text.
find(
'{');
1582 int end = text.
find(
'}',start+1);
1583 yyextra->current->name = text.
mid(
end+2);
1584 int istart = yyextra->current->name.
find(
"\\ilinebr");
1587 QCString rest = yyextra->current->name.
mid(istart);
1589 yyextra->current->name = yyextra->current->name.mid(0,istart);
1591 yyextra->current->args = text.
mid(start+1,
end-start-1);
1593 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1595<PageDocArg1>{FILE} {
1597 yyextra->current->args =
"";
1598 BEGIN( PageDocArg2 );
1600<PageDocArg1>{LC} { yyextra->lineNr++;
1603<PageDocArg1>{DOCNL} {
1604 warn(yyextra->fileName,yyextra->lineNr,
1605 "missing argument after \\page."
1614<PageDocArg2>{DOCNL} {
1618 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1619 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1622<PageDocArg2>{CMD}[<>] {
1627 yyextra->current->args += tmp;
1630 yyextra->current->args += yytext;
1633<ParamArg1>{ID}/{B}*"," {
1640 if (*yytext==
'\n') yyextra->lineNr++;
1654<FileDocArg1>{DOCNL} {
1660<FileDocArg1>{FILE} {
1664<FileDocArg1>{LC} { yyextra->lineNr++;
1672<XRefItemParam1>{LABELID} {
1673 yyextra->newXRefItemKey=yytext;
1675 BEGIN(XRefItemParam2);
1677<XRefItemParam1>{LC} {
1681<XRefItemParam1>{DOCNL} {
1682 warn(yyextra->fileName,yyextra->lineNr,
1683 "Missing first argument of \\xrefitem"
1685 if (*yytext==
'\n') yyextra->lineNr++;
1693<XRefItemParam2>"\""[^\n\"]*"\"" {
1695 BEGIN(XRefItemParam3);
1697<XRefItemParam2>{LC} {
1701<XRefItemParam2>{DOCNL} {
1702 warn(yyextra->fileName,yyextra->lineNr,
1703 "Missing second argument of \\xrefitem"
1705 if (*yytext==
'\n') yyextra->lineNr++;
1713<XRefItemParam3>"\""[^\n\"]*"\"" {
1718<XRefItemParam2,XRefItemParam3>{LC} {
1722<XRefItemParam3>{DOCNL} {
1723 warn(yyextra->fileName,yyextra->lineNr,
1724 "Missing third argument of \\xrefitem"
1726 if (*yytext==
'\n') yyextra->lineNr++;
1737<RelatesParam1>({ID}("::"|"."))*{ID} {
1738 yyextra->current->relates = yytext;
1745<RelatesParam1>{LC} {
1749<RelatesParam1>{DOCNL} {
1750 warn(yyextra->fileName,yyextra->lineNr,
1751 "Missing argument of '\\{}' command",yyextra->currentCmd
1763<Qualifier>{LABELID} {
1764 yyextra->current->qualifiers.emplace_back(yytext);
1767<Qualifier>"\""[^\"]*"\"" {
1768 std::string inp(yytext);
1769 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1773 warn(yyextra->fileName,yyextra->lineNr,
1774 "Missing argument of '\\{}' command",yyextra->currentCmd
1780 warn(yyextra->fileName,yyextra->lineNr,
1781 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1787<ILine>{LINENR}/[\\@\n\.] |
1793 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1797 yyextra->lineNr = nr;
1800 if (YY_START == ILine)
1806 yyextra->sectionTitle+=yytext;
1807 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1810<ILine,ILineSection>. {
1812 if (YY_START == ILine)
1818 yyextra->sectionTitle+=yytext;
1819 BEGIN(SectionTitle);
1824<IRaise>{B}*[0-9]+/[\\@\n\.] |
1825<IRaise>{B}*[0-9]+{B} {
1830 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1834 yyextra->raiseLevel = nr;
1844<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1858<IFile,IFileSection>{FILE} {
1861 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1862 else yyextra->fileName = yytext;
1863 if (YY_START == IFile)
1869 yyextra->sectionTitle+=yytext;
1870 BEGIN(SectionTitle);
1874<LinkSection>[^\\@\n]* {
1875 yyextra->sectionTitle+=yytext;
1877<LinkSection>{CMD}{CMD} {
1878 yyextra->sectionTitle+=yytext;
1880<LinkSection>{DOCNL} {
1882 if (*yytext ==
'\n') yyextra->lineNr++;
1883 yyextra->sectionTitle+=yytext;
1885<LinkSection>{CMD}"endlink" {
1886 yyextra->sectionTitle+=yytext;
1887 BEGIN(SectionTitle);
1890 yyextra->sectionTitle+=yytext;
1892<LinkSection><<EOF>> {
1893 warn(yyextra->fileName,yyextra->lineNr,
1894 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1900<LineParam>{CMD}{CMD} {
1913<LineParam>({CMD}{CMD}){ID} {
1922<SectionLabel>{LABELID} {
1923 yyextra->sectionLabel=yyextra->raisePrefix+yytext;
1924 addOutput(yyscanner,yyextra->sectionLabel.data());
1925 yyextra->sectionTitle.clear();
1926 BEGIN(SectionTitle);
1928<SectionLabel>{DOCNL} {
1929 warn(yyextra->fileName,yyextra->lineNr,
1930 "\\section command has no label"
1932 if (*yytext==
'\n') yyextra->lineNr++;
1937 warn(yyextra->fileName,yyextra->lineNr,
1938 "Invalid or missing section label"
1942<SectionTitle>{STAopt}/"\n" {
1947<SectionTitle>{STopt}"\\\\ilinebr" {
1948 yyextra->sectionTitle+=yytext;
1950<SectionTitle>{STopt}/"\\ilinebr" {
1955<SectionTitle>{B}*{CMD}"f$" {
1956 yyextra->formulaText=
"";
1957 yyextra->formulaPreText=
"$";
1958 yyextra->formulaPostText=
"";
1959 yyextra->formulaNewLines=0;
1960 BEGIN(ReadFormulaShortSection);
1962<SectionTitle>{B}*{CMD}"f(" {
1963 yyextra->formulaText=
"";
1964 yyextra->formulaPreText=
"";
1965 yyextra->formulaPostText=
"";
1966 yyextra->formulaNewLines=0;
1967 BEGIN(ReadFormulaRoundSection);
1969<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
1970<SectionTitle>{B}*{CMD}"f"[\[{] {
1974 warn(yyextra->fileName,yyextra->lineNr,
1975 "'\\{}' command is not allowed in section title, ending section title.",
1985<SectionTitle>[^\n@\\]* {
1986 yyextra->sectionTitle+=yytext;
1989<SectionTitle>{B}*{CMD}{CMD} {
1990 yyextra->sectionTitle+=yytext;
1993<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
1994<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
1996 int idx = fullMatch.
find(
'{');
1998 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
1999 int idxEnd = fullMatch.
find(
"}",idx+1);
2015 switch (it->second.sectionHandling)
2020 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2021 yyextra->sectionTitle+=fullMatch.
left(i);
2022 yyextra->sectionTitle+=
'@';
2023 yyextra->sectionTitle+=fullMatch.
mid(i);
2027 warn(yyextra->fileName,yyextra->lineNr,
2028 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2036 warn(yyextra->fileName,yyextra->lineNr,
2037 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2045 if (cmdName ==
"fileinfo")
2048 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2049 yyextra->sectionTitle+=fullMatch.
left(i);
2054 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2059 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2063 else if (cmdName ==
"lineinfo")
2066 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2067 yyextra->sectionTitle+=fullMatch.
left(i);
2069 yyextra->sectionTitle+=
' ';
2070 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2076 else if (cmdName ==
"raisewarning")
2078 yyextra->raiseWarning =
"";
2079 BEGIN(RaiseWarningSection);
2081 else if (cmdName ==
"noop")
2086 else if (cmdName ==
"cite")
2088 yyextra->sectionTitle+=yytext;
2090 BEGIN(CiteLabelSection);
2092 else if (cmdName ==
"iline")
2094 yyextra->sectionTitle+=yytext;
2096 BEGIN(ILineSection);
2098 else if (cmdName ==
"ifile")
2100 yyextra->sectionTitle+=yytext;
2102 BEGIN(IFileSection);
2104 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2107 if (optList.empty())
2109 yyextra -> anchorTitle =
"";
2114 yyextra -> anchorTitle =
join(optList,
" ");
2117 BEGIN(AnchorLabelSection);
2119 else if (cmdName ==
"link")
2121 yyextra->sectionTitle+=yytext;
2126 yyextra->sectionTitle+=yytext;
2127 warn(yyextra->fileName,yyextra->lineNr,
2128 "internal error '\\{}' command is to be replaced in section title.",cmdName
2135 yyextra->sectionTitle+=yytext;
2143 yyextra->sectionTitle+=yytext;
QCString & setNum(short n)
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
2148 yyextra->sectionTitle+=yytext;
2154<SubpageLabel>{FILE} {
2158 yyextra->current->extends.emplace_back(
QCString(yytext),Protection::Public,Specifier::Normal);
2159 BEGIN(SubpageTitle);
2161<SubpageLabel>{DOCNL} {
2162 warn(yyextra->fileName,yyextra->lineNr,
2163 "\\subpage command has no label"
2165 if (*yytext==
'\n') yyextra->lineNr++;
2173<SubpageTitle>{DOCNL} {
2177<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2188<AnchorLabel,AnchorLabelSection>{LABELID} {
2189 QCString lbl = yyextra->raisePrefix+yytext;
2190 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2192 if (YY_START == AnchorLabel)
2198 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2201<AnchorLabel,AnchorLabelSection>{DOCNL} {
2202 warn(yyextra->fileName,yyextra->lineNr,
2203 "\\anchor command has no label"
2205 if (*yytext==
'\n') yyextra->lineNr++;
2207 if (YY_START == AnchorLabel)
2213 BEGIN(SectionTitle);
2216<AnchorLabel,AnchorLabelSection>. {
2217 warn(yyextra->fileName,yyextra->lineNr,
2218 "Invalid or missing anchor label"
2221 if (YY_START == AnchorLabel)
2227 BEGIN(SectionTitle);
2234<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2236 if (&yytext[4]==yyextra->blockName)
2241<FormatBlock>{CMD}"enduml" {
2243 if (yyextra->blockName==
"startuml")
2248<FormatBlock>[^ \@\*\/\\\n]* {
2251<FormatBlock>{DOCNL} {
2252 if (*yytext==
'\n') yyextra->lineNr++;
2256 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2257 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2258 yyextra->blockName==
"iliteral"
2260 ) yyextra->commentCount++;
2265 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2266 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2267 yyextra->blockName==
"iliteral"
2271 yyextra->commentCount--;
2272 if (yyextra->commentCount<0)
2274 QCString endTag =
"end"+yyextra->blockName;
2275 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2276 warn(yyextra->fileName,yyextra->lineNr,
2277 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2278 yyextra->blockName,endTag);
2285<FormatBlock><<EOF>> {
2286 QCString endTag =
"end"+yyextra->blockName;
2287 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2288 warn(yyextra->fileName,yyextra->lineNr,
2289 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2290 yyextra->blockName,endTag
2297<GuardParam>{B}*"(" {
2298 yyextra->guardExpr=yytext;
2299 yyextra->roundCount=1;
2303 yyextra->guardExpr+=yytext;
2307 yyextra->guardExpr+=yytext;
2308 yyextra->roundCount++;
2311 yyextra->guardExpr+=yytext;
2312 yyextra->roundCount--;
2313 if (yyextra->roundCount==0)
2319 warn(yyextra->fileName,yyextra->lineNr,
2320 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2324<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2327<GuardParam>{DOCNL} {
2342<GuardParamEnd>{B}*{DOCNL} {
2344 yyextra->spaceBeforeIf.clear();
2348<GuardParamEnd>{B}* {
2349 if (!yyextra->spaceBeforeIf.isEmpty())
2351 addOutput(yyscanner,yyextra->spaceBeforeIf);
2353 yyextra->spaceBeforeIf.clear();
2365<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2367 yyextra->guards->emplace(
false);
2368 BEGIN( GuardParam );
2370<SkipGuardedSection>{CMD}"if"/{NW} {
2372 yyextra->guards->emplace(
false);
2373 BEGIN( GuardParam );
2375<SkipGuardedSection>{CMD}"endif"/{NW} {
2376 if (yyextra->guards->empty())
2378 warn(yyextra->fileName,yyextra->lineNr,
2379 "found \\endif without matching start command");
2384 yyextra->guards->pop();
2385 if (yyextra->guards->empty())
2387 BEGIN( GuardParamEnd );
2391 if (yyextra->guards->top().isEnabled())
2393 BEGIN( GuardParamEnd );
2397 BEGIN( SkipGuardedSection );
2402<SkipGuardedSection>{CMD}"else"/{NW} {
2403 if (yyextra->guards->empty())
2405 warn(yyextra->fileName,yyextra->lineNr,
2406 "found \\else without matching start command");
2408 else if (yyextra->guards->top().hasElse())
2410 warn(yyextra->fileName,yyextra->lineNr,
2411 "found multiple \\else commands in same \\if construct");
2412 yyextra->guards->top().setEnabled(
false);
2413 BEGIN( SkipGuardedSection );
2415 else if (!yyextra->guards->top().parentVisible())
2417 yyextra->guards->top().setEnabled(
false);
2418 BEGIN( SkipGuardedSection );
2422 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2423 yyextra->guards->top().setElse();
2424 if (!yyextra->guards->top().parentVisible())
2426 yyextra->guards->top().setEnabled(
false);
2427 BEGIN( SkipGuardedSection );
2429 else if (yyextra->guards->top().isEnabledFound())
2431 yyextra->guards->top().setEnabled(
false);
2432 BEGIN( SkipGuardedSection );
2436 yyextra->guards->top().setEnabled(
true);
2437 BEGIN( GuardParamEnd );
2441<SkipGuardedSection>{CMD}"elseif"/{NW} {
2442 if (yyextra->guards->empty())
2444 warn(yyextra->fileName,yyextra->lineNr,
2445 "found \\elseif without matching start command");
2447 else if (yyextra->guards->top().hasElse())
2449 warn(yyextra->fileName,yyextra->lineNr,
2450 "found \\elseif command after \\else command was given in \\if construct");
2452 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2453 yyextra->guards->top().setEnabled(
false);
2454 BEGIN( GuardParam );
2459 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2460 yyextra->guards->top().setEnabled(
false);
2461 BEGIN( GuardParam );
2464<SkipGuardedSection>{DOCNL} {
2465 if (*yytext==
'\n') yyextra->lineNr++;
2468<SkipGuardedSection>[^ \\@\n]+ {
2470<SkipGuardedSection>{CMD}{CMD} |
2471<SkipGuardedSection>. {
2477<SkipInternal>{DOCNL} {
2478 if (*yytext==
'\n') yyextra->lineNr++;
2481<SkipInternal>[@\\]"if"/[ \t] {
2482 yyextra->condCount++;
2484<SkipInternal>[@\\]"ifnot"/[ \t] {
2485 yyextra->condCount++;
2487<SkipInternal>[@\\]/"endif" {
2488 yyextra->condCount--;
2489 if (yyextra->condCount<0)
2495<SkipInternal>[@\\]/"section"[ \t] {
2496 if (yyextra->sectionLevel>0)
2502<SkipInternal>[@\\]/"subsection"[ \t] {
2503 if (yyextra->sectionLevel>1)
2509<SkipInternal>[@\\]/"subsubsection"[ \t] {
2510 if (yyextra->sectionLevel>2)
2516<SkipInternal>[@\\]/"paragraph"[ \t] {
2517 if (yyextra->sectionLevel>3)
2523<SkipInternal>[@\\]/"subparagraph"[ \t] {
2524 if (yyextra->sectionLevel>4)
2530<SkipInternal>[@\\]/"subsubparagraph"[ \t] {
2531 if (yyextra->sectionLevel>5)
2537<SkipInternal>[@\\]"endinternal"[ \t]* {
2540<SkipInternal>[^ \\@\n]+ {
2557 yyextra->docGroup.appendHeader(
' ');
2560 yyextra->docGroup.appendHeader(*yytext);
2561 yyextra->current->name+=*yytext;
2576<RaiseWarning,RaiseWarningSection>{DOCNL} {
2578 "{}",yyextra->raiseWarning);
2579 yyextra->raiseWarning =
"";
2580 if (*yytext==
'\n') yyextra->lineNr++;
2582 if (YY_START == RaiseWarning)
2588 yyextra->sectionTitle+=yytext;
2589 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2592<RaiseWarning,RaiseWarningSection>. {
2593 yyextra->raiseWarning += yytext;
2597<InGroupParam>{LABELID} {
2598 yyextra->current->groups.emplace_back(
2601 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2603<InGroupParam>{DOCNL} {
2604 if (!yyextra->inGroupParamFound)
2606 warn(yyextra->fileName,yyextra->lineNr,
2607 "Missing group name for \\ingroup command"
2626 if (yyextra->braceCount==0)
2628 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2630 warn(yyextra->fileName,yyextra->lineNr,
2631 "missing argument after '\\{}'.",yyextra->currentCmd
2637 yyextra->langParser->parsePrototype(yyextra->functionProto);
2645 yyextra->functionProto+=
' ';
2647<FnParam>[^@\\\n()]+ {
2648 yyextra->functionProto+=yytext;
2651 yyextra->functionProto+=yytext;
2652 yyextra->braceCount++;
2655 yyextra->functionProto+=yytext;
2656 yyextra->braceCount--;
2659 yyextra->functionProto+=*yytext;
2666<OverloadParam>{DOCNL} {
2667 if (*yytext==
'\n') yyextra->lineNr++;
2668 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2676 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2680<OverloadParam>{LC} {
2682 yyextra->functionProto+=
' ';
2685 yyextra->functionProto+=*yytext;
2690<InheritParam>({ID}("::"|"."))*{ID} {
2691 yyextra->current->extends.emplace_back(
2696<InheritParam>{DOCNL} {
2697 warn(yyextra->fileName,yyextra->lineNr,
2698 "\\inherit command has no argument"
2700 if (*yytext==
'\n') yyextra->lineNr++;
2705 warn(yyextra->fileName,yyextra->lineNr,
2706 "Invalid or missing name for \\inherit command"
2713<ExtendsParam>({ID}("::"|"."))*{ID} {
2714 yyextra->current->extends.emplace_back(
2719<ExtendsParam>{DOCNL} {
2720 warn(yyextra->fileName,yyextra->lineNr,
2721 "'\\{}' command has no argument",yyextra->currentCmd
2733<SkipLang>[\\@]"~"[a-zA-Z-]* {
2737 warn(yyextra->fileName,yyextra->lineNr,
2746<SkipLang>[^*@\\\n]* {
2749 if (*yytext==
'\n') yyextra->lineNr++;
2756<CiteLabel,CiteLabelSection>{CITEID} {
2759 if (YY_START == CiteLabel)
2765 yyextra->sectionTitle+=yytext;
2766 BEGIN(SectionTitle);
2769<CiteLabel,CiteLabelSection>{DOCNL} {
2770 warn(yyextra->fileName,yyextra->lineNr,
2771 "\\cite command has no label"
2775 if (YY_START == CiteLabel)
2782 yyextra->sectionTitle+=yytext;
2784 BEGIN(SectionTitle);
2787<CiteLabel,CiteLabelSection>. {
2788 warn(yyextra->fileName,yyextra->lineNr,
2789 "Invalid or missing cite label"
2791 if (YY_START == CiteLabel)
2797 yyextra->sectionTitle+=yytext;
2798 BEGIN(SectionTitle);
2806 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2807 addOutput(yyscanner,yyextra->copyDocArg);
2812 if (*yytext==
'\n') yyextra->lineNr++;
2813 if (yyextra->braceCount==0)
2816 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2817 addOutput(yyscanner,yyextra->copyDocArg);
2825<CopyDoc>[^@\\\n()]+ {
2826 yyextra->copyDocArg+=yytext;
2830 yyextra->copyDocArg+=yytext;
2832 yyextra->braceCount++;
2835 yyextra->copyDocArg+=yytext;
2837 yyextra->braceCount--;
2840 yyextra->copyDocArg+=yytext;
2862 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2863 yyextra->braceCount=0;
2864 yyextra->functionProto.clear();
2865 yyextra->currentCmd = cmd;
2866 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2873 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2874 yyextra->functionProto.clear();
2875 yyextra->braceCount=0;
2876 yyextra->currentCmd = cmd;
2877 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2884 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2885 yyextra->functionProto.clear();
2886 BEGIN(OverloadParam);
2892 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2893 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2894 BEGIN( EnumDocArg1 );
2900 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2903 BEGIN( GroupDocArg1 );
2909 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2912 BEGIN( GroupDocArg1 );
2918 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2921 BEGIN( GroupDocArg1 );
2927 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2928 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
2929 BEGIN( NameSpaceDocArg1 );
2935 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2937 BEGIN( PackageDocArg1 );
2943 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2944 yyextra->currentCmd = cmd;
2945 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
2946 BEGIN( ClassDocArg1 );
2952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2953 yyextra->currentCmd = cmd;
2954 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
2955 BEGIN( ConceptDocArg1 );
2961 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2962 yyextra->currentCmd = cmd;
2963 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
2964 BEGIN( ModuleDocArg1 );
2970 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2971 BEGIN( ClassDocArg2 );
2977 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2978 yyextra->currentCmd = cmd;
2979 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
2980 BEGIN( ClassDocArg1 );
2986 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2987 yyextra->currentCmd = cmd;
2988 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
2989 BEGIN( CategoryDocArg1 );
2995 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2996 yyextra->currentCmd = cmd;
2997 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
2998 BEGIN( ClassDocArg1 );
3004 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3005 yyextra->currentCmd = cmd;
3006 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3007 BEGIN( ClassDocArg1 );
3013 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3014 yyextra->currentCmd = cmd;
3015 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3016 BEGIN( ClassDocArg1 );
3022 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3023 yyextra->currentCmd = cmd;
3024 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3025 BEGIN( ClassDocArg1 );
3031 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3033 BEGIN( PageDocArg1 );
3039 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3043 yyextra->current->name =
"mainpage";
3046 BEGIN( PageDocArg2 );
3052 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3056 yyextra->current->name = yyextra->fileName;
3058 BEGIN( FileDocArg1 );
3064 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3074 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3082 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3084 if (!stop) yyextra->current->name = yyextra->fileName;
3085 BEGIN( FileDocArg1 );
3091 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3093 for (
const auto &opt : optList)
3097 sectionMaker=EntryType::makeExampleLineno;
3101 warn(yyextra->fileName,yyextra->lineNr,
3102 "unsupported option '{}' for command '\\{}'",opt,cmd);
3106 if (!stop) yyextra->current->name = yyextra->fileName;
3107 BEGIN( FileDocArg1 );
3113 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3116 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3125 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3126 yyextra->raiseWarning =
"";
3127 BEGIN( RaiseWarning );
3133 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3140 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3144 yyextra->docGroup.clearHeader();
3146 if (!yyextra->docGroup.isEmpty())
3148 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3156 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3165 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3174 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3183 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3192 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3194 BEGIN(XRefItemParam1);
3200 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3201 if (yyextra->insideParBlock)
3203 warn(yyextra->fileName,yyextra->lineNr,
3204 "found \\parblock command while already in a parblock!");
3206 if (!yyextra->spaceBeforeCmd.isEmpty())
3208 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3209 yyextra->spaceBeforeCmd.clear();
3212 yyextra->insideParBlock =
TRUE;
3218 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3219 if (!yyextra->insideParBlock)
3221 warn(yyextra->fileName,yyextra->lineNr,
3222 "found \\endparblock command without matching \\parblock!");
3226 yyextra->insideParBlock =
FALSE;
3232 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3233 if (!yyextra->current->relates.isEmpty())
3235 warn(yyextra->fileName,yyextra->lineNr,
3236 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3238 yyextra->current->relatesType = RelatesType::Simple;
3239 yyextra->currentCmd = cmd;
3240 BEGIN(RelatesParam1);
3246 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3247 if (!yyextra->current->relates.isEmpty())
3249 warn(yyextra->fileName,yyextra->lineNr,
3250 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3252 yyextra->current->relatesType = RelatesType::Duplicate;
3253 yyextra->currentCmd = cmd;
3254 BEGIN(RelatesParam1);
3260 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3261 if (!yyextra->current->relates.isEmpty())
3263 warn(yyextra->fileName,yyextra->lineNr,
3264 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3266 yyextra->current->relatesType = RelatesType::MemberOf;
3267 yyextra->currentCmd = cmd;
3268 BEGIN(RelatesParam1);
3274 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3282 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3285 BEGIN(SectionLabel);
3294 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3296 switch (yyextra->sectionLevel)
3304 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3311 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3312 if (!yyextra->current->section.isEmpty() &&
3313 !yyextra->current->section.isPageDoc() &&
3314 !yyextra->current->section.isMainpageDoc()
3317 warn(yyextra->fileName,yyextra->lineNr,
3318 "found \\subpage command in a comment block that is not marked as a page!");
3320 if (!yyextra->spaceBeforeCmd.isEmpty())
3322 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3323 yyextra->spaceBeforeCmd.clear();
3326 BEGIN(SubpageLabel);
3332 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3334 if (optList.empty())
3336 yyextra -> anchorTitle =
"";
3340 yyextra -> anchorTitle =
join(optList,
" ");
3348 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3349 for (
const auto &opt : optList)
3359 if (optList.empty())
3373 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3374 if (!yyextra->spaceBeforeCmd.isEmpty())
3376 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3377 yyextra->spaceBeforeCmd.clear();
3386 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3387 if (!yyextra->spaceBeforeCmd.isEmpty())
3389 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3390 yyextra->spaceBeforeCmd.clear();
3392 if (optList.empty())
3401 yyextra->blockName=s;
3402 yyextra->commentCount=0;
3409 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3426 static std::unordered_map<std::string,OutputWriter> options =
3431 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3432 yyextra->sectionTitle+=fi.baseName();
3438 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3439 yyextra->sectionTitle+=fi.extension(
true);
3445 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3446 yyextra->sectionTitle+=fi.fileName();
3452 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3453 yyextra->sectionTitle+=fi.dirPath();
3459 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3460 yyextra->sectionTitle+=fi.absFilePath();
3465 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3466 if (!yyextra->spaceBeforeCmd.isEmpty())
3468 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3469 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3470 yyextra->spaceBeforeCmd.clear();
3473 FileInfo fi(yyextra->fileName.str());
3474 for (
const auto &opt_ : optList)
3477 std::string opt = optStripped.
lower().
str();
3478 auto it = options.find(opt);
3479 if (it != options.end())
3483 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3487 it->second(yyscanner,fi,isSection);
3493 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3500 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3505 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3514 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3515 if (!yyextra->spaceBeforeCmd.isEmpty())
3517 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3518 yyextra->spaceBeforeCmd.clear();
3526 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3534 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3542 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3549 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3551 BEGIN(IRaisePrefix);
3557 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3559 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3560 if (yyextra->guards->empty())
3562 yyextra->guards->emplace(
true);
3566 bool enabled = yyextra->guards->top().isEnabled();
3567 yyextra->guards->emplace(enabled);
3575 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3577 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3578 if (yyextra->guards->empty())
3580 yyextra->guards->emplace(
true);
3584 bool enabled = yyextra->guards->top().isEnabled();
3585 yyextra->guards->emplace(enabled);
3593 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3594 if (yyextra->guards->empty())
3596 warn(yyextra->fileName,yyextra->lineNr,
3597 "found \\elseif without matching start command");
3599 else if (yyextra->guards->top().hasElse())
3601 warn(yyextra->fileName,yyextra->lineNr,
3602 "found \\elseif command after \\else command was given in \\if construct");
3604 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3605 yyextra->guards->top().setEnabled(
false);
3611 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3612 yyextra->guards->top().setEnabled(
false);
3620 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3621 if (yyextra->guards->empty())
3623 warn(yyextra->fileName,yyextra->lineNr,
3624 "found \\else without matching start command");
3626 else if (yyextra->guards->top().hasElse())
3628 warn(yyextra->fileName,yyextra->lineNr,
3629 "found multiple \\else commands in same \\if construct");
3630 yyextra->guards->top().setEnabled(
false);
3631 yyextra->guards->top().setElse();
3632 BEGIN( SkipGuardedSection );
3636 yyextra->guards->top().setElse();
3637 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3638 if (yyextra->guards->top().isEnabledFound())
3640 yyextra->guards->top().setEnabled(
false);
3641 BEGIN( SkipGuardedSection );
3645 yyextra->guards->top().setEnabled(
true);
3646 BEGIN( GuardParamEnd );
3654 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3655 if (yyextra->guards->empty())
3657 warn(yyextra->fileName,yyextra->lineNr,
3658 "found \\endif without matching start command");
3662 yyextra->guards->pop();
3664 if (!yyextra->spaceBeforeCmd.isEmpty())
3666 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3667 yyextra->spaceBeforeCmd.clear();
3669 if (yyextra->guards->empty())
3671 BEGIN( GuardParamEnd );
3675 if (yyextra->guards->top().isEnabled())
3677 BEGIN( GuardParamEnd );
3681 BEGIN( SkipGuardedSection );
3689 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3690 yyextra->inGroupParamFound=
FALSE;
3691 BEGIN( InGroupParam );
3697 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3698 yyextra->current->subGrouping =
FALSE;
3704 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3705 yyextra->current->initLines = 100000;
3711 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3712 yyextra->current->initLines = 0;
3718 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3719 yyextra->current->commandOverrides.override_callGraph(
true);
3725 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3726 yyextra->current->commandOverrides.override_callGraph(
false);
3732 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3733 yyextra->current->commandOverrides.override_callerGraph(
true);
3739 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3740 yyextra->current->commandOverrides.override_callerGraph(
false);
3746 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3747 yyextra->current->commandOverrides.override_enumValues(
true);
3753 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3754 yyextra->current->commandOverrides.override_enumValues(
false);
3760 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3761 yyextra->current->commandOverrides.override_inlineSource(
true);
3767 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3768 yyextra->current->commandOverrides.override_inlineSource(
false);
3774 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3775 yyextra->current->commandOverrides.override_includeGraph(
true);
3781 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3782 yyextra->current->commandOverrides.override_includedByGraph(
true);
3788 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3789 yyextra->current->commandOverrides.override_includeGraph(
false);
3795 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3796 yyextra->current->commandOverrides.override_includedByGraph(
false);
3802 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3803 yyextra->current->commandOverrides.override_directoryGraph(
true);
3809 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3810 yyextra->current->commandOverrides.override_directoryGraph(
false);
3816 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3817 yyextra->current->commandOverrides.override_collaborationGraph(
true);
3823 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3824 yyextra->current->commandOverrides.override_collaborationGraph(
false);
3830 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3831 yyextra->current->commandOverrides.override_groupGraph(
true);
3837 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3838 yyextra->current->commandOverrides.override_groupGraph(
false);
3844 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3845 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3846 for (
const auto &opt_ : optList)
3853 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3855 else if (opt ==
"graph")
3857 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3859 else if (opt ==
"builtin")
3861 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3863 else if (opt ==
"text")
3865 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3867 else if (opt ==
"no")
3869 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3873 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
3883 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3884 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3890 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3891 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3897 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3898 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3904 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3905 yyextra->current->commandOverrides.override_referencesRelation(
true);
3911 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3912 yyextra->current->commandOverrides.override_referencesRelation(
false);
3918 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3919 yyextra->currentCmd = cmd;
3926 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3931 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
3933 yyextra->current->doc.clear();
3935 yyextra->condCount=0;
3936 BEGIN( SkipInternal );
3942 yyextra->inInternalDocs =
TRUE;
3949 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3950 yyextra->current->isStatic =
TRUE;
3956 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3957 yyextra->current->virt = Specifier::Pure;
3963 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3964 yyextra->current->protection = Protection::Private;
3970 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3971 yyextra->current->protection = yyextra->protection = Protection::Private;
3977 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3978 yyextra->current->protection = Protection::Protected;
3984 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3985 yyextra->current->protection = yyextra->protection = Protection::Protected ;
3991 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3992 yyextra->current->protection = Protection::Public;
3998 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3999 yyextra->current->protection = yyextra->protection = Protection::Public;
4005 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4006 if (yyextra->current->section.isPageDoc() ||
4007 yyextra->current->section.isMainpageDoc())
4009 for (
const auto &opt_ : optList)
4013 int i = opt.
find(
':');
4017 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4019 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4033 yyextra->current->localToc.enableHtml(level);
4035 else if (opt ==
"latex")
4037 yyextra->current->localToc.enableLatex(level);
4039 else if (opt ==
"xml")
4041 yyextra->current->localToc.enableXml(level);
4043 else if (opt ==
"docbook")
4045 yyextra->current->localToc.enableDocbook(level);
4049 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4054 if (yyextra->current->localToc.nothingEnabled())
4066 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4067 BEGIN(InheritParam);
4073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4074 yyextra->currentCmd = cmd;
4075 BEGIN(ExtendsParam);
4081 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4082 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4088 if (!yyextra->spaceBeforeCmd.isEmpty())
4090 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4091 yyextra->spaceBeforeCmd.clear();
4099 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4101 if (!yyextra->spaceBeforeCmd.isEmpty())
4103 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4104 yyextra->spaceBeforeCmd.clear();
4112 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4113 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4119 if (!yyextra->spaceBeforeCmd.isEmpty())
4121 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4122 yyextra->spaceBeforeCmd.clear();
4125 yyextra->copyDocArg.clear();
4126 yyextra->braceCount = 0;
4135 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4136 yyextra->sectionLabel.clear();
4137 yyextra->sectionTitle.clear();
4138 yyextra->docGroup.clearHeader();
4139 yyextra->insideParBlock =
FALSE;
4146 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4148 return yyextra->current->section.isDoc();
4153 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4154 assert(maker!=
nullptr);
4156 if (yyextra->current->section.isDoc())
4162 yyextra->needNewEntry =
true;
4163 yyextra->current->section = maker();
4164 yyextra->current->fileName = yyextra->fileName;
4165 yyextra->current->startLine = yyextra->lineNr;
4166 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4180 for(
const char* c = yytext ; *c ; ++c )
4181 yyextra->lineNr += (*c ==
'\n') ;
4189 if (s==
nullptr || *s==0)
return name;
4191 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4202 const QCString &listTitle,
bool append)
4204 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4205 if (listName.
isEmpty())
return;
4212 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4225 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4233 item = refList->
add();
4237 item->
setText(yyextra->outputXRef);
4239 yyextra->current->sli.push_back(item);
4242 if (yyextra->inBody)
4244 yyextra->current->inbodyDocs += cmdString;
4248 yyextra->current->doc += cmdString;
4258 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4260 yyextra->sectionLevel);
4261 yyextra->current->anchors.push_back(si);
4263 else if (si->
lineNr() != -1)
4265 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4270 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4276 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4278 yyextra->sectionLevel);
4279 yyextra->current->anchors.push_back(si);
4283 yyextra->outputXRef.clear();
4293 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4295 QCString formula = (yyextra->formulaPreText +
4296 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4304 formLabel.
sprintf(
"\\_form#%d",
id);
4305 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4322 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4330 if (addYYtext) yyextra->sectionTitle+=yytext;
4331 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4332 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4334 yyextra->sectionLevel);
4337 yyextra->current->anchors.push_back(si);
4339 else if (si->
lineNr() != -1)
4341 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4346 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4347 yyextra->sectionLabel,si->
fileName());
4353 if (addYYtext) yyextra->sectionTitle+=yytext;
4354 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4355 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4357 yyextra->sectionLevel);
4360 yyextra->current->anchors.push_back(si);
4369 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4371 if (yytext[0] ==
'"')
4374 name=name.
left((
int)yyleng-2);
4390 if (c==
' ' || c==
'\t' || c==
'\r')
4413 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4414 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4416 yyextra->xrefAppendFlag = !yyextra->inBody &&
4418 yyextra->newXRefKind==yyextra->xrefKind &&
4420 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4436 switch(yyextra->xrefKind)
4468 yyextra->xrefItemTitle,
4469 yyextra->xrefListTitle,
4478 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4480 int oldContext = yyextra->inContext;
4481 yyextra->inContext = ctx;
4483 switch(yyextra->inContext)
4486 if (oldContext!=yyextra->inContext)
4489 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4490 if (yyextra->current->docFile.isEmpty())
4492 yyextra->current->docFile = yyextra->fileName;
4493 yyextra->current->docLine = yyextra->lineNr;
4496 yyextra->pOutputString = &yyextra->current->doc;
4500 if (oldContext!=yyextra->inContext)
4502 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4503 if (yyextra->current->briefFile.isEmpty())
4505 yyextra->current->briefFile = yyextra->fileName;
4506 yyextra->current->briefLine = yyextra->lineNr;
4509 bool foundMatch =
false;
4510 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4518 std::string str = yyextra->current->brief.str();
4523 for (
size_t i = 0; i < match[2].str().size(); i++)
4525 if (match[2].str()[i] ==
'\n') cnt++;
4529 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4531 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4538 yyextra->pOutputString = &yyextra->current->brief;
4542 if (!yyextra->current->doc.isEmpty())
4544 yyextra->current->doc +=
"\n";
4546 yyextra->pOutputString = &yyextra->current->doc;
4552 yyextra->pOutputString = &yyextra->outputXRef;
4557 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4566 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4574 yyextra->current->anchors.push_back(si);
4576 else if (si->
lineNr() != -1)
4578 warn(yyextra->fileName,yyextra->lineNr,
4579 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4584 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4591 yyextra->current->anchors.push_back(si);
4598 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4600 *yyextra->pOutputString+=s;
4606 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4608 *yyextra->pOutputString+=s;
4614 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4615 *yyextra->pOutputString+=c;
4621 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4628 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4634 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4635 std::string_view str = yyextra->current->brief.view();
4640 yyextra->briefEndsAtDot=
FALSE;
4642 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4644 yyextra->current->docLine = yyextra->lineNr;
4645 yyextra->current->doc =
"";
4649 addIline(yyscanner,yyextra->lineNr);
4655 int saveLineNr = yyextra->lineNr;
4657 yyextra->current->briefLine = yyextra->lineNr;
4658 yyextra->lineNr = saveLineNr;
4664 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4665 yyextra->prevPosition=yyextra->inputPosition;
4667 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4669 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4680 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4681 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4682 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4683 YY_START==ReadFormulaLong)
4685 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4699 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4707 commentscanYYlex_destroy(
p->yyscanner);
4720 bool &newEntryNeeded,
4721 bool markdownSupport,
4725 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4727 isAutoBriefOn,isInbody,prot,markdownSupport);
4729 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4732 yyextra->guards = guards;
4733 yyextra->langParser = parser;
4734 yyextra->current = curEntry;
4735 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4737 yyextra->inputString =
comment;
4738 yyextra->inputString.append(
" ");
4739 yyextra->inputPosition = position;
4740 yyextra->lineNr = lineNr;
4741 yyextra->fileName = fileName;
4742 yyextra->protection = prot;
4743 yyextra->needNewEntry =
FALSE;
4745 yyextra->xrefAppendFlag =
FALSE;
4746 yyextra->insidePre =
FALSE;
4747 yyextra->parseMore =
FALSE;
4748 yyextra->inBody = isInbody;
4749 yyextra->markdownSupport= markdownSupport;
4750 yyextra->outputXRef.clear();
4751 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4753 yyextra->current->doc +=
'\n';
4756 yyextra->briefEndsAtDot = isAutoBriefOn;
4757 yyextra->condCount = 0;
4758 yyextra->sectionLevel = 0;
4759 yyextra->spaceBeforeCmd.clear();
4760 yyextra->spaceBeforeIf.clear();
4761 yyextra->htmlContextStack.clear();
4764 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4767 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4768 yyextra->current->inbodyDocs+=cmd;
4772 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
4775 commentscanYYrestart(
nullptr, yyscanner );
4777 commentscanYYlex(yyscanner);
4780 if (YY_START==OverloadParam)
4785 if (yyextra->insideParBlock)
4787 warn(yyextra->fileName,yyextra->lineNr,
4788 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4794 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4797 yyextra->current->doc=
"\n\n";
4800 if (yyextra->current->section.isMemberGrp() &&
4801 yyextra->docGroup.isEmpty())
4803 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4807 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
4809 yyextra->current->briefLine,yyextra->current->brief,
4810 yyextra->current->docLine,yyextra->current->doc,
4811 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
4815 prot = yyextra->protection;
4817 yyextra->docGroup.addDocs(curEntry);
4819 newEntryNeeded = yyextra->needNewEntry;
4824 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4826 if (!yyextra->parseMore && !yyextra->guards->empty())
4828 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4831 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4833 lineNr = yyextra->lineNr;
4835 position,yyextra->parseMore,newEntryNeeded);
4837 return yyextra->parseMore;
4842 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4844 bool sectionEnabled =
false;
4849 bool parentEnabled = yyextra->guards->top().parentVisible();
4853 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4854 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4858 yyextra->guards->top().setEnabled(
true);
4859 yyextra->guards->top().setEnabledFound();
4860 BEGIN( GuardParamEnd );
4864 if (yyextra->guards->top().isEnabledFound())
4866 yyextra->guards->top().setEnabled(
false);
4867 BEGIN( SkipGuardedSection );
4869 else if (sectionEnabled)
4871 yyextra->guards->top().setEnabled(
true);
4872 yyextra->guards->top().setEnabledFound();
4873 BEGIN( GuardParamEnd );
4877 yyextra->guards->top().setEnabled(
false);
4878 BEGIN( SkipGuardedSection );
4883 BEGIN( SkipGuardedSection );
4888 BEGIN( SkipGuardedSection );
4894 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4895 yyextra->docGroup.initGroupInfo(entry);
4900 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4901 yyextra->docGroup.enterFile(fileName,lineNr);
4906 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4907 yyextra->docGroup.leaveFile(fileName,lineNr);
4912 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4913 yyextra->docGroup.enterCompound(fileName,lineNr,name);
4918 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4919 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
4924 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4925 yyextra->docGroup.open(e,fileName,lineNr,implicit);
4930 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4931 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
4934#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
Minimal replacement for QFileInfo.
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
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 Config_getBool(name)
#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
static QCString stripFromPath(const QCString &p, const StringVector &l)
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.