diff --git a/ComputingTasks.cc b/ComputingTasks.cc index f45a4e31..e2f60fc9 100644 --- a/ComputingTasks.cc +++ b/ComputingTasks.cc @@ -2686,7 +2686,7 @@ InitialConditionDecompositionStatement::writeOutput(ostream &output, const strin output << "options_ = set_default_initial_condition_decomposition_options(options_);" << endl; options_list.writeOutput(output); symbol_list.writeOutput("var_list_", output); - output << "initial_condition_decomposition(M_, oo_, options_, var_list_, bayestopt_, estim_params_);" << endl; + output << "oo_ = initial_condition_decomposition(M_, oo_, options_, var_list_, bayestopt_, estim_params_);" << endl; } ConditionalForecastStatement::ConditionalForecastStatement(const OptionsList &options_list_arg) : diff --git a/DynareBison.yy b/DynareBison.yy index 8ec4ceeb..53a9ea42 100644 --- a/DynareBison.yy +++ b/DynareBison.yy @@ -114,7 +114,7 @@ class ParsingDriver; %token CPF_WEIGHTS AMISANOTRISTANI MURRAYJONESPARSLOW WRITE_EQUATION_TAGS METHOD %token NONLINEAR_FILTER_INITIALIZATION FILTER_ALGORITHM PROPOSAL_APPROXIMATION CUBATURE UNSCENTED MONTECARLO DISTRIBUTION_APPROXIMATION %token NAME -%token USE_PENALIZED_OBJECTIVE_FOR_HESSIAN INIT_STATE RESCALE_PREDICTION_ERROR_COVARIANCE GENERATE_IRFS +%token USE_PENALIZED_OBJECTIVE_FOR_HESSIAN INIT_STATE FAST_REALTIME RESCALE_PREDICTION_ERROR_COVARIANCE GENERATE_IRFS %token NAN_CONSTANT NO_STATIC NOBS NOCONSTANT NODISPLAY NOCORR NODIAGNOSTIC NOFUNCTIONS NO_HOMOTOPY %token NOGRAPH POSTERIOR_NOGRAPH POSTERIOR_GRAPH NOMOMENTS NOPRINT NORMAL_PDF SAVE_DRAWS MODEL_NAME STDERR_MULTIPLES DIAGONAL_ONLY %token OBSERVATION_TRENDS OPTIM OPTIM_WEIGHTS ORDER OSR OSR_PARAMS MAX_DIM_COVA_GROUP ADVANCED OUTFILE OUTVARS OVERWRITE @@ -2827,6 +2827,7 @@ realtime_shock_decomposition_option : o_parameter_set | o_shock_decomposition_presample | o_shock_decomposition_forecast | o_save_realtime + | o_fast_realtime ; plot_shock_decomposition_options_list : plot_shock_decomposition_option COMMA plot_shock_decomposition_options_list @@ -2860,6 +2861,9 @@ initial_condition_decomposition_option : o_icd_type | o_icd_write_xls | o_icd_plot_init_date | o_icd_plot_end_date + | o_nodisplay + | o_graph_format + | o_psd_fig_name ; homotopy_setup: HOMOTOPY_SETUP ';' homotopy_list END ';' @@ -3240,6 +3244,7 @@ o_init_state : INIT_STATE EQUAL INT_NUMBER { driver.option_num("shock_decomp.ini o_shock_decomposition_presample : PRESAMPLE EQUAL INT_NUMBER { driver.option_num("shock_decomp.presample", $3); }; o_shock_decomposition_forecast : FORECAST EQUAL INT_NUMBER { driver.option_num("shock_decomp.forecast", $3); }; o_save_realtime : SAVE_REALTIME EQUAL vec_int { driver.option_vec_int("shock_decomp.save_realtime", $3); }; +o_fast_realtime : FAST_REALTIME EQUAL INT_NUMBER { driver.option_num("shock_decomp.fast_realtime", $3); }; o_nodisplay : NODISPLAY { driver.option_num("nodisplay","1"); }; o_psd_nodisplay : NODISPLAY { driver.option_num("plot_shock_decomp.nodisplay","1"); }; o_graph_format : GRAPH_FORMAT EQUAL allowed_graph_formats diff --git a/DynareFlex.ll b/DynareFlex.ll index 1ebe6a5c..86f00756 100644 --- a/DynareFlex.ll +++ b/DynareFlex.ll @@ -594,6 +594,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2 controlled_varexo {return token::CONTROLLED_VAREXO; } parameter_set {return token::PARAMETER_SET; } init_state {return token::INIT_STATE; } +fast_realtime {return token::FAST_REALTIME; } save_realtime {return token::SAVE_REALTIME;} detail_plot {return token::DETAIL_PLOT;} interactive {return token::INTERACTIVE;} diff --git a/macro/MacroDriver.cc b/macro/MacroDriver.cc index bd15152b..b0420b44 100644 --- a/macro/MacroDriver.cc +++ b/macro/MacroDriver.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2017 Dynare Team + * Copyright (C) 2008-2018 Dynare Team * * This file is part of Dynare. * @@ -60,7 +60,11 @@ MacroDriver::parse(const string &f, const string &fb, const string &modfiletxt, } catch (boost::bad_lexical_cast &) { - file_with_endl << "@#define " << it->first << " = \"" << it->second << "\"" << endl; + if (!it->second.empty() && it->second.at(0) == '[' && it->second.at(it->second.length()-1) == ']') + // If the input is an array. Issue #1578 + file_with_endl << "@#define " << it->first << " = " << it->second << endl; + else + file_with_endl << "@#define " << it->first << " = \"" << it->second << "\"" << endl; } file_with_endl << modfiletxt << endl; diff --git a/macro/MacroFlex.ll b/macro/MacroFlex.ll index 5125ffa7..21a35a1c 100644 --- a/macro/MacroFlex.ll +++ b/macro/MacroFlex.ll @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2017 Dynare Team + * Copyright (C) 2008-2018 Dynare Team * * This file is part of Dynare. * @@ -71,6 +71,8 @@ CONT \\\\ yylloc->step(); %} +["/"]["/"].* + ^{SPC}*@#{SPC}*includepath{SPC}+\"([^\"\r\n:;|<>]*){1}(:[^\"\r\n:;|<>]*)*\"{SPC}*{EOL} { yylloc->lines(1); yylloc->step(); @@ -303,6 +305,16 @@ CONT \\\\ then_body_tmp.append(yytext); yylloc->step(); } +^{SPC}*@#{SPC}*ifdef({SPC}|{CONT}) { + nested_if_nb++; + then_body_tmp.append(yytext); + yylloc->step(); + } +^{SPC}*@#{SPC}*ifndef({SPC}|{CONT}) { + nested_if_nb++; + then_body_tmp.append(yytext); + yylloc->step(); + } . { then_body_tmp.append(yytext); yylloc->step(); } <> { driver.error(if_stmt_loc_tmp, "@#if/@#ifdef/@#ifndef not matched by an @#endif or file does not end with a new line (unexpected end of file)"); } ^{SPC}*@#{SPC}*else{SPC}*(\/\/.*)?{EOL} {