Doxygen
Loading...
Searching...
No Matches
tagreader.cpp File Reference
#include "tagreader.h"
#include <map>
#include <functional>
#include <utility>
#include <algorithm>
#include <variant>
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include "xml.h"
#include "entry.h"
#include "doxygen.h"
#include "util.h"
#include "message.h"
#include "defargs.h"
#include "arguments.h"
#include "filedef.h"
#include "filename.h"
#include "section.h"
#include "containers.h"
#include "debug.h"
#include "anchor.h"
#include "moduledef.h"
+ Include dependency graph for tagreader.cpp:

Go to the source code of this file.

Classes

class  anonymous_namespace{tagreader.cpp}::TagAnchorInfo
 Information about an linkable anchor. More...
 
class  anonymous_namespace{tagreader.cpp}::TagEnumValueInfo
 Container for enum values that are scoped within an enum. More...
 
class  anonymous_namespace{tagreader.cpp}::TagIncludeInfo
 Container for include info that can be read from a tagfile. More...
 
class  anonymous_namespace{tagreader.cpp}::TagMemberInfo
 Container for member specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagCompoundInfo
 Base class for all compound types. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagClassInfo
 Container for class specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagConceptInfo
 Container for concept specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagModuleInfo
 Container for module specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagNamespaceInfo
 Container for namespace specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagPackageInfo
 Container for package specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagFileInfo
 Container for file specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagGroupInfo
 Container for group specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagPageInfo
 Container for page specific info that can be read from a tagfile. More...
 
struct  anonymous_namespace{tagreader.cpp}::TagDirInfo
 Container for directory specific info that can be read from a tagfile. More...
 
class  anonymous_namespace{tagreader.cpp}::TagCompoundVariant
 Variant class that holds a unique pointer to one of the specific container types. More...
 
class  anonymous_namespace{tagreader.cpp}::TagFileParser
 Tag file parser. More...
 
struct  anonymous_namespace{tagreader.cpp}::ElementCallbacks
 
struct  anonymous_namespace{tagreader.cpp}::CompoundFactory
 

Namespaces

namespace  anonymous_namespace{tagreader.cpp}
 

Macros

#define p_warn(fmt, ...)
 

Typedefs

using anonymous_namespace{tagreader.cpp}::TagClassInfoPtr = std::unique_ptr<TagClassInfo>
 
using anonymous_namespace{tagreader.cpp}::TagConceptInfoPtr = std::unique_ptr<TagConceptInfo>
 
using anonymous_namespace{tagreader.cpp}::TagModuleInfoPtr = std::unique_ptr<TagModuleInfo>
 
using anonymous_namespace{tagreader.cpp}::TagNamespaceInfoPtr = std::unique_ptr<TagNamespaceInfo>
 
using anonymous_namespace{tagreader.cpp}::TagPackageInfoPtr = std::unique_ptr<TagPackageInfo>
 
using anonymous_namespace{tagreader.cpp}::TagFileInfoPtr = std::unique_ptr<TagFileInfo>
 
using anonymous_namespace{tagreader.cpp}::TagGroupInfoPtr = std::unique_ptr<TagGroupInfo>
 
using anonymous_namespace{tagreader.cpp}::TagPageInfoPtr = std::unique_ptr<TagPageInfo>
 
using anonymous_namespace{tagreader.cpp}::TagDirInfoPtr = std::unique_ptr<TagDirInfo>
 

Functions

ElementCallbacks::StartCallback anonymous_namespace{tagreader.cpp}::startCb (void(TagFileParser::*fn)(const XMLHandlers::Attributes &))
 
ElementCallbacks::EndCallback anonymous_namespace{tagreader.cpp}::endCb (void(TagFileParser::*fn)())
 
void parseTagFile (const std::shared_ptr< Entry > &root, const char *fullName)
 

Variables

static const std::map< std::string, ElementCallbacksanonymous_namespace{tagreader.cpp}::g_elementHandlers
 
static const std::map< std::string, CompoundFactoryanonymous_namespace{tagreader.cpp}::g_compoundFactory
 

Macro Definition Documentation

◆ p_warn

