43 DN(DocWord) DN_SEP DN(DocLinkedWord) DN_SEP DN(DocURL) DN_SEP DN(DocLineBreak) DN_SEP DN(DocHorRuler) DN_SEP \
44 DN(DocAnchor) DN_SEP DN(DocCite) DN_SEP DN(DocStyleChange) DN_SEP DN(DocSymbol) DN_SEP DN(DocEmoji) DN_SEP \
45 DN(DocWhiteSpace) DN_SEP DN(DocSeparator) DN_SEP DN(DocVerbatim) DN_SEP DN(DocInclude) DN_SEP DN(DocIncOperator) DN_SEP \
46 DN(DocFormula) DN_SEP DN(DocIndexEntry) DN_SEP DN(DocAutoList) DN_SEP DN(DocAutoListItem) DN_SEP DN(DocTitle) DN_SEP \
47 DN(DocXRefItem) DN_SEP DN(DocImage) DN_SEP DN(DocDotFile) DN_SEP DN(DocMscFile) DN_SEP DN(DocDiaFile) DN_SEP \
48 DN(DocVhdlFlow) DN_SEP DN(DocLink) DN_SEP DN(DocRef) DN_SEP DN(DocInternalRef) DN_SEP DN(DocHRef) DN_SEP \
49 DN(DocHtmlHeader) DN_SEP DN(DocHtmlDescTitle) DN_SEP DN(DocHtmlDescList) DN_SEP DN(DocSection) DN_SEP DN(DocSecRefItem) DN_SEP \
50 DN(DocSecRefList) DN_SEP DN(DocInternal) DN_SEP DN(DocParBlock) DN_SEP DN(DocSimpleList) DN_SEP DN(DocHtmlList) DN_SEP \
51 DN(DocSimpleSect) DN_SEP DN(DocSimpleSectSep) DN_SEP DN(DocParamSect) DN_SEP DN(DocPara) DN_SEP DN(DocParamList) DN_SEP \
52 DN(DocSimpleListItem) DN_SEP DN(DocHtmlListItem) DN_SEP DN(DocHtmlDescData) DN_SEP DN(DocHtmlCell) DN_SEP DN(DocHtmlCaption) DN_SEP \
53 DN(DocHtmlRow) DN_SEP DN(DocHtmlTable) DN_SEP DN(DocHtmlBlockQuote) DN_SEP DN(DocText) DN_SEP DN(DocRoot) DN_SEP \
54 DN(DocHtmlDetails) DN_SEP DN(DocHtmlSummary) DN_SEP DN(DocPlantUmlFile) \
73#define DN(x) constexpr const char *docNodeName(const x &) { return #x; }
122 template<
class T,
class...Args>
123 void append(Args&&... args);
167 const QCString &
ref,
const QCString &
file,
359 enum Type {
Code,
HtmlOnly,
ManOnly,
LatexOnly,
RtfOnly,
XmlOnly,
Verbatim,
Dot,
Msc,
DocbookOnly,
PlantUML,
JavaDocCode,
JavaDocLiteral };
364 QCString
text()
const {
return p->text; }
372 QCString
width()
const {
return p->width; }
376 const DocNodeList &
children()
const {
return p->children; }
385 void setLocation(
const QCString &file,
int line) {
p->srcFile=file;
p->srcLine=line; }
390 Private(
const QCString &context_,
const QCString &text_,
Type type_,
bool isExample_,
391 const QCString &exampleFile_,
const QCString &relPath_,
const QCString &lang_,
bool isBlock_)
410 std::unique_ptr<Private>
p;
471 case Line:
return "line";
473 case Skip:
return "skip";
474 case Until:
return "until";
520 if (
m_text.startsWith(
"\\begin{"))
return false;
626 const QCString &
name,
Type t,
const QCString &
url=QCString(),
bool inlineImage =
TRUE);
628 QCString
name()
const {
return p->name; }
630 QCString
width()
const {
return p->width; }
633 QCString
url()
const {
return p->url; }
636 const HtmlAttribList &
attribs()
const {
return p->attribs; }
642 Private(
const HtmlAttribList &attribs_,
const QCString &name_,
Type type_,
643 const QCString &relPath_,
const QCString &url_,
bool inlineImage_)
655 std::unique_ptr<Private>
p;
664 QCString
name()
const {
return p->name; }
665 QCString
file()
const {
return p->file; }
668 QCString
width()
const {
return p->width; }
677 Private(
const QCString &name_,
const QCString &context_,
const QCString &srcFile_,
int srcLine_)
688 std::unique_ptr<Private>
p;
1008 Token
parse(
bool userTitle,
bool needsSeparator);
1047 Token
parse(
const QCString &cmdName,
bool xmlContext,
Direction d);
1071 Token
handleHtmlStartTag(
const QCString &tagName,
const HtmlAttribList &tagHtmlAttribs);
1077 template<
class T>
void handleFile(
const QCString &cmdName);
1079 void handleLink(
const QCString &cmdName,
bool isJavaLink);
1080 void handleCite(
char cmdChar,
const QCString &cmdName);
1082 void handleEmoji(
char cmdChar,
const QCString &cmdName);
1083 void handleRef(
char cmdChar,
const QCString &cmdName);
1087 void handleILine(
char cmdChar,
const QCString &cmdName);
1088 void handleIFile(
char cmdChar,
const QCString &cmdName);
1093 bool injectToken(Token tok,
const QCString &tokText);
1118 Token
parse(
const QCString &cmdName);
1119 Token
parseXml(
const QCString ¶mName);
1312 return n ? std::visit([](
auto &&x)->
decltype(
auto) {
return x.parent(); }, *n) :
nullptr;
1318 return n ? std::visit([](
auto &&x)->
decltype(
auto) {
return x.parent(); }, *n) :
nullptr;
1324template<
class T,
class... Ts>
1338 return std::holds_alternative<T>(v);
1345template<
class... Ts>
1355template <
typename T,
typename =
void>
1359template <
typename T>
1367 return std::visit([](
auto&& value) ->
DocNodeList* {
1369 return &value.children();
1378template<
class T,
class...Args>
1386 std::get_if<T>(&
back())->setThisVariant(&
back());
1392 return std::get_if<T>(&
back());
1401 static const char *table[] = {
DOC_NODES };
1402 return table[v.index()];
1411 static const char *tableWithNames[] = {
DOC_NODES };
1415#define DN(x) sizeof(x)
1417 static size_t tableWithSizes[] = {
DOC_NODES };
1422 printf(
"DocNodeVariant(\n");
1423 for (
size_t i=0;i<
sizeof(tableWithNames)/
sizeof(tableWithNames[0]);i++)
1425 printf(
" /* %2zu */ sizeof(%s)=%zu\n",i,tableWithNames[i],tableWithSizes[i]);
1426 if (tableWithSizes[i]>maxSize) maxSize = tableWithSizes[i];
1428 printf(
")=%zu\n",maxSize);
1433 printf(
"children=[\n");
1434 for (
const auto &child : children)
1436 const DocWord *w = std::get_if<DocWord>(&child);
1450 template<
class DocNode>
1453 std::get_if<DocNode>(&
root)->setThisVariant(&
root);
1457 if (std::holds_alternative<DocRoot>(
root))
1459 return std::get<DocRoot>(
root).isEmpty();
1461 else if (std::holds_alternative<DocText>(
root))
1463 return std::get<DocText>(
root).isEmpty();
1470template<
class T,
class... Args>
1473 auto node = std::make_unique<DocNodeVariant>(T(std::forward<Args>(args)...));
1474 std::get_if<T>(node.get())->setThisVariant(node.get());
The common base class of all entity definitions found in the sources.
const HtmlAttribList & attribs() const
DocAnchor(DocParser *parser, DocNodeVariant *parent, const QCString &id, bool newAnchor)
bool isCheckedList() const
DocAutoList(DocParser *parser, DocNodeVariant *parent, int indent, bool isEnumList, int depth, bool isCheckedList)
DocAutoListItem(DocParser *parser, DocNodeVariant *parent, int indent, int num)
DocCite(DocParser *parser, DocNodeVariant *parent, const QCString &target, const QCString &context)
const DocNodeList & children() const
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
DocDiaFile(DocParser *parser, DocNodeVariant *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
std::unique_ptr< Private > p
DocDiagramFileBase(DocParser *parser, DocNodeVariant *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
DocDotFile(DocParser *parser, DocNodeVariant *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
DocEmoji(DocParser *parser, DocNodeVariant *parent, const QCString &symName)
DocHRef(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, const QCString &url, const QCString &relPath, const QCString &file)
const HtmlAttribList & attribs() const
DocHorRuler(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const HtmlAttribList & attribs() const
DocHtmlBlockQuote(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const HtmlAttribList & attribs() const
bool hasCaptionId() const
DocHtmlCaption(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const HtmlAttribList & attribs() const
Valignment valignment() const
friend class DocHtmlTable
void setColumnIndex(uint32_t idx)
uint32_t columnIndex() const
void setRowIndex(uint32_t idx)
void markLast(bool v=TRUE)
uint32_t rowIndex() const
DocHtmlCell(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, bool isHeading)
void markFirst(bool v=TRUE)
Alignment alignment() const
const HtmlAttribList & attribs() const
DocHtmlDescData(DocParser *parser, DocNodeVariant *parent)
const HtmlAttribList & attribs() const
DocHtmlDescList(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const HtmlAttribList & attribs() const
DocHtmlDescTitle(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const HtmlAttribList & attribs() const
const HtmlAttribList & attribs() const
DocHtmlDetails(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
void parseSummary(DocNodeVariant *, HtmlAttribList &attribs)
const DocNodeVariant * summary() const
std::unique_ptr< DocNodeVariant > m_summary
const HtmlAttribList & attribs() const
DocHtmlList(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, Type t)
const HtmlAttribList & attribs() const
DocHtmlListItem(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, int num)
Token parseXml(bool header)
void setVisibleCells(uint32_t n)
friend class DocHtmlTable
DocHtmlRow(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
uint32_t rowIndex() const
const HtmlAttribList & attribs() const
void setRowIndex(uint32_t idx)
uint32_t visibleCells() const
const HtmlAttribList & attribs() const
DocHtmlSummary(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
std::unique_ptr< DocNodeVariant > m_caption
void computeTableGrid()
determines the location of all cells in a grid, resolving row and column spans.
size_t numColumns() const
const DocNodeVariant * caption() const
const HtmlAttribList & attribs() const
DocHtmlTable(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const DocNodeVariant * firstRow() const
const HtmlAttribList & attribs() const
DocImage(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, const QCString &name, Type t, const QCString &url=QCString(), bool inlineImage=TRUE)
std::unique_ptr< Private > p
bool isInlineImage() const
const char * typeAsString() const
bool stripCodeComments() const
void markFirst(bool v=TRUE)
QCString includeFileName() const
QCString m_includeFileName
QCString exampleFile() const
DocIncOperator(DocParser *parser, DocNodeVariant *parent, Type t, const QCString &pat, const QCString &context, bool stripCodeComments, bool isExample, const QCString &exampleFile)
void markLast(bool v=TRUE)
QCString extension() const
DocInclude(DocParser *parser, DocNodeVariant *parent, const QCString &file, const QCString &context, Type t, bool stripCodeComments, bool isExample, const QCString &exampleFile, const QCString &blockId, bool isBlock, bool trimLeft)
bool stripCodeComments() const
QCString exampleFile() const
const MemberDef * m_member
DocIndexEntry(DocParser *parser, DocNodeVariant *parent, const Definition *scope, const MemberDef *md)
const Definition * m_scope
const Definition * scope() const
const MemberDef * member() const
DocInternal(DocParser *parser, DocNodeVariant *parent)
DocInternalRef(DocParser *parser, DocNodeVariant *parent, const QCString &target)
DocLineBreak(DocParser *parser, DocNodeVariant *parent)
DocLineBreak(DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs)
const HtmlAttribList & attribs() const
DocLink(DocParser *parser, DocNodeVariant *parent, const QCString &target)
QCString parse(bool, bool isXmlLink=FALSE)
DocLinkedWord(DocParser *parser, DocNodeVariant *parent, const QCString &word, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &tooltip)
DocMscFile(DocParser *parser, DocNodeVariant *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
bool isEmpty() const override
void setParent(DocNodeVariant *parent)
DocNode(DocParser *parser, DocNodeVariant *parent)
const DocNodeVariant * thisVariant() const
void setInsidePreformatted(bool p)
DocNodeVariant * thisVariant()
DocNodeVariant * m_parent
bool isPreformatted() const
void setThisVariant(DocNodeVariant *thisVariant)
DocNodeVariant * parent()
DocNodeVariant * m_thisVariant
const DocNodeVariant * parent() const
const DocParser * parser() const
DocParBlock(DocParser *parser, DocNodeVariant *parent)
Token handleSimpleSection(DocSimpleSect::Type t, bool xmlContext=FALSE)
void handleLink(const QCString &cmdName, bool isJavaLink)
void handleCite(char cmdChar, const QCString &cmdName)
DocPara(DocParser *parser, DocNodeVariant *parent)
void handleInclude(const QCString &cmdName, DocInclude::Type t)
Token handleCommand(char cmdChar, const QCString &cmdName)
void handleDoxyConfig(char cmdChar, const QCString &cmdName)
void handleSection(char cmdChar, const QCString &cmdName)
void handleFile(const QCString &cmdName)
void handleIFile(char cmdChar, const QCString &cmdName)
Token handleParamSection(const QCString &cmdName, DocParamSect::Type t, bool xmlContext, int direction)
const HtmlAttribList & attribs() const
void markLast(bool v=TRUE)
Token handleHtmlStartTag(const QCString &tagName, const HtmlAttribList &tagHtmlAttribs)
void handleEmoji(char cmdChar, const QCString &cmdName)
void handleIncludeOperator(const QCString &cmdName, DocIncOperator::Type t)
void markFirst(bool v=TRUE)
void handleRef(char cmdChar, const QCString &cmdName)
void handleILine(char cmdChar, const QCString &cmdName)
void setAttribs(const HtmlAttribList &attribs)
Token handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs, int level)
void handleShowDate(char cmdChar, const QCString &cmdName)
Token handleHtmlEndTag(const QCString &tagName)
bool injectToken(Token tok, const QCString &tokText)
DocParamSect::Direction m_dir
const DocNodeList & parameters() const
const DocNodeList & paramTypes() const
void markFirst(bool b=TRUE)
DocParamSect::Type type() const
Token parseXml(const QCString ¶mName)
void markLast(bool b=TRUE)
Token parse(const QCString &cmdName)
DocParamList(DocParser *parser, DocNodeVariant *parent, DocParamSect::Type t, DocParamSect::Direction d)
DocParamSect::Type m_type
DocParamSect::Direction direction() const
const DocNodeList & paragraphs() const
bool hasInOutSpecifier() const
DocParamSect(DocParser *parser, DocNodeVariant *parent, Type t)
friend class DocParamList
Token parse(const QCString &cmdName, bool xmlContext, Direction d)
bool hasTypeSpecifier() const
DocPlantUmlFile(DocParser *parser, DocNodeVariant *parent, const QCString &name, const QCString &context, const QCString &srcFile, int srcLine)
SectionType m_sectionType
SectionType sectionType() const
QCString targetTitle() const
DocRef(DocParser *parser, DocNodeVariant *parent, const QCString &target, const QCString &context)
bool refToSection() const
DocRoot(DocParser *parser, bool indent, bool sl)
DocSecRefItem(DocParser *parser, DocNodeVariant *parent, const QCString &target)
DocSecRefList(DocParser *parser, DocNodeVariant *parent)
std::unique_ptr< DocNodeVariant > m_title
DocSection(DocParser *parser, DocNodeVariant *parent, int level, const QCString &id)
const DocNodeVariant * title() const
DocSeparator(DocParser *parser, DocNodeVariant *parent, const QCString &chars)
DocSimpleList(DocParser *parser, DocNodeVariant *parent)
std::unique_ptr< DocNodeVariant > m_paragraph
const DocNodeVariant * paragraph() const
DocSimpleListItem(DocParser *parser, DocNodeVariant *parent)
QCString typeString() const
Token parse(bool userTitle, bool needsSeparator)
DocSimpleSect(DocParser *parser, DocNodeVariant *parent, Type t)
const DocNodeVariant * title() const
void appendLinkWord(const QCString &word)
std::unique_ptr< DocNodeVariant > m_title
DocSimpleSectSep(DocParser *parser, DocNodeVariant *parent)
DocStyleChange(DocParser *parser, DocNodeVariant *parent, size_t position, Style s, const QCString &tagName, bool enable, const HtmlAttribList *attribs=nullptr)
const char * styleString() const
const HtmlAttribList & attribs() const
HtmlEntityMapper::SymType m_symbol
HtmlEntityMapper::SymType symbol() const
DocSymbol(DocParser *parser, DocNodeVariant *parent, HtmlEntityMapper::SymType s)
static HtmlEntityMapper::SymType decodeSymbol(const QCString &symName)
DocText(DocParser *parser)
void parseFromString(DocNodeVariant *, const QCString &title)
DocTitle(DocParser *parser, DocNodeVariant *parent)
DocURL(DocParser *parser, DocNodeVariant *parent, const QCString &url, bool isEmail)
DocVerbatim(DocParser *parser, DocNodeVariant *parent, const QCString &context, const QCString &text, Type t, bool isExample, const QCString &exampleFile, bool isBlock=FALSE, const QCString &lang=QCString())
QCString language() const
const DocNodeList & children() const
void setWidth(const QCString &w)
std::unique_ptr< Private > p
QCString exampleFile() const
void setHeight(const QCString &h)
void setLocation(const QCString &file, int line)
void setUseBitmap(const bool &u)
void setEngine(const QCString &e)
void setText(const QCString &t)
DocVhdlFlow(DocParser *parser, DocNodeVariant *parent)
DocWhiteSpace(DocParser *parser, DocNodeVariant *parent, const QCString &chars)
Node representing a word.
DocWord(DocParser *parser, DocNodeVariant *parent, const QCString &word)
DocXRefItem(DocParser *parser, DocNodeVariant *parent, int id, const QCString &key)
std::vector like container optimized for pushing elements to the back.
size_t size() const
returns the number of elements
bool empty() const
checks whether the container is empty
void emplace_back(Args &&...args)
opaque representation of the abstract syntax tree (AST)
A model of a class/file/namespace member symbol.
static constexpr int Anchor
#define ONLY_DEFAULT_MOVABLE(cls)
Macro to help implementing the rule of 5 for a class that can be moved but not copied.
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile > DocNodeVariant
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
DocNodeList * call_method_children(DocNodeVariant *v)
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
std::unique_ptr< DocNodeVariant > createDocNode(Args &&...args)
void dumpDocNodeList(const DocNodeList &children)
constexpr const char * docNodeName(const DocWord &)
const char * qPrint(const char *s)
Private(const QCString &name_, const QCString &context_, const QCString &srcFile_, int srcLine_)
Private(const HtmlAttribList &attribs_, const QCString &name_, Type type_, const QCString &relPath_, const QCString &url_, bool inlineImage_)
void move_append(DocNodeList &l)
moves the element of list l at the end of this list.
void append(Args &&... args)
Append a new DocNodeVariant to the list by constructing it with type T and parameters Args.
T * get_last()
Returns a pointer to the last element in the list if that element exists and holds a T,...
Private(const QCString &context_, const QCString &text_, Type type_, bool isExample_, const QCString &exampleFile_, const QCString &relPath_, const QCString &lang_, bool isBlock_)
static constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
static constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)