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

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

#include <src/docnode.h>

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

Public Member Functions

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

Private Attributes

bool m_isFirst = false
 
bool m_isLast = false
 
HtmlAttribList m_attribs
 

Additional Inherited Members

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

Detailed Description

Node representing a paragraph in the documentation tree.

Definition at line 1073 of file docnode.h.

Constructor & Destructor Documentation

◆ DocPara()

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

Definition at line 3236 of file docnode.cpp.

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

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

Referenced by parse().

Member Function Documentation

◆ attribs()

const HtmlAttribList & DocPara::attribs ( ) const
inline

Definition at line 1108 of file docnode.h.

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

References m_attribs.

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

◆ handleCite()

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

Definition at line 3295 of file docnode.cpp.

3296{
3297 AUTO_TRACE();
3298 // get the argument of the cite command.
3299 Token tok=parser()->tokenizer.lex();
3300 if (!tok.is(TokenRetval::TK_WHITESPACE))
3301 {
3302 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
3303 cmdChar,cmdName);
3304 return;
3305 }
3307 tok=parser()->tokenizer.lex();
3308 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3309 {
3310 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
3311 "argument of command '{:c}{}'",cmdChar,cmdName);
3312 return;
3313 }
3314 else if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
3315 {
3316 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}'",
3317 tok.to_string(),cmdChar,cmdName);
3318 return;
3319 }
3321 children().append<DocCite>(
3323
3325}
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:112
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1393
TokenInfo * token
Definition docparser_p.h:92
QCString sectionId
QCString name

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, DocParserContext::context, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), 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 3979 of file docnode.cpp.

