Doxygen
Loading...
Searching...
No Matches
DocSecRefList Class Referencefinal

Node representing a list of section references. More...

#include <src/docnode.h>

Inheritance diagram for DocSecRefList:
Collaboration diagram for DocSecRefList:

Public Member Functions

 DocSecRefList (DocParser *parser, DocNodeVariant *parent)
void parse ()
Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
DocNodeList & children ()
const DocNodeList & children () const
Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 ~DocNode ()=default
DocNodeVariant * parent ()
const DocNodeVariant * parent () const
DocNodeVariant * thisVariant ()
const DocNodeVariant * thisVariant () const
void setThisVariant (DocNodeVariant *thisVariant)
DocParser * parser ()
const DocParser * parser () const
void setParent (DocNodeVariant *parent)
bool isPreformatted () const

Additional Inherited Members

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

Detailed Description

Node representing a list of section references.

Definition at line 967 of file docnode.h.

Constructor & Destructor Documentation

◆ DocSecRefList()

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

Definition at line 970 of file docnode.h.

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

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

Member Function Documentation

◆ parse()

void DocSecRefList::parse ( )

Definition at line 627 of file docnode.cpp.

628{
629 AUTO_TRACE();
630 auto ns = AutoNodeStack(parser(),thisVariant());
631
632 Token tok=parser()->tokenizer.lex();
633 // skip white space
634 while (tok.is_any_of(TokenRetval::TK_WHITESPACE, TokenRetval::TK_NEWPARA)) tok=parser()->tokenizer.lex();
635 // handle items
636 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
637 {
638 if (tok.is_any_of(TokenRetval::TK_COMMAND_AT, TokenRetval::TK_COMMAND_BS))
639 {
640 switch (Mappers::cmdMapper->map(parser()->context.token->name))
641 {
643 {
644 tok=parser()->tokenizer.lex();
645 if (!tok.is(TokenRetval::TK_WHITESPACE))
646 {
647 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\refitem command");
648 break;
649 }
650 tok=parser()->tokenizer.lex();
651 if (!tok.is_any_of(TokenRetval::TK_WORD,TokenRetval::TK_LNKWORD))
652 {
653 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of \\refitem",
654 tok.to_string());
655 break;
656 }
657
658 children().append<DocSecRefItem>(parser(),thisVariant(),parser()->context.token->name);
659 children().get_last<DocSecRefItem>()->parse();
660 }
661 break;
663 return;
664 default:
665 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal command '{:c}{}' as part of a \\secreflist",
666 tok.command_to_char(),qPrint(parser()->context.token->name));
667 return;
668 }
669 }
670 else if (tok.is(TokenRetval::TK_WHITESPACE))
671 {
672 // ignore whitespace
673 }
674 else
675 {
676 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected token {} inside section reference list",
677 tok.to_string());
678 return;
679 }
680 tok=parser()->tokenizer.lex();
681 }
682
683}
DocNodeList & children()
Definition docnode.h:143
DocNodeVariant * thisVariant()
Definition docnode.h:92
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
Definition docnode.h:1404
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Definition docnode.h:1415
DocTokenizer tokenizer
DocParserContext context
bool is(TokenRetval rv) const
TOKEN_SPECIFICATIONS RETVAL_SPECIFICATIONS const char * to_string() const
bool is_any_of(ARGS... args) const
char command_to_char() const
DString name
@ CMD_ENDSECREFLIST
Definition cmdmapper.h:54
#define AUTO_TRACE(...)
Definition docnode.cpp:53
const char * qPrint(const char *s)
Definition dstring.h:783
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
const Mapper< CommandType > * cmdMapper
TokenInfo * token
Definition docparser_p.h:94

References DocNodeList::append(), AUTO_TRACE, DocCompoundNode::children(), CMD_ENDSECREFLIST, CMD_SECREFITEM, Mappers::cmdMapper, Token::command_to_char(), DocParser::context, DocNodeList::get_last(), Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, parse(), DocNode::parser(), qPrint(), DocNode::thisVariant(), Token::to_string(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by parse().


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