Doxygen
Loading...
Searching...
No Matches
docnode.cpp File Reference
#include "docnode.h"
#include "aliases.h"
#include "anchor.h"
#include "cite.h"
#include "cmdmapper.h"
#include "config.h"
#include "configimpl.h"
#include "configoptions.h"
#include "datetime.h"
#include "docparser_p.h"
#include "doctokenizer.h"
#include "doxygen.h"
#include "emoji.h"
#include "filedef.h"
#include "filename.h"
#include "formula.h"
#include "groupdef.h"
#include "htmlentity.h"
#include "language.h"
#include "markdown.h"
#include "mermaid.h"
#include "message.h"
#include "namespacedef.h"
#include "pagedef.h"
#include "plantuml.h"
#include "stringutil.h"
#include "trace.h"
#include "util.h"
#include "vhdldocgen.h"
Include dependency graph for docnode.cpp:

Go to the source code of this file.

Classes

struct  ActiveRowSpan
 Helper class to compute the grid for an HTML style table. More...

Macros

#define AUTO_TRACE(...)
#define AUTO_TRACE_ADD(...)
#define AUTO_TRACE_EXIT(...)
#define INTERNAL_ASSERT(x)

Typedefs

typedef std::vector< ActiveRowSpanRowSpanList
 List of ActiveRowSpan classes.

Functions

static void unescapeCRef (DString &s)
static DString stripKnownExtensions (const DString &text)
static void setParent (DocNodeVariant *n, DocNodeVariant *newParent)
static void flattenParagraphs (DocNodeVariant *root, DocNodeList &children)
static Token skipSpacesForTable (DocParser *parser)
static bool findAttribute (const HtmlAttribList &tagHtmlAttribs, const char *attrName, DString *result)
static bool checkIfHtmlEndTagEndsAutoList (DocParser *parser, const DocNodeVariant *n)

Variables

static const char * g_sectionLevelToName []
static const StringUnorderedSet g_plantumlEngine

Macro Definition Documentation

◆ AUTO_TRACE

#define AUTO_TRACE ( ...)
Value:
(void)0

Definition at line 53 of file docnode.cpp.

