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

Node representing a paragraph in the documentation tree. More...

#include <src/docnode.h>

+ Inheritance diagram for DocPara:
+ Collaboration diagram for DocPara:

Public Member Functions

 DocPara (DocParser *parser, DocNodeVariant *parent)
 
Token parse ()
 
bool isEmpty () const
 
void markFirst (bool v=TRUE)
 
void markLast (bool v=TRUE)
 
bool isFirst () const
 
bool isLast () const
 
Token handleCommand (char cmdChar, const QCString &cmdName)
 
Token handleHtmlStartTag (const QCString &tagName, const HtmlAttribList &tagHtmlAttribs)
 
Token handleHtmlEndTag (const QCString &tagName)
 
Token handleSimpleSection (DocSimpleSect::Type t, bool xmlContext=FALSE)
 
Token handleXRefItem ()
 
Token handleParamSection (const QCString &cmdName, DocParamSect::Type t, bool xmlContext, int direction)
 
void handleIncludeOperator (const QCString &cmdName, DocIncOperator::Type t)
 
template<class T>
void handleFile (const QCString &cmdName)
 
void handleInclude (const QCString &cmdName, DocInclude::Type t)
 
void handleLink (const QCString &cmdName, bool isJavaLink)
 
void handleCite (char cmdChar, const QCString &cmdName)
 
void handleDoxyConfig (char cmdChar, const QCString &cmdName)
 
void handleEmoji (char cmdChar, const QCString &cmdName)
 
void handleRef (char cmdChar, const QCString &cmdName)
 
void handleSection (char cmdChar, const QCString &cmdName)
 
void handleInheritDoc ()
 
void handleVhdlFlow ()
 
void handleILine (char cmdChar, const QCString &cmdName)
 
void handleIFile (char cmdChar, const QCString &cmdName)
 
void handleShowDate (char cmdChar, const QCString &cmdName)
 
Token handleStartCode ()
 
Token handleHtmlHeader (const HtmlAttribList &tagHtmlAttribs, int level)
 
bool injectToken (Token tok, const QCString &tokText)
 
const HtmlAttribListattribs () const
 
void setAttribs (const HtmlAttribList &attribs)
 
- Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
 
DocNodeListchildren ()
 
const DocNodeListchildren () const
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Private Attributes

bool m_isFirst = false
 
bool m_isLast = false
 
HtmlAttribList m_attribs
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node representing a paragraph in the documentation tree.

Definition at line 1073 of file docnode.h.

Constructor & Destructor Documentation

◆ DocPara()

DocPara::DocPara ( DocParser * parser,
DocNodeVariant * parent )

Definition at line 3227 of file docnode.cpp.

3227 :
3230{
3231}
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89
bool m_isFirst
Definition docnode.h:1112
bool m_isLast
Definition docnode.h:1113
#define FALSE
Definition qcstring.h:34

References DocCompoundNode::DocCompoundNode(), FALSE, m_isFirst, m_isLast, DocNode::parent(), and DocNode::parser().

Referenced by parse().

Member Function Documentation

◆ attribs()

const HtmlAttribList & DocPara::attribs ( ) const
inline

Definition at line 1108 of file docnode.h.

1108{ return m_attribs; }
HtmlAttribList m_attribs
Definition docnode.h:1114

References m_attribs.

Referenced by HtmlDocVisitor::operator()(), and setAttribs().

◆ handleCite()

void DocPara::handleCite ( char cmdChar,
const QCString & cmdName )

Definition at line 3286 of file docnode.cpp.

