From d035175627890dfee4aa45cf40fc9965d9d640eb Mon Sep 17 00:00:00 2001 From: michel Date: Sun, 17 Dec 2006 14:59:39 +0000 Subject: [PATCH] v4 parser: 'check' is also a computing task git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1123 ac1d8469-bf42-47a9-8791-bf33cf982152 --- parser.src/ComputingTasks.cc | 6 ++++++ parser.src/ModFile.cc | 12 ++++++------ parser.src/ParsingDriver.cc | 2 +- parser.src/Statement.cc | 1 + parser.src/include/ComputingTasks.hh | 1 + parser.src/include/Statement.hh | 2 ++ 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/parser.src/ComputingTasks.cc b/parser.src/ComputingTasks.cc index cf5bba8e9..5db625223 100644 --- a/parser.src/ComputingTasks.cc +++ b/parser.src/ComputingTasks.cc @@ -36,6 +36,12 @@ CheckStatement::writeOutput(ostream &output) const output << "check;\n"; } +void +CheckStatement::checkPass(ModFileStructure &mod_file_struct) +{ + mod_file_struct.check_present = true; +} + SimulStatement::SimulStatement(const OptionsList &options_list_arg) : options_list(options_list_arg) { diff --git a/parser.src/ModFile.cc b/parser.src/ModFile.cc index 16f69428f..154c662bb 100644 --- a/parser.src/ModFile.cc +++ b/parser.src/ModFile.cc @@ -29,12 +29,12 @@ ModFile::checkPass() it != statements.end(); it++) (*it)->checkPass(mod_file_struct); - if (!mod_file_struct.simul_present - && !mod_file_struct.stoch_simul_or_similar_present) - { - cerr << "Error: nothing to compute! you must use one of {simul, stoch_simul, estimation, olr, osr}" << endl; - exit(-1); - } +// if (!mod_file_struct.simul_present +// && !mod_file_struct.stoch_simul_or_similar_present) +// { +// cerr << "Error: nothing to compute! you must use one of {simul, stoch_simul, estimation, olr, osr}" << endl; +// exit(-1); +// } if (mod_file_struct.simul_present && mod_file_struct.stoch_simul_or_similar_present) diff --git a/parser.src/ParsingDriver.cc b/parser.src/ParsingDriver.cc index 21c0860bd..6f475ec6c 100644 --- a/parser.src/ParsingDriver.cc +++ b/parser.src/ParsingDriver.cc @@ -154,7 +154,7 @@ ParsingDriver::add_model_variable(string *name, string *olag) ExpObj * ParsingDriver::add_expression_variable(string *name) { - check_symbol_existence(*name); + // check_symbol_existence(*name); int id = mod_file->symbol_table.getID(*name); Type type = mod_file->symbol_table.getType(*name); delete name; diff --git a/parser.src/Statement.cc b/parser.src/Statement.cc index 22e049f08..3ac46a7d4 100644 --- a/parser.src/Statement.cc +++ b/parser.src/Statement.cc @@ -1,6 +1,7 @@ #include "Statement.hh" ModFileStructure::ModFileStructure() : + check_present(false), simul_present(false), stoch_simul_or_similar_present(false) { diff --git a/parser.src/include/ComputingTasks.hh b/parser.src/include/ComputingTasks.hh index afc01db0c..d8be88230 100644 --- a/parser.src/include/ComputingTasks.hh +++ b/parser.src/include/ComputingTasks.hh @@ -22,6 +22,7 @@ private: const OptionsList options_list; public: CheckStatement(const OptionsList &options_list_arg); + virtual void checkPass(ModFileStructure &mod_file_struct); virtual void writeOutput(ostream &output) const; }; diff --git a/parser.src/include/Statement.hh b/parser.src/include/Statement.hh index c2ce403a2..1e8cdda68 100644 --- a/parser.src/include/Statement.hh +++ b/parser.src/include/Statement.hh @@ -11,6 +11,8 @@ class ModFileStructure { public: ModFileStructure(); + //! Wheter check is present + bool check_present; //! Whether a simul statement is present bool simul_present; //! Whether a stoch_simul, estimation, olr, osr statement is present