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

#include <docparser.h>

Inheritance diagram for DocHtmlDescTitle:
CompAccept< DocHtmlDescTitle > DocNode

Public Member Functions

 DocHtmlDescTitle (DocNode *parent, const HtmlAttribList &attribs)
 
Kind kind () const
 
const HtmlAttribListattribs () const
 
void accept (DocVisitor *v)
 
int parse ()
 
- Public Member Functions inherited from CompAccept< DocHtmlDescTitle >
 CompAccept ()
 
virtual ~CompAccept ()
 
void accept (DocHtmlDescTitle *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

HtmlAttribList m_attribs
 

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

Detailed Description

Node representing a Html description item

Definition at line 906 of file docparser.h.

Constructor & Destructor Documentation

DocHtmlDescTitle::DocHtmlDescTitle ( DocNode parent,
const HtmlAttribList attribs 
)
inline

Definition at line 909 of file docparser.h.

909  :
910  m_attribs(attribs) { m_parent = parent; }
DocNode * parent() const
Definition: docparser.h:147
DocNode * m_parent
Definition: docparser.h:163
HtmlAttribList m_attribs
Definition: docparser.h:917

Member Function Documentation

void DocHtmlDescTitle::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 913 of file docparser.h.

void accept(T *obj, DocVisitor *v)
Definition: docparser.h:177
const HtmlAttribList& DocHtmlDescTitle::attribs ( ) const
inline

Definition at line 912 of file docparser.h.

912 { return m_attribs; }
HtmlAttribList m_attribs
Definition: docparser.h:917
Kind DocHtmlDescTitle::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 911 of file docparser.h.

int DocHtmlDescTitle::parse ( )

Definition at line 3820 of file docparser.cpp.

3821 {
3822  int retval=0;
3823  g_nodeStack.push(this);
3824  DBG(("DocHtmlDescTitle::parse() start\n"));
3825 
3826  int tok;
3827  while ((tok=doctokenizerYYlex()))
3828  {
3829  if (!defaultHandleToken(this,tok,m_children))
3830  {
3831  switch (tok)
3832  {
3833  case TK_COMMAND:
3834  {
3835  QCString cmdName=g_token->name;
3836  bool isJavaLink=FALSE;
3837  switch (Mappers::cmdMapper->map(cmdName))
3838  {
3839  case CMD_REF:
3840  {
3841  int tok=doctokenizerYYlex();
3842  if (tok!=TK_WHITESPACE)
3843  {
3844  warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
3845  qPrint(g_token->name));
3846  }
3847  else
3848  {
3850  tok=doctokenizerYYlex(); // get the reference id
3851  if (tok!=TK_WORD)
3852  {
3853  warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s",
3854  tokToString(tok),qPrint(cmdName));
3855  }
3856  else
3857  {
3858  DocRef *ref = new DocRef(this,g_token->name,g_context);
3859  m_children.append(ref);
3860  ref->parse();
3861  }
3863  }
3864  }
3865  break;
3866  case CMD_JAVALINK:
3867  isJavaLink=TRUE;
3868  // fall through
3869  case CMD_LINK:
3870  {
3871  int tok=doctokenizerYYlex();
3872  if (tok!=TK_WHITESPACE)
3873  {
3874  warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command",
3875  qPrint(cmdName));
3876  }
3877  else
3878  {
3880  tok=doctokenizerYYlex();
3881  if (tok!=TK_WORD)
3882  {
3883  warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s",
3884  tokToString(tok),qPrint(cmdName));
3885  }
3886  else
3887  {
3889  DocLink *lnk = new DocLink(this,g_token->name);
3890  m_children.append(lnk);
3891  QCString leftOver = lnk->parse(isJavaLink);
3892  if (!leftOver.isEmpty())
3893  {
3894  m_children.append(new DocWord(this,leftOver));
3895  }
3896  }
3897  }
3898  }
3899 
3900  break;
3901  default:
3902  warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a <dt> tag",
3903  qPrint(g_token->name));
3904  }
3905  }
3906  break;
3907  case TK_SYMBOL:
3908  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found",
3909  qPrint(g_token->name));
3910  break;
3911  case TK_HTMLTAG:
3912  {
3913  int tagId=Mappers::htmlTagMapper->map(g_token->name);
3914  if (tagId==HTML_DD && !g_token->endTag) // found <dd> tag
3915  {
3916  retval = RetVal_DescData;
3917  goto endtitle;
3918  }
3919  else if (tagId==HTML_DT && g_token->endTag)
3920  {
3921  // ignore </dt> tag.
3922  }
3923  else if (tagId==HTML_DT)
3924  {
3925  // missing <dt> tag.
3926  retval = RetVal_DescTitle;
3927  goto endtitle;
3928  }
3929  else if (tagId==HTML_DL && g_token->endTag)
3930  {
3931  retval=RetVal_EndDesc;
3932  goto endtitle;
3933  }
3934  else if (tagId==HTML_A)
3935  {
3936  if (!g_token->endTag)
3937  {
3939  }
3940  }
3941  else
3942  {
3943  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected html tag <%s%s> found within <dt> context",
3944  g_token->endTag?"/":"",qPrint(g_token->name));
3945  }
3946  }
3947  break;
3948  default:
3949  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
3950  tokToString(tok));
3951  break;
3952  }
3953  }
3954  }
3955  if (tok==0)
3956  {
3957  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected end of comment while inside"
3958  " <dt> tag");
3959  }
3960 endtitle:
3962  DBG(("DocHtmlDescTitle::parse() end\n"));
3963  DocNode *n=g_nodeStack.pop();
3964  ASSERT(n==this);
3965  return retval;
3966 }
static QCString g_fileName
Definition: docparser.cpp:95
QList< DocNode > m_children
Definition: docparser.h:189
void doctokenizerYYsetStatePara()
void doctokenizerYYsetStateRef()
bool isEmpty() const
Definition: qcstring.h:189
void doctokenizerYYsetStateLink()
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
static Mapper * htmlTagMapper
Definition: cmdmapper.h:220
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
int doctokenizerYYlex(void)
void push(const type *d)
Definition: qstack.h:58
static void handlePendingStyleCommands(DocNode *parent, QList< DocNode > &children)
Definition: docparser.cpp:957
std::void_t< T > n
void parse()
Definition: docparser.cpp:2552
int map(const char *n)
Definition: cmdmapper.cpp:225
type * pop()
Definition: qstack.h:59
HtmlAttribList attribs
Definition: doctokenizer.h:102
static int handleAHref(DocNode *parent, QList< DocNode > &children, const HtmlAttribList &tagHtmlAttribs)
Definition: docparser.cpp:981
static bool defaultHandleToken(DocNode *parent, int tok, QList< DocNode > &children, bool handleWord=TRUE)
Definition: docparser.cpp:1331
static Mapper * cmdMapper
Definition: cmdmapper.h:219
QCString name
Definition: doctokenizer.h:77
static QCString g_context
Definition: docparser.cpp:87
const char * tokToString(int token)
const char * qPrint(const char *s)
Definition: qcstring.h:797
const bool TRUE
Definition: qglobal.h:371
#define ASSERT(x)
Definition: qglobal.h:590

Member Data Documentation

HtmlAttribList DocHtmlDescTitle::m_attribs
private

Definition at line 917 of file docparser.h.


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