diff --git a/ComputingTasks.cc b/ComputingTasks.cc index 6045afb4..ef3bec57 100644 --- a/ComputingTasks.cc +++ b/ComputingTasks.cc @@ -126,6 +126,15 @@ StochSimulStatement::checkPass(ModFileStructure &mod_file_struct) if ((it != options_list.num_options.end() && it->second == "1") || mod_file_struct.order_option >= 3) mod_file_struct.k_order_solver = true; + + // Check that option "pruning" is not used with k-order + it = options_list.num_options.find("pruning"); + if ((it != options_list.num_options.end() && it->second == "1") + && mod_file_struct.k_order_solver) + { + cerr << "ERROR: in 'stoch_simul', you cannot use option 'pruning' with 'k_order_solver' option or with 3rd order approximation" << endl; + exit(EXIT_FAILURE); + } } void diff --git a/DynareBison.yy b/DynareBison.yy index 8a3b3a18..daf43412 100644 --- a/DynareBison.yy +++ b/DynareBison.yy @@ -115,7 +115,7 @@ class ParsingDriver; %token NOGRAPH NOMOMENTS NOPRINT NORMAL_PDF %token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS %token PARAMETERS PARAMETER_SET PARTIAL_INFORMATION PERIODS PLANNER_OBJECTIVE PLOT_CONDITIONAL_FORECAST PLOT_PRIORS PREFILTER PRESAMPLE -%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN +%token PRINT PRIOR_MC PRIOR_TRUNC PRIOR_MODE PRIOR_MEAN POSTERIOR_MODE POSTERIOR_MEAN POSTERIOR_MEDIAN PRUNING %token QUOTED_STRING %token QZ_CRITERIUM FULL %token RELATIVE_IRF REPLIC RPLOT SAVE_PARAMS_AND_STEADY_STATE @@ -843,6 +843,7 @@ stoch_simul_options : o_dr_algo | o_partial_information | o_conditional_variance_decomposition | o_k_order_solver + | o_pruning ; symbol_list : symbol_list symbol @@ -1891,6 +1892,7 @@ o_draws_nbr_mean_var_estimate : DRAWS_NBR_MEAN_VAR_ESTIMATE EQUAL INT_NUMBER {dr o_draws_nbr_modified_harmonic_mean : DRAWS_NBR_MODIFIED_HARMONIC_MEAN EQUAL INT_NUMBER {driver.option_num("ms.draws_nbr_modified_harmonic_mean",$3); }; o_dirichlet_scale : DIRICHLET_SCALE EQUAL INT_NUMBER {driver.option_num("ms.dirichlet_scale",$3); }; o_k_order_solver : K_ORDER_SOLVER {driver.option_num("k_order_solver","1"); }; +o_pruning : PRUNING { driver.option_num("pruning", "1"); }; o_chain : CHAIN EQUAL INT_NUMBER { driver.option_num("ms.chain",$3); }; o_state : STATE EQUAL INT_NUMBER { driver.option_num("ms.state",$3); }; diff --git a/DynareFlex.ll b/DynareFlex.ll index 5fd8c518..be1e8689 100644 --- a/DynareFlex.ll +++ b/DynareFlex.ll @@ -351,7 +351,7 @@ int sigma_e = 0; filter_covariance {return token::FILTER_COVARIANCE; } filter_decomposition {return token::FILTER_DECOMPOSITION; } selected_variables_only {return token::SELECTED_VARIABLES_ONLY; } - +pruning {return token::PRUNING; }; [\$][^$]*[\$] { strtok(yytext+1, "$");