diff --git a/preprocessor/DynareMain.cc b/preprocessor/DynareMain.cc index 633f5f97b63240dc64ae07bc220a4d0098914269..1f99d8746d24de499aacde42c174050366b51826 100644 --- a/preprocessor/DynareMain.cc +++ b/preprocessor/DynareMain.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 Dynare Team + * Copyright (C) 2003-2014 Dynare Team * * This file is part of Dynare. * @@ -29,7 +29,7 @@ #include "macro/MacroDriver.hh" #include <unistd.h> -#include "DynareOutput.hh" +#include "FileOutputType.hh" /* Prototype for second part of main function Splitting main() in two parts was necessary because ParsingDriver.h and MacroDriver.h can't be @@ -37,7 +37,7 @@ */ void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool no_log, bool no_warn, bool warn_uninit, bool console, bool nograph, bool nointeractive, bool parallel, const string ¶llel_config_file, const string &cluster_name, bool parallel_slave_open_mode, - bool parallel_test, bool nostrict, OutputType output_mode, bool cuda + bool parallel_test, bool nostrict, FileOutputType output_mode, bool cuda #if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc #endif @@ -96,7 +96,7 @@ main(int argc, char **argv) bool parallel_test = false; bool nostrict = false; map<string, string> defines; - OutputType output_mode = none; + FileOutputType output_mode = none; bool cuda = false; // Parse options diff --git a/preprocessor/DynareMain2.cc b/preprocessor/DynareMain2.cc index 44416b32c9792846d86e1bc2e44e7803143a6906..208f1e40153e5e9e3660b7122d19425c84b17009 100644 --- a/preprocessor/DynareMain2.cc +++ b/preprocessor/DynareMain2.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2013 Dynare Team + * Copyright (C) 2008-2014 Dynare Team * * This file is part of Dynare. * @@ -22,12 +22,12 @@ #include "ParsingDriver.hh" #include "ModFile.hh" #include "ConfigFile.hh" -#include "DynareOutput.hh" +#include "FileOutputType.hh" void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms, bool no_log, bool no_warn, bool warn_uninit, bool console, bool nograph, bool nointeractive, bool parallel, const string ¶llel_config_file, const string &cluster_name, bool parallel_slave_open_mode, - bool parallel_test, bool nostrict, OutputType output_mode, bool cuda + bool parallel_test, bool nostrict, FileOutputType output_mode, bool cuda #if defined(_WIN32) || defined(__CYGWIN32__) , bool cygwin, bool msvc #endif diff --git a/preprocessor/DynareOutput.hh b/preprocessor/DynareOutput.hh deleted file mode 100644 index 4e884f6b55ef9d3d7da498e7250978caaca83867..0000000000000000000000000000000000000000 --- a/preprocessor/DynareOutput.hh +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _DYNARE_OUTPUT_HH -#define _DYNARE_OUTPUT_HH - -enum OutputType - { - none, // outputs files for Matlab/Octave processing - dynamic, // outputs <fname>_dynamic.cc and related files - first, // outputs <fname>_first_derivatives and related files - second, // outputs <fname>_first_derivatives, <fname>_second_derivatives.cc and related files - third, // outputs <fname>_first_derivatives, <fname>_second_derivatives.cc, <fname>_third_derivatives.cc and related files - }; -#endif diff --git a/preprocessor/FileOutputType.hh b/preprocessor/FileOutputType.hh new file mode 100644 index 0000000000000000000000000000000000000000..8f4e681f394d77a6bf9acf35a5b39c7297a0022b --- /dev/null +++ b/preprocessor/FileOutputType.hh @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2014 Dynare Team + * + * This file is part of Dynare. + * + * Dynare is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Dynare is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Dynare. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _FILE_OUTPUT_TYPE_HH +#define _FILE_OUTPUT_TYPE_HH + +enum FileOutputType + { + none, // outputs files for Matlab/Octave processing + dynamic, // outputs <fname>_dynamic.cc and related files + first, // outputs <fname>_first_derivatives and related files + second, // outputs <fname>_first_derivatives, <fname>_second_derivatives.cc and related files + third, // outputs <fname>_first_derivatives, <fname>_second_derivatives.cc, <fname>_third_derivatives.cc and related files + }; +#endif diff --git a/preprocessor/Makefile.am b/preprocessor/Makefile.am index a9cecac8ff251d0e9bb6b85cb3d0ff4b9065e4c6..91112aefe0a8b9471d9a62d529c5580ec844f696 100644 --- a/preprocessor/Makefile.am +++ b/preprocessor/Makefile.am @@ -52,7 +52,8 @@ dynare_m_SOURCES = \ SteadyStateModel.hh \ SteadyStateModel.cc \ WarningConsolidation.hh \ - WarningConsolidation.cc + WarningConsolidation.cc \ + FileOutputType.hh # The -I. is for <FlexLexer.h> dynare_m_CPPFLAGS = $(BOOST_CPPFLAGS) -I. diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc index 51b8553299920bbda38d9d05ed3ab93a5e3e5381..ff352c62039745c5faf5adcd758f011df35da8f5 100644 --- a/preprocessor/ModFile.cc +++ b/preprocessor/ModFile.cc @@ -447,7 +447,7 @@ ModFile::transformPass(bool nostrict) } void -ModFile::computingPass(bool no_tmp_terms, OutputType output) +ModFile::computingPass(bool no_tmp_terms, FileOutputType output) { // Mod file may have no equation (for example in a standalone BVAR estimation) if (dynamic_model.equation_number() > 0) @@ -881,7 +881,7 @@ ModFile::writeModelCC(const string &basename, bool cuda) const } void -ModFile::writeExternalFiles(const string &basename, OutputType output, bool cuda) const +ModFile::writeExternalFiles(const string &basename, FileOutputType output, bool cuda) const { writeModelCC(basename, cuda); steady_state_model.writeSteadyStateFileCC(basename, mod_file_struct.ramsey_policy_present, cuda); diff --git a/preprocessor/ModFile.hh b/preprocessor/ModFile.hh index 6616ae26cb2d2253e08c52e6c8b74ab5f06849c4..387fda178cf1e6be98fe2f3d4746b712d00a9fa9 100644 --- a/preprocessor/ModFile.hh +++ b/preprocessor/ModFile.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2013 Dynare Team + * Copyright (C) 2006-2014 Dynare Team * * This file is part of Dynare. * @@ -35,7 +35,7 @@ using namespace std; #include "ExternalFunctionsTable.hh" #include "ConfigFile.hh" #include "WarningConsolidation.hh" -#include "DynareOutput.hh" +#include "FileOutputType.hh" //! The abstract representation of a "mod" file class ModFile @@ -122,7 +122,7 @@ public: void transformPass(bool nostrict); //! Execute computations /*! \param no_tmp_terms if true, no temporary terms will be computed in the static and dynamic files */ - void computingPass(bool no_tmp_terms, OutputType output); + void computingPass(bool no_tmp_terms, FileOutputType output); //! Writes Matlab/Octave output files /*! \param basename The base name used for writing output files. Should be the name of the mod file without its extension @@ -141,7 +141,7 @@ public: //! Writes C output files only => No further Matlab processing void writeCOutputFiles(const string &basename) const; void writeModelCC(const string &basename, bool cuda) const; - void writeExternalFiles(const string &basename, OutputType output, bool cuda) const; + void writeExternalFiles(const string &basename, FileOutputType output, bool cuda) const; }; #endif // ! MOD_FILE_HH