|
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 DString &name, const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory) |
| Registers an additional parser. | |
| bool | registerExtension (const DString &extension, const DString &parserName) |
| Registers a file extension with a parser with name parserName. | |
| std::unique_ptr< OutlineParserInterface > | getOutlineParser (const DString &extension) |
| Gets the interface to the parser associated with a given extension. | |
| std::unique_ptr< CodeParserInterface > | getCodeParser (const DString &extension) |
| Gets the interface to the parser associated with a given extension. | |
| CodeParserFactory & | getCodeParserFactory (const DString &extension) |
| Get the factory for create code parser objects with a given extension. | |
| DString | getParserName (const DString &extension) |
| Gets the name of the parser associated with given extension. | |
Private Member Functions | |
| ParserPair & | getParsers (const DString &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 181 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 201 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 253 of file parserintf.h.
References getCodeParserFactory().
Referenced by MemberDefImpl::_writeMultiLineInitializer(), generateExampleDocs(), generateXMLForConcept(), 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 259 of file parserintf.h.
References getParsers().
Referenced by DocVisitor::getCodeParser(), and 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 244 of file parserintf.h.
References getParsers().
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, the empty string will be returned.
Definition at line 268 of file parserintf.h.
References getParsers().
Referenced by convertFileNameFortranParserCode().
|
inlineprivate |
Definition at line 274 of file parserintf.h.
References DString::data(), DString::empty(), DString::find(), DString::left(), DString::length(), DString::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 224 of file parserintf.h.
References DString::empty(), m_extensions, m_parsers, and DString::str().
|
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 215 of file parserintf.h.
References m_parsers, and DString::str().
Referenced by initDoxygen().
|
private |
Definition at line 288 of file parserintf.h.
Referenced by getParsers(), and ParserManager().
|
private |
Definition at line 287 of file parserintf.h.
Referenced by getParsers(), and registerExtension().
|
private |
Definition at line 286 of file parserintf.h.
Referenced by registerExtension(), and registerParser().