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

Constructor & Destructor Documentation

DocSimpleSect::DocSimpleSect ( DocNode parent,
Type  t 
)

Definition at line 4485 of file docparser.cpp.

4485  :
4486  m_type(t)
4487 {
4488  m_parent = parent;
4489  m_title=0;
4490 }
DocNode * parent() const
Definition: docparser.h:147
DocNode * m_parent
Definition: docparser.h:163
DocTitle * m_title
Definition: docparser.h:1067
DocSimpleSect::~DocSimpleSect ( )
virtual

Definition at line 4492 of file docparser.cpp.

4493 {
4494  delete m_title;
4495 }
DocTitle * m_title
Definition: docparser.h:1067

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 4497 of file docparser.cpp.

4498 {
4499  v->visitPre(this);
4500  if (m_title) m_title->accept(v);
4502  DocNode *n;
4503  for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
4504  v->visitPost(this);
4505 }
QList< DocNode > m_children
Definition: docparser.h:189
def cli(ctx)
Definition: main.py:7
DocTitle * m_title
Definition: docparser.h:1067
std::void_t< T > n
virtual void visitPre(DocAutoList *)=0
void accept(DocVisitor *v)
Definition: docparser.h:658
virtual void visitPost(DocAutoList *)=0
virtual void accept(DocVisitor *v)=0
void DocSimpleSect::appendLinkWord ( const QCString word)

Definition at line 4600 of file docparser.cpp.

4601 {
4602  DocPara *p;
4604  {
4605  p = new DocPara(this);
4606  m_children.append(p);
4607  }
4608  else
4609  {
4610  p = (DocPara *)m_children.getLast();
4611 
4612  // Comma-seperate <seealso> links.
4613  p->injectToken(TK_WORD,",");
4614  p->injectToken(TK_WHITESPACE," ");
4615  }
4616 
4618  p->injectToken(TK_LNKWORD,word);
4620 }
QList< DocNode > m_children
Definition: docparser.h:189
void append(const type *d)
Definition: qlist.h:73
const bool FALSE
Definition: qglobal.h:370
virtual Kind kind() const =0
bool injectToken(int tok, const QCString &tokText)
Definition: docparser.cpp:5222
type * getLast() const
Definition: qlist.h:96
bool isEmpty() const
Definition: qlist.h:67
p
Definition: test.py:223
static bool g_inSeeBlock
Definition: docparser.cpp:88
const bool TRUE
Definition: qglobal.h:371
Kind DocSimpleSect::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 1056 of file docparser.h.

int DocSimpleSect::parse ( bool  userTitle,
bool  needsSeparator 
)

Definition at line 4507 of file docparser.cpp.

4508 {
4509  DBG(("DocSimpleSect::parse() start\n"));
4510  g_nodeStack.push(this);
4511 
4512  // handle case for user defined title
4513  if (userTitle)
4514  {
4515  m_title = new DocTitle(this);
4516  m_title->parse();
4517  }
4518 
4519  // add new paragraph as child
4520  DocPara *par = new DocPara(this);
4521  if (m_children.isEmpty())
4522  {
4523  par->markFirst();
4524  }
4525  else
4526  {
4528  ((DocPara *)m_children.getLast())->markLast(FALSE);
4529  }
4530  par->markLast();
4531  if (needsSeparator) m_children.append(new DocSimpleSectSep(this));
4532  m_children.append(par);
4533 
4534  // parse the contents of the paragraph
4535  int retval = par->parse();
4536 
4537  DBG(("DocSimpleSect::parse() end retval=%d\n",retval));
4538  DocNode *n=g_nodeStack.pop();
4539  ASSERT(n==this);
4540  return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec
4541 }
QList< DocNode > m_children
Definition: docparser.h:189
void append(const type *d)
Definition: qlist.h:73
#define DBG(x)
Definition: docparser.cpp:59
const bool FALSE
Definition: qglobal.h:370
void markFirst(bool v=TRUE)
Definition: docparser.h:1122
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
virtual Kind kind() const =0
void push(const type *d)
Definition: qstack.h:58
type * getLast() const
Definition: qlist.h:96
DocTitle * m_title
Definition: docparser.h:1067
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
void parse()
Definition: docparser.cpp:4444
type * pop()
Definition: qstack.h:59
#define ASSERT(x)
Definition: qglobal.h:590
int DocSimpleSect::parseRcs ( )

