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)
Protection
Protection level of members.
A bunch of utility functions.
574TABLE ("table"|"TABLE")
584CAPTION ("caption"|"CAPTION")
585CENTER ("center"|"CENTER")
587DETAILS ("details"|"DETAILS")
588BLOCKQUOTE ("blockquote"|"BLOCKQUOTE")
589DETAILEDHTML {CENTER}|{DIV}|{PRE}|{UL}|{TABLE}|{OL}|{DL}|{P}|[Hh][1-6]|{IMG}|{HR}|{PARA}|{BLOCKQUOTE}
590DETAILEDHTMLOPT {CODE}
591DETAILEDHTMLOPTEND {ENDCODE}
592SUMMARY ("summary"|"SUMMARY")
593REMARKS ("remarks"|"REMARKS")
595ANCHTML ("id"|"name"|"ID"|"NAME")"="("\""{LABELID}"\""|"'"{LABELID}"'"|{LABELID})
600DOCNL "\n"|"\\ilinebr"
603FILESCHAR [a-z_A-Z0-9\x80-\xFF\\:\\\/\-\+=@&#~]
604FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+=@&#~]
605FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
606ID [$a-z_A-Z\x80-\xFF][$a-z_A-Z0-9\x80-\xFF]*
607LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
608CITESCHAR [a-z_A-Z0-9\x80-\xFF\-\?]
609CITEECHAR [a-z_A-Z0-9\x80-\xFF\-\+:\/\?]*
610CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*"\""
611SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
612SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
613TMPLSPEC "<"{BN}*[^>]+{BN}*">"
614MAILADDR ("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\-]+
615RCSTAG "$"{ID}":"[^\n$]+"$"
616MODULE_ID ({ID}".")*{ID}
617LINENR {Bopt}[1-9][0-9]*
618IFILELINE ("\\ifile \""[^"]*"\" \\iline "[0-9]+" "("iprefix \""[^"]*"\" ")?("iraise "[0-9]+" ")?)
670%x ReadFormulaShortSection
672%x ReadFormulaRoundSection
686%x RaiseWarningSection
715<Comment>{CMD}{CMD}[a-z_A-Z]+{B}* {
718<Comment>{CMD}{CMD}"~"[a-z_A-Z]* {
724<Comment>"\""[^"\n]*"\"" {
727<Comment>("\\"[a-z_A-Z]+)+"\\" {
730<Comment>"<"{DETAILEDHTML}{ATTR}">" {
732 int spacePos = htmlOpenTag.find(
' ');
733 if (spacePos==-1) spacePos=yyleng-1;
734 QCString htmlTagName = htmlOpenTag.
mid(1,spacePos-1);
736 yyextra->htmlContextStack.emplace_back(htmlTagName,yyextra->inContext);
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
744<Comment>"</"{DETAILEDHTML}">" {
746 QCString htmlTagName = htmlCloseTag.
mid(2,htmlCloseTag.length()-3);
748 if (!yyextra->htmlContextStack.empty() &&
749 yyextra->htmlContextStack.back().tagName==htmlTagName)
756 yyextra->htmlContextStack.pop_back();
760<Comment>"<"{DETAILEDHTMLOPT}">" {
764 yyextra->CScode=
true;
774<Comment>"<"{DETAILEDHTMLOPTEND}">" {
778 yyextra->CScode=
false;
782 yyextra->CScode=
false;
787<Comment>"<"{DETAILEDHTMLOPT}{ATTR}">" {
796<Comment>"<"{DETAILS}{ATTR}">" {
797 yyextra->htmlDetailsStack.push_back(0);
798 yyextra->htmlContextStack.emplace_back(
"details",yyextra->inContext);
805<Comment>"</"{DETAILS}">" {
806 if (!yyextra->htmlDetailsStack.empty())
808 yyextra->htmlDetailsStack.pop_back();
810 if (!yyextra->htmlContextStack.empty() &&
811 yyextra->htmlContextStack.back().tagName==
"details")
818 yyextra->htmlContextStack.pop_back();
823 yyextra->htmlAnchorStr = yytext;
824 yyextra->htmlAnchor =
false;
828 yyextra->htmlAnchorStr += yytext;
833 if (c==
'\'' || c==
'"')
835 int e=tag.find(c,s+2);
838 id=tag.mid(s+2,e-s-2);
847 if (!
id.isEmpty() && !yyextra->htmlAnchor)
853 yyextra->htmlAnchor =
true;
856<HtmlA>("\""[^\n\"]*"\""|"'"[^\n']*"'") {
857 yyextra->htmlAnchorStr += yytext;
860 if (!yyextra->htmlAnchor)
862 addOutput(yyscanner,yyextra->htmlAnchorStr);
875 yyextra->htmlAnchorStr += yytext;
876 if (*yytext ==
'\n') yyextra->lineNr++;
879 yyextra->htmlAnchorStr += yytext;
881<Comment>"<"{SUMMARY}">" {
882 if (yyextra->htmlDetailsStack.empty())
891<Comment>"<"{REMARKS}">" {
895<Comment>"</"{SUMMARY}">" {
896 if (!yyextra->htmlDetailsStack.empty())
905<Comment>"</"{REMARKS}">" {
909<Comment>"<"{CAPTION}{ATTR}">" {
911 int s=tag.find(
"id=");
915 if (c==
'\'' || c==
'"')
917 int e=tag.find(c,s+4);
927<Comment>"<"{PRE}{ATTR}">" {
928 yyextra->insidePre=
TRUE;
931<Comment>"</"{PRE}">" {
932 yyextra->insidePre=
FALSE;
942<Comment>"<!\[CDATA\[" {
945<Comment>{B}*{CMD}"endinternal"{B}* {
947 if (!yyextra->inInternalDocs)
948 warn(yyextra->fileName,yyextra->lineNr,
949 "found \\endinternal without matching \\internal"
951 yyextra->inInternalDocs =
FALSE;
#define warn(file, line, fmt,...)
953<Comment>{B}*"\\ilinebr "{B}* {
956<Comment>(\n|"\\ilinebr ")/({B}*(\n|{IFILELINE}?"\\ilinebr "))+ {
966<Comment>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
967<Comment>{B}*{CMD}[a-z_A-Z]+{B}* {
970 int idx = fullMatch.
find(
'{');
972 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
973 int idxEnd = fullMatch.
find(
"}",idx+1);
991 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
995 !(yyextra->inContext==
OutputXRef && cmdName==
"parblock"))
997 yyextra->briefEndsAtDot=
FALSE;
1003 if (it->second.handler && it->second.handler(yyscanner, cmdName, optList))
1008 yyextra->parseMore=
TRUE;
1010 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);
1013 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.
1025<Comment>{B}*({CMD}{CMD})"f"[$\[{] {
1028<Comment>{B}*{CMD}"~"[a-z_A-Z-]* {
1035 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...
1041<Comment>{B}*{CMD}"f{"[^}\n]+"}"("{"?) {
1043 yyextra->formulaText=
"";
1044 yyextra->formulaPreText=
"\\begin";
1045 yyextra->formulaPostText=
"";
1047 if (yyextra->formulaEnv.at(yyextra->formulaEnv.length()-1)==
'{')
1050 yyextra->formulaEnv=yyextra->formulaEnv.left(yyextra->formulaEnv.length()-1);
1052 yyextra->formulaPreText+=yyextra->formulaEnv;
1053 yyextra->formulaNewLines=0;
1054 BEGIN(ReadFormulaLong);
1056<Comment>{B}*{CMD}"f$" {
1057 yyextra->formulaText=
"";
1058 yyextra->formulaPreText=
"$";
1059 yyextra->formulaPostText=
"";
1060 yyextra->formulaNewLines=0;
1061 BEGIN(ReadFormulaShort);
1063<Comment>{B}*{CMD}"f(" {
1064 yyextra->formulaText=
"";
1065 yyextra->formulaPreText=
"";
1066 yyextra->formulaPostText=
"";
1067 yyextra->formulaNewLines=0;
1068 BEGIN(ReadFormulaRound);
1070<Comment>{B}*{CMD}"f[" {
1072 yyextra->formulaText=
"";
1073 yyextra->formulaPreText=
"\\[";
1074 yyextra->formulaPostText=
"";
1075 yyextra->formulaNewLines=0;
1076 BEGIN(ReadFormulaLong);
1078<Comment>{B}*{CMD}"{" {
1080 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr);
1082<Comment>{B}*{CMD}"}" {
1084 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE);
1085 yyextra->docGroup.clearHeader();
1086 yyextra->parseMore=
TRUE;
1087 yyextra->needNewEntry =
TRUE;
1088 yyextra->inputPosition=yyextra->prevPosition + (int)(yy_bp - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) + (int)strlen(yytext);
1091<Comment>{B}*{CMD}[$@\\&~<>#%] {
1094<Comment>[a-z_A-Z]+ {
1097<Comment>^{B}*"."{Bopt}/\n {
1100<Comment>^{B}*[1-9][0-9]*"."{B}+ |
1101<Comment>^{B}*[*+]{B}+ {
1102 if (!yyextra->markdownSupport)
1110 yyextra->briefEndsAtDot=
FALSE;
1116<Comment>^{B}*"-"{B}+ {
1119 yyextra->briefEndsAtDot=
FALSE;
1124<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n {
1127<Comment>{CMD}"---" {
1134 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"—");
1137 addOutput(yyscanner,yyextra->insidePre || yyextra->markdownSupport ? yytext :
"–");
1142 yyextra->briefEndsAtDot=
FALSE;
1147<Comment>[?!][a-z_A-Z0-9\(\)=<] |
1148<Comment>("."+)[a-z_A-Z0-9\)] {
1152<Comment>{CMD}[\.?!] {
1156<Comment>".\\"[ \t] {
1163<Comment>"...\\"[ \t] {
1166<Comment>"..."/[^\.] {
1169<Comment>".."[\.]?/[^ \t\n] {
1172<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1178 for (i=0;i<(yy_size_t)yyleng;)
1180 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1181 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1188 for (i=0;i<(yy_size_t)yyleng;)
1190 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1191 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1206 if (yyextra->briefEndsAtDot)
1209 yyextra->briefEndsAtDot=
FALSE;
1214 if (*yytext ==
'\n') yyextra->lineNr++;
1223<HtmlComment>"---"[!]?">"{B}* {
1224 warn(yyextra->fileName,yyextra->lineNr,
1225 "incorrect HTML end comment --->"
1228<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1229<HtmlComment>{DOCNL} {
1236<HtmlComment>[^\\\n\-]+ {
1241<CdataSection>"\]\]>" {
1244<CdataSection>{DOCNL} {
1246 if (*yytext==
'\n') yyextra->lineNr++;
1248<CdataSection>[<>&] {
1252<CdataSection>[^\\\n\]<>&]+ {
1261<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1262 yyextra->formulaPostText+=
"$";
1265 if (YY_START == ReadFormulaShort)
1271 yyextra->sectionTitle+=
" "+form;
1272 BEGIN(SectionTitle);
1275<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1278 if (YY_START == ReadFormulaRound)
1284 yyextra->sectionTitle+=
" "+form;
1285 BEGIN(SectionTitle);
1288<ReadFormulaLong>{CMD}"f]" {
1289 yyextra->formulaPostText+=
"\\]";
1293<ReadFormulaLong>{CMD}"f}" {
1294 yyextra->formulaPostText+=
"\\end";
1295 yyextra->formulaPostText+=yyextra->formulaEnv;
1299<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1300 yyextra->formulaText+=yytext;
1302<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1303 yyextra->formulaNewLines++;
1304 yyextra->formulaText+=*yytext;
1306 addIline(yyscanner,yyextra->lineNr);
1308<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1309 yyextra->formulaText+=*yytext;
1314<EnumDocArg1>{SCOPEID} {
1316 yyextra->current->name = yytext;
1323<EnumDocArg1>{DOCNL} {
1324 warn(yyextra->fileName,yyextra->lineNr,
1325 "missing argument after '\\enum'."
1335<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)
1341<NameSpaceDocArg1>{LC} {
1345<NameSpaceDocArg1>{DOCNL} {
1346 warn(yyextra->fileName,yyextra->lineNr,
1347 "missing argument after '\\namespace'."
1352<NameSpaceDocArg1>. {
1357<PackageDocArg1>{ID}("."{ID})* {
1358 yyextra->current->name = yytext;
1361<PackageDocArg1>{LC} {
1365<PackageDocArg1>{DOCNL} {
1366 warn(yyextra->fileName,yyextra->lineNr,
1367 "missing argument after \\package."
1379<ConceptDocArg1>{SCOPEID} {
1381 yyextra->current->name = yytext;
1384<ConceptDocArg1>{LC} {
1388<ConceptDocArg1>{DOCNL} {
1389 warn(yyextra->fileName,yyextra->lineNr,
1390 "missing argument after '\\concept'."
1399<ModuleDocArg1>{MODULE_ID} {
1401 yyextra->current->name = yytext;
1404<ModuleDocArg1>{LC} {
1408<ModuleDocArg1>{DOCNL} {
1409 warn(yyextra->fileName,yyextra->lineNr,
1410 "missing argument after '\\module'."
1420<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1424 BEGIN( ClassDocArg2 );
1426<ClassDocArg1>{SCOPENAME} {
1430 if (yyextra->current->section.isProtocolDoc())
1432 yyextra->current->name+=
"-p";
1435 BEGIN( ClassDocArg2 );
1437<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1441 BEGIN( ClassDocArg2 );
1443<ClassDocArg1,CategoryDocArg1>{LC} {
1447<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1448 warn(yyextra->fileName,yyextra->lineNr,
1449 "missing argument after '\\{}'.",yyextra->currentCmd
1454<ClassDocArg1,CategoryDocArg1>. {
1457<ClassDocArg2>{DOCNL} {
1461<ClassDocArg2>{FILE}|"<>" {
1462 yyextra->current->includeFile = yytext;
1463 BEGIN( ClassDocArg3 );
1472<ClassDocArg3>[<"]?{FILE}?[">]? {
1473 yyextra->current->includeName = yytext;
1480<ClassDocArg3>{DOCNL} {
1490<GroupDocArg1>{LABELID}(".html"?) {
1491 yyextra->current->name = yytext;
1495 if (yyextra->current->name.endsWith(
".html"))
1497 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1499 yyextra->current->type.clear();
1500 BEGIN(GroupDocArg2);
1502<GroupDocArg1>"\\"{B}*"\n" {
1506<GroupDocArg1>{DOCNL} {
1507 warn(yyextra->fileName,yyextra->lineNr,
1508 "missing group name after {}",
1509 yyextra->current->groupDocCmd()
1518<GroupDocArg2>"\\"{B}*"\n" {
1522<GroupDocArg2>[^\n\\]+ {
1523 yyextra->current->type += yytext;
1524 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1526<GroupDocArg2>{DOCNL}+ {
1528 yyextra->current->type.isEmpty()
1531 warn(yyextra->fileName,yyextra->lineNr,
1532 "missing title after "
1533 "\\defgroup {}", yyextra->current->name
1537 int extraLineNr = 0;
1540 for (
int i = 0; i < yyleng; i++)
1542 if (yytext[i]==
'\n') extraLineNr++;
1549 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1550 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1555 yyextra->current->type += yytext;
1556 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1561<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1565 int start = text.
find(
'{');
1566 int end = text.
find(
'}',start+1);
1567 yyextra->current->name = text.
mid(
end+2);
1568 int istart = yyextra->current->name.
find(
"\\ilinebr");
1571 QCString rest = yyextra->current->name.
mid(istart);
1573 yyextra->current->name = yyextra->current->name.mid(0,istart);
1575 yyextra->current->args = text.
mid(start+1,
end-start-1);
1577 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1579<PageDocArg1>{FILE} {
1581 yyextra->current->args =
"";
1582 BEGIN( PageDocArg2 );
1584<PageDocArg1>{LC} { yyextra->lineNr++;
1587<PageDocArg1>{DOCNL} {
1588 warn(yyextra->fileName,yyextra->lineNr,
1589 "missing argument after \\page."
1598<PageDocArg2>{DOCNL} {
1602 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1603 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1606<PageDocArg2>{CMD}[<>] {
1611 yyextra->current->args += tmp;
1614 yyextra->current->args += yytext;
1617<ParamArg1>{ID}/{B}*"," {
1624 if (*yytext==
'\n') yyextra->lineNr++;
1638<FileDocArg1>{DOCNL} {
1644<FileDocArg1>{FILE} {
1648<FileDocArg1>{LC} { yyextra->lineNr++;
1656<XRefItemParam1>{LABELID} {
1657 yyextra->newXRefItemKey=yytext;
1659 BEGIN(XRefItemParam2);
1661<XRefItemParam1>{LC} {
1665<XRefItemParam1>{DOCNL} {
1666 warn(yyextra->fileName,yyextra->lineNr,
1667 "Missing first argument of \\xrefitem"
1669 if (*yytext==
'\n') yyextra->lineNr++;
1677<XRefItemParam2>"\""[^\n\"]*"\"" {
1679 BEGIN(XRefItemParam3);
1681<XRefItemParam2>{LC} {
1685<XRefItemParam2>{DOCNL} {
1686 warn(yyextra->fileName,yyextra->lineNr,
1687 "Missing second argument of \\xrefitem"
1689 if (*yytext==
'\n') yyextra->lineNr++;
1697<XRefItemParam3>"\""[^\n\"]*"\"" {
1702<XRefItemParam2,XRefItemParam3>{LC} {
1706<XRefItemParam3>{DOCNL} {
1707 warn(yyextra->fileName,yyextra->lineNr,
1708 "Missing third argument of \\xrefitem"
1710 if (*yytext==
'\n') yyextra->lineNr++;
1721<RelatesParam1>({ID}("::"|"."))*{ID} {
1722 yyextra->current->relates = yytext;
1729<RelatesParam1>{LC} {
1733<RelatesParam1>{DOCNL} {
1734 warn(yyextra->fileName,yyextra->lineNr,
1735 "Missing argument of '\\{}' command",yyextra->currentCmd
1747<Qualifier>{LABELID} {
1748 yyextra->current->qualifiers.emplace_back(yytext);
1751<Qualifier>"\""[^\"]*"\"" {
1752 std::string inp(yytext);
1753 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1757 warn(yyextra->fileName,yyextra->lineNr,
1758 "Missing argument of '\\{}' command",yyextra->currentCmd
1764 warn(yyextra->fileName,yyextra->lineNr,
1765 "Argument of '\\{}' command should be quoted",yyextra->currentCmd
1771<ILine>{LINENR}/[\\@\n\.] |
1777 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '{}' for iline command",yytext);
1781 yyextra->lineNr = nr;
1784 if (YY_START == ILine)
1790 yyextra->sectionTitle+=yytext;
1791 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1794<ILine,ILineSection>. {
1796 if (YY_START == ILine)
1802 yyextra->sectionTitle+=yytext;
1803 BEGIN(SectionTitle);
1808<IRaise>{B}*[0-9]+/[\\@\n\.] |
1809<IRaise>{B}*[0-9]+{B} {
1814 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '{}' for iraise command",yytext);
1818 yyextra->raiseLevel = nr;
1828<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1842<IFile,IFileSection>{FILE} {
1845 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1846 else yyextra->fileName = yytext;
1847 if (YY_START == IFile)
1853 yyextra->sectionTitle+=yytext;
1854 BEGIN(SectionTitle);
1858<LinkSection>[^\\@\n]* {
1859 yyextra->sectionTitle+=yytext;
1861<LinkSection>{CMD}{CMD} {
1862 yyextra->sectionTitle+=yytext;
1864<LinkSection>{DOCNL} {
1866 if (*yytext ==
'\n') yyextra->lineNr++;
1867 yyextra->sectionTitle+=yytext;
1869<LinkSection>{CMD}"endlink" {
1870 yyextra->sectionTitle+=yytext;
1871 BEGIN(SectionTitle);
1874 yyextra->sectionTitle+=yytext;
1876<LinkSection><<EOF>> {
1877 warn(yyextra->fileName,yyextra->lineNr,
1878 "reached end of comment while inside a '\\link' command, missing '\\endlink' command"
1884<LineParam>{CMD}{CMD} {
1897<LineParam>({CMD}{CMD}){ID} {
1906<SectionLabel>{LABELID} {
1907 yyextra->sectionLabel=yyextra->raisePrefix+yytext;
1908 addOutput(yyscanner,yyextra->sectionLabel.data());
1909 yyextra->sectionTitle.clear();
1910 BEGIN(SectionTitle);
1912<SectionLabel>{DOCNL} {
1913 warn(yyextra->fileName,yyextra->lineNr,
1914 "\\section command has no label"
1916 if (*yytext==
'\n') yyextra->lineNr++;
1921 warn(yyextra->fileName,yyextra->lineNr,
1922 "Invalid or missing section label"
1926<SectionTitle>{STAopt}/"\n" {
1931<SectionTitle>{STopt}"\\\\ilinebr" {
1932 yyextra->sectionTitle+=yytext;
1934<SectionTitle>{STopt}/"\\ilinebr" {
1939<SectionTitle>{B}*{CMD}"f$" {
1940 yyextra->formulaText=
"";
1941 yyextra->formulaPreText=
"$";
1942 yyextra->formulaPostText=
"";
1943 yyextra->formulaNewLines=0;
1944 BEGIN(ReadFormulaShortSection);
1946<SectionTitle>{B}*{CMD}"f(" {
1947 yyextra->formulaText=
"";
1948 yyextra->formulaPreText=
"";
1949 yyextra->formulaPostText=
"";
1950 yyextra->formulaNewLines=0;
1951 BEGIN(ReadFormulaRoundSection);
1953<SectionTitle>{B}*{CMD}"~"[a-z_A-Z-]* |
1954<SectionTitle>{B}*{CMD}"f"[\[{] {
1958 warn(yyextra->fileName,yyextra->lineNr,
1959 "'\\{}' command is not allowed in section title, ending section title.",
1969<SectionTitle>[^\n@\\]* {
1970 yyextra->sectionTitle+=yytext;
1973<SectionTitle>{B}*{CMD}{CMD} {
1974 yyextra->sectionTitle+=yytext;
1977<SectionTitle>{B}*{CMD}[a-z_A-Z]+"{"[^}]*"}"{B}* |
1978<SectionTitle>{B}*{CMD}[a-z_A-Z]+{B}* {
1980 int idx = fullMatch.
find(
'{');
1982 if ((idx > 1) && (yytext[idx-1] ==
'f') && (yytext[idx-2] ==
'\\' || yytext[idx-2] ==
'@')) REJECT;
1983 int idxEnd = fullMatch.
find(
"}",idx+1);
1999 switch (it->second.sectionHandling)
2004 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2005 yyextra->sectionTitle+=fullMatch.
left(i);
2006 yyextra->sectionTitle+=
'@';
2007 yyextra->sectionTitle+=fullMatch.
mid(i);
2011 warn(yyextra->fileName,yyextra->lineNr,
2012 "'\\{}' command is not allowed in section title, escaping command.",cmdName
2020 warn(yyextra->fileName,yyextra->lineNr,
2021 "'\\{}' command is not allowed in section title, ending section title.",cmdName
2029 if (cmdName ==
"fileinfo")
2032 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2033 yyextra->sectionTitle+=fullMatch.
left(i);
2038 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2043 yyextra->sectionTitle+=fullMatch.
mid(idxEnd+1);
2047 else if (cmdName ==
"lineinfo")
2050 while (yytext[i]==
' ' || yytext[i]==
'\t') i++;
2051 yyextra->sectionTitle+=fullMatch.
left(i);
2053 yyextra->sectionTitle+=
' ';
2054 yyextra->sectionTitle+=fullMatch.
mid(i+9);
2060 else if (cmdName ==
"raisewarning")
2062 yyextra->raiseWarning =
"";
2063 BEGIN(RaiseWarningSection);
2065 else if (cmdName ==
"noop")
2070 else if (cmdName ==
"cite")
2072 yyextra->sectionTitle+=yytext;
2074 BEGIN(CiteLabelSection);
2076 else if (cmdName ==
"iline")
2078 yyextra->sectionTitle+=yytext;
2080 BEGIN(ILineSection);
2082 else if (cmdName ==
"ifile")
2084 yyextra->sectionTitle+=yytext;
2086 BEGIN(IFileSection);
2088 else if ((cmdName ==
"anchor") || (cmdName ==
"ianchor"))
2091 if (optList.empty())
2093 yyextra -> anchorTitle =
"";
2098 yyextra -> anchorTitle =
join(optList,
" ");
2101 BEGIN(AnchorLabelSection);
2103 else if (cmdName ==
"link")
2105 yyextra->sectionTitle+=yytext;
2110 yyextra->sectionTitle+=yytext;
2111 warn(yyextra->fileName,yyextra->lineNr,
2112 "internal error '\\{}' command is to be replaced in section title.",cmdName
2119 yyextra->sectionTitle+=yytext;
2127 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
2132 yyextra->sectionTitle+=yytext;
2138<SubpageLabel>{FILE} {
2143 BEGIN(SubpageTitle);
2145<SubpageLabel>{DOCNL} {
2146 warn(yyextra->fileName,yyextra->lineNr,
2147 "\\subpage command has no label"
2149 if (*yytext==
'\n') yyextra->lineNr++;
2157<SubpageTitle>{DOCNL} {
2161<SubpageTitle>[ \t]*"\""[^\"\n]*"\"" {
2172<AnchorLabel,AnchorLabelSection>{LABELID} {
2173 QCString lbl = yyextra->raisePrefix+yytext;
2174 addAnchor(yyscanner,lbl, yyextra->anchorTitle);
2176 if (YY_START == AnchorLabel)
2182 BEGIN(SectionTitle);
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
2185<AnchorLabel,AnchorLabelSection>{DOCNL} {
2186 warn(yyextra->fileName,yyextra->lineNr,
2187 "\\anchor command has no label"
2189 if (*yytext==
'\n') yyextra->lineNr++;
2191 if (YY_START == AnchorLabel)
2197 BEGIN(SectionTitle);
2200<AnchorLabel,AnchorLabelSection>. {
2201 warn(yyextra->fileName,yyextra->lineNr,
2202 "Invalid or missing anchor label"
2205 if (YY_START == AnchorLabel)
2211 BEGIN(SectionTitle);
2218<FormatBlock>{CMD}("endverbatim"|"endiverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"enddot"|"endcode"|"endicode"|"endmsc")/{NW} {
2220 if (&yytext[4]==yyextra->blockName)
2225<FormatBlock>{CMD}"enduml" {
2227 if (yyextra->blockName==
"startuml")
2232<FormatBlock>[^ \@\*\/\\\n]* {
2235<FormatBlock>{DOCNL} {
2236 if (*yytext==
'\n') yyextra->lineNr++;
2240 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2241 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2242 yyextra->blockName==
"iliteral"
2244 ) yyextra->commentCount++;
2249 if (!(yyextra->blockName==
"code" || yyextra->blockName==
"verbatim" ||
2250 yyextra->blockName==
"icode" || yyextra->blockName==
"iverbatim"||
2251 yyextra->blockName==
"iliteral"
2255 yyextra->commentCount--;
2256 if (yyextra->commentCount<0)
2258 QCString endTag =
"end"+yyextra->blockName;
2259 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2260 warn(yyextra->fileName,yyextra->lineNr,
2261 "found */ without matching /* while inside a \\{} block! Perhaps a missing \\{}?",
2262 yyextra->blockName,endTag);
2269<FormatBlock><<EOF>> {
2270 QCString endTag =
"end"+yyextra->blockName;
2271 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2272 warn(yyextra->fileName,yyextra->lineNr,
2273 "reached end of comment while inside a \\{} block; check for missing \\{} tag!",
2274 yyextra->blockName,endTag
2281<GuardParam>{B}*"(" {
2282 yyextra->guardExpr=yytext;
2283 yyextra->roundCount=1;
2287 yyextra->guardExpr+=yytext;
2291 yyextra->guardExpr+=yytext;
2292 yyextra->roundCount++;
2295 yyextra->guardExpr+=yytext;
2296 yyextra->roundCount--;
2297 if (yyextra->roundCount==0)
2303 warn(yyextra->fileName,yyextra->lineNr,
2304 "invalid expression '{}' for yyextra->guards",yyextra->guardExpr);
2308<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2311<GuardParam>{DOCNL} {
2326<GuardParamEnd>{B}*{DOCNL} {
2328 yyextra->spaceBeforeIf.clear();
2332<GuardParamEnd>{B}* {
2333 if (!yyextra->spaceBeforeIf.isEmpty())
2335 addOutput(yyscanner,yyextra->spaceBeforeIf);
2337 yyextra->spaceBeforeIf.clear();
2349<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2351 yyextra->guards->emplace(
false);
2352 BEGIN( GuardParam );
2354<SkipGuardedSection>{CMD}"if"/{NW} {
2356 yyextra->guards->emplace(
false);
2357 BEGIN( GuardParam );
2359<SkipGuardedSection>{CMD}"endif"/{NW} {
2360 if (yyextra->guards->empty())
2362 warn(yyextra->fileName,yyextra->lineNr,
2363 "found \\endif without matching start command");
2368 yyextra->guards->pop();
2369 if (yyextra->guards->empty())
2371 BEGIN( GuardParamEnd );
2375 if (yyextra->guards->top().isEnabled())
2377 BEGIN( GuardParamEnd );
2381 BEGIN( SkipGuardedSection );
2386<SkipGuardedSection>{CMD}"else"/{NW} {
2387 if (yyextra->guards->empty())
2389 warn(yyextra->fileName,yyextra->lineNr,
2390 "found \\else without matching start command");
2392 else if (yyextra->guards->top().hasElse())
2394 warn(yyextra->fileName,yyextra->lineNr,
2395 "found multiple \\else commands in same \\if construct");
2396 yyextra->guards->top().setEnabled(
false);
2397 BEGIN( SkipGuardedSection );
2399 else if (!yyextra->guards->top().parentVisible())
2401 yyextra->guards->top().setEnabled(
false);
2402 BEGIN( SkipGuardedSection );
2406 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2407 yyextra->guards->top().setElse();
2408 if (!yyextra->guards->top().parentVisible())
2410 yyextra->guards->top().setEnabled(
false);
2411 BEGIN( SkipGuardedSection );
2413 else if (yyextra->guards->top().isEnabledFound())
2415 yyextra->guards->top().setEnabled(
false);
2416 BEGIN( SkipGuardedSection );
2420 yyextra->guards->top().setEnabled(
true);
2421 BEGIN( GuardParamEnd );
2425<SkipGuardedSection>{CMD}"elseif"/{NW} {
2426 if (yyextra->guards->empty())
2428 warn(yyextra->fileName,yyextra->lineNr,
2429 "found \\elseif without matching start command");
2431 else if (yyextra->guards->top().hasElse())
2433 warn(yyextra->fileName,yyextra->lineNr,
2434 "found \\elseif command after \\else command was given in \\if construct");
2436 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2437 yyextra->guards->top().setEnabled(
false);
2438 BEGIN( GuardParam );
2443 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2444 yyextra->guards->top().setEnabled(
false);
2445 BEGIN( GuardParam );
2448<SkipGuardedSection>{DOCNL} {
2449 if (*yytext==
'\n') yyextra->lineNr++;
2452<SkipGuardedSection>[^ \\@\n]+ {
2454<SkipGuardedSection>{CMD}{CMD} |
2455<SkipGuardedSection>. {
2461<SkipInternal>{DOCNL} {
2462 if (*yytext==
'\n') yyextra->lineNr++;
2465<SkipInternal>[@\\]"if"/[ \t] {
2466 yyextra->condCount++;
2468<SkipInternal>[@\\]"ifnot"/[ \t] {
2469 yyextra->condCount++;
2471<SkipInternal>[@\\]/"endif" {
2472 yyextra->condCount--;
2473 if (yyextra->condCount<0)
2479<SkipInternal>[@\\]/"section"[ \t] {
2480 if (yyextra->sectionLevel>0)
2486<SkipInternal>[@\\]/"subsection"[ \t] {
2487 if (yyextra->sectionLevel>1)
2493<SkipInternal>[@\\]/"subsubsection"[ \t] {
2494 if (yyextra->sectionLevel>2)
2500<SkipInternal>[@\\]/"paragraph"[ \t] {
2501 if (yyextra->sectionLevel>3)
2507<SkipInternal>[@\\]/"subparagraph"[ \t] {
2508 if (yyextra->sectionLevel>4)
2514<SkipInternal>[@\\]/"subsubparagraph"[ \t] {
2515 if (yyextra->sectionLevel>5)
2521<SkipInternal>[@\\]"endinternal"[ \t]* {
2524<SkipInternal>[^ \\@\n]+ {
2541 yyextra->docGroup.appendHeader(
' ');
2544 yyextra->docGroup.appendHeader(*yytext);
2545 yyextra->current->name+=*yytext;
2560<RaiseWarning,RaiseWarningSection>{DOCNL} {
2562 "{}",yyextra->raiseWarning);
2563 yyextra->raiseWarning =
"";
2564 if (*yytext==
'\n') yyextra->lineNr++;
2566 if (YY_START == RaiseWarning)
2572 yyextra->sectionTitle+=yytext;
2573 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2576<RaiseWarning,RaiseWarningSection>. {
2577 yyextra->raiseWarning += yytext;
2581<InGroupParam>{LABELID} {
2582 yyextra->current->groups.emplace_back(
2585 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2587<InGroupParam>{DOCNL} {
2588 if (!yyextra->inGroupParamFound)
2590 warn(yyextra->fileName,yyextra->lineNr,
2591 "Missing group name for \\ingroup command"
2610 if (yyextra->braceCount==0)
2612 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2614 warn(yyextra->fileName,yyextra->lineNr,
2615 "missing argument after '\\{}'.",yyextra->currentCmd
2621 yyextra->langParser->parsePrototype(yyextra->functionProto);
2629 yyextra->functionProto+=
' ';
2631<FnParam>[^@\\\n()]+ {
2632 yyextra->functionProto+=yytext;
2635 yyextra->functionProto+=yytext;
2636 yyextra->braceCount++;
2639 yyextra->functionProto+=yytext;
2640 yyextra->braceCount--;
2643 yyextra->functionProto+=*yytext;
2650<OverloadParam>{DOCNL} {
2651 if (*yytext==
'\n') yyextra->lineNr++;
2652 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2660 yyextra->langParser->parsePrototype(yyextra->functionProto);
QCString getOverloadDocs()
2664<OverloadParam>{LC} {
2666 yyextra->functionProto+=
' ';
2669 yyextra->functionProto+=*yytext;
2674<InheritParam>({ID}("::"|"."))*{ID} {
2675 yyextra->current->extends.emplace_back(
2680<InheritParam>{DOCNL} {
2681 warn(yyextra->fileName,yyextra->lineNr,
2682 "\\inherit command has no argument"
2684 if (*yytext==
'\n') yyextra->lineNr++;
2689 warn(yyextra->fileName,yyextra->lineNr,
2690 "Invalid or missing name for \\inherit command"
2697<ExtendsParam>({ID}("::"|"."))*{ID} {
2698 yyextra->current->extends.emplace_back(
2703<ExtendsParam>{DOCNL} {
2704 warn(yyextra->fileName,yyextra->lineNr,
2705 "'\\{}' command has no argument",yyextra->currentCmd
2717<SkipLang>[\\@]"~"[a-zA-Z-]* {
2721 warn(yyextra->fileName,yyextra->lineNr,
2730<SkipLang>[^*@\\\n]* {
2733 if (*yytext==
'\n') yyextra->lineNr++;
2740<CiteLabel,CiteLabelSection>{CITEID} {
2743 if (YY_START == CiteLabel)
2749 yyextra->sectionTitle+=yytext;
2750 BEGIN(SectionTitle);
2753<CiteLabel,CiteLabelSection>{DOCNL} {
2754 warn(yyextra->fileName,yyextra->lineNr,
2755 "\\cite command has no label"
2759 if (YY_START == CiteLabel)
2766 yyextra->sectionTitle+=yytext;
2768 BEGIN(SectionTitle);
2771<CiteLabel,CiteLabelSection>. {
2772 warn(yyextra->fileName,yyextra->lineNr,
2773 "Invalid or missing cite label"
2775 if (YY_START == CiteLabel)
2781 yyextra->sectionTitle+=yytext;
2782 BEGIN(SectionTitle);
2790 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2791 addOutput(yyscanner,yyextra->copyDocArg);
2796 if (*yytext==
'\n') yyextra->lineNr++;
2797 if (yyextra->braceCount==0)
2800 addOutput(yyscanner,
" \\ilinebr\\ilinebr\\copydetails ");
2801 addOutput(yyscanner,yyextra->copyDocArg);
2809<CopyDoc>[^@\\\n()]+ {
2810 yyextra->copyDocArg+=yytext;
2814 yyextra->copyDocArg+=yytext;
2816 yyextra->braceCount++;
2819 yyextra->copyDocArg+=yytext;
2821 yyextra->braceCount--;
2824 yyextra->copyDocArg+=yytext;
2846 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2847 yyextra->braceCount=0;
2848 yyextra->functionProto.clear();
2849 yyextra->currentCmd = cmd;
2850 yyextra->currentMakeEntryType = EntryType::makeMemberDoc;
2857 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2858 yyextra->functionProto.clear();
2859 yyextra->braceCount=0;
2860 yyextra->currentCmd = cmd;
2861 yyextra->currentMakeEntryType = EntryType::makeDefineDoc;
2868 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2869 yyextra->functionProto.clear();
2870 BEGIN(OverloadParam);
2876 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2877 yyextra->currentMakeEntryType = EntryType::makeEnumDoc;
2878 BEGIN( EnumDocArg1 );
2884 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2887 BEGIN( GroupDocArg1 );
2893 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2896 BEGIN( GroupDocArg1 );
2902 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2905 BEGIN( GroupDocArg1 );
2911 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2912 yyextra->currentMakeEntryType = EntryType::makeNamespaceDoc;
2913 BEGIN( NameSpaceDocArg1 );
2919 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2921 BEGIN( PackageDocArg1 );
2927 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2928 yyextra->currentCmd = cmd;
2929 yyextra->currentMakeEntryType = EntryType::makeClassDoc;
2930 BEGIN( ClassDocArg1 );
2936 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2937 yyextra->currentCmd = cmd;
2938 yyextra->currentMakeEntryType = EntryType::makeConceptDoc;
2939 BEGIN( ConceptDocArg1 );
2945 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2946 yyextra->currentCmd = cmd;
2947 yyextra->currentMakeEntryType = EntryType::makeModuleDoc;
2948 BEGIN( ModuleDocArg1 );
2954 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2955 BEGIN( ClassDocArg2 );
2961 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2962 yyextra->currentCmd = cmd;
2963 yyextra->currentMakeEntryType = EntryType::makeProtocolDoc;
2964 BEGIN( ClassDocArg1 );
2970 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2971 yyextra->currentCmd = cmd;
2972 yyextra->currentMakeEntryType = EntryType::makeCategoryDoc;
2973 BEGIN( CategoryDocArg1 );
2979 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2980 yyextra->currentCmd = cmd;
2981 yyextra->currentMakeEntryType = EntryType::makeUnionDoc;
2982 BEGIN( ClassDocArg1 );
2988 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2989 yyextra->currentCmd = cmd;
2990 yyextra->currentMakeEntryType = EntryType::makeStructDoc;
2991 BEGIN( ClassDocArg1 );
2997 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
2998 yyextra->currentCmd = cmd;
2999 yyextra->currentMakeEntryType = EntryType::makeInterfaceDoc;
3000 BEGIN( ClassDocArg1 );
3006 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3007 yyextra->currentCmd = cmd;
3008 yyextra->currentMakeEntryType = EntryType::makeExceptionDoc;
3009 BEGIN( ClassDocArg1 );
3015 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3017 BEGIN( PageDocArg1 );
3023 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3027 yyextra->current->name =
"mainpage";
3030 BEGIN( PageDocArg2 );
3036 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3040 yyextra->current->name = yyextra->fileName;
3042 BEGIN( FileDocArg1 );
3048 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3058 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3066 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3068 if (!stop) yyextra->current->name = yyextra->fileName;
3069 BEGIN( FileDocArg1 );
3075 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3077 for (
const auto &opt : optList)
3081 sectionMaker=EntryType::makeExampleLineno;
3085 warn(yyextra->fileName,yyextra->lineNr,
3086 "unsupported option '{}' for command '\\{}'",opt,cmd);
3090 if (!stop) yyextra->current->name = yyextra->fileName;
3091 BEGIN( FileDocArg1 );
3097 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3100 addOutput(yyscanner,
" \\ilinebr\\ilinebr ");
3109 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3110 yyextra->raiseWarning =
"";
3111 BEGIN( RaiseWarning );
3117 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3124 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3128 yyextra->docGroup.clearHeader();
3130 if (!yyextra->docGroup.isEmpty())
3132 yyextra->docGroup.close(yyextra->current,yyextra->fileName,yyextra->lineNr,
TRUE,
true);
3140 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3149 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3158 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3167 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3176 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3178 BEGIN(XRefItemParam1);
3184 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3185 if (yyextra->insideParBlock)
3187 warn(yyextra->fileName,yyextra->lineNr,
3188 "found \\parblock command while already in a parblock!");
3190 if (!yyextra->spaceBeforeCmd.isEmpty())
3192 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3193 yyextra->spaceBeforeCmd.clear();
3196 yyextra->insideParBlock =
TRUE;
3202 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3203 if (!yyextra->insideParBlock)
3205 warn(yyextra->fileName,yyextra->lineNr,
3206 "found \\endparblock command without matching \\parblock!");
3210 yyextra->insideParBlock =
FALSE;
3216 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3217 if (!yyextra->current->relates.isEmpty())
3219 warn(yyextra->fileName,yyextra->lineNr,
3220 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3223 yyextra->currentCmd = cmd;
3224 BEGIN(RelatesParam1);
3230 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3231 if (!yyextra->current->relates.isEmpty())
3233 warn(yyextra->fileName,yyextra->lineNr,
3234 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3237 yyextra->currentCmd = cmd;
3238 BEGIN(RelatesParam1);
3244 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3245 if (!yyextra->current->relates.isEmpty())
3247 warn(yyextra->fileName,yyextra->lineNr,
3248 "found multiple \\relates, \\relatesalso or \\memberof commands in a comment block, using last definition");
3251 yyextra->currentCmd = cmd;
3252 BEGIN(RelatesParam1);
3258 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3266 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3269 BEGIN(SectionLabel);
3278 yyextra->sectionLevel = std::min(yyextra->sectionLevel + yyextra->raiseLevel,
SectionType::MaxLevel);
3280 switch (yyextra->sectionLevel)
3288 default:
addOutput(yyscanner,
"@"+s+
" ");
break;
3295 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3296 if (!yyextra->current->section.isEmpty() &&
3297 !yyextra->current->section.isPageDoc() &&
3298 !yyextra->current->section.isMainpageDoc()
3301 warn(yyextra->fileName,yyextra->lineNr,
3302 "found \\subpage command in a comment block that is not marked as a page!");
3304 if (!yyextra->spaceBeforeCmd.isEmpty())
3306 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3307 yyextra->spaceBeforeCmd.clear();
3310 BEGIN(SubpageLabel);
3316 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3318 if (optList.empty())
3320 yyextra -> anchorTitle =
"";
3324 yyextra -> anchorTitle =
join(optList,
" ");
3332 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3333 for (
const auto &opt : optList)
3343 if (optList.empty())
3357 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3358 if (!yyextra->spaceBeforeCmd.isEmpty())
3360 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3361 yyextra->spaceBeforeCmd.clear();
3370 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3371 if (!yyextra->spaceBeforeCmd.isEmpty())
3373 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3374 yyextra->spaceBeforeCmd.clear();
3376 if (optList.empty())
3385 yyextra->blockName=s;
3386 yyextra->commentCount=0;
3393 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3410 static std::unordered_map<std::string,OutputWriter> options =
3415 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3416 yyextra->sectionTitle+=fi.baseName();
3422 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3423 yyextra->sectionTitle+=fi.extension(
true);
3429 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3430 yyextra->sectionTitle+=fi.fileName();
3436 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3437 yyextra->sectionTitle+=fi.dirPath();
3443 struct yyguts_t *yyg = (
struct yyguts_t*)s;
3444 yyextra->sectionTitle+=fi.absFilePath();
3449 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3450 if (!yyextra->spaceBeforeCmd.isEmpty())
3452 if (isSection) yyextra->sectionTitle+=yyextra->spaceBeforeCmd;
3453 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3454 yyextra->spaceBeforeCmd.clear();
3457 FileInfo fi(yyextra->fileName.str());
3458 for (
const auto &opt_ : optList)
3461 std::string opt = optStripped.
lower().
str();
3462 auto it = options.find(opt);
3463 if (it != options.end())
3467 warn(yyextra->fileName,yyextra->lineNr,
"Multiple options specified with \\fileinfo, discarding '{}'", optStripped);
3471 it->second(yyscanner,fi,isSection);
3477 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '{}'", optStripped);
3484 if (isSection) yyextra->sectionTitle+=
stripFromPath(yyextra->fileName);
3489 if (isSection) yyextra->sectionTitle+=yyextra->fileName;
3498 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3499 if (!yyextra->spaceBeforeCmd.isEmpty())
3501 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3502 yyextra->spaceBeforeCmd.clear();
3510 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3518 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3526 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3533 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3535 BEGIN(IRaisePrefix);
3541 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3543 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3544 if (yyextra->guards->empty())
3546 yyextra->guards->emplace(
true);
3550 bool enabled = yyextra->guards->top().isEnabled();
3551 yyextra->guards->emplace(enabled);
3559 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3561 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3562 if (yyextra->guards->empty())
3564 yyextra->guards->emplace(
true);
3568 bool enabled = yyextra->guards->top().isEnabled();
3569 yyextra->guards->emplace(enabled);
3577 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3578 if (yyextra->guards->empty())
3580 warn(yyextra->fileName,yyextra->lineNr,
3581 "found \\elseif without matching start command");
3583 else if (yyextra->guards->top().hasElse())
3585 warn(yyextra->fileName,yyextra->lineNr,
3586 "found \\elseif command after \\else command was given in \\if construct");
3588 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3589 yyextra->guards->top().setEnabled(
false);
3595 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3596 yyextra->guards->top().setEnabled(
false);
3604 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3605 if (yyextra->guards->empty())
3607 warn(yyextra->fileName,yyextra->lineNr,
3608 "found \\else without matching start command");
3610 else if (yyextra->guards->top().hasElse())
3612 warn(yyextra->fileName,yyextra->lineNr,
3613 "found multiple \\else commands in same \\if construct");
3614 yyextra->guards->top().setEnabled(
false);
3615 yyextra->guards->top().setElse();
3616 BEGIN( SkipGuardedSection );
3620 yyextra->guards->top().setElse();
3621 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
3622 if (yyextra->guards->top().isEnabledFound())
3624 yyextra->guards->top().setEnabled(
false);
3625 BEGIN( SkipGuardedSection );
3629 yyextra->guards->top().setEnabled(
true);
3630 BEGIN( GuardParamEnd );
3638 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3639 if (yyextra->guards->empty())
3641 warn(yyextra->fileName,yyextra->lineNr,
3642 "found \\endif without matching start command");
3646 yyextra->guards->pop();
3648 if (!yyextra->spaceBeforeCmd.isEmpty())
3650 addOutput(yyscanner,yyextra->spaceBeforeCmd);
3651 yyextra->spaceBeforeCmd.clear();
3653 if (yyextra->guards->empty())
3655 BEGIN( GuardParamEnd );
3659 if (yyextra->guards->top().isEnabled())
3661 BEGIN( GuardParamEnd );
3665 BEGIN( SkipGuardedSection );
3673 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3674 yyextra->inGroupParamFound=
FALSE;
3675 BEGIN( InGroupParam );
3681 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3682 yyextra->current->subGrouping =
FALSE;
3688 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3689 yyextra->current->initLines = 100000;
3695 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3696 yyextra->current->initLines = 0;
3702 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3703 yyextra->current->commandOverrides.override_callGraph(
true);
3709 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3710 yyextra->current->commandOverrides.override_callGraph(
false);
3716 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3717 yyextra->current->commandOverrides.override_callerGraph(
true);
3723 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3724 yyextra->current->commandOverrides.override_callerGraph(
false);
3730 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3731 yyextra->current->commandOverrides.override_enumValues(
true);
3737 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3738 yyextra->current->commandOverrides.override_enumValues(
false);
3744 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3745 yyextra->current->commandOverrides.override_inlineSource(
true);
3751 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3752 yyextra->current->commandOverrides.override_inlineSource(
false);
3758 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3759 yyextra->current->commandOverrides.override_includeGraph(
true);
3765 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3766 yyextra->current->commandOverrides.override_includedByGraph(
true);
3772 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3773 yyextra->current->commandOverrides.override_includeGraph(
false);
3779 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3780 yyextra->current->commandOverrides.override_includedByGraph(
false);
3786 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3787 yyextra->current->commandOverrides.override_directoryGraph(
true);
3793 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3794 yyextra->current->commandOverrides.override_directoryGraph(
false);
3800 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3801 yyextra->current->commandOverrides.override_collaborationGraph(
true);
3807 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3808 yyextra->current->commandOverrides.override_collaborationGraph(
false);
3814 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3815 yyextra->current->commandOverrides.override_groupGraph(
true);
3821 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3822 yyextra->current->commandOverrides.override_groupGraph(
false);
3828 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3829 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3830 for (
const auto &opt_ : optList)
3837 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::YES);
3839 else if (opt ==
"graph")
3841 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::GRAPH);
3843 else if (opt ==
"builtin")
3845 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::BUILTIN);
3847 else if (opt ==
"text")
3849 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::TEXT);
3851 else if (opt ==
"no")
3853 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3857 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\inheritancegraph: '{}'",
3867 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3868 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3874 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3875 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3881 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3882 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3888 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3889 yyextra->current->commandOverrides.override_referencesRelation(
true);
3895 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3896 yyextra->current->commandOverrides.override_referencesRelation(
false);
3902 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3903 yyextra->currentCmd = cmd;
3910 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3915 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
3917 yyextra->current->doc.clear();
3919 yyextra->condCount=0;
3920 BEGIN( SkipInternal );
3926 yyextra->inInternalDocs =
TRUE;
3933 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3934 yyextra->current->isStatic =
TRUE;
3940 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3947 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3954 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3961 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3968 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3975 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3982 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3989 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3990 if (yyextra->current->section.isPageDoc() ||
3991 yyextra->current->section.isMainpageDoc())
3993 for (
const auto &opt_ : optList)
3997 int i = opt.
find(
':');
4001 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4003 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option:level specified with \\tableofcontents: '{}'",
4017 yyextra->current->localToc.enableHtml(level);
4019 else if (opt ==
"latex")
4021 yyextra->current->localToc.enableLatex(level);
4023 else if (opt ==
"xml")
4025 yyextra->current->localToc.enableXml(level);
4027 else if (opt ==
"docbook")
4029 yyextra->current->localToc.enableDocbook(level);
4033 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\tableofcontents: '{}'",
4038 if (yyextra->current->localToc.nothingEnabled())
4050 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4051 BEGIN(InheritParam);
4057 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4058 yyextra->currentCmd = cmd;
4059 BEGIN(ExtendsParam);
4065 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4066 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4072 if (!yyextra->spaceBeforeCmd.isEmpty())
4074 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4075 yyextra->spaceBeforeCmd.clear();
4083 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4085 if (!yyextra->spaceBeforeCmd.isEmpty())
4087 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4088 yyextra->spaceBeforeCmd.clear();
4096 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4097 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4103 if (!yyextra->spaceBeforeCmd.isEmpty())
4105 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4106 yyextra->spaceBeforeCmd.clear();
4109 yyextra->copyDocArg.clear();
4110 yyextra->braceCount = 0;
4119 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4120 yyextra->sectionLabel.clear();
4121 yyextra->sectionTitle.clear();
4122 yyextra->docGroup.clearHeader();
4123 yyextra->insideParBlock =
FALSE;
4130 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4132 return yyextra->current->section.isDoc();
4137 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4138 assert(maker!=
nullptr);
4140 if (yyextra->current->section.isDoc())
4146 yyextra->needNewEntry =
true;
4147 yyextra->current->section = maker();
4148 yyextra->current->fileName = yyextra->fileName;
4149 yyextra->current->startLine = yyextra->lineNr;
4150 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4163 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4164 for(
const char* c = yytext ; *c ; ++c )
4165 yyextra->lineNr += (*c ==
'\n') ;
4173 if (s==
nullptr || *s==0)
return name;
4175 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4186 const QCString &listTitle,
bool append)
4188 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4189 if (listName.
isEmpty())
return;
4196 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4209 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4217 item = refList->
add();
4221 item->
setText(yyextra->outputXRef);
4223 yyextra->current->sli.push_back(item);
4226 if (yyextra->inBody)
4228 yyextra->current->inbodyDocs += cmdString;
4232 yyextra->current->doc += cmdString;
4242 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4244 yyextra->sectionLevel);
4245 yyextra->current->anchors.push_back(si);
4247 else if (si->
lineNr() != -1)
4249 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {}, line {})",
4254 warn(listName,yyextra->lineNr,
"multiple use of section label '{}', (first occurrence: {})",
4260 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4262 yyextra->sectionLevel);
4263 yyextra->current->anchors.push_back(si);
4267 yyextra->outputXRef.clear();
4277 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4279 QCString formula = (yyextra->formulaPreText +
4280 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4288 formLabel.
sprintf(
"\\_form#%d",
id);
4289 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4306 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4314 if (addYYtext) yyextra->sectionTitle+=yytext;
4315 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4316 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4318 yyextra->sectionLevel);
4321 yyextra->current->anchors.push_back(si);
4323 else if (si->
lineNr() != -1)
4325 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {}, line {})",
4330 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding section, (first occurrence: {})",
4331 yyextra->sectionLabel,si->
fileName());
4337 if (addYYtext) yyextra->sectionTitle+=yytext;
4338 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4339 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4341 yyextra->sectionLevel);
4344 yyextra->current->anchors.push_back(si);
4353 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4355 if (yytext[0] ==
'"')
4358 name=name.
left((
int)yyleng-2);
4374 if (c==
' ' || c==
'\t' || c==
'\r')
4378 else if (c==
'r' && i>=7 &&
qstrncmp(
"\\ilinebr",s.
data()+i-7,8)==0)
4397 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4398 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4400 yyextra->xrefAppendFlag = !yyextra->inBody &&
4402 yyextra->newXRefKind==yyextra->xrefKind &&
4404 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4420 switch(yyextra->xrefKind)
4452 yyextra->xrefItemTitle,
4453 yyextra->xrefListTitle,
4462 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4464 int oldContext = yyextra->inContext;
4465 yyextra->inContext = ctx;
4467 switch(yyextra->inContext)
4470 if (oldContext!=yyextra->inContext)
4473 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4474 if (yyextra->current->docFile.isEmpty())
4476 yyextra->current->docFile = yyextra->fileName;
4477 yyextra->current->docLine = yyextra->lineNr;
4480 yyextra->pOutputString = &yyextra->current->doc;
4484 if (oldContext!=yyextra->inContext)
4486 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4487 if (yyextra->current->briefFile.isEmpty())
4489 yyextra->current->briefFile = yyextra->fileName;
4490 yyextra->current->briefLine = yyextra->lineNr;
4493 bool foundMatch =
false;
4494 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4502 std::string str = yyextra->current->brief.str();
4507 for (
size_t i = 0; i < match[2].str().size(); i++)
4509 if (match[2].str()[i] ==
'\n') cnt++;
4513 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4515 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4522 yyextra->pOutputString = &yyextra->current->brief;
4526 if (!yyextra->current->doc.isEmpty())
4528 yyextra->current->doc +=
"\n";
4530 yyextra->pOutputString = &yyextra->current->doc;
4536 yyextra->pOutputString = &yyextra->outputXRef;
4541 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4550 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4558 yyextra->current->anchors.push_back(si);
4560 else if (si->
lineNr() != -1)
4562 warn(yyextra->fileName,yyextra->lineNr,
4563 "multiple use of section label '{}' while adding anchor, (first occurrence: {}, line {})",
4568 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '{}' while adding anchor, (first occurrence: {})",
4575 yyextra->current->anchors.push_back(si);
4582 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4584 *yyextra->pOutputString+=s;
4590 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4592 *yyextra->pOutputString+=s;
4598 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4599 *yyextra->pOutputString+=c;
4605 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4612 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4618 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4619 std::string_view str = yyextra->current->brief.view();
4624 yyextra->briefEndsAtDot=
FALSE;
4626 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4628 yyextra->current->docLine = yyextra->lineNr;
4629 yyextra->current->doc =
"";
4633 addIline(yyscanner,yyextra->lineNr);
4639 int saveLineNr = yyextra->lineNr;
4641 yyextra->current->briefLine = yyextra->lineNr;
4642 yyextra->lineNr = saveLineNr;
4648 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4649 yyextra->prevPosition=yyextra->inputPosition;
4651 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4653 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4664 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4665 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4666 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4667 YY_START==ReadFormulaLong)
4669 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4683 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4691 commentscanYYlex_destroy(
p->yyscanner);
4704 bool &newEntryNeeded,
4705 bool markdownSupport,
4709 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4711 isAutoBriefOn,isInbody,prot,markdownSupport);
4713 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4716 yyextra->guards = guards;
4717 yyextra->langParser = parser;
4718 yyextra->current = curEntry;
4719 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4721 yyextra->inputString =
comment;
4722 yyextra->inputString.append(
" ");
4723 yyextra->inputPosition = position;
4724 yyextra->lineNr = lineNr;
4725 yyextra->fileName = fileName;
4726 yyextra->protection = prot;
4727 yyextra->needNewEntry =
FALSE;
4729 yyextra->xrefAppendFlag =
FALSE;
4730 yyextra->insidePre =
FALSE;
4731 yyextra->parseMore =
FALSE;
4732 yyextra->inBody = isInbody;
4733 yyextra->markdownSupport= markdownSupport;
4734 yyextra->outputXRef.clear();
4735 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4737 yyextra->current->doc +=
'\n';
4740 yyextra->briefEndsAtDot = isAutoBriefOn;
4741 yyextra->condCount = 0;
4742 yyextra->sectionLevel = 0;
4743 yyextra->spaceBeforeCmd.clear();
4744 yyextra->spaceBeforeIf.clear();
4745 yyextra->htmlContextStack.clear();
4748 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4751 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4752 yyextra->current->inbodyDocs+=cmd;
4756 "input=[\n{}]\n",fileName,lineNr,yyextra->inputString
4759 commentscanYYrestart(
nullptr, yyscanner );
4761 commentscanYYlex(yyscanner);
4764 if (YY_START==OverloadParam)
4769 if (yyextra->insideParBlock)
4771 warn(yyextra->fileName,yyextra->lineNr,
4772 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4778 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4781 yyextra->current->doc=
"\n\n";
4784 if (yyextra->current->section.isMemberGrp() &&
4785 yyextra->docGroup.isEmpty())
4787 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4791 "brief=[line={}\n{}]\ndocs=[line={}\n{}]\ninbody=[line={}\n{}]\n]\n===========\n",
4793 yyextra->current->briefLine,yyextra->current->brief,
4794 yyextra->current->docLine,yyextra->current->doc,
4795 yyextra->current->inbodyLine,yyextra->current->inbodyDocs
4799 prot = yyextra->protection;
4801 yyextra->docGroup.addDocs(curEntry);
4803 newEntryNeeded = yyextra->needNewEntry;
4808 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4810 if (!yyextra->parseMore && !yyextra->guards->empty())
4812 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4815 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4817 lineNr = yyextra->lineNr;
4819 position,yyextra->parseMore,newEntryNeeded);
4821 return yyextra->parseMore;
4826 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4828 bool sectionEnabled =
false;
4833 bool parentEnabled = yyextra->guards->top().parentVisible();
4837 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4838 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4842 yyextra->guards->top().setEnabled(
true);
4843 yyextra->guards->top().setEnabledFound();
4844 BEGIN( GuardParamEnd );
4848 if (yyextra->guards->top().isEnabledFound())
4850 yyextra->guards->top().setEnabled(
false);
4851 BEGIN( SkipGuardedSection );
4853 else if (sectionEnabled)
4855 yyextra->guards->top().setEnabled(
true);
4856 yyextra->guards->top().setEnabledFound();
4857 BEGIN( GuardParamEnd );
4861 yyextra->guards->top().setEnabled(
false);
4862 BEGIN( SkipGuardedSection );
4867 BEGIN( SkipGuardedSection );
4872 BEGIN( SkipGuardedSection );
4878 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4879 yyextra->docGroup.initGroupInfo(entry);
4884 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4885 yyextra->docGroup.enterFile(fileName,lineNr);
4890 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4891 yyextra->docGroup.leaveFile(fileName,lineNr);
4896 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4897 yyextra->docGroup.enterCompound(fileName,lineNr,name);
4902 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4903 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
4908 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4909 yyextra->docGroup.open(e,fileName,lineNr,implicit);
4914 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4915 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
4918#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.
int qstrncmp(const char *str1, const char *str2, size_t len)
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.