3980{
3981 AUTO_TRACE("cmdName={}",cmdName);
3982 Token retval = Token::make_RetVal_OK();
3983 CommandType cmdId = Mappers::cmdMapper->map(cmdName);
3984 switch (cmdId)
3985 {
3987 {
3988 std::string str{cmdChar};
3989 children().append<DocWord>(parser(),thisVariant(),str.c_str() + cmdName);
3990 if (isAliasCmd(cmdName.view()))
3991 {
3992 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Found unexpanded alias '{:c}{}'. Check if number of arguments passed is correct.",cmdChar,cmdName);
3993 }
3994 else
3995 {
3996 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Found unknown command '{:c}{}'",cmdChar,cmdName);
3997 }
3998 }
3999 break;
4001 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE);
4002 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
4003 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,cmdName,FALSE);
4004 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4005 break;
4007 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Bold,cmdName,TRUE);
4008 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
4009 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Bold,cmdName,FALSE);
4010 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4011 break;
4013 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,cmdName,TRUE);
4014 retval=parser()->handleStyleArgument(thisVariant(),children(),cmdName);
4015 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,cmdName,FALSE);
4016 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
4017 break;
4020 break;
4023 break;
4026 break;
4029 break;
4032 break;
4035 break;
4038 break;
4041 break;
4044 break;
4047 break;
4051 break;
4056 break;
4059 break;
4062 break;
4065 break;
4068 break;
4071 break;
4074 break;
4077 break;
4082 break;
4086 break;
4089 break;
4092 break;
4095 break;
4098 break;
4101 break;
4104 break;
4107 break;
4110 break;
4113 break;
4116 break;
4119 break;
4122 break;
4125 break;
4128 break;
4131 break;
4133 {
4134 children().append<DocSimpleList>(parser(),thisVariant());
4135 retval = children().get_last<DocSimpleList>()->parse();
4136 }
4137 break;
4139 {
4140 handleSection(cmdChar,cmdName);
4141 retval = Token::make_RetVal_Section();
4142 }
4143 break;
4145 {
4146 handleSection(cmdChar,cmdName);
4147 retval = Token::make_RetVal_Subsection();
4148 }
4149 break;
4151 {
4152 handleSection(cmdChar,cmdName);
4153 retval = Token::make_RetVal_Subsubsection();
4154 }
4155 break;
4157 {
4158 handleSection(cmdChar,cmdName);
4159 retval = Token::make_RetVal_Paragraph();
4160 }
4161 break;
4163 {
4164 handleSection(cmdChar,cmdName);
4165 retval = Token::make_RetVal_SubParagraph();
4166 }
4167 break;
4169 {
4170 handleSection(cmdChar,cmdName);
4171 retval = Token::make_RetVal_SubSubParagraph();
4172 }
4173 break;
4175 {
4177 retval = handleStartCode();
4178 }
4179 break;
4181 {
4183 retval = handleStartCode();
4184 }
4185 break;
4187 {
4189 retval = parser()->tokenizer.lex();
4191 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4192 {
4193 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"htmlonly section ended without end marker");
4194 }
4196 }
4197 break;
4199 {
4201 retval = parser()->tokenizer.lex();
4203 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4204 {
4205 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"manonly section ended without end marker");
4206 }
4208 }
4209 break;
4211 {
4213 retval = parser()->tokenizer.lex();
4215 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4216 {
4217 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"rtfonly section ended without end marker");
4218 }
4220 }
4221 break;
4223 {
4225 retval = parser()->tokenizer.lex();
4227 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4228 {
4229 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"latexonly section ended without end marker");
4230 }
4232 }
4233 break;
4235 {
4237 retval = parser()->tokenizer.lex();
4239 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4240 {
4241 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"xmlonly section ended without end marker");
4242 }
4244 }
4245 break;
4247 {
4249 retval = parser()->tokenizer.lex();
4251 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4252 {
4253 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"docbookonly section ended without end marker");
4254 }
4256 }
4257 break;
4259 {
4262 parser()->tokenizer.lex();
4263
4264 QCString fullMatch = parser()->context.token->verb;
4265 int idx = fullMatch.find('{');
4266 int idxEnd = fullMatch.find("}",idx+1);
4267 StringVector optList;
4268 if (idx != -1) // options present
4269 {
4270 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
4271 optList = split(optStr.str(),",");
4272 for (const auto &opt : optList)
4273 {
4274 if (opt.empty()) continue;
4275 QCString locOpt(opt);
4276 locOpt = locOpt.stripWhiteSpace().lower();
4277 if (locOpt == "code")
4278 {
4280 }
4281 else if (!locOpt.isEmpty())
4282 {
4283 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Unknown option '{}' for '\\iliteral'",opt);
4284 }
4285 }
4286 }
4287
4289 retval = parser()->tokenizer.lex();
4291 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4292 {
4293 if (t == DocVerbatim::JavaDocCode)
4294 {
4295 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"javadoc code section ended without end marker");
4296 }
4297 else
4298 {
4299 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"javadoc literal section ended without end marker");
4300 }
4301 }
4303 }
4304 break;
4307 {
4308 if (cmdId == CommandType::CMD_VERBATIM)
4309 {
4311 }
4312 else
4313 {
4315 }
4316 retval = parser()->tokenizer.lex();
4318 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4319 {
4320 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"verbatim section ended without end marker");
4321 }
4323 }
4324 break;
4326 {
4327 children().append<DocVerbatim>(parser(),thisVariant(),
4333 DocVerbatim *dv = children().get_last<DocVerbatim>();
4335 QCString width,height;
4336 parser()->defaultHandleTitleAndSize(CommandType::CMD_DOT,&children().back(),dv->children(),width,height);
4338 retval = parser()->tokenizer.lex();
4339 dv->setText(parser()->context.token->verb);
4340 dv->setWidth(width);
4341 dv->setHeight(height);
4342 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4343 if (!Config_getBool(HAVE_DOT))
4344 {
4345 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"ignoring \\dot command because HAVE_DOT is not set");
4346 children().pop_back();
4347 }
4348 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4349 {
4350 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"dot section ended without end marker");
4351 }
4353 }
4354 break;
4356 {
4357 children().append<DocVerbatim>(parser(),thisVariant(),
4363 DocVerbatim *dv = children().get_last<DocVerbatim>();
4365 QCString width,height;
4366 parser()->defaultHandleTitleAndSize(CommandType::CMD_MSC,&children().back(),dv->children(),width,height);
4368 retval = parser()->tokenizer.lex();
4369 dv->setText(parser()->context.token->verb);
4370 dv->setWidth(width);
4371 dv->setHeight(height);
4372 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4373 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4374 {
4375 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"msc section ended without end marker");
4376 }
4378 }
4379 break;
4381 {
4382 QCString jarPath = Config_getString(PLANTUML_JAR_PATH);
4384 parser()->tokenizer.lex();
4385 QCString fullMatch = parser()->context.token->sectionId;
4386 QCString sectionId = "";
4387 int idx = fullMatch.find('{');
4388 int idxEnd = fullMatch.find("}",idx+1);
4389 StringVector optList;
4390 QCString engine;
4391 if (idx != -1) // options present
4392 {
4393 QCString optStr = fullMatch.mid(idx+1,idxEnd-idx-1).stripWhiteSpace();
4394 optList = split(optStr.str(),",");
4395 for (const auto &opt : optList)
4396 {
4397 if (opt.empty()) continue;
4398 bool found = false;
4399 QCString locOpt(opt);
4400 locOpt = locOpt.stripWhiteSpace().lower();
4401 if (g_plantumlEngine.find(locOpt.str())!=g_plantumlEngine.end())
4402 {
4403 if (!engine.isEmpty())
4404 {
4405 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(), "Multiple definition of engine for '\\startuml'");
4406 }
4407 engine = locOpt;
4408 found = true;
4409 }
4410 if (!found)
4411 {
4412 if (sectionId.isEmpty())
4413 {
4414 sectionId = opt;
4415 }
4416 else
4417 {
4418 warn(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Multiple use of filename for '\\startuml'");
4419 }
4420 }
4421 }
4422 }
4423 else
4424 {
4425 sectionId = parser()->context.token->sectionId;
4426 }
4427 if (engine.isEmpty()) engine = "uml";
4428
4429 if (sectionId.isEmpty())
4430 {
4432 retval = parser()->tokenizer.lex();
4433 assert(retval.is(TokenRetval::RetVal_OK));
4434
4435 sectionId = parser()->context.token->sectionId;
4436 sectionId = sectionId.stripWhiteSpace();
4437 }
4438
4439 QCString plantFile(sectionId);
4440 children().append<DocVerbatim>(parser(),thisVariant(),
4444 FALSE,plantFile);
4445 DocVerbatim *dv = children().get_last<DocVerbatim>();
4446 dv->setEngine(engine);
4448 QCString width,height;
4449 parser()->defaultHandleTitleAndSize(CommandType::CMD_STARTUML,&children().back(),dv->children(),width,height);
4451 retval = parser()->tokenizer.lex();
4452 int line = 0;
4453 QCString trimmedVerb = stripLeadingAndTrailingEmptyLines(parser()->context.token->verb,line);
4454 if (engine == "ditaa")
4455 {
4456 dv->setUseBitmap(true);
4457 }
4458 else if (engine == "uml")
4459 {
4460 int i = trimmedVerb.find('\n');
4461 QCString firstLine = i==-1 ? trimmedVerb : trimmedVerb.left(i);
4462 if (firstLine.stripWhiteSpace() == "ditaa") dv->setUseBitmap(true);
4463 }
4464 dv->setText(trimmedVerb);
4465 dv->setWidth(width);
4466 dv->setHeight(height);
4467 dv->setLocation(parser()->context.fileName,parser()->tokenizer.getLineNr());
4468 if (jarPath.isEmpty())
4469 {
4470 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"ignoring \\startuml command because PLANTUML_JAR_PATH is not set");
4471 children().pop_back();
4472 }
4473 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
4474 {
4475 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"startuml section ended without end marker");
4476 }
4478 }
4479 break;
4481 retval = Token::make_RetVal_EndParBlock();
4482 break;
4498 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command {}",parser()->context.token->name);
4499 break;
4501 retval = handleParamSection(cmdName,DocParamSect::Param,FALSE,parser()->context.token->paramDir);
4502 break;
4504 retval = handleParamSection(cmdName,DocParamSect::TemplateParam,FALSE,parser()->context.token->paramDir);
4505 break;
4507 retval = handleParamSection(cmdName,DocParamSect::RetVal);
4508 break;
4511 break;
4513 retval = handleXRefItem();
4514 break;
4516 {
4517 children().append<DocLineBreak>(parser(),thisVariant());
4518 }
4519 break;
4522 {
4524 }
4525 break;
4527 {
4529 }
4530 break;
4532 {
4533 children().append<DocIndexEntry>(parser(),thisVariant(),
4536 retval = children().get_last<DocIndexEntry>()->parse();
4537 }
4538 break;
4540 retval = Token::make_RetVal_Internal();
4541 break;
4543 retval = Token::make_RetVal_EndInternal();
4544 break;
4546 {
4547 children().append<DocParBlock>(parser(),thisVariant());
4548 retval = children().get_last<DocParBlock>()->parse();
4549 }
4550 break;
4551 case CommandType::CMD_COPYDOC: // fall through
4552 case CommandType::CMD_COPYBRIEF: // fall through
4554 //retval = Token::make_RetVal_CopyDoc();
4555 // these commands should already be resolved by processCopyDoc()
4556 break;
4559 break;
4562 break;
4565 break;
4568 break;
4571 break;
4574 break;
4577 break;
4580 break;
4583 break;
4586 break;
4589 break;
4592 break;
4595 break;
4598 break;
4601 break;
4604 break;
4607 break;
4609 if (!Config_getBool(HAVE_DOT))
4610 {
4611 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),
4612 "ignoring \\dotfile command because HAVE_DOT is not set");
4613 }
4614 else
4615 {
4616 handleFile<DocDotFile>(cmdName);
4617 }
4618 break;
4621 break;
4623 handleFile<DocMscFile>(cmdName);
4624 break;
4626 handleFile<DocDiaFile>(cmdName);
4627 break;
4630 break;
4632 handleLink(cmdName,FALSE);
4633 break;
4635 handleLink(cmdName,TRUE);
4636 break;
4638 handleCite(cmdChar,cmdName);
4639 break;
4641 handleEmoji(cmdChar,cmdName);
4642 break;
4644 handleDoxyConfig(cmdChar,cmdName);
4645 break;
4646 case CommandType::CMD_REF: // fall through
4648 handleRef(cmdChar,cmdName);
4649 break;
4651 {
4652 children().append<DocSecRefList>(parser(),thisVariant());
4653 children().get_last<DocSecRefList>()->parse();
4654 }
4655 break;
4657 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command '{:c}{}'",cmdChar,parser()->context.token->name);
4658 break;
4660 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command '{:c}{}'",cmdChar,parser()->context.token->name);
4661 break;
4663 {
4664 children().append<DocFormula>(parser(),thisVariant(),parser()->context.token->id);
4665 }
4666 break;
4667 //case CommandType::CMD_LANGSWITCH:
4668 // retval = handleLanguageSwitch();
4669 // break;
4671 //warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected command {}",parser()->context.token->name);
4672 {
4675 }
4676 break;
4679 break;
4681 handleShowDate(cmdChar,cmdName);
4682 break;
4684 handleILine(cmdChar,cmdName);
4685 break;
4687 handleIFile(cmdChar,cmdName);
4688 break;
4690 {
4692 (void)parser()->tokenizer.lex();
4694 //printf("Found scope='%s'\n",qPrint(parser()->context.context));
4696 }
4697 break;
4698 default:
4699 // we should not get here!
4700 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected command '{}' in paragraph context",cmdName);
4701 break;
4702 }
4703 INTERNAL_ASSERT(retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF,TokenRetval::RetVal_OK,TokenRetval::RetVal_SimpleSec
4704 TokenRetval::TK_LISTITEM,TokenRetval::TK_ENDLIST,TokenRetval::TK_NEWPARA
4705 TokenRetval::RetVal_Section,TokenRetval::RetVal_EndList
4706 TokenRetval::RetVal_Internal,TokenRetval::RetVal_SwitchLang
4707 TokenRetval::RetVal_EndInternal)
4708 );
4709 AUTO_TRACE_EXIT("retval={}",retval.to_string());
4710 return retval;
4711}
bool isAliasCmd(std::string_view aliasCmd)
Definition aliases.cpp:528
@ LatexInclude
Definition docnode.h:432
@ SnippetWithLines
Definition docnode.h:433
@ IncWithLines
Definition docnode.h:433
@ HtmlInclude
Definition docnode.h:432
@ VerbInclude
Definition docnode.h:432
@ DontInclude
Definition docnode.h:432
@ DocbookInclude
Definition docnode.h:434
Token handleSimpleSection(DocSimpleSect::Type t, bool xmlContext=FALSE)
Definition docnode.cpp:3242
void handleLink(const QCString &cmdName, bool isJavaLink)
Definition docnode.cpp:3684
void handleInheritDoc()
Definition docnode.cpp:3942
void handleCite(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3295
void handleInclude(const QCString &cmdName, DocInclude::Type t)
Definition docnode.cpp:3752
void handleDoxyConfig(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3358
void handleSection(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3857
void handleFile(const QCString &cmdName)
Definition docnode.cpp:3645
void handleIFile(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3561
Token handleParamSection(const QCString &cmdName, DocParamSect::Type t, bool xmlContext, int direction)
Definition docnode.cpp:3272
void handleEmoji(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3327
void handleIncludeOperator(const QCString &cmdName, DocIncOperator::Type t)
Definition docnode.cpp:3585
void handleRef(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3725
void handleILine(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3547
Token parse()
Definition docnode.cpp:5467
void handleVhdlFlow()
Definition docnode.cpp:3677
void handleShowDate(char cmdChar, const QCString &cmdName)
Definition docnode.cpp:3477
Token handleXRefItem()
Definition docnode.cpp:3456
Token handleStartCode()
Definition docnode.cpp:3906
void handleInternalRef(DocNodeVariant *parent, DocNodeList &children)
void handleImage(DocNodeVariant *parent, DocNodeList &children)
void handlePrefix(DocNodeVariant *parent, DocNodeList &children)
Token handleStyleArgument(DocNodeVariant *parent, DocNodeList &children, const QCString &cmdName)
void handleAnchor(DocNodeVariant *parent, DocNodeList &children)
void defaultHandleTitleAndSize(const CommandType cmd, DocNodeVariant *parent, DocNodeList &children, QCString &width, QCString &height)
void setStateILiteralOpt()
void setStateILiteral()
void setStateCode()
void setStatePlantUMLOpt()
void setStateRtfOnly()
void setStateVerbatim()
void setStateLatexOnly()
void setStateManOnly()
void setStateDbOnly()
void setStateHtmlOnly()
void setStateICode()
void setStatePlantUML()
void setStateIVerbatim()
void setStateXmlOnly()
void setStateSetScope()
@ JavaDocLiteral
Definition docnode.h:373
static NamespaceDefMutable * globalScope
Definition doxygen.h:121
void pop_back()
removes the last element
Definition growvector.h:115
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
const std::string & str() const
Definition qcstring.h:537
std::string_view view() const
Definition qcstring.h:161
QCString left(size_t len) const
Definition qcstring.h:214
CommandType
Definition cmdmapper.h:29
@ CMD_ENDSECREFLIST
Definition cmdmapper.h:53
@ CMD_ENDLATEXONLY
Definition cmdmapper.h:51
@ CMD_ENDVERBATIM
Definition cmdmapper.h:54
@ CMD_DONTINCLUDE
Definition cmdmapper.h:46
@ CMD_SUBSUBSECTION
Definition cmdmapper.h:89
@ CMD_SUBSUBPARAGRAPH
Definition cmdmapper.h:161
@ CMD_INTERNALREF
Definition cmdmapper.h:65
@ CMD_ENDHTMLONLY
Definition cmdmapper.h:50
@ CMD_VERBINCLUDE
Definition cmdmapper.h:98
@ CMD_DOCBOOKINCLUDE
Definition cmdmapper.h:145
@ CMD_HTMLINCLUDE
Definition cmdmapper.h:60
@ CMD_SNIPWITHLINES
Definition cmdmapper.h:141
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
std::vector< std::string > StringVector
Definition containers.h:33
static const StringUnorderedSet g_plantumlEngine
Definition docnode.cpp:69
#define INTERNAL_ASSERT(x)
Definition docnode.cpp:51
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
#define warn(file, line, fmt,...)
Definition message.h:97
const Mapper< CommandType > * cmdMapper
#define TRUE
Definition qcstring.h:37
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1404
DocNodeStack nodeStack
Definition docparser_p.h:66
QCString exampleName
Definition docparser_p.h:79
const Definition * scope
Definition docparser_p.h:61
const MemberDef * memberDef
Definition docparser_p.h:77
QCString verb
bool found
Definition util.cpp:984
StringVector split(const std::string &s, const std::string &delimiter)
split input string s by string delimiter delimiter.
Definition util.cpp:7042
QCString stripLeadingAndTrailingEmptyLines(const QCString &s, int &docLine)
Special version of QCString::stripWhiteSpace() that only strips completely blank lines.
Definition util.cpp:5464

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

Referenced by parse().

◆ handleDoxyConfig()

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

Definition at line 3358 of file docnode.cpp.

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

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

Referenced by handleCommand().

◆ handleEmoji()

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

Definition at line 3327 of file docnode.cpp.

3328{
3329 AUTO_TRACE();
3330 // get the argument of the emoji command.
3331 Token tok=parser()->tokenizer.lex();
3332 if (!tok.is(TokenRetval::TK_WHITESPACE))
3333 {
3334 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
3335 cmdChar,cmdName);
3336 return;
3337 }
3339 tok=parser()->tokenizer.lex();
3340 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3341 {
3342 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"no emoji name given or unexpected end of comment block while parsing the "
3343 "argument of command '{:c}{}'",cmdChar,cmdName);
3345 return;
3346 }
3347 else if (!tok.is(TokenRetval::TK_WORD))
3348 {
3349 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}'",
3350 tok.to_string(),cmdChar,cmdName);
3352 return;
3353 }
3356}
void setStateEmoji()

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), DocParser::context, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), 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 3645 of file docnode.cpp.

3646{
3647 AUTO_TRACE("cmdName={}",cmdName);
3648 QCString saveCmdName = cmdName;
3649 Token tok=parser()->tokenizer.lex();
3650 if (!tok.is(TokenRetval::TK_WHITESPACE))
3651 {
3652 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\{} command",
3653 saveCmdName);
3654 return;
3655 }
3657 tok=parser()->tokenizer.lex();
3659 if (!tok.is(TokenRetval::TK_WORD))
3660 {
3661 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of {}",
3662 tok.to_string(),saveCmdName);
3663 return;
3664 }
3665 QCString name = parser()->context.token->name;
3666 children().append<T>(parser(),thisVariant(),name,
3670 auto df = children().get_last<T>();
3671 if (!df->parse())
3672 {
3673 children().pop_back();
3674 }
3675}
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(), 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 5197 of file docnode.cpp.