Definition at line 4543 of file docparser.cpp.

4544 {
4545  DBG(("DocSimpleSect::parseRcs() start\n"));
4546  g_nodeStack.push(this);
4547 
4548  m_title = new DocTitle(this);
4550 
4551  QCString text = g_token->text;
4552  docParserPushContext(); // this will create a new g_token
4554  docParserPopContext(); // this will restore the old g_token
4555 
4556  DBG(("DocSimpleSect::parseRcs()\n"));
4557  DocNode *n=g_nodeStack.pop();
4558  ASSERT(n==this);
4559  return RetVal_OK;
4560 }
QList< DocNode > m_children
Definition: docparser.h:189
#define DBG(x)
Definition: docparser.cpp:59
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
void push(const type *d)
Definition: qstack.h:58
DocTitle * m_title
Definition: docparser.h:1067
std::void_t< T > n
QCString text
Definition: doctokenizer.h:80
type * pop()
Definition: qstack.h:59
static void docParserPopContext(bool keepParamInfo=FALSE)
Definition: docparser.cpp:191
static void docParserPushContext(bool saveParamInfo=TRUE)
Definition: docparser.cpp:148
QCString name
Definition: doctokenizer.h:77
static int internalValidatingParseDoc(DocNode *parent, QList< DocNode > &children, const QCString &doc)
Definition: docparser.cpp:1713
void parseFromString(const QCString &title)
Definition: docparser.cpp:4478
#define ASSERT(x)
Definition: qglobal.h:590
int DocSimpleSect::parseXml ( )

Definition at line 4562 of file docparser.cpp.

4563 {
4564  DBG(("DocSimpleSect::parse() start\n"));
4565  g_nodeStack.push(this);
4566 
4567  int retval = RetVal_OK;
4568  for (;;)
4569  {
4570  // add new paragraph as child
4571  DocPara *par = new DocPara(this);
4572  if (m_children.isEmpty())
4573  {
4574  par->markFirst();
4575  }
4576  else
4577  {
4579  ((DocPara *)m_children.getLast())->markLast(FALSE);
4580  }
4581  par->markLast();
4582  m_children.append(par);
4583 
4584  // parse the contents of the paragraph
4585  retval = par->parse();
4586  if (retval == 0) break;
4587  if (retval == RetVal_CloseXml)
4588  {
4589  retval = RetVal_OK;
4590  break;
4591  }
4592  }
4593 
4594  DBG(("DocSimpleSect::parseXml() end retval=%d\n",retval));
4595  DocNode *n=g_nodeStack.pop();
4596  ASSERT(n==this);
4597  return retval;
4598 }
QList< DocNode > m_children
Definition: docparser.h:189
void append(const type *d)
Definition: qlist.h:73
#define DBG(x)
Definition: docparser.cpp:59
const bool FALSE
Definition: qglobal.h:370
void markFirst(bool v=TRUE)
Definition: docparser.h:1122
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
virtual Kind kind() const =0
void push(const type *d)
Definition: qstack.h:58
type * getLast() const
Definition: qlist.h:96
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
type * pop()
Definition: qstack.h:59
#define ASSERT(x)
Definition: qglobal.h:590
Type DocSimpleSect::type ( ) const
inline

Definition at line 1057 of file docparser.h.

1057 { return m_type; }
QCString DocSimpleSect::typeString ( ) const

Definition at line 4622 of file docparser.cpp.

4623 {
4624  switch (m_type)
4625  {
4626  case Unknown: break;
4627  case See: return "see";
4628  case Return: return "return";
4629  case Author: // fall through
4630  case Authors: return "author";
4631  case Version: return "version";
4632  case Since: return "since";
4633  case Date: return "date";
4634  case Note: return "note";
4635  case Warning: return "warning";
4636  case Pre: return "pre";
4637  case Post: return "post";
4638  case Copyright: return "copyright";
4639  case Invar: return "invariant";
4640  case Remark: return "remark";
4641  case Attention: return "attention";
4642  case User: return "user";
4643  case Rcs: return "rcs";
4644  }
4645  return "unknown";
4646 }

Member Data Documentation

DocTitle* DocSimpleSect::m_title
private

Definition at line 1067 of file docparser.h.

Type DocSimpleSect::m_type
private

Definition at line 1066 of file docparser.h.


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