Preprocessor: added new SymbolTable::orig_endo_nbr() method

time-shift
Sébastien Villemot 2010-04-23 18:36:51 +02:00
parent 19338906ba
commit ed84e27319
2 changed files with 9 additions and 1 deletions

View File

@ -210,7 +210,7 @@ SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException)
<< "M_.param_nbr = " << param_nbr() << ";" << endl;
// Write the auxiliary variable table
output << "M_.orig_endo_nbr = " << endo_nbr() - aux_vars.size() << ";" << endl;
output << "M_.orig_endo_nbr = " << orig_endo_nbr() << ";" << endl;
if (aux_vars.size() == 0)
output << "M_.aux_vars = [];" << endl;
else

View File

@ -236,6 +236,8 @@ public:
inline int param_nbr() const throw (NotYetFrozenException);
//! Returns the greatest symbol ID (the smallest is zero)
inline int maxID();
//! Get number of user-declared endogenous variables (without the auxiliary variables)
inline int orig_endo_nbr() const throw (NotYetFrozenException);
//! Write output of this class
void writeOutput(ostream &output) const throw (NotYetFrozenException);
//! Mark a symbol as predetermined variable
@ -364,4 +366,10 @@ SymbolTable::maxID()
return (size-1);
}
inline int
SymbolTable::orig_endo_nbr() const throw (NotYetFrozenException)
{
return (endo_nbr() - aux_vars.size());
}
#endif