14%option never-interactive
15%option prefix="commentscanYY"
17%option extra-type="struct commentscanYY_state *"
21#define YY_TYPEDEF_YY_SCANNER_T
37#include <unordered_map>
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);
559#define unput_string(yytext,yyleng) do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)
564#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
567static inline const char *
getLexerFILE() {
return __FILE__;}
Represents an unstructured piece of information, about an entity found in the sources.
Wrapper class for the Entry type.
Minimal replacement for QFileInfo.
Abstract interface for outline parsers.
This is an alternative implementation of QCString.
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
static const char * stateToString(int state)
static const char * getLexerFILE()
std::vector< std::string > StringVector
#define lineCount(s, len)
Some helper functions for std::string.
DocCmdMap(DocCmdFunc h, CommandSpacing s, SectionHandling sh)
SectionHandling sectionHandling
HtmlContextInfo(const QCString &tn, OutputContext ctx)
A bunch of utility functions.
575TABLE ("table"|"TABLE")
576TABLEDEL ("table"|"tr"|"th"|"td"|"TABLE"|"TR"|"TH"|"TD")
586CAPTION ("caption"|"CAPTION")
587CENTER ("center"|"CENTER")
589DETAILS ("details"|"DETAILS")
590BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
591DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
592DETAILEDHTMLOPT {CODE}
593DETAILEDHTMLOPTEND {ENDCODE}
594SUMMARY ("summary"|"SUMMARY")
595REMARKS ("remarks"|"REMARKS")
597ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
602DOCNL "\n"|"\\ilinebr"
605FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
606FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
607FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
608ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
609LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
610CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
611CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
612CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
613SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
614SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
615TMPLSPEC "<"{BN}*[^>]+{BN}*">"
616MAILADDR ("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\-]+
617RCSTAG "$"{ID}":"[^\n$]+"$"
618MODULE_ID ({ID}".")*{ID}
619LINENR {Bopt}[1-9][0-9]*
620IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
672%x ReadFormulaShortSection
674%x ReadFormulaRoundSection
688%x RaiseWarningSection
717<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
720<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
726<Comment>"\""[^"\n]*"\"" {
729<Comment>("\\"[a-z_A-Z]+)+"\\" {
732<Comment>"<"{DETAILEDHTML}{ATTR}">" {
734 int spacePos = htmlOpenTag.find(
' ');
735 if (spacePos==-1) spacePos=yyleng-1;
736 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
738 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
746<Comment>"</"{DETAILEDHTML}">" {
748 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
750 if (!yyextra->htmlContextStack.empty() &&
751 yyextra->htmlContextStack.back().tagName==htmlTagName)
758 yyextra->htmlContextStack.pop_back();
762<Comment>"<"{DETAILEDHTMLOPT}">" {
764 if (yyextra->current->lang==SrcLangExt::CSharp)
766 yyextra->CScode=
true;
776<Comment>"<"{DETAILEDHTMLOPTEND}">" {
780 yyextra->CScode=
false;
784 yyextra->CScode=
false;
789<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
791 if (yyextra->current->lang==SrcLangExt::CSharp)
798<Comment>"<"{DETAILS}{ATTR}">" {
799 yyextra->htmlDetailsStack.push_back(0);
800 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
807<Comment>"</"{DETAILS}">" {
808 if (!yyextra->htmlDetailsStack.empty())
810 yyextra->htmlDetailsStack.pop_back();
812 if (!yyextra->htmlContextStack.empty() &&
813 yyextra->htmlContextStack.back().tagName==
"details")
820 yyextra->htmlContextStack.pop_back();
825 yyextra->htmlAnchorStr = yytext;
826 yyextra->htmlAnchor =
false;
830 yyextra->htmlAnchorStr += yytext;
835 if (c==
'\'' || c==
'"')
837 int e=tag.find(c,s+2);
840 id=tag.mid(s+2,e-s-2);
849 if (!
id.isEmpty() && !yyextra->htmlAnchor)
855 yyextra->htmlAnchor =
true;
858<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
859 yyextra->htmlAnchorStr += yytext;
862 if (!yyextra->htmlAnchor)
864 addOutput(yyscanner,yyextra->htmlAnchorStr);
877 yyextra->htmlAnchorStr += yytext;
878 if (*yytext ==
'\n') yyextra->lineNr++;
881 yyextra->htmlAnchorStr += yytext;
883<Comment>"<"{SUMMARY}">" {
884 if (yyextra->htmlDetailsStack.empty())
893<Comment>"<"{REMARKS}">" {
897<Comment>"</"{SUMMARY}">" {
898 if (!yyextra->htmlDetailsStack.empty())
907<Comment>"</"{REMARKS}">" {
911<Comment>"<"{CAPTION}{ATTR}">" {
913 int s=tag.find(
"id=");
917 if (c==
'\'' || c==
'"')
919 int e=tag.find(c,s+4);
929<Comment>"<"{PRE}{ATTR}">" {
930 yyextra->insidePre=
TRUE;
933<Comment>"</"{PRE}">" {
934 yyextra->insidePre=
FALSE;
944<Comment>"<!\[CDATA\[" {
947<Comment>{B}*{CMD}"endinternal"{B}* {
949 if (!yyextra->inInternalDocs)
950 warn(yyextra->fileName,yyextra->lineNr,
951 "found \\endinternal without matching \\internal"
953 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
955<Comment>{B}*"\\ilinebr "{B}* {
958<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
968<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
969<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
972 int idx = fullMatch.
find(
'{');
974 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
975 int idxEnd = fullMatch.
find(
"}",idx+1);
993 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
994 yyextra->spaceBeforeCmd = fullMatch.
left(i);
997 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
999 yyextra->briefEndsAtDot=
FALSE;
1005 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1010 yyextra->parseMore=
TRUE;
1012 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1015 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.
1027<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1030<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1037 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...
1043<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1045 yyextra->formulaText=
"";
1046 yyextra->formulaPreText=
"\\begin";
1047 yyextra->formulaPostText=
"";
1049 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1052 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1054 yyextra->formulaPreText+=yyextra->formulaEnv;
1055 yyextra->formulaNewLines=0;
1056 BEGIN(ReadFormulaLong);
1058<Comment>{B}*{CMD}"f$" {
1059 yyextra->formulaText=
"";
1060 yyextra->formulaPreText=
"$";
1061 yyextra->formulaPostText=
"";
1062 yyextra->formulaNewLines=0;
1063 BEGIN(ReadFormulaShort);
1065<Comment>{B}*{CMD}"f(" {
1066 yyextra->formulaText=
"";
1067 yyextra->formulaPreText=
"";
1068 yyextra->formulaPostText=
"";
1069 yyextra->formulaNewLines=0;
1070 BEGIN(ReadFormulaRound);
1072<Comment>{B}*{CMD}"f[" {
1074 yyextra->formulaText=
"";
1075 yyextra->formulaPreText=
"\\[";
1076 yyextra->formulaPostText=
"";
1077 yyextra->formulaNewLines=0;
1078 BEGIN(ReadFormulaLong);
1080<Comment>{B}*{CMD}"{" {
1082 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1084<Comment>{B}*{CMD}"}" {
1086 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1087 yyextra->docGroup.clearHeader();
1088 yyextra->parseMore=
TRUE;
1089 yyextra->needNewEntry =
TRUE;
1090 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1093<Comment>{B}*{CMD}[$@\\&~<>#%] {
1096<Comment>[a-z_A-Z]+ {
1099<Comment>^{B}*"."{Bopt}/\n {
1102<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1103<Comment>^{B}*[*+]{B}+ {
1104 if (!yyextra->markdownSupport)
1112 yyextra->briefEndsAtDot=
FALSE;
1118<Comment>^{B}*"-"{B}+ {
1121 yyextra->briefEndsAtDot=
FALSE;
1126<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1129<Comment>{CMD}"---" {
1136 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1139 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1144 yyextra->briefEndsAtDot=
FALSE;
1149<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1150<Comment>("."+)[a-z_A-Z0-9\)] {
1154<Comment>{CMD}[\.?!] {
1158<Comment>".\\"[ \t] {
1165<Comment>"...\\"[ \t] {
1168<Comment>"..."/[^\.] {
1171<Comment>".."[\.]?/[^ \t\n] {
1174<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1180 for (i=0;i<(yy_size_t)yyleng;)
1182 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1183 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1190 for (i=0;i<(yy_size_t)yyleng;)
1192 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1193 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1208 if (yyextra->briefEndsAtDot)
1211 yyextra->briefEndsAtDot=
FALSE;
1216 if (*yytext ==
'\n') yyextra->lineNr++;
1218<Comment>"<"[/]?{TABLEDEL}">" {
1236<HtmlComment>"---"[!]?">"{B}* {
1237 warn(yyextra->fileName,yyextra->lineNr,
1238 "incorrect HTML end comment --->"
1241<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1242<HtmlComment>{DOCNL} {
1249<HtmlComment>[^\\\n\-]+ {
1254<CdataSection>"\]\]>" {
1257<CdataSection>{DOCNL} {
1259 if (*yytext==
'\n') yyextra->lineNr++;
1261<CdataSection>[<>&] {
1265<CdataSection>[^\\\n\]<>&]+ {
1274<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1275 yyextra->formulaPostText+=
"$";
1278 if (YY_START == ReadFormulaShort)
1284 yyextra->sectionTitle+=
" "+form;
1285 BEGIN(SectionTitle);
1288<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1291 if (YY_START == ReadFormulaRound)
1297 yyextra->sectionTitle+=
" "+form;
1298 BEGIN(SectionTitle);
1301<ReadFormulaLong>{CMD}"f]" {
1302 yyextra->formulaPostText+=
"\\]";
1306<ReadFormulaLong>{CMD}"f}" {
1307 yyextra->formulaPostText+=
"\\end";
1308 yyextra->formulaPostText+=yyextra->formulaEnv;
1312<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1313 yyextra->formulaText+=yytext;
1315<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1316 yyextra->formulaNewLines++;
1317 yyextra->formulaText+=*yytext;
1319 addIline(yyscanner,yyextra->lineNr);
1321<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1322 yyextra->formulaText+=*yytext;
1327<EnumDocArg1>{SCOPEID} {
1329 yyextra->current->name = yytext;
1336<EnumDocArg1>{DOCNL} {
1337 warn(yyextra->fileName,yyextra->lineNr,
1338 "missing argument after '\\enum'."
1348<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)
1354<NameSpaceDocArg1>{LC} {
1358<NameSpaceDocArg1>{DOCNL} {
1359 warn(yyextra->fileName,yyextra->lineNr,
1360 "missing argument after '\\namespace'."
1365<NameSpaceDocArg1>. {
1370<PackageDocArg1>{ID}("."{ID})* {
1371 yyextra->current->name = yytext;
1374<PackageDocArg1>{LC} {
1378<PackageDocArg1>{DOCNL} {
1379 warn(yyextra->fileName,yyextra->lineNr,
1380 "missing argument after \\package."
1392<ConceptDocArg1>{SCOPEID} {
1394 yyextra->current->name = yytext;
1397<ConceptDocArg1>{LC} {
1401<ConceptDocArg1>{DOCNL} {
1402 warn(yyextra->fileName,yyextra->lineNr,
1403 "missing argument after '\\concept'."
1412<ModuleDocArg1>{MODULE_ID} {
1414 yyextra->current->name = yytext;
1417<ModuleDocArg1>{LC} {
1421<ModuleDocArg1>{DOCNL} {
1422 warn(yyextra->fileName,yyextra->lineNr,
1423 "missing argument after '\\module'."
1433<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1437 BEGIN( ClassDocArg2 );
1439<ClassDocArg1>{SCOPENAME} {
1442 yyextra->current->name =
substitute(yytext,
".",
"::");
1443 if (yyextra->current->section.isProtocolDoc())
1445 yyextra->current->name+=
"-p";
1448 BEGIN( ClassDocArg2 );
1450<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1453 yyextra->current->name =
substitute(yytext,
".",
"::");
1454 BEGIN( ClassDocArg2 );
1456<ClassDocArg1,CategoryDocArg1>{LC} {
1460<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1461 warn(yyextra->fileName,yyextra->lineNr,
1462 "missing argument after '\\{}'.",yyextra->currentCmd
1467<ClassDocArg1,CategoryDocArg1>. {
1470<ClassDocArg2>{DOCNL} {
1474<ClassDocArg2>{FILE}|"<>" {
1475 yyextra->current->includeFile = yytext;
1476 BEGIN( ClassDocArg3 );
1485<ClassDocArg3>[<"]?{FILE}?[">]? {
1486 yyextra->current->includeName = yytext;
1493<ClassDocArg3>{DOCNL} {
1503<GroupDocArg1>{LABELID}(".html"|".xhtml")? {
1504 yyextra->current->name = yytext;
1508 if (yyextra->current->name.endsWith(
".html"))
1510 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1512 else if (yyextra->current->name.endsWith(
".xhtml"))
1514 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-6);
1516 yyextra->current->type.clear();
1517 BEGIN(GroupDocArg2);
1519<GroupDocArg1>"\\"{B}*"\n" {
1523<GroupDocArg1>{DOCNL} {
1524 warn(yyextra->fileName,yyextra->lineNr,
1525 "missing group name after {}",
1526 yyextra->current->groupDocCmd()
1535<GroupDocArg2>"\\"{B}*"\n" {
1539<GroupDocArg2>[^\n\\]+ {
1540 yyextra->current->type += yytext;
1542<GroupDocArg2>{DOCNL}+ {
1543 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1545 yyextra->current->type.isEmpty()
1548 warn(yyextra->fileName,yyextra->lineNr,
1549 "missing title after "
1550 "\\defgroup {}", yyextra->current->name
1554 int extraLineNr = 0;
1557 for (
int i = 0; i < yyleng; i++)
1559 if (yytext[i]==
'\n') extraLineNr++;
1566 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1567 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1572 yyextra->current->type += yytext;
1577<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1581 int start = text.
find(
'{');
1582 int end = text.
find(
'}',start+1);
1583 yyextra->current->name = text.
mid(
end+2);
1584 int istart = yyextra->current->name.
find(
"\\ilinebr");
1587 QCString rest = yyextra->current->name.
mid(istart);
1589 yyextra->current->name = yyextra->current->name.mid(0,istart);
1591 yyextra->current->args = text.
mid(start+1,
end-start-1);
1593 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1595<PageDocArg1>{FILE} {
1597 yyextra->current->args =
"";
1598 BEGIN( PageDocArg2 );
1600<PageDocArg1>{LC} { yyextra->lineNr++;
1603<PageDocArg1>{DOCNL} {
1604 warn(yyextra->fileName,yyextra->lineNr,
1605 "missing argument after \\page."
1614<PageDocArg2>{DOCNL} {
1618 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1619 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1622<PageDocArg2>{CMD}[<>] {
1627 yyextra->current->args += tmp;
1630 yyextra->current->args += yytext;
1633<ParamArg1>{ID}/{B}*"," {
1640 if (*yytext==
'\n') yyextra->lineNr++;
1654<FileDocArg1>{DOCNL} {
1660<FileDocArg1>{FILE} {
1664<FileDocArg1>{LC} { yyextra->lineNr++;
1672<XRefItemParam1>{LABELID} {
1673 yyextra->newXRefItemKey=yytext;
1675 BEGIN(XRefItemParam2);
1677<XRefItemParam1>{LC} {
1681<XRefItemParam1>{DOCNL} {
1682 warn(yyextra->fileName,yyextra->lineNr,
1683 "Missing first argument of \\xrefitem"
1685 if (*yytext==
'\n') yyextra->lineNr++;
1693<XRefItemParam2>"\""[^\n\"]*"\"" {
1695 BEGIN(XRefItemParam3);
1697<XRefItemParam2>{LC} {
1701<XRefItemParam2>{DOCNL} {
1702 warn(yyextra->fileName,yyextra->lineNr,
1703 "Missing second argument of \\xrefitem"
1705 if (*yytext==
'\n') yyextra->lineNr++;
1713<XRefItemParam3>"\""[^\n\"]*"\"" {
1718<XRefItemParam2,XRefItemParam3>{LC} {
1722<XRefItemParam3>{DOCNL} {
1723 warn(yyextra->fileName,yyextra->lineNr,
1724 "Missing third argument of \\xrefitem"
1726 if (*yytext==
'\n') yyextra->lineNr++;
1737<RelatesParam1>({ID}("::"|"."))*{ID} {
1738 yyextra->current->relates = yytext;
1745<RelatesParam1>{LC} {
1749<RelatesParam1>{DOCNL} {
1750 warn(yyextra->fileName,yyextra->lineNr,
1751 "Missing argument of '\\{}' command",yyextra->currentCmd
1763<Qualifier>{LABELID} {
1764 yyextra->current->qualifiers.emplace_back(yytext);
1767<Qualifier>"\""[^\"]*"\"" {
1768 std::string inp(yytext);
1769 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1773 warn(yyextra->fileName,yyextra->lineNr,
1774 "Missing argument of '\\{}' command",yyextra->currentCmd
1780 warn(yyextra->fileName,yyextra->lineNr,
1781 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1787<ILine>{LINENR}/[\\@\n\.] |
1793 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1797 yyextra->lineNr = nr;
1800 if (YY_START == ILine)
1806 yyextra->sectionTitle+=yytext;
1807 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1810<ILine,ILineSection>. {
1812 if (YY_START == ILine)
1818 yyextra->sectionTitle+=yytext;
1819 BEGIN(SectionTitle);
1824<IRaise>{B}*[0-9]+/[\\@\n\.] |
1825<IRaise>{B}*[0-9]+{B} {
1830 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1834 yyextra->raiseLevel = nr;
1844<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1858<IFile,IFileSection>{FILE} {
1861 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1862 else yyextra->fileName = yytext;
1863 if (YY_START == IFile)
1869 yyextra->sectionTitle+=yytext;
1870 BEGIN(SectionTitle);
1874<LinkSection>[^\\@\n]* {
1875 yyextra->sectionTitle+=yytext;
1877<LinkSection>{CMD}{CMD} {
1878 yyextra->sectionTitle+=yytext;
1880<LinkSection>{DOCNL} {
1882 if (*yytext ==
'\n') yyextra->lineNr++;
1883 yyextra->sectionTitle+=yytext;
1885<LinkSection>{CMD}"endlink" {
1886 yyextra->sectionTitle+=yytext;
1887 BEGIN(SectionTitle);
1890 yyextra->sectionTitle+=yytext;
1892<LinkSection><<EOF>> {
1893 warn(yyextra->fileName,yyextra->lineNr,
1894 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1900<LineParam>{CMD}{CMD} {
1913<LineParam>({CMD}{CMD}){ID} {
1922<SectionLabel>{LABELID} {
1923 yyextra->sectionLabel+=yytext;
1925<SectionLabel>{CMD}"lineinfo"("{}")? {
QCString & setNum(short n)
1928<SectionLabel>{CMD}"fileinfo"("{"[^}]*"}")? {
1929 FileInfo fi(yyextra->fileName.str());
1930 bool hasOption =
false;
1932 if (yytext[yyleng-1] ==
'}')
1938 for (
const auto &opt_ : optList)
1941 std::string opt = optStripped.
lower().
str();
1947 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
1957 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
1969 label=yyextra->fileName;
1973 yyextra->sectionLabel+=label;
#define Config_getBool(name)
static QCString stripFromPath(const QCString &p, const StringVector &l)
1975<SectionLabel>{DOCNL} {
1976 yyextra->sectionTitle.clear();
1977 if (yyextra->sectionLabel.isEmpty())
1979 warn(yyextra->fileName,yyextra->lineNr,
1980 "\\section command has no label"
1985 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
1986 addOutput(yyscanner,yyextra->sectionLabel.data());
1989 if (*yytext==
'\n') yyextra->lineNr++;
1994 if (yyextra->sectionLabel.isEmpty())
1996 warn(yyextra->fileName,yyextra->lineNr,
1997 "Invalid or missing section label"
2003 yyextra->sectionLabel=yyextra->raisePrefix+yyextra->sectionLabel;
2004 addOutput(yyscanner,yyextra->sectionLabel.data());
2005 yyextra->sectionTitle.clear();
2007 BEGIN(SectionTitle);
2010<SectionTitle>{STAopt}/"\n" {
2015<SectionTitle>{STopt}"\\\\ilinebr" {
2016 yyextra->sectionTitle+=yytext;
2018<SectionTitle>{STopt}/"\\ilinebr" {
2023<SectionTitle>{B}*{CMD}"f$" {
2024 yyextra->formulaText=
"";
2025 yyextra->formulaPreText=
"$";
2026 yyextra->formulaPostText=
"";
2027 yyextra->formulaNewLines=0;
2028 BEGIN(ReadFormulaShortSection);
2030<SectionTitle>{B}*{CMD}"f(" {
2031 yyextra->formulaText=
"";
2032 yyextra->formulaPreText=
"";
2033 yyextra->formulaPostText=
"";
2034 yyextra->formulaNewLines=0;
2035 BEGIN(ReadFormulaRoundSection);
2037<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
2038<SectionTitle>{B}*{CMD}"f"[\[{] {
2042 warn(yyextra->fileName,yyextra->lineNr,
2043 "'\\{}' command is not allowed in section title, ending section title.",
2053<SectionTitle>[^\n@\\]* {
2054 yyextra->sectionTitle+=yytext;
2057<SectionTitle>{B}*{CMD}{CMD} {
2058 yyextra->sectionTitle+=yytext;
2061<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
2062<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
2064 int idx = fullMatch.
find(
'{');
2066 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
2067 int idxEnd = fullMatch.
find(
"}",idx+1);
2083 switch (it->second.sectionHandling)
2088 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2089 yyextra->sectionTitle+=fullMatch.
left(i);
2090 yyextra->sectionTitle+=
'@';
2091 yyextra->sectionTitle+=fullMatch.
mid(i);
2095 warn(yyextra->fileName,yyextra->lineNr,
2096 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2104 warn(yyextra->fileName,yyextra->lineNr,
2105 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2113 if (cmdName ==
"fileinfo")
2116 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2117 yyextra->sectionTitle+=fullMatch.
left(i);
2122 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2127 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2131 else if (cmdName ==
"lineinfo")
2134 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2135 yyextra->sectionTitle+=fullMatch.
left(i);
2137 yyextra->sectionTitle+=
' ';
2138 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2144 else if (cmdName ==
"raisewarning")
2146 yyextra->raiseWarning =
"";
2147 BEGIN(RaiseWarningSection);
2149 else if (cmdName ==
"noop")
2154 else if (cmdName ==
"cite")
2156 yyextra->sectionTitle+=yytext;
2158 BEGIN(CiteLabelSection);
2160 else if (cmdName ==
"iline")
2162 yyextra->sectionTitle+=yytext;
2164 BEGIN(ILineSection);
2166 else if (cmdName ==
"ifile")
2168 yyextra->sectionTitle+=yytext;
2170 BEGIN(IFileSection);
2172 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2175 if (optList.empty())
2177 yyextra -> anchorTitle =
"";
2182 yyextra -> anchorTitle =
join(optList,
" ");
2185 BEGIN(AnchorLabelSection);
2187 else if (cmdName ==
"link")
2189 yyextra->sectionTitle+=yytext;
2194 yyextra->sectionTitle+=yytext;
2195 warn(yyextra->fileName,yyextra->lineNr,
2196 "internal error '\\{}' command is to be replaced in section title.",cmdName
2203 yyextra->sectionTitle+=yytext;
2211 yyextra->sectionTitle+=yytext;
const char * qPrint(const char *s)
std::string join(const StringVector &sv, const std::string &delimiter)
create a string where the string in the vector are joined by the given delimiter
2216 yyextra->sectionTitle+=yytext;
2222<SubpageLabel>{FILE} {
2226 yyextra->current->extends.emplace_back(yytext,Protection::Public,Specifier::Normal);
2227 BEGIN(SubpageTitle);
2229<SubpageLabel>{DOCNL} {
2230 warn(yyextra->fileName,yyextra->lineNr,
2231 "\\subpage command has no label"
2233 if (*yytext==
'\n') yyextra->lineNr++;
2241<SubpageTitle>{DOCNL} {
2245<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2256<AnchorLabel,AnchorLabelSection>{LABELID} {
2257 QCString lbl = yyextra->raisePrefix+yytext;
2258 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2260 if (YY_START == AnchorLabel)
2266 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2269<AnchorLabel,AnchorLabelSection>{DOCNL} {
2270 warn(yyextra->fileName,yyextra->lineNr,
2271 "\\anchor command has no label"
2273 if (*yytext==
'\n') yyextra->lineNr++;
2275 if (YY_START == AnchorLabel)
2281 BEGIN(SectionTitle);
2284<AnchorLabel,AnchorLabelSection>. {
2285 warn(yyextra->fileName,yyextra->lineNr,
2286 "Invalid or missing anchor label"
2289 if (YY_START == AnchorLabel)
2295 BEGIN(SectionTitle);
2302<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2304 if (&yytext[4]==yyextra->blockName)
2309<FormatBlock>{CMD}"enduml" {
2311 if (yyextra->blockName==
"startuml")
2316<FormatBlock>[^ \@\*\/\\\n]* {
2319<FormatBlock>{DOCNL} {
2320 if (*yytext==
'\n') yyextra->lineNr++;
2324 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2325 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2326 yyextra->blockName==
"iliteral"
2328 ) yyextra->commentCount++;
2333 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2334 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2335 yyextra->blockName==
"iliteral"
2339 yyextra->commentCount--;
2340 if (yyextra->commentCount<0)
2342 QCString endTag =
"end"+yyextra->blockName;
2343 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2344 warn(yyextra->fileName,yyextra->lineNr,
2345 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2346 yyextra->blockName,endTag);
2353<FormatBlock><<EOF>> {
2354 QCString endTag =
"end"+yyextra->blockName;
2355 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2356 warn(yyextra->fileName,yyextra->lineNr,
2357 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2358 yyextra->blockName,endTag
2365<GuardParam>{B}*"(" {
2366 yyextra->guardExpr=yytext;
2367 yyextra->roundCount=1;
2371 yyextra->guardExpr+=yytext;
2375 yyextra->guardExpr+=yytext;
2376 yyextra->roundCount++;
2379 yyextra->guardExpr+=yytext;
2380 yyextra->roundCount--;
2381 if (yyextra->roundCount==0)
2387 warn(yyextra->fileName,yyextra->lineNr,
2388 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2392<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2395<GuardParam>{DOCNL} {
2410<GuardParamEnd>{B}*{DOCNL} {
2412 yyextra->spaceBeforeIf.clear();
2416<GuardParamEnd>{B}* {
2417 if (!yyextra->spaceBeforeIf.isEmpty())
2419 addOutput(yyscanner,yyextra->spaceBeforeIf);
2421 yyextra->spaceBeforeIf.clear();
2433<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2435 yyextra->guards->emplace(
false);
2436 BEGIN( GuardParam );
2438<SkipGuardedSection>{CMD}"if"/{NW} {
2440 yyextra->guards->emplace(
false);
2441 BEGIN( GuardParam );
2443<SkipGuardedSection>{CMD}"endif"/{NW} {
2444 if (yyextra->guards->empty())
2446 warn(yyextra->fileName,yyextra->lineNr,
2447 "found \\endif without matching start command");
2452 yyextra->guards->pop();
2453 if (yyextra->guards->empty())
2455 BEGIN( GuardParamEnd );
2459 if (yyextra->guards->top().isEnabled())
2461 BEGIN( GuardParamEnd );
2465 BEGIN( SkipGuardedSection );
2470<SkipGuardedSection>{CMD}"else"/{NW} {
2471 if (yyextra->guards->empty())
2473 warn(yyextra->fileName,yyextra->lineNr,
2474 "found \\else without matching start command");
2476 else if (yyextra->guards->top().hasElse())
2478 warn(yyextra->fileName,yyextra->lineNr,
2479 "found multiple \\else commands in same \\if construct");
2480 yyextra->guards->top().setEnabled(
false);
2481 BEGIN( SkipGuardedSection );
2483 else if (!yyextra->guards->top().parentVisible())
2485 yyextra->guards->top().setEnabled(
false);
2486 BEGIN( SkipGuardedSection );
2490 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2491 yyextra->guards->top().setElse();
2492 if (!yyextra->guards->top().parentVisible())
2494 yyextra->guards->top().setEnabled(
false);
2495 BEGIN( SkipGuardedSection );
2497 else if (yyextra->guards->top().isEnabledFound())
2499 yyextra->guards->top().setEnabled(
false);
2500 BEGIN( SkipGuardedSection );
2504 yyextra->guards->top().setEnabled(
true);
2505 BEGIN( GuardParamEnd );
2509<SkipGuardedSection>{CMD}"elseif"/{NW} {
2510 if (yyextra->guards->empty())
2512 warn(yyextra->fileName,yyextra->lineNr,
2513 "found \\elseif without matching start command");
2515 else if (yyextra->guards->top().hasElse())
2517 warn(yyextra->fileName,yyextra->lineNr,
2518 "found \\elseif command after \\else command was given in \\if construct");
2520 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2521 yyextra->guards->top().setEnabled(
false);
2522 BEGIN( GuardParam );
2527 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2528 yyextra->guards->top().setEnabled(
false);
2529 BEGIN( GuardParam );
2532<SkipGuardedSection>{DOCNL} {
2533 if (*yytext==
'\n') yyextra->lineNr++;
2536<SkipGuardedSection>[^ \\@\n]+ {
2538<SkipGuardedSection>{CMD}{CMD} |
2539<SkipGuardedSection>. {
2545<SkipInternal>{DOCNL} {
2546 if (*yytext==
'\n') yyextra->lineNr++;
2549<SkipInternal>{CMD}"if"/[ \t] {
2550 yyextra->condCount++;
2552<SkipInternal>{CMD}"ifnot"/[ \t] {
2553 yyextra->condCount++;
2555<SkipInternal>{CMD}/"endif" {
2556 yyextra->condCount--;
2557 if (yyextra->condCount<0)
2563<SkipInternal>{CMD}/"section"[ \t] {
2564 if (yyextra->sectionLevel>0)
2570<SkipInternal>{CMD}/"subsection"[ \t] {
2571 if (yyextra->sectionLevel>1)
2577<SkipInternal>{CMD}/"subsubsection"[ \t] {
2578 if (yyextra->sectionLevel>2)
2584<SkipInternal>{CMD}/"paragraph"[ \t] {
2585 if (yyextra->sectionLevel>3)
2591<SkipInternal>{CMD}/"subparagraph"[ \t] {
2592 if (yyextra->sectionLevel>4)
2598<SkipInternal>{CMD}/"subsubparagraph"[ \t] {
2599 if (yyextra->sectionLevel>5)
2605<SkipInternal>{CMD}"endinternal"[ \t]* {
2608<SkipInternal>[^ \\@\n]+ {
2625 yyextra->docGroup.appendHeader(
' ');
2628 yyextra->docGroup.appendHeader(*yytext);
2629 yyextra->current->name+=*yytext;
2644<RaiseWarning,RaiseWarningSection>{DOCNL} {
2646 "{}",yyextra->raiseWarning);
2647 yyextra->raiseWarning =
"";
2648 if (*yytext==
'\n') yyextra->lineNr++;
2650 if (YY_START == RaiseWarning)
2656 yyextra->sectionTitle+=yytext;
2657 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2660<RaiseWarning,RaiseWarningSection>. {
2661 yyextra->raiseWarning += yytext;
2665<InGroupParam>{LABELID} {
2666 yyextra->current->groups.emplace_back(
2669 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2671<InGroupParam>{DOCNL} {
2672 if (!yyextra->inGroupParamFound)
2674 warn(yyextra->fileName,yyextra->lineNr,
2675 "Missing group name for \\ingroup command"
2694 if (yyextra->braceCount==0)
2696 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2698 warn(yyextra->fileName,yyextra->lineNr,
2699 "missing argument after '\\{}'.",yyextra->currentCmd
2705 yyextra->langParser->parsePrototype(yyextra->functionProto);
2713 yyextra->functionProto+=
' ';
2715<FnParam>[^@\\\n()]+ {
2716 yyextra->functionProto+=yytext;
2719 yyextra->functionProto+=yytext;
2720 yyextra->braceCount++;
2723 yyextra->functionProto+=yytext;
2724 yyextra->braceCount--;
2727 yyextra->functionProto+=*yytext;
2734<OverloadParam>{DOCNL} {
2735 if (*yytext==
'\n') yyextra->lineNr++;
2736 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2744 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2748<OverloadParam>{LC} {
2750 yyextra->functionProto+=
' ';
2753 yyextra->functionProto+=*yytext;
2758<InheritParam>({ID}("::"|"."))*{ID} {
2759 yyextra->current->extends.emplace_back(
2764<InheritParam>{DOCNL} {
2765 warn(yyextra->fileName,yyextra->lineNr,
2766 "\\inherit command has no argument"
2768 if (*yytext==
'\n') yyextra->lineNr++;
2773 warn(yyextra->fileName,yyextra->lineNr,
2774 "Invalid or missing name for \\inherit command"
2781<ExtendsParam>({ID}("::"|"."))*{ID} {
2782 yyextra->current->extends.emplace_back(
2787<ExtendsParam>{DOCNL} {
2788 warn(yyextra->fileName,yyextra->lineNr,
2789 "'\\{}' command has no argument",yyextra->currentCmd
2801<SkipLang>{CMD}"~"[a-zA-Z-]* {
2805 warn(yyextra->fileName,yyextra->lineNr,
2814<SkipLang>[^*@\\\n]* {
2817 if (*yytext==
'\n') yyextra->lineNr++;
2824<CiteLabel,CiteLabelSection>{CITEID} {
2827 if (YY_START == CiteLabel)
2833 yyextra->sectionTitle+=yytext;
2834 BEGIN(SectionTitle);
2837<CiteLabel,CiteLabelSection>{DOCNL} {
2838 warn(yyextra->fileName,yyextra->lineNr,
2839 "\\cite command has no label"
2843 if (YY_START == CiteLabel)
2850 yyextra->sectionTitle+=yytext;
2852 BEGIN(SectionTitle);
2855<CiteLabel,CiteLabelSection>. {
2856 warn(yyextra->fileName,yyextra->lineNr,
2857 "Invalid or missing cite label"
2859 if (YY_START == CiteLabel)
2865 yyextra->sectionTitle+=yytext;
2866 BEGIN(SectionTitle);
2874 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2875 addOutput(yyscanner,yyextra->copyDocArg);
2879<CopyDoc>"<"[/]?{TABLEDEL}">" {
2880 if (yyextra->braceCount==0)
2883 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2884 addOutput(yyscanner,yyextra->copyDocArg);
2890 if (*yytext==
'\n') yyextra->lineNr++;
2891 if (yyextra->braceCount==0)
2894 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2895 addOutput(yyscanner,yyextra->copyDocArg);
2903<CopyDoc>[^@\\\n()<]+ {
2904 yyextra->copyDocArg+=yytext;
2908 yyextra->copyDocArg+=yytext;
2910 yyextra->braceCount++;
2913 yyextra->copyDocArg+=yytext;
2915 yyextra->braceCount--;
2918 yyextra->copyDocArg+=yytext;
2940 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2941 yyextra->braceCount=0;
2942 yyextra->functionProto.clear();
2943 yyextra->currentCmd = cmd;
2944 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2951 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2952 yyextra->functionProto.clear();
2953 yyextra->braceCount=0;
2954 yyextra->currentCmd = cmd;
2955 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2962 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2963 yyextra->functionProto.clear();
2964 BEGIN(OverloadParam);
2970 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2971 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2972 BEGIN( EnumDocArg1 );
2978 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2981 BEGIN( GroupDocArg1 );
2987 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2990 BEGIN( GroupDocArg1 );
2996 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2999 BEGIN( GroupDocArg1 );
3005 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3006 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
3007 BEGIN( NameSpaceDocArg1 );
3013 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3015 BEGIN( PackageDocArg1 );
3021 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3022 yyextra->currentCmd = cmd;
3023 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
3024 BEGIN( ClassDocArg1 );
3030 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3031 yyextra->currentCmd = cmd;
3032 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
3033 BEGIN( ConceptDocArg1 );
3039 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3040 yyextra->currentCmd = cmd;
3041 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
3042 BEGIN( ModuleDocArg1 );
3048 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3049 BEGIN( ClassDocArg2 );
3055 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3056 yyextra->currentCmd = cmd;
3057 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
3058 BEGIN( ClassDocArg1 );
3064 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3065 yyextra->currentCmd = cmd;
3066 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
3067 BEGIN( CategoryDocArg1 );
3073 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3074 yyextra->currentCmd = cmd;
3075 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
3076 BEGIN( ClassDocArg1 );
3082 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3083 yyextra->currentCmd = cmd;
3084 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
3085 BEGIN( ClassDocArg1 );
3091 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3092 yyextra->currentCmd = cmd;
3093 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3094 BEGIN( ClassDocArg1 );
3100 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3101 yyextra->currentCmd = cmd;
3102 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3103 BEGIN( ClassDocArg1 );
3109 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3111 BEGIN( PageDocArg1 );
3117 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3121 yyextra->current->name =
"mainpage";
3124 BEGIN( PageDocArg2 );
3130 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3134 yyextra->current->name = yyextra->fileName;
3136 BEGIN( FileDocArg1 );
3142 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3152 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3160 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3162 if (!stop) yyextra->current->name = yyextra->fileName;
3163 BEGIN( FileDocArg1 );
3169 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3171 for (
const auto &opt : optList)
3175 sectionMaker=EntryType::makeExampleLineno;
3179 warn(yyextra->fileName,yyextra->lineNr,
3180 "unsupported option '{}' for command '\\{}'",opt,cmd);
3184 if (!stop) yyextra->current->name = yyextra->fileName;
3185 BEGIN( FileDocArg1 );
3191 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3194 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3203 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3204 yyextra->raiseWarning =
"";
3205 BEGIN( RaiseWarning );
3211 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3218 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3222 yyextra->docGroup.clearHeader();
3224 if (!yyextra->docGroup.isEmpty())
3226 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3234 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3243 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3252 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3261 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3270 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3272 BEGIN(XRefItemParam1);
3278 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3279 if (yyextra->insideParBlock)
3281 warn(yyextra->fileName,yyextra->lineNr,
3282 "found \\parblock command while already in a parblock!");
3284 if (!yyextra->spaceBeforeCmd.isEmpty())
3286 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3287 yyextra->spaceBeforeCmd.clear();
3290 yyextra->insideParBlock =
TRUE;
3296 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3297 if (!yyextra->insideParBlock)
3299 warn(yyextra->fileName,yyextra->lineNr,
3300 "found \\endparblock command without matching \\parblock!");
3304 yyextra->insideParBlock =
FALSE;
3310 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3311 if (!yyextra->current->relates.isEmpty())
3313 warn(yyextra->fileName,yyextra->lineNr,
3314 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3316 yyextra->current->relatesType = RelatesType::Simple;
3317 yyextra->currentCmd = cmd;
3318 BEGIN(RelatesParam1);
3324 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3325 if (!yyextra->current->relates.isEmpty())
3327 warn(yyextra->fileName,yyextra->lineNr,
3328 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3330 yyextra->current->relatesType = RelatesType::Duplicate;
3331 yyextra->currentCmd = cmd;
3332 BEGIN(RelatesParam1);
3338 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3339 if (!yyextra->current->relates.isEmpty())
3341 warn(yyextra->fileName,yyextra->lineNr,
3342 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3344 yyextra->current->relatesType = RelatesType::MemberOf;
3345 yyextra->currentCmd = cmd;
3346 BEGIN(RelatesParam1);
3352 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3360 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3363 BEGIN(SectionLabel);
3364 yyextra->sectionLabel.clear();
3373 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3375 switch (yyextra->sectionLevel)
3383 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3390 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3391 if (!yyextra->current->section.isEmpty() &&
3392 !yyextra->current->section.isPageDoc() &&
3393 !yyextra->current->section.isMainpageDoc()
3396 warn(yyextra->fileName,yyextra->lineNr,
3397 "found \\subpage command in a comment block that is not marked as a page!");
3399 if (!yyextra->spaceBeforeCmd.isEmpty())
3401 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3402 yyextra->spaceBeforeCmd.clear();
3405 BEGIN(SubpageLabel);
3411 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3413 if (optList.empty())
3415 yyextra -> anchorTitle =
"";
3419 yyextra -> anchorTitle =
join(optList,
" ");
3427 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3428 for (
const auto &opt : optList)
3438 if (optList.empty())
3452 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3453 if (!yyextra->spaceBeforeCmd.isEmpty())
3455 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3456 yyextra->spaceBeforeCmd.clear();
3458 if (optList.empty())
3472 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3473 if (!yyextra->spaceBeforeCmd.isEmpty())
3475 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3476 yyextra->spaceBeforeCmd.clear();
3478 if (optList.empty())
3487 yyextra->blockName=s;
3488 yyextra->commentCount=0;
3495 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3513 static std::unordered_map<std::string,OptionFunc> options =
3516 {
"name", [](
const FileInfo &fi_) ->
QCString {
return fi_.baseName(); } },
3517 {
"extension", [](
const FileInfo &fi_) ->
QCString {
return fi_.extension(
true); } },
3518 {
"filename", [](
const FileInfo &fi_) ->
QCString {
return fi_.fileName(); } },
3519 {
"directory", [](
const FileInfo &fi_) ->
QCString {
return fi_.dirPath(); } },
3520 {
"full", [](
const FileInfo &fi_) ->
QCString {
return fi_.absFilePath(); } }
3522 auto it = options.
find(optionName);
3523 return (it!=options.end()) ? it->second(fi) :
QCString();
3528 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3529 if (!yyextra->spaceBeforeCmd.isEmpty())
3531 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3532 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3533 yyextra->spaceBeforeCmd.clear();
3536 FileInfo fi(yyextra->fileName.str());
3537 for (
const auto &opt_ : optList)
3540 std::string opt = optStripped.
lower().
str();
3546 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3553 yyextra->sectionTitle+=result;
3560 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3567 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3572 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3581 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3582 if (!yyextra->spaceBeforeCmd.isEmpty())
3584 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3585 yyextra->spaceBeforeCmd.clear();
3593 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3601 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3609 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3616 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3618 BEGIN(IRaisePrefix);
3624 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3626 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3627 if (yyextra->guards->empty())
3629 yyextra->guards->emplace(
true);
3633 bool enabled = yyextra->guards->top().isEnabled();
3634 yyextra->guards->emplace(enabled);
3642 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3644 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3645 if (yyextra->guards->empty())
3647 yyextra->guards->emplace(
true);
3651 bool enabled = yyextra->guards->top().isEnabled();
3652 yyextra->guards->emplace(enabled);
3660 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3661 if (yyextra->guards->empty())
3663 warn(yyextra->fileName,yyextra->lineNr,
3664 "found \\elseif without matching start command");
3666 else if (yyextra->guards->top().hasElse())
3668 warn(yyextra->fileName,yyextra->lineNr,
3669 "found \\elseif command after \\else command was given in \\if construct");
3671 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3672 yyextra->guards->top().setEnabled(
false);
3678 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3679 yyextra->guards->top().setEnabled(
false);
3687 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3688 if (yyextra->guards->empty())
3690 warn(yyextra->fileName,yyextra->lineNr,
3691 "found \\else without matching start command");
3693 else if (yyextra->guards->top().hasElse())
3695 warn(yyextra->fileName,yyextra->lineNr,
3696 "found multiple \\else commands in same \\if construct");
3697 yyextra->guards->top().setEnabled(
false);
3698 yyextra->guards->top().setElse();
3699 BEGIN( SkipGuardedSection );
3703 yyextra->guards->top().setElse();
3704 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3705 if (yyextra->guards->top().isEnabledFound())
3707 yyextra->guards->top().setEnabled(
false);
3708 BEGIN( SkipGuardedSection );
3712 yyextra->guards->top().setEnabled(
true);
3713 BEGIN( GuardParamEnd );
3721 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3722 if (yyextra->guards->empty())
3724 warn(yyextra->fileName,yyextra->lineNr,
3725 "found \\endif without matching start command");
3729 yyextra->guards->pop();
3731 if (!yyextra->spaceBeforeCmd.isEmpty())
3733 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3734 yyextra->spaceBeforeCmd.clear();
3736 if (yyextra->guards->empty())
3738 BEGIN( GuardParamEnd );
3742 if (yyextra->guards->top().isEnabled())
3744 BEGIN( GuardParamEnd );
3748 BEGIN( SkipGuardedSection );
3756 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3757 yyextra->inGroupParamFound=
FALSE;
3758 BEGIN( InGroupParam );
3764 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3765 yyextra->current->subGrouping =
FALSE;
3771 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3772 yyextra->current->initLines = 100000;
3778 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3779 yyextra->current->initLines = 0;
3785 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3786 yyextra->current->commandOverrides.override_callGraph(
true);
3792 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3793 yyextra->current->commandOverrides.override_callGraph(
false);
3799 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3800 yyextra->current->commandOverrides.override_callerGraph(
true);
3806 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3807 yyextra->current->commandOverrides.override_callerGraph(
false);
3813 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3814 yyextra->current->commandOverrides.override_enumValues(
true);
3820 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3821 yyextra->current->commandOverrides.override_enumValues(
false);
3827 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3828 yyextra->current->commandOverrides.override_inlineSource(
true);
3834 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3835 yyextra->current->commandOverrides.override_inlineSource(
false);
3841 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3842 yyextra->current->commandOverrides.override_includeGraph(
true);
3848 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3849 yyextra->current->commandOverrides.override_includedByGraph(
true);
3855 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3856 yyextra->current->commandOverrides.override_includeGraph(
false);
3862 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3863 yyextra->current->commandOverrides.override_includedByGraph(
false);
3869 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3870 yyextra->current->commandOverrides.override_directoryGraph(
true);
3876 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3877 yyextra->current->commandOverrides.override_directoryGraph(
false);
3883 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3884 yyextra->current->commandOverrides.override_collaborationGraph(
true);
3890 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3891 yyextra->current->commandOverrides.override_collaborationGraph(
false);
3897 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3898 yyextra->current->commandOverrides.override_groupGraph(
true);
3904 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3905 yyextra->current->commandOverrides.override_groupGraph(
false);
3911 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3912 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3913 for (
const auto &opt_ : optList)
3920 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3922 else if (opt ==
"graph")
3924 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3926 else if (opt ==
"builtin")
3928 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3930 else if (opt ==
"text")
3932 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3934 else if (opt ==
"no")
3936 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3940 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
3950 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3951 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3957 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3958 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3964 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3965 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3971 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3972 yyextra->current->commandOverrides.override_referencesRelation(
true);
3978 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3979 yyextra->current->commandOverrides.override_referencesRelation(
false);
3985 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3986 yyextra->currentCmd = cmd;
3993 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3998 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4000 yyextra->current->doc.clear();
4002 yyextra->condCount=0;
4003 BEGIN( SkipInternal );
4009 yyextra->inInternalDocs =
TRUE;
4016 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4017 yyextra->current->isStatic =
TRUE;
4023 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4024 yyextra->current->virt = Specifier::Pure;
4030 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4031 yyextra->current->protection = Protection::Private;
4037 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4038 yyextra->current->protection = yyextra->protection = Protection::Private;
4044 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4045 yyextra->current->protection = Protection::Protected;
4051 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4052 yyextra->current->protection = yyextra->protection = Protection::Protected ;
4058 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4059 yyextra->current->protection = Protection::Public;
4065 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4066 yyextra->current->protection = yyextra->protection = Protection::Public;
4072 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4073 if (yyextra->current->section.isPageDoc() ||
4074 yyextra->current->section.isMainpageDoc())
4076 for (
const auto &opt_ : optList)
4080 int i = opt.
find(
':');
4084 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4086 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4100 yyextra->current->localToc.enableHtml(level);
4102 else if (opt ==
"latex")
4104 yyextra->current->localToc.enableLatex(level);
4106 else if (opt ==
"xml")
4108 yyextra->current->localToc.enableXml(level);
4110 else if (opt ==
"docbook")
4112 yyextra->current->localToc.enableDocbook(level);
4116 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4121 if (yyextra->current->localToc.nothingEnabled())
4133 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4134 BEGIN(InheritParam);
4140 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4141 yyextra->currentCmd = cmd;
4142 BEGIN(ExtendsParam);
4148 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4149 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4155 if (!yyextra->spaceBeforeCmd.isEmpty())
4157 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4158 yyextra->spaceBeforeCmd.clear();
4166 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4168 if (!yyextra->spaceBeforeCmd.isEmpty())
4170 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4171 yyextra->spaceBeforeCmd.clear();
4179 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4180 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4186 if (!yyextra->spaceBeforeCmd.isEmpty())
4188 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4189 yyextra->spaceBeforeCmd.clear();
4192 yyextra->copyDocArg.clear();
4193 yyextra->braceCount = 0;
4202 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4203 yyextra->sectionLabel.clear();
4204 yyextra->sectionTitle.clear();
4205 yyextra->docGroup.clearHeader();
4206 yyextra->insideParBlock =
FALSE;
4213 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4215 return yyextra->current->section.isDoc();
4220 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4221 assert(maker!=
nullptr);
4223 if (yyextra->current->section.isDoc())
4229 yyextra->needNewEntry =
true;
4230 yyextra->current->section = maker();
4231 yyextra->current->fileName = yyextra->fileName;
4232 yyextra->current->startLine = yyextra->lineNr;
4233 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4246 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4247 for(
const char* c = yytext ; *c ; ++c )
4248 yyextra->lineNr += (*c ==
'\n') ;
4256 if (s==
nullptr || *s==0)
return name;
4258 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4271 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4272 if (listName.
isEmpty())
return;
4279 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4292 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4300 item = refList->
add();
4304 item->
setText(yyextra->outputXRef);
4306 yyextra->current->sli.push_back(item);
4309 if (yyextra->inBody)
4311 yyextra->current->inbodyDocs += cmdString;
4315 yyextra->current->doc += cmdString;
4325 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4327 yyextra->sectionLevel);
4328 yyextra->current->anchors.push_back(si);
4330 else if (si->
lineNr() != -1)
4332 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4337 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4343 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4345 yyextra->sectionLevel);
4346 yyextra->current->anchors.push_back(si);
4350 yyextra->outputXRef.clear();
4360 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || c==
'_' || c<0))
4364 for (
size_t i=1; i<label.
size(); i++)
4367 if (!((c>=
'a' && c<=
'z') || (c>=
'A' && c<=
'Z') || (c>=
'0' && c<=
'9') || c==
'_' || c<0))
4382 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4384 QCString formula = (yyextra->formulaPreText +
4385 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4393 formLabel.
sprintf(
"\\_form#%d",
id);
4394 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4411 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4419 if (addYYtext) yyextra->sectionTitle+=yytext;
4420 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4421 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4423 yyextra->sectionLevel);
4426 yyextra->current->anchors.push_back(si);
4428 else if (si->
lineNr() != -1)
4430 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4435 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4436 yyextra->sectionLabel,si->
fileName());
4442 if (addYYtext) yyextra->sectionTitle+=yytext;
4443 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4444 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4446 yyextra->sectionLevel);
4449 yyextra->current->anchors.push_back(si);
4458 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4460 if (yytext[0] ==
'"')
4463 name=name.
left((
int)yyleng-2);
4469static const reg::Ex nonBrief_re(R
"( *[\\@]ifile \"[^\"]*\" [\\@]iline (\d+) [\\@]ilinebr ([ \n]*))");
4479 if (c==
' ' || c==
'\t' || c==
'\r')
4502 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4503 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4505 yyextra->xrefAppendFlag = !yyextra->inBody &&
4507 yyextra->newXRefKind==yyextra->xrefKind &&
4509 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4525 switch(yyextra->xrefKind)
4557 yyextra->xrefItemTitle,
4558 yyextra->xrefListTitle,
4567 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4569 int oldContext = yyextra->inContext;
4570 yyextra->inContext = ctx;
4572 switch(yyextra->inContext)
4575 if (oldContext!=yyextra->inContext)
4578 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4579 if (yyextra->current->docFile.isEmpty())
4581 yyextra->current->docFile = yyextra->fileName;
4582 yyextra->current->docLine = yyextra->lineNr;
4585 yyextra->pOutputString = &yyextra->current->doc;
4589 if (oldContext!=yyextra->inContext)
4591 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4592 if (yyextra->current->briefFile.isEmpty())
4594 yyextra->current->briefFile = yyextra->fileName;
4595 yyextra->current->briefLine = yyextra->lineNr;
4598 bool foundMatch =
false;
4599 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4607 std::string str = yyextra->current->brief.str();
4612 for (
size_t i = 0; i <
match[2].str().size(); i++)
4614 if (match[2].str()[i] ==
'\n') cnt++;
4618 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4620 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4627 yyextra->pOutputString = &yyextra->current->brief;
4631 if (!yyextra->current->doc.isEmpty())
4633 yyextra->current->doc +=
"\n";
4635 yyextra->pOutputString = &yyextra->current->doc;
4641 yyextra->pOutputString = &yyextra->outputXRef;
4646 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4655 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4663 yyextra->current->anchors.push_back(si);
4665 else if (si->
lineNr() != -1)
4667 warn(yyextra->fileName,yyextra->lineNr,
4668 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4673 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4680 yyextra->current->anchors.push_back(si);
4687 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4689 *yyextra->pOutputString+=s;
4695 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4697 *yyextra->pOutputString+=s;
4703 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4704 *yyextra->pOutputString+=c;
4710 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4717 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4723 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4724 std::string_view str = yyextra->current->brief.view();
4729 yyextra->briefEndsAtDot=
FALSE;
4731 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4733 yyextra->current->docLine = yyextra->lineNr;
4734 yyextra->current->doc =
"";
4738 addIline(yyscanner,yyextra->lineNr);
4744 int saveLineNr = yyextra->lineNr;
4746 yyextra->current->briefLine = yyextra->lineNr;
4747 yyextra->lineNr = saveLineNr;
4753 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4754 yyextra->prevPosition=yyextra->inputPosition;
4756 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4758 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4769 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4770 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4771 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4772 YY_START==ReadFormulaLong)
4774 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4788 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4796 commentscanYYlex_destroy(
p->yyscanner);
4809 bool &newEntryNeeded,
4810 bool markdownSupport,
4814 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4816 isAutoBriefOn,isInbody,prot,markdownSupport);
4818 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4821 yyextra->guards = guards;
4822 yyextra->langParser = parser;
4823 yyextra->current = curEntry;
4824 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4826 yyextra->inputString =
comment;
4827 yyextra->inputString.append(
" ");
4828 yyextra->inputPosition = position;
4829 yyextra->lineNr = lineNr;
4830 yyextra->fileName = fileName;
4831 yyextra->protection = prot;
4832 yyextra->needNewEntry =
FALSE;
4834 yyextra->xrefAppendFlag =
FALSE;
4835 yyextra->insidePre =
FALSE;
4836 yyextra->parseMore =
FALSE;
4837 yyextra->inBody = isInbody;
4838 yyextra->markdownSupport= markdownSupport;
4839 yyextra->outputXRef.clear();
4840 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4842 yyextra->current->doc +=
'\n';
4845 yyextra->briefEndsAtDot = isAutoBriefOn;
4846 yyextra->condCount = 0;
4847 yyextra->sectionLevel = 0;
4848 yyextra->spaceBeforeCmd.clear();
4849 yyextra->spaceBeforeIf.clear();
4850 yyextra->htmlContextStack.clear();
4853 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4856 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4857 yyextra->current->inbodyDocs+=cmd;
4861 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
4864 commentscanYYrestart(
nullptr, yyscanner );
4866 commentscanYYlex(yyscanner);
4869 if (YY_START==OverloadParam)
4874 if (yyextra->insideParBlock)
4876 warn(yyextra->fileName,yyextra->lineNr,
4877 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4883 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4886 yyextra->current->doc=
"\n\n";
4889 if (yyextra->current->section.isMemberGrp() &&
4890 yyextra->docGroup.isEmpty())
4892 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4896 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
4898 yyextra->current->briefLine,yyextra->current->brief,
4899 yyextra->current->docLine,yyextra->current->doc,
4900 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
4904 prot = yyextra->protection;
4906 yyextra->docGroup.addDocs(curEntry);
4908 newEntryNeeded = yyextra->needNewEntry;
4913 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4915 if (!yyextra->parseMore && !yyextra->guards->empty())
4917 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4920 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4922 lineNr = yyextra->lineNr;
4924 position,yyextra->parseMore,newEntryNeeded);
4926 return yyextra->parseMore;
4931 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4933 bool sectionEnabled =
false;
4938 bool parentEnabled = yyextra->guards->top().parentVisible();
4942 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4943 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4947 yyextra->guards->top().setEnabled(
true);
4948 yyextra->guards->top().setEnabledFound();
4949 BEGIN( GuardParamEnd );
4953 if (yyextra->guards->top().isEnabledFound())
4955 yyextra->guards->top().setEnabled(
false);
4956 BEGIN( SkipGuardedSection );
4958 else if (sectionEnabled)
4960 yyextra->guards->top().setEnabled(
true);
4961 yyextra->guards->top().setEnabledFound();
4962 BEGIN( GuardParamEnd );
4966 yyextra->guards->top().setEnabled(
false);
4967 BEGIN( SkipGuardedSection );
4972 BEGIN( SkipGuardedSection );
4977 BEGIN( SkipGuardedSection );
4983 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4984 yyextra->docGroup.initGroupInfo(entry);
4989 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4990 yyextra->docGroup.enterFile(fileName,lineNr);
4995 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4996 yyextra->docGroup.leaveFile(fileName,lineNr);
5001 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5002 yyextra->docGroup.enterCompound(fileName,lineNr,name);
5007 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5008 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
5013 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5014 yyextra->docGroup.open(e,fileName,lineNr,implicit);
5019 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
5020 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
5023#include "commentscan.l.h"
static CitationManager & instance()
void insert(const QCString &label)
Insert a citation identified by label into the database.
Copyright (C) 1997-2015 by Dimitri van Heesch.
bool parse(const QCString &fileName, int lineNr, const QCString &expr)
Copyright (C) 1997-2015 by Dimitri van Heesch.
static bool isFlagSet(const DebugMask mask)
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
int docLine
line number at which the documentation was found
T * add(const char *k, Args &&... args)
const T * find(const std::string &key) const
bool startsWith(const char *s) const
char & at(size_t i)
Returns a reference to the character at index i.
void resize(size_t newlen)
QCString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
QCString & sprintf(const char *format,...)
This struct represents an item in the list of references.
void setAnchor(const QCString &anchor)
void setText(const QCString &text)
List of cross-referenced items.
QCString listName() const
static RefListManager & instance()
class that provide information about a section.
QCString fileName() const
singleton class that owns the list of all sections
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
SectionInfo * add(const SectionInfo &si)
static SectionManager & instance()
returns a reference to the singleton
static constexpr int Anchor
static constexpr int Section
static constexpr int MaxLevel
static constexpr int Subsection
static constexpr int Subsubsection
static constexpr int Paragraph
static constexpr int Subsubparagraph
static constexpr int Subparagraph
Class representing a regular expression.
Object representing the matching results.
#define AUTO_TRACE_EXIT(...)
Translator * theTranslator
QCString trunc(const QCString &s, size_t numChars=15)
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.