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

#include <docparser.h>

Inheritance diagram for DocRoot:
CompAccept< DocRoot > DocNode

Public Member Functions

 DocRoot (bool indent, bool sl)
 
Kind kind () const
 
void accept (DocVisitor *v)
 
void parse ()
 
bool indent () const
 
bool singleLine () const
 
bool isEmpty () const
 
- Public Member Functions inherited from CompAccept< DocRoot >
 CompAccept ()
 
virtual ~CompAccept ()
 
void accept (DocRoot *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

bool m_indent
 
bool m_singleLine
 

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

Detailed Description

Root node of documentation tree

Definition at line 1400 of file docparser.h.

Constructor & Destructor Documentation

DocRoot::DocRoot ( bool  indent,
bool  sl 
)
inline

Definition at line 1403 of file docparser.h.

1403 : m_indent(indent), m_singleLine(sl) {}
bool m_indent
Definition: docparser.h:1412
bool m_singleLine
Definition: docparser.h:1413
bool indent() const
Definition: docparser.h:1407

Member Function Documentation

void DocRoot::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 1405 of file docparser.h.

1405 { CompAccept<DocRoot>::accept(this,v); }
void accept(T *obj, DocVisitor *v)
Definition: docparser.h:177
bool DocRoot::indent ( ) const
inline

Definition at line 1407 of file docparser.h.

1407 { return m_indent; }
bool m_indent
Definition: docparser.h:1412
bool DocRoot::isEmpty ( ) const
inline

Definition at line 1409 of file docparser.h.

1409 { return m_children.isEmpty(); }
QList< DocNode > m_children
Definition: docparser.h:189
bool isEmpty() const
Definition: qlist.h:67
Kind DocRoot::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 1404 of file docparser.h.

1404 { return Kind_Root; }
void DocRoot::parse ( )

Definition at line 6904 of file docparser.cpp.

6905 {
6906  DBG(("DocRoot::parse() start\n"));
6907  g_nodeStack.push(this);
6909  int retval=0;
6910 
6911  // first parse any number of paragraphs
6912  bool isFirst=TRUE;
6913  DocPara *lastPar=0;
6914  do
6915  {
6916  DocPara *par = new DocPara(this);
6917  if (isFirst) { par->markFirst(); isFirst=FALSE; }
6918  retval=par->parse();
6919  if (!par->isEmpty())
6920  {
6921  m_children.append(par);
6922  lastPar=par;
6923  }
6924  else
6925  {
6926  delete par;
6927  }
6928  if (retval==TK_LISTITEM)
6929  {
6930  warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid list item found");
6931  }
6932  else if (retval==RetVal_Subsection)
6933  {
6934  warn_doc_error(g_fileName,doctokenizerYYlineno,"found subsection command outside of section context!");
6935  }
6936  else if (retval==RetVal_Subsubsection)
6937  {
6938  warn_doc_error(g_fileName,doctokenizerYYlineno,"found subsubsection command outside of subsection context!");
6939  }
6940  else if (retval==RetVal_Paragraph)
6941  {
6942  warn_doc_error(g_fileName,doctokenizerYYlineno,"found paragraph command outside of subsubsection context!");
6943  }
6944  if (retval==RetVal_Internal)
6945  {
6946  DocInternal *in = new DocInternal(this);
6947  m_children.append(in);
6948  retval = in->parse(1);
6949  }
6950  } while (retval!=0 && retval!=RetVal_Section);
6951  if (lastPar) lastPar->markLast();
6952 
6953  //printf("DocRoot::parse() retval=%d %d\n",retval,RetVal_Section);
6954  // then parse any number of level1 sections
6955  while (retval==RetVal_Section)
6956  {
6958  if (sec)
6959  {
6960  DocSection *s=new DocSection(this,
6962  m_children.append(s);
6963  retval = s->parse();
6964  }
6965  else
6966  {
6967  warn_doc_error(g_fileName,doctokenizerYYlineno,"Invalid section id `%s'; ignoring section",qPrint(g_token->sectionId));
6968  retval = 0;
6969  }
6970  }
6971 
6973 
6974  DocNode *n = g_nodeStack.pop();
6975  ASSERT(n==this);
6976  DBG(("DocRoot::parse() end\n"));
6977 }
static QCString g_fileName
Definition: docparser.cpp:95
QList< DocNode > m_children
Definition: docparser.h:189
void doctokenizerYYsetStatePara()
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
QCString sectionId
Definition: doctokenizer.h:89
void markFirst(bool v=TRUE)
Definition: docparser.h:1122
static int subpageNestingLevel
Definition: doxygen.h:150
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
void push(const type *d)
Definition: qstack.h:58
#define QMIN(a, b)
Definition: qglobal.h:391
std::void_t< T > n
void markLast(bool v=TRUE)
Definition: docparser.h:1123
static void handleUnclosedStyleCommands()
Definition: docparser.cpp:1041
int parse()
Definition: docparser.cpp:6348
static SectionDict * sectionDict
Definition: doxygen.h:117
type * pop()
Definition: qstack.h:59
T * find(const char *key)
Definition: sortdict.h:232
static QCString * s
Definition: config.cpp:1042
bool isEmpty() const
Definition: docparser.h:1120
const char * qPrint(const char *s)
Definition: qcstring.h:797
const bool TRUE
Definition: qglobal.h:371
int parse(int)
Definition: docparser.cpp:3113
#define ASSERT(x)
Definition: qglobal.h:590
bool DocRoot::singleLine ( ) const
inline

Definition at line 1408 of file docparser.h.

1408 { return m_singleLine; }
bool m_singleLine
Definition: docparser.h:1413

Member Data Documentation

bool DocRoot::m_indent
private

Definition at line 1412 of file docparser.h.

bool DocRoot::m_singleLine
private

Definition at line 1413 of file docparser.h.


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