diff --git a/src/DynareBison.yy b/src/DynareBison.yy index e3e710c47cb38232ab6d58a9916c35680ab10a9d..09f5d744ddae5cf061107f177eeb2b7c87eeb66a 100644 --- a/src/DynareBison.yy +++ b/src/DynareBison.yy @@ -2186,6 +2186,8 @@ list_sampling_option : QUOTED_STRING COMMA QUOTED_STRING { driver.sampling_options_string($1, $3); } | QUOTED_STRING COMMA signed_number { driver.sampling_options_num($1, $3); } + | QUOTED_STRING COMMA vec_str + { driver.sampling_options_vec_str($1, $3); } | QUOTED_STRING COMMA '(' sub_sampling_options ')' { driver.sampling_options_string($1, '(' + $4 + ')'); } ; diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc index 4af2922cd81f088ba958aa24b898132852e743e1..09a4505431f0be63106471de1e4c5d5ed478f48a 100644 --- a/src/ParsingDriver.cc +++ b/src/ParsingDriver.cc @@ -1984,6 +1984,20 @@ ParsingDriver::sampling_options_num(const string &name, const string &value) options_list.string_options["posterior_sampler_options.sampling_opt"] += value; } +void +ParsingDriver::sampling_options_vec_str(const string &name, vector<string> value) +{ + sampling_options_helper(name); + options_list.string_options["posterior_sampler_options.sampling_opt"] += "{"; + for (auto &it : value) + { + if (&it != &value.front()) + options_list.string_options["posterior_sampler_options.sampling_opt"] += ","; + options_list.string_options["posterior_sampler_options.sampling_opt"] += "''" + it + "''"; + } + options_list.string_options["posterior_sampler_options.sampling_opt"] += "}"; +} + void ParsingDriver::check_varobs() { diff --git a/src/ParsingDriver.hh b/src/ParsingDriver.hh index 9eef5f57122bb98fd73271857801fcbd62c185a8..c8fb1969602fd19ac29b21e8efc5bc64bf97b857 100644 --- a/src/ParsingDriver.hh +++ b/src/ParsingDriver.hh @@ -556,6 +556,8 @@ public: void sampling_options_string(const string &name, const string &value); //! Adds an sampling option (numeric value) void sampling_options_num(const string &name, const string &value); + //! Adds an sampling option (vec_str value) + void sampling_options_vec_str(const string &name, vector<string> value); //! Check that no observed variable has yet be defined void check_varobs(); //! Add a new observed variable