3287{
3288 AUTO_TRACE();
3289 // get the argument of the cite command.
3290 Token tok=parser()->tokenizer.lex();
3291 if (!tok.is(TokenRetval::TK_WHITESPACE))
3292 {
3293 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3294 cmdChar,qPrint(cmdName));
3295 return;
3296 }
3298 tok=parser()->tokenizer.lex();
3299 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3300 {
3301 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3302 "argument of command '%c%s'",cmdChar,qPrint(cmdName));
3303 return;
3304 }
3305 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
3306 {
3307 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3308 tok.to_string(),cmdChar,qPrint(cmdName));
3309 return;
3310 }
3312 children().append<DocCite>(
3314
3316}
DocNodeList & children()
Definition docnode.h:142
DocNodeVariant * thisVariant()
Definition docnode.h:92
DocTokenizer tokenizer
DocParserContext context
void setStateCite()
void setStatePara()
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
bool is_any_of(ARGS... args) const
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define warn_doc_error(file, line, fmt,...)
Definition message.h:74
const char * qPrint(const char *s)
Definition qcstring.h:672
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1393
TokenInfo * token
Definition docparser_p.h:92
QCString sectionId
QCString name

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocParserContext::context, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), qPrint(), TokenInfo::sectionId, DocTokenizer::setStateCite(), DocTokenizer::setStatePara(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleCommand()

Token DocPara::handleCommand ( char cmdChar,
const QCString & cmdName )

Definition at line 3971 of file docnode.cpp.

3972{
3973 AUTO_TRACE("cmdName={}",cmdName);
3974 Token retval = Token::make_RetVal_OK();
3975 CommandType cmdId = Mappers::cmdMapper->map(cmdName);
3976 switch (cmdId)
3977 {
3979 {
3980 std::string str{cmdChar};
3981 children().append<DocWord>(parser(),thisVariant(),str.c_str() + cmdName);
3982 if (isAliasCmd(cmdName.view()))
3983 {
3984 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Found unexpanded alias '%c%s'. Check if number of arguments passed is correct.",cmdChar,qPrint(cmdName));
3985 }
3986 else
3987 {
3988 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Found unknown command '%c%s'",cmdChar,qPrint(cmdName));
3989 }
3990 }
3991 break;
3993 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE);
3994 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
3995 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,cmdName,FALSE);
3996 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
3997 break;
3999 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Bold,cmdName,TRUE);
4000 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
4001 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Bold,cmdName,FALSE);
4002 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4003 break;
4005 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,cmdName,TRUE);
4006 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
4007 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,cmdName,FALSE);
4008 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4009 break;
4012 break;
4015 break;
4018 break;
4021 break;
4024 break;
4027 break;
4030 break;
4033 break;
4036 break;
4039 break;
4043 break;
4048 break;
4051 break;
4054 break;
4057 break;
4060 break;
4063 break;
4066 break;
4069 break;
4074 break;
4078 break;
4081 break;
4084 break;
4087 break;
4090 break;
4093 break;
4096 break;
4099 break;
4102 break;
4105 break;
4108 break;
4111 break;
4114 break;
4117 break;
4120 break;
4123 break;
4125 {
4126 children().append<DocSimpleList>(parser(),thisVariant());
4127 retval = children().get_last<DocSimpleList>()->parse();
4128 }
4129 break;
4131 {
4132 handleSection(cmdChar,cmdName);
4133 retval = Token::make_RetVal_Section();
4134 }
4135 break;
4137 {
4138 handleSection(cmdChar,cmdName);
4139 retval = Token::make_RetVal_Subsection();
4140 }
4141 break;
4143 {
4144 handleSection(cmdChar,cmdName);
4145 retval = Token::make_RetVal_Subsubsection();
4146 }
4147 break;
4149 {
4150 handleSection(cmdChar,cmdName);
4151 retval = Token::make_RetVal_Paragraph();
4152 }
4153 break;
4155 {
4156 handleSection(cmdChar,cmdName);
4157 retval = Token::make_RetVal_SubParagraph();
4158 }
4159 break;
4161 {
4162 handleSection(cmdChar,cmdName);
4163 retval = Token::make_RetVal_SubSubParagraph();
4164 }
4165 break;
4167 {
4169 retval = handleStartCode();
4170 }
4171 break;
4173 {
4175 retval = handleStartCode();
4176 }
4177 break;
4179 {
4181 retval = parser()->tokenizer.lex();
4183 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4184 {
4185 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"htmlonly section ended without end marker");
4186 }
4188 }
4189 break;
4191 {
4193 retval = parser()->tokenizer.lex();
4195 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4196 {
4197 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"manonly section ended without end marker");
4198 }
4200 }
4201 break;
4203 {
4205 retval = parser()->tokenizer.lex();
4207 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4208 {
4209 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"rtfonly section ended without end marker");
4210 }
4212 }
4213 break;
4215 {
4217 retval = parser()->tokenizer.lex();
4219 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4220 {
4221 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"latexonly section ended without end marker");
4222 }
4224 }
4225 break;
4227 {
4229 retval = parser()->tokenizer.lex();
4231 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4232 {
4233 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"xmlonly section ended without end marker");
4234 }
4236 }
4237 break;
4239 {
4241 retval = parser()->tokenizer.lex();
4243 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4244 {
4245 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"docbookonly section ended without end marker");
4246 }
4248 }
4249 break;
4251 {
4254 parser()->tokenizer.lex();
4255
4256 QCString fullMatch = parser()->context.token->verb;
4257 int idx = fullMatch.find('{');
4258 int idxEnd = fullMatch.find("}",idx+1);
4259 StringVector optList;
4260 if (idx != -1) // options present
4261 {
4262 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
4263 optList = split(optStr.str(),",");
4264 for (const auto &opt : optList)
4265 {
4266 if (opt.empty()) continue;
4267 QCString locOpt(opt);
4268 locOpt = locOpt.stripWhiteSpace().lower();
4269 if (locOpt == "code")
4270 {
4272 }
4273 else if (!locOpt.isEmpty())
4274 {
4275 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown option '%s' for '\\iliteral'",qPrint(opt));
4276 }
4277 }
4278 }
4279
4281 retval = parser()->tokenizer.lex();
4283 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4284 {
4285 if (t == DocVerbatim::JavaDocCode)
4286 {
4287 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"javadoc code section ended without end marker");
4288 }
4289 else
4290 {
4291 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"javadoc literal section ended without end marker");
4292 }
4293 }
4295 }
4296 break;
4299 {
4300 if (cmdId == CommandType::CMD_VERBATIM)
4301 {
4303 }
4304 else
4305 {
4307 }
4308 retval = parser()->tokenizer.lex();
4310 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4311 {
4312 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"verbatim section ended without end marker");
4313 }
4315 }
4316 break;
4318 {
4319 children().append<DocVerbatim>(parser(),thisVariant(),
4325 DocVerbatim *dv = children().get_last<DocVerbatim>();
4327 QCString width,height;
4328 parser()->defaultHandleTitleAndSize(CommandType::CMD_DOT,&children().back(),dv->children(),width,height);
4330 retval = parser()->tokenizer.lex();
4331 dv->setText(parser()->context.token->verb);
4332 dv->setWidth(width);
4333 dv->setHeight(height);
4334 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4335 if (!Config_getBool(HAVE_DOT))
4336 {
4337 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"ignoring \\dot command because HAVE_DOT is not set");
4338 children().pop_back();
4339 }
4340 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4341 {
4342 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"dot section ended without end marker");
4343 }
4345 }
4346 break;
4348 {
4349 children().append<DocVerbatim>(parser(),thisVariant(),
4355 DocVerbatim *dv = children().get_last<DocVerbatim>();
4357 QCString width,height;
4358 parser()->defaultHandleTitleAndSize(CommandType::CMD_MSC,&children().back(),dv->children(),width,height);
4360 retval = parser()->tokenizer.lex();
4361 dv->setText(parser()->context.token->verb);
4362 dv->setWidth(width);
4363 dv->setHeight(height);
4364 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4365 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4366 {
4367 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"msc section ended without end marker");
4368 }
4370 }
4371 break;
4373 {
4374 QCString jarPath = Config_getString(PLANTUML_JAR_PATH);
4376 parser()->tokenizer.lex();
4377 QCString fullMatch = parser()->context.token->sectionId;
4378 QCString sectionId = "";
4379 int idx = fullMatch.find('{');
4380 int idxEnd = fullMatch.find("}",idx+1);
4381 StringVector optList;
4382 QCString engine;
4383 if (idx != -1) // options present
4384 {
4385 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
4386 optList = split(optStr.str(),",");
4387 for (const auto &opt : optList)
4388 {
4389 if (opt.empty()) continue;
4390 bool found = false;
4391 QCString locOpt(opt);
4392 locOpt = locOpt.stripWhiteSpace().lower();
4393 if (g_plantumlEngine.find(locOpt.str())!=g_plantumlEngine.end())
4394 {
4395 if (!engine.isEmpty())
4396 {
4397 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Multiple definition of engine for '\\startuml'");
4398 }
4399 engine = locOpt;
4400 found = true;
4401 }
4402 if (!found)
4403 {
4404 if (sectionId.isEmpty())
4405 {
4406 sectionId = opt;
4407 }
4408 else
4409 {
4410 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Multiple use of filename for '\\startuml'");
4411 }
4412 }
4413 }
4414 }
4415 else
4416 {
4417 sectionId = parser()->context.token->sectionId;
4418 }
4419 if (engine.isEmpty()) engine = "uml";
4420
4421 if (sectionId.isEmpty())
4422 {
4424 retval = parser()->tokenizer.lex();
4425 assert(retval.is(TokenRetval::RetVal_OK));
4426
4427 sectionId = parser()->context.token->sectionId;
4428 sectionId = sectionId.stripWhiteSpace();
4429 }
4430
4431 QCString plantFile(sectionId);
4432 children().append<DocVerbatim>(parser(),thisVariant(),
4436 FALSE,plantFile);
4437 DocVerbatim *dv = children().get_last<DocVerbatim>();
4438 dv->setEngine(engine);
4440 QCString width,height;
4441 parser()->defaultHandleTitleAndSize(CommandType::CMD_STARTUML,&children().back(),dv->children(),width,height);
4443 retval = parser()->tokenizer.lex();
4444 int line = 0;
4445 QCString trimmedVerb = stripLeadingAndTrailingEmptyLines(parser()->context.token->verb,line);
4446 if (engine == "ditaa")
4447 {
4448 dv->setUseBitmap(true);
4449 }
4450 else if (engine == "uml")
4451 {
4452 int i = trimmedVerb.find('\n');
4453 QCString firstLine = i==-1 ? trimmedVerb : trimmedVerb.left(i);
4454 if (firstLine.stripWhiteSpace() == "ditaa") dv->setUseBitmap(true);
4455 }
4456 dv->setText(trimmedVerb);
4457 dv->setWidth(width);
4458 dv->setHeight(height);
4459 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4460 if (jarPath.isEmpty())
4461 {
4462 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"ignoring \\startuml command because PLANTUML_JAR_PATH is not set");
4463 children().pop_back();
4464 }
4465 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4466 {
4467 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"startuml section ended without end marker");
4468 }
4470 }
4471 break;
4473 retval = Token::make_RetVal_EndParBlock();
4474 break;
4490 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command %s",qPrint(parser()->context.token->name));
4491 break;
4493 retval = handleParamSection(cmdName,DocParamSect::Param,FALSE,parser()->context.token->paramDir);
4494 break;
4496 retval = handleParamSection(cmdName,DocParamSect::TemplateParam,FALSE,parser()->context.token->paramDir);
4497 break;
4499 retval = handleParamSection(cmdName,DocParamSect::RetVal);
4500 break;
4503 break;
4505 retval = handleXRefItem();
4506 break;
4508 {
4509 children().append<DocLineBreak>(parser(),thisVariant());
4510 }
4511 break;
4514 {
4516 }
4517 break;
4519 {
4521 }
4522 break;
4524 {
4525 children().append<DocIndexEntry>(parser(),thisVariant(),
4528 retval = children().get_last<DocIndexEntry>()->parse();
4529 }
4530 break;
4532 retval = Token::make_RetVal_Internal();
4533 break;
4535 retval = Token::make_RetVal_EndInternal();
4536 break;
4538 {
4539 children().append<DocParBlock>(parser(),thisVariant());
4540 retval = children().get_last<DocParBlock>()->parse();
4541 }
4542 break;
4543 case CommandType::CMD_COPYDOC: // fall through
4544 case CommandType::CMD_COPYBRIEF: // fall through
4546 //retval = Token::make_RetVal_CopyDoc();
4547 // these commands should already be resolved by processCopyDoc()
4548 break;
4551 break;
4554 break;
4557 break;
4560 break;
4563 break;
4566 break;
4569 break;
4572 break;
4575 break;
4578 break;
4581 break;
4584 break;
4587 break;
4590 break;
4593 break;
4596 break;
4599 break;
4601 if (!Config_getBool(HAVE_DOT))
4602 {
4603 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),
4604 "ignoring \\dotfile command because HAVE_DOT is not set");
4605 }
4606 else
4607 {
4608 handleFile<DocDotFile>(cmdName);
4609 }
4610 break;
4613 break;
4615 handleFile<DocMscFile>(cmdName);
4616 break;
4618 handleFile<DocDiaFile>(cmdName);
4619 break;
4622 break;
4624 handleLink(cmdName,FALSE);
4625 break;
4627 handleLink(cmdName,TRUE);
4628 break;
4630 handleCite(cmdChar,cmdName);
4631 break;
4633 handleEmoji(cmdChar,cmdName);
4634 break;
4636 handleDoxyConfig(cmdChar,cmdName);
4637 break;
4638 case CommandType::CMD_REF: // fall through
4640 handleRef(cmdChar,cmdName);
4641 break;
4643 {
4644 children().append<DocSecRefList>(parser(),thisVariant());
4645 children().get_last<DocSecRefList>()->parse();
4646 }
4647 break;
4649 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command '%c%s'",cmdChar,qPrint(parser()->context.token->name));
4650 break;
4652 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command '%c%s'",cmdChar,qPrint(parser()->context.token->name));
4653 break;
4655 {
4656 children().append<DocFormula>(parser(),thisVariant(),parser()->context.token->id);
4657 }
4658 break;
4659 //case CommandType::CMD_LANGSWITCH:
4660 // retval = handleLanguageSwitch();
4661 // break;
4663 //warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command %s",qPrint(parser()->context.token->name));
4664 {
4667 }
4668 break;
4671 break;
4673 handleShowDate(cmdChar,cmdName);
4674 break;
4676 handleILine(cmdChar,cmdName);
4677 break;
4679 handleIFile(cmdChar,cmdName);
4680 break;
4682 {
4684 (void)parser()->tokenizer.lex();
4686 //printf("Found scope='%s'\n",qPrint(parser()->context.context));
4688 }
4689 break;
4690 default:
4691 // we should not get here!
4692 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected command '%s' in paragraph context",qPrint(cmdName));
4693 break;
4694 }
4695 INTERNAL_ASSERT(retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF,TokenRetval::RetVal_OK,TokenRetval::RetVal_SimpleSec
4696 TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST,TokenRetval::TK_NEWPARA
4697 TokenRetval::RetVal_Section,TokenRetval::RetVal_EndList
4698 TokenRetval::RetVal_Internal,TokenRetval::RetVal_SwitchLang
4699 TokenRetval::RetVal_EndInternal)
4700 );
4701 AUTO_TRACE_EXIT("retval={}",retval.to_string());
4702 return retval;
4703}
bool isAliasCmd(std::string_view aliasCmd)
Definition aliases.cpp:528
@ LatexInclude
Definition docnode.h:432
@ SnippetWithLines
Definition docnode.h:433
@ IncWithLines
Definition docnode.h:433
@ HtmlInclude
Definition docnode.h:432
@ VerbInclude
Definition docnode.h:432
@ DontInclude
Definition docnode.h:432
@ DocbookInclude
Definition docnode.h:434
Token handleSimpleSection(DocSimpleSect::Type t, bool xmlContext=FALSE)
Definition docnode.cpp:3233
void handleLink(const QCString &cmdName, bool isJavaLink)
Definition docnode.cpp:3676
void handleInheritDoc()
Definition docnode.cpp:3934
void handleCite(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3286
void handleInclude(const QCString &cmdName, DocInclude::Type t)
Definition docnode.cpp:3744
void handleDoxyConfig(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3349
void handleSection(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3849
void handleFile(const QCString &cmdName)
Definition docnode.cpp:3637
void handleIFile(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3553
Token handleParamSection(const QCString &cmdName, DocParamSect::Type t, bool xmlContext, int direction)
Definition docnode.cpp:3263
void handleEmoji(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3318
void handleIncludeOperator(const QCString &cmdName, DocIncOperator::Type t)
Definition docnode.cpp:3577
void handleRef(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3717
void handleILine(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3539
Token parse()
Definition docnode.cpp:5459
void handleVhdlFlow()
Definition docnode.cpp:3669
void handleShowDate(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3468
Token handleXRefItem()
Definition docnode.cpp:3447
Token handleStartCode()
Definition docnode.cpp:3898
void handleInternalRef(DocNodeVariant *parent, DocNodeList &children)
void handleImage(DocNodeVariant *parent, DocNodeList &children)
void handlePrefix(DocNodeVariant *parent, DocNodeList &children)
Token handleStyleArgument(DocNodeVariant *parent, DocNodeList &children, const QCString &cmdName)
void handleAnchor(DocNodeVariant *parent, DocNodeList &children)
void defaultHandleTitleAndSize(const CommandType cmd, DocNodeVariant *parent, DocNodeList &children, QCString &width, QCString &height)
void setStateILiteralOpt()
void setStateILiteral()
void setStateCode()
void setStatePlantUMLOpt()
void setStateRtfOnly()
void setStateVerbatim()
void setStateLatexOnly()
void setStateManOnly()
void setStateDbOnly()
void setStateHtmlOnly()
void setStateICode()
void setStatePlantUML()
void setStateIVerbatim()
void setStateXmlOnly()
void setStateSetScope()
@ JavaDocLiteral
Definition docnode.h:373
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
void pop_back()
removes the last element
Definition growvector.h:115
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
std::string_view view() const
Definition qcstring.h:161
QCString left(size_t len) const
Definition qcstring.h:214
CommandType
Definition cmdmapper.h:29
@ CMD_ENDSECREFLIST
Definition cmdmapper.h:53
@ CMD_ENDLATEXONLY
Definition cmdmapper.h:51
@ CMD_ENDVERBATIM
Definition cmdmapper.h:54
@ CMD_DONTINCLUDE
Definition cmdmapper.h:46
@ CMD_SUBSUBSECTION
Definition cmdmapper.h:89
@ CMD_SUBSUBPARAGRAPH
Definition cmdmapper.h:161
@ CMD_INTERNALREF
Definition cmdmapper.h:65
@ CMD_ENDHTMLONLY
Definition cmdmapper.h:50
@ CMD_VERBINCLUDE
Definition cmdmapper.h:98
@ CMD_DOCBOOKINCLUDE
Definition cmdmapper.h:145
@ CMD_HTMLINCLUDE
Definition cmdmapper.h:60
@ CMD_SNIPWITHLINES
Definition cmdmapper.h:141
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
std::vector< std::string > StringVector
Definition containers.h:33
static const StringUnorderedSet g_plantumlEngine
Definition docnode.cpp:69
#define INTERNAL_ASSERT(x)
Definition docnode.cpp:51
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
#define warn(file, line, fmt,...)
Definition message.h:59
const Mapper< CommandType > * cmdMapper
#define TRUE
Definition qcstring.h:37
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1404
DocNodeStack nodeStack
Definition docparser_p.h:66
QCString exampleName
Definition docparser_p.h:79
const Definition * scope
Definition docparser_p.h:61
const MemberDef * memberDef
Definition docparser_p.h:77
QCString verb
bool found
Definition util.cpp:984
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition util.cpp:6946
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition util.cpp:5368

References DocNodeList::append(), DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, AUTO_TRACE, AUTO_TRACE_EXIT, DocStyleChange::Bold, DocCompoundNode::children(), CMD_ADDINDEX, CMD_AMP, CMD_ANCHOR, CMD_AT, CMD_ATTENTION, CMD_AUTHOR, CMD_AUTHORS, CMD_BOLD, CMD_BSLASH, CMD_CITE, CMD_CODE, CMD_COPYBRIEF, CMD_COPYDETAILS, CMD_COPYDOC, CMD_COPYRIGHT, CMD_DATE, CMD_DBONLY, CMD_DCOLON, CMD_DIAFILE, CMD_DOCBOOKINCLUDE, CMD_DOLLAR, CMD_DONTINCLUDE, CMD_DOT, CMD_DOTFILE, CMD_DOXYCONFIG, CMD_EMOJI, CMD_EMPHASIS, CMD_ENDCODE, CMD_ENDDBONLY, CMD_ENDDOT, CMD_ENDHTMLONLY, CMD_ENDICODE, CMD_ENDILITERAL, CMD_ENDINTERNAL, CMD_ENDIVERBATIM, CMD_ENDLATEXONLY, CMD_ENDLINK, CMD_ENDMANONLY, CMD_ENDMSC, CMD_ENDPARBLOCK, CMD_ENDRTFONLY, CMD_ENDSECREFLIST, CMD_ENDUML, CMD_ENDVERBATIM, CMD_ENDXMLONLY, CMD_EQUAL, CMD_EXCEPTION, CMD_EXCLAMATION, CMD_FORMULA, CMD_GREATER, CMD_HASH, CMD_HTMLINCLUDE, CMD_HTMLONLY, CMD_IANCHOR, CMD_IFILE, CMD_ILINE, CMD_ILITERAL, CMD_IMAGE, CMD_IMPORTANT, CMD_INCLUDE, CMD_INCWITHLINES, CMD_INHERITDOC, CMD_INTERNAL, CMD_INTERNALREF, CMD_INVARIANT, CMD_IPREFIX, CMD_ISTARTCODE, CMD_IVERBATIM, CMD_JAVALINK, CMD_LATEXINCLUDE, CMD_LATEXONLY, CMD_LESS, CMD_LI, CMD_LINE, CMD_LINEBREAK, CMD_LINK, CMD_MANINCLUDE, CMD_MANONLY, CMD_MDASH, CMD_MINUS, CMD_MSC, CMD_MSCFILE, CMD_NDASH, CMD_NOTE, CMD_PAR, CMD_PARAGRAPH, CMD_PARAM, CMD_PARBLOCK, CMD_PERCENT, CMD_PIPE, CMD_PLANTUMLFILE, CMD_PLUS, CMD_POST, CMD_PRE, CMD_PUNT, CMD_QUESTION, CMD_QUOTE, CMD_REF, CMD_REMARK, CMD_RETURN, CMD_RETVAL, CMD_RTFINCLUDE, CMD_RTFONLY, CMD_SA, CMD_SECREFITEM, CMD_SECREFLIST, CMD_SECTION, CMD_SETSCOPE, CMD_SHOWDATE, CMD_SINCE, CMD_SKIP, CMD_SKIPLINE, CMD_SNIPPET, CMD_SNIPWITHLINES, CMD_STARTCODE, CMD_STARTUML, CMD_SUBPAGE, CMD_SUBPARAGRAPH, CMD_SUBSECTION, CMD_SUBSUBPARAGRAPH, CMD_SUBSUBSECTION, CMD_TPARAM, CMD_UNTIL, CMD_VERBATIM, CMD_VERBINCLUDE, CMD_VERSION, CMD_VHDLFLOW, CMD_WARNING, CMD_XMLINCLUDE, CMD_XMLONLY, CMD_XREFITEM, Mappers::cmdMapper, DocStyleChange::Code, Config_getBool, Config_getString, DocParser::context, DocParserContext::context, DocSimpleSect::Copyright, DocSimpleSect::Date, DocParser::defaultHandleTitleAndSize(), DocInclude::DocbookInclude, DocVerbatim::DocbookOnly, DocInclude::DontInclude, DocVerbatim::Dot, DocParserContext::exampleName, DocParamSect::Exception, FALSE, QCString::find(), found, g_plantumlEngine, DocNodeList::get_last(), Doxygen::globalScope, DocParser::handleAnchor(), handleCite(), handleDoxyConfig(), handleEmoji(), handleFile(), handleIFile(), handleILine(), DocParser::handleImage(), handleInclude(), handleIncludeOperator(), handleInheritDoc(), DocParser::handleInternalRef(), handleLink(), handleParamSection(), DocParser::handlePrefix(), handleRef(), handleSection(), handleShowDate(), handleSimpleSection(), handleStartCode(), DocParser::handleStyleArgument(), handleVhdlFlow(), handleXRefItem(), DocParserContext::hasReturnCommand, DocInclude::HtmlInclude, DocVerbatim::HtmlOnly, TokenInfo::id, DocSimpleSect::Important, DocInclude::Include, DocInclude::IncWithLines, DocParserContext::inSeeBlock, INTERNAL_ASSERT, DocSimpleSect::Invar, Token::is_any_of(), isAliasCmd(), QCString::isEmpty(), DocParserContext::isExample, DocStyleChange::Italic, DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocInclude::LatexInclude, DocVerbatim::LatexOnly, QCString::left(), DocTokenizer::lex(), DocIncOperator::Line, QCString::lower(), DocInclude::ManInclude, DocVerbatim::ManOnly, DocParserContext::memberDef, QCString::mid(), DocVerbatim::Msc, TokenInfo::name, DocParserContext::nodeStack, DocSimpleSect::Note, DocParamSect::Param, parse(), DocNode::parser(), DocVerbatim::PlantUML, GrowVector< T >::pop_back(), DocSimpleSect::Post, DocSimpleSect::Pre, qPrint(), DocSimpleSect::Remark, DocSimpleSect::Return, DocParamSect::RetVal, DocInclude::RtfInclude, DocVerbatim::RtfOnly, DocParserContext::scope, TokenInfo::sectionId, DocSimpleSect::See, DocVerbatim::setEngine(), DocTokenizer::setStateCode(), DocTokenizer::setStateDbOnly(), DocTokenizer::setStateDot(), DocTokenizer::setStateHtmlOnly(), DocTokenizer::setStateICode(), DocTokenizer::setStateILiteral(), DocTokenizer::setStateILiteralOpt(), DocTokenizer::setStateIVerbatim(), DocTokenizer::setStateLatexOnly(), DocTokenizer::setStateManOnly(), DocTokenizer::setStateMsc(), DocTokenizer::setStatePara(), DocTokenizer::setStatePlantUML(), DocTokenizer::setStatePlantUMLOpt(), DocTokenizer::setStateRtfOnly(), DocTokenizer::setStateSetScope(), DocTokenizer::setStateVerbatim(), DocTokenizer::setStateXmlOnly(), DocSimpleSect::Since, DocIncOperator::Skip, DocIncOperator::SkipLine, DocInclude::Snippet, DocInclude::SnippetWithLines, split(), QCString::str(), stripLeadingAndTrailingEmptyLines(), QCString::stripWhiteSpace(), 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_Pipe, HtmlEntityMapper::Sym_Plus, HtmlEntityMapper::Sym_Quest, HtmlEntityMapper::Sym_Quot, DocParamSect::TemplateParam, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, TRUE, UNKNOWN, DocIncOperator::Until, DocSimpleSect::User, TokenInfo::verb, DocVerbatim::Verbatim, DocInclude::VerbInclude, DocSimpleSect::Version, QCString::view(), warn, warn_doc_error, DocSimpleSect::Warning, DocInclude::XmlInclude, and DocVerbatim::XmlOnly.

Referenced by parse().

◆ handleDoxyConfig()

void DocPara::handleDoxyConfig ( char cmdChar,
const QCString & cmdName )

Definition at line 3349 of file docnode.cpp.

3350{
3351 // get the argument of the cite command.
3352 Token tok=parser()->tokenizer.lex();
3353 if (!tok.is(TokenRetval::TK_WHITESPACE))
3354 {
3355 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3356 cmdChar,qPrint(cmdName));
3357 return;
3358 }
3360 tok=parser()->tokenizer.lex();
3361 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3362 {
3363 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3364 "argument of command '%c%s'",cmdChar,qPrint(cmdName));
3365 return;
3366 }
3367 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
3368 {
3369 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3370 tok.to_string(),cmdChar,qPrint(cmdName));
3371 return;
3372 }
3373 ConfigOption * opt = ConfigImpl::instance()->get(parser()->context.token->name);
3374 if (opt)
3375 {
3376 QCString optionValue;
3377 switch (opt->kind())
3378 {
3380 optionValue = *(static_cast<ConfigBool*>(opt)->valueStringRef());
3381 break;
3383 optionValue = *(static_cast<ConfigString*>(opt)->valueRef());
3384 break;
3386 optionValue = *(static_cast<ConfigEnum*>(opt)->valueRef());
3387 break;
3389 optionValue = *(static_cast<ConfigInt*>(opt)->valueStringRef());
3390 break;
3392 {
3393 StringVector *lst = static_cast<ConfigList*>(opt)->valueRef();
3394 optionValue="";
3395 if (!lst->empty())
3396 {
3397 std::string lstFormat = theTranslator->trWriteList(static_cast<int>(lst->size())).str();
3398 static const reg::Ex marker(R"(@(\d+))");
3399 reg::Iterator it(lstFormat,marker);
3400 reg::Iterator end;
3401 size_t index=0;
3402 // now replace all markers with the real text
3403 for ( ; it!=end ; ++it)
3404 {
3405 const auto &match = *it;
3406 size_t newIndex = match.position();
3407 size_t matchLen = match.length();
3408 optionValue += lstFormat.substr(index,newIndex-index);
3409 unsigned long entryIndex = std::stoul(match[1].str());
3410 if (entryIndex<(unsigned long)lst->size())
3411 {
3412 optionValue += lst->at(entryIndex);
3413 }
3414 index=newIndex+matchLen;
3415 }
3416 optionValue+=lstFormat.substr(index);
3417 }
3418 }
3419 break;
3421 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Obsolete setting for '%c%s': '%s'",
3422 cmdChar,qPrint(cmdName),qPrint(parser()->context.token->name));
3423 break;
3425 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(),
3426 "Disabled setting (i.e. not supported in this doxygen executable) for '%c%s': '%s'",
3427 cmdChar,qPrint(cmdName),qPrint(parser()->context.token->name));
3428 break;
3430 // nothing to show here
3431 break;
3432 }
3433 if (!optionValue.isEmpty())
3434 {
3435 children().append<DocWord>(parser(),thisVariant(),optionValue);
3436 }
3437 }
3438 else
3439 {
3440 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown option for '%c%s': '%s'",
3441 cmdChar,qPrint(cmdName),qPrint(parser()->context.token->name));
3443 }
3445}
static ConfigImpl * instance()
Definition configimpl.h:350
ConfigOption * get(const QCString &name) const
Definition configimpl.h:399
@ O_Disabled
Disabled compile time option.
Definition configimpl.h:54
@ O_List
A list of items.
Definition configimpl.h:48
@ O_Enum
A fixed set of items.
Definition configimpl.h:49
@ O_Bool
A boolean value.
Definition configimpl.h:52
@ O_String
A single item.
Definition configimpl.h:50
@ O_Obsolete
An obsolete option.
Definition configimpl.h:53
@ O_Int
An integer value.
Definition configimpl.h:51
@ O_Info
A section header.
Definition configimpl.h:47
OptionType kind() const
Definition configimpl.h:69
void setStateDoxyConfig()
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:578
virtual QCString trWriteList(int numEntries)=0
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175
Translator * theTranslator
Definition language.cpp:71
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:759

References DocNodeList::append(), DocCompoundNode::children(), DocParser::context, end(), ConfigImpl::get(), ConfigImpl::instance(), Token::is(), Token::is_any_of(), QCString::isEmpty(), ConfigOption::kind(), DocTokenizer::lex(), TokenInfo::name, ConfigOption::O_Bool, ConfigOption::O_Disabled, ConfigOption::O_Enum, ConfigOption::O_Info, ConfigOption::O_Int, ConfigOption::O_List, ConfigOption::O_Obsolete, ConfigOption::O_String, DocNode::parser(), qPrint(), DocTokenizer::setStateDoxyConfig(), DocTokenizer::setStatePara(), theTranslator, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, ConfigEnum::valueRef(), ConfigString::valueRef(), ConfigBool::valueStringRef(), ConfigInt::valueStringRef(), warn, and warn_doc_error.

Referenced by handleCommand().

◆ handleEmoji()

void DocPara::handleEmoji ( char cmdChar,
const QCString & cmdName )

Definition at line 3318 of file docnode.cpp.

3319{
3320 AUTO_TRACE();
3321 // get the argument of the emoji command.
3322 Token tok=parser()->tokenizer.lex();
3323 if (!tok.is(TokenRetval::TK_WHITESPACE))
3324 {
3325 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3326 cmdChar,qPrint(cmdName));
3327 return;
3328 }
3330 tok=parser()->tokenizer.lex();
3331 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3332 {
3333 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"no emoji name given or unexpected end of comment block while parsing the "
3334 "argument of command '%c%s'",cmdChar,qPrint(cmdName));
3336 return;
3337 }
3338 else if (!tok.is(TokenRetval::TK_WORD))
3339 {
3340 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3341 tok.to_string(),cmdChar,qPrint(cmdName));
3343 return;
3344 }
3347}
void setStateEmoji()

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), qPrint(), DocTokenizer::setStateEmoji(), DocTokenizer::setStatePara(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleFile()

template<class T>
void DocPara::handleFile ( const QCString & cmdName)

Definition at line 3637 of file docnode.cpp.

3638{
3639 AUTO_TRACE("cmdName={}",cmdName);
3640 QCString saveCmdName = cmdName;
3641 Token tok=parser()->tokenizer.lex();
3642 if (!tok.is(TokenRetval::TK_WHITESPACE))
3643 {
3644 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3645 qPrint(saveCmdName));
3646 return;
3647 }
3649 tok=parser()->tokenizer.lex();
3651 if (!tok.is(TokenRetval::TK_WORD))
3652 {
3653 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of %s",
3654 tok.to_string(),qPrint(saveCmdName));
3655 return;
3656 }
3657 QCString name = parser()->context.token->name;
3658 children().append<T>(parser(),thisVariant(),name,
3662 auto df = children().get_last<T>();
3663 if (!df->parse())
3664 {
3665 children().pop_back();
3666 }
3667}
void setStateFile()
int getLineNr(void)
QCString fileName
Definition docparser_p.h:70

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocParserContext::context, DocParserContext::fileName, DocNodeList::get_last(), DocTokenizer::getLineNr(), Token::is(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), GrowVector< T >::pop_back(), qPrint(), DocTokenizer::setStateFile(), DocTokenizer::setStatePara(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleHtmlEndTag()

Token DocPara::handleHtmlEndTag ( const QCString & tagName)

Definition at line 5189 of file docnode.cpp.

5190{
5191 AUTO_TRACE("tagName={}",tagName);
5192 HtmlTagType tagId = Mappers::htmlTagMapper->map(tagName);
5193 Token retval = Token::make_RetVal_OK();
5194 switch (tagId)
5195 {
5197 if (!insideUL(thisVariant()))
5198 {
5199 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </ul> tag without matching <ul>");
5200 }
5201 else
5202 {
5203 retval = Token::make_RetVal_EndList();
5204 }
5205 break;
5207 if (!insideOL(thisVariant()))
5208 {
5209 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </ol> tag without matching <ol>");
5210 }
5211 else
5212 {
5213 retval = Token::make_RetVal_EndList();
5214 }
5215 break;
5217 if (!insideLI(thisVariant()))
5218 {
5219 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </li> tag without matching <li>");
5220 }
5221 else
5222 {
5223 // ignore </li> tags
5224 }
5225 break;
5227 if (!insideDetails(thisVariant()))
5228 {
5229 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </details> tag without matching <details>");
5230 }
5231 else
5232 {
5233 retval = Token::make_RetVal_EndHtmlDetails();
5234 }
5235 break;
5238 {
5239 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </blockquote> tag without matching <blockquote>");
5240 }
5241 else
5242 {
5243 retval = Token::make_RetVal_EndBlockQuote();
5244 }
5245 break;
5248 break;
5251 break;
5254 break;
5257 break;
5260 break;
5263 break;
5266 break;
5269 break;
5272 break;
5275 break;
5278 break;
5281 break;
5284 break;
5287 break;
5290 break;
5293 break;
5298 break;
5300 retval = Token::make_TK_NEWPARA();
5301 break;
5303 retval = Token::make_RetVal_EndDesc();
5304 break;
5306 // ignore </dt> tag
5307 break;
5309 // ignore </dd> tag
5310 break;
5312 retval = Token::make_RetVal_EndTable();
5313 break;
5315 // ignore </tr> tag
5316 break;
5318 // ignore </td> tag
5319 break;
5321 // ignore </th> tag
5322 break;
5326 // for time being ignore </t....> tag
5327 break;
5329 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </caption> found");
5330 break;
5332 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal </br> tag found");
5333 break;
5335 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h1> found");
5336 break;
5338 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h2> found");
5339 break;
5341 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h3> found");
5342 break;
5344 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h4> found");
5345 break;
5347 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h5> found");
5348 break;
5350 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h6> found");
5351 break;
5353 break;
5355 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal </hr> tag found");
5356 break;
5358 //warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </a> found");
5359 // ignore </a> tag (can be part of <a name=...></a>
5360 break;
5361
5363 break;
5365 retval = Token::make_TK_NEWPARA();
5366 break;
5379 retval = Token::make_RetVal_CloseXml();
5380 break;
5381 case HtmlTagType::XML_C:
5383 break;
5391 // These tags are defined in .Net but are currently unsupported
5392 break;
5394 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported xml/html tag </%s> found", qPrint(tagName));
5395 children().append<DocWord>(parser(),thisVariant(),"</"+tagName+">");
5396 break;
5397 default:
5398 // we should not get here!
5399 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected end tag %s",qPrint(tagName));
5400 ASSERT(0);
5401 break;
5402 }
5403 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5404 return retval;
5405}
void setInsidePreformatted(bool p)
Definition docnode.h:108
void handleStyleLeave(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName)
void setInsidePre(bool b)
HtmlTagType
Definition cmdmapper.h:169
bool insideUL(const DocNodeVariant *n)
bool insideLI(const DocNodeVariant *n)
bool insideBlockQuote(const DocNodeVariant *n)
bool insideDetails(const DocNodeVariant *n)
bool insideOL(const DocNodeVariant *n)
const Mapper< HtmlTagType > * htmlTagMapper
#define ASSERT(x)
Definition qcstring.h:39

References DocNodeList::append(), ASSERT, AUTO_TRACE, AUTO_TRACE_EXIT, DocStyleChange::Bold, DocStyleChange::Center, DocCompoundNode::children(), DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, FALSE, DocParser::handleStyleLeave(), HTML_A, HTML_BLOCKQUOTE, HTML_BOLD, HTML_BR, HTML_CAPTION, HTML_CENTER, HTML_CITE, HTML_CODE, HTML_DD, HTML_DEL, HTML_DETAILS, HTML_DIV, HTML_DL, HTML_DT, HTML_EMPHASIS, HTML_H1, HTML_H2, HTML_H3, HTML_H4, HTML_H5, HTML_H6, HTML_HR, HTML_IMG, HTML_INS, HTML_KBD, HTML_LI, HTML_OL, HTML_P, HTML_PRE, HTML_S, HTML_SMALL, HTML_SPAN, HTML_STRIKE, HTML_SUB, HTML_SUP, HTML_TABLE, HTML_TBODY, HTML_TD, HTML_TFOOT, HTML_TH, HTML_THEAD, HTML_TR, HTML_UL, HTML_UNDERLINE, Mappers::htmlTagMapper, DocStyleChange::Ins, insideBlockQuote(), insideDetails(), insideLI(), insideOL(), insideUL(), DocStyleChange::Italic, DocStyleChange::Kbd, DocNode::parser(), DocStyleChange::Preformatted, qPrint(), DocStyleChange::S, DocTokenizer::setInsidePre(), DocNode::setInsidePreformatted(), DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::Subscript, DocStyleChange::Superscript, DocNode::thisVariant(), Token::to_string(), DocParser::tokenizer, DocStyleChange::Underline, UNKNOWN, warn_doc_error, XML_C, XML_DESCRIPTION, XML_EXAMPLE, XML_EXCEPTION, XML_INCLUDE, XML_INHERITDOC, XML_ITEM, XML_LIST, XML_LISTHEADER, XML_PARA, XML_PARAM, XML_PARAMREF, XML_PERMISSION, XML_REMARKS, XML_RETURNS, XML_SEE, XML_SEEALSO, XML_SUMMARY, XML_TERM, XML_TYPEPARAM, XML_TYPEPARAMREF, and XML_VALUE.

Referenced by parse().

◆ handleHtmlHeader()

Token DocPara::handleHtmlHeader ( const HtmlAttribList & tagHtmlAttribs,
int level )

Definition at line 3880 of file docnode.cpp.

3881{
3882 AUTO_TRACE();
3883 children().append<DocHtmlHeader>(parser(),thisVariant(),tagHtmlAttribs,level);
3884 Token retval = children().get_last<DocHtmlHeader>()->parse();
3885 return retval.is(TokenRetval::RetVal_OK) ? Token::make_TK_NEWPARA() : retval;
3886}

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocNodeList::get_last(), parse(), DocNode::parser(), and DocNode::thisVariant().

Referenced by handleHtmlStartTag().

◆ handleHtmlStartTag()

Token DocPara::handleHtmlStartTag ( const QCString & tagName,
const HtmlAttribList & tagHtmlAttribs )

Definition at line 4721 of file docnode.cpp.

4722{
4723 AUTO_TRACE("tagName={} #tagHtmlAttrs={}",tagName,tagHtmlAttribs.size());
4724 Token retval = Token::make_RetVal_OK();
4725 HtmlTagType tagId = Mappers::htmlTagMapper->map(tagName);
4726 if (parser()->context.token->emptyTag && !(tagId>HtmlTagType::XML_CmdMask) &&
4729 {
4730 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"HTML tag ('<%s/>') may not use the 'empty tag' XHTML syntax.",
4731 qPrint(tagName));
4732 }
4733 switch (tagId)
4734 {
4736 if (!parser()->context.token->emptyTag)
4737 {
4738 children().append<DocHtmlList>(parser(),thisVariant(),
4739 tagHtmlAttribs,DocHtmlList::Unordered);
4740 retval=children().get_last<DocHtmlList>()->parse();
4741 }
4742 break;
4744 if (!parser()->context.token->emptyTag)
4745 {
4746 children().append<DocHtmlList>(parser(),thisVariant(),
4747 tagHtmlAttribs,DocHtmlList::Ordered);
4748 retval=children().get_last<DocHtmlList>()->parse();
4749 }
4750 break;
4752 if (parser()->context.token->emptyTag) break;
4754 {
4755 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"lonely <li> tag found");
4756 }
4757 else
4758 {
4759 retval = Token::make_RetVal_ListItem();
4760 }
4761 break;
4763 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Bold,tagName,&parser()->context.token->attribs);
4764 break;
4766 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::S,tagName,&parser()->context.token->attribs);
4767 break;
4769 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Strike,tagName,&parser()->context.token->attribs);
4770 break;
4772 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Del,tagName,&parser()->context.token->attribs);
4773 break;
4775 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Underline,tagName,&parser()->context.token->attribs);
4776 break;
4778 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Ins,tagName,&parser()->context.token->attribs);
4779 break;
4781 if (parser()->context.token->emptyTag) break;
4782 if (parser()->context.xmlComment)
4783 // for C# source or inside a <summary> or <remark> section we
4784 // treat <code> as an XML tag (so similar to @code)
4785 {
4787 retval = handleStartCode();
4788 }
4789 else // normal HTML markup
4790 {
4791 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Code,tagName,&parser()->context.token->attribs);
4792 }
4793 break;
4795 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Kbd,tagName,&parser()->context.token->attribs);
4796 break;
4798 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Italic,tagName,&parser()->context.token->attribs);
4799 break;
4801 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Div,tagName,&parser()->context.token->attribs);
4802 if (parser()->context.token->emptyTag) parser()->handleStyleLeave(thisVariant(),children(),DocStyleChange::Div,tagName);
4803 break;
4805 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Span,tagName,&parser()->context.token->attribs);
4806 if (parser()->context.token->emptyTag) parser()->handleStyleLeave(thisVariant(),children(),DocStyleChange::Span,tagName);
4807 break;
4809 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Subscript,tagName,&parser()->context.token->attribs);
4810 break;
4812 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Superscript,tagName,&parser()->context.token->attribs);
4813 break;
4815 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Center,tagName,&parser()->context.token->attribs);
4816 break;
4818 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Small,tagName,&parser()->context.token->attribs);
4819 break;
4821 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Cite,tagName,&parser()->context.token->attribs);
4822 break;
4824 if (parser()->context.token->emptyTag) break;
4825 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Preformatted,tagName,&parser()->context.token->attribs);
4828 break;
4830 retval = Token::make_TK_NEWPARA();
4831 break;
4833 if (!parser()->context.token->emptyTag)
4834 {
4835 children().append<DocHtmlDescList>(parser(),thisVariant(),tagHtmlAttribs);
4836 retval=children().get_last<DocHtmlDescList>()->parse();
4837 }
4838 break;
4840 if (insideDL(thisVariant()))
4841 {
4842 retval = Token::make_RetVal_DescTitle();
4843 }
4844 else
4845 {
4846 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <dt> found");
4847 }
4848 break;
4850 if (insideDL(thisVariant()))
4851 {
4852 retval = Token::make_RetVal_DescData();
4853 }
4854 else
4855 {
4856 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <dd> found");
4857 }
4858 break;
4860 if (!parser()->context.token->emptyTag)
4861 {
4862 children().append<DocHtmlTable>(parser(),thisVariant(),tagHtmlAttribs);
4863 retval=children().get_last<DocHtmlTable>()->parse();
4864 }
4865 break;
4867 retval = Token::make_RetVal_TableRow();
4868 break;
4870 retval = Token::make_RetVal_TableCell();
4871 break;
4873 retval = Token::make_RetVal_TableHCell();
4874 break;
4878 // for time being ignore </t....> tag
4879 break;
4881 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <caption> found");
4882 break;
4884 {
4885 children().append<DocLineBreak>(parser(),thisVariant(),tagHtmlAttribs);
4886 }
4887 break;
4889 {
4890 children().append<DocHorRuler>(parser(),thisVariant(),tagHtmlAttribs);
4891 }
4892 break;
4894 retval = parser()->handleAHref(thisVariant(),children(),tagHtmlAttribs);
4895 break;
4897 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,1);
4898 break;
4900 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,2);
4901 break;
4903 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,3);
4904 break;
4906 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,4);
4907 break;
4909 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,5);
4910 break;
4912 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,6);
4913 break;
4915 {
4916 parser()->handleImg(thisVariant(),children(),tagHtmlAttribs);
4917 }
4918 break;
4920 if (!parser()->context.token->emptyTag)
4921 {
4922 children().append<DocHtmlDetails>(parser(),thisVariant(),tagHtmlAttribs);
4923 retval=children().get_last<DocHtmlDetails>()->parse();
4924 }
4925 break;
4927 if (!parser()->context.token->emptyTag)
4928 {
4929 children().append<DocHtmlBlockQuote>(parser(),thisVariant(),tagHtmlAttribs);
4930 retval = children().get_last<DocHtmlBlockQuote>()->parse();
4931 }
4932 break;
4933
4936 {
4937 if (!parser()->context.token->emptyTag)
4938 {
4940 while (n && !std::holds_alternative<DocHtmlDetails>(*n)) n=::parent(n);
4941 DocHtmlDetails *d = std::get_if<DocHtmlDetails>(n);
4942 if (d)
4943 {
4944 if (!d->summary()) // details section does not have a summary yet
4945 {
4946 d->parseSummary(n,parser()->context.token->attribs);
4947 }
4948 else
4949 {
4950 retval = Token::make_TK_NEWPARA();
4951 }
4952 }
4953 }
4954 }
4955 break;
4959 // fall through
4962 if (!children().empty())
4963 {
4964 retval = Token::make_TK_NEWPARA();
4965 }
4966 break;
4968 if (insideTable(thisVariant()))
4969 {
4970 retval = Token::make_RetVal_TableCell();
4971 }
4972 break;
4973 case HtmlTagType::XML_C:
4974 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Code,tagName,&parser()->context.token->attribs);
4975 break;
4978 {
4980 QCString paramName;
4981 if (findAttribute(tagHtmlAttribs,"name",&paramName))
4982 {
4983 if (paramName.isEmpty())
4984 {
4985 if (Config_getBool(WARN_NO_PARAMDOC))
4986 {
4987 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"empty 'name' attribute for <param%s> tag.",tagId==HtmlTagType::XML_PARAM?"":"type");
4988 }
4989 }
4990 else
4991 {
4992 retval = handleParamSection(paramName,
4994 TRUE);
4995 }
4996 }
4997 else
4998 {
4999 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'name' attribute from <param%s> tag.",tagId==HtmlTagType::XML_PARAM?"":"type");
5000 }
5001 }
5002 break;
5005 {
5006 QCString paramName;
5007 if (findAttribute(tagHtmlAttribs,"name",&paramName))
5008 {
5009 //printf("paramName=%s\n",qPrint(paramName));
5010 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,tagName,TRUE);
5011 children().append<DocWord>(parser(),thisVariant(),paramName);
5012 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,tagName,FALSE);
5013 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
5014 }
5015 else
5016 {
5017 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'name' attribute from <param%sref> tag.",tagId==HtmlTagType::XML_PARAMREF?"":"type");
5018 }
5019 }
5020 break;
5022 {
5024 QCString exceptName;
5025 if (findAttribute(tagHtmlAttribs,"cref",&exceptName))
5026 {
5027 unescapeCRef(exceptName);
5028 retval = handleParamSection(exceptName,DocParamSect::Exception,TRUE);
5029 }
5030 else
5031 {
5032 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' attribute from <exception> tag.");
5033 }
5034 }
5035 break;
5038 if (insideTable(thisVariant()))
5039 {
5040 retval = Token::make_RetVal_TableRow();
5041 }
5042 else if (insideUL(thisVariant()) || insideOL(thisVariant()))
5043 {
5044 retval = Token::make_RetVal_ListItem();
5045 }
5046 else
5047 {
5048 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"lonely <item> tag found");
5049 }
5050 break;
5055 break;
5057 if (insideTable(thisVariant()))
5058 {
5059 retval = Token::make_RetVal_TableCell();
5060 }
5061 break;
5063 // I'm not sure if <see> is the same as <seealso> or if it
5064 // should you link a member without producing a section. The
5065 // C# specification is extremely vague about this (but what else
5066 // can we expect from Microsoft...)
5067 {
5068 QCString cref;
5069 //printf("HtmlTagType::XML_SEE: empty tag=%d\n",parser()->context.token->emptyTag);
5070 if (findAttribute(tagHtmlAttribs,"cref",&cref))
5071 {
5072 unescapeCRef(cref);
5073 if (parser()->context.token->emptyTag) // <see cref="..."/> style
5074 {
5075 bool inSeeBlock = parser()->context.inSeeBlock;
5076 parser()->context.token->name = cref;
5079 parser()->context.inSeeBlock = inSeeBlock;
5080 }
5081 else // <see cref="...">...</see> style
5082 {
5083 //DocRef *ref = new DocRef(this,cref);
5084 //children().append(ref);
5085 //ref->parse();
5087 children().append<DocLink>(parser(),thisVariant(),cref);
5088 DocLink *lnk = children().get_last<DocLink>();
5089 QCString leftOver = lnk->parse(FALSE,TRUE);
5090 if (!leftOver.isEmpty())
5091 {
5092 children().append<DocWord>(parser(),thisVariant(),leftOver);
5093 }
5094 }
5095 }
5096 else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langword="..."></see>
5097 {
5098 bool inSeeBlock = parser()->context.inSeeBlock;
5099 parser()->context.token->name = cref;
5101 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,tagName,TRUE);
5103 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,tagName,FALSE);
5104 parser()->context.inSeeBlock = inSeeBlock;
5105 }
5106 else
5107 {
5108 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' or 'langword' attribute from <see> tag.");
5109 }
5110 }
5111 break;
5113 {
5115 QCString cref;
5116 if (findAttribute(tagHtmlAttribs,"cref",&cref))
5117 {
5118 unescapeCRef(cref);
5119 // Look for an existing "see" section
5120 DocNodeVariant *vss=nullptr;
5121 for (auto &n : children())
5122 {
5123 DocSimpleSect *candidate = std::get_if<DocSimpleSect>(&n);
5124 if (candidate && candidate->type()==DocSimpleSect::See)
5125 {
5126 vss = &n;
5127 }
5128 }
5129
5130 if (!vss) // start new section
5131 {
5132 children().append<DocSimpleSect>(parser(),thisVariant(),DocSimpleSect::See);
5133 vss = &children().back();
5134 }
5135
5136 std::get<DocSimpleSect>(*vss).appendLinkWord(cref);
5137 retval = Token::make_RetVal_OK();
5138 }
5139 else
5140 {
5141 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' attribute from <seealso> tag.");
5142 }
5143 }
5144 break;
5146 {
5147 QCString type;
5148 findAttribute(tagHtmlAttribs,"type",&type);
5150 HtmlAttribList emptyList;
5151 if (type=="number")
5152 {
5153 listType=DocHtmlList::Ordered;
5154 }
5155 if (type=="table")
5156 {
5157 children().append<DocHtmlTable>(parser(),thisVariant(),emptyList);
5158 retval=children().get_last<DocHtmlTable>()->parseXml();
5159 }
5160 else
5161 {
5162 children().append<DocHtmlList>(parser(),thisVariant(),emptyList,listType);
5163 retval=children().get_last<DocHtmlList>()->parseXml();
5164 }
5165 }
5166 break;
5169 // These tags are defined in .Net but are currently unsupported
5171 break;
5173 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported xml/html tag <%s> found", qPrint(tagName));
5174 children().append<DocWord>(parser(),thisVariant(), "<"+tagName+parser()->context.token->attribsStr+">");
5175 break;
5178 break;
5179 default:
5180 // we should not get here!
5181 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected start tag %s",qPrint(tagName));
5182 ASSERT(0);
5183 break;
5184 }
5185 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5186 return retval;
5187}
void parseSummary(DocNodeVariant *, HtmlAttribList &attribs)
Definition docnode.cpp:1440
const DocNodeVariant * summary() const
Definition docnode.h:858
Token handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs, int level)
Definition docnode.cpp:3880
void handleLinkedWord(DocNodeVariant *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE)
Token handleAHref(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
void handleStyleEnter(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName, const HtmlAttribList *attribs)
void handleImg(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
Type type() const
Definition docnode.h:1020
void setStateXmlCode()
T & back()
access the last element
Definition growvector.h:135
static void unescapeCRef(QCString &s)
Definition docnode.cpp:81
static bool findAttribute(const HtmlAttribList &tagHtmlAttribs, const char *attrName, QCString *result)
Definition docnode.cpp:4705
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 > DocNodeVariant
Definition docnode.h:66
bool insideTable(const DocNodeVariant *n)
bool insideDL(const DocNodeVariant *n)
QCString attribsStr

References DocNodeList::append(), ASSERT, TokenInfo::attribsStr, AUTO_TRACE, AUTO_TRACE_EXIT, GrowVector< T >::back(), DocStyleChange::Bold, DocStyleChange::Center, DocCompoundNode::children(), DocStyleChange::Cite, DocStyleChange::Code, Config_getBool, DocParser::context, DocStyleChange::Del, DocStyleChange::Div, DocParamSect::Exception, FALSE, findAttribute(), DocNodeList::get_last(), DocParser::handleAHref(), handleHtmlHeader(), DocParser::handleImg(), handleInheritDoc(), DocParser::handleLinkedWord(), handleParamSection(), handleSimpleSection(), handleStartCode(), DocParser::handleStyleEnter(), DocParser::handleStyleLeave(), DocParserContext::hasReturnCommand, HTML_A, HTML_BLOCKQUOTE, HTML_BOLD, HTML_BR, HTML_CAPTION, HTML_CENTER, HTML_CITE, HTML_CODE, HTML_DD, HTML_DEL, HTML_DETAILS, HTML_DIV, HTML_DL, HTML_DT, HTML_EMPHASIS, HTML_H1, HTML_H2, HTML_H3, HTML_H4, HTML_H5, HTML_H6, HTML_HR, HTML_IMG, HTML_INS, HTML_KBD, HTML_LI, HTML_OL, HTML_P, HTML_PRE, HTML_S, HTML_SMALL, HTML_SPAN, HTML_STRIKE, HTML_SUB, HTML_SUP, HTML_TABLE, HTML_TBODY, HTML_TD, HTML_TFOOT, HTML_TH, HTML_THEAD, HTML_TR, HTML_UL, HTML_UNDERLINE, Mappers::htmlTagMapper, DocStyleChange::Ins, DocParserContext::inSeeBlock, insideDetails(), insideDL(), insideOL(), insideTable(), insideUL(), Token::is(), QCString::isEmpty(), DocStyleChange::Italic, DocStyleChange::Kbd, TokenInfo::name, DocParserContext::nodeStack, DocHtmlList::Ordered, DocParamSect::Param, DocNode::parent(), parse(), DocNode::parser(), DocHtmlDetails::parseSummary(), DocStyleChange::Preformatted, qPrint(), DocSimpleSect::Return, DocStyleChange::S, DocSimpleSect::See, DocTokenizer::setInsidePre(), DocNode::setInsidePreformatted(), DocTokenizer::setStatePara(), DocTokenizer::setStateXmlCode(), DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::Subscript, DocHtmlDetails::summary(), DocStyleChange::Superscript, DocParamSect::TemplateParam, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, TRUE, DocSimpleSect::type(), DocStyleChange::Underline, unescapeCRef(), UNKNOWN, DocHtmlList::Unordered, warn_doc_error, XML_C, XML_CmdMask, XML_DESCRIPTION, XML_EXAMPLE, XML_EXCEPTION, XML_INCLUDE, XML_INHERITDOC, XML_ITEM, XML_LIST, XML_LISTHEADER, XML_PARA, XML_PARAM, XML_PARAMREF, XML_PERMISSION, XML_REMARKS, XML_RETURNS, XML_SEE, XML_SEEALSO, XML_SUMMARY, XML_TERM, XML_TYPEPARAM, XML_TYPEPARAMREF, XML_VALUE, and DocParserContext::xmlComment.

Referenced by parse().

◆ handleIFile()

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

Definition at line 3553 of file docnode.cpp.

3554{
3555 AUTO_TRACE();
3556 Token tok=parser()->tokenizer.lex();
3557 if (!tok.is(TokenRetval::TK_WHITESPACE))
3558 {
3559 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3560 cmdChar,qPrint(cmdName));
3561 return;
3562 }
3564 tok=parser()->tokenizer.lex();
3566 if (!tok.is(TokenRetval::TK_WORD))
3567 {
3568 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3569 tok.to_string(),cmdChar,qPrint(cmdName));
3570 return;
3571 }
3574}

