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 1059 of file docnode.h.

Constructor & Destructor Documentation

◆ DocPara()

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

Definition at line 3225 of file docnode.cpp.

3225 :
3228{
3229}
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:1098
bool m_isLast
Definition docnode.h:1099
#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 1094 of file docnode.h.

1094{ return m_attribs; }
HtmlAttribList m_attribs
Definition docnode.h:1100

References m_attribs.

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

◆ handleCite()

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

Definition at line 3284 of file docnode.cpp.

3285{
3286 AUTO_TRACE();
3287 // get the argument of the cite command.
3288 Token tok=parser()->tokenizer.lex();
3289 if (!tok.is(TokenRetval::TK_WHITESPACE))
3290 {
3291 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3292 cmdChar,qPrint(cmdName));
3293 return;
3294 }
3296 tok=parser()->tokenizer.lex();
3297 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3298 {
3299 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3300 "argument of command '%c%s'",cmdChar,qPrint(cmdName));
3301 return;
3302 }
3303 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
3304 {
3305 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3306 tok.to_string(),cmdChar,qPrint(cmdName));
3307 return;
3308 }
3310 children().append<DocCite>(
3312
3314}
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:661
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1379
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 3969 of file docnode.cpp.

3970{
3971 AUTO_TRACE("cmdName={}",cmdName);
3972 Token retval = Token::make_RetVal_OK();
3973 CommandType cmdId = Mappers::cmdMapper->map(cmdName);
3974 switch (cmdId)
3975 {
3977 {
3978 std::string str{cmdChar};
3979 children().append<DocWord>(parser(),thisVariant(),str.c_str() + cmdName);
3980 if (isAliasCmd(cmdName.view()))
3981 {
3982 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));
3983 }
3984 else
3985 {
3986 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Found unknown command '%c%s'",cmdChar,qPrint(cmdName));
3987 }
3988 }
3989 break;
3991 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE);
3992 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
3993 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,cmdName,FALSE);
3994 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
3995 break;
3997 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Bold,cmdName,TRUE);
3998 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
3999 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Bold,cmdName,FALSE);
4000 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4001 break;
4003 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,cmdName,TRUE);
4004 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
4005 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,cmdName,FALSE);
4006 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4007 break;
4010 break;
4013 break;
4016 break;
4019 break;
4022 break;
4025 break;
4028 break;
4031 break;
4034 break;
4037 break;
4041 break;
4046 break;
4049 break;
4052 break;
4055 break;
4058 break;
4061 break;
4066 break;
4070 break;
4073 break;
4076 break;
4079 break;
4082 break;
4085 break;
4088 break;
4091 break;
4094 break;
4097 break;
4100 break;
4103 break;
4106 break;
4109 break;
4112 break;
4115 break;
4117 {
4118 children().append<DocSimpleList>(parser(),thisVariant());
4119 retval = children().get_last<DocSimpleList>()->parse();
4120 }
4121 break;
4123 {
4124 handleSection(cmdChar,cmdName);
4125 retval = Token::make_RetVal_Section();
4126 }
4127 break;
4129 {
4130 handleSection(cmdChar,cmdName);
4131 retval = Token::make_RetVal_Subsection();
4132 }
4133 break;
4135 {
4136 handleSection(cmdChar,cmdName);
4137 retval = Token::make_RetVal_Subsubsection();
4138 }
4139 break;
4141 {
4142 handleSection(cmdChar,cmdName);
4143 retval = Token::make_RetVal_Paragraph();
4144 }
4145 break;
4147 {
4148 handleSection(cmdChar,cmdName);
4149 retval = Token::make_RetVal_SubParagraph();
4150 }
4151 break;
4153 {
4154 handleSection(cmdChar,cmdName);
4155 retval = Token::make_RetVal_SubSubParagraph();
4156 }
4157 break;
4159 {
4161 retval = handleStartCode();
4162 }
4163 break;
4165 {
4167 retval = handleStartCode();
4168 }
4169 break;
4171 {
4173 retval = parser()->tokenizer.lex();
4175 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4176 {
4177 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"htmlonly section ended without end marker");
4178 }
4180 }
4181 break;
4183 {
4185 retval = parser()->tokenizer.lex();
4187 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4188 {
4189 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"manonly section ended without end marker");
4190 }
4192 }
4193 break;
4195 {
4197 retval = parser()->tokenizer.lex();
4199 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4200 {
4201 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"rtfonly section ended without end marker");
4202 }
4204 }
4205 break;
4207 {
4209 retval = parser()->tokenizer.lex();
4211 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4212 {
4213 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"latexonly section ended without end marker");
4214 }
4216 }
4217 break;
4219 {
4221 retval = parser()->tokenizer.lex();
4223 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4224 {
4225 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"xmlonly section ended without end marker");
4226 }
4228 }
4229 break;
4231 {
4233 retval = parser()->tokenizer.lex();
4235 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4236 {
4237 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"docbookonly section ended without end marker");
4238 }
4240 }
4241 break;
4243 {
4246 parser()->tokenizer.lex();
4247
4248 QCString fullMatch = parser()->context.token->verb;
4249 int idx = fullMatch.find('{');
4250 int idxEnd = fullMatch.find("}",idx+1);
4251 StringVector optList;
4252 if (idx != -1) // options present
4253 {
4254 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
4255 optList = split(optStr.str(),",");
4256 for (const auto &opt : optList)
4257 {
4258 if (opt.empty()) continue;
4259 QCString locOpt(opt);
4260 locOpt = locOpt.stripWhiteSpace().lower();
4261 if (locOpt == "code")
4262 {
4264 }
4265 else if (!locOpt.isEmpty())
4266 {
4267 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown option '%s' for '\\iliteral'",qPrint(opt));
4268 }
4269 }
4270 }
4271
4273 retval = parser()->tokenizer.lex();
4275 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4276 {
4277 if (t == DocVerbatim::JavaDocCode)
4278 {
4279 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"javadoc code section ended without end marker");
4280 }
4281 else
4282 {
4283 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"javadoc literal section ended without end marker");
4284 }
4285 }
4287 }
4288 break;
4291 {
4292 if (cmdId == CommandType::CMD_VERBATIM)
4293 {
4295 }
4296 else
4297 {
4299 }
4300 retval = parser()->tokenizer.lex();
4302 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4303 {
4304 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"verbatim section ended without end marker");
4305 }
4307 }
4308 break;
4310 {
4311 children().append<DocVerbatim>(parser(),thisVariant(),
4317 DocVerbatim *dv = children().get_last<DocVerbatim>();
4319 QCString width,height;
4320 parser()->defaultHandleTitleAndSize(CommandType::CMD_DOT,&children().back(),dv->children(),width,height);
4322 retval = parser()->tokenizer.lex();
4323 dv->setText(parser()->context.token->verb);
4324 dv->setWidth(width);
4325 dv->setHeight(height);
4326 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4327 if (!Config_getBool(HAVE_DOT))
4328 {
4329 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"ignoring \\dot command because HAVE_DOT is not set");
4330 children().pop_back();
4331 }
4332 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4333 {
4334 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"dot section ended without end marker");
4335 }
4337 }
4338 break;
4340 {
4341 children().append<DocVerbatim>(parser(),thisVariant(),
4347 DocVerbatim *dv = children().get_last<DocVerbatim>();
4349 QCString width,height;
4350 parser()->defaultHandleTitleAndSize(CommandType::CMD_MSC,&children().back(),dv->children(),width,height);
4352 retval = parser()->tokenizer.lex();
4353 dv->setText(parser()->context.token->verb);
4354 dv->setWidth(width);
4355 dv->setHeight(height);
4356 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4357 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4358 {
4359 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"msc section ended without end marker");
4360 }
4362 }
4363 break;
4365 {
4366 QCString jarPath = Config_getString(PLANTUML_JAR_PATH);
4368 parser()->tokenizer.lex();
4369 QCString fullMatch = parser()->context.token->sectionId;
4370 QCString sectionId = "";
4371 int idx = fullMatch.find('{');
4372 int idxEnd = fullMatch.find("}",idx+1);
4373 StringVector optList;
4374 QCString engine;
4375 if (idx != -1) // options present
4376 {
4377 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
4378 optList = split(optStr.str(),",");
4379 for (const auto &opt : optList)
4380 {
4381 if (opt.empty()) continue;
4382 bool found = false;
4383 QCString locOpt(opt);
4384 locOpt = locOpt.stripWhiteSpace().lower();
4385 if (g_plantumlEngine.find(locOpt.str())!=g_plantumlEngine.end())
4386 {
4387 if (!engine.isEmpty())
4388 {
4389 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Multiple definition of engine for '\\startuml'");
4390 }
4391 engine = locOpt;
4392 found = true;
4393 }
4394 if (!found)
4395 {
4396 if (sectionId.isEmpty())
4397 {
4398 sectionId = opt;
4399 }
4400 else
4401 {
4402 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Multiple use of filename for '\\startuml'");
4403 }
4404 }
4405 }
4406 }
4407 else
4408 {
4409 sectionId = parser()->context.token->sectionId;
4410 }
4411 if (engine.isEmpty()) engine = "uml";
4412
4413 if (sectionId.isEmpty())
4414 {
4416 retval = parser()->tokenizer.lex();
4417 assert(retval.is(TokenRetval::RetVal_OK));
4418
4419 sectionId = parser()->context.token->sectionId;
4420 sectionId = sectionId.stripWhiteSpace();
4421 }
4422
4423 QCString plantFile(sectionId);
4424 children().append<DocVerbatim>(parser(),thisVariant(),
4428 FALSE,plantFile);
4429 DocVerbatim *dv = children().get_last<DocVerbatim>();
4430 dv->setEngine(engine);
4432 QCString width,height;
4433 parser()->defaultHandleTitleAndSize(CommandType::CMD_STARTUML,&children().back(),dv->children(),width,height);
4435 retval = parser()->tokenizer.lex();
4436 int line = 0;
4437 QCString trimmedVerb = stripLeadingAndTrailingEmptyLines(parser()->context.token->verb,line);
4438 if (engine == "ditaa")
4439 {
4440 dv->setUseBitmap(true);
4441 }
4442 else if (engine == "uml")
4443 {
4444 int i = trimmedVerb.find('\n');
4445 QCString firstLine = i==-1 ? trimmedVerb : trimmedVerb.left(i);
4446 if (firstLine.stripWhiteSpace() == "ditaa") dv->setUseBitmap(true);
4447 }
4448 dv->setText(trimmedVerb);
4449 dv->setWidth(width);
4450 dv->setHeight(height);
4451 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4452 if (jarPath.isEmpty())
4453 {
4454 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"ignoring \\startuml command because PLANTUML_JAR_PATH is not set");
4455 children().pop_back();
4456 }
4457 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4458 {
4459 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"startuml section ended without end marker");
4460 }
4462 }
4463 break;
4465 retval = Token::make_RetVal_EndParBlock();
4466 break;
4482 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command %s",qPrint(parser()->context.token->name));
4483 break;
4485 retval = handleParamSection(cmdName,DocParamSect::Param,FALSE,parser()->context.token->paramDir);
4486 break;
4488 retval = handleParamSection(cmdName,DocParamSect::TemplateParam,FALSE,parser()->context.token->paramDir);
4489 break;
4491 retval = handleParamSection(cmdName,DocParamSect::RetVal);
4492 break;
4495 break;
4497 retval = handleXRefItem();
4498 break;
4500 {
4501 children().append<DocLineBreak>(parser(),thisVariant());
4502 }
4503 break;
4506 {
4508 }
4509 break;
4511 {
4513 }
4514 break;
4516 {
4517 children().append<DocIndexEntry>(parser(),thisVariant(),
4520 retval = children().get_last<DocIndexEntry>()->parse();
4521 }
4522 break;
4524 retval = Token::make_RetVal_Internal();
4525 break;
4527 retval = Token::make_RetVal_EndInternal();
4528 break;
4530 {
4531 children().append<DocParBlock>(parser(),thisVariant());
4532 retval = children().get_last<DocParBlock>()->parse();
4533 }
4534 break;
4535 case CommandType::CMD_COPYDOC: // fall through
4536 case CommandType::CMD_COPYBRIEF: // fall through
4538 //retval = Token::make_RetVal_CopyDoc();
4539 // these commands should already be resolved by processCopyDoc()
4540 break;
4543 break;
4546 break;
4549 break;
4552 break;
4555 break;
4558 break;
4561 break;
4564 break;
4567 break;
4570 break;
4573 break;
4576 break;
4579 break;
4582 break;
4585 break;
4588 break;
4591 break;
4593 if (!Config_getBool(HAVE_DOT))
4594 {
4595 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),
4596 "ignoring \\dotfile command because HAVE_DOT is not set");
4597 }
4598 else
4599 {
4600 handleFile<DocDotFile>(cmdName);
4601 }
4602 break;
4605 break;
4607 handleFile<DocMscFile>(cmdName);
4608 break;
4610 handleFile<DocDiaFile>(cmdName);
4611 break;
4614 break;
4616 handleLink(cmdName,FALSE);
4617 break;
4619 handleLink(cmdName,TRUE);
4620 break;
4622 handleCite(cmdChar,cmdName);
4623 break;
4625 handleEmoji(cmdChar,cmdName);
4626 break;
4628 handleDoxyConfig(cmdChar,cmdName);
4629 break;
4630 case CommandType::CMD_REF: // fall through
4632 handleRef(cmdChar,cmdName);
4633 break;
4635 {
4636 children().append<DocSecRefList>(parser(),thisVariant());
4637 children().get_last<DocSecRefList>()->parse();
4638 }
4639 break;
4641 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command '%c%s'",cmdChar,qPrint(parser()->context.token->name));
4642 break;
4644 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command '%c%s'",cmdChar,qPrint(parser()->context.token->name));
4645 break;
4647 {
4648 children().append<DocFormula>(parser(),thisVariant(),parser()->context.token->id);
4649 }
4650 break;
4651 //case CommandType::CMD_LANGSWITCH:
4652 // retval = handleLanguageSwitch();
4653 // break;
4655 //warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command %s",qPrint(parser()->context.token->name));
4656 {
4659 }
4660 break;
4663 break;
4665 handleShowDate(cmdChar,cmdName);
4666 break;
4668 handleILine(cmdChar,cmdName);
4669 break;
4671 handleIFile(cmdChar,cmdName);
4672 break;
4674 {
4676 (void)parser()->tokenizer.lex();
4678 //printf("Found scope='%s'\n",qPrint(parser()->context.context));
4680 }
4681 break;
4682 default:
4683 // we should not get here!
4684 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected command '%s' in paragraph context",qPrint(cmdName));
4685 break;
4686 }
4687 INTERNAL_ASSERT(retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF,TokenRetval::RetVal_OK,TokenRetval::RetVal_SimpleSec
4688 TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST,TokenRetval::TK_NEWPARA
4689 TokenRetval::RetVal_Section,TokenRetval::RetVal_EndList
4690 TokenRetval::RetVal_Internal,TokenRetval::RetVal_SwitchLang
4691 TokenRetval::RetVal_EndInternal)
4692 );
4693 AUTO_TRACE_EXIT("retval={}",retval.to_string());
4694 return retval;
4695}
bool isAliasCmd(std::string_view aliasCmd)
Definition aliases.cpp:528
@ LatexInclude
Definition docnode.h:418
@ SnippetWithLines
Definition docnode.h:419
@ IncWithLines
Definition docnode.h:419
@ HtmlInclude
Definition docnode.h:418
@ VerbInclude
Definition docnode.h:418
@ DontInclude
Definition docnode.h:418
@ DocbookInclude
Definition docnode.h:420
Token handleSimpleSection(DocSimpleSect::Type t, bool xmlContext=FALSE)
Definition docnode.cpp:3231
void handleLink(const QCString &cmdName, bool isJavaLink)
Definition docnode.cpp:3674
void handleInheritDoc()
Definition docnode.cpp:3932
void handleCite(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3284
void handleInclude(const QCString &cmdName, DocInclude::Type t)
Definition docnode.cpp:3742
void handleDoxyConfig(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3347
void handleSection(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3847
void handleFile(const QCString &cmdName)
Definition docnode.cpp:3635
void handleIFile(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3551
Token handleParamSection(const QCString &cmdName, DocParamSect::Type t, bool xmlContext, int direction)
Definition docnode.cpp:3261
void handleEmoji(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3316
void handleIncludeOperator(const QCString &cmdName, DocIncOperator::Type t)
Definition docnode.cpp:3575
void handleRef(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3715
void handleILine(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3537
Token parse()
Definition docnode.cpp:5451
void handleVhdlFlow()
Definition docnode.cpp:3667
void handleShowDate(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3466
Token handleXRefItem()
Definition docnode.cpp:3445
Token handleStartCode()
Definition docnode.cpp:3896
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:359
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:526
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:1390
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:6945
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_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_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, 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_Greater, HtmlEntityMapper::Sym_Hash, HtmlEntityMapper::Sym_Less, HtmlEntityMapper::Sym_Minus, HtmlEntityMapper::Sym_Percent, HtmlEntityMapper::Sym_Pipe, HtmlEntityMapper::Sym_Plus, 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 3347 of file docnode.cpp.

3348{
3349 // get the argument of the cite command.
3350 Token tok=parser()->tokenizer.lex();
3351 if (!tok.is(TokenRetval::TK_WHITESPACE))
3352 {
3353 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3354 cmdChar,qPrint(cmdName));
3355 return;
3356 }
3358 tok=parser()->tokenizer.lex();
3359 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3360 {
3361 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3362 "argument of command '%c%s'",cmdChar,qPrint(cmdName));
3363 return;
3364 }
3365 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
3366 {
3367 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3368 tok.to_string(),cmdChar,qPrint(cmdName));
3369 return;
3370 }
3371 ConfigOption * opt = ConfigImpl::instance()->get(parser()->context.token->name);
3372 if (opt)
3373 {
3374 QCString optionValue;
3375 switch (opt->kind())
3376 {
3378 optionValue = *(static_cast<ConfigBool*>(opt)->valueStringRef());
3379 break;
3381 optionValue = *(static_cast<ConfigString*>(opt)->valueRef());
3382 break;
3384 optionValue = *(static_cast<ConfigEnum*>(opt)->valueRef());
3385 break;
3387 optionValue = *(static_cast<ConfigInt*>(opt)->valueStringRef());
3388 break;
3390 {
3391 StringVector *lst = static_cast<ConfigList*>(opt)->valueRef();
3392 optionValue="";
3393 if (!lst->empty())
3394 {
3395 std::string lstFormat = theTranslator->trWriteList(static_cast<int>(lst->size())).str();
3396 static const reg::Ex marker(R"(@(\d+))");
3397 reg::Iterator it(lstFormat,marker);
3398 reg::Iterator end;
3399 size_t index=0;
3400 // now replace all markers with the real text
3401 for ( ; it!=end ; ++it)
3402 {
3403 const auto &match = *it;
3404 size_t newIndex = match.position();
3405 size_t matchLen = match.length();
3406 optionValue += lstFormat.substr(index,newIndex-index);
3407 unsigned long entryIndex = std::stoul(match[1].str());
3408 if (entryIndex<(unsigned long)lst->size())
3409 {
3410 optionValue += lst->at(entryIndex);
3411 }
3412 index=newIndex+matchLen;
3413 }
3414 optionValue+=lstFormat.substr(index);
3415 }
3416 }
3417 break;
3419 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Obsolete setting for '%c%s': '%s'",
3420 cmdChar,qPrint(cmdName),qPrint(parser()->context.token->name));
3421 break;
3423 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(),
3424 "Disabled setting (i.e. not supported in this doxygen executable) for '%c%s': '%s'",
3425 cmdChar,qPrint(cmdName),qPrint(parser()->context.token->name));
3426 break;
3428 // nothing to show here
3429 break;
3430 }
3431 if (!optionValue.isEmpty())
3432 {
3433 children().append<DocWord>(parser(),thisVariant(),optionValue);
3434 }
3435 }
3436 else
3437 {
3438 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown option for '%c%s': '%s'",
3439 cmdChar,qPrint(cmdName),qPrint(parser()->context.token->name));
3441 }
3443}
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:567
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(), QCString::str(), theTranslator, DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, Translator::trWriteList(), warn, and warn_doc_error.

Referenced by handleCommand().

◆ handleEmoji()

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

Definition at line 3316 of file docnode.cpp.

3317{
3318 AUTO_TRACE();
3319 // get the argument of the emoji command.
3320 Token tok=parser()->tokenizer.lex();
3321 if (!tok.is(TokenRetval::TK_WHITESPACE))
3322 {
3323 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3324 cmdChar,qPrint(cmdName));
3325 return;
3326 }
3328 tok=parser()->tokenizer.lex();
3329 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3330 {
3331 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"no emoji name given or unexpected end of comment block while parsing the "
3332 "argument of command '%c%s'",cmdChar,qPrint(cmdName));
3334 return;
3335 }
3336 else if (!tok.is(TokenRetval::TK_WORD))
3337 {
3338 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of '%c%s'",
3339 tok.to_string(),cmdChar,qPrint(cmdName));
3341 return;
3342 }
3345}
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 3635 of file docnode.cpp.

