Doxygen
DocParamList类 参考

Node representing a parameter list. 更多...

#include <docparser.h>

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

Public 成员函数

 DocParamList (DocParser &parser, DocNode *parent, DocParamSect::Type t, DocParamSect::Direction d)
 
virtual ~DocParamList ()
 
Kind kind () const override
 
DocNodeListparameters ()
 
DocNodeListparamTypes ()
 
DocParamSect::Type type () const
 
DocParamSect::Direction direction () const
 
void markFirst (bool b=TRUE)
 
void markLast (bool b=TRUE)
 
bool isFirst () const
 
bool isLast () const
 
void accept (DocVisitor *v) override
 
int parse (const QCString &cmdName)
 
int parseXml (const QCString &paramName)
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 属性

DocParaList m_paragraphs
 
DocNodeList m_params
 
DocNodeList m_paramTypes
 
DocParamSect::Type m_type = DocParamSect::Unknown
 
DocParamSect::Direction m_dir = DocParamSect::Unspecified
 
bool m_isFirst = false
 
bool m_isLast = false
 

额外继承的成员函数

- 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 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a parameter list.

在文件 docparser.h1228 行定义.

构造及析构函数说明

◆ DocParamList()

DocParamList::DocParamList ( DocParser parser,
DocNode parent,
DocParamSect::Type  t,
DocParamSect::Direction  d 
)
inline

在文件 docparser.h1231 行定义.

1232  : DocNode(parser), m_type(t), m_dir(d)
1233  {
1234  m_parent = parent;
1235  }

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

◆ ~DocParamList()

virtual DocParamList::~DocParamList ( )
inlinevirtual

在文件 docparser.h1236 行定义.

1236 { }

成员函数说明

◆ accept()

void DocParamList::accept ( DocVisitor v)
inlineoverridevirtual

Acceptor function for node visitors. Part of the visitor pattern.

参数
vAbstract visitor.

实现了 DocNode.

在文件 docparser.h1246 行定义.

1247  {
1248  v->visitPre(this);
1249  for (const auto &n : m_paragraphs) n->accept(v);
1250  v->visitPost(this);
1251  }

引用了 m_paragraphs, DocVisitor::visitPost() , 以及 DocVisitor::visitPre().

◆ direction()

DocParamSect::Direction DocParamList::direction ( ) const
inline

◆ isFirst()

bool DocParamList::isFirst ( ) const
inline

在文件 docparser.h1244 行定义.

1244 { return m_isFirst; }

引用了 m_isFirst.

◆ isLast()

bool DocParamList::isLast ( ) const
inline

在文件 docparser.h1245 行定义.

1245 { return m_isLast; }

引用了 m_isLast.

被这些函数引用 ManDocVisitor::visitPost().

◆ kind()

Kind DocParamList::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1237 行定义.

1237 { return Kind_ParamList; }

引用了 DocNode::Kind_ParamList.

◆ markFirst()

void DocParamList::markFirst ( bool  b = TRUE)
inline

在文件 docparser.h1242 行定义.

1242 { m_isFirst=b; }

引用了 m_isFirst.

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

◆ markLast()

void DocParamList::markLast ( bool  b = TRUE)
inline

在文件 docparser.h1243 行定义.

1243 { m_isLast=b; }

引用了 m_isLast.

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

◆ parameters()

◆ paramTypes()

DocNodeList& DocParamList::paramTypes ( )
inline

◆ parse()

int DocParamList::parse ( const QCString cmdName)

在文件 docparser.cpp4528 行定义.

4529 {
4530  int retval=RetVal_OK;
4531  DBG(("DocParamList::parse() start\n"));
4532  auto ns = AutoNodeStack(m_parser,this);
4533  DocPara *par=0;
4534  QCString saveCmdName = cmdName;
4535 
4536  int tok=m_parser.tokenizer.lex();
4537  if (tok!=TK_WHITESPACE)
4538  {
4539  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"expected whitespace after \\%s command",
4540  qPrint(saveCmdName));
4541  retval=RetVal_EndParBlock;
4542  goto endparamlist;
4543  }
4545  tok=m_parser.tokenizer.lex();
4546  while (tok==TK_WORD) /* there is a parameter name */
4547  {
4549  {
4550  int typeSeparator = m_parser.context.token->name.find('#'); // explicit type position
4551  if (typeSeparator!=-1)
4552  {
4554  m_parser.context.token->name = m_parser.context.token->name.mid(typeSeparator+1);
4557  ((DocParamSect*)parent())->m_hasTypeSpecifier=TRUE;
4558  }
4559  else
4560  {
4563  }
4564  }
4565  else if (m_type==DocParamSect::RetVal)
4566  {
4569  }
4570  //m_params.append(m_parser.context.token->name);
4572  tok=m_parser.tokenizer.lex();
4573  }
4575  if (tok==0) /* premature end of comment block */
4576  {
4577  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unexpected end of comment block while parsing the "
4578  "argument of command %s",qPrint(saveCmdName));
4579  retval=RetVal_EndParBlock;
4580  goto endparamlist;
4581  }
4582  if (tok!=TK_WHITESPACE) /* premature end of comment block */
4583  {
4584  if (tok!=TK_NEWPARA) /* empty param description */
4585  {
4586  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unexpected token %s in comment block while parsing the "
4587  "argument of command %s",DocTokenizer::tokToString(tok),qPrint(saveCmdName));
4588  }
4589  retval=RetVal_EndParBlock;
4590  goto endparamlist;
4591  }
4592 
4593  par = new DocPara(m_parser,this);
4594  m_paragraphs.push_back(std::unique_ptr<DocPara>(par));
4595  retval = par->parse();
4596  par->markFirst();
4597  par->markLast();
4598 
4599 endparamlist:
4600  DBG(("DocParamList::parse() end retval=%d\n",retval));
4601  return retval;
4602 }