References AUTO_TRACE, DocParser::context, DocParserContext::fileName, Token::is(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), qPrint(), DocTokenizer::setStateFile(), DocTokenizer::setStatePara(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleILine()

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

Definition at line 3539 of file docnode.cpp.

3540{
3541 AUTO_TRACE();
3543 Token tok = parser()->tokenizer.lex();
3544 if (!tok.is(TokenRetval::TK_WORD))
3545 {
3546 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid argument for command '%c%s'",
3547 cmdChar,qPrint(cmdName));
3548 return;
3549 }
3551}
void setStateILine()

References AUTO_TRACE, Token::is(), DocTokenizer::lex(), DocNode::parser(), qPrint(), DocTokenizer::setStateILine(), DocTokenizer::setStatePara(), DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleInclude()

void DocPara::handleInclude ( const QCString & cmdName,
DocInclude::Type t )

Definition at line 3744 of file docnode.cpp.

3745{
3746 AUTO_TRACE("cmdName={}",cmdName);
3747 QCString saveCmdName = cmdName;
3748 Token tok=parser()->tokenizer.lex();
3749 bool isBlock = false;
3750 bool trimLeft = false;
3751 bool localScope = false;
3752 bool stripCodeComments = Config_getBool(STRIP_CODE_COMMENTS);
3753 if (tok.is(TokenRetval::TK_WORD) && parser()->context.token->name=="{")
3754 {
3756 parser()->tokenizer.lex();
3758 StringVector optList=split(parser()->context.token->name.str(),",");
3759 auto contains = [&optList](const char *kw)
3760 {
3761 return std::find(optList.begin(),optList.end(),kw)!=optList.end();
3762 };
3763 localScope = contains("local");
3764 if (contains("nostrip"))
3765 {
3766 stripCodeComments = false;
3767 }
3768 else if (contains("strip"))
3769 {
3770 stripCodeComments = true;
3771 }
3772 if (t==DocInclude::Snippet && contains("trimleft"))
3773 {
3774 trimLeft = true;
3775 }
3776
3777 if (contains("lineno"))
3778 {
3782 }
3783 tok=parser()->tokenizer.lex();
3784 if (!tok.is(TokenRetval::TK_WHITESPACE))
3785 {
3786 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3787 qPrint(saveCmdName));
3788 return;
3789 }
3790 }
3791 else if (tok.is(TokenRetval::TK_WORD) && parser()->context.token->name=="[")
3792 {
3794 parser()->tokenizer.lex();
3795 isBlock = (parser()->context.token->name.stripWhiteSpace() == "block");
3797 parser()->tokenizer.lex();
3798 }
3799 else if (!tok.is(TokenRetval::TK_WHITESPACE))
3800 {
3801 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3802 qPrint(saveCmdName));
3803 return;
3804 }
3806 tok=parser()->tokenizer.lex();
3808 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3809 {
3810 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3811 "argument of command %s",qPrint(saveCmdName));
3812 return;
3813 }
3814 else if (!tok.is(TokenRetval::TK_WORD))
3815 {
3816 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of %s",
3817 tok.to_string(),qPrint(saveCmdName));
3818 return;
3819 }
3820 QCString fileName = parser()->context.token->name;
3821 QCString blockId;
3823 {
3824 if (fileName == "this") fileName=parser()->context.fileName;
3826 tok=parser()->tokenizer.lex();
3828 if (!tok.is(TokenRetval::TK_WORD))
3829 {
3830 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected block identifier, but found token %s instead while parsing the %s command",
3831 tok.to_string(),qPrint(saveCmdName));
3832 return;
3833 }
3834 blockId = "["+parser()->context.token->name+"]";
3835 }
3836
3837 children().append<DocInclude>(parser(),
3838 thisVariant(),
3839 fileName,
3840 localScope ? parser()->context.context : "",
3841 t,
3842 stripCodeComments,
3845 blockId,isBlock,trimLeft);
3846 children().get_last<DocInclude>()->parse();
3847}
@ DontIncWithLines
Definition docnode.h:434
void setStateSnippet()
void setStateBlock()
void setStateOptions()

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), Config_getBool, DocParser::context, DocParserContext::context, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocParserContext::exampleName, DocParserContext::fileName, DocNodeList::get_last(), DocInclude::Include, DocInclude::IncWithLines, Token::is(), Token::is_any_of(), DocParserContext::isExample, DocTokenizer::lex(), TokenInfo::name, parse(), DocNode::parser(), qPrint(), DocTokenizer::setStateBlock(), DocTokenizer::setStateFile(), DocTokenizer::setStateOptions(), DocTokenizer::setStatePara(), DocTokenizer::setStateSnippet(), DocInclude::Snippet, DocInclude::SnippetWithLines, split(), QCString::stripWhiteSpace(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleIncludeOperator()

void DocPara::handleIncludeOperator ( const QCString & cmdName,
DocIncOperator::Type t )

Definition at line 3577 of file docnode.cpp.

3578{
3579 AUTO_TRACE("cmdName={}",cmdName);
3580 QCString saveCmdName = cmdName;
3581 Token tok=parser()->tokenizer.lex();
3582 if (!tok.is(TokenRetval::TK_WHITESPACE))
3583 {
3584 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3585 qPrint(saveCmdName));
3586 return;
3587 }
3589 tok=parser()->tokenizer.lex();
3591 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3592 {
3593 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3594 "argument of command %s", qPrint(saveCmdName));
3595 return;
3596 }
3597 else if (!tok.is(TokenRetval::TK_WORD))
3598 {
3599 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of %s",
3600 tok.to_string(),qPrint(saveCmdName));
3601 return;
3602 }
3603 auto it1 = children().size()>=1 ? std::prev(children().end()) : children().end();
3604 auto it2 = children().size()>=2 ? std::prev(it1) : children().end();
3605 DocNodeVariant *n1 = it1!=children().end() ? &(*it1) : nullptr;
3606 DocNodeVariant *n2 = it2!=children().end() ? &(*it2) : nullptr;
3607 //TODO get from context the stripCodeComments()
3608 bool stripCodeComments = Config_getBool(STRIP_CODE_COMMENTS);
3609 children().append<DocIncOperator>(parser(),thisVariant(),t,
3612 stripCodeComments,
3615 );
3616 DocIncOperator *op = children().get_last<DocIncOperator>();
3617 DocIncOperator *n1_docIncOp = std::get_if<DocIncOperator>(n1);
3618 DocWhiteSpace *n1_docWs = std::get_if<DocWhiteSpace >(n1);
3619 DocIncOperator *n2_docIncOp = std::get_if<DocIncOperator>(n2);
3620 bool isFirst = !n1 || // no last node
3621 (!n1_docIncOp && !n1_docWs) || // last node is not operator or whitespace
3622 (n1_docWs && n2 && !n2_docIncOp); // last node is not operator
3623 op->markFirst(isFirst);
3624 op->markLast(true);
3625 if (n1_docIncOp)
3626 {
3627 n1_docIncOp->markLast(false);
3628 }
3629 else if (n1_docWs && n2_docIncOp)
3630 {
3631 n2_docIncOp->markLast(false);
3632 }
3633 op->parse();
3634}
void markLast(bool v=TRUE)
Definition docnode.h:500
bool isFirst() const
Definition docnode.h:1081
void setStatePattern()
size_t size() const
returns the number of elements
Definition growvector.h:93
iterator end()
returns an iterator to the end
Definition growvector.h:88

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), Config_getBool, DocParser::context, DocParserContext::context, end(), GrowVector< T >::end(), DocParserContext::exampleName, DocNodeList::get_last(), Token::is(), Token::is_any_of(), DocParserContext::isExample, isFirst(), DocTokenizer::lex(), DocIncOperator::markLast(), TokenInfo::name, DocNode::parser(), qPrint(), DocTokenizer::setStatePara(), DocTokenizer::setStatePattern(), GrowVector< T >::size(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleInheritDoc()

void DocPara::handleInheritDoc ( )

Definition at line 3934 of file docnode.cpp.

3935{
3936 if (parser()->context.memberDef) // inheriting docs from a member
3937 {
3938 const MemberDef *reMd = parser()->context.memberDef->reimplements();
3939 if (reMd) // member from which was inherited.
3940 {
3941 const MemberDef *thisMd = parser()->context.memberDef;
3942 //printf("{InheritDocs:%s=>%s}\n",qPrint(parser()->context.memberDef->qualifiedName()),qPrint(reMd->qualifiedName()));
3943 parser()->pushContext();
3944 parser()->context.scope=reMd->getOuterScope();
3945 if (parser()->context.scope!=Doxygen::globalScope)
3946 {
3948 }
3949 parser()->context.memberDef=reMd;
3950 while (!parser()->context.styleStack.empty()) parser()->context.styleStack.pop();
3951 while (!parser()->context.nodeStack.empty()) parser()->context.nodeStack.pop();
3952 parser()->context.copyStack.push_back(reMd);
3955 parser()->context.copyStack.pop_back();
3956 auto hasParamCommand = parser()->context.hasParamCommand;
3957 auto hasReturnCommand = parser()->context.hasReturnCommand;
3958 auto retvalsFound = parser()->context.retvalsFound;
3959 auto paramsFound = parser()->context.paramsFound;
3960 parser()->popContext();
3961 parser()->context.hasParamCommand = hasParamCommand;
3962 parser()->context.hasReturnCommand = hasReturnCommand;
3963 parser()->context.retvalsFound = retvalsFound;
3964 parser()->context.paramsFound = paramsFound;
3965 parser()->context.memberDef = thisMd;
3966 }
3967 }
3968}
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual QCString documentation() const =0
virtual Definition * getOuterScope() const =0
virtual const QCString & name() const =0
Token internalValidatingParseDoc(DocNodeVariant *parent, DocNodeList &children, const QCString &doc)
void popContext()
Definition docparser.cpp:73
void pushContext()
Definition docparser.cpp:59
virtual const MemberDef * reimplements() const =0
StringMultiSet retvalsFound
Definition docparser_p.h:75
DocStyleChangeStack styleStack
Definition docparser_p.h:67
StringMultiSet paramsFound
Definition docparser_p.h:76
DefinitionStack copyStack
Definition docparser_p.h:69

References Definition::briefDescription(), DocCompoundNode::children(), DocParser::context, DocParserContext::context, DocParserContext::copyStack, Definition::documentation(), Definition::getOuterScope(), Doxygen::globalScope, DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, DocParser::internalValidatingParseDoc(), DocParserContext::memberDef, Definition::name(), DocParserContext::nodeStack, DocParserContext::paramsFound, DocNode::parser(), DocParser::popContext(), DocParser::pushContext(), MemberDef::reimplements(), DocParserContext::retvalsFound, DocParserContext::scope, DocParserContext::styleStack, and DocNode::thisVariant().

Referenced by handleCommand(), and handleHtmlStartTag().

◆ handleLink()

void DocPara::handleLink ( const QCString & cmdName,
bool isJavaLink )

Definition at line 3676 of file docnode.cpp.

3677{
3678 AUTO_TRACE("cmdName={} isJavaLink={}",cmdName,isJavaLink);
3679 QCString saveCmdName = cmdName;
3680 Token tok=parser()->tokenizer.lex();
3681 if (!tok.is(TokenRetval::TK_WHITESPACE))
3682 {
3683 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3684 qPrint(saveCmdName));
3685 return;
3686 }
3688 tok=parser()->tokenizer.lex();
3689 if (!tok.is(TokenRetval::TK_WORD))
3690 {
3691 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"%s as the argument of %s",
3692 tok.to_string(),qPrint(saveCmdName));
3693 return;
3694 }
3695 if (saveCmdName == "javalink")
3696 {
3697 children().append<DocStyleChange>(parser(),thisVariant(),
3698 parser()->context.nodeStack.size(),
3699 DocStyleChange::Code,cmdName,TRUE);
3700 }
3703 DocLink *lnk = children().get_last<DocLink>();
3704 if (saveCmdName == "javalink")
3705 {
3706 children().append<DocStyleChange>(parser(),thisVariant(),
3707 parser()->context.nodeStack.size(),
3708 DocStyleChange::Code,cmdName,FALSE);
3709 }
3710 QCString leftOver = lnk->parse(isJavaLink);
3711 if (!leftOver.isEmpty())
3712 {
3713 children().append<DocWord>(parser(),thisVariant(),leftOver);
3714 }
3715}
void setStateLink()

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocStyleChange::Code, DocParser::context, FALSE, DocNodeList::get_last(), Token::is(), QCString::isEmpty(), DocTokenizer::lex(), TokenInfo::name, DocParserContext::nodeStack, DocNode::parser(), qPrint(), DocTokenizer::setStateLink(), DocTokenizer::setStatePara(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, TRUE, and warn_doc_error.

Referenced by handleCommand().

◆ handleParamSection()

Token DocPara::handleParamSection ( const QCString & cmdName,
DocParamSect::Type t,
bool xmlContext = FALSE,
int direction = DocParamSect::Unspecified )

Definition at line 3263 of file docnode.cpp.

3267{
3268 AUTO_TRACE();
3269 DocParamSect *ps = nullptr;
3270 if (!children().empty() && // previous element
3271 (ps=children().get_last<DocParamSect>()) && // was a param sect
3272 ps->type()==t) // of same type
3273 { // append to previous section ps
3274 }
3275 else // start new section
3276 {
3277 children().append<DocParamSect>(parser(),thisVariant(),t);
3278 ps = children().get_last<DocParamSect>();
3279 }
3280 Token rv=ps->parse(cmdName,xmlContext,
3281 static_cast<DocParamSect::Direction>(direction));
3282 AUTO_TRACE_EXIT("retval={}",rv.to_string());
3283 return (!rv.is(TokenRetval::TK_NEWPARA)) ? rv : Token::make_RetVal_OK();
3284}
Token parse(const QCString &cmdName, bool xmlContext, Direction d)
Definition docnode.cpp:3184
Type type() const
Definition docnode.h:1062

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_EXIT, DocCompoundNode::children(), FALSE, DocNodeList::get_last(), Token::is(), DocParamSect::parse(), DocNode::parser(), DocNode::thisVariant(), Token::to_string(), DocParamSect::type(), and DocParamSect::Unspecified.

Referenced by handleCommand(), and handleHtmlStartTag().

◆ handleRef()

void DocPara::handleRef ( char cmdChar,
const QCString & cmdName )

Definition at line 3717 of file docnode.cpp.

3718{
3719 AUTO_TRACE("cmdName={}",cmdName);
3720 QCString saveCmdName = cmdName;
3721 Token tok=parser()->tokenizer.lex();
3722 if (!tok.is(TokenRetval::TK_WHITESPACE))
3723 {
3724 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3725 cmdChar,qPrint(saveCmdName));
3726 return;
3727 }
3729 tok=parser()->tokenizer.lex(); // get the reference id
3730 if (!tok.is(TokenRetval::TK_WORD))
3731 {
3732 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3733 tok.to_string(),cmdChar,qPrint(saveCmdName));
3734 goto endref;
3735 }
3736 children().append<DocRef>(parser(),thisVariant(),
3739 children().get_last<DocRef>()->parse();
3740endref:
3742}

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocParserContext::context, DocNodeList::get_last(), Token::is(), DocTokenizer::lex(), TokenInfo::name, parse(), DocNode::parser(), qPrint(), DocTokenizer::setStatePara(), DocTokenizer::setStateRef(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleSection()

void DocPara::handleSection ( char cmdChar,
const QCString & cmdName )

Definition at line 3849 of file docnode.cpp.

3850{
3851 AUTO_TRACE("cmdName={}",cmdName);
3852 QCString saveCmdName = cmdName;
3853 // get the argument of the section command.
3854 Token tok=parser()->tokenizer.lex();
3855 if (!tok.is(TokenRetval::TK_WHITESPACE))
3856 {
3857 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3858 cmdChar,qPrint(saveCmdName));
3859 return;
3860 }
3861 tok=parser()->tokenizer.lex();
3862 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3863 {
3864 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3865 "argument of command '%c%s'", cmdChar,qPrint(saveCmdName));
3866 return;
3867 }
3868 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
3869 {
3870 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3871 tok.to_string(),cmdChar,qPrint(saveCmdName));
3872 return;
3873 }
3876 parser()->tokenizer.lex();
3878}
void setStateSkipTitle()