3636{
3637 AUTO_TRACE("cmdName={}",cmdName);
3638 QCString saveCmdName = cmdName;
3639 Token tok=parser()->tokenizer.lex();
3640 if (!tok.is(TokenRetval::TK_WHITESPACE))
3641 {
3642 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\%s command",
3643 qPrint(saveCmdName));
3644 return;
3645 }
3647 tok=parser()->tokenizer.lex();
3649 if (!tok.is(TokenRetval::TK_WORD))
3650 {
3651 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token %s as the argument of %s",
3652 tok.to_string(),qPrint(saveCmdName));
3653 return;
3654 }
3655 QCString name = parser()->context.token->name;
3656 children().append<T>(parser(),thisVariant(),name,
3660 auto df = children().get_last<T>();
3661 if (!df->parse())
3662 {
3663 children().pop_back();
3664 }
3665}
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 5181 of file docnode.cpp.

5182{
5183 AUTO_TRACE("tagName={}",tagName);
5184 HtmlTagType tagId = Mappers::htmlTagMapper->map(tagName);
5185 Token retval = Token::make_RetVal_OK();
5186 switch (tagId)
5187 {
5189 if (!insideUL(thisVariant()))
5190 {
5191 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </ul> tag without matching <ul>");
5192 }
5193 else
5194 {
5195 retval = Token::make_RetVal_EndList();
5196 }
5197 break;
5199 if (!insideOL(thisVariant()))
5200 {
5201 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </ol> tag without matching <ol>");
5202 }
5203 else
5204 {
5205 retval = Token::make_RetVal_EndList();
5206 }
5207 break;
5209 if (!insideLI(thisVariant()))
5210 {
5211 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </li> tag without matching <li>");
5212 }
5213 else
5214 {
5215 // ignore </li> tags
5216 }
5217 break;
5219 if (!insideDetails(thisVariant()))
5220 {
5221 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </details> tag without matching <details>");
5222 }
5223 else
5224 {
5225 retval = Token::make_RetVal_EndHtmlDetails();
5226 }
5227 break;
5230 {
5231 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </blockquote> tag without matching <blockquote>");
5232 }
5233 else
5234 {
5235 retval = Token::make_RetVal_EndBlockQuote();
5236 }
5237 break;
5240 break;
5243 break;
5246 break;
5249 break;
5252 break;
5255 break;
5258 break;
5261 break;
5264 break;
5267 break;
5270 break;
5273 break;
5276 break;
5279 break;
5282 break;
5285 break;
5290 break;
5292 retval = Token::make_TK_NEWPARA();
5293 break;
5295 retval = Token::make_RetVal_EndDesc();
5296 break;
5298 // ignore </dt> tag
5299 break;
5301 // ignore </dd> tag
5302 break;
5304 retval = Token::make_RetVal_EndTable();
5305 break;
5307 // ignore </tr> tag
5308 break;
5310 // ignore </td> tag
5311 break;
5313 // ignore </th> tag
5314 break;
5318 // for time being ignore </t....> tag
5319 break;
5321 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </caption> found");
5322 break;
5324 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal </br> tag found");
5325 break;
5327 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h1> found");
5328 break;
5330 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h2> found");
5331 break;
5333 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h3> found");
5334 break;
5336 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h4> found");
5337 break;
5339 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h5> found");
5340 break;
5342 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h6> found");
5343 break;
5345 break;
5347 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal </hr> tag found");
5348 break;
5350 //warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </a> found");
5351 // ignore </a> tag (can be part of <a name=...></a>
5352 break;
5353
5355 break;
5357 retval = Token::make_TK_NEWPARA();
5358 break;
5371 retval = Token::make_RetVal_CloseXml();
5372 break;
5373 case HtmlTagType::XML_C:
5375 break;
5383 // These tags are defined in .Net but are currently unsupported
5384 break;
5386 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported xml/html tag </%s> found", qPrint(tagName));
5387 children().append<DocWord>(parser(),thisVariant(),"</"+tagName+">");
5388 break;
5389 default:
5390 // we should not get here!
5391 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected end tag %s",qPrint(tagName));
5392 ASSERT(0);
5393 break;
5394 }
5395 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5396 return retval;
5397}
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:167
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 3878 of file docnode.cpp.

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

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 4713 of file docnode.cpp.

