Public Member Functions | List of all members
DocText Class Reference

#include <docparser.h>

Inheritance diagram for DocText:
CompAccept< DocText > DocNode

Public Member Functions

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

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

Detailed Description

Root node of a text fragment

Definition at line 1389 of file docparser.h.

Constructor & Destructor Documentation

DocText::DocText ( )
inline

Definition at line 1392 of file docparser.h.

1392 {}

Member Function Documentation

void DocText::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 1394 of file docparser.h.

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

Definition at line 1396 of file docparser.h.

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

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 1393 of file docparser.h.

1393 { return Kind_Text; }
void DocText::parse ( )

Definition at line 6799 of file docparser.cpp.

6800 {
6801  DBG(("DocText::parse() start\n"));
6802  g_nodeStack.push(this);
6804 
6805  int tok;
6806  while ((tok=doctokenizerYYlex())) // get the next token
6807  {
6808  switch(tok)
6809  {
6810  case TK_WORD:
6811  m_children.append(new DocWord(this,g_token->name));
6812  break;
6813  case TK_WHITESPACE:
6815  break;
6816  case TK_SYMBOL:
6817  {
6819  if (s!=DocSymbol::Sym_Unknown)
6820  {
6821  m_children.append(new DocSymbol(this,s));
6822  }
6823  else
6824  {
6825  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
6826  qPrint(g_token->name));
6827  }
6828  }
6829  break;
6830  case TK_COMMAND:
6831  switch (Mappers::cmdMapper->map(g_token->name))
6832  {
6833  case CMD_BSLASH:
6835  break;
6836  case CMD_AT:
6838  break;
6839  case CMD_LESS:
6841  break;
6842  case CMD_GREATER:
6844  break;
6845  case CMD_AMP:
6847  break;
6848  case CMD_DOLLAR:
6850  break;
6851  case CMD_HASH:
6853  break;
6854  case CMD_DCOLON:
6856  break;
6857  case CMD_PERCENT:
6859  break;
6860  case CMD_NDASH:
6863  break;
6864  case CMD_MDASH:
6868  break;
6869  case CMD_QUOTE:
6871  break;
6872  case CMD_PUNT:
6874  break;
6875  case CMD_PLUS:
6877  break;
6878  case CMD_MINUS:
6880  break;
6881  default:
6882  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected command `%s' found",
6883  qPrint(g_token->name));
6884  break;
6885  }
6886  break;
6887  default:
6888  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
6889  tokToString(tok));
6890  break;
6891  }
6892  }
6893 
6895 
6896  DocNode *n = g_nodeStack.pop();
6897  ASSERT(n==this);
6898  DBG(("DocText::parse() end\n"));
6899 }
static QCString g_fileName
Definition: docparser.cpp:95
QList< DocNode > m_children
Definition: docparser.h:189
void append(const type *d)
Definition: qlist.h:73
#define DBG(x)
Definition: docparser.cpp:59
int doctokenizerYYlineno
void warn_doc_error(const char *file, int line, const char *fmt,...)
Definition: message.cpp:210
void doctokenizerYYsetStateText()
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
int doctokenizerYYlex(void)
void push(const type *d)
Definition: qstack.h:58
QCString chars
Definition: doctokenizer.h:107
std::void_t< T > n
static void handleUnclosedStyleCommands()
Definition: docparser.cpp:1041
static SymType decodeSymbol(const QCString &symName)
Definition: docparser.cpp:1705
type * pop()
Definition: qstack.h:59
static Mapper * cmdMapper
Definition: cmdmapper.h:219
QCString name
Definition: doctokenizer.h:77
const char * tokToString(int token)
static QCString * s
Definition: config.cpp:1042
const char * qPrint(const char *s)
Definition: qcstring.h:797
#define ASSERT(x)
Definition: qglobal.h:590

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