Doxygen
Loading...
Searching...
No Matches
DocParser Class Reference

#include <src/docparser_p.h>

Inheritance diagram for DocParser:
Collaboration diagram for DocParser:

Public Member Functions

void pushContext ()
void popContext ()
void handleImg (DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
Token internalValidatingParseDoc (DocNodeVariant *parent, DocNodeList &children, const QCString &doc)
QCString processCopyDoc (const char *data, size_t &len)
QCString findAndCopyImage (const QCString &fileName, DocImage::Type type, bool doWarn=true)
void checkArgumentName ()
void checkRetvalName ()
void checkUnOrMultipleDocumentedParams ()
bool findDocsForMemberOrCompound (const QCString &commandName, QCString *pDoc, QCString *pBrief, const Definition **pDef)
bool defaultHandleToken (DocNodeVariant *parent, Token tok, DocNodeList &children, bool handleWord=TRUE)
void errorHandleDefaultToken (DocNodeVariant *parent, Token tok, DocNodeList &children, const QCString &txt)
void defaultHandleTitleAndSize (const CommandType cmd, DocNodeVariant *parent, DocNodeList &children, QCString &width, QCString &height)
Token handleStyleArgument (DocNodeVariant *parent, DocNodeList &children, const QCString &cmdName)
void handleStyleEnter (DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName, const HtmlAttribList *attribs)
void handleStyleLeave (DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName)
void handlePendingStyleCommands (DocNodeVariant *parent, DocNodeList &children)
void handleInitialStyleCommands (DocNodeVariant *parent, DocNodeList &children)
Token handleAHref (DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
void handleUnclosedStyleCommands ()
void handleLinkedWord (DocNodeVariant *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE)
void handleParameterType (DocNodeVariant *parent, DocNodeList &children, const QCString &paramTypes)
void handleInternalRef (DocNodeVariant *parent, DocNodeList &children)
void handleAnchor (DocNodeVariant *parent, DocNodeList &children)
void handlePrefix (DocNodeVariant *parent, DocNodeList &children)
void handleImage (DocNodeVariant *parent, DocNodeList &children)
void handleRef (DocNodeVariant *parent, DocNodeList &children, char cmdChar, const QCString &cmdName)
void handleIFile (char cmdChar, const QCString &cmdName)
void handleILine (char cmdChar, const QCString &cmdName)
void readTextFileByName (const QCString &file, QCString &text)

Public Attributes

std::stack< DocParserContextcontextStack
DocParserContext context
DocTokenizer tokenizer

Detailed Description

Definition at line 99 of file docparser_p.h.

Member Function Documentation

◆ checkArgumentName()

void DocParser::checkArgumentName ( )

Collects the parameters found with @param command in a list context.paramsFound. If the parameter is not an actual parameter of the current member context.memberDef, then a warning is raised (unless warnings are disabled altogether).

Definition at line 210 of file docparser.cpp.

211{
212 if (!(Config_getBool(WARN_IF_DOC_ERROR) || Config_getBool(WARN_IF_INCOMPLETE_DOC))) return;
213 if (context.memberDef==nullptr) return; // not a member
214 std::string name = context.token->name.str();
215 const ArgumentList &al=context.memberDef->isDocsForDefinition() ?
216 context.memberDef->argumentList() :
217 context.memberDef->declArgumentList();
218 SrcLangExt lang = context.memberDef->getLanguage();
219 //printf("isDocsForDefinition()=%d\n",context.memberDef->isDocsForDefinition());
220 if (al.empty()) return; // no argument list
221
222 static const reg::Ex re(R"(\$?\w+\.*)");
223 reg::Iterator it(name,re);
224 reg::Iterator end;
225 for (; it!=end ; ++it)
226 {
227 const auto &match = *it;
228 QCString aName=match.str();
229 if (lang==SrcLangExt::Fortran) aName=aName.lower();
230 //printf("aName='%s'\n",qPrint(aName));
231 bool found=FALSE;
232 for (const Argument &a : al)
233 {
234 QCString argName = context.memberDef->isDefine() ? a.type : a.name;
235 if (lang==SrcLangExt::Fortran) argName=argName.lower();
236 argName=argName.stripWhiteSpace();
237 //printf("argName='%s' aName=%s\n",qPrint(argName),qPrint(aName));
238 if (argName.endsWith("...")) argName=argName.left(argName.length()-3);
239 if (aName==argName)
240 {
241 context.paramsFound.insert(aName.str());
242 found=TRUE;
243 break;
244 }
245 }
246 if (!found)
247 {
248 //printf("member type=%d\n",context.memberDef->memberType());
249 QCString scope=context.memberDef->getScopeString();
250 if (!scope.isEmpty()) scope+="::"; else scope="";
251 QCString inheritedFrom = "";
252 QCString docFile = context.memberDef->docFile();
253 int docLine = context.memberDef->docLine();
254 const MemberDef *inheritedMd = context.memberDef->inheritsDocsFrom();
255 if (inheritedMd) // documentation was inherited
256 {
257 inheritedFrom.sprintf(" inherited from member %s at line "
258 "%d in file %s",qPrint(inheritedMd->name()),
259 inheritedMd->docLine(),qPrint(inheritedMd->docFile()));
260 docFile = context.memberDef->getDefFileName();
261 docLine = context.memberDef->getDefLine();
262 }
263 QCString alStr = argListToString(al);
264 warn_doc_error(docFile,docLine,
265 "argument '{}' of command @param "
266 "is not found in the argument list of {}{}{}{}",
267 aName, scope, context.memberDef->name(),
268 alStr, inheritedFrom);
269 }
270 }
271}
bool empty() const
Definition arguments.h:99
virtual QCString docFile() const =0
virtual int docLine() const =0
virtual const QCString & name() const =0
DocParserContext context
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
QCString lower() const
Definition qcstring.h:249
bool endsWith(const char *s) const
Definition qcstring.h:524
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
const std::string & str() const
Definition qcstring.h:552
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
QCString left(size_t len) const
Definition qcstring.h:229
#define Config_getBool(name)
Definition config.h:33
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition regex.cpp:855
const char * qPrint(const char *s)
Definition qcstring.h:687
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
SrcLangExt
Definition types.h:207
QCString argListToString(const ArgumentList &al, bool useCanonicalType, bool showDefVals)
Definition util.cpp:1231

References argListToString(), Config_getBool, context, Definition::docFile(), Definition::docLine(), ArgumentList::empty(), end(), QCString::endsWith(), FALSE, QCString::isEmpty(), QCString::left(), QCString::length(), QCString::lower(), Definition::name(), qPrint(), QCString::sprintf(), QCString::str(), QCString::stripWhiteSpace(), TRUE, and warn_doc_error.

Referenced by DocParamList::parse(), and DocParamList::parseXml().

◆ checkRetvalName()

void DocParser::checkRetvalName ( )

Collects the return values found with @retval command in a global list g_parserContext.retvalsFound.

Definition at line 275 of file docparser.cpp.

276{
277 QCString name = context.token->name;
278 if (!Config_getBool(WARN_IF_DOC_ERROR)) return;
279 if (context.memberDef==nullptr || name.isEmpty()) return; // not a member or no valid name
280 if (context.retvalsFound.count(name.str())==1) // only report the first double entry
281 {
282 warn_doc_error(context.memberDef->getDefFileName(),
283 context.memberDef->getDefLine(),
284 "return value '{}' of {} has multiple documentation sections",
285 name, context.memberDef->qualifiedName());
286 }
287 context.retvalsFound.insert(name.str());
288}

References Config_getBool, context, QCString::isEmpty(), QCString::str(), and warn_doc_error.

Referenced by DocParamList::parse(), and DocParamList::parseXml().

◆ checkUnOrMultipleDocumentedParams()

void DocParser::checkUnOrMultipleDocumentedParams ( )

Checks if the parameters that have been specified using @param are indeed all parameters and that a parameter does not have multiple @param blocks. Must be called after checkArgumentName() has been called for each argument.

Definition at line 296 of file docparser.cpp.

297{
298 if (context.memberDef && context.hasParamCommand)
299 {
300 const ArgumentList &al=context.memberDef->isDocsForDefinition() ?
301 context.memberDef->argumentList() :
302 context.memberDef->declArgumentList();
303 SrcLangExt lang = context.memberDef->getLanguage();
304 if (!al.empty())
305 {
306 ArgumentList undocParams;
307 for (const Argument &a: al)
308 {
309 QCString argName = context.memberDef->isDefine() ? a.type : a.name;
310 if (lang==SrcLangExt::Fortran) argName = argName.lower();
311 argName=argName.stripWhiteSpace();
312 QCString aName = argName;
313 if (argName.endsWith("...")) argName=argName.left(argName.length()-3);
314 if (lang==SrcLangExt::Python && (argName=="self" || argName=="cls"))
315 {
316 // allow undocumented self / cls parameter for Python
317 }
318 else if (lang==SrcLangExt::Cpp && (a.type=="this" || a.type.startsWith("this ")))
319 {
320 // allow undocumented this (for C++23 deducing this), see issue #11123
321 }
322 else if (!argName.isEmpty())
323 {
324 size_t count = context.paramsFound.count(argName.str());
325 if (count==0 && a.docs.isEmpty())
326 {
327 undocParams.push_back(a);
328 }
329 else if (count>1 && Config_getBool(WARN_IF_DOC_ERROR))
330 {
331 warn_doc_error(context.memberDef->docFile(),
332 context.memberDef->docLine(),
333 "argument {} from the argument list of {} has multiple @param documentation sections",
334 aName, context.memberDef->qualifiedName());
335 }
336 }
337 }
338 if (!undocParams.empty() && Config_getBool(WARN_IF_INCOMPLETE_DOC))
339 {
340 bool first=TRUE;
341 QCString errMsg = "The following parameter";
342 if (undocParams.size()>1) errMsg+="s";
343 errMsg+=QCString(" of ")+
344 context.memberDef->qualifiedName() +
345 argListToString(al) +
346 (undocParams.size()>1 ? " are" : " is") + " not documented:\n";
347 for (const Argument &a : undocParams)
348 {
349 QCString argName = context.memberDef->isDefine() ? a.type : a.name;
350 if (lang==SrcLangExt::Fortran) argName = argName.lower();
351 argName=argName.stripWhiteSpace();
352 if (!first) errMsg+="\n";
353 first=FALSE;
354 errMsg+=" parameter '"+argName+"'";
355 }
356 warn_incomplete_doc(context.memberDef->docFile(), context.memberDef->docLine(), "{}", errMsg);
357 }
358 }
359 else
360 {
361 if (context.paramsFound.empty() && Config_getBool(WARN_IF_DOC_ERROR))
362 {
363 warn_doc_error(context.memberDef->docFile(),
364 context.memberDef->docLine(),
365 "{} has @param documentation sections but no arguments",
366 context.memberDef->qualifiedName());
367 }
368 }
369 }
370}
size_t size() const
Definition arguments.h:100
void push_back(const Argument &a)
Definition arguments.h:102
#define warn_incomplete_doc(file, line, fmt,...)
Definition message.h:107

References argListToString(), Config_getBool, context, ArgumentList::empty(), QCString::endsWith(), FALSE, QCString::isEmpty(), QCString::left(), QCString::length(), QCString::lower(), ArgumentList::push_back(), ArgumentList::size(), QCString::str(), QCString::stripWhiteSpace(), TRUE, warn_doc_error, and warn_incomplete_doc.

Referenced by validatingParseDoc().

◆ defaultHandleTitleAndSize()

void DocParser::defaultHandleTitleAndSize ( const CommandType cmd,
DocNodeVariant * parent,
DocNodeList & children,
QCString & width,
QCString & height )

Definition at line 1031 of file docparser.cpp.

1032{
1033 AUTO_TRACE();
1034 auto ns = AutoNodeStack(this,parent);
1035
1036 // parse title
1037 tokenizer.setStateTitle();
1038 Token tok = tokenizer.lex();
1039 while (!tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1040 {
1041 if (tok.is(TokenRetval::TK_WORD) && (context.token->name=="width=" || context.token->name=="height="))
1042 {
1043 // special case: no title, but we do have a size indicator
1044 break;
1045 }
1046 else if (tok.is(TokenRetval::TK_HTMLTAG))
1047 {
1048 tokenizer.unputString(context.token->text);
1049 break;
1050 }
1051 if (!defaultHandleToken(parent,tok,children))
1052 {
1053 errorHandleDefaultToken(parent,tok,children,Mappers::cmdMapper->find(cmd));
1054 }
1055 tok = tokenizer.lex();
1056 }
1057 // parse size attributes
1058 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1059 {
1060 tok=tokenizer.lex();
1061 }
1062 while (tok.is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG)) // there are values following the title
1063 {
1064 if (tok.is(TokenRetval::TK_WORD))
1065 {
1066 if (context.token->name=="width=" || context.token->name=="height=")
1067 {
1068 tokenizer.setStateTitleAttrValue();
1069 context.token->name = context.token->name.left(context.token->name.length()-1);
1070 }
1071
1072 if (context.token->name=="width")
1073 {
1074 width = context.token->chars;
1075 }
1076 else if (context.token->name=="height")
1077 {
1078 height = context.token->chars;
1079 }
1080 else // other text after the title -> treat as normal text
1081 {
1082 tokenizer.unputString(context.token->name);
1083 //warn_doc_error(context.fileName,tokenizer.getLineNr(),"Unknown option '{}' after \\{} command, expected 'width' or 'height'",
1084 // context.token->name, Mappers::cmdMapper->find(cmd));
1085 break;
1086 }
1087 }
1088
1089 tok=tokenizer.lex();
1090 // if we found something we did not expect, push it back to the stream
1091 // so it can still be processed
1092 if (tok.is_any_of(TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS))
1093 {
1094 tokenizer.unputString(context.token->name);
1095 tokenizer.unputString(tok.is(TokenRetval::TK_COMMAND_AT) ? "@" : "\\");
1096 break;
1097 }
1098 else if (tok.is(TokenRetval::TK_SYMBOL))
1099 {
1100 tokenizer.unputString(context.token->name);
1101 break;
1102 }
1103 else if (tok.is(TokenRetval::TK_HTMLTAG))
1104 {
1105 tokenizer.unputString(context.token->text);
1106 break;
1107 }
1108 }
1109 tokenizer.setStatePara();
1110
1112 AUTO_TRACE_EXIT("width={} height={}",width,height);
1113}
bool defaultHandleToken(DocNodeVariant *parent, Token tok, DocNodeList &children, bool handleWord=TRUE)
DocTokenizer tokenizer
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children)
void errorHandleDefaultToken(DocNodeVariant *parent, Token tok, DocNodeList &children, const QCString &txt)
bool is(TokenRetval rv) const
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:47
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:49
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1327
const Mapper< CommandType > * cmdMapper

References AUTO_TRACE, AUTO_TRACE_EXIT, Mappers::cmdMapper, context, defaultHandleToken(), errorHandleDefaultToken(), handlePendingStyleCommands(), Token::is(), Token::is_any_of(), parent(), and tokenizer.

Referenced by DocPara::handleCommand(), DocDiaFile::parse(), DocDotFile::parse(), DocImage::parse(), DocMscFile::parse(), and DocPlantUmlFile::parse().

◆ defaultHandleToken()

bool DocParser::defaultHandleToken ( DocNodeVariant * parent,
Token tok,
DocNodeList & children,
bool handleWord = TRUE )

Definition at line 1297 of file docparser.cpp.

1298{
1299 AUTO_TRACE("token={} handleWord={}",tok.to_string(),handleWord);
1300 if (tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD,TokenRetval::TK_SYMBOL,TokenRetval::TK_URL,
1301 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS,TokenRetval::TK_HTMLTAG)
1302 )
1303 {
1304 }
1305reparsetoken:
1306 QCString tokenName = context.token->name;
1307 AUTO_TRACE_ADD("tokenName={}",tokenName);
1308 switch (tok.value())
1309 {
1310 case TokenRetval::TK_COMMAND_AT:
1311 // fall through
1312 case TokenRetval::TK_COMMAND_BS:
1313 switch (Mappers::cmdMapper->map(tokenName))
1314 {
1316 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_BSlash);
1317 break;
1319 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_At);
1320 break;
1322 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Less);
1323 break;
1325 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Greater);
1326 break;
1328 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Amp);
1329 break;
1331 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Dollar);
1332 break;
1334 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Hash);
1335 break;
1337 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_DoubleColon);
1338 break;
1340 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Percent);
1341 break;
1343 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Minus);
1344 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Minus);
1345 break;
1347 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Minus);
1348 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Minus);
1349 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Minus);
1350 break;
1352 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Quot);
1353 break;
1355 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Dot);
1356 break;
1358 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Exclam);
1359 break;
1361 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Quest);
1362 break;
1364 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Plus);
1365 break;
1367 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Minus);
1368 break;
1370 children.append<DocSymbol>(this,parent,HtmlEntityMapper::Sym_Equal);
1371 break;
1373 {
1374 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),DocStyleChange::Italic,tokenName,TRUE);
1375 tok=handleStyleArgument(parent,children,tokenName);
1376 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),DocStyleChange::Italic,tokenName,FALSE);
1377 if (!tok.is(TokenRetval::TK_WORD)) children.append<DocWhiteSpace>(this,parent," ");
1378 if (tok.is(TokenRetval::TK_NEWPARA)) goto handlepara;
1379 else if (tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1380 {
1381 AUTO_TRACE_ADD("CommandType::CMD_EMPHASIS: reparsing");
1382 goto reparsetoken;
1383 }
1384 }
1385 break;
1387 {
1388 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),DocStyleChange::Bold,tokenName,TRUE);
1389 tok=handleStyleArgument(parent,children,tokenName);
1390 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),DocStyleChange::Bold,tokenName,FALSE);
1391 if (!tok.is(TokenRetval::TK_WORD)) children.append<DocWhiteSpace>(this,parent," ");
1392 if (tok.is(TokenRetval::TK_NEWPARA)) goto handlepara;
1393 else if (tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1394 {
1395 AUTO_TRACE_ADD("CommandType::CMD_BOLD: reparsing");
1396 goto reparsetoken;
1397 }
1398 }
1399 break;
1401 {
1402 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),DocStyleChange::Code,tokenName,TRUE);
1403 tok=handleStyleArgument(parent,children,tokenName);
1404 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),DocStyleChange::Code,tokenName,FALSE);
1405 if (!tok.is(TokenRetval::TK_WORD)) children.append<DocWhiteSpace>(this,parent," ");
1406 if (tok.is(TokenRetval::TK_NEWPARA)) goto handlepara;
1407 else if (tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_HTMLTAG))
1408 {
1409 AUTO_TRACE_ADD("CommandType::CMD_CODE: reparsing");
1410 goto reparsetoken;
1411 }
1412 }
1413 break;
1415 {
1416 tokenizer.setStateHtmlOnly();
1417 tok = tokenizer.lex();
1418 children.append<DocVerbatim>(this,parent,context.context,context.token->verb,DocVerbatim::HtmlOnly,context.isExample,context.exampleName,context.token->name=="block");
1419 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1420 {
1421 warn_doc_error(context.fileName,tokenizer.getLineNr(),"htmlonly section ended without end marker");
1422 }
1423 tokenizer.setStatePara();
1424 }
1425 break;
1427 {
1428 tokenizer.setStateManOnly();
1429 tok = tokenizer.lex();
1430 children.append<DocVerbatim>(this,parent,context.context,context.token->verb,DocVerbatim::ManOnly,context.isExample,context.exampleName);
1431 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1432 {
1433 warn_doc_error(context.fileName,tokenizer.getLineNr(),"manonly section ended without end marker");
1434 }
1435 tokenizer.setStatePara();
1436 }
1437 break;
1439 {
1440 tokenizer.setStateRtfOnly();
1441 tok = tokenizer.lex();
1442 children.append<DocVerbatim>(this,parent,context.context,context.token->verb,DocVerbatim::RtfOnly,context.isExample,context.exampleName);
1443 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1444 {
1445 warn_doc_error(context.fileName,tokenizer.getLineNr(),"rtfonly section ended without end marker");
1446 }
1447 tokenizer.setStatePara();
1448 }
1449 break;
1451 {
1452 tokenizer.setStateLatexOnly();
1453 tok = tokenizer.lex();
1454 children.append<DocVerbatim>(this,parent,context.context,context.token->verb,DocVerbatim::LatexOnly,context.isExample,context.exampleName);
1455 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1456 {
1457 warn_doc_error(context.fileName,tokenizer.getLineNr(),"latexonly section ended without end marker");
1458 }
1459 tokenizer.setStatePara();
1460 }
1461 break;
1463 {
1464 tokenizer.setStateXmlOnly();
1465 tok = tokenizer.lex();
1466 children.append<DocVerbatim>(this,parent,context.context,context.token->verb,DocVerbatim::XmlOnly,context.isExample,context.exampleName);
1467 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1468 {
1469 warn_doc_error(context.fileName,tokenizer.getLineNr(),"xmlonly section ended without end marker");
1470 }
1471 tokenizer.setStatePara();
1472 }
1473 break;
1475 {
1476 tokenizer.setStateDbOnly();
1477 tok = tokenizer.lex();
1478 children.append<DocVerbatim>(this,parent,context.context,context.token->verb,DocVerbatim::DocbookOnly,context.isExample,context.exampleName);
1479 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1480 {
1481 warn_doc_error(context.fileName,tokenizer.getLineNr(),"docbookonly section ended without end marker");
1482 }
1483 tokenizer.setStatePara();
1484 }
1485 break;
1487 {
1488 children.append<DocFormula>(this,parent,context.token->id);
1489 }
1490 break;
1493 {
1494 handleAnchor(parent,children);
1495 }
1496 break;
1498 {
1499 handlePrefix(parent,children);
1500 }
1501 break;
1503 {
1504 handleInternalRef(parent,children);
1505 tokenizer.setStatePara();
1506 }
1507 break;
1509 {
1510 tokenizer.setStateSetScope();
1511 (void)tokenizer.lex();
1512 context.context = context.token->name;
1513 //printf("Found scope='%s'\n",qPrint(context.context));
1514 tokenizer.setStatePara();
1515 }
1516 break;
1518 handleImage(parent,children);
1519 break;
1521 handleILine(tok.command_to_char(),tokenName);
1522 break;
1524 handleIFile(tok.command_to_char(),tokenName);
1525 break;
1526 default:
1527 return FALSE;
1528 }
1529 break;
1530 case TokenRetval::TK_HTMLTAG:
1531 {
1532 auto handleEnterLeaveStyle = [this,&parent,&children,&tokenName](DocStyleChange::Style style) {
1533 if (!context.token->endTag)
1534 {
1535 handleStyleEnter(parent,children,style,tokenName,&context.token->attribs);
1536 }
1537 else
1538 {
1539 handleStyleLeave(parent,children,style,tokenName);
1540 }
1541 };
1542 switch (Mappers::htmlTagMapper->map(tokenName))
1543 {
1545 warn_doc_error(context.fileName,tokenizer.getLineNr(),"found <div> tag in heading");
1546 break;
1548 warn_doc_error(context.fileName,tokenizer.getLineNr(),"found <pre> tag in heading");
1549 break;
1551 handleEnterLeaveStyle(DocStyleChange::Span);
1552 break;
1554 handleEnterLeaveStyle(DocStyleChange::Bold);
1555 break;
1557 handleEnterLeaveStyle(DocStyleChange::S);
1558 break;
1560 handleEnterLeaveStyle(DocStyleChange::Strike);
1561 break;
1563 handleEnterLeaveStyle(DocStyleChange::Del);
1564 break;
1566 handleEnterLeaveStyle(DocStyleChange::Underline);
1567 break;
1569 handleEnterLeaveStyle(DocStyleChange::Ins);
1570 break;
1572 case HtmlTagType::XML_C:
1573 handleEnterLeaveStyle(DocStyleChange::Code);
1574 break;
1576 handleEnterLeaveStyle(DocStyleChange::Kbd);
1577 break;
1579 handleEnterLeaveStyle(DocStyleChange::Typewriter);
1580 break;
1582 handleEnterLeaveStyle(DocStyleChange::Italic);
1583 break;
1585 handleEnterLeaveStyle(DocStyleChange::Subscript);
1586 break;
1588 handleEnterLeaveStyle(DocStyleChange::Superscript);
1589 break;
1591 handleEnterLeaveStyle(DocStyleChange::Center);
1592 break;
1594 handleEnterLeaveStyle(DocStyleChange::Small);
1595 break;
1597 handleEnterLeaveStyle(DocStyleChange::Cite);
1598 break;
1600 if (!context.token->endTag)
1601 {
1602 handleImg(parent,children,context.token->attribs);
1603 }
1604 break;
1605 default:
1606 return FALSE;
1607 break;
1608 }
1609 }
1610 break;
1611 case TokenRetval::TK_SYMBOL:
1612 {
1615 {
1616 children.append<DocSymbol>(this,parent,s);
1617 }
1618 else
1619 {
1620 return FALSE;
1621 }
1622 }
1623 break;
1624 case TokenRetval::TK_WHITESPACE:
1625 case TokenRetval::TK_NEWPARA:
1626handlepara:
1627 if (insidePRE(parent) || !children.empty())
1628 {
1629 children.append<DocWhiteSpace>(this,parent,context.token->chars);
1630 }
1631 break;
1632 case TokenRetval::TK_LNKWORD:
1633 if (handleWord)
1634 {
1635 handleLinkedWord(parent,children);
1636 }
1637 else
1638 return FALSE;
1639 break;
1640 case TokenRetval::TK_WORD:
1641 if (handleWord)
1642 {
1643 children.append<DocWord>(this,parent,context.token->name);
1644 }
1645 else
1646 return FALSE;
1647 break;
1648 case TokenRetval::TK_URL:
1649 if (context.insideHtmlLink)
1650 {
1651 children.append<DocWord>(this,parent,context.token->name);
1652 }
1653 else
1654 {
1655 children.append<DocURL>(this,parent,context.token->name,context.token->isEMailAddr);
1656 }
1657 break;
1658 default:
1659 return FALSE;
1660 }
1661 return TRUE;
1662}
void handleLinkedWord(DocNodeVariant *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE)
void handleInternalRef(DocNodeVariant *parent, DocNodeList &children)
void handleStyleLeave(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName)
void handleImage(DocNodeVariant *parent, DocNodeList &children)
void handleStyleEnter(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName, const HtmlAttribList *attribs)
void handlePrefix(DocNodeVariant *parent, DocNodeList &children)
Token handleStyleArgument(DocNodeVariant *parent, DocNodeList &children, const QCString &cmdName)
void handleIFile(char cmdChar, const QCString &cmdName)
void handleILine(char cmdChar, const QCString &cmdName)
void handleAnchor(DocNodeVariant *parent, DocNodeList &children)
void handleImg(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName)
Definition docnode.cpp:153
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
TokenRetval value() const
char command_to_char() const
@ CMD_INTERNALREF
Definition cmdmapper.h:65
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:48
bool insidePRE(const DocNodeVariant *n)
const Mapper< HtmlTagType > * htmlTagMapper
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1396

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_ADD, DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, CMD_AMP, CMD_ANCHOR, CMD_AT, CMD_BOLD, CMD_BSLASH, CMD_CODE, CMD_DBONLY, CMD_DCOLON, CMD_DOLLAR, CMD_EMPHASIS, CMD_EQUAL, CMD_EXCLAMATION, CMD_FORMULA, CMD_GREATER, CMD_HASH, CMD_HTMLONLY, CMD_IANCHOR, CMD_IFILE, CMD_ILINE, CMD_IMAGE, CMD_INTERNALREF, CMD_IPREFIX, CMD_LATEXONLY, CMD_LESS, CMD_MANONLY, CMD_MDASH, CMD_MINUS, CMD_NDASH, CMD_PERCENT, CMD_PLUS, CMD_PUNT, CMD_QUESTION, CMD_QUOTE, CMD_RTFONLY, CMD_SETSCOPE, CMD_XMLONLY, Mappers::cmdMapper, DocStyleChange::Code, Token::command_to_char(), context, DocSymbol::decodeSymbol(), DocStyleChange::Del, DocVerbatim::DocbookOnly, GrowVector< T >::empty(), FALSE, handleAnchor(), handleIFile(), handleILine(), handleImage(), handleImg(), handleInternalRef(), handleLinkedWord(), handlePrefix(), handleStyleArgument(), handleStyleEnter(), handleStyleLeave(), HTML_BOLD, HTML_CENTER, HTML_CITE, HTML_CODE, HTML_DEL, HTML_DIV, HTML_EMPHASIS, HTML_IMG, HTML_INS, HTML_KBD, HTML_PRE, HTML_S, HTML_SMALL, HTML_SPAN, HTML_STRIKE, HTML_SUB, HTML_SUP, HTML_TT, HTML_UNDERLINE, DocVerbatim::HtmlOnly, Mappers::htmlTagMapper, DocStyleChange::Ins, insidePRE(), Token::is(), Token::is_any_of(), DocStyleChange::Italic, DocStyleChange::Kbd, DocVerbatim::LatexOnly, DocVerbatim::ManOnly, parent(), DocVerbatim::RtfOnly, DocStyleChange::S, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::Subscript, DocStyleChange::Superscript, HtmlEntityMapper::Sym_Amp, HtmlEntityMapper::Sym_At, HtmlEntityMapper::Sym_BSlash, HtmlEntityMapper::Sym_Dollar, HtmlEntityMapper::Sym_Dot, HtmlEntityMapper::Sym_DoubleColon, HtmlEntityMapper::Sym_Equal, HtmlEntityMapper::Sym_Exclam, HtmlEntityMapper::Sym_Greater, HtmlEntityMapper::Sym_Hash, HtmlEntityMapper::Sym_Less, HtmlEntityMapper::Sym_Minus, HtmlEntityMapper::Sym_Percent, HtmlEntityMapper::Sym_Plus, HtmlEntityMapper::Sym_Quest, HtmlEntityMapper::Sym_Quot, HtmlEntityMapper::Sym_Unknown, Token::to_string(), tokenizer, TRUE, DocStyleChange::Typewriter, DocStyleChange::Underline, Token::value(), warn_doc_error, XML_C, and DocVerbatim::XmlOnly.

