The ParserManager
Class Reference
Manages programming language parsers. More...
Declaration
Included Headers
Public Constructors Index
ParserManager (const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory) | |
Create the parser manager. More... | |
Public Member Functions Index
void | registerParser (const QCString &name, const OutlineParserFactory &outlineParserFactory, const 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< OutlineParserInterface > | getOutlineParser (const QCString &extension) |
Gets the interface to the parser associated with a given extension. More... | |
std::unique_ptr< CodeParserInterface > | getCodeParser (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... | |
Private Member Functions Index
ParserPair & | getParsers (const QCString &extension) |
Private Member Attributes Index
std::map< std::string, ParserPair > | m_parsers |
std::map< std::string, ParserPair & > | m_extensions |
ParserPair | m_defaultParsers |
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 146 of file parserintf.h.
Public Constructors
ParserManager()
| inline |
Create the parser manager.
- Parameters
-
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.
Reference m_defaultParsers.
Public Member Functions
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 218 of file parserintf.h.
Reference getCodeParserFactory.
getCodeParserFactory()
| inline |
Get the factory for create code parser objects with a given extension.
Definition at line 225 of file parserintf.h.
Reference getParsers.
Referenced by getCodeParser.
getOutlineParser()
| 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.
Reference getParsers.
getParserName()
| inline |
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.
Reference getParsers.
registerExtension()
| 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.
registerParser()
| inline |
Registers an additional parser.
- Parameters
-
[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 Member Functions
getParsers()
| inline |
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.
Private Member Attributes
m_defaultParsers
|
Definition at line 254 of file parserintf.h.
Referenced by getParsers and ParserManager.
m_extensions
|
Definition at line 253 of file parserintf.h.
Referenced by getParsers and registerExtension.
m_parsers
|
Definition at line 252 of file parserintf.h.
Referenced by registerExtension and registerParser.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus by Doxygen 1.14.0.