Doxygen
DocHtmlDescTitle类 参考

Node representing a Html description item 更多...

#include <docparser.h>

+ 类 DocHtmlDescTitle 继承关系图:
+ DocHtmlDescTitle 的协作图:

Public 成员函数

 DocHtmlDescTitle (DocParser &parser, DocNode *parent, const HtmlAttribList &attribs)
 
Kind kind () const override
 
const HtmlAttribListattribs () const
 
int parse ()
 
- Public 成员函数 继承自 CompAccept< DocHtmlDescTitle >
 CompAccept (DocParser &parser)
 
void accept (DocVisitor *v) override
 
const DocNodeListchildren () const
 
DocNodeListchildren ()
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

HtmlAttribList m_attribs
 

额外继承的成员函数

- Public 类型 继承自 DocNode
enum  Kind {
  Kind_Root = 0, Kind_Word = 1, Kind_WhiteSpace = 2, Kind_Para = 3,
  Kind_AutoList = 4, Kind_AutoListItem = 5, Kind_Symbol = 6, Kind_URL = 7,
  Kind_StyleChange = 8, Kind_SimpleSect = 9, Kind_Title = 10, Kind_SimpleList = 11,
  Kind_SimpleListItem = 12, Kind_Section = 13, Kind_Verbatim = 14, Kind_XRefItem = 15,
  Kind_HtmlList = 16, Kind_HtmlListItem = 17, Kind_HtmlDescList = 18, Kind_HtmlDescData = 19,
  Kind_HtmlDescTitle = 20, Kind_HtmlTable = 21, Kind_HtmlRow = 22, Kind_HtmlCell = 23,
  Kind_HtmlCaption = 24, Kind_LineBreak = 25, Kind_HorRuler = 26, Kind_Anchor = 27,
  Kind_IndexEntry = 28, Kind_Internal = 29, Kind_HRef = 30, Kind_Include = 31,
  Kind_IncOperator = 32, Kind_HtmlHeader = 33, Kind_Image = 34, Kind_DotFile = 35,
  Kind_Link = 36, Kind_Ref = 37, Kind_Formula = 38, Kind_SecRefItem = 39,
  Kind_SecRefList = 40, Kind_SimpleSectSep = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43,
  Kind_ParamList = 44, Kind_InternalRef = 45, Kind_Copy = 46, Kind_Text = 47,
  Kind_MscFile = 48, Kind_HtmlBlockQuote = 49, Kind_VhdlFlow = 50, Kind_ParBlock = 51,
  Kind_DiaFile = 52, Kind_Emoji = 53, Kind_Sep = 54
}
 
- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 CompAccept< DocHtmlDescTitle >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a Html description item

在文件 docparser.h973 行定义.

构造及析构函数说明

◆ DocHtmlDescTitle()

DocHtmlDescTitle::DocHtmlDescTitle ( DocParser parser,
DocNode parent,
const HtmlAttribList attribs 
)
inline

在文件 docparser.h976 行定义.

引用了 DocNode::m_parent , 以及 DocNode::parent().

成员函数说明

◆ attribs()

const HtmlAttribList& DocHtmlDescTitle::attribs ( ) const
inline

在文件 docparser.h979 行定义.

979 { return m_attribs; }

引用了 m_attribs.

被这些函数引用 HtmlDocVisitor::visitPre().

◆ kind()

Kind DocHtmlDescTitle::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h978 行定义.

978 { return Kind_HtmlDescTitle; }

引用了 DocNode::Kind_HtmlDescTitle.

◆ parse()

int DocHtmlDescTitle::parse ( )

在文件 docparser.cpp3744 行定义.