Referenced by defaultHandleTitleAndSize(), handleStyleArgument(), and DocPara::injectToken().

◆ errorHandleDefaultToken()

void DocParser::errorHandleDefaultToken ( DocNodeVariant * parent,
Token tok,
DocNodeList & children,
const QCString & txt )

Definition at line 538 of file docparser.cpp.

540{
541 switch (tok.value())
542 {
543 case TokenRetval::TK_COMMAND_AT:
544 // fall through
545 case TokenRetval::TK_COMMAND_BS:
546 {
547 char cs[2] = { tok.command_to_char(), 0 };
548 children.append<DocWord>(this,parent,cs + context.token->name);
549 warn_doc_error(context.fileName,tokenizer.getLineNr(),"Illegal command '{:c}{}' found as part of a {}",
550 tok.command_to_char(),context.token->name,txt);
551 }
552 break;
553 case TokenRetval::TK_SYMBOL:
554 warn_doc_error(context.fileName,tokenizer.getLineNr(),"Unsupported symbol '{}' found as part of a {}",
555 qPrint(context.token->name), qPrint(txt));
556 break;
557 case TokenRetval::TK_HTMLTAG:
558 warn_doc_error(context.fileName,tokenizer.getLineNr(),"Unsupported HTML tag <{}{}> found as part of a {}",
559 context.token->endTag ? "/" : "",context.token->name, txt);
560 break;
561 default:
562 children.append<DocWord>(this,parent,context.token->name);
563 warn_doc_error(context.fileName,tokenizer.getLineNr(),"Unexpected token {} found as part of a {}",
564 tok.to_string(), txt);
565 break;
566 }
567}