4714{
4715 AUTO_TRACE("tagName={} #tagHtmlAttrs={}",tagName,tagHtmlAttribs.size());
4716 Token retval = Token::make_RetVal_OK();
4717 HtmlTagType tagId = Mappers::htmlTagMapper->map(tagName);
4718 if (parser()->context.token->emptyTag && !(tagId>HtmlTagType::XML_CmdMask) &&
4721 {
4722 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"HTML tag ('<%s/>') may not use the 'empty tag' XHTML syntax.",
4723 qPrint(tagName));
4724 }
4725 switch (tagId)
4726 {
4728 if (!parser()->context.token->emptyTag)
4729 {
4730 children().append<DocHtmlList>(parser(),thisVariant(),
4731 tagHtmlAttribs,DocHtmlList::Unordered);
4732 retval=children().get_last<DocHtmlList>()->parse();
4733 }
4734 break;
4736 if (!parser()->context.token->emptyTag)
4737 {
4738 children().append<DocHtmlList>(parser(),thisVariant(),
4739 tagHtmlAttribs,DocHtmlList::Ordered);
4740 retval=children().get_last<DocHtmlList>()->parse();
4741 }
4742 break;
4744 if (parser()->context.token->emptyTag) break;
4746 {
4747 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"lonely <li> tag found");
4748 }
4749 else
4750 {
4751 retval = Token::make_RetVal_ListItem();
4752 }
4753 break;
4755 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Bold,tagName,&parser()->context.token->attribs);
4756 break;
4758 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::S,tagName,&parser()->context.token->attribs);
4759 break;
4761 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Strike,tagName,&parser()->context.token->attribs);
4762 break;
4764 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Del,tagName,&parser()->context.token->attribs);
4765 break;
4767 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Underline,tagName,&parser()->context.token->attribs);
4768 break;
4770 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Ins,tagName,&parser()->context.token->attribs);
4771 break;
4773 if (parser()->context.token->emptyTag) break;
4774 if (parser()->context.xmlComment)
4775 // for C# source or inside a <summary> or <remark> section we
4776 // treat <code> as an XML tag (so similar to @code)
4777 {
4779 retval = handleStartCode();
4780 }
4781 else // normal HTML markup
4782 {
4783 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Code,tagName,&parser()->context.token->attribs);
4784 }
4785 break;
4787 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Kbd,tagName,&parser()->context.token->attribs);
4788 break;
4790 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Italic,tagName,&parser()->context.token->attribs);
4791 break;
4793 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Div,tagName,&parser()->context.token->attribs);
4794 if (parser()->context.token->emptyTag) parser()->handleStyleLeave(thisVariant(),children(),DocStyleChange::Div,tagName);
4795 break;
4797 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Span,tagName,&parser()->context.token->attribs);
4798 if (parser()->context.token->emptyTag) parser()->handleStyleLeave(thisVariant(),children(),DocStyleChange::Span,tagName);
4799 break;
4801 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Subscript,tagName,&parser()->context.token->attribs);
4802 break;
4804 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Superscript,tagName,&parser()->context.token->attribs);
4805 break;
4807 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Center,tagName,&parser()->context.token->attribs);
4808 break;
4810 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Small,tagName,&parser()->context.token->attribs);
4811 break;
4813 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Cite,tagName,&parser()->context.token->attribs);
4814 break;
4816 if (parser()->context.token->emptyTag) break;
4817 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Preformatted,tagName,&parser()->context.token->attribs);
4820 break;
4822 retval = Token::make_TK_NEWPARA();
4823 break;
4825 if (!parser()->context.token->emptyTag)
4826 {
4827 children().append<DocHtmlDescList>(parser(),thisVariant(),tagHtmlAttribs);
4828 retval=children().get_last<DocHtmlDescList>()->parse();
4829 }
4830 break;
4832 if (insideDL(thisVariant()))
4833 {
4834 retval = Token::make_RetVal_DescTitle();
4835 }
4836 else
4837 {
4838 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <dt> found");
4839 }
4840 break;
4842 if (insideDL(thisVariant()))
4843 {
4844 retval = Token::make_RetVal_DescData();
4845 }
4846 else
4847 {
4848 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <dd> found");
4849 }
4850 break;
4852 if (!parser()->context.token->emptyTag)
4853 {
4854 children().append<DocHtmlTable>(parser(),thisVariant(),tagHtmlAttribs);
4855 retval=children().get_last<DocHtmlTable>()->parse();
4856 }
4857 break;
4859 retval = Token::make_RetVal_TableRow();
4860 break;
4862 retval = Token::make_RetVal_TableCell();
4863 break;
4865 retval = Token::make_RetVal_TableHCell();
4866 break;
4870 // for time being ignore </t....> tag
4871 break;
4873 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <caption> found");
4874 break;
4876 {
4877 children().append<DocLineBreak>(parser(),thisVariant(),tagHtmlAttribs);
4878 }
4879 break;
4881 {
4882 children().append<DocHorRuler>(parser(),thisVariant(),tagHtmlAttribs);
4883 }
4884 break;
4886 retval = parser()->handleAHref(thisVariant(),children(),tagHtmlAttribs);
4887 break;
4889 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,1);
4890 break;
4892 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,2);
4893 break;
4895 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,3);
4896 break;
4898 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,4);
4899 break;
4901 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,5);
4902 break;
4904 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,6);
4905 break;
4907 {
4908 parser()->handleImg(thisVariant(),children(),tagHtmlAttribs);
4909 }
4910 break;
4912 if (!parser()->context.token->emptyTag)
4913 {
4914 children().append<DocHtmlDetails>(parser(),thisVariant(),tagHtmlAttribs);
4915 retval=children().get_last<DocHtmlDetails>()->parse();
4916 }
4917 break;
4919 if (!parser()->context.token->emptyTag)
4920 {
4921 children().append<DocHtmlBlockQuote>(parser(),thisVariant(),tagHtmlAttribs);
4922 retval = children().get_last<DocHtmlBlockQuote>()->parse();
4923 }
4924 break;
4925
4928 {
4929 if (!parser()->context.token->emptyTag)
4930 {
4932 while (n && !std::holds_alternative<DocHtmlDetails>(*n)) n=::parent(n);
4933 DocHtmlDetails *d = std::get_if<DocHtmlDetails>(n);
4934 if (d)
4935 {
4936 if (!d->summary()) // details section does not have a summary yet
4937 {
4938 d->parseSummary(n,parser()->context.token->attribs);
4939 }
4940 else
4941 {
4942 retval = Token::make_TK_NEWPARA();
4943 }
4944 }
4945 }
4946 }
4947 break;
4951 // fall through
4954 if (!children().empty())
4955 {
4956 retval = Token::make_TK_NEWPARA();
4957 }
4958 break;
4960 if (insideTable(thisVariant()))
4961 {
4962 retval = Token::make_RetVal_TableCell();
4963 }
4964 break;
4965 case HtmlTagType::XML_C:
4966 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Code,tagName,&parser()->context.token->attribs);
4967 break;
4970 {
4972 QCString paramName;
4973 if (findAttribute(tagHtmlAttribs,"name",&paramName))
4974 {
4975 if (paramName.isEmpty())
4976 {
4977 if (Config_getBool(WARN_NO_PARAMDOC))
4978 {
4979 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"empty 'name' attribute for <param%s> tag.",tagId==HtmlTagType::XML_PARAM?"":"type");
4980 }
4981 }
4982 else
4983 {
4984 retval = handleParamSection(paramName,
4986 TRUE);
4987 }
4988 }
4989 else
4990 {
4991 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'name' attribute from <param%s> tag.",tagId==HtmlTagType::XML_PARAM?"":"type");
4992 }
4993 }
4994 break;
4997 {
4998 QCString paramName;
4999 if (findAttribute(tagHtmlAttribs,"name",&paramName))
5000 {
5001 //printf("paramName=%s\n",qPrint(paramName));
5002 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,tagName,TRUE);
5003 children().append<DocWord>(parser(),thisVariant(),paramName);
5004 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,tagName,FALSE);
5005 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
5006 }
5007 else
5008 {
5009 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'name' attribute from <param%sref> tag.",tagId==HtmlTagType::XML_PARAMREF?"":"type");
5010 }
5011 }
5012 break;
5014 {
5016 QCString exceptName;
5017 if (findAttribute(tagHtmlAttribs,"cref",&exceptName))
5018 {
5019 unescapeCRef(exceptName);
5020 retval = handleParamSection(exceptName,DocParamSect::Exception,TRUE);
5021 }
5022 else
5023 {
5024 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' attribute from <exception> tag.");
5025 }
5026 }
5027 break;
5030 if (insideTable(thisVariant()))
5031 {
5032 retval = Token::make_RetVal_TableRow();
5033 }
5034 else if (insideUL(thisVariant()) || insideOL(thisVariant()))
5035 {
5036 retval = Token::make_RetVal_ListItem();
5037 }
5038 else
5039 {
5040 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"lonely <item> tag found");
5041 }
5042 break;
5047 break;
5049 if (insideTable(thisVariant()))
5050 {
5051 retval = Token::make_RetVal_TableCell();
5052 }
5053 break;
5055 // I'm not sure if <see> is the same as <seealso> or if it
5056 // should you link a member without producing a section. The
5057 // C# specification is extremely vague about this (but what else
5058 // can we expect from Microsoft...)
5059 {
5060 QCString cref;
5061 //printf("HtmlTagType::XML_SEE: empty tag=%d\n",parser()->context.token->emptyTag);
5062 if (findAttribute(tagHtmlAttribs,"cref",&cref))
5063 {
5064 unescapeCRef(cref);
5065 if (parser()->context.token->emptyTag) // <see cref="..."/> style
5066 {
5067 bool inSeeBlock = parser()->context.inSeeBlock;
5068 parser()->context.token->name = cref;
5071 parser()->context.inSeeBlock = inSeeBlock;
5072 }
5073 else // <see cref="...">...</see> style
5074 {
5075 //DocRef *ref = new DocRef(this,cref);
5076 //children().append(ref);
5077 //ref->parse();
5079 children().append<DocLink>(parser(),thisVariant(),cref);
5080 DocLink *lnk = children().get_last<DocLink>();
5081 QCString leftOver = lnk->parse(FALSE,TRUE);
5082 if (!leftOver.isEmpty())
5083 {
5084 children().append<DocWord>(parser(),thisVariant(),leftOver);
5085 }
5086 }
5087 }
5088 else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langword="..."></see>
5089 {
5090 bool inSeeBlock = parser()->context.inSeeBlock;
5091 parser()->context.token->name = cref;
5093 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,tagName,TRUE);
5095 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,tagName,FALSE);
5096 parser()->context.inSeeBlock = inSeeBlock;
5097 }
5098 else
5099 {
5100 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' or 'langword' attribute from <see> tag.");
5101 }
5102 }
5103 break;
5105 {
5107 QCString cref;
5108 if (findAttribute(tagHtmlAttribs,"cref",&cref))
5109 {
5110 unescapeCRef(cref);
5111 // Look for an existing "see" section
5112 DocNodeVariant *vss=nullptr;
5113 for (auto &n : children())
5114 {
5115 DocSimpleSect *candidate = std::get_if<DocSimpleSect>(&n);
5116 if (candidate && candidate->type()==DocSimpleSect::See)
5117 {
5118 vss = &n;
5119 }
5120 }
5121
5122 if (!vss) // start new section
5123 {
5124 children().append<DocSimpleSect>(parser(),thisVariant(),DocSimpleSect::See);
5125 vss = &children().back();
5126 }
5127
5128 std::get<DocSimpleSect>(*vss).appendLinkWord(cref);
5129 retval = Token::make_RetVal_OK();
5130 }
5131 else
5132 {
5133 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' attribute from <seealso> tag.");
5134 }
5135 }
5136 break;
5138 {
5139 QCString type;
5140 findAttribute(tagHtmlAttribs,"type",&type);
5142 HtmlAttribList emptyList;
5143 if (type=="number")
5144 {
5145 listType=DocHtmlList::Ordered;
5146 }
5147 if (type=="table")
5148 {
5149 children().append<DocHtmlTable>(parser(),thisVariant(),emptyList);
5150 retval=children().get_last<DocHtmlTable>()->parseXml();
5151 }
5152 else
5153 {
5154 children().append<DocHtmlList>(parser(),thisVariant(),emptyList,listType);
5155 retval=children().get_last<DocHtmlList>()->parseXml();
5156 }
5157 }
5158 break;
5161 // These tags are defined in .Net but are currently unsupported
5163 break;
5165 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported xml/html tag <%s> found", qPrint(tagName));
5166 children().append<DocWord>(parser(),thisVariant(), "<"+tagName+parser()->context.token->attribsStr+">");
5167 break;
5170 break;
5171 default:
5172 // we should not get here!
5173 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected start tag %s",qPrint(tagName));
5174 ASSERT(0);
5175 break;
5176 }
5177 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5178 return retval;
5179}
void parseSummary(DocNodeVariant *, HtmlAttribList &attribs)
Definition docnode.cpp:1440
const DocNodeVariant * summary() const
Definition docnode.h:844
Token handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs, int level)
Definition docnode.cpp:3878
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:1006
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:4697
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 3551 of file docnode.cpp.

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

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 3537 of file docnode.cpp.