Referenced by MemberDefImpl::_computeLinkableInProject(), SymbolResolver::Private::accessibleViaUsingDefinition(), SymbolResolver::Private::accessibleViaUsingNamespace(), addClassAndNestedClasses(), addClassToContext(), ModuleDefImpl::addClassToModule(), addConceptToContext(), ModuleDefImpl::addConceptToModule(), ModuleManager::addDocs(), addEnumDocs(), addEnumValuesToEnums(), ModuleDefImpl::addExportedModule(), addGlobalFunction(), ModuleDefImpl::addHeader(), ModuleManager::addHeader(), ModuleDefImpl::addImport(), ModuleManager::addImport(), addInterfaceOrServiceToServiceOrSingleton(), addListReferences(), addLocalObjCMethod(), addMemberDocs(), addMemberFunction(), addMemberSpecialization(), ClassDefImpl::addMembersToTemplateInstance(), ClassDefImpl::addMemberToList(), ModuleDefImpl::addMemberToModule(), ClassDefImpl::addMemberToTemplateInstance(), addMethodToClass(), addRequirementReferences(), Markdown::Private::addStrEscapeUtf8Nbsp(), DirDefImpl::addUsesDependency(), addVariable(), addVariableToClass(), addVariableToFile(), adjustConfiguration(), buildClassDocList(), buildClassList(), buildConceptDocList(), buildConceptList(), buildDefineList(), buildDictionaryList(), buildDirectories(), buildFunctionList(), buildGroupListFiltered(), buildInterfaceAndServiceList(), buildNamespaceList(), buildSequenceList(), buildTypedefList(), buildVarList(), checkConfiguration(), ClassDefImpl::ClassDefImpl(), ModuleManager::collectExportedSymbols(), ModuleManager::collectExportedSymbolsRecursively(), combineDeclarationAndDefinition(), computeClassRelations(), computeCommonDirPrefix(), DirDefImpl::computeDependencies(), computeDirDependencies(), computeIndentExcludingListMarkers(), computeMemberReferences(), computeTemplateClassRelations(), ClassDefImpl::containsOverload(), ModuleManager::createModuleDef(), DirDefImpl::createNewDir(), createUsingMemberImportForClass(), ClassDefImpl::deepCopy(), DocParser::defaultHandleTitleAndSize(), DocParser::defaultHandleToken(), distributeConceptGroups(), DocRef::DocRef(), encodeDirName(), extractCanonicalType(), extractClassNameFromType(), Markdown::extractPageTitle(), Markdown::Private::extractTitleId(), filterMemberDocumentation(), findBaseClassesForClass(), CodeFragmentManager::Private::FragmentInfo::findBlockMarkers(), findClassRelation(), DocParser::findDocsForMemberOrCompound(), Markdown::Private::findEmphasisChar(), Markdown::Private::findEndOfLine(), findEnumDocumentation(), findEnums(), findFriends(), findFunctionPtr(), findGlobalMember(), findInheritedTemplateInstances(), findMember(), findMemberDocumentation(), findModuleDocumentation(), findObjCMethodDefinitions(), findTableColumns(), findTemplateInstanceRelation(), findUsedClassesForClass(), findUsedTemplateInstances(), findUsingDeclarations(), findUsingDeclImports(), findUsingDirectives(), SymbolResolver::Private::followPath(), generateDirDocs(), generateDocsForClassList(), generateOutput(), RequirementManager::generatePage(), generateXRefPages(), getCanonicalTemplateSpec(), getCanonicalTypeForIdentifier(), getDefs(), ClassDefImpl::getOutputFileBase(), DirDefImpl::getOutputFileBase(), SymbolResolver::Private::getResolvedSymbol(), SymbolResolver::Private::getResolvedSymbolRec(), SymbolResolver::Private::getResolvedType(), SymbolResolver::Private::getResolvedTypeRec(), DocParser::handleAHref(), DocParser::handleAnchor(), DocParser::handleCite(), DocPara::handleCommand(), handleCommentBlock(), DocPara::handleEmoji(), DocPara::handleFile(), DocPara::handleHtmlEndTag(), DocPara::handleHtmlHeader(), DocPara::handleHtmlStartTag(), DocParser::handleIFile(), DocParser::handleILine(), DocParser::handleImage(), DocParser::handleImg(), DocPara::handleInclude(), DocPara::handleIncludeOperator(), DocParser::handleInitialStyleCommands(), DocParser::handleInternalRef(), DocPara::handleLink(), DocParser::handleLinkedWord(), handleParametersCommentBlocks(), DocParser::handleParameterType(), DocPara::handleParamSection(), DocParser::handlePendingStyleCommands(), DocParser::handlePrefix(), DocParser::handleRef(), DocPara::handleSection(), DocPara::handleShowDate(), DocPara::handleSimpleSection(), DocPara::handleStartCode(), DocParser::handleStyleArgument(), DocParser::handleStyleEnter(), DocParser::handleStyleLeave(), DocParser::handleUnclosedStyleCommands(), DocPara::handleVhdlFlow(), DocPara::handleXRefItem(), hasLineBreak(), DocPara::injectToken(), ClassDefImpl::insertExplicitTemplateInstance(), ClassDefImpl::insertTemplateInstance(), ClassDefImpl::internalInsertMember(), DocParser::internalValidatingParseDoc(), SymbolResolver::isAccessibleFrom(), SymbolResolver::Private::isAccessibleFrom(), SymbolResolver::isAccessibleFromWithExpScope(), SymbolResolver::Private::isAccessibleFromWithExpScope(), Markdown::Private::isAtxHeader(), Markdown::Private::isBlockCommand(), isBlockQuote(), isCodeBlock(), isEmptyLine(), isEndOfList(), isExplicitPage(), isFencedCodeBlock(), Markdown::Private::isHeaderline(), isHRuler(), isLinkRef(), isListMarker(), Markdown::Private::isSpecialCommand(), isTableBlock(), isVarWithConstructor(), linkifyText(), makeTemplateInstanceRelation(), markdownFileNameToId(), matchArgument2(), matchArguments2(), matchCanonicalTypes(), matchTemplateArguments(), mergeArguments(), mergeCategories(), ClassDefImpl::mergeCategory(), DirDefImpl::mergeDirectoryInTree(), mergeScopes(), ModuleDefImpl::mergeSymbolsFrom(), SymbolResolver::Private::newResolveTypedef(), organizeSubGroupsFiltered(), DocAutoList::parse(), DocAutoListItem::parse(), DocHRef::parse(), DocHtmlBlockQuote::parse(), DocHtmlCaption::parse(), DocHtmlCell::parse(), DocHtmlDescData::parse(), DocHtmlDescList::parse(), DocHtmlDescTitle::parse(), DocHtmlDetails::parse(), DocHtmlHeader::parse(), DocHtmlList::parse(), DocHtmlListItem::parse(), DocHtmlRow::parse(), DocHtmlSummary::parse(), DocHtmlTable::parse(), DocInclude::parse(), DocIncOperator::parse(), DocIndexEntry::parse(), DocInternal::parse(), DocInternalRef::parse(), DocLink::parse(), DocPara::parse(), DocParamList::parse(), DocParamSect::parse(), DocParBlock::parse(), DocRef::parse(), DocRoot::parse(), DocSecRefItem::parse(), DocSecRefList::parse(), DocSection::parse(), DocSimpleSect::parse(), DocText::parse(), DocTitle::parse(), DocVhdlFlow::parse(), CodeFragmentManager::parseCodeFragment(), CommentScanner::parseCommentBlock(), parseCompounds(), parseFile(), parseFilesMultiThreading(), parseFilesSingleThreading(), COutlineParser::parseInput(), parseInput(), parseMain(), parsePrototype(), DocSimpleSect::parseRcs(), DocHtmlDetails::parseSummary(), DocHtmlCell::parseXml(), DocHtmlList::parseXml(), DocHtmlListItem::parseXml(), DocHtmlRow::parseXml(), DocHtmlTable::parseXml(), DocParamList::parseXml(), DocSimpleSect::parseXml(), Markdown::Private::processBlocks(), Markdown::Private::processCodeSpan(), DocParser::processCopyDoc(), Markdown::Private::processEmphasis(), Markdown::Private::processEmphasis1(), Markdown::Private::processEmphasis2(), Markdown::Private::processEmphasis3(), Preprocessor::processFile(), Markdown::Private::processHtmlTag(), Markdown::Private::processHtmlTagWrite(), Markdown::Private::processInline(), Markdown::Private::processLink(), Markdown::Private::processNmdash(), Markdown::Private::processQuotations(), Markdown::Private::processQuoted(), Markdown::Private::processSpecialCommand(), processTagLessClasses(), readIncludeFile(), DocParser::readTextFileByName(), readTextFileByName(), SymbolResolver::resolveClass(), ModuleManager::resolveImports(), resolveLink(), ModuleManager::resolvePartitions(), ModuleManager::resolvePartitionsRecursively(), resolveRef(), SymbolResolver::resolveSymbol(), resolveTemplateInstanceInType(), resolveTypeDef(), skipSpacesForTable(), stripIrrelevantString(), substituteTemplateArgumentsInString(), SymbolResolver::Private::substTypedef(), transferFunctionDocumentation(), transferFunctionReferences(), transferRelatedFunctionDocumentation(), transferStaticInstanceInitializers(), warnUndocumentedNamespaces(), Markdown::Private::writeBlockQuote(), DirDefImpl::writeBriefDescription(), Markdown::Private::writeCodeBlock(), DirDefImpl::writeDetailedDescription(), ClassDefImpl::writeDocumentation(), DirDefImpl::writeDocumentation(), DirRelation::writeDocumentation(), ModuleDefImpl::writeDocumentation(), ModuleDefImpl::writeExports(), Markdown::Private::writeFencedCodeBlock(), DirDefImpl::writeFileList(), ModuleDefImpl::writeFiles(), Markdown::Private::writeMarkdownImage(), Markdown::Private::writeOneLineHeaderOrRuler(), DirDefImpl::writeSubDirList(), and Markdown::Private::writeTableBlock().

