doxygen
docnode.h
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2022 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 
16 #ifndef DOCNODE_H
17 #define DOCNODE_H
18 
19 #include <cstdio>
20 #include <cstdint>
21 #include <vector>
22 #include <memory>
23 #include <variant>
24 
25 #include "qcstring.h"
26 #include "docvisitor.h"
27 #include "docparser.h"
28 #include "htmlattrib.h"
29 #include "htmlentity.h"
30 #include "growvector.h"
31 #include "section.h"
32 
33 class MemberDef;
34 class Definition;
35 class DocParser;
36 
37 //---------------------------------------------------------------------------
38 
39 #define DOC_NODES \
40 /* 0 */ DN(DocWord) DN_SEP DN(DocLinkedWord) DN_SEP DN(DocURL) DN_SEP DN(DocLineBreak) DN_SEP DN(DocHorRuler) DN_SEP \
41 /* 5 */ DN(DocAnchor) DN_SEP DN(DocCite) DN_SEP DN(DocStyleChange) DN_SEP DN(DocSymbol) DN_SEP DN(DocEmoji) DN_SEP \
42 /* 10 */ DN(DocWhiteSpace) DN_SEP DN(DocSeparator) DN_SEP DN(DocVerbatim) DN_SEP DN(DocInclude) DN_SEP DN(DocIncOperator) DN_SEP \
43 /* 15 */ DN(DocFormula) DN_SEP DN(DocIndexEntry) DN_SEP DN(DocAutoList) DN_SEP DN(DocAutoListItem) DN_SEP DN(DocTitle) DN_SEP \
44 /* 20 */ DN(DocXRefItem) DN_SEP DN(DocImage) DN_SEP DN(DocDotFile) DN_SEP DN(DocMscFile) DN_SEP DN(DocDiaFile) DN_SEP \
45 /* 25 */ DN(DocVhdlFlow) DN_SEP DN(DocLink) DN_SEP DN(DocRef) DN_SEP DN(DocInternalRef) DN_SEP DN(DocHRef) DN_SEP \
46 /* 30 */ DN(DocHtmlHeader) DN_SEP DN(DocHtmlDescTitle) DN_SEP DN(DocHtmlDescList) DN_SEP DN(DocSection) DN_SEP DN(DocSecRefItem) DN_SEP \
47 /* 35 */ DN(DocSecRefList) DN_SEP DN(DocInternal) DN_SEP DN(DocParBlock) DN_SEP DN(DocSimpleList) DN_SEP DN(DocHtmlList) DN_SEP \
48 /* 40 */ DN(DocSimpleSect) DN_SEP DN(DocSimpleSectSep) DN_SEP DN(DocParamSect) DN_SEP DN(DocPara) DN_SEP DN(DocParamList) DN_SEP \
49 /* 45 */ DN(DocSimpleListItem) DN_SEP DN(DocHtmlListItem) DN_SEP DN(DocHtmlDescData) DN_SEP DN(DocHtmlCell) DN_SEP DN(DocHtmlCaption) DN_SEP \
50 /* 50 */ DN(DocHtmlRow) DN_SEP DN(DocHtmlTable) DN_SEP DN(DocHtmlBlockQuote) DN_SEP DN(DocText) DN_SEP DN(DocRoot) DN_SEP \
51 /* 55 */ DN(DocHtmlDetails) DN_SEP DN(DocHtmlSummary) \
52 
53 // forward declarations
54 #define DN(x) class x;
55 #define DN_SEP
56 DOC_NODES
57 #undef DN
58 #undef DN_SEP
59 
60 // define a variant type
61 #define DN(x) x
62 #define DN_SEP ,
63 using DocNodeVariant = std::variant<
64 DOC_NODES
65 >;
66 #undef DN
67 #undef DN_SEP
68 
69 // getter functions to return the name of a doc node type
70 #define DN(x) constexpr const char *docNodeName(const x &/* n */) { return #x; }
71 #define DN_SEP
72 DOC_NODES
73 #undef DN
74 #undef DN_SEP
75 
77 class DocNode
78 {
79  public:
81  DocNode(DocParser *parser,DocNodeVariant *parent) : m_parser(parser), m_parent(parent) {}
82 
83  // allow nodes to be moved but not copied
84  DocNode(const DocNode &) = delete;
85  DocNode &operator=(const DocNode &) = delete;
86  DocNode(DocNode &&) = default;
87  DocNode &operator=(DocNode &&) = default;
88  ~DocNode() = default;
89 
91  DocNodeVariant *parent() { return m_parent; }
92  const DocNodeVariant *parent() const { return m_parent; }
93 
94  DocNodeVariant *thisVariant() { return m_thisVariant; }
95  const DocNodeVariant *thisVariant() const { return m_thisVariant; }
96 
97  void setThisVariant(DocNodeVariant *thisVariant) { m_thisVariant=thisVariant; }
98 
99  DocParser *parser() { return m_parser; }
100  const DocParser *parser() const { return m_parser; }
101 
103  void setParent(DocNodeVariant *parent) { m_parent = parent; }
104 
106  bool isPreformatted() const { return m_insidePre; }
107 
108  protected:
110  void setInsidePreformatted(bool p) { m_insidePre = p; }
111  enum RefType { Unknown, Anchor, Section, Table };
112  private:
113  bool m_insidePre = false;
114  DocParser *m_parser;
115  DocNodeVariant *m_parent;
116  DocNodeVariant *m_thisVariant = nullptr;
117 };
118 
119 struct DocNodeList : public GrowVector<DocNodeVariant>
120 {
124  template<class T,class...Args>
125  void append(Args&&... args);
126 
129  void move_append(DocNodeList &l);
130 
134  template<class T>
135  T *get_last();
136 };
137 
139 class DocCompoundNode : public DocNode
140 {
141  public:
142  DocCompoundNode(DocParser *parser,DocNodeVariant *parent)
143  : DocNode(parser,parent) {}
144  DocNodeList &children() { return m_children; }
145  const DocNodeList &children() const { return m_children; }
146 
147  private:
148  DocNodeList m_children;
149 };
150 
153 class DocWord : public DocNode
154 {
155  public:
156  DocWord(DocParser *parser,DocNodeVariant *parent,const QCString &word);
157  QCString word() const { return m_word; }
158 
159  private:
160  QCString m_word;
161 };
162 
165 class DocLinkedWord : public DocNode
166 {
167  public:
168  DocLinkedWord(DocParser *parser,DocNodeVariant *parent,const QCString &word,
169  const QCString &ref,const QCString &file,
170  const QCString &anchor,const QCString &tooltip);
171  QCString word() const { return m_word; }
172  QCString file() const { return m_file; }
173  QCString relPath() const { return m_relPath; }
174  QCString ref() const { return m_ref; }
175  QCString anchor() const { return m_anchor; }
176  QCString tooltip() const { return m_tooltip; }
177 
178  private:
179  QCString m_word;
180  QCString m_ref;
181  QCString m_file;
182  QCString m_relPath;
183  QCString m_anchor;
184  QCString m_tooltip;
185 };
186 
188 class DocURL : public DocNode
189 {
190  public:
191  DocURL(DocParser *parser,DocNodeVariant *parent,const QCString &url,bool isEmail) :
192  DocNode(parser,parent), m_url(url), m_isEmail(isEmail) {}
193  QCString url() const { return m_url; }
194  bool isEmail() const { return m_isEmail; }
195 
196  private:
197  QCString m_url;
198  bool m_isEmail = false;
199 };
200 
202 class DocLineBreak : public DocNode
203 {
204  public:
205  DocLineBreak(DocParser *parser,DocNodeVariant *parent) : DocNode(parser,parent) {}
206  DocLineBreak(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs)
207  : DocNode(parser,parent), m_attribs(attribs) {}
208 
209  const HtmlAttribList &attribs() const { return m_attribs; }
210 
211  private:
212  HtmlAttribList m_attribs;
213 };
214 
216 class DocHorRuler : public DocNode
217 {
218  public:
219  DocHorRuler(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs)
220  : DocNode(parser,parent), m_attribs(attribs) {}
221 
222  const HtmlAttribList &attribs() const { return m_attribs; }
223 
224  private:
225  HtmlAttribList m_attribs;
226 };
227 
229 class DocAnchor : public DocNode
230 {
231  public:
232  DocAnchor(DocParser *parser,DocNodeVariant *parent,const QCString &id,bool newAnchor);
233  QCString anchor() const { return m_anchor; }
234  QCString file() const { return m_file; }
235 
236  const HtmlAttribList &attribs() const { return m_attribs; }
237 
238  private:
239  QCString m_anchor;
240  QCString m_file;
241  HtmlAttribList m_attribs;
242 };
243 
245 class DocCite : public DocNode
246 {
247  public:
248  DocCite(DocParser *parser,DocNodeVariant *parent,const QCString &target,const QCString &context);
249  QCString file() const { return m_file; }
250  QCString relPath() const { return m_relPath; }
251  QCString ref() const { return m_ref; }
252  QCString anchor() const { return m_anchor; }
253  QCString text() const { return m_text; }
254 
255  private:
256  QCString m_file;
257  QCString m_relPath;
258  QCString m_ref;
259  QCString m_anchor;
260  QCString m_text;
261 };
262 
263 
265 class DocStyleChange : public DocNode
266 {
267  public:
268  enum Style { Bold = (1<<0),
269  Italic = (1<<1),
270  Code = (1<<2),
271  Center = (1<<3),
272  Small = (1<<4),
273  Subscript = (1<<5),
274  Superscript = (1<<6),
275  Preformatted = (1<<7),
276  Span = (1<<8),
277  Div = (1<<9),
278  Strike = (1<<10),
279  Underline = (1<<11),
280  Del = (1<<12),
281  Ins = (1<<13),
282  S = (1<<14),
283  Cite = (1<<15)
284  };
285 
286  DocStyleChange(DocParser *parser,DocNodeVariant *parent,size_t position,Style s,
287  const QCString &tagName,bool enable, const HtmlAttribList *attribs=0)
288  : DocNode(parser,parent), m_position(position), m_style(s), m_enable(enable)
289  {
290  if (attribs) m_attribs=*attribs;
291  m_tagName = tagName.lower();
292  }
293  Style style() const { return m_style; }
294  const char *styleString() const;
295  bool enable() const { return m_enable; }
296  size_t position() const { return m_position; }
297  const HtmlAttribList &attribs() const { return m_attribs; }
298  QCString tagName() const { return m_tagName; }
299 
300  private:
301  size_t m_position = 0;
302  Style m_style = Bold;
303  bool m_enable = false;
304  HtmlAttribList m_attribs;
305  QCString m_tagName;
306 };
307 
309 class DocSymbol : public DocNode
310 {
311  public:
312  DocSymbol(DocParser *parser,DocNodeVariant *parent,HtmlEntityMapper::SymType s)
313  : DocNode(parser,parent), m_symbol(s) {}
314  HtmlEntityMapper::SymType symbol() const { return m_symbol; }
315  static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName);
316 
317  private:
318  HtmlEntityMapper::SymType m_symbol = HtmlEntityMapper::Sym_Unknown;
319 };
320 
322 class DocEmoji : public DocNode
323 {
324  public:
325  DocEmoji(DocParser *parser,DocNodeVariant *parent,const QCString &symName);
326  QCString name() const { return m_symName; }
327  int index() const { return m_index; }
328 
329  private:
330  QCString m_symName;
331  int m_index = 0;
332 };
333 
335 class DocWhiteSpace : public DocNode
336 {
337  public:
338  DocWhiteSpace(DocParser *parser,DocNodeVariant *parent,const QCString &chars)
339  : DocNode(parser,parent), m_chars(chars) {}
340  QCString chars() const { return m_chars; }
341  private:
342  QCString m_chars;
343 };
344 
346 class DocSeparator : public DocNode
347 {
348  public:
349  DocSeparator(DocParser *parser,DocNodeVariant *parent,const QCString &chars)
350  : DocNode(parser,parent), m_chars(chars) {}
351  QCString chars() const { return m_chars; }
352  private:
353  QCString m_chars;
354 };
355 
357 class DocVerbatim : public DocNode
358 {
359  public:
360  enum Type { Code, HtmlOnly, ManOnly, LatexOnly, RtfOnly, XmlOnly, Verbatim, Dot, Msc, DocbookOnly, PlantUML, JavaDocCode, JavaDocLiteral };
361  DocVerbatim(DocParser *parser,DocNodeVariant *parent,const QCString &context,
362  const QCString &text, Type t,bool isExample,
363  const QCString &exampleFile,bool isBlock=FALSE,const QCString &lang=QCString());
364  Type type() const { return p->type; }
365  QCString text() const { return p->text; }
366  QCString context() const { return p->context; }
367  bool isExample() const { return p->isExample; }
368  QCString exampleFile() const { return p->exampleFile; }
369  QCString relPath() const { return p->relPath; }
370  QCString language() const { return p->lang; }
371  bool isBlock() const { return p->isBlock; }
372  bool hasCaption() const { return !p->children.empty(); }
373  QCString width() const { return p->width; }
374  QCString height() const { return p->height; }
375  QCString engine() const { return p->engine; }
376  bool useBitmap() const { return p->useBitmap; }
377  const DocNodeList &children() const { return p->children; }
378  DocNodeList &children() { return p->children; }
379  QCString srcFile() const { return p->srcFile; }
380  int srcLine() const { return p->srcLine; }
381  void setText(const QCString &t) { p->text=t; }
382  void setWidth(const QCString &w) { p->width=w; }
383  void setHeight(const QCString &h) { p->height=h; }
384  void setEngine(const QCString &e) { p->engine=e; }
385  void setUseBitmap(const bool &u) { p->useBitmap=u; }
386  void setLocation(const QCString &file,int line) { p->srcFile=file; p->srcLine=line; }
387 
388  private:
389  struct Private
390  {
391  Private(const QCString &context_,const QCString &text_, Type type_, bool isExample_,
392  const QCString &exampleFile_, const QCString &relPath_,const QCString &lang_, bool isBlock_)
393  : context(context_), text(text_), type(type_), isExample(isExample_),
394  exampleFile(exampleFile_), relPath(relPath_), lang(lang_), isBlock(isBlock_) {}
395  QCString context;
396  QCString text;
397  Type type = Code;
398  bool isExample;
399  QCString exampleFile;
400  QCString relPath;
401  QCString lang;
402  bool isBlock;
403  QCString width;
404  QCString height;
405  QCString engine;
406  bool useBitmap=false; // some PlantUML engines cannot output data in EPS format so bitmap format is required
407  DocNodeList children;
408  QCString srcFile;
409  int srcLine = -1;
410  };
411  std::unique_ptr<Private> p;
412 };
413 
414 
416 class DocInclude : public DocNode
417 {
418  public:
419  enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude,
420  IncWithLines, Snippet , IncludeDoc, SnippetDoc, SnipWithLines,
421  DontIncWithLines, RtfInclude, ManInclude, DocbookInclude, XmlInclude,
422  SnippetTrimLeft};
423  DocInclude(DocParser *parser,DocNodeVariant *parent,const QCString &file,
424  const QCString &context, Type t,
425  bool isExample,const QCString &exampleFile,
426  const QCString &blockId, bool isBlock)
427  : DocNode(parser,parent), m_file(file), m_context(context), m_type(t),
428  m_isExample(isExample), m_isBlock(isBlock),
429  m_exampleFile(exampleFile), m_blockId(blockId) {}
430  QCString file() const { return m_file; }
431  QCString extension() const { int i=m_file.findRev('.');
432  if (i!=-1)
433  return m_file.right(m_file.length()-static_cast<uint32_t>(i));
434  else
435  return QCString();
436  }
437  Type type() const { return m_type; }
438  QCString text() const { return m_text; }
439  QCString context() const { return m_context; }
440  QCString blockId() const { return m_blockId; }
441  bool isExample() const { return m_isExample; }
442  QCString exampleFile() const { return m_exampleFile; }
443  bool isBlock() const { return m_isBlock; }
444  void parse();
445 
446  private:
447  QCString m_file;
448  QCString m_context;
449  QCString m_text;
450  Type m_type;
451  bool m_isExample;
452  bool m_isBlock;
453  QCString m_exampleFile;
454  QCString m_blockId;
455 };
456 
458 class DocIncOperator : public DocNode
459 {
460  public:
461  enum Type { Line, SkipLine, Skip, Until };
462  DocIncOperator(DocParser *parser,DocNodeVariant *parent,Type t,const QCString &pat,
463  const QCString &context,bool isExample,const QCString &exampleFile)
464  : DocNode(parser,parent), m_type(t), m_pattern(pat), m_context(context),
465  m_isFirst(FALSE), m_isLast(FALSE),
466  m_isExample(isExample), m_exampleFile(exampleFile) {}
467  Type type() const { return m_type; }
468  const char *typeAsString() const
469  {
470  switch(m_type)
471  {
472  case Line: return "line";
473  case SkipLine: return "skipline";
474  case Skip: return "skip";
475  case Until: return "until";
476  }
477  return "";
478  }
479  int line() const { return m_line; }
480  bool showLineNo() const { return m_showLineNo; }
481  QCString text() const { return m_text; }
482  QCString pattern() const { return m_pattern; }
483  QCString context() const { return m_context; }
484  bool isFirst() const { return m_isFirst; }
485  bool isLast() const { return m_isLast; }
486  void markFirst(bool v=TRUE) { m_isFirst = v; }
487  void markLast(bool v=TRUE) { m_isLast = v; }
488  bool isExample() const { return m_isExample; }
489  QCString exampleFile() const { return m_exampleFile; }
490  QCString includeFileName() const { return m_includeFileName; }
491  void parse();
492 
493  private:
494  Type m_type = Line;
495  int m_line = 0;
496  bool m_showLineNo = false;
497  QCString m_text;
498  QCString m_pattern;
499  QCString m_context;
500  bool m_isFirst = false;
501  bool m_isLast = false;
502  bool m_isExample = false;
503  QCString m_exampleFile;
504  QCString m_includeFileName;
505 };
506 
508 class DocFormula : public DocNode
509 {
510  public:
511  DocFormula(DocParser *parser,DocNodeVariant *parent,int id);
512  QCString name() const { return m_name; }
513  QCString text() const { return m_text; }
514  QCString relPath() const { return m_relPath; }
515  int id() const { return m_id; }
516  bool isInline() const
517  {
518  if (m_text.length()>1 && m_text.at(0)=='\\' && m_text.at(1)=='[') return false;
519  if (m_text.startsWith("\\begin{")) return false;
520  return true;
521  }
522 
523  private:
524  QCString m_name;
525  QCString m_text;
526  QCString m_relPath;
527  int m_id = 0;
528 };
529 
531 class DocIndexEntry : public DocNode
532 {
533  public:
534  DocIndexEntry(DocParser *parser,DocNodeVariant *parent,const Definition *scope,const MemberDef *md)
535  : DocNode(parser,parent), m_scope(scope), m_member(md) {}
536  int parse();
537  const Definition *scope() const { return m_scope; }
538  const MemberDef *member() const { return m_member; }
539  QCString entry() const { return m_entry; }
540 
541  private:
542  QCString m_entry;
543  const Definition *m_scope = 0;
544  const MemberDef *m_member = 0;
545 };
546 
547 //-----------------------------------------------------------------------
548 
551 {
552  public:
553  DocAutoList(DocParser *parser,DocNodeVariant *parent,int indent,bool isEnumList,int depth);
554  bool isEnumList() const { return m_isEnumList; }
555  int indent() const { return m_indent; }
556  int depth() const { return m_depth; }
557  int parse();
558 
559  private:
560  int m_indent = 0;
561  bool m_isEnumList = false;
562  int m_depth = 0;
563 };
564 
567 {
568  public:
569  DocAutoListItem(DocParser *parser,DocNodeVariant *parent,int indent,int num);
570  int itemNumber() const { return m_itemNum; }
571  int parse();
572 
573  private:
574  int m_indent = 0;
575  int m_itemNum = 0;
576 };
577 
579 class DocTitle : public DocCompoundNode
580 {
581  public:
582  DocTitle(DocParser *parser,DocNodeVariant *parent) : DocCompoundNode(parser,parent) {}
583  void parse();
584  void parseFromString(DocNodeVariant *,const QCString &title);
585  bool hasTitle() const { return !children().empty(); }
586 
587  private:
588 };
589 
592 {
593  public:
594  DocXRefItem(DocParser *parser,DocNodeVariant *parent,int id,const QCString &key);
595  QCString file() const { return m_file; }
596  QCString anchor() const { return m_anchor; }
597  QCString title() const { return m_title; }
598  QCString relPath() const { return m_relPath; }
599  QCString key() const { return m_key; }
600  bool parse();
601 
602  private:
603  int m_id = 0;
604  QCString m_key;
605  QCString m_file;
606  QCString m_anchor;
607  QCString m_title;
608  QCString m_relPath;
609 };
610 
612 class DocImage : public DocCompoundNode
613 {
614  public:
615  enum Type { Html, Latex, Rtf, DocBook, Xml };
616  DocImage(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs,
617  const QCString &name,Type t,const QCString &url=QCString(), bool inlineImage = TRUE);
618  Type type() const { return p->type; }
619  QCString name() const { return p->name; }
620  bool hasCaption() const { return !children().empty(); }
621  QCString width() const { return p->width; }
622  QCString height() const { return p->height; }
623  QCString relPath() const { return p->relPath; }
624  QCString url() const { return p->url; }
625  bool isInlineImage() const { return p->inlineImage; }
626  bool isSVG() const;
627  const HtmlAttribList &attribs() const { return p->attribs; }
628  void parse();
629 
630  private:
631  struct Private
632  {
633  Private(const HtmlAttribList &attribs_,const QCString &name_,Type type_,
634  const QCString &relPath_, const QCString &url_,bool inlineImage_)
635  : attribs(attribs_), name(name_), type(type_),
636  relPath(relPath_), url(url_), inlineImage(inlineImage_) {}
637  HtmlAttribList attribs;
638  QCString name;
639  Type type = Html;
640  QCString width;
641  QCString height;
642  QCString relPath;
643  QCString url;
644  bool inlineImage;
645  };
646  std::unique_ptr<Private> p;
647 };
648 
650 {
651  public:
652  DocDiagramFileBase(DocParser *parser, DocNodeVariant *parent,const QCString &name,
653  const QCString &context, const QCString &srcFile,int srcLine)
654  : DocCompoundNode(parser,parent), p(std::make_unique<Private>(name, context, srcFile, srcLine)) {}
655  QCString name() const { return p->name; }
656  QCString file() const { return p->file; }
657  QCString relPath() const { return p->relPath; }
658  bool hasCaption() const { return !children().empty(); }
659  QCString width() const { return p->width; }
660  QCString height() const { return p->height; }
661  QCString context() const { return p->context; }
662  QCString srcFile() const { return p->srcFile; }
663  int srcLine() const { return p->srcLine; }
664 
665  protected:
666  struct Private
667  {
668  Private(const QCString &name_,const QCString &context_,const QCString &srcFile_,int srcLine_)
669  : name(name_), context(context_), srcFile(srcFile_), srcLine(srcLine_) {}
670  QCString name;
671  QCString file;
672  QCString relPath;
673  QCString width;
674  QCString height;
675  QCString context;
676  QCString srcFile;
677  int srcLine;
678  };
679  std::unique_ptr<Private> p;
680 };
681 
684 {
685  public:
686  DocDotFile(DocParser *parser,DocNodeVariant *parent,const QCString &name,const QCString &context,
687  const QCString &srcFile,int srcLine);
688  bool parse();
689 };
690 
693 {
694  public:
695  DocMscFile(DocParser *parser,DocNodeVariant *parent,const QCString &name,const QCString &context,
696  const QCString &srcFile,int srcLine);
697  bool parse();
698 };
699 
702 {
703  public:
704  DocDiaFile(DocParser *parser,DocNodeVariant *parent,const QCString &name,const QCString &context,
705  const QCString &srcFile,int srcLine);
706  bool parse();
707 };
708 
711 {
712  public:
713  DocVhdlFlow(DocParser *parser,DocNodeVariant *parent);
714  void parse();
715  bool hasCaption() const { return !children().empty(); }
716  private:
717 };
718 
720 class DocLink : public DocCompoundNode
721 {
722  public:
723  DocLink(DocParser *parser,DocNodeVariant *parent,const QCString &target);
724  QCString parse(bool,bool isXmlLink=FALSE);
725  QCString file() const { return m_file; }
726  QCString relPath() const { return m_relPath; }
727  QCString ref() const { return m_ref; }
728  QCString anchor() const { return m_anchor; }
729 
730  private:
731  QCString m_file;
732  QCString m_relPath;
733  QCString m_ref;
734  QCString m_anchor;
735  QCString m_refText;
736 };
737 
739 class DocRef : public DocCompoundNode
740 {
741  public:
742  DocRef(DocParser *parser,DocNodeVariant *parent,const QCString &target,const QCString &context);
743  void parse();
744  QCString file() const { return m_file; }
745  QCString relPath() const { return m_relPath; }
746  QCString ref() const { return m_ref; }
747  QCString anchor() const { return m_anchor; }
748  QCString targetTitle() const { return m_text; }
749  SectionType sectionType() const { return m_sectionType; }
750  bool hasLinkText() const { return !children().empty(); }
751  bool refToAnchor() const { return m_refType==Anchor; }
752  bool refToSection() const { return m_refType==Section; }
753  bool refToTable() const { return m_refType==Table; }
754  bool isSubPage() const { return m_isSubPage; }
755 
756  private:
757  RefType m_refType = Unknown;
758  SectionType m_sectionType = SectionType::Anchor;
759  bool m_isSubPage = false;
760  QCString m_file;
761  QCString m_relPath;
762  QCString m_ref;
763  QCString m_anchor;
764  QCString m_text;
765 };
766 
769 {
770  public:
771  DocInternalRef(DocParser *parser,DocNodeVariant *parent,const QCString &target);
772  void parse();
773  QCString file() const { return m_file; }
774  QCString relPath() const { return m_relPath; }
775  QCString anchor() const { return m_anchor; }
776 
777  private:
778  QCString m_file;
779  QCString m_relPath;
780  QCString m_anchor;
781 };
782 
784 class DocHRef : public DocCompoundNode
785 {
786  public:
787  DocHRef(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs,const QCString &url,
788  const QCString &relPath, const QCString &file)
789  : DocCompoundNode(parser,parent), m_attribs(attribs), m_url(url),
790  m_relPath(relPath), m_file(file) {}
791  int parse();
792  QCString url() const { return m_url; }
793  QCString file() const { return m_file; }
794  QCString relPath() const { return m_relPath; }
795  const HtmlAttribList &attribs() const { return m_attribs; }
796 
797  private:
798  HtmlAttribList m_attribs;
799  QCString m_url;
800  QCString m_relPath;
801  QCString m_file;
802 };
803 
806 {
807  public:
808  DocHtmlSummary(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs) :
809  DocCompoundNode(parser,parent), m_attribs(attribs) {}
810  const HtmlAttribList &attribs() const { return m_attribs; }
811  void parse();
812 
813  private:
814  HtmlAttribList m_attribs;
815 };
816 
819 {
820  public:
821  DocHtmlDetails(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs) :
822  DocCompoundNode(parser,parent), m_attribs(attribs) {}
823  const HtmlAttribList &attribs() const { return m_attribs; }
824  int parse();
825  void parseSummary(DocNodeVariant *,HtmlAttribList &attribs);
826  const DocNodeVariant *summary() const { return m_summary.get(); }
827 
828  private:
829  HtmlAttribList m_attribs;
830  std::unique_ptr<DocNodeVariant> m_summary;
831 };
832 
835 {
836  public:
837  DocHtmlHeader(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs,int level) :
838  DocCompoundNode(parser,parent), m_level(level), m_attribs(attribs) {}
839  int level() const { return m_level; }
840  const HtmlAttribList &attribs() const { return m_attribs; }
841  int parse();
842 
843  private:
844  int m_level = 0;
845  HtmlAttribList m_attribs;
846 };
847 
850 {
851  public:
852  DocHtmlDescTitle(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs) :
853  DocCompoundNode(parser,parent), m_attribs(attribs) {}
854  const HtmlAttribList &attribs() const { return m_attribs; }
855  int parse();
856 
857  private:
858  HtmlAttribList m_attribs;
859 };
860 
863 {
864  public:
865  DocHtmlDescList(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs) :
866  DocCompoundNode(parser,parent), m_attribs(attribs) {}
867  const HtmlAttribList &attribs() const { return m_attribs; }
868  int parse();
869 
870  private:
871  HtmlAttribList m_attribs;
872 };
873 
876 {
877  public:
878  DocSection(DocParser *parser,DocNodeVariant *parent,int level,const QCString &id) :
879  DocCompoundNode(parser,parent), m_level(level), m_id(id) {}
880  int level() const { return m_level; }
881  QCString title() const { return m_title; }
882  QCString anchor() const { return m_anchor; }
883  QCString id() const { return m_id; }
884  QCString file() const { return m_file; }
885  int parse();
886 
887  private:
888  int m_level = 0;
889  QCString m_id;
890  QCString m_title;
891  QCString m_anchor;
892  QCString m_file;
893 };
894 
897 {
898  public:
899  DocSecRefItem(DocParser *parser,DocNodeVariant *parent,const QCString &target);
900  QCString target() const { return m_target; }
901  QCString file() const { return m_file; }
902  QCString anchor() const { return m_anchor; }
903  QCString relPath() const { return m_relPath; }
904  QCString ref() const { return m_ref; }
905  bool refToTable() const { return m_refType==Table; }
906  bool isSubPage() const { return m_isSubPage; }
907  void parse();
908 
909  private:
910  QCString m_target;
911  RefType m_refType = Unknown;
912  bool m_isSubPage = false;
913  QCString m_file;
914  QCString m_relPath;
915  QCString m_ref;
916  QCString m_anchor;
917 };
918 
921 {
922  public:
923  DocSecRefList(DocParser *parser,DocNodeVariant *parent) : DocCompoundNode(parser,parent) {}
924  void parse();
925 
926  private:
927 };
928 
931 {
932  public:
933  DocInternal(DocParser *parser,DocNodeVariant *parent) : DocCompoundNode(parser,parent) {}
934  int parse(int);
935 
936  private:
937 };
938 
941 {
942  public:
943  DocParBlock(DocParser *parser,DocNodeVariant *parent) : DocCompoundNode(parser,parent) {}
944  int parse();
945 
946  private:
947 };
948 
949 
952 {
953  public:
954  DocSimpleList(DocParser *parser,DocNodeVariant *parent) : DocCompoundNode(parser,parent) {}
955  int parse();
956 
957  private:
958 };
959 
962 {
963  public:
964  enum Type { Unordered, Ordered };
965  DocHtmlList(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs,Type t) :
966  DocCompoundNode(parser,parent), m_type(t), m_attribs(attribs) {}
967  Type type() const { return m_type; }
968  const HtmlAttribList &attribs() const { return m_attribs; }
969  int parse();
970  int parseXml();
971 
972  private:
973  Type m_type = Unordered;
974  HtmlAttribList m_attribs;
975 };
976 
979 {
980  public:
981  enum Type
982  {
983  Unknown, See, Return, Author, Authors, Version, Since, Date,
984  Note, Warning, Copyright, Pre, Post, Invar, Remark, Attention, User, Rcs
985  };
986  DocSimpleSect(DocParser *parser,DocNodeVariant *parent,Type t);
987  Type type() const { return m_type; }
988  QCString typeString() const;
989  int parse(bool userTitle,bool needsSeparator);
990  int parseRcs();
991  int parseXml();
992  void appendLinkWord(const QCString &word);
993  bool hasTitle() const;
994  const DocNodeVariant *title() const { return m_title.get(); }
995 
996  private:
997  Type m_type = Unknown;
998  std::unique_ptr<DocNodeVariant> m_title;
999 };
1000 
1005 {
1006  public:
1007  DocSimpleSectSep(DocParser *parser,DocNodeVariant *parent) : DocNode(parser,parent) {}
1008 
1009  private:
1010 };
1011 
1014 {
1015  friend class DocParamList;
1016  public:
1017  enum Type
1018  {
1019  Unknown, Param, RetVal, Exception, TemplateParam
1020  };
1021  enum Direction
1022  {
1023  In=1, Out=2, InOut=3, Unspecified=0
1024  };
1025  DocParamSect(DocParser *parser,DocNodeVariant *parent,Type t)
1026  : DocCompoundNode(parser,parent), m_type(t), m_hasInOutSpecifier(FALSE), m_hasTypeSpecifier(FALSE)
1027  {}
1028  int parse(const QCString &cmdName,bool xmlContext,Direction d);
1029  Type type() const { return m_type; }
1030  bool hasInOutSpecifier() const { return m_hasInOutSpecifier; }
1031  bool hasTypeSpecifier() const { return m_hasTypeSpecifier; }
1032 
1033  private:
1034  Type m_type = Unknown;
1035  bool m_hasInOutSpecifier = false;
1036  bool m_hasTypeSpecifier = false;
1037 };
1038 
1040 class DocPara : public DocCompoundNode
1041 {
1042  public:
1043  DocPara(DocParser *parser,DocNodeVariant *parent);
1044  int parse();
1045  bool isEmpty() const { return children().empty(); }
1046  void markFirst(bool v=TRUE) { m_isFirst=v; }
1047  void markLast(bool v=TRUE) { m_isLast=v; }
1048  bool isFirst() const { return m_isFirst; }
1049  bool isLast() const { return m_isLast; }
1050 
1051  int handleCommand(const QCString &cmdName,const int tok);
1052  int handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &tagHtmlAttribs);
1053  int handleHtmlEndTag(const QCString &tagName);
1054  int handleSimpleSection(DocSimpleSect::Type t,bool xmlContext=FALSE);
1055  int handleXRefItem();
1056  int handleParamSection(const QCString &cmdName,DocParamSect::Type t, bool xmlContext, int direction);
1057  void handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type t);
1058  template<class T> void handleFile(const QCString &cmdName);
1059  void handleInclude(const QCString &cmdName,DocInclude::Type t);
1060  void handleLink(const QCString &cmdName,bool isJavaLink);
1061  void handleCite();
1062  void handleDoxyConfig();
1063  void handleEmoji();
1064  void handleRef(const QCString &cmdName);
1065  void handleSection(const QCString &cmdName);
1066  void handleInheritDoc();
1067  void handleVhdlFlow();
1068  void handleILine();
1069  void handleIFile();
1070  void handleShowDate();
1071  int handleStartCode();
1072  int handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs,int level);
1073 
1074  bool injectToken(int tok,const QCString &tokText);
1075  const HtmlAttribList &attribs() const { return m_attribs; }
1076  void setAttribs(const HtmlAttribList &attribs) { m_attribs = attribs; }
1077 
1078  private:
1079  bool m_isFirst = false;
1080  bool m_isLast = false;
1081  HtmlAttribList m_attribs;
1082 };
1083 
1085 class DocParamList : public DocNode
1086 {
1087  public:
1088  DocParamList(DocParser *parser,DocNodeVariant *parent,DocParamSect::Type t,DocParamSect::Direction d)
1089  : DocNode(parser,parent), m_type(t), m_dir(d) {}
1090  const DocNodeList &parameters() const { return m_params; }
1091  const DocNodeList &paramTypes() const { return m_paramTypes; }
1092  const DocNodeList &paragraphs() const { return m_paragraphs; }
1093  DocParamSect::Type type() const { return m_type; }
1094  DocParamSect::Direction direction() const { return m_dir; }
1095  void markFirst(bool b=TRUE) { m_isFirst=b; }
1096  void markLast(bool b=TRUE) { m_isLast=b; }
1097  bool isFirst() const { return m_isFirst; }
1098  bool isLast() const { return m_isLast; }
1099  int parse(const QCString &cmdName);
1100  int parseXml(const QCString &paramName);
1101 
1102  private:
1103  DocNodeList m_paragraphs;
1104  DocNodeList m_params;
1105  DocNodeList m_paramTypes;
1106  DocParamSect::Type m_type = DocParamSect::Unknown;
1107  DocParamSect::Direction m_dir = DocParamSect::Unspecified;
1108  bool m_isFirst = false;
1109  bool m_isLast = false;
1110 };
1111 
1114 {
1115  public:
1116  DocSimpleListItem(DocParser *parser,DocNodeVariant *parent);
1117  int parse();
1118  const DocNodeVariant *paragraph() const { return m_paragraph.get(); }
1119 
1120  private:
1121  std::unique_ptr<DocNodeVariant> m_paragraph;
1122 };
1123 
1126 {
1127  public:
1128  DocHtmlListItem(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs,int num)
1129  : DocCompoundNode(parser,parent), m_attribs(attribs), m_itemNum(num) {}
1130  int itemNumber() const { return m_itemNum; }
1131  const HtmlAttribList &attribs() const { return m_attribs; }
1132  int parse();
1133  int parseXml();
1134 
1135  private:
1136  HtmlAttribList m_attribs;
1137  int m_itemNum = 0;
1138 };
1139 
1142 {
1143  public:
1144  DocHtmlDescData(DocParser *parser,DocNodeVariant *parent) : DocCompoundNode(parser,parent) {}
1145  const HtmlAttribList &attribs() const { return m_attribs; }
1146  int parse();
1147 
1148  private:
1149  HtmlAttribList m_attribs;
1150 };
1151 
1154 {
1155  friend class DocHtmlTable;
1156  public:
1157  enum Alignment { Left, Right, Center };
1158  enum Valignment {Top, Middle, Bottom};
1159  DocHtmlCell(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs,bool isHeading) :
1160  DocCompoundNode(parser,parent), m_isHeading(isHeading), m_attribs(attribs) {}
1161  bool isHeading() const { return m_isHeading; }
1162  bool isFirst() const { return m_isFirst; }
1163  bool isLast() const { return m_isLast; }
1164  void markFirst(bool v=TRUE) { m_isFirst=v; }
1165  void markLast(bool v=TRUE) { m_isLast=v; }
1166  const HtmlAttribList &attribs() const { return m_attribs; }
1167  int parse();
1168  int parseXml();
1169  uint32_t rowIndex() const { return m_rowIdx; }
1170  uint32_t columnIndex() const { return m_colIdx; }
1171  uint32_t rowSpan() const;
1172  uint32_t colSpan() const;
1173  Alignment alignment() const;
1174  Valignment valignment() const;
1175 
1176  private:
1177  void setRowIndex(uint32_t idx) { m_rowIdx = idx; }
1178  void setColumnIndex(uint32_t idx) { m_colIdx = idx; }
1179  bool m_isHeading = false;
1180  bool m_isFirst = false;
1181  bool m_isLast = false;
1182  HtmlAttribList m_attribs;
1183  uint32_t m_rowIdx = static_cast<uint32_t>(-1);
1184  uint32_t m_colIdx = static_cast<uint32_t>(-1);
1185 };
1186 
1189 {
1190  public:
1191  DocHtmlCaption(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs);
1192  const HtmlAttribList &attribs() const { return m_attribs; }
1193  int parse();
1194  bool hasCaptionId() const { return m_hasCaptionId; }
1195  QCString file() const { return m_file; }
1196  QCString anchor() const { return m_anchor; }
1197 
1198  private:
1199  HtmlAttribList m_attribs;
1200  bool m_hasCaptionId = false;
1201  QCString m_file;
1202  QCString m_anchor;
1203 };
1204 
1207 {
1208  friend class DocHtmlTable;
1209  public:
1210  DocHtmlRow(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs)
1211  : DocCompoundNode(parser,parent), m_attribs(attribs) {}
1212  size_t numCells() const { return children().size(); }
1213  const HtmlAttribList &attribs() const { return m_attribs; }
1214  int parse();
1215  int parseXml(bool header);
1216  bool isHeading() const;
1217  void setVisibleCells(uint32_t n) { m_visibleCells = n; }
1218  uint32_t visibleCells() const { return m_visibleCells; }
1219  uint32_t rowIndex() const { return m_rowIdx; }
1220 
1221  private:
1222  void setRowIndex(uint32_t idx) { m_rowIdx = idx; }
1223  HtmlAttribList m_attribs;
1224  uint32_t m_visibleCells = 0;
1225  uint32_t m_rowIdx = static_cast<uint32_t>(-1);
1226 };
1227 
1230 {
1231  public:
1232  DocHtmlTable(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs)
1233  : DocCompoundNode(parser,parent), m_attribs(attribs) {}
1234  size_t numRows() const { return children().size(); }
1235  bool hasCaption() const;
1236  const HtmlAttribList &attribs() const { return m_attribs; }
1237  int parse();
1238  int parseXml();
1239  size_t numColumns() const { return m_numCols; }
1240  const DocNodeVariant *caption() const;
1241  const DocNodeVariant *firstRow() const;
1242 
1243  private:
1244  void computeTableGrid();
1245  std::unique_ptr<DocNodeVariant> m_caption;
1246  HtmlAttribList m_attribs;
1247  size_t m_numCols = 0;
1248 };
1249 
1252 {
1253  public:
1254  DocHtmlBlockQuote(DocParser *parser,DocNodeVariant *parent,const HtmlAttribList &attribs)
1255  : DocCompoundNode(parser,parent), m_attribs(attribs) {}
1256  int parse();
1257  const HtmlAttribList &attribs() const { return m_attribs; }
1258 
1259  private:
1260  HtmlAttribList m_attribs;
1261 };
1262 
1264 class DocText : public DocCompoundNode
1265 {
1266  public:
1267  DocText(DocParser *parser) : DocCompoundNode(parser,0) {}
1268  void parse();
1269  bool isEmpty() const { return children().empty(); }
1270 };
1271 
1273 class DocRoot : public DocCompoundNode
1274 {
1275  public:
1276  DocRoot(DocParser *parser,bool indent,bool sl)
1277  : DocCompoundNode(parser,0), m_indent(indent), m_singleLine(sl) {}
1278  void parse();
1279  bool indent() const { return m_indent; }
1280  bool singleLine() const { return m_singleLine; }
1281  bool isEmpty() const { return children().empty(); }
1282 
1283  private:
1284  bool m_indent = false;
1285  bool m_singleLine = false;
1286 };
1287 
1288 //--------------------------------------------------------------------------------------
1289 
1291 constexpr DocNodeVariant *parent(DocNodeVariant *n)
1292 {
1293  return n ? std::visit([](auto &&x)->decltype(auto) { return x.parent(); }, *n) : nullptr;
1294 }
1295 
1297 constexpr const DocNodeVariant *parent(const DocNodeVariant *n)
1298 {
1299  return n ? std::visit([](auto &&x)->decltype(auto) { return x.parent(); }, *n) : nullptr;
1300 }
1301 
1302 namespace details
1303 {
1304 
1305 template<class T,class... Ts>
1306 struct Impl
1307 {
1308  static constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
1309  {
1310  return std::holds_alternative<T>(v) || Impl<Ts...>::holds_one_of_alternatives(v);
1311  }
1312 };
1313 
1314 template<class T>
1315 struct Impl<T>
1316 {
1317  static constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
1318  {
1319  return std::holds_alternative<T>(v);
1320  }
1321 };
1322 
1323 }
1324 
1326 template<class... Ts>
1327 constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
1328 {
1330 }
1331 
1332 //----------------- DocNodeList ---------------------------------------
1333 
1334 template<class T,class...Args>
1335 inline void DocNodeList::append(Args&&... args)
1336 {
1337  // add a DocNodeVariant to the list containing an node T as its active member.
1338  emplace_back(T(std::forward<Args>(args)...));
1339  // store a pointer to the variant holding node T inside the node itself.
1340  // Since DocNodeList is a GrowVector this reference will remain valid even if new
1341  // elements are added (which would not be the case if a std::vector was used)
1342  std::get_if<T>(&back())->setThisVariant(&back());
1343 }
1344 
1346 {
1347  for (auto &&elem : elements)
1348  {
1349  emplace_back(std::move(elem));
1350  }
1351  elements.clear();
1352 }
1353 
1354 template<class T>
1356 {
1357  return std::get_if<T>(&back());
1358 }
1359 
1360 // ---------------- Debug helpers -------------------------------
1361 
1362 #define DN(x) #x
1363 #define DN_SEP ,
1364 inline const char *docNodeName(const DocNodeVariant &v)
1365 {
1366  static const char *table[] = { DOC_NODES };
1367  return table[v.index()];
1368 }
1369 #undef DN
1370 #undef DN_SEP
1371 
1372 inline void dumpDocNodeSizes()
1373 {
1374 #define DN(x) #x
1375 #define DN_SEP ,
1376  static const char *tableWithNames[] = { DOC_NODES };
1377 #undef DN
1378 #undef DN_SEP
1379 
1380 #define DN(x) sizeof(x)
1381 #define DN_SEP ,
1382  static size_t tableWithSizes[] = { DOC_NODES };
1383 #undef DN
1384 #undef DN_SEP
1385 
1386  size_t maxSize=0;
1387  printf("DocNodeVariant(\n");
1388  for (size_t i=0;i<sizeof(tableWithNames)/sizeof(tableWithNames[0]);i++)
1389  {
1390  printf(" /* %2zu */ sizeof(%s)=%zu\n",i,tableWithNames[i],tableWithSizes[i]);
1391  if (tableWithSizes[i]>maxSize) maxSize = tableWithSizes[i];
1392  }
1393  printf(")=%zu\n",maxSize);
1394 }
1395 
1396 inline void dumpDocNodeList(const DocNodeList &children)
1397 {
1398  printf("children=[\n");
1399  for (const auto &child : children)
1400  {
1401  const DocWord *w = std::get_if<DocWord>(&child);
1402  printf(" %s (%p) %s\n",docNodeName(child),(void*)&child,qPrint(w?w->word():""));
1403  }
1404  printf("]\n");
1405 }
1406 
1407 //----------------------------------------------------------------------------------
1408 
1410 class DocNodeAST : public IDocNodeAST
1411 {
1412  public:
1413  template<class DocNode>
1414  DocNodeAST(DocNode &&r) : root(std::move(r))
1415  {
1416  std::get_if<DocNode>(&root)->setThisVariant(&root);
1417  }
1418  bool isEmpty() const override
1419  {
1420  if (std::holds_alternative<DocRoot>(root))
1421  {
1422  return std::get<DocRoot>(root).isEmpty();
1423  }
1424  else if (std::holds_alternative<DocText>(root))
1425  {
1426  return std::get<DocText>(root).isEmpty();
1427  }
1428  return false;
1429  }
1430  DocNodeVariant root;
1431 };
1432 
1433 template<class T,class... Args>
1434 std::unique_ptr<DocNodeVariant> createDocNode(Args&&...args)
1435 {
1436  auto node = std::make_unique<DocNodeVariant>(T(std::forward<Args>(args)...));
1437  std::get_if<T>(node.get())->setThisVariant(node.get());
1438  return node;
1439 }
1440 
1441 #endif
Node representing a separator.
Definition: docnode.h:346
Node representing an HTML blockquote.
Definition: docnode.h:1251
Node representing a URL (or email address)
Definition: docnode.h:188
Node representing a word.
Definition: docnode.h:153
Node representing some amount of white space.
Definition: docnode.h:335
Node representing a Hypertext reference.
Definition: docnode.h:784
Root node of a text fragment.
Definition: docnode.h:1264
Node representing a horizontal ruler.
Definition: docnode.h:216
The common base class of all entity definitions found in the sources.
Definition: definition.h:74
Node representing a simple section title.
Definition: docnode.h:579
Definition: docparser_p.h:92
A model of a class/file/namespace member symbol.
Definition: memberdef.h:46
Node representing a reference to some item.
Definition: docnode.h:739
Node representing a style change.
Definition: docnode.h:265
Node representing an auto List.
Definition: docnode.h:550
Node representing an emoji.
Definition: docnode.h:322
Node representing a citation of some bibliographic reference.
Definition: docnode.h:245
Node representing a HTML table caption.
Definition: docnode.h:1188
void move_append(DocNodeList &l)
moves the element of list l at the end of this list.
Definition: docnode.h:1345
Root node of documentation tree.
Definition: docnode.h:1273
Node representing a HTML table cell.
Definition: docnode.h:1153
Node representing an entry in the index.
Definition: docnode.h:531
bool isPreformatted() const
Definition: docnode.h:106
Node representing a simple section.
Definition: docnode.h:978
Node representing a paragraph in the documentation tree.
Definition: docnode.h:1040
Class representing the abstract syntax tree of a documentation block.
Definition: docnode.h:1410
DocNode(DocParser *parser, DocNodeVariant *parent)
Definition: docnode.h:81
std::vector like container optimised for pushing elements to the back.
Definition: growvector.h:37
Node representing a special symbol.
Definition: docnode.h:309
void setInsidePreformatted(bool p)
Definition: docnode.h:110
Node Html details.
Definition: docnode.h:818
Node representing a VHDL flow chart.
Definition: docnode.h:710
Node representing a Html description list.
Definition: docnode.h:862
Node representing a HTML list item.
Definition: docnode.h:1125
Node representing a msc file.
Definition: docnode.h:692
Node representing a verbatim, unparsed text fragment.
Definition: docnode.h:357
Node representing a Html description item.
Definition: docnode.h:849
Node Html heading.
Definition: docnode.h:834
Definition: docnode.h:666
Definition: docnode.h:1302
Node representing a HTML table.
Definition: docnode.h:1229
DocNodeVariant * parent()
Definition: docnode.h:91
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args...
Definition: docnode.h:1335
Node representing a dia file.
Definition: docnode.h:701
Node representing a HTML table row.
Definition: docnode.h:1206
opaque representation of the abstract syntax tree (AST)
Definition: docparser.h:46
Definition: docnode.h:119
Node representing a line break.
Definition: docnode.h:202
Node representing a list of section references.
Definition: docnode.h:920
Node representing a reference to a section.
Definition: docnode.h:896
Node representing an item of a cross-referenced list.
Definition: docnode.h:508
Node representing a parameter section.
Definition: docnode.h:1013
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T...
Definition: docnode.h:1355
Definition: docnode.h:1306
Node representing an image.
Definition: docnode.h:612
Node representing a parameter list.
Definition: docnode.h:1085
Node representing a normal section.
Definition: docnode.h:875
Node representing a Html list.
Definition: docnode.h:961
Node representing an internal reference to some item.
Definition: docnode.h:768
Node representing an included text block from file.
Definition: docnode.h:416
void setParent(DocNodeVariant *parent)
Definition: docnode.h:103
Node representing an block of paragraphs.
Definition: docnode.h:940
Node representing an anchor.
Definition: docnode.h:229
Abstract node interface with type information.
Definition: docnode.h:77
Node representing a separator between two simple sections of the same type.
Definition: docnode.h:1004
Node representing a simple list item.
Definition: docnode.h:1113
Node representing a HTML description data.
Definition: docnode.h:1141
Class representing a list of HTML attributes.
Definition: htmlattrib.h:30
This is an alternative implementation of QCString.
Definition: qcstring.h:92
Node representing a word that can be linked to something.
Definition: docnode.h:165
Node representing a simple list.
Definition: docnode.h:951
Node representing a dot file.
Definition: docnode.h:683
Node representing an item of a auto list.
Definition: docnode.h:566
Definition: docnode.h:649
Node representing an internal section of documentation.
Definition: docnode.h:930
Node representing an item of a cross-referenced list.
Definition: docnode.h:591
Node representing a include/dontinclude operator block.
Definition: docnode.h:458
Node Html summary.
Definition: docnode.h:805
Base class for nodes with children.
Definition: docnode.h:139