References AUTO_TRACE, DocParser::context, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), qPrint(), TokenInfo::sectionId, DocTokenizer::setStatePara(), DocTokenizer::setStateSkipTitle(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleShowDate()

void DocPara::handleShowDate ( char cmdChar,
const QCString & cmdName )

Definition at line 3468 of file docnode.cpp.

3469{
3470 AUTO_TRACE();
3471 QCString fmt;
3472 QCString date;
3473 Token tok=parser()->tokenizer.lex();
3474 if (!tok.is(TokenRetval::TK_WHITESPACE))
3475 {
3476 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3477 cmdChar,qPrint(cmdName));
3478 return;
3479 }
3481 tok = parser()->tokenizer.lex();
3482 if (!tok.is(TokenRetval::TK_WORD))
3483 {
3484 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <format> argument for command '%c%s'",
3485 cmdChar,qPrint(cmdName));
3487 return;
3488 }
3489 fmt = parser()->context.token->name;
3490
3492 tok = parser()->tokenizer.lex();
3493
3494 QCString specDateRaw = tok.is(TokenRetval::TK_WORD) ? parser()->context.token->name : QCString();
3495 QCString specDate = specDateRaw.stripWhiteSpace();
3496 bool specDateOnlyWS = !specDateRaw.isEmpty() && specDate.isEmpty();
3497 if (!specDate.isEmpty() && !tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3498 {
3499 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <date_time> argument for command '%c%s'",
3500 cmdChar,qPrint(cmdName));
3502 return;
3503 }
3504
3505 std::tm dat{};
3506 int specFormat=0;
3507 QCString err = dateTimeFromString(specDate,dat,specFormat);
3508 if (!err.isEmpty())
3509 {
3510 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <date_time> argument for command '%c%s': %s",
3511 cmdChar,qPrint(cmdName),qPrint(err));
3513 return;
3514 }
3515
3516 int usedFormat=0;
3517 QCString dateTimeStr = formatDateTime(fmt,dat,usedFormat);
3518
3519 // warn the user if the format contains markers that are not explicitly filled in
3520 for (int i=0;i<SF_NumBits;i++)
3521 {
3522 int bitMask = 1<<i;
3523 if ((usedFormat&bitMask) && !(specFormat&bitMask)) // a part was used in the format string but its value was not specified.
3524 {
3525 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"'%c%s' <format> parameter '%s' has %s related markers which are not specified in the <date_time> parameter '%s'. Filling in the current value for %s instead.",
3526 cmdChar,qPrint(cmdName),
3527 qPrint(fmt),SF_bit2str(i),qPrint(specDate),SF_bit2str(i));
3528 }
3529 }
3530
3531 children().append<DocWord>(parser(),thisVariant(),dateTimeStr);
3532 if (specDateOnlyWS) // specDate is only whitespace
3533 {
3534 children().append<DocWhiteSpace>(parser(),thisVariant()," ");
3535 }
3537}
void setStateShowDate()
void setStateQuotedString()
QCString formatDateTime(const QCString &format, const std::tm &dt, int &formatUsed)
Return a string representation for a given std::tm value that is formatted according to the pattern g...
Definition datetime.cpp:175
QCString dateTimeFromString(const QCString &spec, std::tm &dt, int &format)
Returns the filled in std::tm for a given string representing a date and/or time.
Definition datetime.cpp:134
constexpr const char * SF_bit2str(int bitNumber)
Helper function that returns the name related one of the SF bits.
Definition datetime.h:32
constexpr int SF_NumBits
number of bits in SF vector
Definition datetime.h:27
#define err(fmt,...)
Definition message.h:84

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, dateTimeFromString(), err, formatDateTime(), Token::is(), Token::is_any_of(), QCString::isEmpty(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), qPrint(), DocTokenizer::setStatePara(), DocTokenizer::setStateQuotedString(), DocTokenizer::setStateShowDate(), SF_bit2str(), SF_NumBits, QCString::stripWhiteSpace(), DocNode::thisVariant(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by handleCommand().

◆ handleSimpleSection()

Token DocPara::handleSimpleSection ( DocSimpleSect::Type t,
bool xmlContext = FALSE )

Definition at line 3233 of file docnode.cpp.

3234{
3235 AUTO_TRACE();
3236 DocSimpleSect *ss=nullptr;
3237 bool needsSeparator = FALSE;
3238 if (!children().empty() && // has previous element
3239 (ss=children().get_last<DocSimpleSect>()) && // was a simple sect
3240 ss->type()==t && // of same type
3241 t!=DocSimpleSect::User) // but not user defined
3242 {
3243 // append to previous section
3244 needsSeparator = TRUE;
3245 }
3246 else // start new section
3247 {
3248 children().append<DocSimpleSect>(parser(),thisVariant(),t);
3249 ss = children().get_last<DocSimpleSect>();
3250 }
3251 Token rv = Token::make_RetVal_OK();
3252 if (xmlContext)
3253 {
3254 return ss->parseXml();
3255 }
3256 else
3257 {
3258 rv = ss->parse(t==DocSimpleSect::User,needsSeparator);
3259 }
3260 return (!rv.is(TokenRetval::TK_NEWPARA)) ? rv : Token::make_RetVal_OK();
3261}
Token parse(bool userTitle, bool needsSeparator)
Definition docnode.cpp:2898
Token parseXml()
Definition docnode.cpp:2952

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), FALSE, DocNodeList::get_last(), Token::is(), DocSimpleSect::parse(), DocNode::parser(), DocSimpleSect::parseXml(), DocNode::thisVariant(), TRUE, DocSimpleSect::type(), and DocSimpleSect::User.

