From bc2348f0b77af42ffbe2364adde04a798d3d4273 Mon Sep 17 00:00:00 2001
From: sebastien <sebastien@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Mon, 25 Aug 2008 16:45:39 +0000
Subject: [PATCH] v4 preprocessor: * DynareBison.yy: added missing declaration
 of MODEL_INFO as a token * various cosmetic changes

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1995 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 ComputingTasks.cc         | 8 +++-----
 DynareBison.yy            | 4 ++--
 DynareMain.cc             | 1 -
 DynareMain2.cc            | 4 ++--
 ParsingDriver.cc          | 4 +---
 include/ComputingTasks.hh | 4 ++--
 include/ParsingDriver.hh  | 4 ++--
 macro/MacroDriver.hh      | 8 ++++----
 8 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/ComputingTasks.cc b/ComputingTasks.cc
index 26f8fff9..8de0bcc0 100644
--- a/ComputingTasks.cc
+++ b/ComputingTasks.cc
@@ -68,23 +68,21 @@ CheckStatement::checkPass(ModFileStructure &mod_file_struct)
   mod_file_struct.check_present = true;
 }
 
-Model_InfoStatement::Model_InfoStatement(const OptionsList &options_list_arg) :
+ModelInfoStatement::ModelInfoStatement(const OptionsList &options_list_arg) :
   options_list(options_list_arg)
 {
 }
 
-void Model_InfoStatement::checkPass(ModFileStructure &mod_file_struct)
+void ModelInfoStatement::checkPass(ModFileStructure &mod_file_struct)
 {
-  //mod_file_struct.model_info_present = true;
 }
 
-void Model_InfoStatement::writeOutput(ostream &output, const string &basename) const
+void ModelInfoStatement::writeOutput(ostream &output, const string &basename) const
 {
   options_list.writeOutput(output);
   output << "model_info();\n";
 }
 
-
 SimulStatement::SimulStatement(const OptionsList &options_list_arg) :
   options_list(options_list_arg)
 {
diff --git a/DynareBison.yy b/DynareBison.yy
index 2fee306c..c2d51863 100644
--- a/DynareBison.yy
+++ b/DynareBison.yy
@@ -98,7 +98,7 @@ class ParsingDriver;
 %token KALMAN_ALGO KALMAN_TOL
 %token LAPLACE LCC_COMPILER LIK_ALGO LIK_INIT LINEAR LOAD_MH_FILE LOGLINEAR LU MARKOWITZ MAX
 %token METHOD MH_DROP MH_INIT_SCALE MH_JSCALE MH_MODE MH_NBLOCKS MH_REPLIC MH_RECOVER MIN
-%token MODE_CHECK MODE_COMPUTE MODE_FILE MODEL MODEL_COMPARISON MSHOCKS
+%token MODE_CHECK MODE_COMPUTE MODE_FILE MODEL MODEL_COMPARISON MODEL_INFO MSHOCKS
 %token MODEL_COMPARISON_APPROXIMATION MODIFIEDHARMONICMEAN MOMENTS_VARENDO DIFFUSE_FILTER
 %token <string_val> NAME
 %token NO_COMPILER NOBS NOCONSTANT NOCORR NODIAGNOSTIC NOFUNCTIONS
@@ -615,7 +615,7 @@ check_options : o_solve_algo;
 
 model_info : MODEL_INFO ';'
              { driver.model_info(); }
-             ;
+           ;
 
 simul : SIMUL ';'
         { driver.simulate(); }
diff --git a/DynareMain.cc b/DynareMain.cc
index 7a32a3a0..61dc9bbb 100644
--- a/DynareMain.cc
+++ b/DynareMain.cc
@@ -86,7 +86,6 @@ main(int argc, char** argv)
     }
 
   // Do the rest
-
   main2(macro_output, basename, debug, clear_all);
 
   return 0;