References DocNodeList::append(), Token::command_to_char(), context, parent(), qPrint(), Token::to_string(), tokenizer, Token::value(), and warn_doc_error.

Referenced by defaultHandleTitleAndSize(), handleStyleArgument(), DocHRef::parse(), DocHtmlCaption::parse(), DocHtmlHeader::parse(), DocHtmlSummary::parse(), DocInternalRef::parse(), DocRef::parse(), DocSecRefItem::parse(), DocTitle::parse(), and DocVhdlFlow::parse().

◆ findAndCopyImage()

QCString DocParser::findAndCopyImage ( const QCString & fileName,
DocImage::Type type,
bool doWarn = true )

search for an image in the imageNameDict and if found copies the image to the output directory (which depends on the type parameter).

Definition at line 96 of file docparser.cpp.

97{
98 QCString result;
99 bool ambig = false;
100 FileDef *fd = findFileDef(Doxygen::imageNameLinkedMap,fileName,ambig);
101 //printf("Search for %s\n",fileName);
102 if (fd)
103 {
104 if (ambig & doWarn)
105 {
106 warn_doc_error(context.fileName,tokenizer.getLineNr(),
107 "image file name '{}' is ambiguous.\n"
108 "Possible candidates:\n{}", fileName,showFileDefMatches(Doxygen::imageNameLinkedMap,fileName));
109 }
110
111 QCString inputFile = fd->absFilePath();
112 FileInfo infi(inputFile.str());
113 if (infi.exists())
114 {
115 result = fileName;
116 int i = result.findRev('/');
117 if (i!=-1 || (i=result.findRev('\\'))!=-1)
118 {
119 result = result.right(static_cast<int>(result.length())-i-1);
120 }
121 //printf("fileName=%s result=%s\n",fileName,qPrint(result));
122 QCString outputDir;
123 switch(type)
124 {
125 case DocImage::Html:
126 if (!Config_getBool(GENERATE_HTML)) return result;
127 outputDir = Config_getString(HTML_OUTPUT);
128 break;
129 case DocImage::Latex:
130 if (!Config_getBool(GENERATE_LATEX)) return result;
131 outputDir = Config_getString(LATEX_OUTPUT);
132 break;
134 if (!Config_getBool(GENERATE_DOCBOOK)) return result;
135 outputDir = Config_getString(DOCBOOK_OUTPUT);
136 break;
137 case DocImage::Rtf:
138 if (!Config_getBool(GENERATE_RTF)) return result;
139 outputDir = Config_getString(RTF_OUTPUT);
140 break;
141 case DocImage::Xml:
142 if (!Config_getBool(GENERATE_XML)) return result;
143 outputDir = Config_getString(XML_OUTPUT);
144 break;
145 }
146 QCString outputFile = outputDir+"/"+result;
147 FileInfo outfi(outputFile.str());
148 if (outfi.isSymLink())
149 {
150 Dir().remove(outputFile.str());
151 warn_doc_error(context.fileName,tokenizer.getLineNr(),
152 "destination of image {} is a symlink, replacing with image",
153 outputFile);
154 }
155 if (outputFile!=inputFile) // prevent copying to ourself
156 {
157 if (copyFile(inputFile,outputFile) && type==DocImage::Html)
158 {
160 }
161 }
162 }
163 else
164 {
165 warn_doc_error(context.fileName,tokenizer.getLineNr(),
166 "could not open image {}",fileName);
167 }
168
169 if (type==DocImage::Latex && Config_getBool(USE_PDFLATEX) &&
170 fd->name().endsWith(".eps")
171 )
172 { // we have an .eps image in pdflatex mode => convert it to a pdf.
173 QCString outputDir = Config_getString(LATEX_OUTPUT);
174 QCString baseName = fd->name().left(fd->name().length()-4);
175 QCString epstopdfArgs(4096, QCString::ExplicitSize);
176 epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"",
177 qPrint(outputDir), qPrint(baseName),
178 qPrint(outputDir), qPrint(baseName));
179 if (Portable::system("epstopdf",epstopdfArgs)!=0)
180 {
181 err("Problems running epstopdf. Check your TeX installation!\n");
182 }
183 else
184 {
185 Dir().remove(outputDir.str()+"/"+baseName.str()+".eps");
186 }
187 return baseName;
188 }
189 }
190 else
191 {
192 result=fileName;
193 if (!result.startsWith("http:") && !result.startsWith("https:") && doWarn)
194 {
195 warn_doc_error(context.fileName,tokenizer.getLineNr(),
196 "image file {} is not found in IMAGE_PATH: "
197 "assuming external image.",fileName
198 );
199 }
200 }
201 return result;
202}
@ DocBook
Definition docnode.h:644
static FileNameLinkedMap * imageNameLinkedMap
Definition doxygen.h:105
static IndexList * indexList
Definition doxygen.h:133
virtual QCString absFilePath() const =0
void addImageFile(const QCString &name)
Definition indexlist.h:123
QCString right(size_t len) const
Definition qcstring.h:234
@ ExplicitSize
Definition qcstring.h:146
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
#define Config_getString(name)
Definition config.h:32
#define err(fmt,...)
Definition message.h:127
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition portable.cpp:106
QCString showFileDefMatches(const FileNameLinkedMap *fnMap, const QCString &n)
Definition util.cpp:2999
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:5857
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition util.cpp:2871