◆ AUTO_TRACE_ADD

#define AUTO_TRACE_ADD ( ...)
Value:
(void)0

Definition at line 54 of file docnode.cpp.

Referenced by MemberDefImpl::_computeLinkableInProject(), SymbolResolver::Private::accessibleViaUsingDefinition(), SymbolResolver::Private::accessibleViaUsingNamespace(), addClassToContext(), addConceptToContext(), addEnumValuesToEnums(), ModuleManager::addHeader(), ModuleManager::addImport(), addLocalObjCMethod(), addMemberFunction(), DirDefImpl::addUsesDependency(), addVariable(), addVariableToClass(), addVariableToFile(), buildDefineList(), buildDirectories(), buildFunctionList(), buildGroupListFiltered(), buildNamespaceList(), buildTypedefList(), ModuleManager::collectExportedSymbols(), combineDeclarationAndDefinition(), computeCommonDirPrefix(), DirDefImpl::computeDependencies(), computeDirDependencies(), computeTemplateClassRelations(), DirDefImpl::createNewDir(), ClassDefImpl::deepCopy(), DocParser::defaultHandleToken(), distributeConceptGroups(), CodeFragmentManager::Private::FragmentInfo::findBlockMarkers(), findClassRelation(), findEnumDocumentation(), findEnums(), findFriends(), findGlobalMember(), findMember(), findTemplateInstanceRelation(), findUsedClassesForClass(), findUsingDeclarations(), findUsingDeclImports(), findUsingDirectives(), SymbolResolver::Private::followPath(), RequirementManager::generatePage(), getCanonicalTypeForIdentifier(), SymbolResolver::Private::getResolvedSymbol(), SymbolResolver::Private::getResolvedSymbolRec(), SymbolResolver::Private::getResolvedType(), SymbolResolver::Private::getResolvedTypeRec(), DocParser::handleImg(), DocParser::handleLinkedWord(), handleParametersCommentBlocks(), DocParser::handlePendingStyleCommands(), DocParser::handleStyleArgument(), ClassDefImpl::internalInsertMember(), SymbolResolver::Private::isAccessibleFrom(), SymbolResolver::Private::isAccessibleFromWithExpScope(), isLinkRef(), makeTemplateInstanceRelation(), mergeArguments(), mergeCategories(), ClassDefImpl::mergeCategory(), SymbolResolver::Private::newResolveTypedef(), organizeSubGroupsFiltered(), DocIncOperator::parse(), DocPara::parse(), CodeFragmentManager::parseCodeFragment(), parseCompounds(), parseInput(), Markdown::Private::processCodeSpan(), Markdown::Private::processSpecialCommand(), readIncludeFile(), SymbolResolver::resolveClass(), ModuleManager::resolveImports(), ModuleManager::resolvePartitionsRecursively(), resolveRef(), resolveTemplateInstanceInType(), resolveTypeDef(), skipSpacesForTable(), substituteTemplateArgumentsInString(), transferFunctionReferences(), transferRelatedFunctionDocumentation(), transferStaticInstanceInitializers(), Markdown::Private::writeBlockQuote(), DirDefImpl::writeFileList(), and DirDefImpl::writeSubDirList().