#define p_warn ( fmt,
... )
Value:
do { \
warn(m_locator->fileName(),m_locator->lineNr(),fmt,##__VA_ARGS__); \
} while(0)
Definition message.h:144

Definition at line 330 of file tagreader.cpp.

330#define p_warn(fmt,...) do { \
331 warn(m_locator->fileName(),m_locator->lineNr(),fmt,##__VA_ARGS__); \
332 } while(0)

Referenced by anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), anonymous_namespace{tagreader.cpp}::TagFileParser::endAnchor(), anonymous_namespace{tagreader.cpp}::TagFileParser::endAnchorFile(), anonymous_namespace{tagreader.cpp}::TagFileParser::endArglist(), anonymous_namespace{tagreader.cpp}::TagFileParser::endBase(), anonymous_namespace{tagreader.cpp}::TagFileParser::endClangId(), anonymous_namespace{tagreader.cpp}::TagFileParser::endClass(), anonymous_namespace{tagreader.cpp}::TagFileParser::endCompound(), anonymous_namespace{tagreader.cpp}::TagFileParser::endConcept(), anonymous_namespace{tagreader.cpp}::TagFileParser::endDir(), anonymous_namespace{tagreader.cpp}::TagFileParser::endDocAnchor(), anonymous_namespace{tagreader.cpp}::TagFileParser::endElement(), anonymous_namespace{tagreader.cpp}::TagFileParser::endFile(), anonymous_namespace{tagreader.cpp}::TagFileParser::endFilename(), anonymous_namespace{tagreader.cpp}::TagFileParser::endIncludes(), anonymous_namespace{tagreader.cpp}::TagFileParser::endMember(), anonymous_namespace{tagreader.cpp}::TagFileParser::endModule(), anonymous_namespace{tagreader.cpp}::TagFileParser::endName(), anonymous_namespace{tagreader.cpp}::TagFileParser::endNamespace(), anonymous_namespace{tagreader.cpp}::TagFileParser::endPage(), anonymous_namespace{tagreader.cpp}::TagFileParser::endPath(), anonymous_namespace{tagreader.cpp}::TagFileParser::endSubgroup(), anonymous_namespace{tagreader.cpp}::TagFileParser::endSubpage(), anonymous_namespace{tagreader.cpp}::TagFileParser::endTemplateArg(), anonymous_namespace{tagreader.cpp}::TagFileParser::endTitle(), anonymous_namespace{tagreader.cpp}::TagFileParser::endType(), anonymous_namespace{tagreader.cpp}::TagFileParser::startBase(), anonymous_namespace{tagreader.cpp}::TagFileParser::startCompound(), anonymous_namespace{tagreader.cpp}::TagFileParser::startElement(), and anonymous_namespace{tagreader.cpp}::TagFileParser::startEnumValue().

Function Documentation

◆ parseTagFile()

void parseTagFile ( const std::shared_ptr< Entry > & root,
const char * fullName )

Definition at line 1815 of file tagreader.cpp.

1816{
1817 TagFileParser tagFileParser(fullName);
1818 QCString inputStr = fileToString(fullName);
1819 XMLHandlers handlers;
1820 // connect the generic events handlers of the XML parser to the specific handlers of the tagFileParser object
1821 handlers.startDocument = [&tagFileParser]() { tagFileParser.startDocument(); };
1822 handlers.startElement = [&tagFileParser](const std::string &name,const XMLHandlers::Attributes &attrs) { tagFileParser.startElement(QCString(name),attrs); };
1823 handlers.endElement = [&tagFileParser](const std::string &name) { tagFileParser.endElement(QCString(name)); };
1824 handlers.characters = [&tagFileParser](const std::string &chars) { tagFileParser.characters(QCString(chars)); };
1825 handlers.error = [&tagFileParser](const std::string &fileName,int lineNr,const std::string &msg) { tagFileParser.error(QCString(fileName),lineNr,QCString(msg)); };
1826 XMLParser parser(handlers);
1827 tagFileParser.setDocumentLocator(&parser);
1828 parser.parse(fullName,inputStr.data(),Debug::isFlagSet(Debug::Lex_xml),
1829 [&]() { DebugLex::print(Debug::Lex_xml,"Entering","libxml/xml.l",fullName); },
1830 [&]() { DebugLex::print(Debug::Lex_xml,"Finished", "libxml/xml.l",fullName); }
1831 );
1832 tagFileParser.buildLists(root);
1833 tagFileParser.addIncludes();
1835 {
1836 tagFileParser.dump();
1837 }
1838}
@ Tag
Definition debug.h:45
@ Lex_xml
Definition debug.h:70
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
This is an alternative implementation of QCString.
Definition qcstring.h:101
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:159
Event handlers that can installed by the client and called while parsing a XML document.
Definition xml.h:27
std::unordered_map< std::string, std::string > Attributes
Definition xml.h:29
std::function< EndElementType > endElement
handler invoked when a closing tag has been found
Definition xml.h:40
std::function< StartElementType > startElement
handler invoked when an opening tag has been found
Definition xml.h:39
std::function< CharsType > characters
handler invoked when content between tags has been found
Definition xml.h:41
std::function< ErrorType > error
handler invoked when the parser encounters an error
Definition xml.h:42
std::function< StartDocType > startDocument
handler invoked at the start of the document
Definition xml.h:37
#define msg(fmt,...)
Definition message.h:94
QCString fileToString(const QCString &name, bool filter, bool isSourceCode)
Definition util.cpp:1414

References XMLHandlers::characters, QCString::data(), XMLHandlers::endElement, XMLHandlers::error, fileToString(), Debug::isFlagSet(), Debug::Lex_xml, msg, XMLParser::parse(), XMLHandlers::startDocument, XMLHandlers::startElement, Debug::Tag, and anonymous_namespace{tagreader.cpp}::TagFileParser::TagFileParser().

Referenced by readTagFile().