Skip to main content

The DocInternal Class Reference

Node representing an internal section of documentation. More...

Declaration

class DocInternal { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocCompoundNode

Base class for nodes with children. More...

Public Constructors Index

DocInternal (DocParser *parser, DocNodeVariant *parent)

Public Member Functions Index

Tokenparse (int)

Description

Node representing an internal section of documentation.

Definition at line 968 of file docnode.h.

Public Constructors

DocInternal()

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

Public Member Functions

parse()

Token DocInternal::parse (int level)

Declaration at line 972 of file docnode.h, definition at line 1539 of file docnode.cpp.

1540{
1541 AUTO_TRACE();
1542 Token retval(TokenRetval::RetVal_OK);
1543 auto ns = AutoNodeStack(parser(),thisVariant());
1544
1545 // first parse any number of paragraphs
1546 bool isFirst=TRUE;
1547 DocPara *lastPar=nullptr;
1548 do
1549 {
1551 DocPara *par = children().get_last<DocPara>();
1552 if (isFirst) { par->markFirst(); isFirst=FALSE; }
1553 retval=par->parse();
1554 if (!par->isEmpty())
1555 {
1556 if (lastPar) lastPar->markLast(FALSE);
1557 lastPar=par;
1558 }
1559 else
1560 {
1561 children().pop_back();
1562 }
1563 if (retval.is(TokenRetval::TK_LISTITEM))
1564 {
1565 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Invalid list item found");
1566 }
1567 } while (!retval.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF,
1568 TokenRetval::RetVal_Section, TokenRetval::RetVal_Subsection, TokenRetval::RetVal_Subsubsection,
1569 TokenRetval::RetVal_Paragraph, TokenRetval::RetVal_SubParagraph, TokenRetval::RetVal_SubSubParagraph,
1570 TokenRetval::RetVal_EndInternal));
1571 if (lastPar) lastPar->markLast();
1572
1573 // then parse any number of level-n sections
1574 while ((level==1 && retval.is(TokenRetval::RetVal_Section)) ||
1575 (level==2 && retval.is(TokenRetval::RetVal_Subsection)) ||
1576 (level==3 && retval.is(TokenRetval::RetVal_Subsubsection)) ||
1577 (level==4 && retval.is(TokenRetval::RetVal_Paragraph)) ||
1578 (level==5 && retval.is(TokenRetval::RetVal_SubParagraph)) ||
1579 (level==6 && retval.is(TokenRetval::RetVal_SubSubParagraph))
1580 )
1581 {
1583 level,
1585 retval = children().get_last<DocSection>()->parse();
1586 }
1587
1588 if (retval.is(TokenRetval::RetVal_Internal))
1589 {
1590 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"\\internal command found inside internal section");
1591 }
1592
1593 AUTO_TRACE_EXIT("retval={}",retval.to_string());
1594 return retval;
1595}

References DocNodeList::append, AUTO_TRACE, AUTO_TRACE_EXIT, DocCompoundNode::children, DocParser::context, FALSE, DocNodeList::get_last, Token::is, Token::is_any_of, DocPara::markLast, parse, DocNode::parser, GrowVector< T >::pop_back, TokenInfo::sectionId, DocNode::thisVariant, Token::to_string, DocParserContext::token, TRUE and warn_doc_error.

Referenced by parse.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.