My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.

References m_paragraphs, m_params, m_paramTypes, DocNode::m_parent, and DocNode::parent().

: m_type(t), m_dir(d), m_isFirst(TRUE), m_isLast(TRUE)
{ m_paragraphs.setAutoDelete(TRUE);
m_params.setAutoDelete(TRUE);
m_paramTypes.setAutoDelete(TRUE);
}
virtual DocParamList::~DocParamList ( )
inlinevirtual

Definition at line 1167 of file docparser.h.

{ }

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.

References DocNode::accept(), m_paragraphs, DocVisitor::visitPost(), and DocVisitor::visitPre().

{
v->visitPre(this);
QListIterator<DocPara> cli(m_paragraphs);
DocNode *n;
for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
v->visitPost(this);
}
DocParamSect::Direction DocParamList::direction ( ) const
inline
bool DocParamList::isFirst ( ) const
inline

Definition at line 1175 of file docparser.h.

References m_isFirst.

{ return m_isFirst; }
bool DocParamList::isLast ( ) const
inline

Definition at line 1176 of file docparser.h.

References m_isLast.

Referenced by ManDocVisitor::visitPost().

{ 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.

References DocNode::Kind_ParamList.

{ return Kind_ParamList; }
void DocParamList::markFirst ( bool  b = TRUE)
inline

Definition at line 1173 of file docparser.h.

References m_isFirst.

Referenced by DocParamSect::parse().

{ m_isFirst=b; }
void DocParamList::markLast ( bool  b = TRUE)
inline

Definition at line 1174 of file docparser.h.

References m_isLast.

Referenced by DocParamSect::parse().

{ m_isLast=b; }
const QList<DocNode>& DocParamList::parameters ( )
inline
const QList<DocNode>& DocParamList::paramTypes ( )
inline
int DocParamList::parse ( const QCString &  cmdName)

Definition at line 4665 of file docparser.cpp.

References checkArgumentName(), DBG, doctokenizerYYlex(), doctokenizerYYlineno, doctokenizerYYsetStatePara(), doctokenizerYYsetStateParam(), g_fileName, g_hasParamCommand, g_hasReturnCommand, g_nodeStack, g_token, handleLinkedWord(), handleParameterType(), m_paragraphs, m_params, m_paramTypes, m_type, DocPara::markFirst(), DocPara::markLast(), TokenInfo::name, DocParamSect::Param, DocNode::parent(), DocPara::parse(), DocParamSect::RetVal, RetVal_OK, TK_WHITESPACE, TK_WORD, and warn_doc_error().

Referenced by DocParamSect::parse().

{
int retval=RetVal_OK;
DBG(("DocParamList::parse() start\n"));
g_nodeStack.push(this);
DocPara *par=0;
QCString saveCmdName = cmdName;
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
qPrint(cmdName));
retval=0;
goto endparamlist;
}
while (tok==TK_WORD) /* there is a parameter name */
{
{
int typeSeparator = g_token->name.find('#'); // explicit type position
if (typeSeparator!=-1)
{
handleParameterType(this,m_paramTypes,g_token->name.left(typeSeparator));
g_token->name = g_token->name.mid(typeSeparator+1);
((DocParamSect*)parent())->m_hasTypeSpecifier=TRUE;
}
else
{
}
}
{
}
//m_params.append(g_token->name);
}
if (tok==0) /* premature end of comment block */
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected end of comment block while parsing the "
"argument of command %s",qPrint(cmdName));
retval=0;
goto endparamlist;
}
if (tok!=TK_WHITESPACE) /* premature end of comment block */
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token in comment block while parsing the "
"argument of command %s",qPrint(saveCmdName));
retval=0;
goto endparamlist;
}
par = new DocPara(this);
m_paragraphs.append(par);
retval = par->parse();
par->markFirst();
par->markLast();
endparamlist:
DBG(("DocParamList::parse() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval;
}
int DocParamList::parseXml ( const QCString &  paramName)

Definition at line 4740 of file docparser.cpp.

References checkArgumentName(), DBG, doctokenizerYYlineno, g_fileName, g_hasParamCommand, g_hasReturnCommand, g_nodeStack, g_token, handleLinkedWord(), Mappers::htmlTagMapper, DocPara::isEmpty(), m_paragraphs, m_params, m_type, Mapper::map(), DocPara::markFirst(), DocPara::markLast(), TokenInfo::name, DocParamSect::Param, DocPara::parse(), DocParamSect::RetVal, RetVal_CloseXml, RetVal_OK, warn_doc_error(), XML_EXCEPTION, XML_PARAM, and XML_TYPEPARAM.

Referenced by DocParamSect::parse().

{
int retval=RetVal_OK;
DBG(("DocParamList::parseXml() start\n"));
g_nodeStack.push(this);
g_token->name = paramName;
{
}
{
}
do
{
DocPara *par = new DocPara(this);
retval = par->parse();
if (par->isEmpty()) // avoid adding an empty paragraph for the whitespace
// after </para> and before </param>
{
delete par;
break;
}
else // append the paragraph to the list
{
if (m_paragraphs.isEmpty())
{
par->markFirst();
}
else
{
m_paragraphs.getLast()->markLast(FALSE);
}
par->markLast();
m_paragraphs.append(par);
}
if (retval == 0) break;
} while (retval==RetVal_CloseXml &&
if (retval==0) /* premature end of comment block */
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"unterminated param or exception tag");
}
else
{
retval=RetVal_OK;
}
DBG(("DocParamList::parse() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval;
}
DocParamSect::Type DocParamList::type ( ) const
inline

Definition at line 1171 of file docparser.h.

References m_type.

{ return m_type; }

Member Data Documentation

DocParamSect::Direction DocParamList::m_dir
private

Definition at line 1193 of file docparser.h.

Referenced by direction().

bool DocParamList::m_isFirst
private

Definition at line 1194 of file docparser.h.

Referenced by isFirst(), and markFirst().

bool DocParamList::m_isLast
private

Definition at line 1195 of file docparser.h.

Referenced by isLast(), and markLast().

QList<DocPara> DocParamList::m_paragraphs
private

Definition at line 1189 of file docparser.h.

Referenced by accept(), DocParamList(), parse(), and parseXml().

QList<DocNode> DocParamList::m_params
private

Definition at line 1190 of file docparser.h.

Referenced by DocParamList(), parameters(), parse(), and parseXml().

QList<DocNode> DocParamList::m_paramTypes
private

Definition at line 1191 of file docparser.h.

Referenced by DocParamList(), paramTypes(), and parse().

DocParamSect::Type DocParamList::m_type
private

Definition at line 1192 of file docparser.h.

Referenced by parse(), parseXml(), and type().


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