References FileDef::absFilePath(), Config_getBool, Config_getString, context, copyFile(), DocImage::DocBook, QCString::endsWith(), err, FileInfo::exists(), QCString::ExplicitSize, findFileDef(), QCString::findRev(), DocImage::Html, Doxygen::imageNameLinkedMap, Doxygen::indexList, FileInfo::isSymLink(), DocImage::Latex, QCString::left(), QCString::length(), Definition::name(), qPrint(), Dir::remove(), QCString::right(), DocImage::Rtf, showFileDefMatches(), QCString::sprintf(), QCString::startsWith(), QCString::str(), Portable::system(), tokenizer, warn_doc_error, and DocImage::Xml.

Referenced by handleImage(), and handleImg().

◆ findDocsForMemberOrCompound()

bool DocParser::findDocsForMemberOrCompound ( const QCString & commandName,
QCString * pDoc,
QCString * pBrief,
const Definition ** pDef )

Looks for a documentation block with name commandName in the current context (g_parserContext.context). The resulting documentation string is put in pDoc, the definition in which the documentation was found is put in pDef.

Return values
TRUEif name was found.
FALSEif name was not found.

Definition at line 385 of file docparser.cpp.

389{
390 AUTO_TRACE("commandName={}",commandName);
391 *pDoc="";
392 *pBrief="";
393 *pDef=nullptr;
394 QCString cmdArg=commandName;
395 if (cmdArg.isEmpty())
396 {
397 AUTO_TRACE_EXIT("empty");
398 return false;
399 }
400
401 const FileDef *fd=nullptr;
402 const GroupDef *gd=nullptr;
403 const PageDef *pd=nullptr;
404 gd = Doxygen::groupLinkedMap->find(cmdArg);
405 if (gd) // group
406 {
407 *pDoc=gd->documentation();
408 *pBrief=gd->briefDescription();
409 *pDef=gd;
410 AUTO_TRACE_EXIT("group");
411 return true;
412 }
413 pd = Doxygen::pageLinkedMap->find(cmdArg);
414 if (pd) // page
415 {
416 *pDoc=pd->documentation();
417 *pBrief=pd->briefDescription();
418 *pDef=pd;
419 AUTO_TRACE_EXIT("page");
420 return true;
421 }
422 bool ambig = false;
423 fd = findFileDef(Doxygen::inputNameLinkedMap,cmdArg,ambig);
424 if (fd && !ambig) // file
425 {
426 *pDoc=fd->documentation();
427 *pBrief=fd->briefDescription();
428 *pDef=fd;
429 AUTO_TRACE_EXIT("file");
430 return true;
431 }
432
433 // for symbols we need to normalize the separator, so A#B, or A\B, or A.B becomes A::B
434 cmdArg = substitute(cmdArg,"#","::");
435 cmdArg = substitute(cmdArg,"\\","::");
436 bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
437 if (extractAnonNs &&
438 cmdArg.startsWith("anonymous_namespace{")
439 )
440 {
441 size_t rightBracePos = cmdArg.find("}", static_cast<int>(qstrlen("anonymous_namespace{")));
442 QCString leftPart = cmdArg.left(rightBracePos + 1);
443 QCString rightPart = cmdArg.right(cmdArg.size() - rightBracePos - 1);
444 rightPart = substitute(rightPart, ".", "::");
445 cmdArg = leftPart + rightPart;
446 }
447 else
448 {
449 cmdArg = substitute(cmdArg,".","::");
450 }
451
452 int l=static_cast<int>(cmdArg.length());
453
454 int funcStart=cmdArg.find('(');
455 if (funcStart==-1)
456 {
457 funcStart=l;
458 }
459 else
460 {
461 // Check for the case of operator() and the like.
462 // beware of scenarios like operator()((foo)bar)
463 int secondParen = cmdArg.find('(', funcStart+1);
464 int leftParen = cmdArg.find(')', funcStart+1);
465 if (leftParen!=-1 && secondParen!=-1)
466 {
467 if (leftParen<secondParen)
468 {
469 funcStart=secondParen;
470 }
471 }
472 }
473
474 QCString name=removeRedundantWhiteSpace(cmdArg.left(funcStart));
475 QCString args=cmdArg.right(l-funcStart);
476 // try if the link is to a member
477 GetDefInput input(
478 context.context.find('.')==-1 ? context.context : QCString(), // find('.') is a hack to detect files
479 name,
480 args);
481 input.checkCV=true;
482 GetDefResult result = getDefs(input);
483 //printf("found=%d context=%s name=%s\n",result.found,qPrint(context.context),qPrint(name));
484 if (result.found && result.md)
485 {
486 *pDoc=result.md->documentation();
487 *pBrief=result.md->briefDescription();
488 *pDef=result.md;
489 AUTO_TRACE_EXIT("member");
490 return true;
491 }
492
493 int scopeOffset=static_cast<int>(context.context.length());
494 do // for each scope
495 {
496 QCString fullName=cmdArg;
497 if (scopeOffset>0)
498 {
499 fullName.prepend(context.context.left(scopeOffset)+"::");
500 }
501 //printf("Trying fullName='%s'\n",qPrint(fullName));
502
503 // try class, namespace, group, page, file reference
504 const ClassDef *cd = Doxygen::classLinkedMap->find(fullName);
505 if (cd) // class
506 {
507 *pDoc=cd->documentation();
508 *pBrief=cd->briefDescription();
509 *pDef=cd;
510 AUTO_TRACE_EXIT("class");
511 return true;
512 }
513 const NamespaceDef *nd = Doxygen::namespaceLinkedMap->find(fullName);
514 if (nd) // namespace
515 {
516 *pDoc=nd->documentation();
517 *pBrief=nd->briefDescription();
518 *pDef=nd;
519 AUTO_TRACE_EXIT("namespace");
520 return true;
521 }
522 if (scopeOffset==0)
523 {
524 scopeOffset=-1;
525 }
526 else
527 {
528 scopeOffset = context.context.findRev("::",scopeOffset-1);
529 if (scopeOffset==-1) scopeOffset=0;
530 }
531 } while (scopeOffset>=0);
532
533 AUTO_TRACE_EXIT("not found");
534 return FALSE;
535}
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual QCString documentation() const =0
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:114
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:104
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:95
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:99
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:113
const T * find(const std::string &key) const
Definition linkedmap.h:47
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:422
bool startsWith(const char *s) const
Definition qcstring.h:507
size_t size() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:169
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:571
uint32_t qstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
Definition qcstring.h:58
const MemberDef * md
Definition util.h:124
bool found
Definition util.h:123
QCString removeRedundantWhiteSpace(const QCString &s)
Definition util.cpp:568
GetDefResult getDefs(const GetDefInput &input)
Definition util.cpp:2275

References AUTO_TRACE, AUTO_TRACE_EXIT, Definition::briefDescription(), GetDefInput::checkCV, Doxygen::classLinkedMap, Config_getBool, context, Definition::documentation(), FALSE, QCString::find(), findFileDef(), GetDefResult::found, getDefs(), Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, QCString::isEmpty(), QCString::left(), QCString::length(), GetDefResult::md, Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, QCString::prepend(), qstrlen(), removeRedundantWhiteSpace(), QCString::right(), QCString::size(), QCString::startsWith(), and substitute().

Referenced by processCopyDoc().

◆ handleAHref()

Token DocParser::handleAHref ( DocNodeVariant * parent,
DocNodeList & children,
const HtmlAttribList & tagHtmlAttribs )

Definition at line 715 of file docparser.cpp.

717{
718 AUTO_TRACE();
719 size_t index=0;
720 Token retval = Token::make_RetVal_OK();
721 for (const auto &opt : tagHtmlAttribs)
722 {
723 if (opt.name=="name" || opt.name=="id") // <a name=label> or <a id=label> tag
724 {
725 if (!opt.value.isEmpty())
726 {
727 children.append<DocAnchor>(this,parent,opt.value,TRUE);
728 break; // stop looking for other tag attribs
729 }
730 else
731 {
732 warn_doc_error(context.fileName,tokenizer.getLineNr(),"found <a> tag with name option but without value!");
733 }
734 }
735 else if (opt.name=="href") // <a href=url>..</a> tag
736 {
737 // copy attributes
738 HtmlAttribList attrList = tagHtmlAttribs;
739 // and remove the href attribute
740 attrList.erase(attrList.begin()+index);
741 QCString relPath;
742 if (opt.value.at(0) != '#') relPath = context.relPath;
743 children.append<DocHRef>(this, parent, attrList,
744 opt.value, relPath,
745 convertNameToFile(context.fileName, FALSE, TRUE));
746 context.insideHtmlLink=TRUE;
747 retval = children.get_last<DocHRef>()->parse();
748 context.insideHtmlLink=FALSE;
749 tokenizer.setStatePara();
750 break;
751 }
752 else // unsupported option for tag a
753 {
754 }
755 ++index;
756 }
757 return retval;
758}
bool parse(const QCString &fileName, bool update=FALSE, CompareMode compareMode=CompareMode::Full)
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1407
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition util.cpp:3485

