Commit 162195c8 authored by sebastien's avatar sebastien
Browse files

v4 parser: removed the mechanism which records whether a given symbol has been...

v4 parser: removed the mechanism which records whether a given symbol has been referenced or not in the model block (useless and creates problems for standalone BVAR estimation)


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1371 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 446623f5
......@@ -316,9 +316,6 @@ EstimatedParamsStatement::writeOutput(ostream &output, const string &basename) c
for(it = estim_params_list.begin(); it != estim_params_list.end(); it++)
{
if (symbol_table.isReferenced(it->name) == eNotReferenced
&& it->name != "dsge_prior_weight")
continue;
switch(it->type)
{
case 1:
......@@ -362,8 +359,6 @@ EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basenam
for(it = estim_params_list.begin(); it != estim_params_list.end(); it++)
{
if (symbol_table.isReferenced(it->name) == eNotReferenced)
return;
if (it->type < 3)
{
if (symbol_table.getType(it->name) == eExogenous)
......@@ -412,8 +407,6 @@ EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basen
for(it = estim_params_list.begin(); it != estim_params_list.end(); it++)
{
if (symbol_table.isReferenced(it->name) == eNotReferenced)
return;
if (it->type < 3)
{
if (symbol_table.getType(it->name) == eExogenous)
......
......@@ -41,8 +41,6 @@ DataTree::AddVariable(const string &name, int lag)
exit(-1);
}
symbol_table.SetReferenced(name);
int symb_id = symbol_table.getID(name);
Type type = symbol_table.getType(name);
......
......@@ -23,7 +23,6 @@ SymbolTable::SymbolTable() : endo_nbr(0), exo_nbr(0), exo_det_nbr(0), parameter_
int SymbolTable::AddSymbol(string name,Type type, string tex_name)
{
symboltable[name].type = type;
symboltable[name].referenced = eNotReferenced;
name_table[(int) type].push_back(name);
tex_name_table[(int) type].push_back(tex_name);
......@@ -90,17 +89,6 @@ void SymbolTable::ResetType(string name,Type new_type)
symboltable[name].type = new_type;
}
void SymbolTable::SetReferenced(string name)
{
symboltable[name].referenced = eReferenced;
}
Reference SymbolTable::isReferenced(const std::string &name) const
{
symboltable_const_iterator iter = symboltable.find(name);
return iter->second.referenced;
}
void
SymbolTable::writeOutput(ostream &output) const
{
......
......@@ -44,11 +44,10 @@ TmpSymbolTable::writeOutput(const string &varname, ostream &output) const
output << varname << "=[];" << endl;
for (vector<string>::const_iterator it = tmpsymboltable.begin();
it != tmpsymboltable.end(); it++)
if (symbol_table.isReferenced(*it) == eReferenced)
{
output << varname << " = ";
output << interfaces::strvcat(varname, "'" + *it + "'") << ";" << endl;
}
{
output << varname << " = ";
output << interfaces::strvcat(varname, "'" + *it + "'") << ";" << endl;
}
}
void
......
......@@ -72,10 +72,6 @@ public :
int AddSymbolDeclar(std::string name, Type type, std::string tex_name);
/*! Adds symbol range */
void AddSymbolRange(std::string name, int nbr, Type type, std::string tex_name);
/*! Sets a symbol as referenced */
void SetReferenced(std::string name);
/*! Return eReferenced if symbol is referenced eNotReferenced otherwise*/
Reference isReferenced(const std::string &name) const;
/*! Tests if symbol exists in symbol table
\return true if exists, false outherwise
*/
......
......@@ -13,23 +13,14 @@ enum Type
eModFileLocalVariable = 11 //!< Local variable whose scope is mod file (model excluded)
};
//! Symbol reference flag enum
enum Reference
{
eNotReferenced, //!< Not yet referenced in model
eReferenced, //!< Already referenced in model
};
struct Symbol
{
//! Symbol type
Type type;
//! Symbol ID : for each type
int id;
//! Symbol reference flag
Reference referenced;
Symbol() : id(-1), referenced(eNotReferenced)
Symbol() : id(-1)
{
}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment