Skip to main content

The DocHtmlDescTitle Class Reference

Node representing a Html description item. More...

Declaration

class DocHtmlDescTitle { ... }

Included Headers

#include <src/docnode.h>

Base class

classDocCompoundNode

Base class for nodes with children. More...

Public Constructors Index

DocHtmlDescTitle (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 item.

Definition at line 887 of file docnode.h.

Public Constructors

DocHtmlDescTitle()

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

Public Member Functions

attribs()

const HtmlAttribList & DocHtmlDescTitle::attribs ()
inline

Definition at line 892 of file docnode.h.

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

Reference m_attribs.

Referenced by DocHtmlDescTitle and HtmlDocVisitor::operator().

parse()

Token DocHtmlDescTitle::parse ()

Declaration at line 893 of file docnode.h, definition at line 2342 of file docnode.cpp.

2343{
2344 AUTO_TRACE();
2345 Token retval = Token::make_TK_NONE();
2346 auto ns = AutoNodeStack(parser(),thisVariant());
2347
2348 Token tok = parser()->tokenizer.lex();
2349 while (!tok.is_any_of(TokenRetval::TK_NONE, TokenRetval::TK_EOF))
2350 {
2351 if (!parser()->defaultHandleToken(thisVariant(),tok,children()))
2352 {
2353 switch (tok.value())
2354 {
2355 case TokenRetval::TK_COMMAND_AT:
2356 // fall through
2357 case TokenRetval::TK_COMMAND_BS:
2358 {
2359 QCString cmdName=parser()->context.token->name;
2360 bool isJavaLink=FALSE;
2361 switch (Mappers::cmdMapper->map(cmdName))
2362 {
2364 {
2365 tok=parser()->tokenizer.lex();
2366 if (!tok.is(TokenRetval::TK_WHITESPACE))
2367 {
2368 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after '{:c}{}' command",
2369 tok.command_to_char(),cmdName);
2370 }
2371 else
2372 {
2374 tok=parser()->tokenizer.lex(); // get the reference id
2375 if (!tok.is(TokenRetval::TK_WORD))
2376 {
2377 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of '{:c}{}' command",
2378 tok.to_string(),tok.command_to_char(),cmdName);
2379 }
2380 else
2381 {
2384 }
2386 }
2387 }
2388 break;
2390 isJavaLink=TRUE;
2391 // fall through
2393 {
2394 tok=parser()->tokenizer.lex();
2395 if (!tok.is(TokenRetval::TK_WHITESPACE))
2396 {
2397 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"expected whitespace after \\{} command",
2398 cmdName);
2399 }
2400 else
2401 {
2403 tok=parser()->tokenizer.lex();
2404 if (!tok.is(TokenRetval::TK_WORD))
2405 {
2406 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"unexpected token {} as the argument of \\{} command",
2407 tok.to_string(),cmdName);
2408 }
2409 else
2410 {
2413 DocLink *lnk = children().get_last<DocLink>();
2414 QCString leftOver = lnk->parse(isJavaLink);
2415 if (!leftOver.isEmpty())
2416 {
2417 children().append<DocWord>(parser(),thisVariant(),leftOver);
2418 }
2419 }
2420 }
2421 }
2422
2423 break;
2424 default:
2425 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Illegal command '{:c}{}' found as part of a <dt> tag",
2426 tok.command_to_char(),cmdName);
2427 }
2428 }
2429 break;
2430 case TokenRetval::TK_SYMBOL:
2431 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unsupported symbol '{}' found as part of a <dt> tag",
2432 parser()->context.token->name);
2433 break;
2434 case TokenRetval::TK_HTMLTAG:
2435 {
2436 HtmlTagType tagId=Mappers::htmlTagMapper->map(parser()->context.token->name);
2437 if (tagId==HtmlTagType::HTML_DD && !parser()->context.token->endTag) // found <dd> tag
2438 {
2439 retval = Token::make_RetVal_DescData();
2440 goto endtitle;
2441 }
2442 else if (tagId==HtmlTagType::HTML_DT && parser()->context.token->endTag)
2443 {
2444 // ignore </dt> tag.
2445 }
2446 else if (tagId==HtmlTagType::HTML_DT)
2447 {
2448 // missing <dt> tag.
2449 retval = Token::make_RetVal_DescTitle();
2450 goto endtitle;
2451 }
2452 else if (tagId==HtmlTagType::HTML_DL && parser()->context.token->endTag)
2453 {
2454 retval = Token::make_RetVal_EndDesc();
2455 goto endtitle;
2456 }
2457 else if (tagId==HtmlTagType::HTML_A)
2458 {
2459 if (!parser()->context.token->endTag)
2460 {
2461 parser()->handleAHref(thisVariant(),children(),parser()->context.token->attribs);
2462 }
2463 }
2464 else
2465 {
2466 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected html tag <{}{}> found within <dt> context",
2467 parser()->context.token->endTag?"/":"",parser()->context.token->name);
2468 }
2469 }
2470 break;
2471 default:
2472 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected token {} found as part of a <dt> tag",
2473 tok.to_string());
2474 break;
2475 }
2476 }
2477 tok = parser()->tokenizer.lex();
2478 }
2479 if (tok.is_any_of(TokenRetval::TK_NONE,TokenRetval::TK_EOF))
2480 {
2481 warn_doc_error(parser()->context.fileName,parser()->tokenizer.getLineNr(),"Unexpected end of comment while inside"
2482 " <dt> tag");
2483 }
2484endtitle:
2486 return retval;
2487}

References DocNodeList::append, AUTO_TRACE, DocCompoundNode::children, CMD_JAVALINK, CMD_LINK, CMD_REF, Mappers::cmdMapper, Token::command_to_char, DocParser::context, DocParserContext::context, FALSE, DocNodeList::get_last, DocParser::handleAHref, DocParser::handlePendingStyleCommands, HTML_A, HTML_DD, HTML_DL, HTML_DT, Mappers::htmlTagMapper, Token::is, Token::is_any_of, DocTokenizer::lex, TokenInfo::name, parse, DocNode::parser, DocTokenizer::setStateLink, DocTokenizer::setStatePara, DocTokenizer::setStateRef, DocNode::thisVariant, Token::to_string, DocParserContext::token, DocParser::tokenizer, TRUE, Token::value and warn_doc_error.

Referenced by parse.

Private Member Attributes

m_attribs

HtmlAttribList DocHtmlDescTitle::m_attribs

Definition at line 896 of file docnode.h.

Referenced by attribs and DocHtmlDescTitle.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.