5198{
5199 AUTO_TRACE("tagName={}",tagName);
5200 HtmlTagType tagId = Mappers::htmlTagMapper->map(tagName);
5201 Token retval = Token::make_RetVal_OK();
5202 switch (tagId)
5203 {
5205 if (!insideUL(thisVariant()))
5206 {
5207 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </ul> tag without matching <ul>");
5208 }
5209 else
5210 {
5211 retval = Token::make_RetVal_EndList();
5212 }
5213 break;
5215 if (!insideOL(thisVariant()))
5216 {
5217 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </ol> tag without matching <ol>");
5218 }
5219 else
5220 {
5221 retval = Token::make_RetVal_EndList();
5222 }
5223 break;
5225 if (!insideLI(thisVariant()))
5226 {
5227 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </li> tag without matching <li>");
5228 }
5229 else
5230 {
5231 // ignore </li> tags
5232 }
5233 break;
5235 if (!insideDetails(thisVariant()))
5236 {
5237 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </details> tag without matching <details>");
5238 }
5239 else
5240 {
5241 retval = Token::make_RetVal_EndHtmlDetails();
5242 }
5243 break;
5246 {
5247 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"found </blockquote> tag without matching <blockquote>");
5248 }
5249 else
5250 {
5251 retval = Token::make_RetVal_EndBlockQuote();
5252 }
5253 break;
5256 break;
5259 break;
5262 break;
5265 break;
5268 break;
5271 break;
5274 break;
5277 break;
5280 break;
5283 break;
5286 break;
5289 break;
5292 break;
5295 break;
5298 break;
5301 break;
5306 break;
5308 retval = Token::make_TK_NEWPARA();
5309 break;
5311 retval = Token::make_RetVal_EndDesc();
5312 break;
5314 // ignore </dt> tag
5315 break;
5317 // ignore </dd> tag
5318 break;
5320 retval = Token::make_RetVal_EndTable();
5321 break;
5323 // ignore </tr> tag
5324 break;
5326 // ignore </td> tag
5327 break;
5329 // ignore </th> tag
5330 break;
5334 // for time being ignore </t....> tag
5335 break;
5337 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </caption> found");
5338 break;
5340 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal </br> tag found");
5341 break;
5343 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h1> found");
5344 break;
5346 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h2> found");
5347 break;
5349 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h3> found");
5350 break;
5352 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h4> found");
5353 break;
5355 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h5> found");
5356 break;
5358 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </h6> found");
5359 break;
5361 break;
5363 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal </hr> tag found");
5364 break;
5366 //warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag </a> found");
5367 // ignore </a> tag (can be part of <a name=...></a>
5368 break;
5369
5371 break;
5373 retval = Token::make_TK_NEWPARA();
5374 break;
5387 retval = Token::make_RetVal_CloseXml();
5388 break;
5389 case HtmlTagType::XML_C:
5391 break;
5399 // These tags are defined in .Net but are currently unsupported
5400 break;
5402 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported xml/html tag </{}> found", tagName);
5403 children().append<DocWord>(parser(),thisVariant(),"</"+tagName+">");
5404 break;
5405 default:
5406 // we should not get here!
5407 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected end tag {}",tagName);
5408 ASSERT(0);
5409 break;
5410 }
5411 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5412 return retval;
5413}
void setInsidePreformatted(bool p)
Definition docnode.h:108
void handleStyleLeave(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName)
void setInsidePre(bool b)
HtmlTagType
Definition cmdmapper.h:169
bool insideUL(const DocNodeVariant *n)
bool insideLI(const DocNodeVariant *n)
bool insideBlockQuote(const DocNodeVariant *n)
bool insideDetails(const DocNodeVariant *n)
bool insideOL(const DocNodeVariant *n)
const Mapper< HtmlTagType > * htmlTagMapper
#define ASSERT(x)
Definition qcstring.h:39

References DocNodeList::append(), ASSERT, AUTO_TRACE, AUTO_TRACE_EXIT, DocStyleChange::Bold, DocStyleChange::Center, DocCompoundNode::children(), DocStyleChange::Cite, DocStyleChange::Code, DocStyleChange::Del, DocStyleChange::Div, FALSE, DocParser::handleStyleLeave(), HTML_A, HTML_BLOCKQUOTE, HTML_BOLD, HTML_BR, HTML_CAPTION, HTML_CENTER, HTML_CITE, HTML_CODE, HTML_DD, HTML_DEL, HTML_DETAILS, HTML_DIV, HTML_DL, HTML_DT, HTML_EMPHASIS, HTML_H1, HTML_H2, HTML_H3, HTML_H4, HTML_H5, HTML_H6, HTML_HR, HTML_IMG, HTML_INS, HTML_KBD, HTML_LI, HTML_OL, HTML_P, HTML_PRE, HTML_S, HTML_SMALL, HTML_SPAN, HTML_STRIKE, HTML_SUB, HTML_SUP, HTML_TABLE, HTML_TBODY, HTML_TD, HTML_TFOOT, HTML_TH, HTML_THEAD, HTML_TR, HTML_UL, HTML_UNDERLINE, Mappers::htmlTagMapper, DocStyleChange::Ins, insideBlockQuote(), insideDetails(), insideLI(), insideOL(), insideUL(), DocStyleChange::Italic, DocStyleChange::Kbd, DocNode::parser(), DocStyleChange::Preformatted, 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 3888 of file docnode.cpp.

3889{
3890 AUTO_TRACE();
3891 children().append<DocHtmlHeader>(parser(),thisVariant(),tagHtmlAttribs,level);
3892 Token retval = children().get_last<DocHtmlHeader>()->parse();
3893 return retval.is(TokenRetval::RetVal_OK) ? Token::make_TK_NEWPARA() : retval;
3894}

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

