Public Member Functions | Private Attributes | List of all members
DocParamList Class Reference

#include <docparser.h>

Inheritance diagram for DocParamList:
DocNode

Public Member Functions

 DocParamList (DocNode *parent, DocParamSect::Type t, DocParamSect::Direction d)
 
virtual ~DocParamList ()
 
Kind kind () const
 
const QList< DocNode > & parameters ()
 
const QList< DocNode > & paramTypes ()
 
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)
 
int parse (const QCString &cmdName)
 
int parseXml (const QCString &paramName)
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

QList< DocParam_paragraphs
 
QList< DocNodem_params
 
QList< DocNodem_paramTypes
 
DocParamSect::Type m_type
 
DocParamSect::Direction m_dir
 
bool m_isFirst
 
bool m_isLast
 

Additional Inherited Members

- Public Types inherited from 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
}
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 
- Protected Attributes inherited from DocNode
DocNodem_parent
 

Detailed Description

Node representing a parameter list.

Definition at line 1157 of file docparser.h.

Constructor & Destructor Documentation

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

Definition at line 1160 of file docparser.h.

1165  m_parent = parent;
1166  }
DocNode * parent() const
Definition: docparser.h:147
DocParamSect::Type m_type
Definition: docparser.h:1192
DocNode * m_parent
Definition: docparser.h:163
QList< DocNode > m_params
Definition: docparser.h:1190
DocParamSect::Direction m_dir
Definition: docparser.h:1193
QList< DocPara > m_paragraphs
Definition: docparser.h:1189
bool m_isFirst
Definition: docparser.h:1194
QList< DocNode > m_paramTypes
Definition: docparser.h:1191
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
virtual DocParamList::~DocParamList ( )
inlinevirtual

Definition at line 1167 of file docparser.h.

1167 { }

Member Function Documentation

void DocParamList::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 1177 of file docparser.h.

1178  {
1179  v->visitPre(this);
1181  DocNode *n;
1182  for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
1183  v->visitPost(this);
1184  }
def cli(ctx)
Definition: main.py:7
std::void_t< T > n
virtual void visitPre(DocAutoList *)=0
QList< DocPara > m_paragraphs
Definition: docparser.h:1189
virtual void visitPost(DocAutoList *)=0
virtual void accept(DocVisitor *v)=0
DocParamSect::Direction DocParamList::direction ( ) const
inline

Definition at line 1172 of file docparser.h.

1172 { return m_dir; }
DocParamSect::Direction m_dir
Definition: docparser.h:1193
bool DocParamList::isFirst ( ) const
inline

Definition at line 1175 of file docparser.h.

1175 { return m_isFirst; }
bool m_isFirst
Definition: docparser.h:1194
bool DocParamList::isLast ( ) const
inline

Definition at line 1176 of file docparser.h.

1176 { return m_isLast; }
Kind DocParamList::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 1168 of file docparser.h.

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

Definition at line 1173 of file docparser.h.

1173 { m_isFirst=b; }
static bool * b
Definition: config.cpp:1043
bool m_isFirst
Definition: docparser.h:1194
void DocParamList::markLast ( bool  b = TRUE)
inline

Definition at line 1174 of file docparser.h.

1174 { m_isLast=b; }
static bool * b
Definition: config.cpp:1043
const QList<DocNode>& DocParamList::parameters ( )
inline

Definition at line 1169 of file docparser.h.

1169 { return m_params; }
QList< DocNode > m_params
Definition: docparser.h:1190
const QList<DocNode>& DocParamList::paramTypes ( )
inline

Definition at line 1170 of file docparser.h.

1170 { return m_paramTypes; }
QList< DocNode > m_paramTypes
Definition: docparser.h:1191
int DocParamList::parse ( const QCString cmdName)

Definition at line 4650 of file docparser.cpp.

