Doxygen
|
Manages programming language parsers. More...
#include <src/parserintf.h>
Classes | |
struct | ParserPair |
Public Member Functions | |
ParserManager (const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory) | |
Create the parser manager. | |
void | registerParser (const QCString &name, const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory) |
Registers an additional parser. | |
bool | registerExtension (const QCString &extension, const QCString &parserName) |
Registers a file extension with a parser with name parserName. | |
std::unique_ptr< OutlineParserInterface > | getOutlineParser (const QCString &extension) |
Gets the interface to the parser associated with a given extension. | |
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. | |
QCString | getParserName (const QCString &extension) |
Gets the name of the parser associated with given extension. | |
Private Member Functions | |
ParserPair & | getParsers (const QCString &extension) |
Private Attributes | |
std::map< std::string, ParserPair > | m_parsers |
std::map< std::string, ParserPair & > | m_extensions |
ParserPair | m_defaultParsers |
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 146 of file parserintf.h.
|
inline |
Create the parser manager.
outlineParserFactory | the fallback outline parser factory to use for unknown extensions |
codeParserFactory | the fallback code parser factory to use for unknown extensions |
Definition at line 166 of file parserintf.h.
References m_defaultParsers.
|
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.
Definition at line 218 of file parserintf.h.
References getCodeParserFactory().
|
inline |
Get the factory for create code parser objects with a given extension.
Definition at line 225 of file parserintf.h.
References getParsers().
Referenced by getCodeParser().
|
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.
Definition at line 209 of file parserintf.h.
References getParsers().
Gets the name of the parser associated with given extension.
If there is no parser explicitly registered for the supplied extension, the empty string will be returned.
Definition at line 234 of file parserintf.h.
References getParsers().
|
inlineprivate |
Definition at line 240 of file parserintf.h.
References QCString::data(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::lower(), m_defaultParsers, and m_extensions.
Referenced by getCodeParserFactory(), getOutlineParser(), and getParserName().
|
inline |
Registers a file extension with a parser with name parserName.
Returns TRUE if the extension was successfully registered.
Definition at line 189 of file parserintf.h.
References FALSE, QCString::isEmpty(), m_extensions, m_parsers, QCString::str(), and TRUE.
|
inline |
Registers an additional parser.
[in] | name | A symbolic name of the parser, i.e. "c", "python", "fortran", "vhdl", ... |
[in] | outlineParserFactory | A factory method to create a language parser (scanner) that is to be used for the given name. |
[in] | codeParserFactory | A factory method to create a code parser that is to be used for the given name. |
Definition at line 180 of file parserintf.h.
References m_parsers, and QCString::str().
|
private |
Definition at line 254 of file parserintf.h.
Referenced by getParsers(), and ParserManager().
|
private |
Definition at line 253 of file parserintf.h.
Referenced by getParsers(), and registerExtension().
|
private |
Definition at line 252 of file parserintf.h.
Referenced by registerExtension(), and registerParser().