4730{
4731 AUTO_TRACE("tagName={} #tagHtmlAttrs={}",tagName,tagHtmlAttribs.size());
4732 Token retval = Token::make_RetVal_OK();
4733 HtmlTagType tagId = Mappers::htmlTagMapper->map(tagName);
4734 if (parser()->context.token->emptyTag && !(tagId>HtmlTagType::XML_CmdMask) &&
4737 {
4738 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"HTML tag ('<{}/>') may not use the 'empty tag' XHTML syntax.",
4739 tagName);
4740 }
4741 switch (tagId)
4742 {
4744 if (!parser()->context.token->emptyTag)
4745 {
4746 children().append<DocHtmlList>(parser(),thisVariant(),
4747 tagHtmlAttribs,DocHtmlList::Unordered);
4748 retval=children().get_last<DocHtmlList>()->parse();
4749 }
4750 break;
4752 if (!parser()->context.token->emptyTag)
4753 {
4754 children().append<DocHtmlList>(parser(),thisVariant(),
4755 tagHtmlAttribs,DocHtmlList::Ordered);
4756 retval=children().get_last<DocHtmlList>()->parse();
4757 }
4758 break;
4760 if (parser()->context.token->emptyTag) break;
4762 {
4763 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"lonely <li> tag found");
4764 }
4765 else
4766 {
4767 retval = Token::make_RetVal_ListItem();
4768 }
4769 break;
4771 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Bold,tagName,&parser()->context.token->attribs);
4772 break;
4774 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::S,tagName,&parser()->context.token->attribs);
4775 break;
4777 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Strike,tagName,&parser()->context.token->attribs);
4778 break;
4780 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Del,tagName,&parser()->context.token->attribs);
4781 break;
4783 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Underline,tagName,&parser()->context.token->attribs);
4784 break;
4786 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Ins,tagName,&parser()->context.token->attribs);
4787 break;
4789 if (parser()->context.token->emptyTag) break;
4790 if (parser()->context.xmlComment)
4791 // for C# source or inside a <summary> or <remark> section we
4792 // treat <code> as an XML tag (so similar to @code)
4793 {
4795 retval = handleStartCode();
4796 }
4797 else // normal HTML markup
4798 {
4799 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Code,tagName,&parser()->context.token->attribs);
4800 }
4801 break;
4803 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Kbd,tagName,&parser()->context.token->attribs);
4804 break;
4806 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Italic,tagName,&parser()->context.token->attribs);
4807 break;
4809 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Div,tagName,&parser()->context.token->attribs);
4810 if (parser()->context.token->emptyTag) parser()->handleStyleLeave(thisVariant(),children(),DocStyleChange::Div,tagName);
4811 break;
4813 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Span,tagName,&parser()->context.token->attribs);
4814 if (parser()->context.token->emptyTag) parser()->handleStyleLeave(thisVariant(),children(),DocStyleChange::Span,tagName);
4815 break;
4817 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Subscript,tagName,&parser()->context.token->attribs);
4818 break;
4820 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Superscript,tagName,&parser()->context.token->attribs);
4821 break;
4823 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Center,tagName,&parser()->context.token->attribs);
4824 break;
4826 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Small,tagName,&parser()->context.token->attribs);
4827 break;
4829 if (!parser()->context.token->emptyTag) parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Cite,tagName,&parser()->context.token->attribs);
4830 break;
4832 if (parser()->context.token->emptyTag) break;
4833 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Preformatted,tagName,&parser()->context.token->attribs);
4836 break;
4838 retval = Token::make_TK_NEWPARA();
4839 break;
4841 if (!parser()->context.token->emptyTag)
4842 {
4843 children().append<DocHtmlDescList>(parser(),thisVariant(),tagHtmlAttribs);
4844 retval=children().get_last<DocHtmlDescList>()->parse();
4845 }
4846 break;
4848 if (insideDL(thisVariant()))
4849 {
4850 retval = Token::make_RetVal_DescTitle();
4851 }
4852 else
4853 {
4854 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <dt> found");
4855 }
4856 break;
4858 if (insideDL(thisVariant()))
4859 {
4860 retval = Token::make_RetVal_DescData();
4861 }
4862 else
4863 {
4864 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <dd> found");
4865 }
4866 break;
4868 if (!parser()->context.token->emptyTag)
4869 {
4870 children().append<DocHtmlTable>(parser(),thisVariant(),tagHtmlAttribs);
4871 retval=children().get_last<DocHtmlTable>()->parse();
4872 }
4873 break;
4875 retval = Token::make_RetVal_TableRow();
4876 break;
4878 retval = Token::make_RetVal_TableCell();
4879 break;
4881 retval = Token::make_RetVal_TableHCell();
4882 break;
4886 // for time being ignore </t....> tag
4887 break;
4889 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected tag <caption> found");
4890 break;
4892 {
4893 children().append<DocLineBreak>(parser(),thisVariant(),tagHtmlAttribs);
4894 }
4895 break;
4897 {
4898 children().append<DocHorRuler>(parser(),thisVariant(),tagHtmlAttribs);
4899 }
4900 break;
4902 retval = parser()->handleAHref(thisVariant(),children(),tagHtmlAttribs);
4903 break;
4905 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,1);
4906 break;
4908 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,2);
4909 break;
4911 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,3);
4912 break;
4914 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,4);
4915 break;
4917 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,5);
4918 break;
4920 if (!parser()->context.token->emptyTag) retval=handleHtmlHeader(tagHtmlAttribs,6);
4921 break;
4923 {
4924 parser()->handleImg(thisVariant(),children(),tagHtmlAttribs);
4925 }
4926 break;
4928 if (!parser()->context.token->emptyTag)
4929 {
4930 children().append<DocHtmlDetails>(parser(),thisVariant(),tagHtmlAttribs);
4931 retval=children().get_last<DocHtmlDetails>()->parse();
4932 }
4933 break;
4935 if (!parser()->context.token->emptyTag)
4936 {
4937 children().append<DocHtmlBlockQuote>(parser(),thisVariant(),tagHtmlAttribs);
4938 retval = children().get_last<DocHtmlBlockQuote>()->parse();
4939 }
4940 break;
4941
4944 {
4945 if (!parser()->context.token->emptyTag)
4946 {
4948 while (n && !std::holds_alternative<DocHtmlDetails>(*n)) n=::parent(n);
4949 DocHtmlDetails *d = std::get_if<DocHtmlDetails>(n);
4950 if (d)
4951 {
4952 if (!d->summary()) // details section does not have a summary yet
4953 {
4954 d->parseSummary(n,parser()->context.token->attribs);
4955 }
4956 else
4957 {
4958 retval = Token::make_TK_NEWPARA();
4959 }
4960 }
4961 }
4962 }
4963 break;
4967 // fall through
4970 if (!children().empty())
4971 {
4972 retval = Token::make_TK_NEWPARA();
4973 }
4974 break;
4976 if (insideTable(thisVariant()))
4977 {
4978 retval = Token::make_RetVal_TableCell();
4979 }
4980 break;
4981 case HtmlTagType::XML_C:
4982 parser()->handleStyleEnter(thisVariant(),children(),DocStyleChange::Code,tagName,&parser()->context.token->attribs);
4983 break;
4986 {
4988 QCString paramName;
4989 if (findAttribute(tagHtmlAttribs,"name",&paramName))
4990 {
4991 if (paramName.isEmpty())
4992 {
4993 if (Config_getBool(WARN_NO_PARAMDOC))
4994 {
4995 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"empty 'name' attribute for <param{}> tag.",tagId==HtmlTagType::XML_PARAM?"":"type");
4996 }
4997 }
4998 else
4999 {
5000 retval = handleParamSection(paramName,
5002 TRUE);
5003 }
5004 }
5005 else
5006 {
5007 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'name' attribute from <param{}> tag.",tagId==HtmlTagType::XML_PARAM?"":"type");
5008 }
5009 }
5010 break;
5013 {
5014 QCString paramName;
5015 if (findAttribute(tagHtmlAttribs,"name",&paramName))
5016 {
5017 //printf("paramName=%s\n",qPrint(paramName));
5018 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,tagName,TRUE);
5019 children().append<DocWord>(parser(),thisVariant(),paramName);
5020 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Italic,tagName,FALSE);
5021 if (!retval.is(TokenRetval::TK_WORD)) children().append<DocWhiteSpace>(parser(),thisVariant()," ");
5022 }
5023 else
5024 {
5025 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'name' attribute from <param{}ref> tag.",tagId==HtmlTagType::XML_PARAMREF?"":"type");
5026 }
5027 }
5028 break;
5030 {
5032 QCString exceptName;
5033 if (findAttribute(tagHtmlAttribs,"cref",&exceptName))
5034 {
5035 unescapeCRef(exceptName);
5036 retval = handleParamSection(exceptName,DocParamSect::Exception,TRUE);
5037 }
5038 else
5039 {
5040 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' attribute from <exception> tag.");
5041 }
5042 }
5043 break;
5046 if (insideTable(thisVariant()))
5047 {
5048 retval = Token::make_RetVal_TableRow();
5049 }
5050 else if (insideUL(thisVariant()) || insideOL(thisVariant()))
5051 {
5052 retval = Token::make_RetVal_ListItem();
5053 }
5054 else
5055 {
5056 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"lonely <item> tag found");
5057 }
5058 break;
5063 break;
5065 if (insideTable(thisVariant()))
5066 {
5067 retval = Token::make_RetVal_TableCell();
5068 }
5069 break;
5071 // I'm not sure if <see> is the same as <seealso> or if it
5072 // should you link a member without producing a section. The
5073 // C# specification is extremely vague about this (but what else
5074 // can we expect from Microsoft...)
5075 {
5076 QCString cref;
5077 //printf("HtmlTagType::XML_SEE: empty tag=%d\n",parser()->context.token->emptyTag);
5078 if (findAttribute(tagHtmlAttribs,"cref",&cref))
5079 {
5080 unescapeCRef(cref);
5081 if (parser()->context.token->emptyTag) // <see cref="..."/> style
5082 {
5083 bool inSeeBlock = parser()->context.inSeeBlock;
5084 parser()->context.token->name = cref;
5087 parser()->context.inSeeBlock = inSeeBlock;
5088 }
5089 else // <see cref="...">...</see> style
5090 {
5091 //DocRef *ref = new DocRef(this,cref);
5092 //children().append(ref);
5093 //ref->parse();
5095 children().append<DocLink>(parser(),thisVariant(),cref);
5096 DocLink *lnk = children().get_last<DocLink>();
5097 QCString leftOver = lnk->parse(FALSE,TRUE);
5098 if (!leftOver.isEmpty())
5099 {
5100 children().append<DocWord>(parser(),thisVariant(),leftOver);
5101 }
5102 }
5103 }
5104 else if (findAttribute(tagHtmlAttribs,"langword",&cref)) // <see langword="..."/> or <see langword="..."></see>
5105 {
5106 bool inSeeBlock = parser()->context.inSeeBlock;
5107 parser()->context.token->name = cref;
5109 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,tagName,TRUE);
5111 children().append<DocStyleChange>(parser(),thisVariant(),parser()->context.nodeStack.size(),DocStyleChange::Code,tagName,FALSE);
5112 parser()->context.inSeeBlock = inSeeBlock;
5113 }
5114 else
5115 {
5116 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' or 'langword' attribute from <see> tag.");
5117 }
5118 }
5119 break;
5121 {
5123 QCString cref;
5124 if (findAttribute(tagHtmlAttribs,"cref",&cref))
5125 {
5126 unescapeCRef(cref);
5127 // Look for an existing "see" section
5128 DocNodeVariant *vss=nullptr;
5129 for (auto &n : children())
5130 {
5131 DocSimpleSect *candidate = std::get_if<DocSimpleSect>(&n);
5132 if (candidate && candidate->type()==DocSimpleSect::See)
5133 {
5134 vss = &n;
5135 }
5136 }
5137
5138 if (!vss) // start new section
5139 {
5140 children().append<DocSimpleSect>(parser(),thisVariant(),DocSimpleSect::See);
5141 vss = &children().back();
5142 }
5143
5144 std::get<DocSimpleSect>(*vss).appendLinkWord(cref);
5145 retval = Token::make_RetVal_OK();
5146 }
5147 else
5148 {
5149 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Missing 'cref' attribute from <seealso> tag.");
5150 }
5151 }
5152 break;
5154 {
5155 QCString type;
5156 findAttribute(tagHtmlAttribs,"type",&type);
5158 HtmlAttribList emptyList;
5159 if (type=="number")
5160 {
5161 listType=DocHtmlList::Ordered;
5162 }
5163 if (type=="table")
5164 {
5165 children().append<DocHtmlTable>(parser(),thisVariant(),emptyList);
5166 retval=children().get_last<DocHtmlTable>()->parseXml();
5167 }
5168 else
5169 {
5170 children().append<DocHtmlList>(parser(),thisVariant(),emptyList,listType);
5171 retval=children().get_last<DocHtmlList>()->parseXml();
5172 }
5173 }
5174 break;
5177 // These tags are defined in .Net but are currently unsupported
5179 break;
5181 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported xml/html tag <{}> found", tagName);
5182 children().append<DocWord>(parser(),thisVariant(), "<"+tagName+parser()->context.token->attribsStr+">");
5183 break;
5186 break;
5187 default:
5188 // we should not get here!
5189 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected start tag {}",tagName);
5190 ASSERT(0);
5191 break;
5192 }
5193 AUTO_TRACE_EXIT("retval={}",retval.to_string());
5194 return retval;
5195}
void parseSummary(DocNodeVariant *, HtmlAttribList &attribs)
Definition docnode.cpp:1449
const DocNodeVariant * summary() const
Definition docnode.h:858
Token handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs, int level)
Definition docnode.cpp:3888
void handleLinkedWord(DocNodeVariant *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE)
Token handleAHref(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
void handleStyleEnter(DocNodeVariant *parent, DocNodeList &children, DocStyleChange::Style s, const QCString &tagName, const HtmlAttribList *attribs)
void handleImg(DocNodeVariant *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
Type type() const
Definition docnode.h:1020
void setStateXmlCode()
T & back()
access the last element
Definition growvector.h:135
static void unescapeCRef(QCString &s)
Definition docnode.cpp:81
static bool findAttribute(const HtmlAttribList &tagHtmlAttribs, const char *attrName, QCString *result)
Definition docnode.cpp:4713
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, 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 3561 of file docnode.cpp.

3562{
3563 AUTO_TRACE();
3564 Token tok=parser()->tokenizer.lex();
3565 if (!tok.is(TokenRetval::TK_WHITESPACE))
3566 {
3567 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
3568 cmdChar,cmdName);
3569 return;
3570 }
3572 tok=parser()->tokenizer.lex();
3574 if (!tok.is(TokenRetval::TK_WORD))
3575 {
3576 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}'",
3577 tok.to_string(),cmdChar,cmdName);
3578 return;
3579 }
3582}

