56 const std::shared_ptr<
Entry> &root,
159 bool stripCodeComments,
229 const auto &parserIt =
m_parsers.find(parserName.
str());
247 return getParsers(extension).outlineParserFactory();
263 return getParsers(extension).codeParserFactory;
279 if (ext.
isEmpty()) ext=
".no_extension";
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Abstract interface for code parsers.
virtual void resetCodeParserState()=0
Resets the state of the code parser.
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
The common base class of all entity definitions found in the sources.
Represents an unstructured piece of information, about an entity found in the sources.
A model of a file symbol.
A model of a class/file/namespace member symbol.
Abstract interface for outline parsers.
virtual bool needsPreprocessing(const QCString &extension) const =0
Returns TRUE if the language identified by extension needs the C preprocessor to be run before feed t...
virtual void parseInput(const QCString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser)=0
Parses a single input file with the goal to build an Entry tree.
virtual void parsePrototype(const QCString &text)=0
Callback function called by the comment block scanner.
Class representing a list of different code generators.
bool registerExtension(const QCString &extension, const QCString &parserName)
Registers a file extension with a parser with name parserName.
std::map< std::string, ParserPair > m_parsers
void registerParser(const QCString &name, const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory)
Registers an additional parser.
std::unique_ptr< OutlineParserInterface > getOutlineParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
ParserPair m_defaultParsers
std::unique_ptr< CodeParserInterface > getCodeParser(const QCString &extension)
Gets the interface to the parser associated with a given extension.
CodeParserFactory & getCodeParserFactory(const QCString &extension)
Get the factory for create code parser objects with a given extension.
ParserManager(const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory)
Create the parser manager.
ParserPair & getParsers(const QCString &extension)
std::map< std::string, ParserPair & > m_extensions
QCString getParserName(const QCString &extension)
Gets the name of the parser associated with given extension.
This is an alternative implementation of QCString.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
QCString left(size_t len) const
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
std::function< std::unique_ptr< CodeParserInterface >()> CodeParserFactory
std::function< std::unique_ptr< OutlineParserInterface >()> OutlineParserFactory
Options to configure the code parser.
CodeParserOptions & setSearchCtx(const Definition *d)
CodeParserOptions & setStartLine(int lineNr)
const Definition * searchCtx() const
const FileDef * fileDef() const
CodeParserOptions & setExample(bool isExample, const QCString &name)
Associate this comment block with a given example.
CodeParserOptions & setInlineFragment(bool enable)
const MemberDef * memberDef() const
CodeParserOptions & setCollectXRefs(bool enable)
bool showLineNumbers() const
bool inlineFragment() const
CodeParserOptions & setEndLine(int lineNr)
QCString exampleName() const
const MemberDef * m_memberDef
const Definition * m_searchCtx
CodeParserOptions & setMemberDef(const MemberDef *md)
bool collectXRefs() const
const FileDef * m_fileDef
CodeParserOptions & setShowLineNumbers(bool enable)
CodeParserOptions & setFileDef(const FileDef *fd)
CodeParserFactory codeParserFactory
ParserPair(OutlineParserFactory opf, const CodeParserFactory &cpf, const QCString &pn)
OutlineParserFactory outlineParserFactory
This file contains a number of basic enums and types.