References DocNodeList::append(), AUTO_TRACE, context, convertNameToFile(), FALSE, DocNodeList::get_last(), parent(), tokenizer, TRUE, and warn_doc_error.

Referenced by DocPara::handleHtmlStartTag(), DocHtmlDescTitle::parse(), and DocHtmlHeader::parse().

◆ handleAnchor()

void DocParser::handleAnchor ( DocNodeVariant * parent,
DocNodeList & children )

Definition at line 967 of file docparser.cpp.

968{
969 AUTO_TRACE();
970 Token tok=tokenizer.lex();
971 if (!tok.is(TokenRetval::TK_WHITESPACE))
972 {
973 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\{} command",
974 context.token->name);
975 return;
976 }
977 tokenizer.setStateAnchor();
978 tok=tokenizer.lex();
979 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
980 {
981 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
982 "argument of command {}",context.token->name);
983 return;
984 }
985 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
986 {
987 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of {}",
988 tok.to_string(),context.token->name);
989 return;
990 }
991 tokenizer.setStatePara();
992 children.append<DocAnchor>(this,parent,context.token->name,FALSE);
993}

References DocNodeList::append(), AUTO_TRACE, context, FALSE, Token::is(), Token::is_any_of(), parent(), Token::to_string(), tokenizer, and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleIFile()

void DocParser::handleIFile ( char cmdChar,
const QCString & cmdName )

Definition at line 1249 of file docparser.cpp.

1250{
1251 AUTO_TRACE();
1252 Token tok=tokenizer.lex();
1253 if (!tok.is(TokenRetval::TK_WHITESPACE))
1254 {
1255 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
1256 cmdChar,cmdName);
1257 return;
1258 }
1259 tokenizer.setStateFile();
1260 tok=tokenizer.lex();
1261 tokenizer.setStatePara();
1262 if (!tok.is(TokenRetval::TK_WORD))
1263 {
1264 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}'",
1265 tok.to_string(),cmdChar,cmdName);
1266 return;
1267 }
1268 context.fileName = context.token->name;
1269 tokenizer.setStatePara();
1270}

References AUTO_TRACE, context, Token::is(), Token::to_string(), tokenizer, and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleILine()

void DocParser::handleILine ( char cmdChar,
const QCString & cmdName )

Definition at line 1272 of file docparser.cpp.

1273{
1274 AUTO_TRACE();
1275 tokenizer.setStateILine();
1276 Token tok = tokenizer.lex();
1277 if (!tok.is(TokenRetval::TK_WORD))
1278 {
1279 warn_doc_error(context.fileName,tokenizer.getLineNr(),"invalid argument for command '{:c}{}'",
1280 cmdChar,cmdName);
1281 return;
1282 }
1283 tokenizer.setStatePara();
1284}

References AUTO_TRACE, context, Token::is(), tokenizer, and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleImage()

void DocParser::handleImage ( DocNodeVariant * parent,
DocNodeList & children )

Definition at line 1115 of file docparser.cpp.

1116{
1117 AUTO_TRACE();
1118 bool inlineImage = false;
1119 QCString anchorStr;
1120
1121 Token tok=tokenizer.lex();
1122 if (!tok.is(TokenRetval::TK_WHITESPACE))
1123 {
1124 if (tok.is(TokenRetval::TK_WORD))
1125 {
1126 if (context.token->name == "{")
1127 {
1128 tokenizer.setStateOptions();
1129 tokenizer.lex();
1130 tokenizer.setStatePara();
1131 StringVector optList=split(context.token->name.str(),",");
1132 for (const auto &opt : optList)
1133 {
1134 if (opt.empty()) continue;
1135 QCString locOpt(opt);
1136 QCString locOptLow;
1137 locOpt = locOpt.stripWhiteSpace();
1138 locOptLow = locOpt.lower();
1139 if (locOptLow == "inline")
1140 {
1141 inlineImage = true;
1142 }
1143 else if (locOptLow.startsWith("anchor:"))
1144 {
1145 if (!anchorStr.isEmpty())
1146 {
1147 warn_doc_error(context.fileName,tokenizer.getLineNr(),
1148 "multiple use of option 'anchor' for 'image' command, ignoring: '{}'",
1149 locOpt.mid(7));
1150 }
1151 else
1152 {
1153 anchorStr = locOpt.mid(7);
1154 }
1155 }
1156 else
1157 {
1158 warn_doc_error(context.fileName,tokenizer.getLineNr(),
1159 "unknown option '{}' for 'image' command specified",
1160 locOpt);
1161 }
1162 }
1163 tok=tokenizer.lex();
1164 if (!tok.is(TokenRetval::TK_WHITESPACE))
1165 {
1166 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\image command");
1167 return;
1168 }
1169 }
1170 }
1171 else
1172 {
1173 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\image command");
1174 return;
1175 }
1176 }
1177 tok=tokenizer.lex();
1178 if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
1179 {
1180 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of \\image",
1181 tok.to_string());
1182 return;
1183 }
1184 tok=tokenizer.lex();
1185 if (!tok.is(TokenRetval::TK_WHITESPACE))
1186 {
1187 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\image command");
1188 return;
1189 }
1191 QCString imgType = context.token->name.lower();
1192 if (imgType=="html") t=DocImage::Html;
1193 else if (imgType=="latex") t=DocImage::Latex;
1194 else if (imgType=="docbook") t=DocImage::DocBook;
1195 else if (imgType=="rtf") t=DocImage::Rtf;
1196 else if (imgType=="xml") t=DocImage::Xml;
1197 else
1198 {
1199 warn_doc_error(context.fileName,tokenizer.getLineNr(),"output format `{}` specified as the first argument of "
1200 "\\image command is not valid", imgType);
1201 return;
1202 }
1203 tokenizer.setStateFile();
1204 tok=tokenizer.lex();
1205 tokenizer.setStatePara();
1206 if (!tok.is(TokenRetval::TK_WORD))
1207 {
1208 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of \\image", tok.to_string());
1209 return;
1210 }
1211 if (!anchorStr.isEmpty())
1212 {
1213 children.append<DocAnchor>(this,parent,anchorStr,true);
1214 }
1215 HtmlAttribList attrList;
1216 children.append<DocImage>(this,parent,attrList,
1217 findAndCopyImage(context.token->name,t),t,"",inlineImage);
1218 children.get_last<DocImage>()->parse();
1219}
QCString findAndCopyImage(const QCString &fileName, DocImage::Type type, bool doWarn=true)
Definition docparser.cpp:96
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
std::vector< std::string > StringVector
Definition containers.h:33
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition util.cpp:6618

References DocNodeList::append(), AUTO_TRACE, context, DocImage::DocBook, findAndCopyImage(), DocNodeList::get_last(), DocImage::Html, Token::is(), Token::is_any_of(), QCString::isEmpty(), DocImage::Latex, QCString::lower(), QCString::mid(), parent(), DocImage::Rtf, split(), QCString::startsWith(), QCString::stripWhiteSpace(), Token::to_string(), tokenizer, warn_doc_error, and DocImage::Xml.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleImg()

void DocParser::handleImg ( DocNodeVariant * parent,
DocNodeList & children,
const HtmlAttribList & tagHtmlAttribs )

Definition at line 1666 of file docparser.cpp.

1667{
1668 AUTO_TRACE();
1669 bool found=FALSE;
1670 size_t index=0;
1671 for (const auto &opt : tagHtmlAttribs)
1672 {
1673 AUTO_TRACE_ADD("option name={} value='{}'",opt.name,opt.value);
1674 if (opt.name=="src" && !opt.value.isEmpty())
1675 {
1676 // copy attributes
1677 HtmlAttribList attrList = tagHtmlAttribs;
1678 // and remove the src attribute
1679 attrList.erase(attrList.begin()+index);
1681 children.append<DocImage>(
1682 this,parent,attrList,
1683 findAndCopyImage(opt.value,t,false),
1684 t,opt.value);
1685 found = TRUE;
1686 }
1687 ++index;
1688 }
1689 if (!found)
1690 {
1691 warn_doc_error(context.fileName,tokenizer.getLineNr(),"IMG tag does not have a SRC attribute!");
1692 }
1693}

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_ADD, context, FALSE, findAndCopyImage(), DocImage::Html, parent(), tokenizer, TRUE, and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleHtmlStartTag().

◆ handleInitialStyleCommands()

void DocParser::handleInitialStyleCommands ( DocNodeVariant * parent,
DocNodeList & children )

Definition at line 704 of file docparser.cpp.

705{
706 AUTO_TRACE();
707 while (!context.initialStyleStack.empty())
708 {
709 const DocStyleChange &sc = std::get<DocStyleChange>(*context.initialStyleStack.top());
710 handleStyleEnter(parent,children,sc.style(),sc.tagName(),&sc.attribs());
711 context.initialStyleStack.pop();
712 }
713}
const HtmlAttribList & attribs() const
Definition docnode.h:311
QCString tagName() const
Definition docnode.h:312
Style style() const
Definition docnode.h:307

References DocStyleChange::attribs(), AUTO_TRACE, context, handleStyleEnter(), parent(), DocStyleChange::style(), and DocStyleChange::tagName().

Referenced by DocPara::parse().

◆ handleInternalRef()

void DocParser::handleInternalRef ( DocNodeVariant * parent,
DocNodeList & children )

Definition at line 945 of file docparser.cpp.

946{
947 Token tok=tokenizer.lex();
948 QCString tokenName = context.token->name;
949 AUTO_TRACE("name={}",tokenName);
950 if (!tok.is(TokenRetval::TK_WHITESPACE))
951 {
952 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\{} command", tokenName);
953 return;
954 }
955 tokenizer.setStateInternalRef();
956 tok=tokenizer.lex(); // get the reference id
957 if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
958 {
959 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of {}",
960 tok.to_string(),tokenName);
961 return;
962 }
963 children.append<DocInternalRef>(this,parent,context.token->name);
964 children.get_last<DocInternalRef>()->parse();
965}

References DocNodeList::append(), AUTO_TRACE, context, DocNodeList::get_last(), Token::is(), Token::is_any_of(), parent(), Token::to_string(), tokenizer, and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleLinkedWord()

void DocParser::handleLinkedWord ( DocNodeVariant * parent,
DocNodeList & children,
bool ignoreAutoLinkFlag = FALSE )

Definition at line 784 of file docparser.cpp.

785{
786 // helper to check if word w starts with any of the words in AUTOLINK_IGNORE_WORDS
787 auto ignoreWord = [](const QCString &w) -> bool {
788 const auto &list = Config_getList(AUTOLINK_IGNORE_WORDS);
789 return std::find_if(list.begin(), list.end(),
790 [&w](const auto &ignore) { return w.startsWith(ignore); }
791 )!=list.end();
792 };
793 QCString name = linkToText(context.lang,context.token->name,TRUE);
794 AUTO_TRACE("word={}",name);
795 if ((!context.autolinkSupport && !ignoreAutoLinkFlag) || ignoreWord(context.token->name)) // no autolinking -> add as normal word
796 {
797 children.append<DocWord>(this,parent,name);
798 return;
799 }
800
801 // ------- try to turn the word 'name' into a link
802
803 const Definition *compound=nullptr;
804 const MemberDef *member=nullptr;
805 size_t len = context.token->name.length();
806 ClassDef *cd=nullptr;
807 bool ambig = false;
808 FileDef *fd = findFileDef(Doxygen::inputNameLinkedMap,context.fileName,ambig);
809 auto lang = context.lang;
810 bool inSeeBlock = context.inSeeBlock || context.inCodeStyle;
811 //printf("handleLinkedWord(%s) context.context=%s\n",qPrint(context.token->name),qPrint(context.context));
812 if (!context.insideHtmlLink &&
813 (resolveRef(context.context,context.token->name,inSeeBlock,&compound,&member,lang,TRUE,fd,TRUE)
814 || (!context.context.isEmpty() && // also try with global scope
815 resolveRef(QCString(),context.token->name,inSeeBlock,&compound,&member,lang,FALSE,nullptr,TRUE))
816 )
817 )
818 {
819 //printf("ADD %s = %p (linkable?=%d)\n",qPrint(context.token->name),(void*)member,member ? member->isLinkable() : FALSE);
820 if (member && member->isLinkable()) // member link
821 {
822 AUTO_TRACE_ADD("resolved reference as member link");
823 if (member->isObjCMethod())
824 {
825 bool localLink = context.memberDef ? member->getClassDef()==context.memberDef->getClassDef() : FALSE;
826 name = member->objCMethodName(localLink,inSeeBlock);
827 }
828 children.append<DocLinkedWord>(
829 this,parent,name,
830 member->getReference(),
831 member->getOutputFileBase(),
832 member->anchor(),
833 member->briefDescriptionAsTooltip());
834 }
835 else if (compound->isLinkable()) // compound link
836 {
837 AUTO_TRACE_ADD("resolved reference as compound link");
838 QCString anchor = compound->anchor();
839 if (compound->definitionType()==Definition::TypeFile)
840 {
841 name=context.token->name;
842 }
843 else if (compound->definitionType()==Definition::TypeGroup)
844 {
845 name=toGroupDef(compound)->groupTitle();
846 }
847 children.append<DocLinkedWord>(
848 this,parent,name,
849 compound->getReference(),
850 compound->getOutputFileBase(),
851 anchor,
852 compound->briefDescriptionAsTooltip());
853 }
854 else if (compound->definitionType()==Definition::TypeFile &&
855 (toFileDef(compound))->generateSourceFile()
856 ) // undocumented file that has source code we can link to
857 {
858 AUTO_TRACE_ADD("resolved reference as source link");
859 children.append<DocLinkedWord>(
860 this,parent,context.token->name,
861 compound->getReference(),
862 compound->getSourceFileBase(),
863 "",
864 compound->briefDescriptionAsTooltip());
865 }
866 else // not linkable
867 {
868 AUTO_TRACE_ADD("resolved reference as unlinkable compound={} (linkable={}) member={} (linkable={})",
869 compound ? compound->name() : "<none>", compound ? (int)compound->isLinkable() : -1,
870 member ? member->name() : "<none>", member ? (int)member->isLinkable() : -1);
871 children.append<DocWord>(this,parent,name);
872 }
873 }
874 else if (!context.insideHtmlLink && len>1 && context.token->name.at(len-1)==':')
875 {
876 // special case, where matching Foo: fails to be an Obj-C reference,
877 // but Foo itself might be linkable.
878 context.token->name=context.token->name.left(len-1);
879 handleLinkedWord(parent,children,ignoreAutoLinkFlag);
880 children.append<DocWord>(this,parent,":");
881 }
882 else if (!context.insideHtmlLink && (cd=getClass(context.token->name+"-p")))
883 {
884 // special case 2, where the token name is not a class, but could
885 // be a Obj-C protocol
886 children.append<DocLinkedWord>(
887 this,parent,name,
888 cd->getReference(),
889 cd->getOutputFileBase(),
890 cd->anchor(),
892 }
893 else if (const RequirementIntf *req = RequirementManager::instance().find(name); req!=nullptr) // link to requirement
894 {
895 if (Config_getBool(GENERATE_REQUIREMENTS))
896 {
897 children.append<DocLinkedWord>(
898 this,parent,name,
899 QCString(), // link to local requirements overview also for external references
900 req->getOutputFileBase(),
901 req->id(),
902 req->title()
903 );
904 }
905 else // cannot link to a page that does not exist
906 {
907 children.append<DocWord>(this,parent,name);
908 }
909 }
910 else // normal non-linkable word
911 {
912 AUTO_TRACE_ADD("non-linkable");
913 if (context.token->name.startsWith("#"))
914 {
915 warn_doc_error(context.fileName,tokenizer.getLineNr(),"explicit link request to '{}' could not be resolved",name);
916 }
917 children.append<DocWord>(this,parent,context.token->name);
918 }
919}
virtual bool isLinkable() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual QCString briefDescriptionAsTooltip() const =0
virtual QCString getReference() const =0
virtual QCString getSourceFileBase() const =0
virtual QCString getOutputFileBase() const =0
virtual QCString groupTitle() const =0
virtual bool isObjCMethod() const =0
virtual const ClassDef * getClassDef() const =0
virtual QCString objCMethodName(bool localLink, bool showStatic) const =0
static RequirementManager & instance()
ClassDef * getClass(const QCString &n)
#define Config_getList(name)
Definition config.h:38
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1967
GroupDef * toGroupDef(Definition *d)
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
Definition util.cpp:2675
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)
Definition util.cpp:2419

References Definition::anchor(), DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_ADD, Definition::briefDescriptionAsTooltip(), Config_getBool, Config_getList, context, Definition::definitionType(), FALSE, findFileDef(), getClass(), MemberDef::getClassDef(), Definition::getOutputFileBase(), Definition::getReference(), Definition::getSourceFileBase(), GroupDef::groupTitle(), handleLinkedWord(), Doxygen::inputNameLinkedMap, RequirementManager::instance(), Definition::isLinkable(), MemberDef::isObjCMethod(), linkToText(), Definition::name(), MemberDef::objCMethodName(), parent(), resolveRef(), toFileDef(), toGroupDef(), tokenizer, TRUE, Definition::TypeFile, Definition::TypeGroup, and warn_doc_error.

Referenced by defaultHandleToken(), DocPara::handleHtmlStartTag(), handleLinkedWord(), handleParameterType(), DocPara::parse(), DocParamList::parse(), and DocParamList::parseXml().

◆ handleParameterType()

void DocParser::handleParameterType ( DocNodeVariant * parent,
DocNodeList & children,
const QCString & paramTypes )

Definition at line 921 of file docparser.cpp.

922{
923 QCString name = context.token->name; // save token name
924 AUTO_TRACE("name={}",name);
925 QCString name1;
926 int p=0, i=0, ii=0;
927 while ((i=paramTypes.find('|',p))!=-1)
928 {
929 name1 = paramTypes.mid(p,i-p);
930 ii=name1.find('[');
931 context.token->name=ii!=-1 ? name1.mid(0,ii) : name1; // take part without []
932 handleLinkedWord(parent,children);
933 if (ii!=-1) children.append<DocWord>(this,parent,name1.mid(ii)); // add [] part
934 p=i+1;
935 children.append<DocSeparator>(this,parent,"|");
936 }
937 name1 = paramTypes.mid(p);
938 ii=name1.find('[');
939 context.token->name=ii!=-1 ? name1.mid(0,ii) : name1;
940 handleLinkedWord(parent,children);
941 if (ii!=-1) children.append<DocWord>(this,parent,name1.mid(ii));
942 context.token->name = name; // restore original token name
943}

References DocNodeList::append(), AUTO_TRACE, context, QCString::find(), handleLinkedWord(), QCString::mid(), and parent().

Referenced by DocParamList::parse().

◆ handlePendingStyleCommands()

void DocParser::handlePendingStyleCommands ( DocNodeVariant * parent,
DocNodeList & children )

Called at the end of a paragraph to close all open style changes (e.g. a without a ). The closed styles are pushed onto a stack and entered again at the start of a new paragraph.

Definition at line 687 of file docparser.cpp.

688{
689 AUTO_TRACE();
690 if (!context.styleStack.empty())
691 {
692 const DocStyleChange *sc = &std::get<DocStyleChange>(*context.styleStack.top());
693 while (sc && sc->position()>=context.nodeStack.size())
694 { // there are unclosed style modifiers in the paragraph
695 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),
696 sc->style(),sc->tagName(),FALSE);
697 context.initialStyleStack.push(context.styleStack.top());
698 context.styleStack.pop();
699 sc = !context.styleStack.empty() ? &std::get<DocStyleChange>(*context.styleStack.top()) : nullptr;
700 }
701 }
702}
size_t position() const
Definition docnode.h:310

References DocNodeList::append(), AUTO_TRACE, context, FALSE, parent(), DocStyleChange::position(), DocStyleChange::style(), and DocStyleChange::tagName().

Referenced by defaultHandleTitleAndSize(), DocHRef::parse(), DocHtmlCaption::parse(), DocHtmlDescTitle::parse(), DocHtmlHeader::parse(), DocInternalRef::parse(), DocLink::parse(), DocPara::parse(), DocRef::parse(), DocSecRefItem::parse(), DocTitle::parse(), and DocVhdlFlow::parse().

◆ handlePrefix()

void DocParser::handlePrefix ( DocNodeVariant * parent,
DocNodeList & children )

Definition at line 995 of file docparser.cpp.

996{
997 AUTO_TRACE();
998 Token tok=tokenizer.lex();
999 if (!tok.is(TokenRetval::TK_WHITESPACE))
1000 {
1001 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\{} command", context.token->name);
1002 return;
1003 }
1004 tokenizer.setStatePrefix();
1005 tok=tokenizer.lex();
1006 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
1007 {
1008 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
1009 "argument of command {}",context.token->name);
1010 return;
1011 }
1012 else if (!tok.is(TokenRetval::TK_WORD))
1013 {
1014 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of {}",
1015 tok.to_string(),context.token->name);
1016 return;
1017 }
1018 context.prefix = context.token->name;
1019 tokenizer.setStatePara();
1020}

References AUTO_TRACE, context, Token::is(), Token::is_any_of(), parent(), Token::to_string(), tokenizer, and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleRef()

void DocParser::handleRef ( DocNodeVariant * parent,
DocNodeList & children,
char cmdChar,
const QCString & cmdName )

Definition at line 1221 of file docparser.cpp.

1222{
1223 AUTO_TRACE("cmdName={}",cmdName);
1224 QCString saveCmdName = cmdName;
1225 tokenizer.pushState();
1226 Token tok=tokenizer.lex();
1227 if (!tok.is(TokenRetval::TK_WHITESPACE))
1228 {
1229 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
1230 cmdChar,qPrint(saveCmdName));
1231 goto endref;
1232 }
1233 tokenizer.setStateRef();
1234 tok=tokenizer.lex(); // get the reference id
1235 if (!tok.is(TokenRetval::TK_WORD))
1236 {
1237 warn_doc_error(context.fileName,tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}'",
1238 tok.to_string(),cmdChar,saveCmdName);
1239 goto endref;
1240 }
1241 children.append<DocRef>(this,parent,
1242 context.token->name,
1243 context.context);
1244 children.get_last<DocRef>()->parse(cmdChar,saveCmdName);
1245endref:
1246 tokenizer.popState();
1247}

References DocNodeList::append(), AUTO_TRACE, context, DocNodeList::get_last(), Token::is(), parent(), qPrint(), Token::to_string(), tokenizer, and warn_doc_error.

Referenced by DocPara::handleCommand(), and DocHtmlSummary::parse().

