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

#include <docparser.h>

Inheritance diagram for DocSection:
CompAccept< DocSection > DocNode

Public Member Functions

 DocSection (DocNode *parent, int level, const QCString &id)
 
Kind kind () const
 
int level () const
 
QCString title () const
 
QCString anchor () const
 
QCString id () const
 
QCString file () const
 
void accept (DocVisitor *v)
 
int parse ()
 
- Public Member Functions inherited from CompAccept< DocSection >
 CompAccept ()
 
virtual ~CompAccept ()
 
void accept (DocSection *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

int m_level
 
QCString m_id
 
QCString m_title
 
QCString m_anchor
 
QCString m_file
 

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 CompAccept< DocSection >
QList< DocNodem_children
 
- Protected Attributes inherited from DocNode
DocNodem_parent
 

Detailed Description

Node representing a normal section

Definition at line 936 of file docparser.h.

Constructor & Destructor Documentation

DocSection::DocSection ( DocNode parent,
int  level,
const QCString &  id 
)
inline

Definition at line 939 of file docparser.h.

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

Referenced by parse().

:
m_level(level), m_id(id) { m_parent = parent; }

Member Function Documentation

void DocSection::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 947 of file docparser.h.

References CompAccept< T >::accept().

QCString DocSection::anchor ( ) const
inline

Definition at line 944 of file docparser.h.

References m_anchor.

Referenced by DocbookDocVisitor::visitPre(), RTFDocVisitor::visitPre(), XmlDocVisitor::visitPre(), LatexDocVisitor::visitPre(), and HtmlDocVisitor::visitPre().

{ return m_anchor; }
QCString DocSection::file ( ) const
inline

Definition at line 946 of file docparser.h.

References m_file.

Referenced by DocbookDocVisitor::visitPre(), RTFDocVisitor::visitPre(), XmlDocVisitor::visitPre(), and LatexDocVisitor::visitPre().

{ return m_file; }
QCString DocSection::id ( ) const
inline

Definition at line 945 of file docparser.h.

References m_id.

{ return m_id; }
Kind DocSection::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 941 of file docparser.h.

References DocNode::Kind_Section.

{ return Kind_Section; }
int DocSection::level ( ) const
inline

Definition at line 942 of file docparser.h.

References m_level.

Referenced by parse(), XmlDocVisitor::visitPost(), PrintDocVisitor::visitPost(), RTFDocVisitor::visitPre(), ManDocVisitor::visitPre(), XmlDocVisitor::visitPre(), HtmlDocVisitor::visitPre(), LatexDocVisitor::visitPre(), PerlModDocVisitor::visitPre(), and PrintDocVisitor::visitPre().

{ return m_level; }
int DocSection::parse ( )

Definition at line 6707 of file docparser.cpp.

References SDict< T >::append(), DBG, DocSection(), doctokenizerYYlineno, SectionInfo::fileName, SDict< T >::find(), g_fileName, g_nodeStack, g_token, INTERNAL_ASSERT, DocPara::isEmpty(), SectionInfo::label, level(), m_anchor, CompAccept< DocSection >::m_children, m_file, m_id, m_level, m_title, DocPara::markFirst(), DocPara::markLast(), parse(), DocInternal::parse(), DocPara::parse(), RetVal_EndInternal, RetVal_Internal, RetVal_OK, RetVal_Paragraph, RetVal_Section, RetVal_Subsection, RetVal_Subsubsection, Doxygen::sectionDict, TokenInfo::sectionId, sectionLevelToName, Doxygen::subpageNestingLevel, SectionInfo::title, TK_LISTITEM, and warn_doc_error().

Referenced by parse(), DocInternal::parse(), and DocRoot::parse().

{
DBG(("DocSection::parse() start %s level=%d\n",qPrint(g_token->sectionId),m_level));
int retval=RetVal_OK;
g_nodeStack.push(this);
if (!m_id.isEmpty())
{
if (sec)
{
m_file = sec->fileName;
m_anchor = sec->label;
m_title = sec->title;
if (m_title.isEmpty()) m_title = sec->label;
{
}
}
}
// first parse any number of paragraphs
bool isFirst=TRUE;
DocPara *lastPar=0;
do
{
DocPara *par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
if (!par->isEmpty())
{
m_children.append(par);
lastPar=par;
}
else
{
delete par;
}
if (retval==TK_LISTITEM)
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found");
}
if (retval==RetVal_Internal)
{
DocInternal *in = new DocInternal(this);
m_children.append(in);
retval = in->parse(m_level+1);
if (retval==RetVal_EndInternal)
{
retval=RetVal_OK;
}
}
} while (retval!=0 &&
retval!=RetVal_Section &&
retval!=RetVal_Subsection &&
retval!=RetVal_Paragraph &&
);
if (lastPar) lastPar->markLast();
//printf("m_level=%d <-> %d\n",m_level,Doxygen::subpageNestingLevel);
{
// then parse any number of nested sections
while (retval==RetVal_Subsection) // more sections follow
{
//SectionInfo *sec=Doxygen::sectionDict[g_token->sectionId];
DocSection *s=new DocSection(this,
m_children.append(s);
retval = s->parse();
}
}
{
// then parse any number of nested sections
while (retval==RetVal_Subsubsection) // more sections follow
{
//SectionInfo *sec=Doxygen::sectionDict[g_token->sectionId];
DocSection *s=new DocSection(this,
m_children.append(s);
retval = s->parse();
}
}
else if (retval==RetVal_Paragraph && m_level==QMIN(5,Doxygen::subpageNestingLevel+3))
{
// then parse any number of nested sections
while (retval==RetVal_Paragraph) // more sections follow
{
//SectionInfo *sec=Doxygen::sectionDict[g_token->sectionId];
DocSection *s=new DocSection(this,
m_children.append(s);
retval = s->parse();
}
}
)
{
int level = (retval==RetVal_Subsubsection) ? 3 : 4;
warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected %s "
"command found inside %s!",
retval=0; // stop parsing
}
else
{
}
INTERNAL_ASSERT(retval==0 ||
retval==RetVal_Section ||
retval==RetVal_Subsection ||
retval==RetVal_Paragraph ||
retval==RetVal_Internal ||
);
DBG(("DocSection::parse() end: retval=%x\n",retval));
DocNode *n = g_nodeStack.pop();
ASSERT(n==this);
return retval;
}
QCString DocSection::title ( ) const
inline

Definition at line 943 of file docparser.h.

References m_title.

Referenced by DocbookDocVisitor::visitPre(), ManDocVisitor::visitPre(), RTFDocVisitor::visitPre(), XmlDocVisitor::visitPre(), HtmlDocVisitor::visitPre(), LatexDocVisitor::visitPre(), and PerlModDocVisitor::visitPre().

{ return m_title; }

Member Data Documentation

QCString DocSection::m_anchor
private

Definition at line 954 of file docparser.h.

Referenced by anchor(), and parse().

QCString DocSection::m_file
private

Definition at line 955 of file docparser.h.

Referenced by file(), and parse().

QCString DocSection::m_id
private

Definition at line 952 of file docparser.h.

Referenced by id(), and parse().

int DocSection::m_level
private

Definition at line 951 of file docparser.h.

Referenced by level(), and parse().

QCString DocSection::m_title
private

Definition at line 953 of file docparser.h.

Referenced by parse(), and title().


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