26 eval(hit::Field * n,
const std::list<std::string> & args, hit::BraceExpander & exp);
33 eval(hit::Field * n,
const std::list<std::string> & args, hit::BraceExpander & exp);
40 eval(hit::Field * n,
const std::list<std::string> & args, hit::BraceExpander & exp);
47 eval(hit::Field * n,
const std::list<std::string> & args, hit::BraceExpander & exp);
54 walk(
const std::string & fullpath,
const std::string & , hit::Node * n)
override;
56 std::vector<hit::ErrorMessage>
errors;
59 std::map<std::string, hit::Node *>
_have;
65 virtual void walk(
const std::string & ,
67 hit::Node * section)
override;
68 std::vector<hit::ErrorMessage>
errors;
74 typedef std::map<std::string, hit::Node *>
ParamMap;
78 walk(
const std::string & fullpath,
const std::string & , hit::Node * n)
override;
89 void walk(
const std::string & fullpath,
const std::string & , hit::Node * n)
override;
109 Parser(
const std::vector<std::string> & input_filenames,
110 const std::optional<std::vector<std::string>> & input_text = {});
116 Parser(
const std::string & input_filename,
const std::optional<std::string> & input_text = {});
121 Error(
const std::vector<hit::ErrorMessage> & error_messages);
226 const std::vector<hit::ErrorMessage> & from);
227 static void appendErrorMessages(std::vector<hit::ErrorMessage> & to,
const hit::Error & error);
233 static std::string
joinErrorMessages(
const std::vector<hit::ErrorMessage> & error_messages);
241 void parseError(std::vector<hit::ErrorMessage> messages)
const;
std::vector< hit::ErrorMessage > errors
virtual void walk(const std::string &, const std::string &, hit::Node *section) override
CompileParamWalker(ParamMap &map)
std::map< std::string, hit::Node * > ParamMap
virtual void walk(const std::string &fullpath, const std::string &, hit::Node *n) override
std::map< std::string, hit::Node * > _have
virtual void walk(const std::string &fullpath, const std::string &, hit::Node *n) override
std::vector< hit::ErrorMessage > errors
virtual std::string eval(hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)
virtual std::string eval(hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)
const CompileParamWalker::ParamMap & _map
OverrideParamWalker(const CompileParamWalker::ParamMap &map)
std::vector< std::string > warnings
void walk(const std::string &fullpath, const std::string &, hit::Node *n) override
Class for parsing input files.
std::set< std::string > _extracted_vars
Variables that have been extracted during brace expansion.
static void appendErrorMessages(std::vector< hit::ErrorMessage > &to, const std::vector< hit::ErrorMessage > &from)
Helper for accumulating errors from a walker into an accumulation of errors.
const std::string & getLastInputFileName() const
void setThrowOnError(const bool throw_on_error)
Set whether or not to throw Parse::Error on errors.
void setAppType(const std::string &app_type)
const hit::Node & getCommandLineRoot() const
const hit::Node * queryRoot() const
void setCommandLineParams(const std::vector< std::string > ¶ms)
Sets the HIT parameters from the command line.
const std::vector< std::string > & getInputText() const
std::vector< std::string > _input_text
The input text (may be filled during parse())
const std::vector< std::string > & getInputFileNames() const
const std::string & getAppType() const
std::filesystem::path getLastInputFilePath() const
const std::vector< std::string > _input_filenames
The input file names.
std::string _app_type
The application types extracted from [Application] block.
std::optional< std::vector< std::string > > _command_line_params
The command line HIT parameters (if any)
std::unique_ptr< hit::Node > _cli_root
The root node for command line hit arguments.
std::unique_ptr< hit::Node > _root
The root node, which owns the whole tree.
bool getThrowOnError() const
void parseError(std::vector< hit::ErrorMessage > messages) const
Helper for throwing an error with the given messages.
bool _throw_on_error
Whether or not to throw on error.
hit::Node * queryCommandLineRoot()
const hit::Node * queryCommandLineRoot() const
void parse()
Parses the inputs.
const std::set< std::string > & getExtractedVars() const
static std::string joinErrorMessages(const std::vector< hit::ErrorMessage > &error_messages)
Helper for combining error messages into a single, newline separated message.
virtual std::string eval(hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)
virtual std::string eval(hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)