Skip to main content

The DocHtmlDescList Class Reference

Node representing a Html description list. More...

Declaration

class DocHtmlDescList { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocCompoundNode

Base class for nodes with children. More...

Public Constructors Index

DocHtmlDescList (DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)

Public Member Functions Index

const HtmlAttribList &attribs () const
Tokenparse ()

Private Member Attributes Index

HtmlAttribListm_attribs

Description

Node representing a Html description list.

Definition at line 900 of file docnode.h.

Public Constructors

DocHtmlDescList()

DocHtmlDescList::DocHtmlDescList (DocParser * parser, DocNodeVariant * parent, const HtmlAttribList & attribs)
inline

Public Member Functions

attribs()

const HtmlAttribList & DocHtmlDescList::attribs ()
inline

Definition at line 905 of file docnode.h.

905 const HtmlAttribList &attribs() const { return m_attribs; }

Reference m_attribs.

Referenced by classEqualsReflist, DocHtmlDescList and HtmlDocVisitor::operator().

parse()

Token DocHtmlDescList::parse ()

Declaration at line 906 of file docnode.h, definition at line 2515 of file docnode.cpp.

2516{
2517 AUTO_TRACE();
2518 Token retval = Token::make_RetVal_OK();
2519 auto ns = AutoNodeStack(parser(),thisVariant());
2520
2521 // get next token
2522 Token tok=parser()->tokenizer.lex();
2523 // skip whitespace
2524 while (tok.is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_NEWPARA)) tok=parser()->tokenizer.lex();
2525 // should find a html tag now
2526 if (tok.is(TokenRetval::TK_HTMLTAG))
2527 {
2528 HtmlTagType tagId=Mappers::htmlTagMapper->map(parser()->context.token->name);
2529 if (tagId==HtmlTagType::HTML_DT && !parser()->context.token->endTag) // found <dt> tag
2530 {
2531 // continue
2532 }
2533 else // found some other tag
2534 {
2535 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected <dt> tag but "
2536 "found <{}> instead!",parser()->context.token->name);
2537 parser()->tokenizer.pushBackHtmlTag(parser()->context.token->name);
2538 goto enddesclist;
2539 }
2540 }
2541 else if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF)) // premature end of comment
2542 {
2543 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment while looking"
2544 " for a html description title");
2545 goto enddesclist;
2546 }
2547 else // token other than html token
2548 {
2549 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected <dt> tag but found {} token instead!",
2550 tok.to_string());
2551 goto enddesclist;
2552 }
2553
2554 do
2555 {
2560 retval=dt->parse();
2561 if (retval.is(TokenRetval::RetVal_DescData))
2562 {
2563 retval=dd->parse();
2564 while (retval.is(TokenRetval::RetVal_DescData))
2565 {
2568 retval=dd->parse();
2569 }
2570 }
2571 else if (!retval.is(TokenRetval::RetVal_DescTitle))
2572 {
2573 // error
2574 break;
2575 }
2576 } while (retval.is(TokenRetval::RetVal_DescTitle));
2577
2578 if (retval.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
2579 {
2580 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected end of comment while inside <dl> block");
2581 }
2582
2583enddesclist:
2584
2585 return retval.is(TokenRetval::RetVal_EndDesc) ? Token::make_RetVal_OK() : retval;
2586}

References DocNodeList::append, TokenInfo::attribs, AUTO_TRACE, DocCompoundNode::children, DocParser::context, DocNodeList::get_last, HTML_DT, Mappers::htmlTagMapper, Token::is, Token::is_any_of, DocTokenizer::lex, DocHtmlDescData::parse, DocNode::parser, DocTokenizer::pushBackHtmlTag, DocNode::thisVariant, Token::to_string, DocParserContext::token, DocParser::tokenizer and warn_doc_error.

Private Member Attributes

m_attribs

HtmlAttribList DocHtmlDescList::m_attribs

Definition at line 909 of file docnode.h.

Referenced by attribs and DocHtmlDescList.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.