Commit d5ac5b1f authored by sebastien's avatar sebastien
Browse files

v4 parser: created ModFile class, which is the abstract representation of a...

v4 parser: created ModFile class, which is the abstract representation of a mod file; removed all static variables


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1110 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 442bf232
......@@ -13,7 +13,7 @@ using namespace std;
//------------------------------------------------------------------------------
//ostringstream ComputingTasks::output;
//------------------------------------------------------------------------------
ComputingTasks::ComputingTasks()
ComputingTasks::ComputingTasks(const SymbolTable &symbol_table_arg) : symbol_table(symbol_table_arg)
{
// Empty
}
......@@ -120,8 +120,8 @@ void ComputingTasks::setEstimationInit(void)
//------------------------------------------------------------------------------
void ComputingTasks::setOptimOptions(string str1, string str2, int task)
{
static string optim_string;
static int start;
string optim_string;
int start;
switch(task)
{
case 1:
......@@ -160,12 +160,12 @@ void ComputingTasks::setOptimOptions(string str1, string str2, int task)
//------------------------------------------------------------------------------
void ComputingTasks::setEstimatedElements(void)
{
if (!SymbolTable::Exist(EstimParams->name))
if (!symbol_table.Exist(EstimParams->name))
{
string msg = "Unknown symbol: "+EstimParams->name;
error(msg.c_str());
}
if (SymbolTable::isReferenced(EstimParams->name) == eNotReferenced & EstimParams->name != "dsge_prior_weight")
if (symbol_table.isReferenced(EstimParams->name) == eNotReferenced & EstimParams->name != "dsge_prior_weight")
{
return;
}
......@@ -176,31 +176,31 @@ void ComputingTasks::setEstimatedElements(void)
switch(EstimParams->type)
{
case 1:
if( SymbolTable::getType(EstimParams->name) == eExogenous)
if (symbol_table.getType(EstimParams->name) == eExogenous)
{
*output << "estim_params_.var_exo = [estim_params_.var_exo; ";
}
else if ( SymbolTable::getType(EstimParams->name) == eEndogenous)
else if (symbol_table.getType(EstimParams->name) == eEndogenous)
{
*output << "estim_params_.var_endo = [estim_params_.var_endo; ";
}
*output << SymbolTable::getID(EstimParams->name)+1;
*output << symbol_table.getID(EstimParams->name)+1;
break;
case 2:
*output << "estim_params_.param_vals = [estim_params_.param_vals; ";
*output << SymbolTable::getID(EstimParams->name)+1;
*output << symbol_table.getID(EstimParams->name)+1;
break;
case 3:
if( SymbolTable::getType(EstimParams->name) == eExogenous)
if (symbol_table.getType(EstimParams->name) == eExogenous)
{
*output << "estim_params_.corrx = [estim_params_.corrx; ";
}
else if ( SymbolTable::getType(EstimParams->name) == eEndogenous)
else if (symbol_table.getType(EstimParams->name) == eEndogenous)
{
*output << "estim_params_.corrn = [estim_params_.corrn; ";
}
*output << SymbolTable::getID(EstimParams->name)+1;
*output << " " << SymbolTable::getID(EstimParams->name2)+1;
*output << symbol_table.getID(EstimParams->name)+1;
*output << " " << symbol_table.getID(EstimParams->name2)+1;
break;
}
*output << " " << EstimParams->init_val << " " << EstimParams->low_bound << " " <<
......@@ -213,12 +213,12 @@ void ComputingTasks::setEstimatedElements(void)
//------------------------------------------------------------------------------
void ComputingTasks::setEstimatedInitElements(void)
{
if (!SymbolTable::Exist(EstimParams->name))
if (!symbol_table.Exist(EstimParams->name))
{
string msg = "Unknown symbol: "+EstimParams->name;
error(msg.c_str());
}
if (SymbolTable::isReferenced(EstimParams->name) == eNotReferenced)
if (symbol_table.isReferenced(EstimParams->name) == eNotReferenced)
{
return;
}
......@@ -228,32 +228,32 @@ void ComputingTasks::setEstimatedInitElements(void)
}
if (EstimParams->type < 3)
{
if( SymbolTable::getType(EstimParams->name) == eExogenous)
if (symbol_table.getType(EstimParams->name) == eExogenous)
{
*output << "tmp1 = find(estim_params_.var_exo(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ");\n";
*output << "tmp1 = find(estim_params_.var_exo(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ");\n";
*output << "estim_params_.var_exo(tmp1,2) = " << EstimParams->init_val << ";\n";
}
else if ( SymbolTable::getType(EstimParams->name) == eEndogenous)
else if (symbol_table.getType(EstimParams->name) == eEndogenous)
{
*output << "tmp1 = find(estim_params_.var_endo(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ");\n";
*output << "tmp1 = find(estim_params_.var_endo(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ");\n";
*output << "estim_params_.var_endo(tmp1,2) = " << EstimParams->init_val << ";\n";
}
else if ( SymbolTable::getType(EstimParams->name) == eParameter)
else if (symbol_table.getType(EstimParams->name) == eParameter)
{
*output << "tmp1 = find(estim_params_.param_vals(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ");\n";
*output << "tmp1 = find(estim_params_.param_vals(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ");\n";
*output << "estim_params_.param_vals(tmp1,2) = " << EstimParams->init_val << ";\n";
}
}
else
{
if( SymbolTable::getType(EstimParams->name) == eExogenous)
if (symbol_table.getType(EstimParams->name) == eExogenous)
{
*output << "tmp1 = find((estim_params_.corrx(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ")) & (estim_params_.corrx(:,2)==SymbolTable::getID(EstimParams->name2)+1);\n";
*output << "tmp1 = find((estim_params_.corrx(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ")) & (estim_params_.corrx(:,2)==" << symbol_table.getID(EstimParams->name2)+1 << ");\n";
*output << "estim_params_.corrx(tmp1,3) = " << EstimParams->init_val << ";\n";
}
else if ( SymbolTable::getType(EstimParams->name) == eEndogenous)
else if (symbol_table.getType(EstimParams->name) == eEndogenous)
{
*output << "tmp1 = find((estim_params_.corrn(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ")) & (estim_params_.corrn(:,2)==" << SymbolTable::getID(EstimParams->name2)+1 << ";\n";
*output << "tmp1 = find((estim_params_.corrn(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ")) & (estim_params_.corrn(:,2)==" << symbol_table.getID(EstimParams->name2)+1 << ";\n";
*output << "estim_params_.corrx(tmp1,3) = " << EstimParams->init_val << ";\n";
}
}
......@@ -263,12 +263,12 @@ void ComputingTasks::setEstimatedInitElements(void)
//------------------------------------------------------------------------------
void ComputingTasks::setEstimatedBoundsElements(void)
{
if (!SymbolTable::Exist(EstimParams->name))
if (!symbol_table.Exist(EstimParams->name))
{
string msg = "Unknown symbol: "+EstimParams->name;
error(msg.c_str());
}
if (SymbolTable::isReferenced(EstimParams->name) == eNotReferenced)
if (symbol_table.isReferenced(EstimParams->name) == eNotReferenced)
{
return;
}
......@@ -278,36 +278,36 @@ void ComputingTasks::setEstimatedBoundsElements(void)
}
if (EstimParams->type < 3)
{
if( SymbolTable::getType(EstimParams->name) == eExogenous)
if (symbol_table.getType(EstimParams->name) == eExogenous)
{
*output << "tmp1 = find(estim_params_.var_exo(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ");\n";
*output << "tmp1 = find(estim_params_.var_exo(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ");\n";
*output << "estim_params_.var_exo(tmp1,3) = " << EstimParams->low_bound << ";\n";
*output << "estim_params_.var_exo(tmp1,4) = " << EstimParams->up_bound << ";\n";
}
else if ( SymbolTable::getType(EstimParams->name) == eEndogenous)
else if (symbol_table.getType(EstimParams->name) == eEndogenous)
{
*output << "tmp1 = find(estim_params_.var_endo(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ");\n";
*output << "tmp1 = find(estim_params_.var_endo(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ");\n";
*output << "estim_params_.var_endo(tmp1,3) = " << EstimParams->low_bound << ";\n";
*output << "estim_params_.var_endo(tmp1,4) = " << EstimParams->up_bound << ";\n";
}
else if ( SymbolTable::getType(EstimParams->name) == eParameter)
else if (symbol_table.getType(EstimParams->name) == eParameter)
{
*output << "tmp1 = find(estim_params_.param_vals(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ");\n";
*output << "tmp1 = find(estim_params_.param_vals(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ");\n";
*output << "estim_params_.param_vals(tmp1,3) = " << EstimParams->low_bound << ";\n";
*output << "estim_params_.param_vals(tmp1,4) = " << EstimParams->up_bound << ";\n";
}
}
else
{
if( SymbolTable::getType(EstimParams->name) == eExogenous)
if (symbol_table.getType(EstimParams->name) == eExogenous)
{
*output << "tmp1 = find((estim_params_.corrx(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ")) & (estim_params_.corrx(:,2)==SymbolTable::getID(EstimParams->name2)+1);\n";
*output << "tmp1 = find((estim_params_.corrx(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ")) & (estim_params_.corrx(:,2)==" << symbol_table.getID(EstimParams->name2)+1 << ");\n";
*output << "estim_params_.corrx(tmp1,4) = " << EstimParams->low_bound << ";\n";
*output << "estim_params_.corrx(tmp1,5) = " << EstimParams->up_bound << ";\n";
}
else if ( SymbolTable::getType(EstimParams->name) == eEndogenous)
else if (symbol_table.getType(EstimParams->name) == eEndogenous)
{
*output << "tmp1 = find((estim_params_.corrn(:,1)==" << SymbolTable::getID(EstimParams->name)+1 << ")) & (estim_params_.corrn(:,2)==" << SymbolTable::getID(EstimParams->name2)+1 << ";\n";
*output << "tmp1 = find((estim_params_.corrn(:,1)==" << symbol_table.getID(EstimParams->name)+1 << ")) & (estim_params_.corrn(:,2)==" << symbol_table.getID(EstimParams->name2)+1 << ";\n";
*output << "estim_params_.corrx(tmp1,4) = " << EstimParams->low_bound << ";\n";
*output << "estim_params_.corrx(tmp1,5) = " << EstimParams->up_bound << ";\n";
}
......@@ -319,13 +319,13 @@ void ComputingTasks::setEstimatedBoundsElements(void)
void ComputingTasks::set_trend_element (string name, string expression)
{
//Testing if symbol exists
if (!SymbolTable::Exist(name))
if (!symbol_table.Exist(name))
{
string msg = "Unknown variable: " + name;
(* error) (msg.c_str());
}
Type type = SymbolTable::getType(name);
// int id = SymbolTable::getID(name);
Type type = symbol_table.getType(name);
// int id = symbol_table.getID(name);
if (type == eEndogenous)
{
*output << "tmp1 = strmatch('" << name << "',options_.varobs,'exact');\n";
......@@ -354,19 +354,19 @@ void ComputingTasks::BeginCalibVar(void)
//------------------------------------------------------------------------------
void ComputingTasks::setCalibVar(string name, string weight, string expression)
{
if (!SymbolTable::Exist(name))
if (!symbol_table.Exist(name))
{
string msg = "calib_var: " + name + " doesn't exist";
error(msg.c_str());
}
int id = SymbolTable::getID(name)+1;
if (SymbolTable::getType(name) == eEndogenous)
int id = symbol_table.getID(name) + 1;
if (symbol_table.getType(name) == eEndogenous)
{
*output << "calib_var_index{1} = [calib_var_index{1};" << id << "," << id << "];\n";
*output << "calib_weights{1} = [calib_weights{1}; " << weight << "];\n";
*output << "calib_targets{1} =[calib_targets{1}; " << expression << "];\n";
}
else if (SymbolTable::getType(name) == eExogenous)
else if (symbol_table.getType(name) == eExogenous)
{
*output << "calib_var_index{3} = [calib_var_index{3};" << id << "," << id << "];\n";
*output << "calib_weights{3} = [calib_weights{3}; " << weight << "];\n";
......@@ -382,30 +382,30 @@ void ComputingTasks::setCalibVar(string name, string weight, string expression)
//------------------------------------------------------------------------------
void ComputingTasks::setCalibVar(string name1, string name2, string weight, string expression)
{
if (!SymbolTable::Exist(name1))
if (!symbol_table.Exist(name1))
{
string msg = "calib_var: " + name1 + " doesn't exist";
error(msg.c_str());
}
if (!SymbolTable::Exist(name2))
if (!symbol_table.Exist(name2))
{
string msg = "calib_var: " + name2 + " doesn't exist";
error(msg.c_str());
}
if (SymbolTable::getType(name1) != SymbolTable::getType(name2))
if (symbol_table.getType(name1) != symbol_table.getType(name2))
{
string msg = "calib_var: " + name1 + " and " + name2 + " don't have the same type";
error(msg.c_str());
}
int id1 = SymbolTable::getID(name1)+1;
int id2 = SymbolTable::getID(name2)+1;
if (SymbolTable::getType(name1) == eEndogenous)
int id1 = symbol_table.getID(name1) + 1;
int id2 = symbol_table.getID(name2) + 1;
if (symbol_table.getType(name1) == eEndogenous)
{
*output << "calib_var_index{1} = [calib_var_index{1};" << id1 << "," << id2 << "];\n";
*output << "calib_weights{1} = [calib_weights{1}; " << weight << "];\n";
*output << "calib_targets{1} =[calib_targets{1}; " << expression << "];\n";
}
else if (SymbolTable::getType(name1) == eExogenous)
else if (symbol_table.getType(name1) == eExogenous)
{
*output << "calib_var_index{3} = [calib_var_index{3};" << id1 << "," << id2 << "];\n";
*output << "calib_weights{3} = [calib_weights{3}; " << weight << "];\n";
......@@ -420,13 +420,13 @@ void ComputingTasks::setCalibVar(string name1, string name2, string weight, stri
void ComputingTasks::setCalibAc(string name, string ar, string weight, string expression)
{
static int max_iar = 3;
if (!SymbolTable::Exist(name))
int max_iar = 3;
if (!symbol_table.Exist(name))
{
string msg = "calib_var: " + name + " doesn't exist";
error(msg.c_str());
}
int id = SymbolTable::getID(name)+1;
int id = symbol_table.getID(name) + 1;
int iar = atoi(ar.c_str())+3;
if (iar > max_iar)
{
......@@ -439,7 +439,7 @@ void ComputingTasks::setCalibAc(string name, string ar, string weight, string ex
}
max_iar = iar;
}
if (SymbolTable::getType(name) == eEndogenous)
if (symbol_table.getType(name) == eEndogenous)
{
*output << "calib_var_index{" << iar << "} = [calib_var_index{" << iar << "};" << id << "];\n";
*output << "calib_weights{" << iar << "} = [calib_weights{" << iar << "}; " << weight << "];\n";
......@@ -498,12 +498,12 @@ void ComputingTasks::BeginOptimWeights(void)
//------------------------------------------------------------------------------
void ComputingTasks::setOptimWeights(string name, string exp)
{
if (!SymbolTable::Exist(name) || SymbolTable::getType(name) != eEndogenous)
if (!symbol_table.Exist(name) || symbol_table.getType(name) != eEndogenous)
{
string msg = "optim_weights: " + name + " isn't an endogenous variable";
error(msg.c_str());
}
int id = SymbolTable::getID(name)+1;
int id = symbol_table.getID(name) + 1;
*output << "optim_weights_(" << id << "," << id << ") = " << exp << ";\n";
*output << "obj_var_ = [obj_var_; " << id << "];\n";
}
......@@ -511,18 +511,18 @@ void ComputingTasks::setOptimWeights(string name, string exp)
//------------------------------------------------------------------------------
void ComputingTasks::setOptimWeights(string name1, string name2, string exp)
{
if (!SymbolTable::Exist(name1) || SymbolTable::getType(name1) != eEndogenous)
if (!symbol_table.Exist(name1) || symbol_table.getType(name1) != eEndogenous)
{
string msg = "optim_weights: " + name1 + " isn't an endogenous variable";
error(msg.c_str());
}
if (!SymbolTable::Exist(name2) || SymbolTable::getType(name2) != eEndogenous)
if (!symbol_table.Exist(name2) || symbol_table.getType(name2) != eEndogenous)
{
string msg = "optim_weights: " + name2 + " isn't an endogenous variable";
error(msg.c_str());
}
int id1 = SymbolTable::getID(name1)+1;
int id2 = SymbolTable::getID(name2)+1;
int id1 = symbol_table.getID(name1) + 1;
int id2 = symbol_table.getID(name2) + 1;
*output << "optim_weights_(" << id1 << "," << id2 << ") = " << exp << ";\n";
*output << "obj_var_ = [obj_var_; " << id1 << " " << id2 << "];\n";
}
......
......@@ -16,35 +16,30 @@ using namespace std;
#include "VariableTable.hh"
#include "NumericalConstants.hh"
#include "DataTree.hh"
//------------------------------------------------------------------------------
const int DataTree::NoOpCode = -1;
const NodeID DataTree::NullID = NULL;
const NodeID DataTree::Zero = new MetaToken(reinterpret_cast <NodeID> (0), eNumericalConstant, NULL, -1);
const NodeID DataTree::One = new MetaToken(reinterpret_cast <NodeID> (1), eNumericalConstant, NULL, -1);
const NodeID DataTree::MinusOne = new MetaToken(One, eTempResult, NULL, token::UMINUS);
const NodeID DataTree::ZeroEqZero = new MetaToken(Zero, eTempResult, Zero, token::EQUAL);
int DataTree::offset = 1;
//------------------------------------------------------------------------------
DataTree::DataTree()
{
DataTree::DataTree(SymbolTable &symbol_table_arg, VariableTable &variable_table_arg) :
symbol_table(symbol_table_arg),
variable_table(variable_table_arg),
NoOpCode(-1), NullID(NULL)
{
offset = 1;
current_order = 0;
//Here "0" and "1" have been added to NumericalConstants class
SymbolTable::AddSymbolDeclar("0.0",eNumericalConstant, "");
SymbolTable::AddSymbolDeclar("1.0",eNumericalConstant, "");
Zero = new MetaToken(reinterpret_cast <NodeID> (0), eNumericalConstant, NULL, -1);
Zero->op_name = "";
Zero->reference_count.resize(current_order+1,2);
Zero->idx = 0;
mModelTree.push_back(Zero);
mIndexOfTokens[*Zero]=Zero;
One = new MetaToken(reinterpret_cast <NodeID> (1), eNumericalConstant, NULL, -1); One->op_name = "";
One->op_name = "";
One->reference_count.resize(current_order+1,1);
One->idx = 1;
mModelTree.push_back(One);
mIndexOfTokens[*One]=One;
MinusOne = new MetaToken(One, eTempResult, NULL, token::UMINUS);
MinusOne->op_name = operator_table.str(token::UMINUS);
MinusOne->reference_count.resize(current_order+1,1);
MinusOne->idx = 2;
......@@ -52,6 +47,7 @@ DataTree::DataTree()
mIndexOfTokens[*MinusOne]=MinusOne;
// Pushing "0=0" into mModelTree
ZeroEqZero = new MetaToken(Zero, eTempResult, Zero, token::EQUAL);
ZeroEqZero->op_name = operator_table.str(token::EQUAL);
ZeroEqZero->reference_count.resize(current_order+1,1);
ZeroEqZero->idx = 3;
......
......@@ -331,11 +331,10 @@ typedef pair<int, Type> ExpObj;
model
: MODEL ';' equation_list END
{driver.check_model();}
| MODEL '(' LINEAR ')' ';' {driver.option_num("linear","1");}
equation_list END {driver.check_model();}
equation_list END
| MODEL '(' USE_DLL ')' ';' {driver.use_dll();}
equation_list END {driver.check_model();}
equation_list END
;
equation_list
......@@ -349,7 +348,7 @@ typedef pair<int, Type> ExpObj;
: hand_side EQUAL hand_side ';'
{$$ = driver.add_model_equal($1, $3);}
| hand_side ';'
{$$ = driver.add_model_equal($1);}
{$$ = driver.add_model_equal_with_zero_rhs($1);}
;
hand_side
......
......@@ -258,7 +258,7 @@ int sigma_e = 0;
otherwise it is a native statement until the end of the line
*/
<INITIAL>[A-Za-z_][A-Za-z0-9_]* {
if (SymbolTable::getID(yytext) != -1)
if (driver.exists_symbol(yytext))
{
BEGIN DYNARE_STATEMENT;
yylval->string_val = new string(yytext);
......@@ -267,14 +267,14 @@ int sigma_e = 0;
else
{
BEGIN NATIVE;
*(driver.output) << yytext;
driver.add_native(yytext);
}
}
<INITIAL>. {BEGIN NATIVE; *(driver.output) << yytext;}
<INITIAL>. {BEGIN NATIVE; driver.add_native(yytext); }
/* NATIVE Block */
<NATIVE>.* {BEGIN INITIAL; *(driver.output) << yytext << endl;}
<NATIVE>.* {BEGIN INITIAL; driver.add_native(yytext); driver.add_native("\n"); }
<*>. {return yy::parser::token_type (yytext[0]);}
......
......@@ -7,6 +7,7 @@ using namespace std;
#include "ParsingDriver.hh"
#include "OutputFile.hh"
#include "ModFile.hh"
/*!
\brief Main function of Dynare.
......@@ -48,7 +49,7 @@ main(int argc, char** argv)
cout << "Parsing your model file ..." << endl;
// Launch parsing
p.parse(argv[1]);
ModFile *mod_file = p.parse(argv[1]);
// Execute final instructions
p.finish();
......@@ -56,9 +57,11 @@ main(int argc, char** argv)
string name = argv[1];
name.erase(name.size() - 4,4);
// Opening and init main Output file (.m or .sci file)
output_file.Open(name);
output_file.Open(name, mod_file);
// Writing remaining string output to output file
output_file.Save(output);
output_file.Save(output, mod_file);
delete mod_file;
cout << "Parsing done" << endl;
cout << "Starting Matlab computing ..." << endl;
......
......@@ -8,9 +8,7 @@
using namespace std;
//------------------------------------------------------------------------------
#include "Expression.hh"
//------------------------------------------------------------------------------
ostringstream Expression::output;
//------------------------------------------------------------------------------
Expression::Expression()
{
// Empty
......@@ -22,7 +20,12 @@ Expression::~Expression()
// Empty
}
//------------------------------------------------------------------------------
void
Expression::setNumericalConstants(NumericalConstants *num_constants_arg)
{
num_constants = num_constants_arg;
}
int Expression::AddToken(int id1,Type type1,int id2,Type type2,int op_code)
{
Token token;
......@@ -261,13 +264,13 @@ string Expression::getArgument(Type type,int id)
}
else if (type == eNumericalConstant)
{
argument << NumericalConstants::get(id);
argument << num_constants->get(id);
}
return argument.str();
}
//------------------------------------------------------------------------------
string Expression::get(void)
string Expression::get()
{
return output.str();
}
......
......@@ -15,6 +15,8 @@ endif
ifeq ($(CROSS_WIN32), yes)
CPP = i586-mingw32msvc-g++
# Detection of uninitialized variables is buggy in MinGW and generates spurious warnings
CPPFLAGS += -Wno-uninitialized
DYNARE_M = dynare_m.exe
DYNARE_S = dynare_s.exe
endif
......@@ -48,7 +50,8 @@ COMMON_OBJ=\
TmpSymbolTable.o\
VariableTable.o\
ParsingDriver.o\
DataTree.o
DataTree.o \
ModFile.o
MATLAB_OBJ = InterfaceMatlab.o
......
#include "ModFile.hh"
ModFile::ModFile() : symbol_table(model_parameters),
variable_table(symbol_table, model_parameters),
numerical_initialization(symbol_table, model_parameters),
computing_tasks(symbol_table),
model_tree(symbol_table, variable_table, model_parameters, num_constants)
{
}
......@@ -3,41 +3,20 @@
\date 04/09/2004
\par This file implements the ModelParemeters class methodes.
*/
//------------------------------------------------------------------------------
#include <iostream>
#include "ModelParameters.hh"
//------------------------------------------------------------------------------
int ModelParameters::eq_nbr = 0;
int ModelParameters::exo_nbr = 0;
int ModelParameters::var_exo_nbr = 0;
int ModelParameters::exo_det_nbr = 0;
int ModelParameters::var_exo_det_nbr = 0;
int ModelParameters::endo_nbr = 0;
int ModelParameters::var_endo_nbr = 0;
int ModelParameters::parameter_nbr = 0;
int ModelParameters::local_parameter_nbr = 0;
int ModelParameters::recur_nbr = 0;
int ModelParameters::max_lag = 0;
int ModelParameters::max_lead = 0;
int ModelParameters::max_endo_lag = 0;
int ModelParameters::max_endo_lead = 0;
int ModelParameters::max_exo_lag = 0;
int ModelParameters::max_exo_lead = 0;
int ModelParameters::max_exo_det_lag = 0;
int ModelParameters::max_exo_det_lead = 0;
int ModelParameters::max_recur_lag = 0;
int ModelParameters::max_recur_lead = 0;
using namespace std;
//------------------------------------------------------------------------------
ModelParameters::ModelParameters()
{
// Empty
}
//------------------------------------------------------------------------------
ModelParameters::~ModelParameters()
ModelParameters::ModelParameters() : eq_nbr(0),
exo_nbr(0), var_exo_nbr(0),
exo_det_nbr(0), var_exo_det_nbr(0),
endo_nbr(0), var_endo_nbr(0),
parameter_nbr(0), local_parameter_nbr(0),
recur_nbr(0),
max_lag(0), max_lead(0),
max_endo_lag(0), max_endo_lead(0),