My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
DocSimpleSect Class Reference

#include <docparser.h>

Inheritance diagram for DocSimpleSect:
CompAccept< DocSimpleSect > DocNode

Public Types

enum  Type {
  Unknown, See, Return, Author,
  Authors, Version, Since, Date,
  Note, Warning, Copyright, Pre,
  Post, Invar, Remark, Attention,
  User, Rcs
}
 
- 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
}
 

Public Member Functions

 DocSimpleSect (DocNode *parent, Type t)
 
virtual ~DocSimpleSect ()
 
Kind kind () const
 
Type type () const
 
QCString typeString () const
 
void accept (DocVisitor *v)
 
int parse (bool userTitle, bool needsSeparator)
 
int parseRcs ()
 
int parseXml ()
 
void appendLinkWord (const QCString &word)
 
- Public Member Functions inherited from CompAccept< DocSimpleSect >
 CompAccept ()
 
virtual ~CompAccept ()
 
void accept (DocSimpleSect *obj, DocVisitor *v)
 
const QList< DocNode > & children () const
 
QList< DocNode > & children ()
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

Type m_type
 
DocTitlem_title
 

Additional Inherited Members

- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 
- Protected Attributes inherited from CompAccept< DocSimpleSect >
QList< DocNodem_children
 
- Protected Attributes inherited from DocNode
DocNodem_parent
 

Detailed Description

Node representing a simple section

Definition at line 1046 of file docparser.h.

Member Enumeration Documentation

Enumerator
Unknown 
See 
Return 
Author 
Authors 
Version 
Since 
Date 
Note 
Warning 
Copyright 
Pre 
Post 
Invar 
Remark 
Attention 
User 
Rcs 

Definition at line 1049 of file docparser.h.

Constructor & Destructor Documentation

DocSimpleSect::DocSimpleSect ( DocNode parent,
Type  t 
)

Definition at line 4500 of file docparser.cpp.

References DocNode::m_parent, m_title, and DocNode::parent().

:
m_type(t)
{
m_title=0;
}
DocSimpleSect::~DocSimpleSect ( )
virtual

Definition at line 4507 of file docparser.cpp.

References m_title.

{
delete m_title;
}

Member Function Documentation

void DocSimpleSect::accept ( DocVisitor v)
virtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 4512 of file docparser.cpp.

References DocNode::accept(), DocTitle::accept(), CompAccept< DocSimpleSect >::m_children, m_title, DocVisitor::visitPost(), and DocVisitor::visitPre().

{
v->visitPre(this);
QListIterator<DocNode> cli(m_children);
DocNode *n;
for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
v->visitPost(this);
}
void DocSimpleSect::appendLinkWord ( const QCString &  word)

Definition at line 4615 of file docparser.cpp.

References g_inSeeBlock, DocPara::injectToken(), DocNode::Kind_Para, CompAccept< DocSimpleSect >::m_children, TK_LNKWORD, TK_WHITESPACE, and TK_WORD.

Referenced by DocPara::handleHtmlStartTag().

{
DocPara *p;
if (m_children.isEmpty() || m_children.getLast()->kind()!=DocNode::Kind_Para)
{
p = new DocPara(this);
m_children.append(p);
}
else
{
p = (DocPara *)m_children.getLast();
// Comma-seperate <seealso> links.
}
g_inSeeBlock=FALSE;
}
Kind DocSimpleSect::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 1056 of file docparser.h.

References DocNode::Kind_SimpleSect.

{ return Kind_SimpleSect; }
int DocSimpleSect::parse ( bool  userTitle,
bool  needsSeparator 
)

Definition at line 4522 of file docparser.cpp.

References DBG, g_nodeStack, DocNode::Kind_Para, CompAccept< DocSimpleSect >::m_children, m_title, DocPara::markFirst(), DocPara::markLast(), DocTitle::parse(), and DocPara::parse().

Referenced by DocPara::handleSimpleSection().

{
DBG(("DocSimpleSect::parse() start\n"));
g_nodeStack.push(this);
// handle case for user defined title
if (userTitle)
{
m_title = new DocTitle(this);
}
// add new paragraph as child
DocPara *par = new DocPara(this);
if (m_children.isEmpty())
{
par->markFirst();
}
else
{
ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
((DocPara *)m_children.getLast())->markLast(FALSE);
}
par->markLast();
if (needsSeparator) m_children.append(new DocSimpleSectSep(this));
m_children.append(par);
// parse the contents of the paragraph
int retval = par->parse();
DBG(("DocSimpleSect::parse() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec
}
int DocSimpleSect::parseRcs ( )

Definition at line 4558 of file docparser.cpp.

References DBG, docParserPopContext(), docParserPushContext(), g_nodeStack, g_token, internalValidatingParseDoc(), CompAccept< DocSimpleSect >::m_children, m_title, TokenInfo::name, DocTitle::parseFromString(), RetVal_OK, and TokenInfo::text.

Referenced by DocPara::parse().

{
DBG(("DocSimpleSect::parseRcs() start\n"));
g_nodeStack.push(this);
m_title = new DocTitle(this);
QCString text = g_token->text;
docParserPushContext(); // this will create a new g_token
docParserPopContext(); // this will restore the old g_token
DBG(("DocSimpleSect::parseRcs()\n"));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return RetVal_OK;
}
int DocSimpleSect::parseXml ( )

Definition at line 4577 of file docparser.cpp.

References DBG, g_nodeStack, DocNode::Kind_Para, CompAccept< DocSimpleSect >::m_children, DocPara::markFirst(), DocPara::markLast(), DocPara::parse(), RetVal_CloseXml, and RetVal_OK.

Referenced by DocPara::handleSimpleSection().

{
DBG(("DocSimpleSect::parse() start\n"));
g_nodeStack.push(this);
int retval = RetVal_OK;
for (;;)
{
// add new paragraph as child
DocPara *par = new DocPara(this);
if (m_children.isEmpty())
{
par->markFirst();
}
else
{
ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
((DocPara *)m_children.getLast())->markLast(FALSE);
}
par->markLast();
m_children.append(par);
// parse the contents of the paragraph
retval = par->parse();
if (retval == 0) break;
if (retval == RetVal_CloseXml)
{
retval = RetVal_OK;
break;
}
}
DBG(("DocSimpleSect::parseXml() end retval=%d\n",retval));
DocNode *n=g_nodeStack.pop();
ASSERT(n==this);
return retval;
}
Type DocSimpleSect::type ( ) const
inline
QCString DocSimpleSect::typeString ( ) const

Definition at line 4637 of file docparser.cpp.

References Attention, Author, Authors, Copyright, Date, Invar, m_type, Note, Post, Pre, Rcs, Remark, Return, See, Since, Unknown, User, Version, and Warning.

Referenced by HtmlDocVisitor::visitPre().

{
switch (m_type)
{
case Unknown: break;
case See: return "see";
case Return: return "return";
case Author: // fall through
case Authors: return "author";
case Version: return "version";
case Since: return "since";
case Date: return "date";
case Note: return "note";
case Warning: return "warning";
case Pre: return "pre";
case Post: return "post";
case Copyright: return "copyright";
case Invar: return "invariant";
case Remark: return "remark";
case Attention: return "attention";
case User: return "user";
case Rcs: return "rcs";
}
return "unknown";
}

Member Data Documentation

DocTitle* DocSimpleSect::m_title
private

Definition at line 1067 of file docparser.h.

Referenced by accept(), DocSimpleSect(), parse(), parseRcs(), and ~DocSimpleSect().

Type DocSimpleSect::m_type
private

Definition at line 1066 of file docparser.h.

Referenced by type(), and typeString().


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