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++;
993 yyextra->spaceBeforeCmd = fullMatch.
left(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} {
1441 yyextra->current->name =
substitute(yytext,
".",
"::");
1442 if (yyextra->current->section.isProtocolDoc())
1444 yyextra->current->name+=
"-p";
1447 BEGIN( ClassDocArg2 );
1449<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1452 yyextra->current->name =
substitute(yytext,
".",
"::");
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(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);
2810<CopyDoc>"<"[/]?{TABLEDEL}">" {
2811 if (yyextra->braceCount==0)
2814 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2815 addOutput(yyscanner,yyextra->copyDocArg);
2821 if (*yytext==
'\n') yyextra->lineNr++;
2822 if (yyextra->braceCount==0)
2825 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2826 addOutput(yyscanner,yyextra->copyDocArg);
2834<CopyDoc>[^@\\\n()<]+ {
2835 yyextra->copyDocArg+=yytext;
2839 yyextra->copyDocArg+=yytext;
2841 yyextra->braceCount++;
2844 yyextra->copyDocArg+=yytext;
2846 yyextra->braceCount--;
2849 yyextra->copyDocArg+=yytext;
2871 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2872 yyextra->braceCount=0;
2873 yyextra->functionProto.clear();
2874 yyextra->currentCmd = cmd;
2875 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2882 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2883 yyextra->functionProto.clear();
2884 yyextra->braceCount=0;
2885 yyextra->currentCmd = cmd;
2886 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2893 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2894 yyextra->functionProto.clear();
2895 BEGIN(OverloadParam);
2901 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2902 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2903 BEGIN( EnumDocArg1 );
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;
2930 BEGIN( GroupDocArg1 );
2936 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2937 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
2938 BEGIN( NameSpaceDocArg1 );
2944 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2946 BEGIN( PackageDocArg1 );
2952 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2953 yyextra->currentCmd = cmd;
2954 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
2955 BEGIN( ClassDocArg1 );
2961 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2962 yyextra->currentCmd = cmd;
2963 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
2964 BEGIN( ConceptDocArg1 );
2970 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2971 yyextra->currentCmd = cmd;
2972 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
2973 BEGIN( ModuleDocArg1 );
2979 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2980 BEGIN( ClassDocArg2 );
2986 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2987 yyextra->currentCmd = cmd;
2988 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
2989 BEGIN( ClassDocArg1 );
2995 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2996 yyextra->currentCmd = cmd;
2997 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
2998 BEGIN( CategoryDocArg1 );
3004 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3005 yyextra->currentCmd = cmd;
3006 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3007 BEGIN( ClassDocArg1 );
3013 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3014 yyextra->currentCmd = cmd;
3015 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3016 BEGIN( ClassDocArg1 );
3022 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3023 yyextra->currentCmd = cmd;
3024 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3025 BEGIN( ClassDocArg1 );
3031 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3032 yyextra->currentCmd = cmd;
3033 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3034 BEGIN( ClassDocArg1 );
3040 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3042 BEGIN( PageDocArg1 );
3048 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3052 yyextra->current->name =
"mainpage";
3055 BEGIN( PageDocArg2 );
3061 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3065 yyextra->current->name = yyextra->fileName;
3067 BEGIN( FileDocArg1 );
3073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3083 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3091 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3093 if (!stop) yyextra->current->name = yyextra->fileName;
3094 BEGIN( FileDocArg1 );
3100 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3102 for (
const auto &opt : optList)
3106 sectionMaker=EntryType::makeExampleLineno;
3110 warn(yyextra->fileName,yyextra->lineNr,
3111 "unsupported option '{}' for command '\\{}'",opt,cmd);
3115 if (!stop) yyextra->current->name = yyextra->fileName;
3116 BEGIN( FileDocArg1 );
3122 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3125 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3135 yyextra->raiseWarning =
"";
3136 BEGIN( RaiseWarning );
3142 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3149 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3153 yyextra->docGroup.clearHeader();
3155 if (!yyextra->docGroup.isEmpty())
3157 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
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;
3201 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3203 BEGIN(XRefItemParam1);
3209 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3210 if (yyextra->insideParBlock)
3212 warn(yyextra->fileName,yyextra->lineNr,
3213 "found \\parblock command while already in a parblock!");
3215 if (!yyextra->spaceBeforeCmd.isEmpty())
3217 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3218 yyextra->spaceBeforeCmd.clear();
3221 yyextra->insideParBlock =
TRUE;
3227 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3228 if (!yyextra->insideParBlock)
3230 warn(yyextra->fileName,yyextra->lineNr,
3231 "found \\endparblock command without matching \\parblock!");
3235 yyextra->insideParBlock =
FALSE;
3241 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3242 if (!yyextra->current->relates.isEmpty())
3244 warn(yyextra->fileName,yyextra->lineNr,
3245 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3247 yyextra->current->relatesType = RelatesType::Simple;
3248 yyextra->currentCmd = cmd;
3249 BEGIN(RelatesParam1);
3255 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3256 if (!yyextra->current->relates.isEmpty())
3258 warn(yyextra->fileName,yyextra->lineNr,
3259 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3261 yyextra->current->relatesType = RelatesType::Duplicate;
3262 yyextra->currentCmd = cmd;
3263 BEGIN(RelatesParam1);
3269 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3270 if (!yyextra->current->relates.isEmpty())
3272 warn(yyextra->fileName,yyextra->lineNr,
3273 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3275 yyextra->current->relatesType = RelatesType::MemberOf;
3276 yyextra->currentCmd = cmd;
3277 BEGIN(RelatesParam1);
3283 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3291 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3294 BEGIN(SectionLabel);
3303 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3305 switch (yyextra->sectionLevel)
3313 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3320 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3321 if (!yyextra->current->section.isEmpty() &&
3322 !yyextra->current->section.isPageDoc() &&
3323 !yyextra->current->section.isMainpageDoc()
3326 warn(yyextra->fileName,yyextra->lineNr,
3327 "found \\subpage command in a comment block that is not marked as a page!");
3329 if (!yyextra->spaceBeforeCmd.isEmpty())
3331 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3332 yyextra->spaceBeforeCmd.clear();
3335 BEGIN(SubpageLabel);
3341 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3343 if (optList.empty())
3345 yyextra -> anchorTitle =
"";
3349 yyextra -> anchorTitle =
join(optList,
" ");
3357 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3358 for (
const auto &opt : optList)
3368 if (optList.empty())
3382 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3383 if (!yyextra->spaceBeforeCmd.isEmpty())
3385 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3386 yyextra->spaceBeforeCmd.clear();
3388 if (optList.empty())
3402 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3403 if (!yyextra->spaceBeforeCmd.isEmpty())
3405 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3406 yyextra->spaceBeforeCmd.clear();
3408 if (optList.empty())
3417 yyextra->blockName=s;
3418 yyextra->commentCount=0;
3425 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3442 static std::unordered_map<std::string,OutputWriter> options =
3447 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3448 yyextra->sectionTitle+=fi.baseName();
3454 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3455 yyextra->sectionTitle+=fi.extension(
true);
3461 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3462 yyextra->sectionTitle+=fi.fileName();
3468 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3469 yyextra->sectionTitle+=fi.dirPath();
3475 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3476 yyextra->sectionTitle+=fi.absFilePath();
3481 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3482 if (!yyextra->spaceBeforeCmd.isEmpty())
3484 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3485 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3486 yyextra->spaceBeforeCmd.clear();
3489 FileInfo fi(yyextra->fileName.str());
3490 for (
const auto &opt_ : optList)
3493 std::string opt = optStripped.
lower().
str();
3494 auto it = options.find(opt);
3495 if (it != options.end())
3499 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3503 it->second(yyscanner,fi,isSection);
3509 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3516 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3521 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3530 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3531 if (!yyextra->spaceBeforeCmd.isEmpty())
3533 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3534 yyextra->spaceBeforeCmd.clear();
3542 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3550 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3558 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3565 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3567 BEGIN(IRaisePrefix);
3573 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3575 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3576 if (yyextra->guards->empty())
3578 yyextra->guards->emplace(
true);
3582 bool enabled = yyextra->guards->top().isEnabled();
3583 yyextra->guards->emplace(enabled);
3591 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3593 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3594 if (yyextra->guards->empty())
3596 yyextra->guards->emplace(
true);
3600 bool enabled = yyextra->guards->top().isEnabled();
3601 yyextra->guards->emplace(enabled);
3609 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3610 if (yyextra->guards->empty())
3612 warn(yyextra->fileName,yyextra->lineNr,
3613 "found \\elseif without matching start command");
3615 else if (yyextra->guards->top().hasElse())
3617 warn(yyextra->fileName,yyextra->lineNr,
3618 "found \\elseif command after \\else command was given in \\if construct");
3620 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3621 yyextra->guards->top().setEnabled(
false);
3627 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3628 yyextra->guards->top().setEnabled(
false);
3636 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3637 if (yyextra->guards->empty())
3639 warn(yyextra->fileName,yyextra->lineNr,
3640 "found \\else without matching start command");
3642 else if (yyextra->guards->top().hasElse())
3644 warn(yyextra->fileName,yyextra->lineNr,
3645 "found multiple \\else commands in same \\if construct");
3646 yyextra->guards->top().setEnabled(
false);
3647 yyextra->guards->top().setElse();
3648 BEGIN( SkipGuardedSection );
3652 yyextra->guards->top().setElse();
3653 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3654 if (yyextra->guards->top().isEnabledFound())
3656 yyextra->guards->top().setEnabled(
false);
3657 BEGIN( SkipGuardedSection );
3661 yyextra->guards->top().setEnabled(
true);
3662 BEGIN( GuardParamEnd );
3670 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3671 if (yyextra->guards->empty())
3673 warn(yyextra->fileName,yyextra->lineNr,
3674 "found \\endif without matching start command");
3678 yyextra->guards->pop();
3680 if (!yyextra->spaceBeforeCmd.isEmpty())
3682 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3683 yyextra->spaceBeforeCmd.clear();
3685 if (yyextra->guards->empty())
3687 BEGIN( GuardParamEnd );
3691 if (yyextra->guards->top().isEnabled())
3693 BEGIN( GuardParamEnd );
3697 BEGIN( SkipGuardedSection );
3705 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3706 yyextra->inGroupParamFound=
FALSE;
3707 BEGIN( InGroupParam );
3713 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3714 yyextra->current->subGrouping =
FALSE;
3720 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3721 yyextra->current->initLines = 100000;
3727 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3728 yyextra->current->initLines = 0;
3734 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3735 yyextra->current->commandOverrides.override_callGraph(
true);
3741 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3742 yyextra->current->commandOverrides.override_callGraph(
false);
3748 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3749 yyextra->current->commandOverrides.override_callerGraph(
true);
3755 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3756 yyextra->current->commandOverrides.override_callerGraph(
false);
3762 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3763 yyextra->current->commandOverrides.override_enumValues(
true);
3769 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3770 yyextra->current->commandOverrides.override_enumValues(
false);
3776 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3777 yyextra->current->commandOverrides.override_inlineSource(
true);
3783 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3784 yyextra->current->commandOverrides.override_inlineSource(
false);
3790 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3791 yyextra->current->commandOverrides.override_includeGraph(
true);
3797 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3798 yyextra->current->commandOverrides.override_includedByGraph(
true);
3804 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3805 yyextra->current->commandOverrides.override_includeGraph(
false);
3811 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3812 yyextra->current->commandOverrides.override_includedByGraph(
false);
3818 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3819 yyextra->current->commandOverrides.override_directoryGraph(
true);
3825 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3826 yyextra->current->commandOverrides.override_directoryGraph(
false);
3832 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3833 yyextra->current->commandOverrides.override_collaborationGraph(
true);
3839 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3840 yyextra->current->commandOverrides.override_collaborationGraph(
false);
3846 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3847 yyextra->current->commandOverrides.override_groupGraph(
true);
3853 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3854 yyextra->current->commandOverrides.override_groupGraph(
false);
3860 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3861 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3862 for (
const auto &opt_ : optList)
3869 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3871 else if (opt ==
"graph")
3873 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3875 else if (opt ==
"builtin")
3877 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3879 else if (opt ==
"text")
3881 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3883 else if (opt ==
"no")
3885 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3889 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
3899 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3900 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3906 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3907 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3913 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3914 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3920 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3921 yyextra->current->commandOverrides.override_referencesRelation(
true);
3927 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3928 yyextra->current->commandOverrides.override_referencesRelation(
false);
3934 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3935 yyextra->currentCmd = cmd;
3942 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3947 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
3949 yyextra->current->doc.clear();
3951 yyextra->condCount=0;
3952 BEGIN( SkipInternal );
3958 yyextra->inInternalDocs =
TRUE;
3965 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3966 yyextra->current->isStatic =
TRUE;
3972 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3973 yyextra->current->virt = Specifier::Pure;
3979 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3980 yyextra->current->protection = Protection::Private;
3986 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3987 yyextra->current->protection = yyextra->protection = Protection::Private;
3993 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3994 yyextra->current->protection = Protection::Protected;
4000 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4001 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4007 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4008 yyextra->current->protection = Protection::Public;
4014 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4015 yyextra->current->protection = yyextra->protection = Protection::Public;
4021 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4022 if (yyextra->current->section.isPageDoc() ||
4023 yyextra->current->section.isMainpageDoc())
4025 for (
const auto &opt_ : optList)
4029 int i = opt.
find(
':');
4033 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4035 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4049 yyextra->current->localToc.enableHtml(level);
4051 else if (opt ==
"latex")
4053 yyextra->current->localToc.enableLatex(level);
4055 else if (opt ==
"xml")
4057 yyextra->current->localToc.enableXml(level);
4059 else if (opt ==
"docbook")
4061 yyextra->current->localToc.enableDocbook(level);
4065 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4070 if (yyextra->current->localToc.nothingEnabled())
4082 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4083 BEGIN(InheritParam);
4089 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4090 yyextra->currentCmd = cmd;
4091 BEGIN(ExtendsParam);
4097 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4098 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4104 if (!yyextra->spaceBeforeCmd.isEmpty())
4106 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4107 yyextra->spaceBeforeCmd.clear();
4115 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4117 if (!yyextra->spaceBeforeCmd.isEmpty())
4119 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4120 yyextra->spaceBeforeCmd.clear();
4128 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4129 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4135 if (!yyextra->spaceBeforeCmd.isEmpty())
4137 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4138 yyextra->spaceBeforeCmd.clear();
4141 yyextra->copyDocArg.clear();
4142 yyextra->braceCount = 0;
4151 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4152 yyextra->sectionLabel.clear();
4153 yyextra->sectionTitle.clear();
4154 yyextra->docGroup.clearHeader();
4155 yyextra->insideParBlock =
FALSE;
4162 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4164 return yyextra->current->section.isDoc();
4169 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4170 assert(maker!=
nullptr);
4172 if (yyextra->current->section.isDoc())
4178 yyextra->needNewEntry =
true;
4179 yyextra->current->section = maker();
4180 yyextra->current->fileName = yyextra->fileName;
4181 yyextra->current->startLine = yyextra->lineNr;
4182 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4195 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4196 for(
const char* c = yytext ; *c ; ++c )
4197 yyextra->lineNr += (*c ==
'\n') ;
4205 if (s==
nullptr || *s==0)
return name;
4207 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4218 const QCString &listTitle,
bool append)
4220 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4221 if (listName.
isEmpty())
return;
4228 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4241 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4249 item = refList->
add();
4253 item->
setText(yyextra->outputXRef);
4255 yyextra->current->sli.push_back(item);
4258 if (yyextra->inBody)
4260 yyextra->current->inbodyDocs += cmdString;
4264 yyextra->current->doc += cmdString;
4274 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4276 yyextra->sectionLevel);
4277 yyextra->current->anchors.push_back(si);
4279 else if (si->
lineNr() != -1)
4281 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4286 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4292 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4294 yyextra->sectionLevel);
4295 yyextra->current->anchors.push_back(si);
4299 yyextra->outputXRef.clear();
4309 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4311 QCString formula = (yyextra->formulaPreText +
4312 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4320 formLabel.
sprintf(
"\\_form#%d",
id);
4321 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4338 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4346 if (addYYtext) yyextra->sectionTitle+=yytext;
4347 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4348 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4350 yyextra->sectionLevel);
4353 yyextra->current->anchors.push_back(si);
4355 else if (si->
lineNr() != -1)
4357 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4362 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4363 yyextra->sectionLabel,si->
fileName());
4369 if (addYYtext) yyextra->sectionTitle+=yytext;
4370 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4371 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4373 yyextra->sectionLevel);
4376 yyextra->current->anchors.push_back(si);
4385 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4387 if (yytext[0] ==
'"')
4390 name=name.
left((
int)yyleng-2);
4406 if (c==
' ' || c==
'\t' || c==
'\r')
4429 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4430 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4432 yyextra->xrefAppendFlag = !yyextra->inBody &&
4434 yyextra->newXRefKind==yyextra->xrefKind &&
4436 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4452 switch(yyextra->xrefKind)
4484 yyextra->xrefItemTitle,
4485 yyextra->xrefListTitle,
4494 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4496 int oldContext = yyextra->inContext;
4497 yyextra->inContext = ctx;
4499 switch(yyextra->inContext)
4502 if (oldContext!=yyextra->inContext)
4505 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4506 if (yyextra->current->docFile.isEmpty())
4508 yyextra->current->docFile = yyextra->fileName;
4509 yyextra->current->docLine = yyextra->lineNr;
4512 yyextra->pOutputString = &yyextra->current->doc;
4516 if (oldContext!=yyextra->inContext)
4518 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4519 if (yyextra->current->briefFile.isEmpty())
4521 yyextra->current->briefFile = yyextra->fileName;
4522 yyextra->current->briefLine = yyextra->lineNr;
4525 bool foundMatch =
false;
4526 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4534 std::string str = yyextra->current->brief.str();
4539 for (
size_t i = 0; i < match[2].str().size(); i++)
4541 if (match[2].str()[i] ==
'\n') cnt++;
4545 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4547 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4554 yyextra->pOutputString = &yyextra->current->brief;
4558 if (!yyextra->current->doc.isEmpty())
4560 yyextra->current->doc +=
"\n";
4562 yyextra->pOutputString = &yyextra->current->doc;
4568 yyextra->pOutputString = &yyextra->outputXRef;
4573 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4582 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4590 yyextra->current->anchors.push_back(si);
4592 else if (si->
lineNr() != -1)
4594 warn(yyextra->fileName,yyextra->lineNr,
4595 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4600 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4607 yyextra->current->anchors.push_back(si);
4614 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4616 *yyextra->pOutputString+=s;
4622 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4624 *yyextra->pOutputString+=s;
4630 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4631 *yyextra->pOutputString+=c;
4637 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4644 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4650 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4651 std::string_view str = yyextra->current->brief.view();
4656 yyextra->briefEndsAtDot=
FALSE;
4658 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4660 yyextra->current->docLine = yyextra->lineNr;
4661 yyextra->current->doc =
"";
4665 addIline(yyscanner,yyextra->lineNr);
4671 int saveLineNr = yyextra->lineNr;
4673 yyextra->current->briefLine = yyextra->lineNr;
4674 yyextra->lineNr = saveLineNr;
4680 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4681 yyextra->prevPosition=yyextra->inputPosition;
4683 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4685 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4696 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4697 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4698 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4699 YY_START==ReadFormulaLong)
4701 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4715 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4723 commentscanYYlex_destroy(
p->yyscanner);
4736 bool &newEntryNeeded,
4737 bool markdownSupport,
4741 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4743 isAutoBriefOn,isInbody,prot,markdownSupport);
4745 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4748 yyextra->guards = guards;
4749 yyextra->langParser = parser;
4750 yyextra->current = curEntry;
4751 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4753 yyextra->inputString =
comment;
4754 yyextra->inputString.append(
" ");
4755 yyextra->inputPosition = position;
4756 yyextra->lineNr = lineNr;
4757 yyextra->fileName = fileName;
4758 yyextra->protection = prot;
4759 yyextra->needNewEntry =
FALSE;
4761 yyextra->xrefAppendFlag =
FALSE;
4762 yyextra->insidePre =
FALSE;
4763 yyextra->parseMore =
FALSE;
4764 yyextra->inBody = isInbody;
4765 yyextra->markdownSupport= markdownSupport;
4766 yyextra->outputXRef.clear();
4767 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4769 yyextra->current->doc +=
'\n';
4772 yyextra->briefEndsAtDot = isAutoBriefOn;
4773 yyextra->condCount = 0;
4774 yyextra->sectionLevel = 0;
4775 yyextra->spaceBeforeCmd.clear();
4776 yyextra->spaceBeforeIf.clear();
4777 yyextra->htmlContextStack.clear();
4780 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4783 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4784 yyextra->current->inbodyDocs+=cmd;
4788 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
4791 commentscanYYrestart(
nullptr, yyscanner );
4793 commentscanYYlex(yyscanner);
4796 if (YY_START==OverloadParam)
4801 if (yyextra->insideParBlock)
4803 warn(yyextra->fileName,yyextra->lineNr,
4804 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4810 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4813 yyextra->current->doc=
"\n\n";
4816 if (yyextra->current->section.isMemberGrp() &&
4817 yyextra->docGroup.isEmpty())
4819 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4823 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
4825 yyextra->current->briefLine,yyextra->current->brief,
4826 yyextra->current->docLine,yyextra->current->doc,
4827 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
4831 prot = yyextra->protection;
4833 yyextra->docGroup.addDocs(curEntry);
4835 newEntryNeeded = yyextra->needNewEntry;
4840 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4842 if (!yyextra->parseMore && !yyextra->guards->empty())
4844 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4847 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4849 lineNr = yyextra->lineNr;
4851 position,yyextra->parseMore,newEntryNeeded);
4853 return yyextra->parseMore;
4858 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4860 bool sectionEnabled =
false;
4865 bool parentEnabled = yyextra->guards->top().parentVisible();
4869 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4870 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4874 yyextra->guards->top().setEnabled(
true);
4875 yyextra->guards->top().setEnabledFound();
4876 BEGIN( GuardParamEnd );
4880 if (yyextra->guards->top().isEnabledFound())
4882 yyextra->guards->top().setEnabled(
false);
4883 BEGIN( SkipGuardedSection );
4885 else if (sectionEnabled)
4887 yyextra->guards->top().setEnabled(
true);
4888 yyextra->guards->top().setEnabledFound();
4889 BEGIN( GuardParamEnd );
4893 yyextra->guards->top().setEnabled(
false);
4894 BEGIN( SkipGuardedSection );
4899 BEGIN( SkipGuardedSection );
4904 BEGIN( SkipGuardedSection );
4910 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4911 yyextra->docGroup.initGroupInfo(entry);
4916 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4917 yyextra->docGroup.enterFile(fileName,lineNr);
4922 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4923 yyextra->docGroup.leaveFile(fileName,lineNr);
4928 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4929 yyextra->docGroup.enterCompound(fileName,lineNr,name);
4934 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4935 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
4940 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4941 yyextra->docGroup.open(e,fileName,lineNr,implicit);
4946 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4947 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
4950#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.