References AUTO_TRACE, DocParser::context, DocParserContext::fileName, Token::is(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), 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 3547 of file docnode.cpp.

3548{
3549 AUTO_TRACE();
3551 Token tok = parser()->tokenizer.lex();
3552 if (!tok.is(TokenRetval::TK_WORD))
3553 {
3554 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid argument for command '{:c}{}'",
3555 cmdChar,cmdName);
3556 return;
3557 }
3559}
void setStateILine()

References AUTO_TRACE, Token::is(), DocTokenizer::lex(), DocNode::parser(), 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 3752 of file docnode.cpp.

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

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), Config_getBool, DocParser::context, DocParserContext::context, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocParserContext::exampleName, DocParserContext::fileName, DocNodeList::get_last(), DocInclude::Include, DocInclude::IncWithLines, Token::is(), Token::is_any_of(), DocParserContext::isExample, DocTokenizer::lex(), TokenInfo::name, parse(), DocNode::parser(), 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 3585 of file docnode.cpp.

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

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), Config_getBool, DocParser::context, DocParserContext::context, end(), GrowVector< T >::end(), DocParserContext::exampleName, DocNodeList::get_last(), Token::is(), Token::is_any_of(), DocParserContext::isExample, isFirst(), DocTokenizer::lex(), DocIncOperator::markLast(), TokenInfo::name, DocNode::parser(), 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 3942 of file docnode.cpp.

