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;
1541<GroupDocArg2>{DOCNL}+ {
1542 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
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;
1576<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1580 int start = text.
find(
'{');
1581 int end = text.
find(
'}',start+1);
1582 yyextra->current->name = text.
mid(
end+2);
1583 int istart = yyextra->current->name.
find(
"\\ilinebr");
1586 QCString rest = yyextra->current->name.
mid(istart);
1588 yyextra->current->name = yyextra->current->name.mid(0,istart);
1590 yyextra->current->args = text.
mid(start+1,
end-start-1);
1592 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1594<PageDocArg1>{FILE} {
1596 yyextra->current->args =
"";
1597 BEGIN( PageDocArg2 );
1599<PageDocArg1>{LC} { yyextra->lineNr++;
1602<PageDocArg1>{DOCNL} {
1603 warn(yyextra->fileName,yyextra->lineNr,
1604 "missing argument after \\page."
1613<PageDocArg2>{DOCNL} {
1617 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1618 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1621<PageDocArg2>{CMD}[<>] {
1626 yyextra->current->args += tmp;
1629 yyextra->current->args += yytext;
1632<ParamArg1>{ID}/{B}*"," {
1639 if (*yytext==
'\n') yyextra->lineNr++;
1653<FileDocArg1>{DOCNL} {
1659<FileDocArg1>{FILE} {
1663<FileDocArg1>{LC} { yyextra->lineNr++;
1671<XRefItemParam1>{LABELID} {
1672 yyextra->newXRefItemKey=yytext;
1674 BEGIN(XRefItemParam2);
1676<XRefItemParam1>{LC} {
1680<XRefItemParam1>{DOCNL} {
1681 warn(yyextra->fileName,yyextra->lineNr,
1682 "Missing first argument of \\xrefitem"
1684 if (*yytext==
'\n') yyextra->lineNr++;
1692<XRefItemParam2>"\""[^\n\"]*"\"" {
1694 BEGIN(XRefItemParam3);
1696<XRefItemParam2>{LC} {
1700<XRefItemParam2>{DOCNL} {
1701 warn(yyextra->fileName,yyextra->lineNr,
1702 "Missing second argument of \\xrefitem"
1704 if (*yytext==
'\n') yyextra->lineNr++;
1712<XRefItemParam3>"\""[^\n\"]*"\"" {
1717<XRefItemParam2,XRefItemParam3>{LC} {
1721<XRefItemParam3>{DOCNL} {
1722 warn(yyextra->fileName,yyextra->lineNr,
1723 "Missing third argument of \\xrefitem"
1725 if (*yytext==
'\n') yyextra->lineNr++;
1736<RelatesParam1>({ID}("::"|"."))*{ID} {
1737 yyextra->current->relates = yytext;
1744<RelatesParam1>{LC} {
1748<RelatesParam1>{DOCNL} {
1749 warn(yyextra->fileName,yyextra->lineNr,
1750 "Missing argument of '\\{}' command",yyextra->currentCmd
1762<Qualifier>{LABELID} {
1763 yyextra->current->qualifiers.emplace_back(yytext);
1766<Qualifier>"\""[^\"]*"\"" {
1767 std::string inp(yytext);
1768 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1772 warn(yyextra->fileName,yyextra->lineNr,
1773 "Missing argument of '\\{}' command",yyextra->currentCmd
1779 warn(yyextra->fileName,yyextra->lineNr,
1780 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1786<ILine>{LINENR}/[\\@\n\.] |
1792 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1796 yyextra->lineNr = nr;
1799 if (YY_START == ILine)
1805 yyextra->sectionTitle+=yytext;
1806 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1809<ILine,ILineSection>. {
1811 if (YY_START == ILine)
1817 yyextra->sectionTitle+=yytext;
1818 BEGIN(SectionTitle);
1823<IRaise>{B}*[0-9]+/[\\@\n\.] |
1824<IRaise>{B}*[0-9]+{B} {
1829 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1833 yyextra->raiseLevel = nr;
1843<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1857<IFile,IFileSection>{FILE} {
1860 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1861 else yyextra->fileName = yytext;
1862 if (YY_START == IFile)
1868 yyextra->sectionTitle+=yytext;
1869 BEGIN(SectionTitle);
1873<LinkSection>[^\\@\n]* {
1874 yyextra->sectionTitle+=yytext;
1876<LinkSection>{CMD}{CMD} {
1877 yyextra->sectionTitle+=yytext;
1879<LinkSection>{DOCNL} {
1881 if (*yytext ==
'\n') yyextra->lineNr++;
1882 yyextra->sectionTitle+=yytext;
1884<LinkSection>{CMD}"endlink" {
1885 yyextra->sectionTitle+=yytext;
1886 BEGIN(SectionTitle);
1889 yyextra->sectionTitle+=yytext;
1891<LinkSection><<EOF>> {
1892 warn(yyextra->fileName,yyextra->lineNr,
1893 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1899<LineParam>{CMD}{CMD} {
1912<LineParam>({CMD}{CMD}){ID} {
1921<SectionLabel>{LABELID} {
1922 yyextra->sectionLabel=yyextra->raisePrefix+yytext;
1923 addOutput(yyscanner,yyextra->sectionLabel.data());
1924 yyextra->sectionTitle.clear();
1925 BEGIN(SectionTitle);
1927<SectionLabel>{DOCNL} {
1928 warn(yyextra->fileName,yyextra->lineNr,
1929 "\\section command has no label"
1931 if (*yytext==
'\n') yyextra->lineNr++;
1936 warn(yyextra->fileName,yyextra->lineNr,
1937 "Invalid or missing section label"
1941<SectionTitle>{STAopt}/"\n" {
1946<SectionTitle>{STopt}"\\\\ilinebr" {
1947 yyextra->sectionTitle+=yytext;
1949<SectionTitle>{STopt}/"\\ilinebr" {
1954<SectionTitle>{B}*{CMD}"f$" {
1955 yyextra->formulaText=
"";
1956 yyextra->formulaPreText=
"$";
1957 yyextra->formulaPostText=
"";
1958 yyextra->formulaNewLines=0;
1959 BEGIN(ReadFormulaShortSection);
1961<SectionTitle>{B}*{CMD}"f(" {
1962 yyextra->formulaText=
"";
1963 yyextra->formulaPreText=
"";
1964 yyextra->formulaPostText=
"";
1965 yyextra->formulaNewLines=0;
1966 BEGIN(ReadFormulaRoundSection);
1968<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
1969<SectionTitle>{B}*{CMD}"f"[\[{] {
1973 warn(yyextra->fileName,yyextra->lineNr,
1974 "'\\{}' command is not allowed in section title, ending section title.",
1984<SectionTitle>[^\n@\\]* {
1985 yyextra->sectionTitle+=yytext;
1988<SectionTitle>{B}*{CMD}{CMD} {
1989 yyextra->sectionTitle+=yytext;
1992<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
1993<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
1995 int idx = fullMatch.
find(
'{');
1997 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
1998 int idxEnd = fullMatch.
find(
"}",idx+1);
2014 switch (it->second.sectionHandling)
2019 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2020 yyextra->sectionTitle+=fullMatch.
left(i);
2021 yyextra->sectionTitle+=
'@';
2022 yyextra->sectionTitle+=fullMatch.
mid(i);
2026 warn(yyextra->fileName,yyextra->lineNr,
2027 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2035 warn(yyextra->fileName,yyextra->lineNr,
2036 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2044 if (cmdName ==
"fileinfo")
2047 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2048 yyextra->sectionTitle+=fullMatch.
left(i);
2053 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2058 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2062 else if (cmdName ==
"lineinfo")
2065 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2066 yyextra->sectionTitle+=fullMatch.
left(i);
2068 yyextra->sectionTitle+=
' ';
2069 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2075 else if (cmdName ==
"raisewarning")
2077 yyextra->raiseWarning =
"";
2078 BEGIN(RaiseWarningSection);
2080 else if (cmdName ==
"noop")
2085 else if (cmdName ==
"cite")
2087 yyextra->sectionTitle+=yytext;
2089 BEGIN(CiteLabelSection);
2091 else if (cmdName ==
"iline")
2093 yyextra->sectionTitle+=yytext;
2095 BEGIN(ILineSection);
2097 else if (cmdName ==
"ifile")
2099 yyextra->sectionTitle+=yytext;
2101 BEGIN(IFileSection);
2103 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2106 if (optList.empty())
2108 yyextra -> anchorTitle =
"";
2113 yyextra -> anchorTitle =
join(optList,
" ");
2116 BEGIN(AnchorLabelSection);
2118 else if (cmdName ==
"link")
2120 yyextra->sectionTitle+=yytext;
2125 yyextra->sectionTitle+=yytext;
2126 warn(yyextra->fileName,yyextra->lineNr,
2127 "internal error '\\{}' command is to be replaced in section title.",cmdName
2134 yyextra->sectionTitle+=yytext;
2142 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
2147 yyextra->sectionTitle+=yytext;
2153<SubpageLabel>{FILE} {
2157 yyextra->current->extends.emplace_back(
QCString(yytext),Protection::Public,Specifier::Normal);
2158 BEGIN(SubpageTitle);
2160<SubpageLabel>{DOCNL} {
2161 warn(yyextra->fileName,yyextra->lineNr,
2162 "\\subpage command has no label"
2164 if (*yytext==
'\n') yyextra->lineNr++;
2172<SubpageTitle>{DOCNL} {
2176<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2187<AnchorLabel,AnchorLabelSection>{LABELID} {
2188 QCString lbl = yyextra->raisePrefix+yytext;
2189 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2191 if (YY_START == AnchorLabel)
2197 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2200<AnchorLabel,AnchorLabelSection>{DOCNL} {
2201 warn(yyextra->fileName,yyextra->lineNr,
2202 "\\anchor command has no label"
2204 if (*yytext==
'\n') yyextra->lineNr++;
2206 if (YY_START == AnchorLabel)
2212 BEGIN(SectionTitle);
2215<AnchorLabel,AnchorLabelSection>. {
2216 warn(yyextra->fileName,yyextra->lineNr,
2217 "Invalid or missing anchor label"
2220 if (YY_START == AnchorLabel)
2226 BEGIN(SectionTitle);
2233<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2235 if (&yytext[4]==yyextra->blockName)
2240<FormatBlock>{CMD}"enduml" {
2242 if (yyextra->blockName==
"startuml")
2247<FormatBlock>[^ \@\*\/\\\n]* {
2250<FormatBlock>{DOCNL} {
2251 if (*yytext==
'\n') yyextra->lineNr++;
2255 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2256 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2257 yyextra->blockName==
"iliteral"
2259 ) yyextra->commentCount++;
2264 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2265 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2266 yyextra->blockName==
"iliteral"
2270 yyextra->commentCount--;
2271 if (yyextra->commentCount<0)
2273 QCString endTag =
"end"+yyextra->blockName;
2274 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2275 warn(yyextra->fileName,yyextra->lineNr,
2276 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2277 yyextra->blockName,endTag);
2284<FormatBlock><<EOF>> {
2285 QCString endTag =
"end"+yyextra->blockName;
2286 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2287 warn(yyextra->fileName,yyextra->lineNr,
2288 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2289 yyextra->blockName,endTag
2296<GuardParam>{B}*"(" {
2297 yyextra->guardExpr=yytext;
2298 yyextra->roundCount=1;
2302 yyextra->guardExpr+=yytext;
2306 yyextra->guardExpr+=yytext;
2307 yyextra->roundCount++;
2310 yyextra->guardExpr+=yytext;
2311 yyextra->roundCount--;
2312 if (yyextra->roundCount==0)
2318 warn(yyextra->fileName,yyextra->lineNr,
2319 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2323<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2326<GuardParam>{DOCNL} {
2341<GuardParamEnd>{B}*{DOCNL} {
2343 yyextra->spaceBeforeIf.clear();
2347<GuardParamEnd>{B}* {
2348 if (!yyextra->spaceBeforeIf.isEmpty())
2350 addOutput(yyscanner,yyextra->spaceBeforeIf);
2352 yyextra->spaceBeforeIf.clear();
2364<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2366 yyextra->guards->emplace(
false);
2367 BEGIN( GuardParam );
2369<SkipGuardedSection>{CMD}"if"/{NW} {
2371 yyextra->guards->emplace(
false);
2372 BEGIN( GuardParam );
2374<SkipGuardedSection>{CMD}"endif"/{NW} {
2375 if (yyextra->guards->empty())
2377 warn(yyextra->fileName,yyextra->lineNr,
2378 "found \\endif without matching start command");
2383 yyextra->guards->pop();
2384 if (yyextra->guards->empty())
2386 BEGIN( GuardParamEnd );
2390 if (yyextra->guards->top().isEnabled())
2392 BEGIN( GuardParamEnd );
2396 BEGIN( SkipGuardedSection );
2401<SkipGuardedSection>{CMD}"else"/{NW} {
2402 if (yyextra->guards->empty())
2404 warn(yyextra->fileName,yyextra->lineNr,
2405 "found \\else without matching start command");
2407 else if (yyextra->guards->top().hasElse())
2409 warn(yyextra->fileName,yyextra->lineNr,
2410 "found multiple \\else commands in same \\if construct");
2411 yyextra->guards->top().setEnabled(
false);
2412 BEGIN( SkipGuardedSection );
2414 else if (!yyextra->guards->top().parentVisible())
2416 yyextra->guards->top().setEnabled(
false);
2417 BEGIN( SkipGuardedSection );
2421 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2422 yyextra->guards->top().setElse();
2423 if (!yyextra->guards->top().parentVisible())
2425 yyextra->guards->top().setEnabled(
false);
2426 BEGIN( SkipGuardedSection );
2428 else if (yyextra->guards->top().isEnabledFound())
2430 yyextra->guards->top().setEnabled(
false);
2431 BEGIN( SkipGuardedSection );
2435 yyextra->guards->top().setEnabled(
true);
2436 BEGIN( GuardParamEnd );
2440<SkipGuardedSection>{CMD}"elseif"/{NW} {
2441 if (yyextra->guards->empty())
2443 warn(yyextra->fileName,yyextra->lineNr,
2444 "found \\elseif without matching start command");
2446 else if (yyextra->guards->top().hasElse())
2448 warn(yyextra->fileName,yyextra->lineNr,
2449 "found \\elseif command after \\else command was given in \\if construct");
2451 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2452 yyextra->guards->top().setEnabled(
false);
2453 BEGIN( GuardParam );
2458 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2459 yyextra->guards->top().setEnabled(
false);
2460 BEGIN( GuardParam );
2463<SkipGuardedSection>{DOCNL} {
2464 if (*yytext==
'\n') yyextra->lineNr++;
2467<SkipGuardedSection>[^ \\@\n]+ {
2469<SkipGuardedSection>{CMD}{CMD} |
2470<SkipGuardedSection>. {
2476<SkipInternal>{DOCNL} {
2477 if (*yytext==
'\n') yyextra->lineNr++;
2480<SkipInternal>{CMD}"if"/[ \t] {
2481 yyextra->condCount++;
2483<SkipInternal>{CMD}"ifnot"/[ \t] {
2484 yyextra->condCount++;
2486<SkipInternal>{CMD}/"endif" {
2487 yyextra->condCount--;
2488 if (yyextra->condCount<0)
2494<SkipInternal>{CMD}/"section"[ \t] {
2495 if (yyextra->sectionLevel>0)
2501<SkipInternal>{CMD}/"subsection"[ \t] {
2502 if (yyextra->sectionLevel>1)
2508<SkipInternal>{CMD}/"subsubsection"[ \t] {
2509 if (yyextra->sectionLevel>2)
2515<SkipInternal>{CMD}/"paragraph"[ \t] {
2516 if (yyextra->sectionLevel>3)
2522<SkipInternal>{CMD}/"subparagraph"[ \t] {
2523 if (yyextra->sectionLevel>4)
2529<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2530 if (yyextra->sectionLevel>5)
2536<SkipInternal>{CMD}"endinternal"[ \t]* {
2539<SkipInternal>[^ \\@\n]+ {
2556 yyextra->docGroup.appendHeader(
' ');
2559 yyextra->docGroup.appendHeader(*yytext);
2560 yyextra->current->name+=*yytext;
2575<RaiseWarning,RaiseWarningSection>{DOCNL} {
2577 "{}",yyextra->raiseWarning);
2578 yyextra->raiseWarning =
"";
2579 if (*yytext==
'\n') yyextra->lineNr++;
2581 if (YY_START == RaiseWarning)
2587 yyextra->sectionTitle+=yytext;
2588 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2591<RaiseWarning,RaiseWarningSection>. {
2592 yyextra->raiseWarning += yytext;
2596<InGroupParam>{LABELID} {
2597 yyextra->current->groups.emplace_back(
2600 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2602<InGroupParam>{DOCNL} {
2603 if (!yyextra->inGroupParamFound)
2605 warn(yyextra->fileName,yyextra->lineNr,
2606 "Missing group name for \\ingroup command"
2625 if (yyextra->braceCount==0)
2627 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2629 warn(yyextra->fileName,yyextra->lineNr,
2630 "missing argument after '\\{}'.",yyextra->currentCmd
2636 yyextra->langParser->parsePrototype(yyextra->functionProto);
2644 yyextra->functionProto+=
' ';
2646<FnParam>[^@\\\n()]+ {
2647 yyextra->functionProto+=yytext;
2650 yyextra->functionProto+=yytext;
2651 yyextra->braceCount++;
2654 yyextra->functionProto+=yytext;
2655 yyextra->braceCount--;
2658 yyextra->functionProto+=*yytext;
2665<OverloadParam>{DOCNL} {
2666 if (*yytext==
'\n') yyextra->lineNr++;
2667 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2675 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2679<OverloadParam>{LC} {
2681 yyextra->functionProto+=
' ';
2684 yyextra->functionProto+=*yytext;
2689<InheritParam>({ID}("::"|"."))*{ID} {
2690 yyextra->current->extends.emplace_back(
2695<InheritParam>{DOCNL} {
2696 warn(yyextra->fileName,yyextra->lineNr,
2697 "\\inherit command has no argument"
2699 if (*yytext==
'\n') yyextra->lineNr++;
2704 warn(yyextra->fileName,yyextra->lineNr,
2705 "Invalid or missing name for \\inherit command"
2712<ExtendsParam>({ID}("::"|"."))*{ID} {
2713 yyextra->current->extends.emplace_back(
2718<ExtendsParam>{DOCNL} {
2719 warn(yyextra->fileName,yyextra->lineNr,
2720 "'\\{}' command has no argument",yyextra->currentCmd
2732<SkipLang>{CMD}"~"[a-zA-Z-]* {
2736 warn(yyextra->fileName,yyextra->lineNr,
2745<SkipLang>[^*@\\\n]* {
2748 if (*yytext==
'\n') yyextra->lineNr++;
2755<CiteLabel,CiteLabelSection>{CITEID} {
2758 if (YY_START == CiteLabel)
2764 yyextra->sectionTitle+=yytext;
2765 BEGIN(SectionTitle);
2768<CiteLabel,CiteLabelSection>{DOCNL} {
2769 warn(yyextra->fileName,yyextra->lineNr,
2770 "\\cite command has no label"
2774 if (YY_START == CiteLabel)
2781 yyextra->sectionTitle+=yytext;
2783 BEGIN(SectionTitle);
2786<CiteLabel,CiteLabelSection>. {
2787 warn(yyextra->fileName,yyextra->lineNr,
2788 "Invalid or missing cite label"
2790 if (YY_START == CiteLabel)
2796 yyextra->sectionTitle+=yytext;
2797 BEGIN(SectionTitle);
2805 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2806 addOutput(yyscanner,yyextra->copyDocArg);
2811 if (*yytext==
'\n') yyextra->lineNr++;
2812 if (yyextra->braceCount==0)
2815 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2816 addOutput(yyscanner,yyextra->copyDocArg);
2824<CopyDoc>[^@\\\n()]+ {
2825 yyextra->copyDocArg+=yytext;
2829 yyextra->copyDocArg+=yytext;
2831 yyextra->braceCount++;
2834 yyextra->copyDocArg+=yytext;
2836 yyextra->braceCount--;
2839 yyextra->copyDocArg+=yytext;
2861 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2862 yyextra->braceCount=0;
2863 yyextra->functionProto.clear();
2864 yyextra->currentCmd = cmd;
2865 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2872 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2873 yyextra->functionProto.clear();
2874 yyextra->braceCount=0;
2875 yyextra->currentCmd = cmd;
2876 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2883 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2884 yyextra->functionProto.clear();
2885 BEGIN(OverloadParam);
2891 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2892 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2893 BEGIN( EnumDocArg1 );
2899 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2902 BEGIN( GroupDocArg1 );
2908 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2911 BEGIN( GroupDocArg1 );
2917 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2920 BEGIN( GroupDocArg1 );
2926 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2927 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
2928 BEGIN( NameSpaceDocArg1 );
2934 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2936 BEGIN( PackageDocArg1 );
2942 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2943 yyextra->currentCmd = cmd;
2944 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
2945 BEGIN( ClassDocArg1 );
2951 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2952 yyextra->currentCmd = cmd;
2953 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
2954 BEGIN( ConceptDocArg1 );
2960 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2961 yyextra->currentCmd = cmd;
2962 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
2963 BEGIN( ModuleDocArg1 );
2969 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2970 BEGIN( ClassDocArg2 );
2976 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2977 yyextra->currentCmd = cmd;
2978 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
2979 BEGIN( ClassDocArg1 );
2985 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2986 yyextra->currentCmd = cmd;
2987 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
2988 BEGIN( CategoryDocArg1 );
2994 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2995 yyextra->currentCmd = cmd;
2996 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
2997 BEGIN( ClassDocArg1 );
3003 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3004 yyextra->currentCmd = cmd;
3005 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3006 BEGIN( ClassDocArg1 );
3012 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3013 yyextra->currentCmd = cmd;
3014 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3015 BEGIN( ClassDocArg1 );
3021 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3022 yyextra->currentCmd = cmd;
3023 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3024 BEGIN( ClassDocArg1 );
3030 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3032 BEGIN( PageDocArg1 );
3038 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3042 yyextra->current->name =
"mainpage";
3045 BEGIN( PageDocArg2 );
3051 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3055 yyextra->current->name = yyextra->fileName;
3057 BEGIN( FileDocArg1 );
3063 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3081 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3083 if (!stop) yyextra->current->name = yyextra->fileName;
3084 BEGIN( FileDocArg1 );
3090 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3092 for (
const auto &opt : optList)
3096 sectionMaker=EntryType::makeExampleLineno;
3100 warn(yyextra->fileName,yyextra->lineNr,
3101 "unsupported option '{}' for command '\\{}'",opt,cmd);
3105 if (!stop) yyextra->current->name = yyextra->fileName;
3106 BEGIN( FileDocArg1 );
3112 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3115 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3124 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3125 yyextra->raiseWarning =
"";
3126 BEGIN( RaiseWarning );
3132 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3139 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3143 yyextra->docGroup.clearHeader();
3145 if (!yyextra->docGroup.isEmpty())
3147 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3155 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3164 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3173 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3182 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3191 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3193 BEGIN(XRefItemParam1);
3199 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3200 if (yyextra->insideParBlock)
3202 warn(yyextra->fileName,yyextra->lineNr,
3203 "found \\parblock command while already in a parblock!");
3205 if (!yyextra->spaceBeforeCmd.isEmpty())
3207 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3208 yyextra->spaceBeforeCmd.clear();
3211 yyextra->insideParBlock =
TRUE;
3217 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3218 if (!yyextra->insideParBlock)
3220 warn(yyextra->fileName,yyextra->lineNr,
3221 "found \\endparblock command without matching \\parblock!");
3225 yyextra->insideParBlock =
FALSE;
3231 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3232 if (!yyextra->current->relates.isEmpty())
3234 warn(yyextra->fileName,yyextra->lineNr,
3235 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3237 yyextra->current->relatesType = RelatesType::Simple;
3238 yyextra->currentCmd = cmd;
3239 BEGIN(RelatesParam1);
3245 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3246 if (!yyextra->current->relates.isEmpty())
3248 warn(yyextra->fileName,yyextra->lineNr,
3249 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3251 yyextra->current->relatesType = RelatesType::Duplicate;
3252 yyextra->currentCmd = cmd;
3253 BEGIN(RelatesParam1);
3259 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3260 if (!yyextra->current->relates.isEmpty())
3262 warn(yyextra->fileName,yyextra->lineNr,
3263 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3265 yyextra->current->relatesType = RelatesType::MemberOf;
3266 yyextra->currentCmd = cmd;
3267 BEGIN(RelatesParam1);
3273 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3281 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3284 BEGIN(SectionLabel);
3293 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3295 switch (yyextra->sectionLevel)
3303 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3310 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3311 if (!yyextra->current->section.isEmpty() &&
3312 !yyextra->current->section.isPageDoc() &&
3313 !yyextra->current->section.isMainpageDoc()
3316 warn(yyextra->fileName,yyextra->lineNr,
3317 "found \\subpage command in a comment block that is not marked as a page!");
3319 if (!yyextra->spaceBeforeCmd.isEmpty())
3321 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3322 yyextra->spaceBeforeCmd.clear();
3325 BEGIN(SubpageLabel);
3331 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3333 if (optList.empty())
3335 yyextra -> anchorTitle =
"";
3339 yyextra -> anchorTitle =
join(optList,
" ");
3347 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3348 for (
const auto &opt : optList)
3358 if (optList.empty())
3372 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3373 if (!yyextra->spaceBeforeCmd.isEmpty())
3375 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3376 yyextra->spaceBeforeCmd.clear();
3378 if (optList.empty())
3392 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3393 if (!yyextra->spaceBeforeCmd.isEmpty())
3395 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3396 yyextra->spaceBeforeCmd.clear();
3398 if (optList.empty())
3407 yyextra->blockName=s;
3408 yyextra->commentCount=0;
3415 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3432 static std::unordered_map<std::string,OutputWriter> options =
3437 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3438 yyextra->sectionTitle+=fi.baseName();
3444 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3445 yyextra->sectionTitle+=fi.extension(
true);
3451 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3452 yyextra->sectionTitle+=fi.fileName();
3458 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3459 yyextra->sectionTitle+=fi.dirPath();
3465 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3466 yyextra->sectionTitle+=fi.absFilePath();
3471 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3472 if (!yyextra->spaceBeforeCmd.isEmpty())
3474 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3475 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3476 yyextra->spaceBeforeCmd.clear();
3479 FileInfo fi(yyextra->fileName.str());
3480 for (
const auto &opt_ : optList)
3483 std::string opt = optStripped.
lower().
str();
3484 auto it = options.find(opt);
3485 if (it != options.end())
3489 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3493 it->second(yyscanner,fi,isSection);
3499 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3506 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3511 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3520 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3521 if (!yyextra->spaceBeforeCmd.isEmpty())
3523 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3524 yyextra->spaceBeforeCmd.clear();
3532 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3540 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3548 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3555 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3557 BEGIN(IRaisePrefix);
3563 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3565 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3566 if (yyextra->guards->empty())
3568 yyextra->guards->emplace(
true);
3572 bool enabled = yyextra->guards->top().isEnabled();
3573 yyextra->guards->emplace(enabled);
3581 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3583 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3584 if (yyextra->guards->empty())
3586 yyextra->guards->emplace(
true);
3590 bool enabled = yyextra->guards->top().isEnabled();
3591 yyextra->guards->emplace(enabled);
3599 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3600 if (yyextra->guards->empty())
3602 warn(yyextra->fileName,yyextra->lineNr,
3603 "found \\elseif without matching start command");
3605 else if (yyextra->guards->top().hasElse())
3607 warn(yyextra->fileName,yyextra->lineNr,
3608 "found \\elseif command after \\else command was given in \\if construct");
3610 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3611 yyextra->guards->top().setEnabled(
false);
3617 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3618 yyextra->guards->top().setEnabled(
false);
3626 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3627 if (yyextra->guards->empty())
3629 warn(yyextra->fileName,yyextra->lineNr,
3630 "found \\else without matching start command");
3632 else if (yyextra->guards->top().hasElse())
3634 warn(yyextra->fileName,yyextra->lineNr,
3635 "found multiple \\else commands in same \\if construct");
3636 yyextra->guards->top().setEnabled(
false);
3637 yyextra->guards->top().setElse();
3638 BEGIN( SkipGuardedSection );
3642 yyextra->guards->top().setElse();
3643 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3644 if (yyextra->guards->top().isEnabledFound())
3646 yyextra->guards->top().setEnabled(
false);
3647 BEGIN( SkipGuardedSection );
3651 yyextra->guards->top().setEnabled(
true);
3652 BEGIN( GuardParamEnd );
3660 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3661 if (yyextra->guards->empty())
3663 warn(yyextra->fileName,yyextra->lineNr,
3664 "found \\endif without matching start command");
3668 yyextra->guards->pop();
3670 if (!yyextra->spaceBeforeCmd.isEmpty())
3672 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3673 yyextra->spaceBeforeCmd.clear();
3675 if (yyextra->guards->empty())
3677 BEGIN( GuardParamEnd );
3681 if (yyextra->guards->top().isEnabled())
3683 BEGIN( GuardParamEnd );
3687 BEGIN( SkipGuardedSection );
3695 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3696 yyextra->inGroupParamFound=
FALSE;
3697 BEGIN( InGroupParam );
3703 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3704 yyextra->current->subGrouping =
FALSE;
3710 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3711 yyextra->current->initLines = 100000;
3717 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3718 yyextra->current->initLines = 0;
3724 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3725 yyextra->current->commandOverrides.override_callGraph(
true);
3731 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3732 yyextra->current->commandOverrides.override_callGraph(
false);
3738 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3739 yyextra->current->commandOverrides.override_callerGraph(
true);
3745 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3746 yyextra->current->commandOverrides.override_callerGraph(
false);
3752 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3753 yyextra->current->commandOverrides.override_enumValues(
true);
3759 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3760 yyextra->current->commandOverrides.override_enumValues(
false);
3766 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3767 yyextra->current->commandOverrides.override_inlineSource(
true);
3773 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3774 yyextra->current->commandOverrides.override_inlineSource(
false);
3780 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3781 yyextra->current->commandOverrides.override_includeGraph(
true);
3787 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3788 yyextra->current->commandOverrides.override_includedByGraph(
true);
3794 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3795 yyextra->current->commandOverrides.override_includeGraph(
false);
3801 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3802 yyextra->current->commandOverrides.override_includedByGraph(
false);
3808 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3809 yyextra->current->commandOverrides.override_directoryGraph(
true);
3815 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3816 yyextra->current->commandOverrides.override_directoryGraph(
false);
3822 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3823 yyextra->current->commandOverrides.override_collaborationGraph(
true);
3829 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3830 yyextra->current->commandOverrides.override_collaborationGraph(
false);
3836 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3837 yyextra->current->commandOverrides.override_groupGraph(
true);
3843 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3844 yyextra->current->commandOverrides.override_groupGraph(
false);
3850 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3851 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3852 for (
const auto &opt_ : optList)
3859 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3861 else if (opt ==
"graph")
3863 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3865 else if (opt ==
"builtin")
3867 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3869 else if (opt ==
"text")
3871 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3873 else if (opt ==
"no")
3875 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3879 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
3889 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3890 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3896 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3897 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3903 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3904 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3910 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3911 yyextra->current->commandOverrides.override_referencesRelation(
true);
3917 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3918 yyextra->current->commandOverrides.override_referencesRelation(
false);
3924 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3925 yyextra->currentCmd = cmd;
3932 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3937 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
3939 yyextra->current->doc.clear();
3941 yyextra->condCount=0;
3942 BEGIN( SkipInternal );
3948 yyextra->inInternalDocs =
TRUE;
3955 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3956 yyextra->current->isStatic =
TRUE;
3962 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3963 yyextra->current->virt = Specifier::Pure;
3969 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3970 yyextra->current->protection = Protection::Private;
3976 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3977 yyextra->current->protection = yyextra->protection = Protection::Private;
3983 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3984 yyextra->current->protection = Protection::Protected;
3990 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3991 yyextra->current->protection = yyextra->protection = Protection::Protected ;
3997 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3998 yyextra->current->protection = Protection::Public;
4004 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4005 yyextra->current->protection = yyextra->protection = Protection::Public;
4011 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4012 if (yyextra->current->section.isPageDoc() ||
4013 yyextra->current->section.isMainpageDoc())
4015 for (
const auto &opt_ : optList)
4019 int i = opt.
find(
':');
4023 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4025 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4039 yyextra->current->localToc.enableHtml(level);
4041 else if (opt ==
"latex")
4043 yyextra->current->localToc.enableLatex(level);
4045 else if (opt ==
"xml")
4047 yyextra->current->localToc.enableXml(level);
4049 else if (opt ==
"docbook")
4051 yyextra->current->localToc.enableDocbook(level);
4055 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4060 if (yyextra->current->localToc.nothingEnabled())
4072 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4073 BEGIN(InheritParam);
4079 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4080 yyextra->currentCmd = cmd;
4081 BEGIN(ExtendsParam);
4087 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4088 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4094 if (!yyextra->spaceBeforeCmd.isEmpty())
4096 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4097 yyextra->spaceBeforeCmd.clear();
4105 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4107 if (!yyextra->spaceBeforeCmd.isEmpty())
4109 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4110 yyextra->spaceBeforeCmd.clear();
4118 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4119 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4125 if (!yyextra->spaceBeforeCmd.isEmpty())
4127 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4128 yyextra->spaceBeforeCmd.clear();
4131 yyextra->copyDocArg.clear();
4132 yyextra->braceCount = 0;
4141 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4142 yyextra->sectionLabel.clear();
4143 yyextra->sectionTitle.clear();
4144 yyextra->docGroup.clearHeader();
4145 yyextra->insideParBlock =
FALSE;
4152 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4154 return yyextra->current->section.isDoc();
4159 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4160 assert(maker!=
nullptr);
4162 if (yyextra->current->section.isDoc())
4168 yyextra->needNewEntry =
true;
4169 yyextra->current->section = maker();
4170 yyextra->current->fileName = yyextra->fileName;
4171 yyextra->current->startLine = yyextra->lineNr;
4172 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4185 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4186 for(
const char* c = yytext ; *c ; ++c )
4187 yyextra->lineNr += (*c ==
'\n') ;
4195 if (s==
nullptr || *s==0)
return name;
4197 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4208 const QCString &listTitle,
bool append)
4210 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4211 if (listName.
isEmpty())
return;
4218 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4231 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4239 item = refList->
add();
4243 item->
setText(yyextra->outputXRef);
4245 yyextra->current->sli.push_back(item);
4248 if (yyextra->inBody)
4250 yyextra->current->inbodyDocs += cmdString;
4254 yyextra->current->doc += cmdString;
4264 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4266 yyextra->sectionLevel);
4267 yyextra->current->anchors.push_back(si);
4269 else if (si->
lineNr() != -1)
4271 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4276 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4282 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4284 yyextra->sectionLevel);
4285 yyextra->current->anchors.push_back(si);
4289 yyextra->outputXRef.clear();
4299 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4301 QCString formula = (yyextra->formulaPreText +
4302 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4310 formLabel.
sprintf(
"\\_form#%d",
id);
4311 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4328 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4336 if (addYYtext) yyextra->sectionTitle+=yytext;
4337 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4338 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4340 yyextra->sectionLevel);
4343 yyextra->current->anchors.push_back(si);
4345 else if (si->
lineNr() != -1)
4347 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4352 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4353 yyextra->sectionLabel,si->
fileName());
4359 if (addYYtext) yyextra->sectionTitle+=yytext;
4360 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4361 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4363 yyextra->sectionLevel);
4366 yyextra->current->anchors.push_back(si);
4375 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4377 if (yytext[0] ==
'"')
4380 name=name.
left((
int)yyleng-2);
4396 if (c==
' ' || c==
'\t' || c==
'\r')
4419 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4420 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4422 yyextra->xrefAppendFlag = !yyextra->inBody &&
4424 yyextra->newXRefKind==yyextra->xrefKind &&
4426 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4442 switch(yyextra->xrefKind)
4474 yyextra->xrefItemTitle,
4475 yyextra->xrefListTitle,
4484 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4486 int oldContext = yyextra->inContext;
4487 yyextra->inContext = ctx;
4489 switch(yyextra->inContext)
4492 if (oldContext!=yyextra->inContext)
4495 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4496 if (yyextra->current->docFile.isEmpty())
4498 yyextra->current->docFile = yyextra->fileName;
4499 yyextra->current->docLine = yyextra->lineNr;
4502 yyextra->pOutputString = &yyextra->current->doc;
4506 if (oldContext!=yyextra->inContext)
4508 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4509 if (yyextra->current->briefFile.isEmpty())
4511 yyextra->current->briefFile = yyextra->fileName;
4512 yyextra->current->briefLine = yyextra->lineNr;
4515 bool foundMatch =
false;
4516 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4524 std::string str = yyextra->current->brief.str();
4529 for (
size_t i = 0; i < match[2].str().size(); i++)
4531 if (match[2].str()[i] ==
'\n') cnt++;
4535 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4537 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4544 yyextra->pOutputString = &yyextra->current->brief;
4548 if (!yyextra->current->doc.isEmpty())
4550 yyextra->current->doc +=
"\n";
4552 yyextra->pOutputString = &yyextra->current->doc;
4558 yyextra->pOutputString = &yyextra->outputXRef;
4563 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4572 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4580 yyextra->current->anchors.push_back(si);
4582 else if (si->
lineNr() != -1)
4584 warn(yyextra->fileName,yyextra->lineNr,
4585 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4590 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4597 yyextra->current->anchors.push_back(si);
4604 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4606 *yyextra->pOutputString+=s;
4612 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4614 *yyextra->pOutputString+=s;
4620 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4621 *yyextra->pOutputString+=c;
4627 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4634 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4640 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4641 std::string_view str = yyextra->current->brief.view();
4646 yyextra->briefEndsAtDot=
FALSE;
4648 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4650 yyextra->current->docLine = yyextra->lineNr;
4651 yyextra->current->doc =
"";
4655 addIline(yyscanner,yyextra->lineNr);
4661 int saveLineNr = yyextra->lineNr;
4663 yyextra->current->briefLine = yyextra->lineNr;
4664 yyextra->lineNr = saveLineNr;
4670 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4671 yyextra->prevPosition=yyextra->inputPosition;
4673 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4675 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4686 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4687 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4688 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4689 YY_START==ReadFormulaLong)
4691 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4705 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4713 commentscanYYlex_destroy(
p->yyscanner);
4726 bool &newEntryNeeded,
4727 bool markdownSupport,
4731 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4733 isAutoBriefOn,isInbody,prot,markdownSupport);
4735 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4738 yyextra->guards = guards;
4739 yyextra->langParser = parser;
4740 yyextra->current = curEntry;
4741 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4743 yyextra->inputString =
comment;
4744 yyextra->inputString.append(
" ");
4745 yyextra->inputPosition = position;
4746 yyextra->lineNr = lineNr;
4747 yyextra->fileName = fileName;
4748 yyextra->protection = prot;
4749 yyextra->needNewEntry =
FALSE;
4751 yyextra->xrefAppendFlag =
FALSE;
4752 yyextra->insidePre =
FALSE;
4753 yyextra->parseMore =
FALSE;
4754 yyextra->inBody = isInbody;
4755 yyextra->markdownSupport= markdownSupport;
4756 yyextra->outputXRef.clear();
4757 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4759 yyextra->current->doc +=
'\n';
4762 yyextra->briefEndsAtDot = isAutoBriefOn;
4763 yyextra->condCount = 0;
4764 yyextra->sectionLevel = 0;
4765 yyextra->spaceBeforeCmd.clear();
4766 yyextra->spaceBeforeIf.clear();
4767 yyextra->htmlContextStack.clear();
4770 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4773 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4774 yyextra->current->inbodyDocs+=cmd;
4778 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
4781 commentscanYYrestart(
nullptr, yyscanner );
4783 commentscanYYlex(yyscanner);
4786 if (YY_START==OverloadParam)
4791 if (yyextra->insideParBlock)
4793 warn(yyextra->fileName,yyextra->lineNr,
4794 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4800 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4803 yyextra->current->doc=
"\n\n";
4806 if (yyextra->current->section.isMemberGrp() &&
4807 yyextra->docGroup.isEmpty())
4809 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4813 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
4815 yyextra->current->briefLine,yyextra->current->brief,
4816 yyextra->current->docLine,yyextra->current->doc,
4817 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
4821 prot = yyextra->protection;
4823 yyextra->docGroup.addDocs(curEntry);
4825 newEntryNeeded = yyextra->needNewEntry;
4830 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4832 if (!yyextra->parseMore && !yyextra->guards->empty())
4834 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4837 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4839 lineNr = yyextra->lineNr;
4841 position,yyextra->parseMore,newEntryNeeded);
4843 return yyextra->parseMore;
4848 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4850 bool sectionEnabled =
false;
4855 bool parentEnabled = yyextra->guards->top().parentVisible();
4859 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4860 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4864 yyextra->guards->top().setEnabled(
true);
4865 yyextra->guards->top().setEnabledFound();
4866 BEGIN( GuardParamEnd );
4870 if (yyextra->guards->top().isEnabledFound())
4872 yyextra->guards->top().setEnabled(
false);
4873 BEGIN( SkipGuardedSection );
4875 else if (sectionEnabled)
4877 yyextra->guards->top().setEnabled(
true);
4878 yyextra->guards->top().setEnabledFound();
4879 BEGIN( GuardParamEnd );
4883 yyextra->guards->top().setEnabled(
false);
4884 BEGIN( SkipGuardedSection );
4889 BEGIN( SkipGuardedSection );
4894 BEGIN( SkipGuardedSection );
4900 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4901 yyextra->docGroup.initGroupInfo(entry);
4906 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4907 yyextra->docGroup.enterFile(fileName,lineNr);
4912 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4913 yyextra->docGroup.leaveFile(fileName,lineNr);
4918 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4919 yyextra->docGroup.enterCompound(fileName,lineNr,name);
4924 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4925 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
4930 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4931 yyextra->docGroup.open(e,fileName,lineNr,implicit);
4936 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4937 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
4940#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.