4651 {
4652  int retval=RetVal_OK;
4653  DBG(("DocParamList::parse() start\n"));
4654  g_nodeStack.push(this);
4655  DocPara *par=0;
4656  QCString saveCmdName = cmdName;
4657 
4658  int tok=doctokenizerYYlex();
4659  if (tok!=TK_WHITESPACE)
4660  {
4661  warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
4662  qPrint(cmdName));
4663  retval=0;
4664  goto endparamlist;
4665  }
4667  tok=doctokenizerYYlex();
4668  while (tok==TK_WORD) /* there is a parameter name */
4669  {
4671  {
4672  int typeSeparator = g_token->name.find('#'); // explicit type position
4673  if (typeSeparator!=-1)
4674  {
4675  handleParameterType(this,m_paramTypes,g_token->name.left(typeSeparator));
4676  g_token->name = g_token->name.mid(typeSeparator+1);
4679  ((DocParamSect*)parent())->m_hasTypeSpecifier=TRUE;
4680  }
4681  else
4682  {
4685  }
4686  }
4687  else if (m_type==DocParamSect::RetVal)
4688  {
4691  }
4692  //m_params.append(g_token->name);
4693  handleLinkedWord(this,m_params);
4694  tok=doctokenizerYYlex();
4695  }
4697  if (tok==0) /* premature end of comment block */
4698  {
4699  warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected end of comment block while parsing the "
4700  "argument of command %s",qPrint(cmdName));
4701  retval=0;
4702  goto endparamlist;
4703  }
4704  if (tok!=TK_WHITESPACE) /* premature end of comment block */
4705  {
4706  warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token in comment block while parsing the "
4707  "argument of command %s",qPrint(saveCmdName));
4708  retval=0;
4709  goto endparamlist;
4710  }
4711 
4712  par = new DocPara(this);
4713  m_paragraphs.append(par);
4714  retval = par->parse();
4715  par->markFirst();
4716  par->markLast();
4717 
4718 endparamlist:
4719  DBG(("DocParamList::parse() end retval=%d\n",retval));
4720  DocNode *n=g_nodeStack.pop();
4721  ASSERT(n==this);
4722  return retval;
4723 }
DocNode * parent() const
Definition: docparser.h:147
static QCString g_fileName
Definition: docparser.cpp:95
DocParamSect::Type m_type
Definition: docparser.h:1192
void doctokenizerYYsetStatePara()
static void handleParameterType(DocNode *parent, QList< DocNode > &children, const QCString &paramTypes)
Definition: docparser.cpp:1181
void append(const type *d)
Definition: qlist.h:73
#define DBG(x)
Definition: docparser.cpp:59
int doctokenizerYYlineno
const bool FALSE
Definition: qglobal.h:370
void warn_doc_error(const char *file, int line, const char *fmt,...)
Definition: message.cpp:210
void markFirst(bool v=TRUE)
Definition: docparser.h:1122
static bool g_hasReturnCommand
Definition: docparser.cpp:99
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
static void handleLinkedWord(DocNode *parent, QList< DocNode > &children, bool ignoreAutoLinkFlag=FALSE)
Definition: docparser.cpp:1054
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
int doctokenizerYYlex(void)
void push(const type *d)
Definition: qstack.h:58
static bool g_hasParamCommand
Definition: docparser.cpp:98
std::void_t< T > n
void markLast(bool v=TRUE)
Definition: docparser.h:1123
int parse()
Definition: docparser.cpp:6348
QList< DocNode > m_params
Definition: docparser.h:1190
static void checkArgumentName(const QCString &name, bool isParam)
Definition: docparser.cpp:386
type * pop()
Definition: qstack.h:59
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
QList< DocPara > m_paragraphs
Definition: docparser.h:1189
void doctokenizerYYsetStateParam()
QCString name
Definition: doctokenizer.h:77
QList< DocNode > m_paramTypes
Definition: docparser.h:1191
const char * qPrint(const char *s)
Definition: qcstring.h:797
const bool TRUE
Definition: qglobal.h:371
#define ASSERT(x)
Definition: qglobal.h:590
int DocParamList::parseXml ( const QCString paramName)

Definition at line 4725 of file docparser.cpp.

