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 144 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 164 of file parserintf.h.
|
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 216 of file parserintf.h.
Referenced by MemberDefImpl::_writeMultiLineInitializer(), generateExampleDocs(), CodeFragmentManager::parseCodeFragment(), FileDefImpl::parseSource(), ConceptDefImpl::writeDefinition(), DefinitionImpl::writeInlineCode(), VhdlDocGen::writeSource(), FileDefImpl::writeSourceBody(), and writeXMLCodeBlock().
|
inline |
Get the factory for create code parser objects with a given extension.
Definition at line 223 of file parserintf.h.
Referenced by DocVisitor::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 207 of file parserintf.h.
Referenced by VhdlDocGen::createFlowChart(), getParserForFile(), and MarkdownOutlineParser::parsePrototype().
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.
Definition at line 232 of file parserintf.h.
Referenced by convertFileNameFortranParserCode().
|
inlineprivate |
Definition at line 238 of file parserintf.h.
References QCString::data(), QCString::find(), QCString::isEmpty(), QCString::left(), QCString::length(), and QCString::lower().
|
inline |
Registers a file extension with a parser with name parserName.
Returns TRUE if the extension was successfully registered.
Definition at line 187 of file parserintf.h.
References FALSE, QCString::isEmpty(), 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 178 of file parserintf.h.
References QCString::str().
Referenced by initDoxygen().
|
private |
Definition at line 252 of file parserintf.h.
|
private |
Definition at line 251 of file parserintf.h.
|
private |
Definition at line 250 of file parserintf.h.