3538{
3539 AUTO_TRACE();
3541 Token tok = parser()->tokenizer.lex();
3542 if (!tok.is(TokenRetval::TK_WORD))
3543 {
3544 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid argument for command '%c%s'",
3545 cmdChar,qPrint(cmdName));
3546 return;
3547 }
3549}
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 3742 of file docnode.cpp.

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

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

3933{
3934 if (parser()->context.memberDef) // inheriting docs from a member
3935 {
3936 const MemberDef *reMd = parser()->context.memberDef->reimplements();
3937 if (reMd) // member from which was inherited.
3938 {
3939 const MemberDef *thisMd = parser()->context.memberDef;
3940 //printf("{InheritDocs:%s=>%s}\n",qPrint(parser()->context.memberDef->qualifiedName()),qPrint(reMd->qualifiedName()));
3941 parser()->pushContext();
3942 parser()->context.scope=reMd->getOuterScope();
3943 if (parser()->context.scope!=Doxygen::globalScope)
3944 {
3946 }
3947 parser()->context.memberDef=reMd;
3948 while (!parser()->context.styleStack.empty()) parser()->context.styleStack.pop();
3949 while (!parser()->context.nodeStack.empty()) parser()->context.nodeStack.pop();
3950 parser()->context.copyStack.push_back(reMd);
3953 parser()->context.copyStack.pop_back();
3954 auto hasParamCommand = parser()->context.hasParamCommand;
3955 auto hasReturnCommand = parser()->context.hasReturnCommand;
3956 auto retvalsFound = parser()->context.retvalsFound;
3957 auto paramsFound = parser()->context.paramsFound;
3958 parser()->popContext();
3959 parser()->context.hasParamCommand = hasParamCommand;
3960 parser()->context.hasReturnCommand = hasReturnCommand;
3961 parser()->context.retvalsFound = retvalsFound;
3962 parser()->context.paramsFound = paramsFound;
3963 parser()->context.memberDef = thisMd;
3964 }
3965 }
3966}
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 3674 of file docnode.cpp.

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

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

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 3715 of file docnode.cpp.

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

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 3847 of file docnode.cpp.

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

