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

Node representing an block of paragraphs. More...

#include <src/docnode.h>

+ Inheritance diagram for DocParBlock:
+ Collaboration diagram for DocParBlock:

Public Member Functions

 DocParBlock (DocParser *parser, DocNodeVariant *parent)
 
Token parse ()
 
- 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
 

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 an block of paragraphs.

Definition at line 958 of file docnode.h.

Constructor & Destructor Documentation

◆ DocParBlock()

DocParBlock::DocParBlock ( DocParser * parser,
DocNodeVariant * parent )
inline

Definition at line 961 of file docnode.h.

DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References DocCompoundNode::DocCompoundNode(), DocNode::parent(), and DocNode::parser().

Member Function Documentation

◆ parse()

Token DocParBlock::parse ( )

Definition at line 2703 of file docnode.cpp.

2704{
2705 AUTO_TRACE();
2706 Token retval = Token::make_TK_NONE();
2707 auto ns = AutoNodeStack(parser(),thisVariant());
2708
2709 // parse one or more paragraphs
2710 bool isFirst=TRUE;
2711 DocPara *par=nullptr;
2712 do
2713 {
2714 children().append<DocPara>(parser(),thisVariant());
2715 par = children().get_last<DocPara>();
2716 if (isFirst) { par->markFirst(); isFirst=FALSE; }
2717 retval=par->parse();
2718 }
2719 while (retval.is(TokenRetval::TK_NEWPARA));
2720 if (par) par->markLast();
2721
2722 AUTO_TRACE_EXIT("retval={}",retval.to_string());
2723 return retval.is(TokenRetval::RetVal_EndBlockQuote) ? Token::make_RetVal_OK() : retval;
2724}
DocNodeList & children()
Definition docnode.h:142
DocNodeVariant * thisVariant()
Definition docnode.h:92
void markLast(bool v=TRUE)
Definition docnode.h:1066
void markFirst(bool v=TRUE)
Definition docnode.h:1065
Token parse()
Definition docnode.cpp:5451
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
#define AUTO_TRACE(...)
Definition docnode.cpp:46
#define AUTO_TRACE_EXIT(...)
Definition docnode.cpp:48
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1379
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1390

References DocNodeList::append(), AUTO_TRACE, AUTO_TRACE_EXIT, DocCompoundNode::children(), FALSE, DocNodeList::get_last(), Token::is(), DocPara::markFirst(), DocPara::markLast(), DocPara::parse(), DocNode::parser(), DocNode::thisVariant(), Token::to_string(), and TRUE.


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