Referenced by handleCommand(), and handleHtmlStartTag().

◆ handleStartCode()

Token DocPara::handleStartCode ( )

Definition at line 3898 of file docnode.cpp.

3899{
3900 AUTO_TRACE();
3901 Token retval = parser()->tokenizer.lex();
3902 QCString lang = parser()->context.token->name;
3903 if (!lang.isEmpty() && lang.at(0)!='.')
3904 {
3905 lang="."+lang;
3906 }
3907 if (parser()->context.xmlComment)
3908 {
3909 parser()->context.token->verb = substitute(substitute(parser()->context.token->verb,"&lt;","<"),"&gt;",">");
3910 }
3911 // search for the first non-whitespace line, index is stored in li
3912 size_t i=0,li=0,l=parser()->context.token->verb.length();
3913 while (i<l && (parser()->context.token->verb.at(i)==' ' || parser()->context.token->verb.at(i)=='\n'))
3914 {
3915 if (parser()->context.token->verb.at(i)=='\n') li=i+1;
3916 i++;
3917 }
3918 children().append<DocVerbatim>(parser(),thisVariant(),
3920 stripIndentation(parser()->context.token->verb.mid(li)),
3924 FALSE,lang);
3925 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3926 {
3927 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"code section ended without end marker");
3928 }
3930 AUTO_TRACE_EXIT("retval={}",retval.to_string());
3931 return retval;
3932}
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
QCString stripIndentation(const QCString &s)
Definition util.cpp:6282

