v4 parser: 'check' is also a computing task
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1123 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
f3c3e6d71d
commit
d035175627
|
@ -36,6 +36,12 @@ CheckStatement::writeOutput(ostream &output) const
|
||||||
output << "check;\n";
|
output << "check;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CheckStatement::checkPass(ModFileStructure &mod_file_struct)
|
||||||
|
{
|
||||||
|
mod_file_struct.check_present = true;
|
||||||
|
}
|
||||||
|
|
||||||
SimulStatement::SimulStatement(const OptionsList &options_list_arg) :
|
SimulStatement::SimulStatement(const OptionsList &options_list_arg) :
|
||||||
options_list(options_list_arg)
|
options_list(options_list_arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,12 +29,12 @@ ModFile::checkPass()
|
||||||
it != statements.end(); it++)
|
it != statements.end(); it++)
|
||||||
(*it)->checkPass(mod_file_struct);
|
(*it)->checkPass(mod_file_struct);
|
||||||
|
|
||||||
if (!mod_file_struct.simul_present
|
// if (!mod_file_struct.simul_present
|
||||||
&& !mod_file_struct.stoch_simul_or_similar_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;
|
// cerr << "Error: nothing to compute! you must use one of {simul, stoch_simul, estimation, olr, osr}" << endl;
|
||||||
exit(-1);
|
// exit(-1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (mod_file_struct.simul_present
|
if (mod_file_struct.simul_present
|
||||||
&& mod_file_struct.stoch_simul_or_similar_present)
|
&& mod_file_struct.stoch_simul_or_similar_present)
|
||||||
|
|
|
@ -154,7 +154,7 @@ ParsingDriver::add_model_variable(string *name, string *olag)
|
||||||
ExpObj *
|
ExpObj *
|
||||||
ParsingDriver::add_expression_variable(string *name)
|
ParsingDriver::add_expression_variable(string *name)
|
||||||
{
|
{
|
||||||
check_symbol_existence(*name);
|
// check_symbol_existence(*name);
|
||||||
int id = mod_file->symbol_table.getID(*name);
|
int id = mod_file->symbol_table.getID(*name);
|
||||||
Type type = mod_file->symbol_table.getType(*name);
|
Type type = mod_file->symbol_table.getType(*name);
|
||||||
delete name;
|
delete name;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "Statement.hh"
|
#include "Statement.hh"
|
||||||
|
|
||||||
ModFileStructure::ModFileStructure() :
|
ModFileStructure::ModFileStructure() :
|
||||||
|
check_present(false),
|
||||||
simul_present(false),
|
simul_present(false),
|
||||||
stoch_simul_or_similar_present(false)
|
stoch_simul_or_similar_present(false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,7 @@ private:
|
||||||
const OptionsList options_list;
|
const OptionsList options_list;
|
||||||
public:
|
public:
|
||||||
CheckStatement(const OptionsList &options_list_arg);
|
CheckStatement(const OptionsList &options_list_arg);
|
||||||
|
virtual void checkPass(ModFileStructure &mod_file_struct);
|
||||||
virtual void writeOutput(ostream &output) const;
|
virtual void writeOutput(ostream &output) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ class ModFileStructure
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModFileStructure();
|
ModFileStructure();
|
||||||
|
//! Wheter check is present
|
||||||
|
bool check_present;
|
||||||
//! Whether a simul statement is present
|
//! Whether a simul statement is present
|
||||||
bool simul_present;
|
bool simul_present;
|
||||||
//! Whether a stoch_simul, estimation, olr, osr statement is present
|
//! Whether a stoch_simul, estimation, olr, osr statement is present
|
||||||
|
|
Loading…
Reference in New Issue