43#if !ENABLE_DOCPARSER_TRACING
47#define AUTO_TRACE(...) (void)0
48#define AUTO_TRACE_ADD(...) (void)0
49#define AUTO_TRACE_EXIT(...) (void)0
57 return std::make_unique<DocParser>();
107 "image file name '{}' is ambiguous.\n"
117 if (i!=-1 || (i=result.
findRev(
'\\'))!=-1)
119 result = result.
right(
static_cast<int>(result.
length())-i-1);
146 QCString outputFile = outputDir+
"/"+result;
152 "destination of image {} is a symlink, replacing with image",
155 if (outputFile!=inputFile)
166 "could not open image {}",fileName);
176 epstopdfArgs.
sprintf(
"\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
181 err(
"Problems running epstopdf. Check your TeX installation!\n");
196 "image file {} is not found in IMAGE_PATH: "
197 "assuming external image.",fileName
213 if (
context.memberDef==
nullptr)
return;
214 std::string name =
context.token->name.str();
216 context.memberDef->argumentList() :
217 context.memberDef->declArgumentList();
219 context.numParameters =
static_cast<int>(al.
size());
221 if (al.
empty())
return;
223 static const reg::Ex re(R
"(\$?\w+\.*)");
224 static const reg::Ex re_digits(R
"(\d+)");
227 for (; it!=
end ; ++it)
229 const auto &match = *it;
232 if (lang==SrcLangExt::Fortran) aName=aName.
lower();
239 if (lang==SrcLangExt::Fortran) argName=argName.
lower();
243 bool sameName = aName==argName;
244 bool samePosition = position==number;
245 if (samePosition || sameName)
265 if (!scope.
isEmpty()) scope+=
"::";
else scope=
"";
268 int docLine =
context.memberDef->docLine();
272 inheritedFrom.
sprintf(
" inherited from member %s at line "
275 docFile =
context.memberDef->getDefFileName();
276 docLine =
context.memberDef->getDefLine();
282 "positional argument with value '0' of command @param "
283 "is invalid, first parameter has index '1' for {}{}{}{}",
284 scope,
context.memberDef->name(),
285 alStr, inheritedFrom);
291 "positional argument '{}' of command @param "
292 "is larger than the number of parameters ({}) for {}{}{}{}",
293 number, al.
size(), scope,
context.memberDef->name(),
294 alStr, inheritedFrom);
300 "argument '{}' of command @param "
301 "is not found in the argument list of {}{}{}{}",
302 aName, scope,
context.memberDef->name(),
303 alStr, inheritedFrom);
316 if (
context.retvalsFound.count(name.
str())==1)
319 context.memberDef->getDefLine(),
320 "return value '{}' of {} has multiple documentation sections",
321 name,
context.memberDef->qualifiedName());
337 context.memberDef->argumentList() :
338 context.memberDef->declArgumentList();
347 if (lang==SrcLangExt::Fortran) argName = argName.
lower();
351 if (lang==SrcLangExt::Python && (argName==
"self" || argName==
"cls"))
355 else if (lang==SrcLangExt::Cpp && (a.type==
"this" || a.type.startsWith(
"this ")))
361 size_t count_named =
context.paramsFound.count(argName.
str());
362 size_t count_positional =
context.paramsFound.count(std::to_string(position));
363 if (count_named==0 && count_positional==0 && a.docs.isEmpty())
367 else if (count_named==1 && count_positional==1 &&
Config_getBool(WARN_IF_DOC_ERROR))
371 "argument {} from the argument list of {} has both named and positional @param documentation sections",
372 aName,
context.memberDef->qualifiedName());
374 else if (count_named+count_positional>1 &&
Config_getBool(WARN_IF_DOC_ERROR))
378 "argument {} from the argument list of {} has multiple @param documentation sections",
379 aName,
context.memberDef->qualifiedName());
387 QCString errMsg =
"The following parameter";
388 if (undocParams.
size()>1) errMsg+=
"s";
390 context.memberDef->qualifiedName() +
392 (undocParams.
size()>1 ?
" are" :
" is") +
" not documented:\n";
393 for (
const Argument &a : undocParams)
396 if (lang==SrcLangExt::Fortran) argName = argName.
lower();
398 if (!first) errMsg+=
"\n";
400 errMsg+=
" parameter '"+argName+
"'";
409 "too many @param commands for function {}. Found {} while function has {} parameter{}",
419 "{} has @param documentation sections but no arguments",
420 context.memberDef->qualifiedName());
495 size_t rightBracePos = cmdArg.
find(
"}",
static_cast<int>(
qstrlen(
"anonymous_namespace{")));
499 cmdArg = leftPart + rightPart;
506 int l=
static_cast<int>(cmdArg.
length());
508 int funcStart=cmdArg.
find(
'(');
517 int secondParen = cmdArg.
find(
'(', funcStart+1);
518 int leftParen = cmdArg.
find(
')', funcStart+1);
519 if (leftParen!=-1 && secondParen!=-1)
521 if (leftParen<secondParen)
523 funcStart=secondParen;
547 int scopeOffset=
static_cast<int>(
context.context.length());
582 scopeOffset =
context.context.findRev(
"::",scopeOffset-1);
583 if (scopeOffset==-1) scopeOffset=0;
585 }
while (scopeOffset>=0);
597 case TokenRetval::TK_COMMAND_AT:
599 case TokenRetval::TK_COMMAND_BS:
607 case TokenRetval::TK_SYMBOL:
611 case TokenRetval::TK_HTMLTAG:
630 size_t styleStackSizeAtStart =
context.styleStack.size();
631 if (!tok.
is(TokenRetval::TK_WHITESPACE))
638 while (!tok.
is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::TK_WHITESPACE,
639 TokenRetval::TK_NEWPARA, TokenRetval::TK_LISTITEM, TokenRetval::TK_ENDLIST)
642 static const reg::Ex specialChar(R
"([.,|()\[\]:;?])");
643 if (tok.
is(TokenRetval::TK_WORD) &&
context.token->name.length()==1 &&
647 AUTO_TRACE_ADD(
"special character ending style argument: '{}' styleStackSize {}->{}",
context.token->name,styleStackSizeAtStart,
context.styleStack.size());
648 if (
context.styleStack.size() > styleStackSizeAtStart)
658 case TokenRetval::TK_HTMLTAG:
678 return (tok.
is_any_of(TokenRetval::TK_NEWPARA,TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST)) ? tok : Token::make_RetVal_OK();
705 return std::get<DocStyleChange>(*stack.top());
708 if (
context.styleStack.empty() ||
709 topStyleChange(
context.styleStack).style()!=s ||
710 topStyleChange(
context.styleStack).tagName()!=tagNameLower ||
711 topStyleChange(
context.styleStack).position()!=
context.nodeStack.size()
714 if (
context.styleStack.empty())
718 else if (topStyleChange(
context.styleStack).tagName()!=tagNameLower ||
719 topStyleChange(
context.styleStack).style()!=s)
722 tagName,topStyleChange(
context.styleStack).tagName());
727 tagName,
context.nodeStack.size(),topStyleChange(
context.styleStack).position());
749 AUTO_TRACE(
"context.styleStack.size()={} numberOfElementsToClose={}",
context.styleStack.size(),numberOfElementsToClose);
750 if (!
context.styleStack.empty())
752 if (numberOfElementsToClose==0) numberOfElementsToClose =
context.styleStack.size();
754 while (sc && sc->
position()>=
context.nodeStack.size() && numberOfElementsToClose>0)
761 sc = !
context.styleStack.empty() ? &std::get<DocStyleChange>(*
context.styleStack.top()) :
nullptr;
762 numberOfElementsToClose--;
770 while (!
context.initialStyleStack.empty())
774 context.initialStyleStack.pop();
783 Token retval = Token::make_RetVal_OK();
784 for (
const auto &opt : tagHtmlAttribs)
786 if (opt.name==
"name" || opt.name==
"id")
788 if (!opt.value.isEmpty())
798 else if (opt.name==
"href")
803 attrList.erase(attrList.begin()+index);
805 if (opt.value.at(0) !=
'#') relPath =
context.relPath;
825 AUTO_TRACE(
"content.initialStyleStack.size()={}",
context.initialStyleStack.size());
826 if (!
context.initialStyleStack.empty())
828 QCString tagName = std::get<DocStyleChange>(*
context.initialStyleStack.top()).tagName();
829 QCString fileName = std::get<DocStyleChange>(*
context.initialStyleStack.top()).fileName();
830 int lineNr = std::get<DocStyleChange>(*
context.initialStyleStack.top()).lineNr();
831 context.initialStyleStack.pop();
836 "end of comment block while expecting "
837 "command </{}> (Probable start '{}' at line {})",tagName, fileName, lineNr);
842 "end of comment block while expecting command </{}>",tagName);
850 auto ignoreWord = [](
const QCString &w) ->
bool {
852 return std::find_if(list.begin(), list.end(),
853 [&w](
const auto &ignore) { return w.startsWith(ignore); }
858 if (!
context.autolinkSupport || ignoreAutoLinkFlag || ignoreWord(
context.token->name))
868 size_t len =
context.token->name.length();
877 || (!
context.context.isEmpty() &&
886 if (!typeLinkOnly ||
context.token->name.startsWith(
"#") ||
904 AUTO_TRACE_ADD(
"no link as request is type but member is not a type or explicit link");
928 (
toFileDef(compound))->generateSourceFile()
941 AUTO_TRACE_ADD(
"resolved reference as unlinkable compound={} (linkable={}) member={} (linkable={})",
942 compound ? compound->
name() :
"<none>", compound ? (
int)compound->
isLinkable() : -1,
943 member ? member->
name() :
"<none>", member ? (
int)member->
isLinkable() : -1);
947 else if (!
context.insideHtmlLink && len>1 &&
context.token->name.at(len-1)==
':')
973 req->getOutputFileBase(),
986 if (
context.token->name.startsWith(
"#"))
1000 while ((i=paramTypes.
find(
'|',p))!=-1)
1002 name1 = paramTypes.
mid(p,i-p);
1004 context.token->name=ii!=-1 ? name1.
mid(0,ii) : name1;
1010 name1 = paramTypes.
mid(p);
1012 context.token->name=ii!=-1 ? name1.
mid(0,ii) : name1;
1023 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1030 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1044 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1054 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1057 "argument of command {}",
context.token->name);
1060 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1077 if (tok.
is(TokenRetval::TK_WORD) &&
context.token->name==
"{")
1082 for (
auto const &opt : optList)
1084 if (opt ==
"number")
1095 else if (opt ==
"year")
1106 else if (opt ==
"shortauthor")
1117 else if (opt ==
"nopar")
1121 else if (opt ==
"nocite")
1135 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1142 else if (!tok.
is(TokenRetval::TK_WHITESPACE))
1156 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1159 "argument of command '\\{}'",
context.token->name);
1162 else if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1178 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1185 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1188 "argument of command {}",
context.token->name);
1191 else if (!tok.
is(TokenRetval::TK_WORD))
1218 while (!tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1220 if (tok.
is(TokenRetval::TK_WORD) && (
context.token->name==
"width=" ||
context.token->name==
"height="))
1225 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1237 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1241 while (tok.
is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1243 if (tok.
is(TokenRetval::TK_WORD))
1245 if (
context.token->name==
"width=" ||
context.token->name==
"height=")
1251 if (
context.token->name==
"width")
1255 else if (
context.token->name==
"height")
1257 height =
context.token->chars;
1271 if (tok.
is_any_of(TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS))
1274 tokenizer.unputString(tok.
is(TokenRetval::TK_COMMAND_AT) ?
"@" :
"\\");
1277 else if (tok.
is(TokenRetval::TK_SYMBOL))
1282 else if (tok.
is(TokenRetval::TK_HTMLTAG))
1297 bool inlineImage =
false;
1301 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1303 if (tok.
is(TokenRetval::TK_WORD))
1305 if (
context.token->name ==
"{")
1311 for (
const auto &opt : optList)
1313 if (opt.empty())
continue;
1317 locOptLow = locOpt.
lower();
1318 if (locOptLow ==
"inline")
1327 "multiple use of option 'anchor' for 'image' command, ignoring: '{}'",
1332 anchorStr = locOpt.
mid(7);
1338 "unknown option '{}' for 'image' command specified",
1343 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1357 if (!tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1364 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1379 "\\image command is not valid", imgType);
1385 if (!tok.
is(TokenRetval::TK_WORD))
1406 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1409 cmdChar,
qPrint(saveCmdName));
1414 if (!tok.
is(TokenRetval::TK_WORD))
1430 if (!tok.
is(TokenRetval::TK_WHITESPACE))
1439 if (!tok.
is(TokenRetval::TK_WORD))
1454 if (!tok.
is(TokenRetval::TK_WORD))
1476 if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD,TokenRetval::TK_SYMBOL,TokenRetval::TK_URL,
1477 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS,TokenRetval::TK_HTMLTAG)
1484 switch (tok.
value())
1486 case TokenRetval::TK_COMMAND_AT:
1488 case TokenRetval::TK_COMMAND_BS:
1554 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1555 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1568 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1569 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1582 if (tok.
is(TokenRetval::TK_NEWPARA))
goto handlepara;
1583 else if (tok.
is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1595 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1607 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1619 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1631 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1643 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1655 if (tok.
is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1711 case TokenRetval::TK_HTMLTAG:
1792 case TokenRetval::TK_SYMBOL:
1805 case TokenRetval::TK_WHITESPACE:
1806 case TokenRetval::TK_NEWPARA:
1813 case TokenRetval::TK_LNKWORD:
1821 case TokenRetval::TK_WORD:
1829 case TokenRetval::TK_URL:
1852 for (
const auto &opt : tagHtmlAttribs)
1855 if (opt.name==
"src" && !opt.value.isEmpty())
1860 attrList.erase(attrList.begin()+index);
1882 Token retval = Token::make_RetVal_OK();
1884 if (doc.
isEmpty())
return retval;
1890 DocPara *lastPar=!children.
empty() ? std::get_if<DocPara>(&children.
back()):
nullptr;
1899 if (isFirst) { par->markFirst(); isFirst=
FALSE; }
1900 retval=par->parse();
1901 if (!par->isEmpty())
1910 }
while (retval.
is(TokenRetval::TK_NEWPARA));
1937 "Check your EXAMPLE_PATH",file);
1947 bool insideDQuote=
FALSE;
1948 bool insideSQuote=
FALSE;
1950 while (j<len && !found)
1952 if (!insideSQuote && !insideDQuote)
1956 case '(': round++;
break;
1957 case ')': round--;
break;
1958 case '"': insideDQuote=
TRUE;
break;
1959 case '\'': insideSQuote=
TRUE;
break;
1967 found=(round==0) && (j<8 || !
literal_at(data+j-8,
"operator"));
1971 else if (insideSQuote)
1973 if (data[j]==
'\'' && (j==0 || data[j]!=
'\\'))
1978 else if (insideDQuote)
1980 if (data[j]==
'"' && (j==0 || data[j]!=
'\\'))
2000 while (k<len && data[k]==
' ') k++;
2001 if (k<len-1 && data[k]==
'&' && data[k+1]==
'&') j=k+2;
2002 else if (k<len && data[k]==
'&' ) j=k+1;
2006 if (j>0 && data[j-1]==
'.') { e--; }
2016#define CHECK_FOR_COMMAND(str,action) \
2017 do if ((i+sizeof(str)<len) && literal_at(data+i+1,str)) \
2018 { j=i+sizeof(str); action; } while(0)
2023 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2034 if (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\'))
2059 if ((data[i]==
'@' || data[i]==
'\\') &&
2060 (i==0 || (data[i-1]!=
'@' && data[i-1]!=
'\\')))
2064 return i+endMarker.
length()+1;
2070 return i<len ? i+1 : len;
2084 if (c==
'@' || c==
'\\')
2091 while (j<len && (data[j]==
' ' || data[j]==
'\t')) j++;
2101 "@copy{} or @copydoc target '{}' found but is from a tag file, skipped",
2102 isBrief?
"brief":
"details",
id);
2107 auto it = std::find(
context.copyStack.begin(),
context.copyStack.end(),def);
2108 if (it==
context.copyStack.end())
2111 context.copyStack.push_back(def);
2114 result+=
" \\ifile \""+file_+
"\" ";
2116 size_t len_ = doc_.
length();
2136 result+=
" \\ilinebr \\ifile \""+
context.fileName+
"\" ";
2142 "Found recursive @copy{} or @copydoc relation for argument '{}'.",
2143 isBrief?
"brief":
"details",
id);
2149 "@copy{} or @copydoc target '{}' not found", isBrief?
"brief":
"details",
id);
2162 result+=
QCString(data+orgPos,i-orgPos);
2176 lineNr += (c==
'\n') ? 1 : 0;
2196 assert(parser!=
nullptr);
2197 if (parser==
nullptr)
return nullptr;
2294 size_t ioLen = input.
length();
2305 auto ast = std::make_unique<DocNodeAST>(
DocRoot(parser,md!=
nullptr,options.
singleLine()));
2306 std::get<DocRoot>(ast->root).parse();
2332 assert(parser!=
nullptr);
2333 if (parser==
nullptr)
return nullptr;
2365 auto ast = std::make_unique<DocNodeAST>(
DocTitle(parser,
nullptr));
2370 std::get<DocTitle>(ast->root).parseFromString(
nullptr,input);
2385 assert(parser!=
nullptr);
2386 if (parser==
nullptr)
return nullptr;
2420 auto ast = std::make_unique<DocNodeAST>(
DocText(parser));
2429 std::get<DocText>(ast->root).parse();
2444 assert(parser!=
nullptr);
2445 if (parser==
nullptr)
return nullptr;
2452 return std::make_unique<DocNodeAST>(
DocRef(parser,
nullptr,target,context));
This class represents an function or template argument list.
void push_back(const Argument &a)
constexpr void setNoCite() noexcept
static constexpr CiteInfoOption makeNumber()
constexpr void changeToNumber() noexcept
constexpr void setNoPar() noexcept
constexpr bool isUnknown() const noexcept
static constexpr CiteInfoOption makeYear()
static constexpr CiteInfoOption makeShortAuthor()
A abstract class representing of a compound symbol.
static bool isFlagSet(const DebugMask mask)
The common base class of all entity definitions found in the sources.
virtual QCString docFile() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual int docLine() const =0
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual QCString briefDescriptionAsTooltip() const =0
virtual int briefLine() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual QCString getReference() const =0
virtual QCString getSourceFileBase() const =0
virtual QCString documentation() const =0
virtual QCString qualifiedName() const =0
virtual QCString briefFile() const =0
virtual QCString getOutputFileBase() const =0
virtual bool isReference() const =0
virtual const QCString & name() const =0
Class representing a directory in the file system.
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Node representing an anchor.
Node representing a citation of some bibliographic reference.
Node representing a Hypertext reference.
Node representing an image.
Node representing an internal reference to some item.
Node representing a word that can be linked to something.
Node representing a paragraph in the documentation tree.
void markLast(bool v=TRUE)
std::stack< DocParserContext > contextStack
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children, size_t numberOfElementsToClose=0)
void handleInternalRef(DocNodeVariant *parent, DocNodeList &children)
void handleParameterType(DocNodeVariant *parent, DocNodeList &children, const QCString ¶mTypes)
QCString findAndCopyImage(const QCString &fileName, DocImage::Type type, bool doWarn=true)
QCString processCopyDoc(const char *data, size_t &len)
void readTextFileByName(const QCString &file, QCString &text)
bool defaultHandleToken(DocNodeVariant *parent, Token &tok, DocNodeList &children, bool handleWord=TRUE)
void handleRef(DocNodeVariant *parent, DocNodeList &children, char cmdChar, const QCString &cmdName)
Token handleAHref(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
Token internalValidatingParseDoc(DocNodeVariant *parent, DocNodeList &children, const QCString &doc)
void handleInitialStyleCommands(DocNodeVariant *parent, DocNodeList &children)
void handleStyleLeave(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName)
void checkUnOrMultipleDocumentedParams()
bool findDocsForMemberOrCompound(const QCString &commandName, QCString *pDoc, QCString *pBrief, const Definition **pDef)
void handleImage(DocNodeVariant *parent, DocNodeList &children)
void handleStyleEnter(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName, const HtmlAttribList *attribs)
void handleCite(DocNodeVariant *parent, DocNodeList &children)
void handlePrefix(DocNodeVariant *parent, DocNodeList &children)
Token handleStyleArgument(DocNodeVariant *parent, DocNodeList &children, const QCString &cmdName)
void handleIFile(char cmdChar, const QCString &cmdName)
void handleLinkedWord(DocNodeVariant *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE, bool typeLinkOnly=false)
void handleILine(char cmdChar, const QCString &cmdName)
void handleAnchor(DocNodeVariant *parent, DocNodeList &children)
void handleImg(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
void defaultHandleTitleAndSize(const CommandType cmd, DocNodeVariant *parent, DocNodeList &children, QCString &width, QCString &height)
void handleUnclosedStyleCommands()
void errorHandleDefaultToken(DocNodeVariant *parent, Token tok, DocNodeList &children, const QCString &txt)
Node representing a reference to some item.
Root node of documentation tree.
Node representing a separator.
Node representing a style change.
const char * styleString() const
const HtmlAttribList & attribs() const
Node representing a special symbol.
static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName)
Root node of a text fragment.
Node representing a simple section title.
void init(const char *input, const QCString &fileName, bool markdownSupport, bool insideHtmlLink)
void setLineNr(int lineno)
void setFileName(const QCString &fileName)
void findSections(const QCString &input, const Definition *d, const QCString &fileName)
Node representing a URL (or email address).
Node representing a verbatim, unparsed text fragment.
Node representing some amount of white space.
Node representing a word.
static NamespaceLinkedMap * namespaceLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
static ClassLinkedMap * classLinkedMap
static NamespaceDefMutable * globalScope
static FileNameLinkedMap * imageNameLinkedMap
static IndexList * indexList
static PageLinkedMap * pageLinkedMap
static FileNameLinkedMap * exampleNameLinkedMap
static SearchIndexIntf searchIndex
static GroupLinkedMap * groupLinkedMap
A model of a file symbol.
virtual QCString absFilePath() const =0
Minimal replacement for QFileInfo.
A model of a group of symbols.
virtual QCString groupTitle() const =0
T & back()
access the last element
void pop_back()
removes the last element
bool empty() const
checks whether the container is empty
Class representing a list of HTML attributes.
A model of a class/file/namespace member symbol.
virtual bool isObjCMethod() const =0
virtual const ClassDef * getClassDef() const =0
virtual bool isTypedef() const =0
virtual const ArgumentList & argumentList() const =0
virtual bool isFunction() const =0
virtual bool isDocsForDefinition() const =0
virtual QCString objCMethodName(bool localLink, bool showStatic) const =0
virtual const MemberDef * templateMaster() const =0
virtual bool isEnumerate() const =0
virtual void detectUndocumentedParams(bool hasParamCommand, bool hasReturnCommand) const =0
virtual const ArgumentList & declArgumentList() const =0
virtual bool isEnumValue() const =0
An abstract interface of a namespace symbol.
A model of a page symbol.
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
QCString & prepend(const char *s)
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool startsWith(const char *s) const
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
bool endsWith(const char *s) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const std::string & str() const
QCString & setNum(short n)
QCString right(size_t len) const
size_t size() const
Returns the length of the string, not counting the 0-terminator.
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
QCString & sprintf(const char *format,...)
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
std::string_view view() const
QCString left(size_t len) const
static RequirementManager & instance()
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
TokenRetval value() const
bool is_any_of(ARGS... args) const
char command_to_char() const
ClassDef * getClass(const QCString &n)
Class representing a regular expression.
Class to iterate through matches.
#define Config_getList(name)
#define Config_getBool(name)
#define Config_getString(name)
std::vector< std::string > StringVector
DirIterator end(const DirIterator &) noexcept
#define AUTO_TRACE_ADD(...)
#define AUTO_TRACE_EXIT(...)
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile, DocMermaidFile > DocNodeVariant
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
void docFindSections(const QCString &input, const Definition *d, const QCString &fileName)
static QCString extractCopyDocId(const char *data, size_t &j, size_t len)
IDocNodeASTPtr validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, const DocOptions &options)
static size_t skipToEndMarker(const char *data, size_t i, size_t len, const QCString &endMarker)
IDocNodeASTPtr validatingParseText(IDocParser &parserIntf, const QCString &input)
IDocParserPtr createDocParser()
factory function to create a parser
IDocNodeASTPtr createRef(IDocParser &parserIntf, const QCString &target, const QCString &context, const QCString &srcFile, int srcLine)
static size_t isVerbatimSection(const char *data, size_t i, size_t len, QCString &endMarker)
IDocNodeASTPtr validatingParseTitle(IDocParser &parserIntf, const QCString &fileName, int lineNr, const QCString &input)
static size_t isCopyBriefOrDetailsCmd(const char *data, size_t i, size_t len, bool &brief)
#define CHECK_FOR_COMMAND(str, action)
std::unique_ptr< IDocNodeAST > IDocNodeASTPtr
std::unique_ptr< IDocParser > IDocParserPtr
pointer to parser interface
Private header shared between docparser.cpp and docnode.cpp.
IterableStack< const DocNodeVariant * > DocStyleChangeStack
bool insidePRE(const DocNodeVariant *n)
bool insideLI(const DocNodeVariant *n)
FileDef * toFileDef(Definition *d)
GroupDef * toGroupDef(Definition *d)
MemberDef * toMemberDef(Definition *d)
#define warn_incomplete_doc(file, line, fmt,...)
#define warn(file, line, fmt,...)
#define warn_doc_error(file, line, fmt,...)
const Mapper< HtmlTagType > * htmlTagMapper
const Mapper< CommandType > * cmdMapper
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
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.
PageDef * toPageDef(Definition *d)
Portable versions of functions that are platform dependent.
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
int qstrncmp(const char *str1, const char *str2, size_t len)
const char * qPrint(const char *s)
uint32_t qstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
Some helper functions for std::string.
bool literal_at(const char *data, const char(&str)[N])
returns TRUE iff data points to a substring that matches string literal str
This class contains the information about the argument of a function or template.
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
bool autolinkSupport() const
bool linkFromIndex() const
bool markdownSupport() const
QCString exampleName() const
StringMultiSet retvalsFound
DocStyleChangeStack styleStack
StringMultiSet paramsFound
DocStyleChangeStack initialStyleStack
const MemberDef * memberDef
QCString removeRedundantWhiteSpace(const QCString &s)
QCString findFilePath(const QCString &file, bool &ambig)
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
bool resolveRef(const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, SrcLangExt lang, bool lookForSpecialization, const FileDef *currentFile, bool checkScope)
QCString relativePathToRoot(const QCString &name)
QCString showFileDefMatches(const FileNameLinkedMap *fnMap, const QCString &n)
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
QCString detab(const QCString &s, size_t &refIndent)
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
GetDefResult getDefs(const GetDefInput &input)
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
QCString inlineArgListToDoc(const ArgumentList &al)
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
A bunch of utility functions.