◆ handleStyleArgument()

Token DocParser::handleStyleArgument ( DocNodeVariant * parent,
DocNodeList & children,
const QCString & cmdName )

Definition at line 571 of file docparser.cpp.

572{
573 AUTO_TRACE("cmdName={}",cmdName);
574 QCString saveCmdName = cmdName;
575 Token tok=tokenizer.lex();
576 if (!tok.is(TokenRetval::TK_WHITESPACE))
577 {
578 warn_doc_error(context.fileName,tokenizer.getLineNr(),"expected whitespace after \\{} command",
579 saveCmdName);
580 return tok;
581 }
582 tok = tokenizer.lex();
583 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF, TokenRetval::TK_WHITESPACE,
584 TokenRetval::TK_NEWPARA, TokenRetval::TK_LISTITEM, TokenRetval::TK_ENDLIST)
585 )
586 {
587 static const reg::Ex specialChar(R"([.,|()\‍[\‍]:;?])");
588 if (tok.is(TokenRetval::TK_WORD) && context.token->name.length()==1 &&
589 reg::match(context.token->name.str(),specialChar))
590 {
591 // special character that ends the markup command
592 return tok;
593 }
594 if (!defaultHandleToken(parent,tok,children))
595 {
596 switch (tok.value())
597 {
598 case TokenRetval::TK_HTMLTAG:
599 if (insideLI(parent) && Mappers::htmlTagMapper->map(context.token->name)!=HtmlTagType::UNKNOWN && context.token->endTag)
600 {
601 // ignore </li> as the end of a style command
602 }
603 else
604 {
605 AUTO_TRACE_EXIT("end tok={}",tok.to_string());
606 return tok;
607 }
608 break;
609 default:
610 errorHandleDefaultToken(parent,tok,children,"\\" + saveCmdName + " command");
611 break;
612 }
613 break;
614 }
615 tok = tokenizer.lex();
616 }
617 AUTO_TRACE_EXIT("end tok={}",tok.to_string());
618 return (tok.is_any_of(TokenRetval::TK_NEWPARA,TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST)) ? tok : Token::make_RetVal_OK();
619}
bool insideLI(const DocNodeVariant *n)

References AUTO_TRACE, AUTO_TRACE_EXIT, context, defaultHandleToken(), errorHandleDefaultToken(), Mappers::htmlTagMapper, insideLI(), Token::is(), Token::is_any_of(), reg::match(), parent(), Token::to_string(), tokenizer, UNKNOWN, Token::value(), and warn_doc_error.

Referenced by defaultHandleToken(), and DocPara::handleCommand().

◆ handleStyleEnter()

void DocParser::handleStyleEnter ( DocNodeVariant * parent,
DocNodeList & children,
DocStyleChange::Style s,
const QCString & tagName,
const HtmlAttribList * attribs )

Called when a style change starts. For instance a <b> command is encountered.

Definition at line 624 of file docparser.cpp.

626{
627 AUTO_TRACE("tagName={}",tagName);
628 children.append<DocStyleChange>(this,parent,context.nodeStack.size(),s,tagName,TRUE,
629 context.fileName,tokenizer.getLineNr(),attribs);
630 context.styleStack.push(&children.back());
632}
T & back()
access the last element
Definition growvector.h:135

References DocNodeList::append(), AUTO_TRACE, GrowVector< T >::back(), context, parent(), tokenizer, TRUE, and DocStyleChange::Typewriter.

Referenced by defaultHandleToken(), DocPara::handleHtmlStartTag(), and handleInitialStyleCommands().

◆ handleStyleLeave()

void DocParser::handleStyleLeave ( DocNodeVariant * parent,
DocNodeList & children,
DocStyleChange::Style s,
const QCString & tagName )

Called when a style change ends. For instance a </b> command is encountered.

Definition at line 637 of file docparser.cpp.

639{
640 AUTO_TRACE("tagName={}",tagName);
641 QCString tagNameLower = QCString(tagName).lower();
642
643 auto topStyleChange = [](const DocStyleChangeStack &stack) -> const DocStyleChange &
644 {
645 return std::get<DocStyleChange>(*stack.top());
646 };
647
648 if (context.styleStack.empty() || // no style change
649 topStyleChange(context.styleStack).style()!=s || // wrong style change
650 topStyleChange(context.styleStack).tagName()!=tagNameLower || // wrong style change
651 topStyleChange(context.styleStack).position()!=context.nodeStack.size() // wrong position
652 )
653 {
654 if (context.styleStack.empty())
655 {
656 warn_doc_error(context.fileName,tokenizer.getLineNr(),"found </{0}> tag without matching <{0}>",tagName);
657 }
658 else if (topStyleChange(context.styleStack).tagName()!=tagNameLower ||
659 topStyleChange(context.styleStack).style()!=s)
660 {
661 warn_doc_error(context.fileName,tokenizer.getLineNr(),"found </{}> tag while expecting </{}>",
662 tagName,topStyleChange(context.styleStack).tagName());
663 }
664 else
665 {
666 warn_doc_error(context.fileName,tokenizer.getLineNr(),"found </{}> at different nesting level ({}) than expected ({})",
667 tagName,context.nodeStack.size(),topStyleChange(context.styleStack).position());
668 }
669 }
670 else // end the section
671 {
672 children.append<DocStyleChange>(
673 this,parent,context.nodeStack.size(),s,
674 topStyleChange(context.styleStack).tagName(),FALSE);
675 context.styleStack.pop();
676 }
678 {
679 context.inCodeStyle = false;
680 }
681}
IterableStack< const DocNodeVariant * > DocStyleChangeStack
Definition docparser_p.h:55

References DocNodeList::append(), AUTO_TRACE, context, FALSE, QCString::lower(), parent(), tokenizer, DocStyleChange::Typewriter, and warn_doc_error.

Referenced by defaultHandleToken(), DocPara::handleHtmlEndTag(), and DocPara::handleHtmlStartTag().

◆ handleUnclosedStyleCommands()

void DocParser::handleUnclosedStyleCommands ( )

Definition at line 760 of file docparser.cpp.

761{
762 AUTO_TRACE();
763 if (!context.initialStyleStack.empty())
764 {
765 QCString tagName = std::get<DocStyleChange>(*context.initialStyleStack.top()).tagName();
766 QCString fileName = std::get<DocStyleChange>(*context.initialStyleStack.top()).fileName();
767 int lineNr = std::get<DocStyleChange>(*context.initialStyleStack.top()).lineNr();
768 context.initialStyleStack.pop();
770 if (lineNr != -1)
771 {
772 warn_doc_error(context.fileName,tokenizer.getLineNr(),
773 "end of comment block while expecting "
774 "command </{}> (Probable start '{}' at line {})",tagName, fileName, lineNr);
775 }
776 else
777 {
778 warn_doc_error(context.fileName,tokenizer.getLineNr(),
779 "end of comment block while expecting command </{}>",tagName);
780 }
781 }
782}
void handleUnclosedStyleCommands()

References AUTO_TRACE, context, handleUnclosedStyleCommands(), tokenizer, and warn_doc_error.

Referenced by handleUnclosedStyleCommands(), DocRoot::parse(), and DocText::parse().

◆ internalValidatingParseDoc()

Token DocParser::internalValidatingParseDoc ( DocNodeVariant * parent,
DocNodeList & children,
const QCString & doc )

Definition at line 1697 of file docparser.cpp.

1699{
1700 AUTO_TRACE();
1701 Token retval = Token::make_RetVal_OK();
1702
1703 if (doc.isEmpty()) return retval;
1704
1705 tokenizer.init(doc.data(),context.fileName,context.markdownSupport,context.insideHtmlLink);
1706
1707 // first parse any number of paragraphs
1708 bool isFirst=TRUE;
1709 DocPara *lastPar=!children.empty() ? std::get_if<DocPara>(&children.back()): nullptr;
1710 if (lastPar)
1711 { // last child item was a paragraph
1712 isFirst=FALSE;
1713 }
1714 do
1715 {
1716 children.append<DocPara>(this,parent);
1717 DocPara *par = children.get_last<DocPara>();
1718 if (isFirst) { par->markFirst(); isFirst=FALSE; }
1719 retval=par->parse();
1720 if (!par->isEmpty())
1721 {
1722 if (lastPar) lastPar->markLast(FALSE);
1723 lastPar=par;
1724 }
1725 else
1726 {
1727 children.pop_back();
1728 }
1729 } while (retval.is(TokenRetval::TK_NEWPARA));
1730 if (lastPar) lastPar->markLast();
1731
1732 AUTO_TRACE_EXIT("isFirst={} isLast={}",lastPar?lastPar->isFirst():-1,lastPar?lastPar->isLast():-1);
1733 return retval;
1734}
bool isLast() const
Definition docnode.h:1088
void markLast(bool v=TRUE)
Definition docnode.h:1086
bool isFirst() const
Definition docnode.h:1087
void pop_back()
removes the last element
Definition growvector.h:115
bool empty() const
checks whether the container is empty
Definition growvector.h:140
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_EXIT, GrowVector< T >::back(), context, QCString::data(), GrowVector< T >::empty(), FALSE, DocNodeList::get_last(), Token::is(), QCString::isEmpty(), DocPara::isFirst(), DocPara::isLast(), DocPara::markLast(), parent(), GrowVector< T >::pop_back(), tokenizer, and TRUE.

Referenced by DocPara::handleInheritDoc(), DocRef::parse(), DocXRefItem::parse(), DocTitle::parseFromString(), and DocSimpleSect::parseRcs().

◆ popContext()

void DocParser::popContext ( )

Definition at line 75 of file docparser.cpp.

76{
77 auto &ctx = contextStack.top();
78 context = ctx;
79 tokenizer.setFileName(ctx.fileName);
80 tokenizer.setLineNr(ctx.lineNo);
81 contextStack.pop();
82 tokenizer.popContext();
83 context.token = tokenizer.token();
84
85 //QCString indent;
86 //indent.fill(' ',contextStack.size()*2+2);
87 //printf("%sdocParserPopContext() count=%zu\n",qPrint(indent),context.nodeStack.size());
88}
std::stack< DocParserContext > contextStack

References context, contextStack, and tokenizer.

Referenced by DocPara::handleInheritDoc(), DocRef::parse(), DocXRefItem::parse(), DocTitle::parseFromString(), and DocSimpleSect::parseRcs().

◆ processCopyDoc()

QCString DocParser::processCopyDoc ( const char * data,
size_t & len )

Definition at line 1892 of file docparser.cpp.

