doxygen
Classes | Public Member Functions | List of all members
ParserManager Class Reference

Manages programming language parsers. More...

#include <parserintf.h>

Public Member Functions

 ParserManager (OutlineParserFactory outlineParserFactory, CodeParserFactory codeParserFactory)
 Create the parser manager. More...
 
void registerParser (const QCString &name, OutlineParserFactory outlineParserFactory, CodeParserFactory codeParserFactory)
 Registers an additional parser. More...
 
bool registerExtension (const QCString &extension, const QCString &parserName)
 Registers a file extension with a parser with name parserName. More...
 
std::unique_ptr< OutlineParserInterfacegetOutlineParser (const QCString &extension)
 Gets the interface to the parser associated with a given extension. More...
 
std::unique_ptr< CodeParserInterfacegetCodeParser (const QCString &extension)
 Gets the interface to the parser associated with a given extension. More...
 
CodeParserFactory & getCodeParserFactory (const QCString &extension)
 Get the factory for create code parser objects with a given extension. More...
 
QCString getParserName (const QCString &extension)
 Gets the name of the parser associated with given extension. More...
 

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.

Constructor & Destructor Documentation

◆ ParserManager()

ParserManager::ParserManager ( OutlineParserFactory  outlineParserFactory,
CodeParserFactory  codeParserFactory 
)
inline

Create the parser manager.

Parameters
outlineParserFactorythe fallback outline parser factory to use for unknown extensions
codeParserFactorythe fallback code parser factory to use for unknown extensions

Member Function Documentation

◆ getCodeParser()

std::unique_ptr<CodeParserInterface> ParserManager::getCodeParser ( const QCString extension)
inline

Gets the interface to the parser associated with a given extension.

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

◆ getCodeParserFactory()

CodeParserFactory& ParserManager::getCodeParserFactory ( const QCString extension)
inline

Get the factory for create code parser objects with a given extension.

◆ getOutlineParser()

std::unique_ptr<OutlineParserInterface> ParserManager::getOutlineParser ( const QCString extension)
inline

Gets the interface to the parser associated with a given extension.

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

◆ getParserName()

QCString ParserManager::getParserName ( const QCString extension)
inline

Gets the name of the parser associated with given extension.

If there is no parser explicitly registered for the supplied extension, te empty string will be reurned.

◆ registerExtension()

bool ParserManager::registerExtension ( const QCString extension,
const QCString parserName 
)
inline

Registers a file extension with a parser with name parserName.

Returns TRUE if the extension was successfully registered.

◆ registerParser()

void ParserManager::registerParser ( const QCString name,
OutlineParserFactory  outlineParserFactory,
CodeParserFactory  codeParserFactory 
)
inline

Registers an additional parser.

Parameters
[in]nameA symbolic name of the parser, i.e. "c", "python", "fortran", "vhdl", ...
[in]outlineParserFactoryA factory method to create a language parser (scanner) that is to be used for the given name.
[in]codeParserFactoryA factory method to create a code parser that is to be used for the given name.

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