doxygen  1.8.18
About: Doxygen is a source code documentation generator tool for C++, C, Objective-C, C#, PHP, Java, Python, IDL (diverse flavors), Fortran, VHDL, Tcl, and to some extent D. Different output formats are supported.
  Fossies Dox: doxygen-1.8.18.src.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ParserManager Class Reference

Manages programming language parsers. More...

#include <parserintf.h>

+ Collaboration diagram for ParserManager:

Classes

struct  ParserPair
 

Public Member Functions

 ParserManager (std::unique_ptr< OutlineParserInterface > outlineParser, std::unique_ptr< CodeParserInterface > codeParser)
 
void registerParser (const char *name, std::unique_ptr< OutlineParserInterface > outlineParser, std::unique_ptr< CodeParserInterface > codeParser)
 Registers an additional parser. More...
 
bool registerExtension (const char *extension, const char *parserName)
 Registers a file extension with a parser with name parserName. More...
 
OutlineParserInterfacegetOutlineParser (const char *extension)
 Gets the interface to the parser associated with given extension. More...
 
CodeParserInterfacegetCodeParser (const char *extension)
 Gets the interface to the parser associated with given extension. More...
 

Private Member Functions

ParserPairgetParsers (const char *extension)
 

Private Attributes

std::map< std::string, ParserPairm_parsers
 
std::map< std::string, ParserPair & > m_extensions
 
ParserPair m_defaultParsers
 

Detailed Description

Manages programming language parsers.

This class manages the language parsers in the system. One can register parsers, and obtain a parser given a file extension.

Definition at line 159 of file parserintf.h.

Constructor & Destructor Documentation

◆ ParserManager()

ParserManager::ParserManager ( std::unique_ptr< OutlineParserInterface outlineParser,
std::unique_ptr< CodeParserInterface codeParser 
)
inline

Definition at line 174 of file parserintf.h.

Member Function Documentation

◆ getCodeParser()

CodeParserInterface& ParserManager::getCodeParser ( const char *  extension)
inline

Gets the interface to the parser associated with given extension.

If there is no parser explicitly registered for the supplied extension, the interface to the default parser will be returned.

Definition at line 227 of file parserintf.h.

References ParserManager::ParserPair::codeParser, and getParsers().

Referenced by findXRefSymbols(), generateExampleDocs(), parseCode(), FileDefImpl::parseSource(), ManDocVisitor::visit(), RTFDocVisitor::visit(), DocbookDocVisitor::visit(), XmlDocVisitor::visit(), LatexDocVisitor::visit(), HtmlDocVisitor::visit(), MemberDefImpl::writeDocumentation(), DefinitionImpl::writeInlineCode(), FileDefImpl::writeSource(), VhdlDocGen::writeSource(), and writeXMLCodeBlock().

◆ getOutlineParser()

OutlineParserInterface& ParserManager::getOutlineParser ( const char *  extension)
inline

Gets the interface to the parser associated with given extension.

If there is no parser explicitly registered for the supplied extension, the interface to the default parser will be returned.

Definition at line 218 of file parserintf.h.

References getParsers(), and ParserManager::ParserPair::outlineParser.

Referenced by VhdlDocGen::createFlowChart(), getParserForFile(), and MarkdownOutlineParser::parsePrototype().

◆ getParsers()

ParserPair& ParserManager::getParsers ( const char *  extension)
inlineprivate

◆ registerExtension()

bool ParserManager::registerExtension ( const char *  extension,
const char *  parserName 
)
inline

Registers a file extension with a parser with name parserName.

Returns TRUE if the extension was successfully registered.

Definition at line 198 of file parserintf.h.

References FALSE, m_extensions, m_parsers, and TRUE.

◆ registerParser()

void ParserManager::registerParser ( const char *  name,
std::unique_ptr< OutlineParserInterface outlineParser,
std::unique_ptr< CodeParserInterface codeParser 
)
inline

Registers an additional parser.

Parameters
[in]nameA symbolic name of the parser, i.e. "c", "python", "fortran", "vhdl", ...
[in]outlineParserThe language parser (scanner) that is to be used for the given name.
[in]codeParserThe code parser that is to be used for the given name.

Definition at line 188 of file parserintf.h.

References m_parsers.

Referenced by initDoxygen().

Member Data Documentation

◆ m_defaultParsers

ParserPair ParserManager::m_defaultParsers
private

Definition at line 247 of file parserintf.h.

Referenced by getParsers().

◆ m_extensions

std::map<std::string,ParserPair &> ParserManager::m_extensions
private

Definition at line 246 of file parserintf.h.

Referenced by getParsers(), and registerExtension().

◆ m_parsers

std::map<std::string,ParserPair> ParserManager::m_parsers
private

Definition at line 245 of file parserintf.h.

Referenced by registerExtension(), and registerParser().


The documentation for this class was generated from the following file: