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

#include <docparser.h>

Inheritance diagram for DocIndexEntry:
DocNode

Public Member Functions

 DocIndexEntry (DocNode *parent, Definition *scope, MemberDef *md)
 
Kind kind () const
 
int parse ()
 
Definitionscope () const
 
MemberDefmember () const
 
QCString entry () const
 
void accept (DocVisitor *v)
 
- Public Member Functions inherited from DocNode
 DocNode ()
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private Attributes

QCString m_entry
 
Definitionm_scope
 
MemberDefm_member
 

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 DocNode
DocNodem_parent
 

Detailed Description

Node representing an entry in the index.

Definition at line 577 of file docparser.h.

Constructor & Destructor Documentation

DocIndexEntry::DocIndexEntry ( DocNode parent,
Definition scope,
MemberDef md 
)
inline

Definition at line 580 of file docparser.h.

581  : m_scope(scope), m_member(md){ m_parent = parent; }
DocNode * parent() const
Definition: docparser.h:147
MemberDef * m_member
Definition: docparser.h:592
DocNode * m_parent
Definition: docparser.h:163
Definition * m_scope
Definition: docparser.h:591

Member Function Documentation

void DocIndexEntry::accept ( DocVisitor v)
inlinevirtual

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

Parameters
vAbstract visitor.

Implements DocNode.

Definition at line 587 of file docparser.h.

587 { v->visit(this); }
virtual void visit(DocWord *)=0
QCString DocIndexEntry::entry ( ) const
inline

Definition at line 586 of file docparser.h.

586 { return m_entry; }
QCString m_entry
Definition: docparser.h:590
Kind DocIndexEntry::kind ( ) const
inlinevirtual

Returns the kind of node. Provides runtime type information

Implements DocNode.

Definition at line 582 of file docparser.h.

MemberDef* DocIndexEntry::member ( ) const
inline

Definition at line 585 of file docparser.h.

585 { return m_member; }
MemberDef * m_member
Definition: docparser.h:592
int DocIndexEntry::parse ( )

Definition at line 3175 of file docparser.cpp.

3176 {
3177  int retval=RetVal_OK;
3178  g_nodeStack.push(this);
3179  DBG(("DocIndexEntry::parse() start\n"));
3180  int tok=doctokenizerYYlex();
3181  if (tok!=TK_WHITESPACE)
3182  {
3183  warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\addindex command");
3184  goto endindexentry;
3185  }
3187  m_entry="";
3188  while ((tok=doctokenizerYYlex()))
3189  {
3190  switch (tok)
3191  {
3192  case TK_WHITESPACE:
3193  m_entry+=" ";
3194  break;
3195  case TK_WORD:
3196  case TK_LNKWORD:
3197  m_entry+=g_token->name;
3198  break;
3199  case TK_SYMBOL:
3200  {
3202  switch (s)
3203  {
3204  case DocSymbol::Sym_BSlash: m_entry+='\\'; break;
3205  case DocSymbol::Sym_At: m_entry+='@'; break;
3206  case DocSymbol::Sym_Less: m_entry+='<'; break;
3207  case DocSymbol::Sym_Greater: m_entry+='>'; break;
3208  case DocSymbol::Sym_Amp: m_entry+='&'; break;
3209  case DocSymbol::Sym_Dollar: m_entry+='$'; break;
3210  case DocSymbol::Sym_Hash: m_entry+='#'; break;
3211  case DocSymbol::Sym_Percent: m_entry+='%'; break;
3212  case DocSymbol::Sym_apos: m_entry+='\''; break;
3213  case DocSymbol::Sym_Quot: m_entry+='"'; break;
3214  case DocSymbol::Sym_lsquo: m_entry+='`'; break;
3215  case DocSymbol::Sym_rsquo: m_entry+='\''; break;
3216  case DocSymbol::Sym_ldquo: m_entry+="``"; break;
3217  case DocSymbol::Sym_rdquo: m_entry+="''"; break;
3218  case DocSymbol::Sym_ndash: m_entry+="--"; break;
3219  case DocSymbol::Sym_mdash: m_entry+="---"; break;
3220  default:
3221  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected symbol found as argument of \\addindex");
3222  break;
3223  }
3224  }
3225  break;
3226  case TK_COMMAND:
3227  switch (Mappers::cmdMapper->map(g_token->name))
3228  {
3229  case CMD_BSLASH: m_entry+='\\'; break;
3230  case CMD_AT: m_entry+='@'; break;
3231  case CMD_LESS: m_entry+='<'; break;
3232  case CMD_GREATER: m_entry+='>'; break;
3233  case CMD_AMP: m_entry+='&'; break;
3234  case CMD_DOLLAR: m_entry+='$'; break;
3235  case CMD_HASH: m_entry+='#'; break;
3236  case CMD_DCOLON: m_entry+="::"; break;
3237  case CMD_PERCENT: m_entry+='%'; break;
3238  case CMD_NDASH: m_entry+="--"; break;
3239  case CMD_MDASH: m_entry+="---"; break;
3240  case CMD_QUOTE: m_entry+='"'; break;
3241  case CMD_PUNT: m_entry+='.'; break;
3242  case CMD_PLUS: m_entry+='+'; break;
3243  case CMD_MINUS: m_entry+='-'; break;
3244  default:
3245  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected command %s found as argument of \\addindex",
3246  qPrint(g_token->name));
3247  break;
3248  }
3249  break;
3250  default:
3251  warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s",
3252  tokToString(tok));
3253  break;
3254  }
3255  }
3258 endindexentry:
3259  DBG(("DocIndexEntry::parse() end retval=%x\n",retval));
3260  DocNode *n=g_nodeStack.pop();
3261  ASSERT(n==this);
3262  return retval;
3263 }
static QCString g_fileName
Definition: docparser.cpp:95
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
void doctokenizerYYsetStatePara()
#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
static QStack< DocNode > g_nodeStack
Definition: docparser.cpp:91
TokenInfo * g_token
int doctokenizerYYlex(void)
void push(const type *d)
Definition: qstack.h:58
void doctokenizerYYsetStateTitle()
std::void_t< T > n
QCString m_entry
Definition: docparser.h:590
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
Definition* DocIndexEntry::scope ( ) const
inline

Definition at line 584 of file docparser.h.

584 { return m_scope; }
Definition * m_scope
Definition: docparser.h:591

Member Data Documentation

QCString DocIndexEntry::m_entry
private

Definition at line 590 of file docparser.h.

MemberDef* DocIndexEntry::m_member
private

Definition at line 592 of file docparser.h.

Definition* DocIndexEntry::m_scope
private

Definition at line 591 of file docparser.h.


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