preprocessor: move all dynamic model reindexing to DynamicModel

issue#70
Houtan Bastani 2015-05-20 12:24:55 +02:00
parent 3c7f96e29d
commit a361980437
3 changed files with 10 additions and 2 deletions

View File

@ -4202,6 +4202,13 @@ DynamicModel::addStaticOnlyEquation(expr_t eq, int lineno)
static_only_equations_lineno.push_back(lineno);
}
void
DynamicModel::reindex(SymbolTable &orig_symbol_table)
{
ModelTree::reindex(orig_symbol_table);
reindexStaticOnlyEquations(orig_symbol_table);
}
void
DynamicModel::reindexStaticOnlyEquations(SymbolTable &orig_symbol_table)
{

View File

@ -244,6 +244,9 @@ public:
//! Adds an equation marked as [static]
void addStaticOnlyEquation(expr_t eq, int lineno);
//! reindex Dynamic Model after removal of extra exogenous
void reindex(SymbolTable &orig_symbol_table);
//! reindex equations marked as [static]
void reindexStaticOnlyEquations(SymbolTable &orig_symbol_table);

View File

@ -314,8 +314,6 @@ ModFile::transformPass(bool nostrict)
SymbolTable orig_symbol_table = symbol_table;
symbol_table.rmExo(unusedExo);
dynamic_model.reindex(orig_symbol_table);
dynamic_model.reindexStaticOnlyEquations(orig_symbol_table);
external_functions_table.reindex(symbol_table, orig_symbol_table);
vector<Statement *> orig_statements = statements;