◆ AUTO_TRACE_EXIT

#define AUTO_TRACE_EXIT ( ...)
Value:
(void)0

Definition at line 55 of file docnode.cpp.

Referenced by SymbolResolver::Private::accessibleViaUsingDefinition(), SymbolResolver::Private::accessibleViaUsingNamespace(), ClassDefImpl::ClassDefImpl(), computeIndentExcludingListMarkers(), ClassDefImpl::containsOverload(), DocParser::defaultHandleTitleAndSize(), DocRef::DocRef(), encodeDirName(), extractCanonicalType(), extractClassNameFromType(), Markdown::extractPageTitle(), Markdown::Private::extractTitleId(), DocParser::findDocsForMemberOrCompound(), Markdown::Private::findEmphasisChar(), Markdown::Private::findEndOfLine(), findFunctionPtr(), findTableColumns(), SymbolResolver::Private::followPath(), getCanonicalTemplateSpec(), getCanonicalTypeForIdentifier(), SymbolResolver::Private::getResolvedSymbol(), SymbolResolver::Private::getResolvedSymbolRec(), SymbolResolver::Private::getResolvedType(), SymbolResolver::Private::getResolvedTypeRec(), DocPara::handleCommand(), DocPara::handleHtmlEndTag(), DocPara::handleHtmlStartTag(), DocPara::handleParamSection(), DocPara::handleStartCode(), DocParser::handleStyleArgument(), hasLineBreak(), DocParser::internalValidatingParseDoc(), SymbolResolver::isAccessibleFrom(), SymbolResolver::Private::isAccessibleFrom(), SymbolResolver::isAccessibleFromWithExpScope(), SymbolResolver::Private::isAccessibleFromWithExpScope(), Markdown::Private::isAtxHeader(), Markdown::Private::isBlockCommand(), isBlockQuote(), isCodeBlock(), isEmptyLine(), isEndOfList(), isExplicitPage(), isFencedCodeBlock(), Markdown::Private::isHeaderline(), isHRuler(), isLinkRef(), isListMarker(), Markdown::Private::isSpecialCommand(), isTableBlock(), isVarWithConstructor(), markdownFileNameToId(), matchArgument2(), matchTemplateArguments(), mergeScopes(), SymbolResolver::Private::newResolveTypedef(), DocAutoList::parse(), DocAutoListItem::parse(), DocHtmlBlockQuote::parse(), DocHtmlDetails::parse(), DocHtmlList::parse(), DocHtmlListItem::parse(), DocIndexEntry::parse(), DocInternal::parse(), DocPara::parse(), DocParamList::parse(), DocParamSect::parse(), DocParBlock::parse(), DocSection::parse(), DocSimpleSect::parse(), CommentScanner::parseCommentBlock(), DocHtmlList::parseXml(), DocHtmlListItem::parseXml(), DocParamList::parseXml(), DocSimpleSect::parseXml(), Markdown::Private::processCodeSpan(), DocParser::processCopyDoc(), Markdown::Private::processEmphasis(), Markdown::Private::processEmphasis1(), Markdown::Private::processEmphasis2(), Markdown::Private::processEmphasis3(), Markdown::Private::processHtmlTagWrite(), Markdown::Private::processLink(), Markdown::Private::processNmdash(), Markdown::Private::processQuoted(), Markdown::Private::processSpecialCommand(), SymbolResolver::resolveClass(), resolveLink(), SymbolResolver::resolveSymbol(), resolveTypeDef(), stripIrrelevantString(), substituteTemplateArgumentsInString(), SymbolResolver::Private::substTypedef(), Markdown::Private::writeBlockQuote(), Markdown::Private::writeCodeBlock(), and Markdown::Private::writeTableBlock().

◆ INTERNAL_ASSERT

#define INTERNAL_ASSERT ( x)
Value:
do {} while(0)

Definition at line 58 of file docnode.cpp.

Referenced by DocPara::handleCommand(), DocPara::parse(), and DocSection::parse().

Typedef Documentation

◆ RowSpanList

typedef std::vector<ActiveRowSpan> RowSpanList

List of ActiveRowSpan classes.

Definition at line 2498 of file docnode.cpp.

Function Documentation

◆ checkIfHtmlEndTagEndsAutoList()

bool checkIfHtmlEndTagEndsAutoList ( DocParser * parser,
const DocNodeVariant * n )
static

Definition at line 5717 of file docnode.cpp.

5718{
5719 // expected hierarchy:
5720 // 1. DocAutoListItem <- n
5721 // 2. DocAutoList <- parent(n)
5722 // 3. DocPara <- parent(parent(n))
5723
5724 // step 1
5725 if (!std::get_if<DocAutoListItem>(n)) // not inside a auto list item
5726 {
5727 return false;
5728 }
5729
5730 // step 2
5731 n = parent(n);
5732 int indent = 0;
5733 const auto &docAutoList = std::get_if<DocAutoList>(n);
5734 if (docAutoList) // capture indent
5735 {
5736 indent = docAutoList->indent();
5737 }
5738 else
5739 {
5740 return false;
5741 }
5742
5743 // step 3
5744 n = parent(n);
5745 const auto &docPara = std::get_if<DocPara>(n);
5746 if (docPara)
5747 {
5748 DString tagNameLower = DString(parser->context.token->name).lower();
5749 auto topStyleChange = [](const DocStyleChangeStack &stack) -> const DocStyleChange &
5750 {
5751 return std::get<DocStyleChange>(*stack.top());
5752 };
5753
5754 if (parser->context.styleStack.empty() || // no style change
5755 (topStyleChange(parser->context.styleStack).tagName()==tagNameLower && // correct style change
5756 topStyleChange(parser->context.styleStack).position()!=parser->context.nodeStack.size()) // wrong position, so normal close
5757 )
5758 {
5759 // insert an artificial 'end of autolist' marker and parse again
5760 DString indentStr;
5761 indentStr.fill(' ',indent);
5762 parser->tokenizer.unputString("\\ilinebr "+indentStr+".\\ilinebr"+indentStr+"</"+parser->context.token->name+">");
5763 return true;
5764 }
5765 }
5766 return false;
5767}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
DString fill(char c, size_t len)
Fills a string with a predefined character.
Definition dstring.h:278
DString lower() const
Definition dstring.h:326
DocTokenizer tokenizer
DocParserContext context
Node representing a style change.
Definition docnode.h:268
void unputString(const DString &tag)
DString name
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1335
IterableStack< const DocNodeVariant * > DocStyleChangeStack
Definition docparser_p.h:54
DocStyleChangeStack styleStack
Definition docparser_p.h:67
DocNodeStack nodeStack
Definition docparser_p.h:66
TokenInfo * token
Definition docparser_p.h:94

References DocParser::context, DString::fill(), DString::lower(), TokenInfo::name, DocParserContext::nodeStack, parent(), DocParserContext::styleStack, DocParserContext::token, DocParser::tokenizer, and DocTokenizer::unputString().

Referenced by DocPara::parse().

◆ findAttribute()

bool findAttribute ( const HtmlAttribList & tagHtmlAttribs,
const char * attrName,
DString * result )
static

Definition at line 5010 of file docnode.cpp.

5013{
5014
5015 for (const auto &opt : tagHtmlAttribs)
5016 {
5017 if (opt.name==attrName)
5018 {
5019 *result = opt.value;
5020 return true;
5021 }
5022 }
5023 return false;
5024}

Referenced by DocPara::handleHtmlStartTag().

◆ flattenParagraphs()

void flattenParagraphs ( DocNodeVariant * root,
DocNodeList & children )
static

Definition at line 864 of file docnode.cpp.

865{
866 DocNodeList newChildren;
867 for (auto &dn : children)
868 {
869 DocPara *para = std::get_if<DocPara>(&dn);
870 if (para)
871 {
872 //// move the children of the paragraph to the end of the newChildren list
873 newChildren.move_append(para->children());
874 }
875 }
876
877 // replace the children list by the newChildren list
878 children.clear();
879 children.move_append(newChildren);
880 // reparent the children
881 for (auto &cn : children)
882 {
883 setParent(&cn,root);
884 // we also need to set the parent for each child of cn, as cn's address may have changed.
885 auto opt_children = call_method_children(&cn);
886 if (opt_children)
887 {
888 for (auto &ccn : *opt_children)
889 {
890 setParent(&ccn,&cn);
891 }
892 }
893 }
894}
DocNodeList & children()
Definition docnode.h:143
void move_append(DocNodeList &l)
moves the element of list l at the end of this list.
Definition docnode.cpp:855
Node representing a paragraph in the documentation tree.
Definition docnode.h:1089
void clear()
clears the contents
Definition growvector.h:143
static void setParent(DocNodeVariant *n, DocNodeVariant *newParent)
Definition docnode.cpp:125
DocNodeList * call_method_children(DocNodeVariant *v)
Definition docnode.h:1390

References call_method_children(), DocCompoundNode::children(), GrowVector< T >::clear(), DocNodeList::move_append(), and setParent().

Referenced by DocRef::parse(), and DocTitle::parseFromString().

◆ setParent()

void setParent ( DocNodeVariant * n,
DocNodeVariant * newParent )
static

Definition at line 125 of file docnode.cpp.

126{
127 std::visit([&](auto &&x)->decltype(auto) { return x.setParent(newParent); }, *n);
128}

Referenced by flattenParagraphs().

◆ skipSpacesForTable()

Token skipSpacesForTable ( DocParser * parser)
static

Definition at line 2101 of file docnode.cpp.

2102{
2103 AUTO_TRACE();
2104 // get next token
2105 Token tok=parser->tokenizer.lex();
2106 // skip whitespace and tbody, thead and tfoot tags
2107 while (tok.is_any_of(TokenRetval::TK_WHITESPACE,TokenRetval::TK_NEWPARA,TokenRetval::TK_HTMLTAG,
2108 TokenRetval::TK_COMMAND_AT,TokenRetval::TK_COMMAND_BS))
2109 {
2110 if (tok.is(TokenRetval::TK_HTMLTAG))
2111 {
2112 AUTO_TRACE_ADD("html_tag={}",parser->context.token->name);
2114 // skip over tbody, thead, tfoot tags
2115 if (tagId==HtmlTagType::HTML_TBODY ||
2116 tagId==HtmlTagType::HTML_THEAD ||
2118 {
2119 tok=parser->tokenizer.lex();
2120 }
2121 else
2122 {
2123 break;
2124 }
2125 }
2126 else if (tok.is_any_of(TokenRetval::TK_COMMAND_AT, TokenRetval::TK_COMMAND_BS))
2127 {
2128 DString cmdName=parser->context.token->name;
2129 AUTO_TRACE_ADD("command={}",cmdName);
2130 auto cmdType = Mappers::cmdMapper->map(cmdName);
2131 if (cmdType==CommandType::CMD_ILINE)
2132 {
2133 { DocTokenizer::AutoSaveState saveState(parser->tokenizer);
2134 parser->tokenizer.setStateILine();
2135 tok = parser->tokenizer.lex();
2136 if (!tok.is(TokenRetval::TK_WORD))
2137 {
2138 warn_doc_error(parser->context.fileName,parser->tokenizer.getLineNr(),"invalid argument for command '{:c}{}'",
2139 tok.command_to_char(),cmdName);
2140 }
2141 }
2142 tok = parser->tokenizer.lex();
2143 }
2144 else
2145 {
2146 break;
2147 }
2148 }
2149 else
2150 {
2151 AUTO_TRACE_ADD("skip whitespace");
2152 tok=parser->tokenizer.lex();
2153 }
2154 }
2155 return tok;
2156}
int getLineNr() const
void setStateILine()
bool is(TokenRetval rv) const
bool is_any_of(ARGS... args) const
char command_to_char() const
HtmlTagType
Definition cmdmapper.h:174
#define AUTO_TRACE_ADD(...)
Definition docnode.cpp:54
#define AUTO_TRACE(...)
Definition docnode.cpp:53
#define warn_doc_error(file, line, fmt,...)
Definition message.h:112
const Mapper< HtmlTagType > * htmlTagMapper
const Mapper< CommandType > * cmdMapper

References AUTO_TRACE, AUTO_TRACE_ADD, CMD_ILINE, Mappers::cmdMapper, Token::command_to_char(), DocParser::context, DocParserContext::fileName, DocTokenizer::getLineNr(), HTML_TBODY, HTML_TFOOT, HTML_THEAD, Mappers::htmlTagMapper, Token::is(), Token::is_any_of(), DocTokenizer::lex(), TokenInfo::name, DocTokenizer::setStateILine(), DocParserContext::token, DocParser::tokenizer, and warn_doc_error.

Referenced by DocHtmlRow::parse(), and DocHtmlTable::parse().

◆ stripKnownExtensions()

DString stripKnownExtensions ( const DString & text)
static

Strips known html and tex extensions from text.

Definition at line 111 of file docnode.cpp.

112{
113 DString result=text;
114 if (result.endsWith(".tex"))
115 {
116 result=result.left(result.length()-4);
117 }
119 {
120 result=result.left(result.length()-Doxygen::htmlFileExtension.length());
121 }
122 return result;
123}
DString right(size_t len) const
Definition dstring.h:311
DString left(size_t len) const
Definition dstring.h:306
bool endsWith(const char *s) const
Definition dstring.h:617
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
static DString htmlFileExtension
Definition doxygen.h:115

References DString::endsWith(), Doxygen::htmlFileExtension, DString::left(), DString::length(), and DString::right().

Referenced by DocLink::DocLink(), DocRef::DocRef(), and DocSecRefItem::parse().

◆ unescapeCRef()

void unescapeCRef ( DString & s)
static

Definition at line 89 of file docnode.cpp.

90{
91 DString result;
92 const char *p = s.data();
93 if (p)
94 {
95 char c = 0;
96 while ((c=*p++))
97 {
98 if (c=='{') c='<'; else if (c=='}') c='>';
99 result+=c;
100 }
101 }
102
103 result=substitute(result,"&lt;","<");
104 result=substitute(result,"&gt;",">");
105 s = result;
106}
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:485

References DString::data(), and substitute().

Referenced by DocPara::handleHtmlStartTag().

Variable Documentation

◆ g_plantumlEngine

const StringUnorderedSet g_plantumlEngine
static
Initial value:
{
"uml", "bpm", "wire", "dot", "ditaa",
"salt", "math", "latex", "gantt", "mindmap",
"wbs", "yaml", "creole", "json", "flow",
"board", "git", "hcl", "regex", "ebnf",
"files", "chen", "chronology", "chart", "nwdiag",
"packetdiag", "project", "sprites"
}

Definition at line 76 of file docnode.cpp.

Referenced by DocPara::handleCommand().

◆ g_sectionLevelToName

const char* g_sectionLevelToName[]
static
Initial value:
=
{
"page",
"section",
"subsection",
"subsubsection",
"paragraph",
"subparagraph"
}

Definition at line 63 of file docnode.cpp.

Referenced by DocSection::parse().