3467{
3468 AUTO_TRACE();
3469 QCString fmt;
3470 QCString date;
3471 Token tok=parser()->tokenizer.lex();
3472 if (!tok.is(TokenRetval::TK_WHITESPACE))
3473 {
3474 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '%c%s' command",
3475 cmdChar,qPrint(cmdName));
3476 return;
3477 }
3479 tok = parser()->tokenizer.lex();
3480 if (!tok.is(TokenRetval::TK_WORD))
3481 {
3482 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <format> argument for command '%c%s'",
3483 cmdChar,qPrint(cmdName));
3485 return;
3486 }
3487 fmt = parser()->context.token->name;
3488
3490 tok = parser()->tokenizer.lex();
3491
3492 QCString specDateRaw = tok.is(TokenRetval::TK_WORD) ? parser()->context.token->name : QCString();
3493 QCString specDate = specDateRaw.stripWhiteSpace();
3494 bool specDateOnlyWS = !specDateRaw.isEmpty() && specDate.isEmpty();
3495 if (!specDate.isEmpty() && !tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3496 {
3497 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <date_time> argument for command '%c%s'",
3498 cmdChar,qPrint(cmdName));
3500 return;
3501 }
3502
3503 std::tm dat{};
3504 int specFormat=0;
3505 QCString err = dateTimeFromString(specDate,dat,specFormat);
3506 if (!err.isEmpty())
3507 {
3508 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <date_time> argument for command '%c%s': %s",
3509 cmdChar,qPrint(cmdName),qPrint(err));
3511 return;
3512 }
3513
3514 int usedFormat=0;
3515 QCString dateTimeStr = formatDateTime(fmt,dat,usedFormat);
3516
3517 // warn the user if the format contains markers that are not explicitly filled in
3518 for (int i=0;i<SF_NumBits;i++)
3519 {
3520 int bitMask = 1<<i;
3521 if ((usedFormat&bitMask) && !(specFormat&bitMask)) // a part was used in the format string but its value was not specified.
3522 {
3523 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.",
3524 cmdChar,qPrint(cmdName),
3525 qPrint(fmt),SF_bit2str(i),qPrint(specDate),SF_bit2str(i));
3526 }
3527 }
3528
3529 children().append<DocWord>(parser(),thisVariant(),dateTimeStr);
3530 if (specDateOnlyWS) // specDate is only whitespace
3531 {
3532 children().append<DocWhiteSpace>(parser(),thisVariant()," ");
3533 }
3535}
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 3231 of file docnode.cpp.

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

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 3896 of file docnode.cpp.