References DocNodeList::append(), QCString::at(), AUTO_TRACE, AUTO_TRACE_EXIT, DocCompoundNode::children(), DocVerbatim::Code, DocParser::context, DocParserContext::context, DocParserContext::exampleName, FALSE, Token::is_any_of(), QCString::isEmpty(), DocParserContext::isExample, QCString::length(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), DocTokenizer::setStatePara(), stripIndentation(), substitute(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, TokenInfo::verb, and warn_doc_error.

Referenced by handleCommand(), and handleHtmlStartTag().

◆ handleVhdlFlow()

void DocPara::handleVhdlFlow ( )

Definition at line 3669 of file docnode.cpp.

3670{
3671 AUTO_TRACE();
3672 children().append<DocVhdlFlow>(parser(),thisVariant());
3673 children().get_last<DocVhdlFlow>()->parse();
3674}

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocNodeList::get_last(), parse(), DocNode::parser(), and DocNode::thisVariant().

Referenced by handleCommand().

◆ handleXRefItem()

Token DocPara::handleXRefItem ( )

Definition at line 3447 of file docnode.cpp.

3448{
3449 AUTO_TRACE();
3450 Token retval=parser()->tokenizer.lex();
3451 ASSERT(retval.is(TokenRetval::TK_WHITESPACE));
3453 retval=parser()->tokenizer.lex();
3454 if (retval.is(TokenRetval::RetVal_OK))
3455 {
3456 children().append<DocXRefItem>(parser(),thisVariant(),
3458 DocXRefItem *ref = children().get_last<DocXRefItem>();
3459 if (!ref->parse())
3460 {
3461 children().pop_back();
3462 }
3463 }
3465 return retval;
3466}
void setStateXRefItem()

References DocNodeList::append(), ASSERT, AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocNodeList::get_last(), TokenInfo::id, Token::is(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), GrowVector< T >::pop_back(), DocTokenizer::setStatePara(), DocTokenizer::setStateXRefItem(), DocNode::thisVariant(), DocParserContext::token, and DocParser::tokenizer.

Referenced by handleCommand().

◆ injectToken()

bool DocPara::injectToken ( Token tok,
const QCString & tokText )

Definition at line 3891 of file docnode.cpp.

3892{
3893 AUTO_TRACE();
3894 parser()->context.token->name = tokText;
3895 return parser()->defaultHandleToken(thisVariant(),tok,children());
3896}
bool defaultHandleToken(DocNodeVariant *parent, Token tok, DocNodeList &children, bool handleWord=TRUE)

References AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocParser::defaultHandleToken(), TokenInfo::name, DocNode::parser(), DocNode::thisVariant(), and DocParserContext::token.

Referenced by DocSimpleSect::appendLinkWord().

◆ isEmpty()

bool DocPara::isEmpty ( ) const
inline

Definition at line 1078 of file docnode.h.

1078{ return children().empty(); }
bool empty() const
checks whether the container is empty
Definition growvector.h:140

References DocCompoundNode::children(), and GrowVector< T >::empty().

◆ isFirst()

bool DocPara::isFirst ( ) const
inline

Definition at line 1081 of file docnode.h.

1081{ return m_isFirst; }

References m_isFirst.

Referenced by handleIncludeOperator(), and DocParser::internalValidatingParseDoc().

◆ isLast()

bool DocPara::isLast ( ) const
inline

◆ markFirst()

◆ markLast()

◆ parse()

Token DocPara::parse ( )

Definition at line 5459 of file docnode.cpp.

5460{
5461 AUTO_TRACE();
5462 auto ns = AutoNodeStack(parser(),thisVariant());
5463 // handle style commands "inherited" from the previous paragraph
5465 Token tok=parser()->tokenizer.lex();
5466 Token retval = Token::make_TK_NONE();
5467 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF)) // get the next token
5468 {
5469reparsetoken:
5470 AUTO_TRACE_ADD("token '{}' at {}",tok.to_string(),parser()->tokenizer.getLineNr());
5471 if (tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD,TokenRetval::TK_SYMBOL,TokenRetval::TK_URL,
5472 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS,TokenRetval::TK_HTMLTAG)
5473 )
5474 {
5475 AUTO_TRACE_ADD("name={}",parser()->context.token->name);
5476 }
5477 switch(tok.value())
5478 {
5479 case TokenRetval::TK_WORD:
5481 break;
5482 case TokenRetval::TK_LNKWORD:
5484 break;
5485 case TokenRetval::TK_URL:
5487 break;
5488 case TokenRetval::TK_WHITESPACE:
5489 {
5490 // prevent leading whitespace and collapse multiple whitespace areas
5491 if (insidePRE(thisVariant()) || // all whitespace is relevant
5492 (
5493 // remove leading whitespace
5494 !children().empty() &&
5495 // and whitespace after certain constructs
5496 !holds_one_of_alternatives<DocHtmlDescList, DocHtmlTable, DocHtmlList, DocSimpleSect,
5497 DocAutoList, DocSimpleList, DocHtmlHeader, DocHtmlBlockQuote,
5498 DocParamSect, DocHtmlDetails, DocXRefItem>(children().back())
5499 )
5500 )
5501 {
5502 children().append<DocWhiteSpace>(parser(),thisVariant(),parser()->context.token->chars);
5503 }
5504 }
5505 break;
5506 case TokenRetval::TK_LISTITEM:
5507 {
5508 AUTO_TRACE_ADD("found list item at {}",parser()->context.token->indent);
5509 const DocNodeVariant *n=parent();
5510 while (n && !std::holds_alternative<DocAutoList>(*n)) n=::parent(n);
5511 const DocAutoList *al = std::get_if<DocAutoList>(n);
5512 if (al) // we found an auto list up in the hierarchy
5513 {
5514 AUTO_TRACE_ADD("previous list item at {}",al->indent());
5515 if (al->indent()>=parser()->context.token->indent)
5516 // new item at the same or lower indent level
5517 {
5518 retval = Token::make_TK_LISTITEM();
5519 goto endparagraph;
5520 }
5521 }
5522
5523 // determine list depth
5524 int depth = 0;
5525 n=parent();
5526 while (n)
5527 {
5528 al = std::get_if<DocAutoList>(n);
5529 if (al && al->isEnumList()) depth++;
5530 n=::parent(n);
5531 }
5532
5533 // first item or sub list => create new list
5534 do
5535 {
5536 children().append<DocAutoList>(parser(),thisVariant(),
5538 parser()->context.token->isEnumList,depth,
5540 al = children().get_last<DocAutoList>();
5541 retval = children().get_last<DocAutoList>()->parse();
5542 } while (retval.is(TokenRetval::TK_LISTITEM) && // new list
5543 al->indent()==parser()->context.token->indent // at same indent level
5544 );
5545
5546 // check the return value
5547 if (retval.is(TokenRetval::RetVal_SimpleSec)) // auto list ended due to simple section command
5548 {
5549 // Reparse the token that ended the section at this level,
5550 // so a new simple section will be started at this level.
5551 // This is the same as unputting the last read token and continuing.
5553 if (parser()->context.token->name.startsWith("rcs:")) // RCS section
5554 {
5557 tok = Token::make_TK_RCSTAG();
5558 }
5559 else // other section
5560 {
5561 tok = Token::make_TK_COMMAND_BS();
5562 }
5563 AUTO_TRACE_ADD("reparsing command {}",parser()->context.token->name);
5564 goto reparsetoken;
5565 }
5566 else if (retval.is(TokenRetval::TK_ENDLIST))
5567 {
5568 if (al->indent()>parser()->context.token->indent) // end list
5569 {
5570 goto endparagraph;
5571 }
5572 else // continue with current paragraph
5573 {
5574 }
5575 }
5576 else // paragraph ended due to TokenRetval::TK_NEWPARA, TokenRetval::TK_LISTITEM, or EOF
5577 {
5578 goto endparagraph;
5579 }
5580 }
5581 break;
5582 case TokenRetval::TK_ENDLIST:
5583 AUTO_TRACE_ADD("Found end of list inside of paragraph at line {}",parser()->tokenizer.getLineNr());
5584 if (std::get_if<DocAutoListItem>(parent()))
5585 {
5586 const DocAutoList *al = std::get_if<DocAutoList>(::parent(parent()));
5587 if (al && al->indent()>=parser()->context.token->indent)
5588 {
5589 // end of list marker ends this paragraph
5590 retval = Token::make_TK_ENDLIST();
5591 goto endparagraph;
5592 }
5593 else
5594 {
5595 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"End of list marker found "
5596 "has invalid indent level");
5597 }
5598 }
5599 else
5600 {
5601 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"End of list marker found without any preceding "
5602 "list items");
5603 }
5604 break;
5605 case TokenRetval::TK_COMMAND_AT:
5606 // fall through
5607 case TokenRetval::TK_COMMAND_BS:
5608 {
5609 // see if we have to start a simple section
5610 CommandType cmd = Mappers::cmdMapper->map(parser()->context.token->name);
5611 const DocNodeVariant *n=parent();
5612 while (n && !std::holds_alternative<DocSimpleSect>(*n) &&
5613 !std::holds_alternative<DocParamSect>(*n))
5614 {
5615 n=::parent(n);
5616 }
5618 {
5619 if (n) // already in a simple section
5620 {
5621 // simple section cannot start in this paragraph, need
5622 // to unwind the stack and remember the command.
5624 retval = Token::make_RetVal_SimpleSec();
5625 goto endparagraph;
5626 }
5627 }
5628 // see if we are in a simple list
5629 n=parent();
5630 while (n && !std::holds_alternative<DocSimpleListItem>(*n)) n=::parent(n);
5631 if (n)
5632 {
5633 if (cmd==CommandType::CMD_LI)
5634 {
5635 retval = Token::make_RetVal_ListItem();
5636 goto endparagraph;
5637 }
5638 }
5639
5640 // handle the command
5641 retval=handleCommand(tok.command_to_char(),parser()->context.token->name);
5642 AUTO_TRACE_ADD("handleCommand returns {}",retval.to_string());
5643
5644 // check the return value
5645 if (retval.is(TokenRetval::RetVal_SimpleSec))
5646 {
5647 // Reparse the token that ended the section at this level,
5648 // so a new simple section will be started at this level.
5649 // This is the same as unputting the last read token and continuing.
5651 if (parser()->context.token->name.startsWith("rcs:")) // RCS section
5652 {
5655 tok = Token::make_TK_RCSTAG();
5656 }
5657 else // other section
5658 {
5659 tok = Token::make_TK_COMMAND_BS();
5660 }
5661 AUTO_TRACE_ADD("reparsing command {}",parser()->context.token->name);
5662 goto reparsetoken;
5663 }
5664 else if (retval.value()>TokenRetval::TK_NONE && retval.value()<TokenRetval::RetVal_OK)
5665 {
5666 // the command ended with a new command, reparse this token
5667 tok = retval;
5668 goto reparsetoken;
5669 }
5670 else if (retval.value()!=TokenRetval::RetVal_OK) // end of file, end of paragraph, start or end of section
5671 // or some auto list marker
5672 {
5673 goto endparagraph;
5674 }
5675 }
5676 break;
5677 case TokenRetval::TK_HTMLTAG:
5678 {
5679 if (!parser()->context.token->endTag) // found a start tag
5680 {
5681 retval = handleHtmlStartTag(parser()->context.token->name,parser()->context.token->attribs);
5682 }
5683 else // found an end tag
5684 {
5686 {
5687 break; // new code has been pushed back to the scanner, need to reparse
5688 }
5689 retval = handleHtmlEndTag(parser()->context.token->name);
5690 }
5691 if (!retval.is(TokenRetval::RetVal_OK))
5692 {
5693 goto endparagraph;
5694 }
5695 }
5696 break;
5697 case TokenRetval::TK_SYMBOL:
5698 {
5699 HtmlEntityMapper::SymType s = DocSymbol::decodeSymbol(parser()->context.token->name);
5701 {
5702 children().append<DocSymbol>(parser(),thisVariant(),s);
5703 }
5704 else
5705 {
5707 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported symbol '%s' found",
5708 qPrint(parser()->context.token->name));
5709 }
5710 break;
5711 }
5712 case TokenRetval::TK_NEWPARA:
5713 retval = Token::make_TK_NEWPARA();
5714 goto endparagraph;
5715 case TokenRetval::TK_RCSTAG:
5716 {
5717 const DocNodeVariant *n=parent();
5718 while (n && !std::holds_alternative<DocSimpleSect>(*n) &&
5719 !std::holds_alternative<DocParamSect>(*n))
5720 {
5721 n=::parent(n);
5722 }
5723 if (n) // already in a simple section
5724 {
5725 // simple section cannot start in this paragraph, need
5726 // to unwind the stack and remember the command.
5729 retval = Token::make_RetVal_SimpleSec();
5730 goto endparagraph;
5731 }
5732
5733 // see if we are in a simple list
5734 children().append<DocSimpleSect>(parser(),thisVariant(),DocSimpleSect::Rcs);
5735 children().get_last<DocSimpleSect>()->parseRcs();
5736 }
5737 break;
5738 default:
5739 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),
5740 "Found unexpected token (id=%s)",tok.to_string());
5741 break;
5742 }
5743 tok=parser()->tokenizer.lex();
5744 }
5745 retval=Token::make_TK_NONE();
5746endparagraph:
5748 DocPara *par = std::get_if<DocPara>(parser()->context.nodeStack.top());
5749 if (!parser()->context.token->endTag && par &&
5750 retval.is(TokenRetval::TK_NEWPARA) && parser()->context.token->name.lower() == "p")
5751 {
5752 par->setAttribs(parser()->context.token->attribs);
5753 }
5754 INTERNAL_ASSERT(retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF,TokenRetval::TK_NEWPARA,TokenRetval::TK_LISTITEM,
5755 TokenRetval::TK_ENDLIST,TokenRetval::RetVal_OK)
5756 );
5757
5758 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5759 return retval;
5760}
bool isEnumList() const
Definition docnode.h:575
int indent() const
Definition docnode.h:576
DocPara(DocParser *parser, DocNodeVariant *parent)
Definition docnode.cpp:3227
Token handleCommand(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3971
Token handleHtmlStartTag(const QCString &tagName, const HtmlAttribList &tagHtmlAttribs)
Definition docnode.cpp:4721
void setAttribs(const HtmlAttribList &attribs)
Definition docnode.h:1109
Token handleHtmlEndTag(const QCString &tagName)
Definition docnode.cpp:5189
void handleInitialStyleCommands(DocNodeVariant *parent, DocNodeList &children)
void handlePendingStyleCommands(DocNodeVariant *parent, DocNodeList &children)
static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName)
Definition docnode.cpp:152
TokenRetval value() const
char command_to_char() const
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:47
static bool checkIfHtmlEndTagEndsAutoList(DocParser *parser, const DocNodeVariant *n)
Definition docnode.cpp:5407
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1360
bool insidePRE(const DocNodeVariant *n)
bool isEnumList
QCString text
QCString chars
bool isCheckedList
QCString simpleSectText
bool isEMailAddr
QCString simpleSectName

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, TokenInfo::chars, checkIfHtmlEndTagEndsAutoList(), DocCompoundNode::children(), CMD_LI, Mappers::cmdMapper, Token::command_to_char(), DocParser::context, DocSymbol::decodeSymbol(), DocPara(), DocNodeList::get_last(), handleCommand(), handleHtmlEndTag(), handleHtmlStartTag(), DocParser::handleInitialStyleCommands(), DocParser::handleLinkedWord(), DocParser::handlePendingStyleCommands(), holds_one_of_alternatives(), DocAutoList::indent(), TokenInfo::indent, insidePRE(), INTERNAL_ASSERT, Token::is(), Token::is_any_of(), TokenInfo::isCheckedList, TokenInfo::isEMailAddr, DocAutoList::isEnumList(), TokenInfo::isEnumList, DocTokenizer::lex(), QCString::mid(), TokenInfo::name, DocNode::parent(), parse(), DocNode::parser(), qPrint(), DocSimpleSect::Rcs, setAttribs(), SIMPLESECT_BIT, TokenInfo::simpleSectName, TokenInfo::simpleSectText, HtmlEntityMapper::Sym_Unknown, TokenInfo::text, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, Token::value(), and warn_doc_error.

Referenced by handleCommand(), handleHtmlHeader(), handleHtmlStartTag(), handleInclude(), handleRef(), handleVhdlFlow(), DocHtmlBlockQuote::parse(), DocHtmlCell::parse(), DocHtmlDescData::parse(), DocHtmlDetails::parse(), DocHtmlListItem::parse(), parse(), DocParamList::parse(), DocParBlock::parse(), DocSimpleListItem::parse(), DocHtmlCell::parseXml(), and DocHtmlListItem::parseXml().

◆ setAttribs()

void DocPara::setAttribs ( const HtmlAttribList & attribs)
inline

Definition at line 1109 of file docnode.h.

1109{ m_attribs = attribs; }
const HtmlAttribList & attribs() const
Definition docnode.h:1108

References attribs(), and m_attribs.

Referenced by parse().

Member Data Documentation

◆ m_attribs

HtmlAttribList DocPara::m_attribs
private

Definition at line 1114 of file docnode.h.

Referenced by attribs(), and setAttribs().

◆ m_isFirst

bool DocPara::m_isFirst = false
private

Definition at line 1112 of file docnode.h.

Referenced by DocPara(), isFirst(), and markFirst().

◆ m_isLast

bool DocPara::m_isLast = false
private

Definition at line 1113 of file docnode.h.

Referenced by DocPara(), isLast(), and markLast().


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