3745 {
3746  int retval=0;
3747  auto ns = AutoNodeStack(m_parser,this);
3748  DBG(("DocHtmlDescTitle::parse() start\n"));
3749 
3750  int tok;
3751  while ((tok=m_parser.tokenizer.lex()))
3752  {
3753  if (!m_parser.defaultHandleToken(this,tok,m_children))
3754  {
3755  const char *cmd_start = "\\";
3756  switch (tok)
3757  {
3758  case TK_COMMAND_AT:
3759  cmd_start = "@";
3760  // fall through
3761  case TK_COMMAND_BS:
3762  {
3763  QCString cmdName=m_parser.context.token->name;
3764  bool isJavaLink=FALSE;
3765  switch (Mappers::cmdMapper->map(cmdName))
3766  {
3767  case CMD_REF:
3768  {
3769  tok=m_parser.tokenizer.lex();
3770  if (tok!=TK_WHITESPACE)
3771  {
3772  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected whitespace after \\%s command",
3774  }
3775  else
3776  {
3778  tok=m_parser.tokenizer.lex(); // get the reference id
3779  if (tok!=TK_WORD)
3780  {
3781  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unexpected token %s as the argument of \\%s command",
3782  DocTokenizer::tokToString(tok),qPrint(cmdName));
3783  }
3784  else
3785  {
3787  m_children.push_back(std::unique_ptr<DocRef>(ref));
3788  ref->parse();
3789  }
3791  }
3792  }
3793  break;
3794  case CMD_JAVALINK:
3795  isJavaLink=TRUE;
3796  // fall through
3797  case CMD_LINK:
3798  {
3799  tok=m_parser.tokenizer.lex();
3800  if (tok!=TK_WHITESPACE)
3801  {
3802  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected whitespace after \\%s command",
3803  qPrint(cmdName));
3804  }
3805  else
3806  {
3808  tok=m_parser.tokenizer.lex();
3809  if (tok!=TK_WORD)
3810  {
3811  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unexpected token %s as the argument of \\%s command",
3812  DocTokenizer::tokToString(tok),qPrint(cmdName));
3813  }
3814  else
3815  {
3817  DocLink *lnk = new DocLink(m_parser,this,m_parser.context.token->name);
3818  m_children.push_back(std::unique_ptr<DocLink>(lnk));
3819  QCString leftOver = lnk->parse(isJavaLink);
3820  if (!leftOver.isEmpty())
3821  {
3822  m_children.push_back(std::make_unique<DocWord>(m_parser,this,leftOver));
3823  }
3824  }
3825  }
3826  }
3827 
3828  break;
3829  default:
3830  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Illegal command %s found as part of a <dt> tag",
3831  qPrint(cmd_start + m_parser.context.token->name));
3832  }
3833  }
3834  break;
3835  case TK_SYMBOL:
3836  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unsupported symbol \\%s found as part of a <dt> tag",
3838  break;
3839  case TK_HTMLTAG:
3840  {
3842  if (tagId==HTML_DD && !m_parser.context.token->endTag) // found <dd> tag
3843  {
3844  retval = RetVal_DescData;
3845  goto endtitle;
3846  }
3847  else if (tagId==HTML_DT && m_parser.context.token->endTag)
3848  {
3849  // ignore </dt> tag.
3850  }
3851  else if (tagId==HTML_DT)
3852  {
3853  // missing <dt> tag.
3854  retval = RetVal_DescTitle;
3855  goto endtitle;
3856  }
3857  else if (tagId==HTML_DL && m_parser.context.token->endTag)
3858  {
3859  retval=RetVal_EndDesc;
3860  goto endtitle;
3861  }
3862  else if (tagId==HTML_A)
3863  {
3864  if (!m_parser.context.token->endTag)
3865  {
3867  }
3868  }
3869  else
3870  {
3871  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected html tag <%s%s> found within <dt> context",
3873  }
3874  }
3875  break;
3876  default:
3877  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected token %s found as part of a <dt> tag",
3879  break;
3880  }
3881  }
3882  }
3883  if (tok==0)
3884  {
3885  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"Unexpected end of comment while inside"
3886  " <dt> tag");
3887  }
3888 endtitle:
3890  DBG(("DocHtmlDescTitle::parse() end\n"));
3891  return retval;
3892 }

引用了 TokenInfo::attribs, CMD_JAVALINK, CMD_LINK, CMD_REF, Mappers::cmdMapper, DocParserContext::context, DocParser::context, DBG, DocParser::defaultHandleToken(), TokenInfo::endTag, FALSE, DocParserContext::fileName, DocTokenizer::getLineNr(), DocParser::handleAHref(), DocParser::handlePendingStyleCommands(), HTML_A, HTML_DD, HTML_DL, HTML_DT, Mappers::htmlTagMapper, QCString::isEmpty(), DocTokenizer::lex(), CompAccept< DocHtmlDescTitle >::m_children, DocNode::m_parser, Mapper::map(), TokenInfo::name, DocLink::parse(), DocRef::parse(), qPrint(), RetVal_DescData, RetVal_DescTitle, RetVal_EndDesc, DocTokenizer::setStateLink(), DocTokenizer::setStatePara(), DocTokenizer::setStateRef(), TK_COMMAND_AT, TK_COMMAND_BS, TK_HTMLTAG, TK_SYMBOL, TK_WHITESPACE, TK_WORD, DocParserContext::token, DocParser::tokenizer, DocTokenizer::tokToString(), TRUE , 以及 warn_doc_error().

