NEML2 1.4.0
Loading...
Searching...
No Matches
HITParser Class Reference

A parser is responsible for parsing an input file into a collection of options which can be used by the Factory to manufacture corresponding objects. More...

Detailed Description

A parser is responsible for parsing an input file into a collection of options which can be used by the Factory to manufacture corresponding objects.

The HITParser parses input files written in the HIT format.

#include <HITParser.h>

Inheritance diagram for HITParser:

Public Member Functions

 HITParser ()=default
 
virtual OptionCollection parse (const std::filesystem::path &filename, const std::string &additional_input="") const override
 Deserialize a file.
 
virtual OptionSet extract_object_options (hit::Node *object, hit::Node *section) const
 Extract options for a specific object.
 
- Public Member Functions inherited from Parser
 Parser ()=default
 

Additional Inherited Members

- Static Public Attributes inherited from Parser
static const std::vector< std::string > sections
 Known top-level sections in the input file.
 

Constructor & Destructor Documentation

◆ HITParser()

HITParser ( )
default

Member Function Documentation

◆ extract_object_options()

OptionSet extract_object_options ( hit::Node * object,
hit::Node * section ) const
virtual

Extract options for a specific object.

Parameters
objectThe object whose options are to be extracted.
sectionThe current section node.
Returns
OptionSet The options of the object.

◆ parse()

OptionCollection parse ( const std::filesystem::path & filename,
const std::string & additional_input = "" ) const
overridevirtual

Deserialize a file.

Parameters
filenameName/path of the input file.
additional_inputAdditional content of the input file not included in the input file itself, e.g., from command line.
Returns
OptionCollection The extracted object options.

Implements Parser.