3897{
3898 AUTO_TRACE();
3899 Token retval = parser()->tokenizer.lex();
3900 QCString lang = parser()->context.token->name;
3901 if (!lang.isEmpty() && lang.at(0)!='.')
3902 {
3903 lang="."+lang;
3904 }
3905 if (parser()->context.xmlComment)
3906 {
3907 parser()->context.token->verb = substitute(substitute(parser()->context.token->verb,"&lt;","<"),"&gt;",">");
3908 }
3909 // search for the first non-whitespace line, index is stored in li
3910 size_t i=0,li=0,l=parser()->context.token->verb.length();
3911 while (i<l && (parser()->context.token->verb.at(i)==' ' || parser()->context.token->verb.at(i)=='\n'))
3912 {
3913 if (parser()->context.token->verb.at(i)=='\n') li=i+1;
3914 i++;
3915 }
3916 children().append<DocVerbatim>(parser(),thisVariant(),
3918 stripIndentation(parser()->context.token->verb.mid(li)),
3922 FALSE,lang);
3923 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3924 {
3925 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"code section ended without end marker");
3926 }
3928 AUTO_TRACE_EXIT("retval={}",retval.to_string());
3929 return retval;
3930}
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:6281

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 3667 of file docnode.cpp.

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

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 3445 of file docnode.cpp.