被这些函数引用 DocHtmlDescList::parse().

类成员变量说明

◆ m_attribs

HtmlAttribList DocHtmlDescTitle::m_attribs
private

在文件 docparser.h983 行定义.

被这些函数引用 attribs().


该类的文档由以下文件生成:
TokenInfo::endTag
bool endTag
Definition: doctokenizer.h:100
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
DocTokenizer::tokToString
static const char * tokToString(int token)
TK_WORD
@ TK_WORD
Definition: doctokenizer.h:46
CompAccept< DocHtmlDescTitle >
RetVal_EndDesc
@ RetVal_EndDesc
Definition: doctokenizer.h:71
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
CMD_LINK
@ CMD_LINK
Definition: cmdmapper.h:69
DocNode::Kind_HtmlDescTitle
@ Kind_HtmlDescTitle
Definition: docparser.h:120
DocParser::handlePendingStyleCommands
void handlePendingStyleCommands(DocNode *parent, DocNodeList &children)
Definition: docparser.cpp:912
TokenInfo::attribs
HtmlAttribList attribs
Definition: doctokenizer.h:99
DocParser::tokenizer
DocTokenizer tokenizer
Definition: docparser.cpp:176
warn_doc_error
void warn_doc_error(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:186
DocHtmlDescTitle::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:983
DocParser::handleAHref
int handleAHref(DocNode *parent, DocNodeList &children, const HtmlAttribList &tagHtmlAttribs)
Definition: docparser.cpp:937
TK_WHITESPACE
@ TK_WHITESPACE
Definition: doctokenizer.h:48
DocRef::parse
void parse()
Definition: docparser.cpp:2504
TK_SYMBOL
@ TK_SYMBOL
Definition: doctokenizer.h:53
DocHtmlDescTitle::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:979
TK_COMMAND_AT
@ TK_COMMAND_AT
Definition: doctokenizer.h:51
DocTokenizer::setStateLink
void setStateLink()
DocParser::defaultHandleToken
bool defaultHandleToken(DocNode *parent, int tok, DocNodeList &children, bool handleWord=TRUE)
Definition: docparser.cpp:1277
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
HTML_DL
@ HTML_DL
Definition: cmdmapper.h:168
RetVal_DescData
@ RetVal_DescData
Definition: doctokenizer.h:69
HTML_DD
@ HTML_DD
Definition: cmdmapper.h:170
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
HTML_DT
@ HTML_DT
Definition: cmdmapper.h:169
DocParserContext::context
QCString context
Definition: docparser.cpp:102
DocTokenizer::getLineNr
int getLineNr(void)
DocRef
Node representing a reference to some item
Definition: docparser.h:891
TRUE
#define TRUE
Definition: qcstring.h:36
CMD_REF
@ CMD_REF
Definition: cmdmapper.h:76
CMD_JAVALINK
@ CMD_JAVALINK
Definition: cmdmapper.h:92
HTML_A
@ HTML_A
Definition: cmdmapper.h:172
DocTokenizer::setStateRef
void setStateRef()
TK_HTMLTAG
@ TK_HTMLTAG
Command starting with @
Definition: doctokenizer.h:52
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
RetVal_DescTitle
@ RetVal_DescTitle
Definition: doctokenizer.h:70
Mappers::cmdMapper
static Mapper * cmdMapper
Definition: cmdmapper.h:234
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
DocTokenizer::lex
int lex()
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocTokenizer::setStatePara
void setStatePara()
DBG
#define DBG(x)
Definition: docparser.cpp:58
CompAccept< DocHtmlDescTitle >::m_children
DocNodeList m_children
Definition: docparser.h:211
TK_COMMAND_BS
@ TK_COMMAND_BS
Definition: doctokenizer.h:57
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108