3943{
3944 if (parser()->context.memberDef) // inheriting docs from a member
3945 {
3946 const MemberDef *reMd = parser()->context.memberDef->reimplements();
3947 if (reMd) // member from which was inherited.
3948 {
3949 const MemberDef *thisMd = parser()->context.memberDef;
3950 //printf("{InheritDocs:%s=>%s}\n",qPrint(parser()->context.memberDef->qualifiedName()),qPrint(reMd->qualifiedName()));
3951 parser()->pushContext();
3952 parser()->context.scope=reMd->getOuterScope();
3953 if (parser()->context.scope!=Doxygen::globalScope)
3954 {
3956 }
3957 parser()->context.memberDef=reMd;
3958 while (!parser()->context.styleStack.empty()) parser()->context.styleStack.pop();
3959 while (!parser()->context.nodeStack.empty()) parser()->context.nodeStack.pop();
3960 parser()->context.copyStack.push_back(reMd);
3963 parser()->context.copyStack.pop_back();
3964 auto hasParamCommand = parser()->context.hasParamCommand;
3965 auto hasReturnCommand = parser()->context.hasReturnCommand;
3966 auto retvalsFound = parser()->context.retvalsFound;
3967 auto paramsFound = parser()->context.paramsFound;
3968 parser()->popContext();
3969 parser()->context.hasParamCommand = hasParamCommand;
3970 parser()->context.hasReturnCommand = hasReturnCommand;
3971 parser()->context.retvalsFound = retvalsFound;
3972 parser()->context.paramsFound = paramsFound;
3973 parser()->context.memberDef = thisMd;
3974 }
3975 }
3976}
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 3684 of file docnode.cpp.

3685{
3686 AUTO_TRACE("cmdName={} isJavaLink={}",cmdName,isJavaLink);
3687 QCString saveCmdName = cmdName;
3688 Token tok=parser()->tokenizer.lex();
3689 if (!tok.is(TokenRetval::TK_WHITESPACE))
3690 {
3691 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\{} command",
3692 saveCmdName);
3693 return;
3694 }
3696 tok=parser()->tokenizer.lex();
3697 if (!tok.is(TokenRetval::TK_WORD))
3698 {
3699 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"{} as the argument of {}",
3700 tok.to_string(),saveCmdName);
3701 return;
3702 }
3703 if (saveCmdName == "javalink")
3704 {
3705 children().append<DocStyleChange>(parser(),thisVariant(),
3706 parser()->context.nodeStack.size(),
3707 DocStyleChange::Code,cmdName,TRUE);
3708 }
3711 DocLink *lnk = children().get_last<DocLink>();
3712 if (saveCmdName == "javalink")
3713 {
3714 children().append<DocStyleChange>(parser(),thisVariant(),
3715 parser()->context.nodeStack.size(),
3716 DocStyleChange::Code,cmdName,FALSE);
3717 }
3718 QCString leftOver = lnk->parse(isJavaLink);
3719 if (!leftOver.isEmpty())
3720 {
3721 children().append<DocWord>(parser(),thisVariant(),leftOver);
3722 }
3723}
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(), 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 3272 of file docnode.cpp.

3276{
3277 AUTO_TRACE();
3278 DocParamSect *ps = nullptr;
3279 if (!children().empty() && // previous element
3280 (ps=children().get_last<DocParamSect>()) && // was a param sect
3281 ps->type()==t) // of same type
3282 { // append to previous section ps
3283 }
3284 else // start new section
3285 {
3286 children().append<DocParamSect>(parser(),thisVariant(),t);
3287 ps = children().get_last<DocParamSect>();
3288 }
3289 Token rv=ps->parse(cmdName,xmlContext,
3290 static_cast<DocParamSect::Direction>(direction));
3291 AUTO_TRACE_EXIT("retval={}",rv.to_string());
3292 return (!rv.is(TokenRetval::TK_NEWPARA)) ? rv : Token::make_RetVal_OK();
3293}
Token parse(const QCString &cmdName, bool xmlContext, Direction d)
Definition docnode.cpp:3193
Type type() const
Definition docnode.h:1062

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

Referenced by handleCommand(), and handleHtmlStartTag().

◆ handleRef()

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

Definition at line 3725 of file docnode.cpp.

3726{
3727 AUTO_TRACE("cmdName={}",cmdName);
3728 QCString saveCmdName = cmdName;
3729 Token tok=parser()->tokenizer.lex();
3730 if (!tok.is(TokenRetval::TK_WHITESPACE))
3731 {
3732 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
3733 cmdChar,qPrint(saveCmdName));
3734 return;
3735 }
3737 tok=parser()->tokenizer.lex(); // get the reference id
3738 if (!tok.is(TokenRetval::TK_WORD))
3739 {
3740 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}'",
3741 tok.to_string(),cmdChar,saveCmdName);
3742 goto endref;
3743 }
3744 children().append<DocRef>(parser(),thisVariant(),
3747 children().get_last<DocRef>()->parse();
3748endref:
3750}
const char * qPrint(const char *s)
Definition qcstring.h:672

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

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

References AUTO_TRACE, DocParser::context, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocNode::parser(), 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 3477 of file docnode.cpp.