diff --git a/DynareMain2.cc b/DynareMain2.cc
index 7061e71e..53a5584d 100644
--- a/DynareMain2.cc
+++ b/DynareMain2.cc
@@ -28,10 +28,10 @@ void
 main2(stringstream &in, string &basename, bool debug, bool clear_all)
 {
   ParsingDriver p;
-  //cout << "OK\n";
+
   // Do parsing and construct internal representation of mod file
   ModFile *mod_file = p.parse(in, debug);
-  //cout << "OK1\n";
+
   // Run checking pass
   mod_file->checkPass();
 
diff --git a/ParsingDriver.cc b/ParsingDriver.cc
index ac254e3e..267ed92a 100644
--- a/ParsingDriver.cc
+++ b/ParsingDriver.cc
@@ -729,15 +729,13 @@ ParsingDriver::simul()
   options_list.clear();
 }
 
-
 void
 ParsingDriver::model_info()
 {
-  mod_file->addStatement(new Model_InfoStatement(options_list));
+  mod_file->addStatement(new ModelInfoStatement(options_list));
   options_list.clear();
 }
 
-
 void
 ParsingDriver::check()
 {
diff --git a/include/ComputingTasks.hh b/include/ComputingTasks.hh
index f497a45b..1d5a749b 100644
--- a/include/ComputingTasks.hh
+++ b/include/ComputingTasks.hh
@@ -76,12 +76,12 @@ public:
   virtual void writeOutput(ostream &output, const string &basename) const;
 };
 
-class Model_InfoStatement : public Statement
+class ModelInfoStatement : public Statement
 {
 private:
   const OptionsList options_list;
 public:
-  Model_InfoStatement(const OptionsList &options_list_arg);
+  ModelInfoStatement(const OptionsList &options_list_arg);
   virtual void checkPass(ModFileStructure &mod_file_struct);
   virtual void writeOutput(ostream &output, const string &basename) const;
 };
diff --git a/include/ParsingDriver.hh b/include/ParsingDriver.hh
index c9da8d05..fd282538 100644
--- a/include/ParsingDriver.hh
+++ b/include/ParsingDriver.hh
@@ -54,7 +54,7 @@ using namespace std;
 class DynareFlex : public DynareFlexLexer
 {
 public:
-  DynareFlex(std::istream* in = 0, ostream* out = 0);
+  DynareFlex(istream* in = 0, ostream* out = 0);
 
   //! The main lexing function
   Dynare::parser::token_type lex(Dynare::parser::semantic_type *yylval,
@@ -146,7 +146,7 @@ public:
 
   //! Starts parsing, and constructs the MOD file representation
   /*! The returned pointer should be deleted after use */
-  ModFile *parse(std::istream &in, bool debug);
+  ModFile *parse(istream &in, bool debug);
 
   //! Reference to the lexer
   class DynareFlex *lexer;
diff --git a/macro/MacroDriver.hh b/macro/MacroDriver.hh
index 63bded30..cb8a29e2 100644
--- a/macro/MacroDriver.hh
+++ b/macro/MacroDriver.hh
@@ -53,12 +53,12 @@ private:
   class ScanContext
   {
   public:
-    std::istream *input;
+    istream *input;
     struct yy_buffer_state *buffer;
     const Macro::parser::location_type yylloc;
     const string for_body;
     const Macro::parser::location_type for_body_loc;
-    ScanContext(std::istream *input_arg, struct yy_buffer_state *buffer_arg,
+    ScanContext(istream *input_arg, struct yy_buffer_state *buffer_arg,
                 Macro::parser::location_type &yylloc_arg, const string &for_body_arg,
                 Macro::parser::location_type &for_body_loc_arg) :
       input(input_arg), buffer(buffer_arg), yylloc(yylloc_arg), for_body(for_body_arg),
@@ -70,7 +70,7 @@ private:
 
   //! Input stream used for initialization of current scanning context
   /*! Kept for deletion at end of current scanning buffer */
-  std::istream *input;
+  istream *input;
 
   //! If current context is the body of a loop, contains the string of the loop body. Empty otherwise.
   string for_body;
@@ -125,7 +125,7 @@ private:
       and initialise a new scanning context with the loop body */
   bool iter_loop(MacroDriver &driver, Macro::parser::location_type *yylloc);
 public:
-  MacroFlex(std::istream* in = 0, ostream* out = 0);
+  MacroFlex(istream* in = 0, ostream* out = 0);
 
   //! The main lexing function
   Macro::parser::token_type lex(Macro::parser::semantic_type *yylval,
-- 
GitLab