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);
Wrapper class for the Entry type.
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.
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
#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\)] {
1150<Comment>".\\"[ \t] {
1157<Comment>"...\\"[ \t] {
1160<Comment>"..."/[^\.] {
1163<Comment>".."[\.]?/[^ \t\n] {
1166<Comment>(\n|"\\ilinebr ")({B}*(\n|"\\ilinebr "))+ {
1172 for (i=0;i<(yy_size_t)yyleng;)
1174 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1175 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1182 for (i=0;i<(yy_size_t)yyleng;)
1184 if (yytext[i]==
'\n')
addOutput(yyscanner,
'\n'),i++;
1185 else if (strncmp(yytext+i,
"\\ilinebr ",9)==0)
addOutput(yyscanner,
"\\ilinebr "),i+=9;
1199 if (yyextra->briefEndsAtDot)
1202 yyextra->briefEndsAtDot=
FALSE;
1207 if (*yytext ==
'\n') yyextra->lineNr++;
1216<HtmlComment>"---"[!]?">"{B}* {
1217 warn(yyextra->fileName,yyextra->lineNr,
1218 "incorrect HTML end comment --->"
1221<HtmlComment>"--"[!]?">"{B}* { BEGIN( Comment ); }
1222<HtmlComment>{DOCNL} {
1229<HtmlComment>[^\\\n\-]+ {
1234<CdataSection>"\]\]>" {
1237<CdataSection>{DOCNL} {
1239 if (*yytext==
'\n') yyextra->lineNr++;
1241<CdataSection>[<>&] {
1245<CdataSection>[^\\\n\]<>&]+ {
1254<ReadFormulaShort,ReadFormulaShortSection>{CMD}"f$" {
1255 yyextra->formulaPostText+=
"$";
1258 if (YY_START == ReadFormulaShort)
1264 yyextra->sectionTitle+=
" "+form;
1265 BEGIN(SectionTitle);
1268<ReadFormulaRound,ReadFormulaRoundSection>{CMD}"f)" {
1271 if (YY_START == ReadFormulaRound)
1277 yyextra->sectionTitle+=
" "+form;
1278 BEGIN(SectionTitle);
1281<ReadFormulaLong>{CMD}"f]" {
1282 yyextra->formulaPostText+=
"\\]";
1286<ReadFormulaLong>{CMD}"f}" {
1287 yyextra->formulaPostText+=
"\\end";
1288 yyextra->formulaPostText+=yyextra->formulaEnv;
1292<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>[^\\@\n]+ {
1293 yyextra->formulaText+=yytext;
1295<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>\n {
1296 yyextra->formulaNewLines++;
1297 yyextra->formulaText+=*yytext;
1299 addIline(yyscanner,yyextra->lineNr);
1301<ReadFormulaLong,ReadFormulaShort,ReadFormulaShortSection,ReadFormulaRound,ReadFormulaRoundSection>. {
1302 yyextra->formulaText+=*yytext;
1307<EnumDocArg1>{SCOPEID} {
1309 yyextra->current->name = yytext;
1316<EnumDocArg1>{DOCNL} {
1317 warn(yyextra->fileName,yyextra->lineNr,
1318 "missing argument after '\\enum'."
1328<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)
1334<NameSpaceDocArg1>{LC} {
1338<NameSpaceDocArg1>{DOCNL} {
1339 warn(yyextra->fileName,yyextra->lineNr,
1340 "missing argument after "
1346<NameSpaceDocArg1>. {
1351<PackageDocArg1>{ID}("."{ID})* {
1352 yyextra->current->name = yytext;
1355<PackageDocArg1>{LC} {
1359<PackageDocArg1>{DOCNL} {
1360 warn(yyextra->fileName,yyextra->lineNr,
1361 "missing argument after "
1374<ConceptDocArg1>{SCOPEID} {
1376 yyextra->current->name = yytext;
1379<ConceptDocArg1>{LC} {
1383<ConceptDocArg1>{DOCNL} {
1384 warn(yyextra->fileName,yyextra->lineNr,
1385 "missing argument after "
1395<ModuleDocArg1>{MODULE_ID} {
1397 yyextra->current->name = yytext;
1400<ModuleDocArg1>{LC} {
1404<ModuleDocArg1>{DOCNL} {
1405 warn(yyextra->fileName,yyextra->lineNr,
1406 "missing argument after "
1417<ClassDocArg1>{SCOPENAME}{TMPLSPEC} {
1421 BEGIN( ClassDocArg2 );
1423<ClassDocArg1>{SCOPENAME} {
1427 if (yyextra->current->section.isProtocolDoc())
1429 yyextra->current->name+=
"-p";
1432 BEGIN( ClassDocArg2 );
1434<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
1438 BEGIN( ClassDocArg2 );
1440<ClassDocArg1,CategoryDocArg1>{LC} {
1444<ClassDocArg1,CategoryDocArg1>{DOCNL} {
1445 warn(yyextra->fileName,yyextra->lineNr,
1446 "missing argument after "
1447 "'\\%s'.",
qPrint(yyextra->currentCmd)
const char * qPrint(const char *s)
1452<ClassDocArg1,CategoryDocArg1>. {
1455<ClassDocArg2>{DOCNL} {
1459<ClassDocArg2>{FILE}|"<>" {
1460 yyextra->current->includeFile = yytext;
1461 BEGIN( ClassDocArg3 );
1470<ClassDocArg3>[<"]?{FILE}?[">]? {
1471 yyextra->current->includeName = yytext;
1478<ClassDocArg3>{DOCNL} {
1488<GroupDocArg1>{LABELID}(".html"?) {
1489 yyextra->current->name = yytext;
1493 if (yyextra->current->name.endsWith(
".html"))
1495 yyextra->current->name=yyextra->current->name.left(yyextra->current->name.length()-5);
1497 yyextra->current->type.clear();
1498 BEGIN(GroupDocArg2);
1500<GroupDocArg1>"\\"{B}*"\n" {
1504<GroupDocArg1>{DOCNL} {
1505 warn(yyextra->fileName,yyextra->lineNr,
1506 "missing group name after %s",
1507 yyextra->current->groupDocCmd()
1516<GroupDocArg2>"\\"{B}*"\n" {
1520<GroupDocArg2>[^\n\\]+ {
1521 yyextra->current->type += yytext;
1522 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1524<GroupDocArg2>{DOCNL}+ {
1526 yyextra->current->type.isEmpty()
1529 warn(yyextra->fileName,yyextra->lineNr,
1530 "missing title after "
1531 "\\defgroup %s",
qPrint(yyextra->current->name)
1535 int extraLineNr = 0;
1538 for (
int i = 0; i < yyleng; i++)
1540 if (yytext[i]==
'\n') extraLineNr++;
1547 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1548 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr + extraLineNr) +
" \\ilinebr ");
@ GROUPDOC_NORMAL
defgroup
1553 yyextra->current->type += yytext;
1554 yyextra->current->type = yyextra->current->type.stripWhiteSpace();
1559<PageDocArg1>[^\n]*"\\ilinebr @ianchor"\{[^\]\n]*\}{B}{FILE} {
1563 int start = text.
find(
'{');
1564 int end = text.
find(
'}',start+1);
1565 yyextra->current->name = text.
mid(
end+2);
1566 int istart = yyextra->current->name.
find(
"\\ilinebr");
1569 QCString rest = yyextra->current->name.
mid(istart);
1571 yyextra->current->name = yyextra->current->name.mid(0,istart);
1573 yyextra->current->args = text.
mid(start+1,
end-start-1);
1575 BEGIN( PageDocArg2 );
size_t length() const
Returns the length of the string, not counting the 0-terminator.
DirIterator end(const DirIterator &) noexcept
1577<PageDocArg1>{FILE} {
1579 yyextra->current->args =
"";
1580 BEGIN( PageDocArg2 );
1582<PageDocArg1>{LC} { yyextra->lineNr++;
1585<PageDocArg1>{DOCNL} {
1586 warn(yyextra->fileName,yyextra->lineNr,
1587 "missing argument after "
1597<PageDocArg2>{DOCNL} {
1601 addOutput(yyscanner,
" \\ifile \""+ yyextra->fileName);
1602 addOutput(yyscanner,
"\" \\iline " +
QCString().setNum(yyextra->lineNr) +
" \\ilinebr ");
1605<PageDocArg2>{CMD}[<>] {
1610 yyextra->current->args += tmp;
1613 yyextra->current->args += yytext;
1616<ParamArg1>{ID}/{B}*"," {
1623 if (*yytext==
'\n') yyextra->lineNr++;
1637<FileDocArg1>{DOCNL} {
1643<FileDocArg1>{FILE} {
1647<FileDocArg1>{LC} { yyextra->lineNr++;
1655<XRefItemParam1>{LABELID} {
1656 yyextra->newXRefItemKey=yytext;
1658 BEGIN(XRefItemParam2);
1660<XRefItemParam1>{LC} {
1664<XRefItemParam1>{DOCNL} {
1665 warn(yyextra->fileName,yyextra->lineNr,
1666 "Missing first argument of \\xrefitem"
1668 if (*yytext==
'\n') yyextra->lineNr++;
1676<XRefItemParam2>"\""[^\n\"]*"\"" {
1678 BEGIN(XRefItemParam3);
1680<XRefItemParam2>{LC} {
1684<XRefItemParam2>{DOCNL} {
1685 warn(yyextra->fileName,yyextra->lineNr,
1686 "Missing second argument of \\xrefitem"
1688 if (*yytext==
'\n') yyextra->lineNr++;
1696<XRefItemParam3>"\""[^\n\"]*"\"" {
1701<XRefItemParam2,XRefItemParam3>{LC} {
1705<XRefItemParam3>{DOCNL} {
1706 warn(yyextra->fileName,yyextra->lineNr,
1707 "Missing third argument of \\xrefitem"
1709 if (*yytext==
'\n') yyextra->lineNr++;
1720<RelatesParam1>({ID}("::"|"."))*{ID} {
1721 yyextra->current->relates = yytext;
1728<RelatesParam1>{LC} {
1732<RelatesParam1>{DOCNL} {
1733 warn(yyextra->fileName,yyextra->lineNr,
1734 "Missing argument of '\\%s' command",
qPrint(yyextra->currentCmd)
1746<Qualifier>{LABELID} {
1747 yyextra->current->qualifiers.emplace_back(yytext);
1750<Qualifier>"\""[^\"]*"\"" {
1751 std::string inp(yytext);
1752 yyextra->current->qualifiers.push_back(inp.substr(1,yyleng-2));
1756 warn(yyextra->fileName,yyextra->lineNr,
1757 "Missing argument of '\\%s' command",
qPrint(yyextra->currentCmd)
1763 warn(yyextra->fileName,yyextra->lineNr,
1764 "Argument of '\\%s' command should be quoted",
qPrint(yyextra->currentCmd)
1770<ILine>{LINENR}/[\\@\n\.] |
1776 warn(yyextra->fileName,yyextra->lineNr,
"Invalid line number '%s' for iline command",yytext);
1780 yyextra->lineNr = nr;
1783 if (YY_START == ILine)
1789 yyextra->sectionTitle+=yytext;
1790 BEGIN(SectionTitle);
int toInt(bool *ok=nullptr, int base=10) const
1793<ILine,ILineSection>. {
1795 if (YY_START == ILine)
1801 yyextra->sectionTitle+=yytext;
1802 BEGIN(SectionTitle);
1807<IRaise>{B}*[0-9]+/[\\@\n\.] |
1808<IRaise>{B}*[0-9]+{B} {
1813 warn(yyextra->fileName,yyextra->lineNr,
"Invalid level '%s' for iraise command",yytext);
1817 yyextra->raiseLevel = nr;
1827<IRaisePrefix>{B}*"\""({LABELID})?"\"" {
1841<IFile,IFileSection>{FILE} {
1844 if (yytext[0] ==
'\"') yyextra->fileName = text.
mid(1,text.
length()-2);
1845 else yyextra->fileName = yytext;
1846 if (YY_START == IFile)
1852 yyextra->sectionTitle+=yytext;
1853 BEGIN(SectionTitle);
1857<LinkSection>[^\\@\n]* {
1858 yyextra->sectionTitle+=yytext;
1860<LinkSection>{CMD}{CMD} {
1861 yyextra->sectionTitle+=yytext;
1863<LinkSection>{DOCNL} {
1865 if (*yytext ==
'\n') yyextra->lineNr++;
1866 yyextra->sectionTitle+=yytext;
1868<LinkSection>{CMD}"endlink" {
1869 yyextra->sectionTitle+=yytext;
1870 BEGIN(SectionTitle);
1873 yyextra->sectionTitle+=yytext;
1875<LinkSection><<EOF>> {
1876 warn(yyextra->fileName,yyextra->lineNr,
1877 "reached end of comment while inside a '\\%s' command, missing '\\%s' 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 "'\\%s' 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 "'\\%s' command is not allowed in section title, escaping command.",
qPrint(cmdName)
2020 warn(yyextra->fileName,yyextra->lineNr,
2021 "'\\%s' command is not allowed in section title, ending section title.",
qPrint(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 '\\%s' command is to be replaced in section title.",
qPrint(cmdName)
2119 yyextra->sectionTitle+=yytext;
2127 yyextra->sectionTitle+=yytext;
QCString & setNum(short n)
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);
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 \\%s block! Perhaps a missing \\%s?",
qPrint(yyextra->blockName),
qPrint(endTag));
2268<FormatBlock><<EOF>> {
2269 QCString endTag =
"end"+yyextra->blockName;
2270 if (yyextra->blockName==
"startuml") endTag=
"enduml";
2271 warn(yyextra->fileName,yyextra->lineNr,
2272 "reached end of comment while inside a \\%s block; check for missing \\%s tag!",
2280<GuardParam>{B}*"(" {
2281 yyextra->guardExpr=yytext;
2282 yyextra->roundCount=1;
2286 yyextra->guardExpr+=yytext;
2290 yyextra->guardExpr+=yytext;
2291 yyextra->roundCount++;
2294 yyextra->guardExpr+=yytext;
2295 yyextra->roundCount--;
2296 if (yyextra->roundCount==0)
2302 warn(yyextra->fileName,yyextra->lineNr,
2303 "invalid expression '%s' for yyextra->guards",
qPrint(yyextra->guardExpr));
2307<GuardParam>{B}*[a-z_A-Z0-9.\-]+ {
2310<GuardParam>{DOCNL} {
2325<GuardParamEnd>{B}*{DOCNL} {
2327 yyextra->spaceBeforeIf.clear();
2331<GuardParamEnd>{B}* {
2332 if (!yyextra->spaceBeforeIf.isEmpty())
2334 addOutput(yyscanner,yyextra->spaceBeforeIf);
2336 yyextra->spaceBeforeIf.clear();
2348<SkipGuardedSection>{CMD}"ifnot"/{NW} {
2350 yyextra->guards->emplace(
false);
2351 BEGIN( GuardParam );
2353<SkipGuardedSection>{CMD}"if"/{NW} {
2355 yyextra->guards->emplace(
false);
2356 BEGIN( GuardParam );
2358<SkipGuardedSection>{CMD}"endif"/{NW} {
2359 if (yyextra->guards->empty())
2361 warn(yyextra->fileName,yyextra->lineNr,
2362 "found \\endif without matching start command");
2367 yyextra->guards->pop();
2368 if (yyextra->guards->empty())
2370 BEGIN( GuardParamEnd );
2374 if (yyextra->guards->top().isEnabled())
2376 BEGIN( GuardParamEnd );
2380 BEGIN( SkipGuardedSection );
2385<SkipGuardedSection>{CMD}"else"/{NW} {
2386 if (yyextra->guards->empty())
2388 warn(yyextra->fileName,yyextra->lineNr,
2389 "found \\else without matching start command");
2391 else if (yyextra->guards->top().hasElse())
2393 warn(yyextra->fileName,yyextra->lineNr,
2394 "found multiple \\else commands in same \\if construct");
2395 yyextra->guards->top().setEnabled(
false);
2396 BEGIN( SkipGuardedSection );
2398 else if (!yyextra->guards->top().parentVisible())
2400 yyextra->guards->top().setEnabled(
false);
2401 BEGIN( SkipGuardedSection );
2405 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2406 yyextra->guards->top().setElse();
2407 if (!yyextra->guards->top().parentVisible())
2409 yyextra->guards->top().setEnabled(
false);
2410 BEGIN( SkipGuardedSection );
2412 else if (yyextra->guards->top().isEnabledFound())
2414 yyextra->guards->top().setEnabled(
false);
2415 BEGIN( SkipGuardedSection );
2419 yyextra->guards->top().setEnabled(
true);
2420 BEGIN( GuardParamEnd );
2424<SkipGuardedSection>{CMD}"elseif"/{NW} {
2425 if (yyextra->guards->empty())
2427 warn(yyextra->fileName,yyextra->lineNr,
2428 "found \\elseif without matching start command");
2430 else if (yyextra->guards->top().hasElse())
2432 warn(yyextra->fileName,yyextra->lineNr,
2433 "found \\elseif command after \\else command was given in \\if construct");
2435 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2436 yyextra->guards->top().setEnabled(
false);
2437 BEGIN( GuardParam );
2442 yyextra->spaceBeforeIf = yyextra->spaceBeforeCmd;
2443 yyextra->guards->top().setEnabled(
false);
2444 BEGIN( GuardParam );
2447<SkipGuardedSection>{DOCNL} {
2448 if (*yytext==
'\n') yyextra->lineNr++;
2451<SkipGuardedSection>[^ \\@\n]+ {
2453<SkipGuardedSection>{CMD}{CMD} |
2454<SkipGuardedSection>. {
2460<SkipInternal>{DOCNL} {
2461 if (*yytext==
'\n') yyextra->lineNr++;
2464<SkipInternal>[@\\]"if"/[ \t] {
2465 yyextra->condCount++;
2467<SkipInternal>[@\\]"ifnot"/[ \t] {
2468 yyextra->condCount++;
2470<SkipInternal>[@\\]/"endif" {
2471 yyextra->condCount--;
2472 if (yyextra->condCount<0)
2478<SkipInternal>[@\\]/"section"[ \t] {
2479 if (yyextra->sectionLevel>0)
2485<SkipInternal>[@\\]/"subsection"[ \t] {
2486 if (yyextra->sectionLevel>1)
2492<SkipInternal>[@\\]/"subsubsection"[ \t] {
2493 if (yyextra->sectionLevel>2)
2499<SkipInternal>[@\\]/"paragraph"[ \t] {
2500 if (yyextra->sectionLevel>3)
2506<SkipInternal>[@\\]/"subparagraph"[ \t] {
2507 if (yyextra->sectionLevel>4)
2513<SkipInternal>[@\\]/"subsubparagraph"[ \t] {
2514 if (yyextra->sectionLevel>5)
2520<SkipInternal>[@\\]"endinternal"[ \t]* {
2523<SkipInternal>[^ \\@\n]+ {
2540 yyextra->docGroup.appendHeader(
' ');
2543 yyextra->docGroup.appendHeader(*yytext);
2544 yyextra->current->name+=*yytext;
2559<RaiseWarning,RaiseWarningSection>{DOCNL} {
2561 "%s",
qPrint(yyextra->raiseWarning));
2562 yyextra->raiseWarning =
"";
2563 if (*yytext==
'\n') yyextra->lineNr++;
2565 if (YY_START == RaiseWarning)
2571 yyextra->sectionTitle+=yytext;
2572 BEGIN(SectionTitle);
#define warn_doc_error(file, line, fmt,...)
2575<RaiseWarning,RaiseWarningSection>. {
2576 yyextra->raiseWarning += yytext;
2580<InGroupParam>{LABELID} {
2581 yyextra->current->groups.emplace_back(
2584 yyextra->inGroupParamFound=
TRUE;
@ GROUPING_INGROUP
membership in group was defined by @ingroup
2586<InGroupParam>{DOCNL} {
2587 if (!yyextra->inGroupParamFound)
2589 warn(yyextra->fileName,yyextra->lineNr,
2590 "Missing group name for \\ingroup command"
2609 if (yyextra->braceCount==0)
2611 if (yyextra->functionProto.stripWhiteSpace().isEmpty())
2613 warn(yyextra->fileName,yyextra->lineNr,
2614 "missing argument after "
2615 "'\\%s'.",
qPrint(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 "'\\%s' command has no argument",
qPrint(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 '%s' for command '\\%s'",opt.c_str(),
qPrint(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 '%s'",
qPrint(optStripped));
3471 it->second(yyscanner,fi,isSection);
3477 warn(yyextra->fileName,yyextra->lineNr,
"Unknown option specified with \\fileinfo: '%s'",
qPrint(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);
3866 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3867 yyextra->current->commandOverrides.override_inheritanceGraph(CLASS_GRAPH_t::NO);
3873 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3874 yyextra->current->commandOverrides.override_referencedByRelation(
true);
3880 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3881 yyextra->current->commandOverrides.override_referencedByRelation(
false);
3887 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3888 yyextra->current->commandOverrides.override_referencesRelation(
true);
3894 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3895 yyextra->current->commandOverrides.override_referencesRelation(
false);
3901 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3902 yyextra->currentCmd = cmd;
3909 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3914 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
3916 yyextra->current->doc.clear();
3918 yyextra->condCount=0;
3919 BEGIN( SkipInternal );
3925 yyextra->inInternalDocs =
TRUE;
3932 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3933 yyextra->current->isStatic =
TRUE;
3939 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3946 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3953 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3960 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3967 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3974 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3981 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3988 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
3989 if (yyextra->current->section.isPageDoc() ||
3990 yyextra->current->section.isMainpageDoc())
3992 for (
const auto &opt_ : optList)
3996 int i = opt.
find(
':');
4000 if (sscanf(opt.
right(opt.
length() - i - 1).
data(),
"%d%c",&level,&dum) != 1)
4015 yyextra->current->localToc.enableHtml(level);
4017 else if (opt ==
"latex")
4019 yyextra->current->localToc.enableLatex(level);
4021 else if (opt ==
"xml")
4023 yyextra->current->localToc.enableXml(level);
4025 else if (opt ==
"docbook")
4027 yyextra->current->localToc.enableDocbook(level);
4035 if (yyextra->current->localToc.nothingEnabled())
4047 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4048 BEGIN(InheritParam);
4054 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4055 yyextra->currentCmd = cmd;
4056 BEGIN(ExtendsParam);
4062 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4063 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4069 if (!yyextra->spaceBeforeCmd.isEmpty())
4071 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4072 yyextra->spaceBeforeCmd.clear();
4080 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4082 if (!yyextra->spaceBeforeCmd.isEmpty())
4084 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4085 yyextra->spaceBeforeCmd.clear();
4093 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4094 if (yyextra->current->brief.stripWhiteSpace().isEmpty() && yyextra->current->doc.stripWhiteSpace().isEmpty())
4100 if (!yyextra->spaceBeforeCmd.isEmpty())
4102 addOutput(yyscanner,yyextra->spaceBeforeCmd);
4103 yyextra->spaceBeforeCmd.clear();
4106 yyextra->copyDocArg.clear();
4107 yyextra->braceCount = 0;
4116 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4117 yyextra->sectionLabel.clear();
4118 yyextra->sectionTitle.clear();
4119 yyextra->docGroup.clearHeader();
4120 yyextra->insideParBlock =
FALSE;
4127 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4129 return yyextra->current->section.isDoc();
4134 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4135 assert(maker!=
nullptr);
4137 if (yyextra->current->section.isDoc())
4143 yyextra->needNewEntry =
true;
4144 yyextra->current->section = maker();
4145 yyextra->current->fileName = yyextra->fileName;
4146 yyextra->current->startLine = yyextra->lineNr;
4147 if (yyextra->current->docLine == -1) yyextra->current->docLine = yyextra->lineNr;
4160 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4161 for(
const char* c = yytext ; *c ; ++c )
4162 yyextra->lineNr += (*c ==
'\n') ;
4170 if (s==
nullptr || *s==0)
return name;
4172 if (name.
at(0)==
'"' && name.
at(name.
length()-1)==
'"')
4183 const QCString &listTitle,
bool append)
4185 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4186 if (listName.
isEmpty())
return;
4193 for (
auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it)
4206 item->
setText(item->
text() +
" <p>" + yyextra->outputXRef);
4214 item = refList->
add();
4218 item->
setText(yyextra->outputXRef);
4220 yyextra->current->sli.push_back(item);
4223 if (yyextra->inBody)
4225 yyextra->current->inbodyDocs += cmdString;
4229 yyextra->current->doc += cmdString;
4239 si = sm.
replace(anchorLabel,listName,yyextra->lineNr,
4241 yyextra->sectionLevel);
4242 yyextra->current->anchors.push_back(si);
4244 else if (si->
lineNr() != -1)
4246 warn(listName,yyextra->lineNr,
"multiple use of section label '%s', (first occurrence: %s, line %d)",
qPrint(anchorLabel),
qPrint(si->
fileName()),si->
lineNr());
4250 warn(listName,yyextra->lineNr,
"multiple use of section label '%s', (first occurrence: %s)",
qPrint(anchorLabel),
qPrint(si->
fileName()));
4255 si = sm.
add(anchorLabel,listName,yyextra->lineNr,
4257 yyextra->sectionLevel);
4258 yyextra->current->anchors.push_back(si);
4262 yyextra->outputXRef.clear();
4272 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4274 QCString formula = (yyextra->formulaPreText +
4275 yyextra->formulaText.stripLeadingAndTrailingEmptyLines() +
4283 formLabel.
sprintf(
"\\_form#%d",
id);
4284 for (
int i=0;i<yyextra->formulaNewLines;i++) formLabel+=
"@_fakenl";
4301 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4309 if (addYYtext) yyextra->sectionTitle+=yytext;
4310 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4311 si = sm.
replace(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4313 yyextra->sectionLevel);
4316 yyextra->current->anchors.push_back(si);
4318 else if (si->
lineNr() != -1)
4320 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '%s' while adding section, (first occurrence: %s, line %d)",
qPrint(yyextra->sectionLabel),
qPrint(si->
fileName()),si->
lineNr());
4324 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '%s' while adding section, (first occurrence: %s)",
qPrint(yyextra->sectionLabel),
qPrint(si->
fileName()));
4330 if (addYYtext) yyextra->sectionTitle+=yytext;
4331 yyextra->sectionTitle=yyextra->sectionTitle.stripWhiteSpace();
4332 si = sm.
add(yyextra->sectionLabel,yyextra->fileName,yyextra->lineNr,
4334 yyextra->sectionLevel);
4337 yyextra->current->anchors.push_back(si);
4346 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4348 if (yytext[0] ==
'"')
4351 name=name.
left((
int)yyleng-2);
4367 if (c==
' ' || c==
'\t' || c==
'\r')
4371 else if (c==
'r' && i>=7 &&
qstrncmp(
"\\ilinebr",s.
data()+i-7,8)==0)
4390 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4391 bool xrefAppendToPrev = yyextra->xrefAppendFlag;
4393 yyextra->xrefAppendFlag = !yyextra->inBody &&
4395 yyextra->newXRefKind==yyextra->xrefKind &&
4397 yyextra->newXRefItemKey==yyextra->xrefItemKey);
4413 switch(yyextra->xrefKind)
4445 yyextra->xrefItemTitle,
4446 yyextra->xrefListTitle,
4455 yyextra->xrefItemKey = yyextra->newXRefItemKey;
4457 int oldContext = yyextra->inContext;
4458 yyextra->inContext = ctx;
4460 switch(yyextra->inContext)
4463 if (oldContext!=yyextra->inContext)
4466 if (yyextra->current->doc.isEmpty()) yyextra->current->docLine = yyextra->lineNr;
4467 if (yyextra->current->docFile.isEmpty())
4469 yyextra->current->docFile = yyextra->fileName;
4470 yyextra->current->docLine = yyextra->lineNr;
4473 yyextra->pOutputString = &yyextra->current->doc;
4477 if (oldContext!=yyextra->inContext)
4479 if (yyextra->current->brief.isEmpty()) yyextra->current->briefLine = yyextra->lineNr;
4480 if (yyextra->current->briefFile.isEmpty())
4482 yyextra->current->briefFile = yyextra->fileName;
4483 yyextra->current->briefLine = yyextra->lineNr;
4486 bool foundMatch =
false;
4487 if (yyextra->current->brief.stripWhiteSpace().isEmpty())
4495 std::string str = yyextra->current->brief.str();
4500 for (
size_t i = 0; i < match[2].str().size(); i++)
4502 if (match[2].str()[i] ==
'\n') cnt++;
4506 yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
4508 yyextra->current->brief +=
" \\iline " +
QCString().
setNum(cnt +
static_cast<int>(std::stoul(match[1].str()))) +
" \\ilinebr ";
4515 yyextra->pOutputString = &yyextra->current->brief;
4519 if (!yyextra->current->doc.isEmpty())
4521 yyextra->current->doc +=
"\n";
4523 yyextra->pOutputString = &yyextra->current->doc;
4529 yyextra->pOutputString = &yyextra->outputXRef;
4534 yyextra->pOutputString = &yyextra->current->inbodyDocs;
4543 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4551 yyextra->current->anchors.push_back(si);
4553 else if (si->
lineNr() != -1)
4555 warn(yyextra->fileName,yyextra->lineNr,
4556 "multiple use of section label '%s' while adding anchor, (first occurrence: %s, line %d)",
4561 warn(yyextra->fileName,yyextra->lineNr,
"multiple use of section label '%s' while adding anchor, (first occurrence: %s)",
4568 yyextra->current->anchors.push_back(si);
4575 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4577 *yyextra->pOutputString+=s;
4583 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4585 *yyextra->pOutputString+=s;
4591 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4592 *yyextra->pOutputString+=c;
4598 qsnprintf(cmd,30,
" \\iline %d ",lineNr);
4605 qsnprintf(cmd,30,
" \\iline %d \\ilinebr ",lineNr);
4611 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4612 std::string_view str = yyextra->current->brief.view();
4617 yyextra->briefEndsAtDot=
FALSE;
4619 if (yyextra->current->doc.stripWhiteSpace().isEmpty())
4621 yyextra->current->docLine = yyextra->lineNr;
4622 yyextra->current->doc =
"";
4626 addIline(yyscanner,yyextra->lineNr);
4632 int saveLineNr = yyextra->lineNr;
4634 yyextra->current->briefLine = yyextra->lineNr;
4635 yyextra->lineNr = saveLineNr;
4641 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4642 yyextra->prevPosition=yyextra->inputPosition;
4644 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
4646 *buf = yyextra->inputString[yyextra->inputPosition++] ;
4657 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4658 if (YY_START==ReadFormulaShort || YY_START==ReadFormulaShortSection ||
4659 YY_START==ReadFormulaRound || YY_START==ReadFormulaRoundSection ||
4660 YY_START==ReadFormulaLong)
4662 warn(yyextra->fileName,yyextra->lineNr,
"End of comment block while inside formula.");
4676 commentscanYYlex_init_extra(&
p->extra,&
p->yyscanner);
4684 commentscanYYlex_destroy(
p->yyscanner);
4697 bool &newEntryNeeded,
4698 bool markdownSupport,
4702 AUTO_TRACE(
"comment='{}' fileName={} lineNr={} isBrief={} isAutoBriefOn={} inInbody={}"
4704 isAutoBriefOn,isInbody,prot,markdownSupport);
4706 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4709 yyextra->guards = guards;
4710 yyextra->langParser = parser;
4711 yyextra->current = curEntry;
4712 yyextra->current->
docLine = (lineNr > 1 ? lineNr : 1);
4714 yyextra->inputString =
comment;
4715 yyextra->inputString.append(
" ");
4716 yyextra->inputPosition = position;
4717 yyextra->lineNr = lineNr;
4718 yyextra->fileName = fileName;
4719 yyextra->protection = prot;
4720 yyextra->needNewEntry =
FALSE;
4722 yyextra->xrefAppendFlag =
FALSE;
4723 yyextra->insidePre =
FALSE;
4724 yyextra->parseMore =
FALSE;
4725 yyextra->inBody = isInbody;
4726 yyextra->markdownSupport= markdownSupport;
4727 yyextra->outputXRef.
clear();
4728 if (!isBrief && !isAutoBriefOn && !yyextra->current->doc.isEmpty())
4730 yyextra->current->doc +=
'\n';
4733 yyextra->briefEndsAtDot = isAutoBriefOn;
4734 yyextra->condCount = 0;
4735 yyextra->sectionLevel = 0;
4736 yyextra->spaceBeforeCmd.clear();
4737 yyextra->spaceBeforeIf.clear();
4738 yyextra->htmlContextStack.clear();
4741 if (!yyextra->current->inbodyDocs.isEmpty() && isInbody)
4744 qsnprintf(cmd,30,
"\n\n\\iline %d \\ilinebr ",lineNr);
4745 yyextra->current->inbodyDocs+=cmd;
4749 "input=[\n%s]\n",
qPrint(fileName),lineNr,
qPrint(yyextra->inputString)
4752 commentscanYYrestart(
nullptr, yyscanner );
4754 commentscanYYlex(yyscanner);
4757 if (YY_START==OverloadParam)
4762 if (yyextra->insideParBlock)
4764 warn(yyextra->fileName,yyextra->lineNr,
4765 "Documentation block ended while inside a \\parblock. Missing \\endparblock");
4771 if (yyextra->current->section.isFileDoc() && yyextra->current->doc.isEmpty())
4774 yyextra->current->doc=
"\n\n";
4777 if (yyextra->current->section.isMemberGrp() &&
4778 yyextra->docGroup.isEmpty())
4780 yyextra->docGroup.open(yyextra->current,yyextra->fileName,yyextra->lineNr,
true);
4784 "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n]\n===========\n",
4786 yyextra->current->briefLine,
qPrint(yyextra->current->brief),
4787 yyextra->current->docLine,
qPrint(yyextra->current->doc),
4788 yyextra->current->inbodyLine,
qPrint(yyextra->current->inbodyDocs)
4792 prot = yyextra->protection;
4794 yyextra->docGroup.addDocs(curEntry);
4796 newEntryNeeded = yyextra->needNewEntry;
4801 if (yyextra->parseMore && position==yyextra->inputPosition) yyextra->parseMore=
FALSE;
4803 if (!yyextra->parseMore && !yyextra->guards->empty())
4805 warn(yyextra->fileName,yyextra->lineNr,
"Documentation block ended in the middle of a conditional section!");
4808 if (yyextra->parseMore) position=yyextra->inputPosition;
else position=0;
4810 lineNr = yyextra->lineNr;
4812 position,yyextra->parseMore,newEntryNeeded);
4814 return yyextra->parseMore;
4819 struct yyguts_t *yyg = (
struct yyguts_t*)yyscanner;
4821 bool sectionEnabled =
false;
4826 bool parentEnabled = yyextra->guards->top().parentVisible();
4830 (sectionEnabled && yyextra->guardType==
Guard_If) ||
4831 (!sectionEnabled && yyextra->guardType==
Guard_IfNot)
4835 yyextra->guards->top().setEnabled(
true);
4836 yyextra->guards->top().setEnabledFound();
4837 BEGIN( GuardParamEnd );
4841 if (yyextra->guards->top().isEnabledFound())
4843 yyextra->guards->top().setEnabled(
false);
4844 BEGIN( SkipGuardedSection );
4846 else if (sectionEnabled)
4848 yyextra->guards->top().setEnabled(
true);
4849 yyextra->guards->top().setEnabledFound();
4850 BEGIN( GuardParamEnd );
4854 yyextra->guards->top().setEnabled(
false);
4855 BEGIN( SkipGuardedSection );
4860 BEGIN( SkipGuardedSection );
4865 BEGIN( SkipGuardedSection );
4871 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4872 yyextra->docGroup.initGroupInfo(entry);
4877 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4878 yyextra->docGroup.enterFile(fileName,lineNr);
4883 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4884 yyextra->docGroup.leaveFile(fileName,lineNr);
4889 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4890 yyextra->docGroup.enterCompound(fileName,lineNr,name);
4895 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4896 yyextra->docGroup.leaveCompound(fileName,lineNr,name);
4901 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4902 yyextra->docGroup.open(e,fileName,lineNr,implicit);
4907 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
4908 yyextra->docGroup.close(e,fileName,lineNr,foundInline,implicit);
4911#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 void print(DebugMask mask, int prio, const char *fmt,...)
static bool isFlagSet(const DebugMask mask)
Represents an unstructured piece of information, about an entity found in the sources.
int docLine
line number at which the documentation was found
Minimal replacement for QFileInfo.
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
const T * find(const std::string &key) const
Find an object given the key.
Abstract interface for outline parsers.
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())
Replace an existing section with a new one Return a non-owning pointer to the newly added section.
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
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.