引用了 DocParser::checkArgumentName(), DocParser::checkRetvalName(), DocParser::context, DBG, DocParserContext::fileName, QCString::find(), DocTokenizer::getLineNr(), DocParser::handleLinkedWord(), DocParser::handleParameterType(), DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, QCString::left(), DocTokenizer::lex(), m_paragraphs, m_params, m_paramTypes, DocNode::m_parser, m_type, DocPara::markFirst(), DocPara::markLast(), QCString::mid(), TokenInfo::name, DocParamSect::Param, DocNode::parent(), DocPara::parse(), qPrint(), DocParamSect::RetVal, RetVal_EndParBlock, RetVal_OK, DocTokenizer::setStatePara(), DocTokenizer::setStateParam(), TK_NEWPARA, TK_WHITESPACE, TK_WORD, DocParserContext::token, DocParser::tokenizer, DocTokenizer::tokToString(), TRUE , 以及 warn_doc_error().

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

◆ parseXml()

int DocParamList::parseXml ( const QCString paramName)

在文件 docparser.cpp4604 行定义.

4605 {
4606  int retval=RetVal_OK;
4607  DBG(("DocParamList::parseXml() start\n"));
4608  auto ns = AutoNodeStack(m_parser,this);
4609 
4610  m_parser.context.token->name = paramName;
4612  {
4615  }
4616  else if (m_type==DocParamSect::RetVal)
4617  {
4620  }
4621 
4623 
4624  do
4625  {
4626  DocPara *par = new DocPara(m_parser,this);
4627  retval = par->parse();
4628  if (par->isEmpty()) // avoid adding an empty paragraph for the whitespace
4629  // after </para> and before </param>
4630  {
4631  delete par;
4632  break;
4633  }
4634  else // append the paragraph to the list
4635  {
4636  if (m_paragraphs.empty())
4637  {
4638  par->markFirst();
4639  }
4640  else
4641  {
4642  m_paragraphs.back()->markLast(FALSE);
4643  }
4644  par->markLast();
4645  m_paragraphs.push_back(std::unique_ptr<DocPara>(par));
4646  }
4647 
4648  if (retval == 0) break;
4649 
4650  } while (retval==RetVal_CloseXml &&
4654 
4655 
4656  if (retval==0) /* premature end of comment block */
4657  {
4658  warn_doc_error(m_parser.context.fileName,m_parser.tokenizer.getLineNr(),"unterminated param or exception tag");
4659  }
4660  else
4661  {
4662  retval=RetVal_OK;
4663  }
4664 
4665 
4666  DBG(("DocParamList::parse() end retval=%d\n",retval));
4667  return retval;
4668 }

引用了 DocParser::checkArgumentName(), DocParser::checkRetvalName(), DocParser::context, DBG, FALSE, DocParserContext::fileName, DocTokenizer::getLineNr(), DocParser::handleLinkedWord(), DocParserContext::hasParamCommand, DocParserContext::hasReturnCommand, Mappers::htmlTagMapper, DocPara::isEmpty(), m_paragraphs, m_params, DocNode::m_parser, m_type, Mapper::map(), DocPara::markFirst(), DocPara::markLast(), TokenInfo::name, DocParamSect::Param, DocPara::parse(), DocParamSect::RetVal, RetVal_CloseXml, RetVal_OK, DocParserContext::token, DocParser::tokenizer, TRUE, warn_doc_error(), XML_EXCEPTION, XML_PARAM , 以及 XML_TYPEPARAM.

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

◆ type()

DocParamSect::Type DocParamList::type ( ) const
inline

在文件 docparser.h1240 行定义.

1240 { return m_type; }

引用了 m_type.

类成员变量说明

◆ m_dir

DocParamSect::Direction DocParamList::m_dir = DocParamSect::Unspecified
private

在文件 docparser.h1260 行定义.

被这些函数引用 direction().

◆ m_isFirst

bool DocParamList::m_isFirst = false
private

在文件 docparser.h1261 行定义.

被这些函数引用 isFirst() , 以及 markFirst().

◆ m_isLast

bool DocParamList::m_isLast = false
private

在文件 docparser.h1262 行定义.

被这些函数引用 isLast() , 以及 markLast().

◆ m_paragraphs

DocParaList DocParamList::m_paragraphs
private

在文件 docparser.h1256 行定义.

被这些函数引用 accept(), parse() , 以及 parseXml().

◆ m_params

DocNodeList DocParamList::m_params
private

在文件 docparser.h1257 行定义.

被这些函数引用 parameters(), parse() , 以及 parseXml().

◆ m_paramTypes

DocNodeList DocParamList::m_paramTypes
private

在文件 docparser.h1258 行定义.

被这些函数引用 paramTypes() , 以及 parse().

◆ m_type

DocParamSect::Type DocParamList::m_type = DocParamSect::Unknown
private

在文件 docparser.h1259 行定义.

被这些函数引用 parse(), parseXml() , 以及 type().


该类的文档由以下文件生成:
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
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
DocParser::handleParameterType
void handleParameterType(DocNode *parent, DocNodeList &children, const QCString &paramTypes)
Definition: docparser.cpp:1127
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
RetVal_CloseXml
@ RetVal_CloseXml
Definition: doctokenizer.h:78
DocPara::markFirst
void markFirst(bool v=TRUE)
Definition: docparser.h:1186
DocParser::handleLinkedWord
void handleLinkedWord(DocNode *parent, DocNodeList &children, bool ignoreAutoLinkFlag=FALSE)
Definition: docparser.cpp:1015
DocTokenizer::setStateParam
void setStateParam()
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
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
DocParserContext::hasReturnCommand
bool hasReturnCommand
Definition: docparser.cpp:114
TK_WHITESPACE
@ TK_WHITESPACE
Definition: doctokenizer.h:48
DocParamList::m_dir
DocParamSect::Direction m_dir
Definition: docparser.h:1260
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
DocParserContext::fileName
QCString fileName
Definition: docparser.cpp:110
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
DocParser::checkArgumentName
void checkArgumentName()
Definition: docparser.cpp:380
DocPara::isEmpty
bool isEmpty() const
Definition: docparser.h:1185
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
DocParamList::m_paragraphs
DocParaList m_paragraphs
Definition: docparser.h:1256
DocTokenizer::getLineNr
int getLineNr(void)
TRUE
#define TRUE
Definition: qcstring.h:36
DocParamSect
Node representing a parameter section
Definition: docparser.h:1150
DocParamList::m_type
DocParamSect::Type m_type
Definition: docparser.h:1259
DocParamList::m_params
DocNodeList m_params
Definition: docparser.h:1257
DocNode::Kind_ParamList
@ Kind_ParamList
Definition: docparser.h:144
DocPara::markLast
void markLast(bool v=TRUE)
Definition: docparser.h:1187
DocPara::parse
int parse()
Definition: docparser.cpp:6579
RetVal_EndParBlock
@ RetVal_EndParBlock
Definition: doctokenizer.h:82
DocParamList::m_paramTypes
DocNodeList m_paramTypes
Definition: docparser.h:1258
XML_TYPEPARAM
@ XML_TYPEPARAM
Definition: cmdmapper.h:211
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
DocVisitor::visitPost
virtual void visitPost(DocAutoList *)=0
XML_PARAM
@ XML_PARAM
Definition: cmdmapper.h:202
DocParamSect::Param
@ Param
Definition: docparser.h:1156
DocParamList::m_isFirst
bool m_isFirst
Definition: docparser.h:1261
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
DocParser::checkRetvalName
void checkRetvalName()
Definition: docparser.cpp:445
DocParserContext::hasParamCommand
bool hasParamCommand
Definition: docparser.cpp:113
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
DocTokenizer::lex
int lex()
DocParamSect::RetVal
@ RetVal
Definition: docparser.h:1156
TK_NEWPARA
@ TK_NEWPARA
Definition: doctokenizer.h:54
DocParamList::m_isLast
bool m_isLast
Definition: docparser.h:1262
DocNode::DocNode
DocNode(DocParser &parser)
Definition: docparser.h:157
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocTokenizer::setStatePara
void setStatePara()
DBG
#define DBG(x)
Definition: docparser.cpp:58
XML_EXCEPTION
@ XML_EXCEPTION
Definition: cmdmapper.h:196
DocVisitor::visitPre
virtual void visitPre(DocAutoList *)=0
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