3478{
3479 AUTO_TRACE();
3480 QCString fmt;
3481 QCString date;
3482 Token tok=parser()->tokenizer.lex();
3483 if (!tok.is(TokenRetval::TK_WHITESPACE))
3484 {
3485 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
3486 cmdChar,cmdName);
3487 return;
3488 }
3490 tok = parser()->tokenizer.lex();
3491 if (!tok.is(TokenRetval::TK_WORD))
3492 {
3493 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <format> argument for command '{:c}{}'",
3494 cmdChar,cmdName);
3496 return;
3497 }
3498 fmt = parser()->context.token->name;
3499
3501 tok = parser()->tokenizer.lex();
3502
3503 QCString specDateRaw = tok.is(TokenRetval::TK_WORD) ? parser()->context.token->name : QCString();
3504 QCString specDate = specDateRaw.stripWhiteSpace();
3505 bool specDateOnlyWS = !specDateRaw.isEmpty() && specDate.isEmpty();
3506 if (!specDate.isEmpty() && !tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3507 {
3508 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <date_time> argument for command '{:c}{}'",
3509 cmdChar,cmdName);
3511 return;
3512 }
3513
3514 std::tm dat{};
3515 int specFormat=0;
3516 QCString err = dateTimeFromString(specDate,dat,specFormat);
3517 if (!err.isEmpty())
3518 {
3519 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"invalid <date_time> argument for command '{:c}{}': {}",
3520 cmdChar,cmdName,err);
3522 return;
3523 }
3524
3525 int usedFormat=0;
3526 QCString dateTimeStr = formatDateTime(fmt,dat,usedFormat);
3527
3528 // warn the user if the format contains markers that are not explicitly filled in
3529 for (int i=0;i<SF_NumBits;i++)
3530 {
3531 int bitMask = 1<<i;
3532 if ((usedFormat&bitMask) && !(specFormat&bitMask)) // a part was used in the format string but its value was not specified.
3533 {
3534 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"'{:c}{}' <format> parameter '{}' has {} related markers which are not specified in the <date_time> parameter '{}'. Filling in the current value for {} instead.",
3535 cmdChar,cmdName,fmt,SF_bit2str(i),specDate,SF_bit2str(i));
3536 }
3537 }
3538
3539 children().append<DocWord>(parser(),thisVariant(),dateTimeStr);
3540 if (specDateOnlyWS) // specDate is only whitespace
3541 {
3542 children().append<DocWhiteSpace>(parser(),thisVariant()," ");
3543 }
3545}
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:127

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(), 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 3242 of file docnode.cpp.

3243{
3244 AUTO_TRACE();
3245 DocSimpleSect *ss=nullptr;
3246 bool needsSeparator = FALSE;
3247 if (!children().empty() && // has previous element
3248 (ss=children().get_last<DocSimpleSect>()) && // was a simple sect
3249 ss->type()==t && // of same type
3250 t!=DocSimpleSect::User) // but not user defined
3251 {
3252 // append to previous section
3253 needsSeparator = TRUE;
3254 }
3255 else // start new section
3256 {
3257 children().append<DocSimpleSect>(parser(),thisVariant(),t);
3258 ss = children().get_last<DocSimpleSect>();
3259 }
3260 Token rv = Token::make_RetVal_OK();
3261 if (xmlContext)
3262 {
3263 return ss->parseXml();
3264 }
3265 else
3266 {
3267 rv = ss->parse(t==DocSimpleSect::User,needsSeparator);
3268 }
3269 return (!rv.is(TokenRetval::TK_NEWPARA)) ? rv : Token::make_RetVal_OK();
3270}
Token parse(bool userTitle, bool needsSeparator)
Definition docnode.cpp:2907
Token parseXml()
Definition docnode.cpp:2961

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

3907{
3908 AUTO_TRACE();
3909 Token retval = parser()->tokenizer.lex();
3910 QCString lang = parser()->context.token->name;
3911 if (!lang.isEmpty() && lang.at(0)!='.')
3912 {
3913 lang="."+lang;
3914 }
3915 if (parser()->context.xmlComment)
3916 {
3917 parser()->context.token->verb = substitute(substitute(parser()->context.token->verb,"&lt;","<"),"&gt;",">");
3918 }
3919 // search for the first non-whitespace line, index is stored in li
3920 size_t i=0,li=0,l=parser()->context.token->verb.length();
3921 while (i<l && (parser()->context.token->verb.at(i)==' ' || parser()->context.token->verb.at(i)=='\n'))
3922 {
3923 if (parser()->context.token->verb.at(i)=='\n') li=i+1;
3924 i++;
3925 }
3926 children().append<DocVerbatim>(parser(),thisVariant(),
3928 stripIndentation(parser()->context.token->verb.mid(li)),
3932 FALSE,lang);
3933 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
3934 {
3935 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"code section ended without end marker");
3936 }
3938 AUTO_TRACE_EXIT("retval={}",retval.to_string());
3939 return retval;
3940}
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:6378

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

3678{
3679 AUTO_TRACE();
3680 children().append<DocVhdlFlow>(parser(),thisVariant());
3681 children().get_last<DocVhdlFlow>()->parse();
3682}

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

3457{
3458 AUTO_TRACE();
3459 Token retval=parser()->tokenizer.lex();
3460 ASSERT(retval.is(TokenRetval::TK_WHITESPACE));
3462 retval=parser()->tokenizer.lex();
3463 if (retval.is(TokenRetval::RetVal_OK))
3464 {
3465 children().append<DocXRefItem>(parser(),thisVariant(),
3467 DocXRefItem *ref = children().get_last<DocXRefItem>();
3468 if (!ref->parse())
3469 {
3470 children().pop_back();
3471 }
3472 }
3474 return retval;
3475}
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 3899 of file docnode.cpp.

3900{
3901 AUTO_TRACE();
3902 parser()->context.token->name = tokText;
3903 return parser()->defaultHandleToken(thisVariant(),tok,children());
3904}
bool defaultHandleToken(DocNodeVariant *parent, Token tok, DocNodeList &children, bool handleWord=TRUE)

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

Referenced by DocSimpleSect::appendLinkWord().

◆ isEmpty()

bool DocPara::isEmpty ( ) const
inline

Definition at line 1078 of file docnode.h.

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

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

◆ isFirst()

bool DocPara::isFirst ( ) const
inline

Definition at line 1081 of file docnode.h.

1081{ return m_isFirst; }

References m_isFirst.

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

◆ isLast()

bool DocPara::isLast ( ) const
inline

◆ markFirst()

◆ markLast()

◆ parse()

Token DocPara::parse ( )

Definition at line 5467 of file docnode.cpp.

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

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

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

◆ setAttribs()

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

Definition at line 1109 of file docnode.h.

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

References attribs(), and m_attribs.

Referenced by parse().

Member Data Documentation

◆ m_attribs

HtmlAttribList DocPara::m_attribs
private

Definition at line 1114 of file docnode.h.

Referenced by attribs(), and setAttribs().

◆ m_isFirst

bool DocPara::m_isFirst = false
private

Definition at line 1112 of file docnode.h.

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

◆ m_isLast

bool DocPara::m_isLast = false
private

Definition at line 1113 of file docnode.h.

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


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