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 walk(
const std::string & fullpath,
const std::string & , hit::Node * n)
override;
42 std::vector<hit::ErrorMessage>
errors;
45 std::map<std::string, hit::Node *>
_have;
51 virtual void walk(
const std::string & ,
53 hit::Node * section)
override;
54 std::vector<hit::ErrorMessage>
errors;
60 typedef std::map<std::string, hit::Node *>
ParamMap;
64 walk(
const std::string & fullpath,
const std::string & , hit::Node * n)
override;
75 void walk(
const std::string & fullpath,
const std::string & , hit::Node * n)
override;
95 Parser(
const std::vector<std::string> & input_filenames,
96 const std::optional<std::vector<std::string>> & input_text = {});
102 Parser(
const std::string & input_filename,
const std::optional<std::string> & input_text = {});
107 Error(
const std::vector<hit::ErrorMessage> & error_messages);
212 const std::vector<hit::ErrorMessage> & from);
213 static void appendErrorMessages(std::vector<hit::ErrorMessage> & to,
const hit::Error & error);
219 static std::string
joinErrorMessages(
const std::vector<hit::ErrorMessage> & error_messages);
227 void parseError(std::vector<hit::ErrorMessage> messages)
const;
const std::vector< std::string > _input_filenames
The input file names.
void setAppType(const std::string &app_type)
const hit::Node * queryCommandLineRoot() const
void parseError(std::vector< hit::ErrorMessage > messages) const
Helper for throwing an error with the given messages.
void parse()
Parses the inputs.
CompileParamWalker(ParamMap &map)
void setCommandLineParams(const std::vector< std::string > ¶ms)
Sets the HIT parameters from the command line.
virtual std::string eval(hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)
const std::string & getLastInputFileName() const
const std::vector< std::string > & getInputFileNames() const
const std::set< std::string > & getExtractedVars() const
std::vector< std::string > warnings
std::string _app_type
The application types extracted from [Application] block.
const hit::Node * queryRoot() const
const std::string & getAppType() const
std::vector< hit::ErrorMessage > errors
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.
virtual void walk(const std::string &fullpath, const std::string &, hit::Node *n) override
std::unique_ptr< hit::Node > _cli_root
The root node for command line hit arguments.
static std::string joinErrorMessages(const std::vector< hit::ErrorMessage > &error_messages)
Helper for combining error messages into a single, newline separated message.
Parser(const std::vector< std::string > &input_filenames, const std::optional< std::vector< std::string >> &input_text={})
Constructor given a list of input files, given in input_filenames.
std::map< std::string, hit::Node * > _have
bool getThrowOnError() const
bool _throw_on_error
Whether or not to throw on error.
std::vector< std::string > _input_text
The input text (may be filled during parse())
std::map< std::string, hit::Node * > ParamMap
std::set< std::string > _extracted_vars
Variables that have been extracted during brace expansion.
virtual void walk(const std::string &fullpath, const std::string &, hit::Node *n) override
std::unique_ptr< hit::Node > _root
The root node, which owns the whole tree.
void walk(const std::string &fullpath, const std::string &, hit::Node *n) override
const hit::Node & getCommandLineRoot() const
hit::Node * queryCommandLineRoot()
const std::vector< std::string > & getInputText() const
std::vector< hit::ErrorMessage > errors
std::filesystem::path getLastInputFilePath() const
std::optional< std::vector< std::string > > _command_line_params
The command line HIT parameters (if any)
virtual std::string eval(hit::Field *n, const std::list< std::string > &args, hit::BraceExpander &exp)
OverrideParamWalker(const CompileParamWalker::ParamMap &map)
Class for parsing input files.
virtual void walk(const std::string &, const std::string &, hit::Node *section) override
const CompileParamWalker::ParamMap & _map
void setThrowOnError(const bool throw_on_error)
Set whether or not to throw Parse::Error on errors.