HAL
hal::gate_library_parser_manager Namespace Reference

Typedefs

using ParserFactory = std::function< std::unique_ptr< GateLibraryParser >()>
 

Functions

void register_parser (const std::string &name, const ParserFactory &parser_factory, const std::vector< std::string > &supported_file_extensions)
 
void unregister_parser (const std::string &name)
 
std::unique_ptr< GateLibraryparse (std::filesystem::path file_path)
 

Detailed Description

The gate library parser manager keeps track of all gate library parsers that are available within HAL. Further, it is used to dispatch parsing tasks to the respective parsers.

Typedef Documentation

◆ ParserFactory

using hal::gate_library_parser_manager::ParserFactory = typedef std::function<std::unique_ptr<GateLibraryParser>()>

Definition at line 47 of file gate_library_parser_manager.h.

Function Documentation

◆ parse()

NETLIST_API std::unique_ptr< GateLibrary > hal::gate_library_parser_manager::parse ( std::filesystem::path  file_path)

Parses the gate library file depending on its file extension.

Parameters
[in]file_path- The input path.
Returns
The gate library.

Definition at line 77 of file gate_library_parser_manager.cpp.

References log_error, log_info, and control::parser.

Referenced by hal::gate_library_manager::load(), and hal::NetlistParser::parse_and_instantiate().

◆ register_parser()

NETLIST_API void hal::gate_library_parser_manager::register_parser ( const std::string &  name,
const ParserFactory parser_factory,
const std::vector< std::string > &  supported_file_extensions 
)

Registers a new gate library parser for a selection of file types.
If parsers for some of the extensions already exist, they remain changed and only new ones are registered.

Parameters
[in]name- The name of the parser.
[in]parser_factory- A factory function that constructs a new parser instance.
[in]supported_file_extensions- The file extensions this parser can process.

Definition at line 40 of file gate_library_parser_manager.cpp.

References log_info, log_warning, name, hal::utils::to_lower(), and hal::utils::trim().

Referenced by hal::plugin_manager::load().

◆ unregister_parser()

NETLIST_API void hal::gate_library_parser_manager::unregister_parser ( const std::string &  name)

Unregisters a specific parser.

Parameters
[in]name- The name of the parser.

Definition at line 61 of file gate_library_parser_manager.cpp.

References log_info, and name.

Referenced by hal::plugin_manager::unload().