3446{
3447 AUTO_TRACE();
3448 Token retval=parser()->tokenizer.lex();
3449 ASSERT(retval.is(TokenRetval::TK_WHITESPACE));
3451 retval=parser()->tokenizer.lex();
3452 if (retval.is(TokenRetval::RetVal_OK))
3453 {
3454 children().append<DocXRefItem>(parser(),thisVariant(),
3456 DocXRefItem *ref = children().get_last<DocXRefItem>();
3457 if (!ref->parse())
3458 {
3459 children().pop_back();
3460 }
3461 }
3463 return retval;
3464}
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 3889 of file docnode.cpp.

3890{
3891 AUTO_TRACE();
3892 parser()->context.token->name = tokText;
3893 return parser()->defaultHandleToken(thisVariant(),tok,children());
3894}
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 1064 of file docnode.h.

1064{ 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 1067 of file docnode.h.

1067{ 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 5451 of file docnode.cpp.

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

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

References attribs(), and m_attribs.

Referenced by parse().

Member Data Documentation

◆ m_attribs

HtmlAttribList DocPara::m_attribs
private

Definition at line 1100 of file docnode.h.

Referenced by attribs(), and setAttribs().

◆ m_isFirst

bool DocPara::m_isFirst = false
private

Definition at line 1098 of file docnode.h.

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

◆ m_isLast

bool DocPara::m_isLast = false
private

Definition at line 1099 of file docnode.h.

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


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