4726 {
4727  int retval=RetVal_OK;
4728  DBG(("DocParamList::parseXml() start\n"));
4729  g_nodeStack.push(this);
4730 
4731  g_token->name = paramName;
4733  {
4736  }
4737  else if (m_type==DocParamSect::RetVal)
4738  {
4741  }
4742 
4743  handleLinkedWord(this,m_params);
4744 
4745  do
4746  {
4747  DocPara *par = new DocPara(this);
4748  retval = par->parse();
4749  if (par->isEmpty()) // avoid adding an empty paragraph for the whitespace
4750  // after </para> and before </param>
4751  {
4752  delete par;
4753  break;
4754  }
4755  else // append the paragraph to the list
4756  {
4757  if (m_paragraphs.isEmpty())
4758  {
4759  par->markFirst();
4760  }
4761  else
4762  {
4764  }
4765  par->markLast();
4766  m_paragraphs.append(par);
4767  }
4768 
4769  if (retval == 0) break;
4770 
4771  } while (retval==RetVal_CloseXml &&
4775 
4776 
4777  if (retval==0) /* premature end of comment block */
4778  {
4779  warn_doc_error(g_fileName,doctokenizerYYlineno,"unterminated param or exception tag");
4780  }
4781  else
4782  {
4783  retval=RetVal_OK;
4784  }
4785 
4786 
4787  DBG(("DocParamList::parse() end retval=%d\n",retval));
4788  DocNode *n=g_nodeStack.pop();
4789  ASSERT(n==this);
4790  return retval;
4791 }
static QCString g_fileName
Definition: docparser.cpp:95
DocParamSect::Type m_type
Definition: docparser.h:1192
void append(const type *d)
Definition: qlist.h:73
#define DBG(x)
Definition: docparser.cpp:59
int doctokenizerYYlineno
const bool FALSE
Definition: qglobal.h:370
void warn_doc_error(const char *file, int line, const char *fmt,...)
Definition: message.cpp:210
void markFirst(bool v=TRUE)
Definition: docparser.h:1122
static Mapper * htmlTagMapper
Definition: cmdmapper.h:220
static bool g_hasReturnCommand
Definition: docparser.cpp:99
static void handleLinkedWord(DocNode *parent, QList< DocNode > &children, bool ignoreAutoLinkFlag=FALSE)
Definition: docparser.cpp:1054
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
void push(const type *d)
Definition: qstack.h:58
type * getLast() const
Definition: qlist.h:96
static bool g_hasParamCommand
Definition: docparser.cpp:98
bool isEmpty() const
Definition: qlist.h:67
std::void_t< T > n
void markLast(bool v=TRUE)
Definition: docparser.h:1123
int parse()
Definition: docparser.cpp:6348
QList< DocNode > m_params
Definition: docparser.h:1190
static void checkArgumentName(const QCString &name, bool isParam)
Definition: docparser.cpp:386
int map(const char *n)
Definition: cmdmapper.cpp:225
type * pop()
Definition: qstack.h:59
QList< DocPara > m_paragraphs
Definition: docparser.h:1189
QCString name
Definition: doctokenizer.h:77
bool isEmpty() const
Definition: docparser.h:1120
const bool TRUE
Definition: qglobal.h:371
#define ASSERT(x)
Definition: qglobal.h:590
DocParamSect::Type DocParamList::type ( ) const
inline

Definition at line 1171 of file docparser.h.

1171 { return m_type; }
DocParamSect::Type m_type
Definition: docparser.h:1192

Member Data Documentation

DocParamSect::Direction DocParamList::m_dir
private

Definition at line 1193 of file docparser.h.

bool DocParamList::m_isFirst
private

Definition at line 1194 of file docparser.h.

bool DocParamList::m_isLast
private

Definition at line 1195 of file docparser.h.

QList<DocPara> DocParamList::m_paragraphs
private

Definition at line 1189 of file docparser.h.

QList<DocNode> DocParamList::m_params
private

Definition at line 1190 of file docparser.h.

QList<DocNode> DocParamList::m_paramTypes
private

Definition at line 1191 of file docparser.h.

DocParamSect::Type DocParamList::m_type
private

Definition at line 1192 of file docparser.h.


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