1893{
1894 AUTO_TRACE("data={} len={}",Trace::trunc(data),len);
1895 QCString result;
1896 result.reserve(len+32);
1897 size_t i=0;
1898 int lineNr = tokenizer.getLineNr();
1899 while (i<len)
1900 {
1901 char c = data[i];
1902 if (c=='@' || c=='\\') // look for a command
1903 {
1904 bool isBrief=TRUE;
1905 size_t j=isCopyBriefOrDetailsCmd(data,i,len,isBrief);
1906 if (j>0)
1907 {
1908 // skip whitespace
1909 while (j<len && (data[j]==' ' || data[j]=='\t')) j++;
1910 // extract the argument
1911 QCString id = extractCopyDocId(data,j,len);
1912 const Definition *def = nullptr;
1913 QCString doc,brief;
1914 //printf("resolving docs='%s'\n",qPrint(id));
1915 bool found = findDocsForMemberOrCompound(id,&doc,&brief,&def);
1916 if (found && def->isReference())
1917 {
1918 warn_doc_error(context.fileName,tokenizer.getLineNr(),
1919 "@copy{} or @copydoc target '{}' found but is from a tag file, skipped",
1920 isBrief?"brief":"details", id);
1921 }
1922 else if (found)
1923 {
1924 //printf("found it def=%p brief='%s' doc='%s' isBrief=%d\n",def,qPrint(brief),qPrint(doc),isBrief);
1925 auto it = std::find(context.copyStack.begin(),context.copyStack.end(),def);
1926 if (it==context.copyStack.end()) // definition not parsed earlier
1927 {
1928 QCString orgFileName = context.fileName;
1929 context.copyStack.push_back(def);
1930 auto addDocs = [&](const QCString &file_,int line_,const QCString &doc_)
1931 {
1932 result+=" \\ifile \""+file_+"\" ";
1933 result+="\\iline "+QCString().setNum(line_)+" \\ilinebr ";
1934 size_t len_ = doc_.length();
1935 result+=processCopyDoc(doc_.data(),len_);
1936 };
1937 if (isBrief)
1938 {
1939 addDocs(def->briefFile(),def->briefLine(),brief);
1940 }
1941 else
1942 {
1943 addDocs(def->docFile(),def->docLine(),doc);
1945 {
1946 const MemberDef *md = toMemberDef(def);
1947 const ArgumentList &docArgList = md->templateMaster() ?
1948 md->templateMaster()->argumentList() :
1949 md->argumentList();
1950 result+=inlineArgListToDoc(docArgList);
1951 }
1952 }
1953 context.copyStack.pop_back();
1954 result+=" \\ilinebr \\ifile \""+context.fileName+"\" ";
1955 result+="\\iline "+QCString().setNum(lineNr)+" ";
1956 }
1957 else
1958 {
1959 warn_doc_error(context.fileName,tokenizer.getLineNr(),
1960 "Found recursive @copy{} or @copydoc relation for argument '{}'.",
1961 isBrief?"brief":"details",id);
1962 }
1963 }
1964 else
1965 {
1966 warn_doc_error(context.fileName,tokenizer.getLineNr(),
1967 "@copy{} or @copydoc target '{}' not found", isBrief?"brief":"details",id);
1968 }
1969 // skip over command
1970 i=j;
1971 }
1972 else
1973 {
1974 QCString endMarker;
1975 size_t k = isVerbatimSection(data,i,len,endMarker);
1976 if (k>0)
1977 {
1978 size_t orgPos = i;
1979 i=skipToEndMarker(data,k,len,endMarker);
1980 result+=QCString(data+orgPos,i-orgPos);
1981 // TODO: adjust lineNr
1982 }
1983 else
1984 {
1985 result+=c;
1986 i++;
1987 }
1988 }
1989 }
1990 else // not a command, just copy
1991 {
1992 result+=c;
1993 i++;
1994 lineNr += (c=='\n') ? 1 : 0;
1995 }
1996 }
1997 len = result.length();
1998 AUTO_TRACE_EXIT("result={}",Trace::trunc(result));
1999 return result;
2000}
virtual int briefLine() const =0
virtual QCString briefFile() const =0
virtual bool isReference() const =0
QCString processCopyDoc(const char *data, size_t &len)
bool findDocsForMemberOrCompound(const QCString &commandName, QCString *pDoc, QCString *pBrief, const Definition **pDef)
virtual const ArgumentList & argumentList() const =0
virtual const MemberDef * templateMaster() const =0
QCString & setNum(short n)
Definition qcstring.h:459
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
Definition qcstring.h:185
static QCString extractCopyDocId(const char *data, size_t &j, size_t len)
static size_t skipToEndMarker(const char *data, size_t i, size_t len, const QCString &endMarker)
static size_t isVerbatimSection(const char *data, size_t i, size_t len, QCString &endMarker)
static size_t isCopyBriefOrDetailsCmd(const char *data, size_t i, size_t len, bool &brief)
MemberDef * toMemberDef(Definition *d)
QCString trunc(const QCString &s, size_t numChars=15)
Definition trace.h:56
QCString inlineArgListToDoc(const ArgumentList &al)
Definition util.cpp:1186

References MemberDef::argumentList(), AUTO_TRACE, AUTO_TRACE_EXIT, Definition::briefFile(), Definition::briefLine(), context, Definition::definitionType(), Definition::docFile(), Definition::docLine(), extractCopyDocId(), findDocsForMemberOrCompound(), inlineArgListToDoc(), isCopyBriefOrDetailsCmd(), Definition::isReference(), isVerbatimSection(), QCString::length(), processCopyDoc(), QCString::reserve(), QCString::setNum(), skipToEndMarker(), MemberDef::templateMaster(), tokenizer, toMemberDef(), TRUE, Trace::trunc(), Definition::TypeMember, and warn_doc_error.

Referenced by processCopyDoc(), and validatingParseDoc().

◆ pushContext()

void DocParser::pushContext ( )

Definition at line 60 of file docparser.cpp.

61{
62 //QCString indent;
63 //indent.fill(' ',contextStack.size()*2+2);
64 //printf("%sdocParserPushContext() count=%zu\n",qPrint(indent),context.nodeStack.size());
65
66 tokenizer.pushContext();
67 contextStack.emplace();
68 auto &ctx = contextStack.top();
69 ctx = context;
70 ctx.fileName = tokenizer.getFileName();
71 ctx.lineNo = tokenizer.getLineNr();
72 context.token = tokenizer.token();
73}

References context, contextStack, and tokenizer.

Referenced by DocPara::handleInheritDoc(), DocRef::parse(), DocXRefItem::parse(), DocTitle::parseFromString(), and DocSimpleSect::parseRcs().

◆ readTextFileByName()

void DocParser::readTextFileByName ( const QCString & file,
QCString & text )

Definition at line 1738 of file docparser.cpp.

1739{
1740 AUTO_TRACE("file={} text={}",file,text);
1741 bool ambig = false;
1742 QCString filePath = findFilePath(file,ambig);
1743 if (!filePath.isEmpty())
1744 {
1745 text = fileToString(filePath,Config_getBool(FILTER_SOURCE_FILES));
1746 if (ambig)
1747 {
1748 warn_doc_error(context.fileName,tokenizer.getLineNr(),"included file name '{}' is ambiguous"
1749 "Possible candidates:\n{}",file, showFileDefMatches(Doxygen::exampleNameLinkedMap,file));
1750 }
1751 }
1752 else
1753 {
1754 warn_doc_error(context.fileName,tokenizer.getLineNr(),"included file '{}' is not found. "
1755 "Check your EXAMPLE_PATH",file);
1756 }
1757}
static FileNameLinkedMap * exampleNameLinkedMap
Definition doxygen.h:102
QCString findFilePath(const QCString &file, bool &ambig)
Definition util.cpp:2956
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1471

References AUTO_TRACE, Config_getBool, context, Doxygen::exampleNameLinkedMap, fileToString(), findFilePath(), QCString::isEmpty(), showFileDefMatches(), tokenizer, and warn_doc_error.

Referenced by DocInclude::parse().

Member Data Documentation

◆ context

DocParserContext DocParser::context

Definition at line 145 of file docparser_p.h.

Referenced by DocSimpleSect::appendLinkWord(), checkArgumentName(), checkIfHtmlEndTagEndsAutoList(), checkRetvalName(), checkUnOrMultipleDocumentedParams(), createRef(), defaultHandleTitleAndSize(), defaultHandleToken(), errorHandleDefaultToken(), findAndCopyImage(), findDocsForMemberOrCompound(), handleAHref(), handleAnchor(), DocPara::handleCite(), DocPara::handleCommand(), DocPara::handleDoxyConfig(), DocPara::handleEmoji(), DocPara::handleFile(), DocPara::handleHtmlStartTag(), handleIFile(), handleILine(), handleImage(), handleImg(), DocPara::handleInclude(), DocPara::handleIncludeOperator(), DocPara::handleInheritDoc(), handleInitialStyleCommands(), handleInternalRef(), DocPara::handleLink(), handleLinkedWord(), handleParameterType(), handlePendingStyleCommands(), handlePrefix(), handleRef(), DocPara::handleSection(), DocPara::handleShowDate(), DocPara::handleStartCode(), handleStyleArgument(), handleStyleEnter(), handleStyleLeave(), handleUnclosedStyleCommands(), DocPara::handleXRefItem(), DocPara::injectToken(), internalValidatingParseDoc(), DocAutoList::parse(), DocHRef::parse(), DocHtmlDescData::parse(), DocHtmlDescList::parse(), DocHtmlDescTitle::parse(), DocHtmlHeader::parse(), DocHtmlList::parse(), DocHtmlRow::parse(), DocHtmlTable::parse(), DocInclude::parse(), DocIncOperator::parse(), DocIndexEntry::parse(), DocInternal::parse(), DocLink::parse(), DocPara::parse(), DocParamList::parse(), DocRef::parse(), DocRoot::parse(), DocSecRefList::parse(), DocSection::parse(), DocText::parse(), DocTitle::parseFromString(), DocSimpleSect::parseRcs(), DocHtmlList::parseXml(), DocHtmlRow::parseXml(), DocHtmlTable::parseXml(), DocParamList::parseXml(), popContext(), processCopyDoc(), pushContext(), readTextFileByName(), skipSpacesForTable(), validatingParseDoc(), validatingParseText(), and validatingParseTitle().

◆ contextStack

std::stack< DocParserContext > DocParser::contextStack

Definition at line 144 of file docparser_p.h.

Referenced by popContext(), and pushContext().

◆ tokenizer

DocTokenizer DocParser::tokenizer

Definition at line 146 of file docparser_p.h.

Referenced by checkIfHtmlEndTagEndsAutoList(), createRef(), defaultHandleTitleAndSize(), defaultHandleToken(), docFindSections(), errorHandleDefaultToken(), findAndCopyImage(), handleAHref(), handleAnchor(), DocPara::handleCite(), DocPara::handleCommand(), DocPara::handleDoxyConfig(), DocPara::handleEmoji(), DocPara::handleFile(), DocPara::handleHtmlEndTag(), DocPara::handleHtmlStartTag(), handleIFile(), handleILine(), handleImage(), handleImg(), DocPara::handleInclude(), DocPara::handleIncludeOperator(), handleInternalRef(), DocPara::handleLink(), handleLinkedWord(), handlePrefix(), handleRef(), DocPara::handleSection(), DocPara::handleShowDate(), DocPara::handleStartCode(), handleStyleArgument(), handleStyleEnter(), handleStyleLeave(), handleUnclosedStyleCommands(), DocPara::handleXRefItem(), internalValidatingParseDoc(), DocAutoList::parse(), DocHRef::parse(), DocHtmlCaption::parse(), DocHtmlDescList::parse(), DocHtmlDescTitle::parse(), DocHtmlHeader::parse(), DocHtmlList::parse(), DocHtmlRow::parse(), DocHtmlSummary::parse(), DocHtmlTable::parse(), DocIndexEntry::parse(), DocInternalRef::parse(), DocLink::parse(), DocPara::parse(), DocParamList::parse(), DocRef::parse(), DocRoot::parse(), DocSecRefItem::parse(), DocSecRefList::parse(), DocText::parse(), DocTitle::parse(), DocVhdlFlow::parse(), DocTitle::parseFromString(), DocHtmlList::parseXml(), DocHtmlRow::parseXml(), DocHtmlTable::parseXml(), popContext(), processCopyDoc(), pushContext(), readTextFileByName(), skipSpacesForTable(), validatingParseDoc(), validatingParseText(), and validatingParseTitle().


The documentation for this class was generated from the following files: