|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Parser for LHA/FLHA files, producing blocks and a DBNode representation. More...
#include <LhaParser.h>


Public Member Functions | |
| std::shared_ptr< DBNode > | readFromFile (const std::string &input_file) const override |
| Parses an LHA/FLHA file from disk and returns its DBNode representation. | |
| std::shared_ptr< DBNode > | parse (const std::string &src) const override |
| Parses LHA/FLHA content from an in-memory string. | |
| void | writeToFile (const std::string &filename, const std::shared_ptr< DBNode > &root) const |
| Serializes a DBNode structure back to an LHA-like file. | |
| void | set_prototypes (const std::unordered_set< Prototype > &prototypes) |
| Sets the set of block prototypes used by the parser. | |
Public Member Functions inherited from IParser | |
| virtual | ~IParser ()=default |
| Virtual destructor to allow proper cleanup via base pointer. | |
Parser for LHA/FLHA files, producing blocks and a DBNode representation.
LhaParser implements the IParser interface using the LHA/FLHA conventions:
The set of known prototypes can be configured via set_prototypes() (e.g. using LHA_BLOCKS, SLHA_BLOCKS, FLHA_BLOCKS).
Definition at line 113 of file LhaParser.h.
|
overridevirtual |
Parses LHA/FLHA content from an in-memory string.
The pipeline is:
| src | Raw LHA/FLHA text. |
| std::runtime_error | on lexical or structural errors. |
Implements IParser.
Definition at line 165 of file LhaParser.cpp.
|
overridevirtual |
Parses an LHA/FLHA file from disk and returns its DBNode representation.
This implementation:
| input_file | Path to the LHA/FLHA file to read. |
| std::runtime_error | if the file cannot be opened or parsing fails. |
Implements IParser.
Definition at line 158 of file LhaParser.cpp.
| void LhaParser::set_prototypes | ( | const std::unordered_set< Prototype > & | prototypes | ) |
Sets the set of block prototypes used by the parser.
Typical usage is to pass one of the predefined sets:
| prototypes | Set of Prototype objects describing known blocks. |
Definition at line 177 of file LhaParser.cpp.
|
virtual |
Serializes a DBNode structure back to an LHA-like file.
Currently marked as TODO in the implementation. The intended design is to invert the toDBNode/LhaBlock/LhaElement pipeline in order to reconstruct a valid LHA/FLHA text file from a DBNode tree.
| filename | Target file name. |
| root | Root DBNode to serialize. |
Implements IParser.
Definition at line 644 of file LhaParser.cpp.