Commit f1885a6b authored by michel's avatar michel
Browse files

v4 parser.src: added include/Interface.h to handle Scilab version, many files affected

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@870 ac1d8469-bf42-47a9-8791-bf33cf982152
parent ab16c4d1
......@@ -50,6 +50,9 @@
%right POWER
%nonassoc FACTORIAL
%token EXP LOG LOG10 LN SIN COS TAN ASIN ACOS ATAN SINH COSH TANH ASINH ACOSH ATANH SQRT
/* isn't parsed from the *.mod file, but used to distinguish EQUAL in equation and EQUAL in assignment in operation codes
*/
%token ASSIGN
%%
statement_list
......
......@@ -14,6 +14,7 @@ using namespace std;
#include "DynareParser.h"
#include "DynareScanner.h"
#include "OutputFile.h"
#include "Interface.h"
//------------------------------------------------------------------------------
/*! main function
\brief Main function of Dynare.
......@@ -24,6 +25,11 @@ int main(int argc, char** argv)
{
OutputFile output_file;
ostringstream output;
#ifdef SCILAB
interfaces interface(eScilab);
#else
interfaces interface(eMatlab);
#endif
int retval = 0;
try {
if (argc <2)
......@@ -67,8 +73,8 @@ int main(int argc, char** argv)
p.finish();
string name = argv[1];
name.erase(name.size()-4,4);
// Opening and init main Output file (M file)
output_file.Open(name+".m");
// Opening and init main Output file (.m or .sci file)
output_file.Open(name);
// Writing remaining string output to output file
output_file.Save(output);
......
......@@ -96,6 +96,12 @@ dynare::Objects* dynare::parser::add_variable(Objects* var,Objects* olag)
int lag = atoi((olag->symbol).c_str());
//cout << "symbol = " << olag->symbol << endl;
//cout << "lag = " << lag << endl;
if ((var->type == eExogenous) && lag != 0)
{
std::cout << "Warning: exogenous variable "
<< var->symbol
<< " has lag " << lag << "\n";
}
if ((var->type == eEndogenous) || (var->type == eExogenous))
variable_table.AddVariable(var->symbol,lag);
//cout << "add_model_token : " << var->ID << endl;
......@@ -638,7 +644,7 @@ dynare::Objects* dynare::parser::add_equal(Objects* arg1, Objects* arg2)
dynare::Objects* dynare::parser::init_local_parameter(Objects* arg1, Objects* arg2)
{
NodeID id = model_tree.AddEqual(arg1->ID, arg2->ID);
NodeID id = model_tree.AddAssign(arg1->ID, arg2->ID);
return new Objects("", id, eTempResult);
}
......
CPP = c++
ifeq ($(DEBUG),yes)
CPPFLAGS = -mno-cygwin -ggdb -pg -Wall
FLEXFLAGS = -i
else
ifeq ($(MINGW),yes)
CPPFLAGS = -O2
FLEXFLAGS = -i -d
else
CPPFLAGS = -mno-cygwin -O2
FLEXFLAGS = -i
endif
endif
OBJ=\
DynareFlex.o\
DynareBison.o\
ComputingTasks.o\
DynareMain.o\
Expression.o\
ModelParameters.o\
ModelTree.o\
NumericalConstants.o\
NumericalInitialization.o\
OperatorTable.o\
OutputFile.o\
Shocks.o\
SigmaeInitialization.o\
SymbolTable.o\
TmpSymbolTable.o\
VariableTable.o\
DynareParser.o\
DataTree.o
################################################################################
### Build ######################################################################
################################################################################
all: dynare.exe
dynare.exe: $(OBJ)
$(CPP) $(CPPFLAGS) -o dynare.exe $(OBJ);\
cp dynare.exe ../matlab/dynare_m.exe;\
################################################################################
### Compile ####################################################################
################################################################################
%.o : %.cc
$(CPP) $(CPPFLAGS) -MD -I include -c $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(OBJ:.o=.P)
DynareFlex.cc: DynareFlex.ll include/DynareScanner.h
flex $(FLEXFLAGS) -oDynareFlex.cc DynareFlex.ll
DynareBison.cc include/DynareBison.h: DynareBison.yy include/DynareParser.h
(bison -v -d -b --verbose -o DynareBison.cc DynareBison.yy; mv DynareBison.hh include/DynareBison.h)
################################################################################
### Clean ######################################################################
################################################################################
clean:
rm "ComputingTasks.o" \
"DynareParser.o" \
"DynareBison.o" \
"DynareFlex.o" \
"DynareMain.o" \
"Expression.o" \
"ModelParameters.o" \
"ModelTree.o" \
"NumericalConstants.o" \
"NumericalInitialization.o" \
"OperatorTable.o" \
"OutputFile.o" \
"Shocks.o" \
"SigmaeInitialization.o" \
"SymbolTable.o" \
"TmpSymbolTable.o" \
"VariableTable.o" \
"DataTree.o" \
"dynare.exe" \
"DynareBison.cc" \
"include/DynareBison.h" \
"DynareFlex.cc"
CPP = c++
ifeq ($(DEBUG),yes)
CPPFLAGS = -mno-cygwin -ggdb -pg -Wall
FLEXFLAGS = -i
else
ifeq ($(MINGW),yes)
CPPFLAGS = -O2
FLEXFLAGS = -i -d
else
CPPFLAGS = -mno-cygwin -O2
FLEXFLAGS = -i
endif
endif
ifeq ($(PROFILE),yes)
CPPFLAGS = -mno-cygwin -O2 -pg
endif
OBJ=\
DynareFlex.o\
DynareBison.o\
ComputingTasks.o\
DynareMain.o\
Expression.o\
ModelParameters.o\
ModelTree.o\
NumericalConstants.o\
NumericalInitialization.o\
OperatorTable.o\
OutputFile.o\
Shocks.o\
SigmaeInitialization.o\
SymbolTable.o\
TmpSymbolTable.o\
VariableTable.o\
DynareParser.o\
DataTree.o\
Interface.o
################################################################################
### Build ######################################################################
################################################################################
all: dynare.exe
dynare.exe: $(OBJ)
$(CPP) $(CPPFLAGS) -o dynare.exe $(OBJ);\
cp dynare.exe ../matlab/dynare_m.exe;\
dynare_s.exe: $(OBJ)
$(CPP) $(CPPFLAGS) -Iinclude -DSCILAB -o DynareMain.o -c DynareMain.cc
$(CPP) $(CPPFLAGS) -o dynare_s.exe $(OBJ);\
cp dynare_s.exe ../scilab/dynare_s.exe;\
################################################################################
### Compile ####################################################################
################################################################################
%.o : %.cc
$(CPP) $(CPPFLAGS) -MD -I include -c $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(OBJ:.o=.P)
DynareFlex.cc: DynareFlex.ll include/DynareScanner.h
flex $(FLEXFLAGS) -oDynareFlex.cc DynareFlex.ll
DynareBison.cc include/DynareBison.h: DynareBison.yy include/DynareParser.h
(bison -v -d -b --verbose -o DynareBison.cc DynareBison.yy; mv DynareBison.hh include/DynareBison.h)
################################################################################
### Clean ######################################################################
################################################################################
clean:
rm "ComputingTasks.o" \
"DynareParser.o" \
"DynareBison.o" \
"DynareFlex.o" \
"DynareMain.o" \
"Expression.o" \
"ModelParameters.o" \
"ModelTree.o" \
"NumericalConstants.o" \
"NumericalInitialization.o" \
"OperatorTable.o" \
"OutputFile.o" \
"Shocks.o" \
"SigmaeInitialization.o" \
"SymbolTable.o" \
"TmpSymbolTable.o" \
"VariableTable.o" \
"DataTree.o" \
"dynare.exe" \
"DynareBison.cc" \
"include/DynareBison.h" \
"DynareFlex.cc"
......@@ -19,6 +19,7 @@ using namespace std;
#include "NumericalConstants.h"
#include "ModelTree.h"
#include "ModelParameters.h"
#include "Interface.h"
//------------------------------------------------------------------------------
ostringstream ModelTree::output;
//------------------------------------------------------------------------------
......@@ -38,7 +39,7 @@ void ModelTree::OpenMFiles(string iModelFileName1, string iModelFileName2)
{
if (iModelFileName1.size())
{
iModelFileName1 += ".m";
iModelFileName1 += interfaces::function_file_extension();
mStaticModelFile.open(iModelFileName1.c_str(),ios::out|ios::binary);
if (!mStaticModelFile.is_open())
{
......@@ -49,12 +50,15 @@ void ModelTree::OpenMFiles(string iModelFileName1, string iModelFileName2)
iModelFileName1.erase(iModelFileName1.end()-2,iModelFileName1.end());
//Writing comments and function definition command
mStaticModelFile << "function [residual, g1] = " << iModelFileName1 << "( y, x )\n";
mStaticModelFile << "%\n% Status : Computes static model for Dynare\n%\n";
mStaticModelFile << "% Warning : this file is generated automatically by Dynare\n";
mStaticModelFile << "% from model file (.mod)\n\n";
mStaticModelFile << interfaces::comment()+"\n"+interfaces::comment();
mStaticModelFile << "Status : Computes static model for Dynare\n%\n";
mStaticModelFile << interfaces::comment();
mStaticModelFile << "Warning : this file is generated automatically by Dynare\n";
mStaticModelFile << interfaces::comment();
mStaticModelFile << " from model file (.mod)\n\n";
if (iModelFileName2.size() && (computeJacobian||computeJacobianExo||computeHessian))
{
iModelFileName2 += ".m";
iModelFileName2 += interfaces::function_file_extension();
mDynamicModelFile.open(iModelFileName2.c_str(),ios::out|ios::binary);
if (!mDynamicModelFile.is_open())
{
......@@ -64,9 +68,12 @@ void ModelTree::OpenMFiles(string iModelFileName1, string iModelFileName2)
}
iModelFileName2.erase(iModelFileName2.end()-2,iModelFileName2.end());
mDynamicModelFile << "function [residual, g1, g2] = " << iModelFileName2 << "(y, x)\n";
mDynamicModelFile << "%\n% Status : Computes dynamic model for Dynare\n%\n";
mDynamicModelFile << "%Warning : this file is generated automatically by Dynare\n";
mDynamicModelFile << "% from model file (.mod)\n\n";
mDynamicModelFile << interfaces::comment()+"\n"+interfaces::comment();
mDynamicModelFile << "Status : Computes dynamic model for Dynare\n%\n";
mDynamicModelFile << interfaces::comment();
mDynamicModelFile << "Warning : this file is generated automatically by Dynare\n";
mDynamicModelFile << interfaces::comment();
mDynamicModelFile << " from model file (.mod)\n\n";
}
}
......@@ -137,11 +144,13 @@ void ModelTree::SaveMFiles()
if (mStaticModelFile.is_open())
{
mStaticModelFile << StaticOutput.str();
interfaces::function_close();
mStaticModelFile.close();
}
if (mDynamicModelFile.is_open() && (computeJacobian||computeJacobianExo||computeHessian))
{
mDynamicModelFile << DynamicOutput.str();
interfaces::function_close();
mDynamicModelFile.close();
}
}
......@@ -285,6 +294,7 @@ void ModelTree::derive(int iOrder)
(*currentIT)->reference_count[0]++;
}
}
std::cout << "size " << EqualTokenIDs.size() << "\n";
mDerivativeIndex.resize(iOrder);
// Uncomment this to print model tree data
/*
......@@ -340,6 +350,7 @@ void ModelTree::derive(int iOrder)
lArg2 = lToken->id2;
lType1 = lToken->type1;
lD1 = DeriveArgument(lArg1, lType1, var);
lD2 = Zero;
if (lArg2 != NullID)
lD2 = DeriveArgument(lArg2, eTempResult, var);
// Case where token is a final argument
......@@ -347,9 +358,12 @@ void ModelTree::derive(int iOrder)
{
setDerivativeAdress(*currentIT, lD1, var);
}
else if (lD1 == Zero && lD2 == Zero)
{
setDerivativeAdress(*currentIT, Zero, var);
}
else
{
switch (lToken->op_code)
{
case UMINUS:
......@@ -692,7 +706,7 @@ string ModelTree::setStaticModel(void)
tree_it = BeginModel;
for (; tree_it != mModelTree.end(); tree_it++)
{
if ((*tree_it)->op_code == EQUAL)
if ((*tree_it)->op_code == EQUAL || (*tree_it)->op_code == ASSIGN )
{
if ((*tree_it)->id1->type1 == eLocalParameter)
{
......@@ -728,7 +742,9 @@ string ModelTree::setStaticModel(void)
// Writing Jacobian for endogenous variables without lag
for(; tree_it != mModelTree.end(); tree_it++)
{
if ((*tree_it)->op_code != NoOpCode && (*tree_it)->op_code != EQUAL)
if ((*tree_it)->op_code != NoOpCode
&& (*tree_it)->op_code != EQUAL
&& (*tree_it)->op_code != ASSIGN)
{
if (optimize(*tree_it) == 1)
{
......@@ -766,7 +782,9 @@ string ModelTree::setStaticModel(void)
StaticOutput << "if M_.param_nbr > 0\n params = M_.params;\nend\n";
StaticOutput << " residual = zeros( " << ModelParameters::eq_nbr << ", 1);\n";
StaticOutput << "\n\t%\n\t% Model equations\n\t%\n\n";
StaticOutput << "\n\t"+interfaces::comment()+"\n\t"+interfaces::comment();
StaticOutput << "Model equations\n\t";
StaticOutput << interfaces::comment() + "\n\n";
StaticOutput << model_output.str();
StaticOutput << "if ~isreal(residual)\n";
StaticOutput << " residual = real(residual)+imag(residual).^2;\n";
......@@ -775,7 +793,9 @@ string ModelTree::setStaticModel(void)
StaticOutput << " g1 = " <<
"zeros(" << ModelParameters::eq_nbr << ", " <<
ModelParameters::endo_nbr << ");\n" ;
StaticOutput << "\n\t%\n\t% Jacobian matrix\n\t%\n\n";
StaticOutput << "\n\t"+interfaces::comment()+"\n\t"+interfaces::comment();
StaticOutput << "Jacobian matrix\n\t";
StaticOutput << interfaces::comment() + "\n\n";
StaticOutput << jacobian_output.str();
StaticOutput << " if ~isreal(g1)\n";
StaticOutput << " g1 = real(g1)+2*imag(g1);\n";
......@@ -838,7 +858,7 @@ string ModelTree::setDynamicModel(void)
tree_it = BeginModel;
for (; tree_it != mModelTree.end(); tree_it++)
{
if ((*tree_it)->op_code == EQUAL)
if ((*tree_it)->op_code == EQUAL || (*tree_it)->op_code == ASSIGN)
{
if ((*tree_it)->id1->type1 == eLocalParameter)
{
......@@ -873,7 +893,9 @@ string ModelTree::setDynamicModel(void)
for(; tree_it != mModelTree.end(); tree_it++)
{
if ((*tree_it)->op_code != NoOpCode && (*tree_it)->op_code != EQUAL)
if ((*tree_it)->op_code != NoOpCode
&& (*tree_it)->op_code != EQUAL
&& (*tree_it)->op_code != ASSIGN)
{
if (optimize(*tree_it) == 1)
{
......@@ -893,7 +915,9 @@ string ModelTree::setDynamicModel(void)
cout << "\tJacobian .. ";
for(; tree_it != mModelTree.end(); tree_it++)
{
if ((*tree_it)->op_code != NoOpCode && (*tree_it)->op_code != EQUAL)
if ((*tree_it)->op_code != NoOpCode
&& (*tree_it)->op_code != EQUAL
&& (*tree_it)->op_code != ASSIGN)
{
if (optimize(*tree_it) == 1)
{
......@@ -961,7 +985,9 @@ string ModelTree::setDynamicModel(void)
{
DynamicOutput << "global M_ it_\n";
DynamicOutput << "if M_.param_nbr > 0\n params = M_.params;\nend\n";
DynamicOutput << "\n\t%\n\t% Model equations\n\t%\n\n";
DynamicOutput << "\n\t"+interfaces::comment()+"\n\t"+interfaces::comment();
DynamicOutput << "Model equations\n\t";
DynamicOutput << interfaces::comment() + "\n\n";
DynamicOutput << "residual = zeros(" << nrows << ", 1);\n";
DynamicOutput << model_output.str();
......@@ -972,7 +998,9 @@ string ModelTree::setDynamicModel(void)
// Writing initialization instruction for matrix g1
DynamicOutput << " g1 = " <<
"zeros(" << nrows << ", " << VariableTable::size() << ");\n" ;
DynamicOutput << "\n\t%\n\t% Jacobian matrix\n\t%\n\n";
DynamicOutput << "\n\t"+interfaces::comment()+"\n\t"+interfaces::comment();
DynamicOutput << "Jacobian matrix\n\t";
DynamicOutput << interfaces::comment()+"\n\n";
DynamicOutput << jacobian_output.str();
DynamicOutput << "end\n";
}
......@@ -984,7 +1012,9 @@ string ModelTree::setDynamicModel(void)
DynamicOutput << " g2 = " <<
"sparse([],[],[]," << nrows << ", " << ncols << ", " <<
5*ncols << ");\n";
DynamicOutput << "\n\t%\n\t% Hessian matrix\n\t%\n\n";
DynamicOutput << "\n\t"+interfaces::comment()+"\n\t"+interfaces::comment();
DynamicOutput << "Hessian matrix\n\t";
DynamicOutput << interfaces::comment() + "\n\n";
DynamicOutput << hessian_output.str() << lsymetric.str();
DynamicOutput << "end;\n";
}
......
......@@ -11,6 +11,7 @@ using namespace std;
#include "OutputFile.h"
#include "SymbolTable.h"
#include "ModelTree.h"
#include "Interface.h"
//------------------------------------------------------------------------------
OutputFile::OutputFile()
{
......@@ -24,71 +25,74 @@ OutputFile::~OutputFile()
//------------------------------------------------------------------------------
void OutputFile::Open(string iFileName)
{
if (iFileName.size())
if (iFileName.size())
{
string fname(iFileName);
fname += interfaces::function_file_extension();
mOutputFile.open(fname.c_str(),ios::out|ios::binary);
if (!mOutputFile.is_open())
{
mOutputFile.open(iFileName.c_str(),ios::out|ios::binary);
if (!mOutputFile.is_open())
{
cout << "OutputFile::Open : Error : Can't open file " << iFileName
<< " for writing\n";
exit(-1);
}
}
else
{
cout << "OutputFile::Open : Error : Missing file name\n";
exit(-1);
}
mOutputFile << "%\n% Status : main Dynare file \n%\n";
mOutputFile << "% Warning : this file is generated automatically by Dynare\n";
mOutputFile << "% from model file (.mod)\n\n";
if (clear_all)
mOutputFile << "clear all\n";
mOutputFile << "tic;\n";
mOutputFile << "global M_ oo_ exedet_ exdet_ recur_ recurs_ \n";
mOutputFile << "global options_ endval_\n";
mOutputFile << "global ys0_ recurs0_ ex0_ ct_\n";
mOutputFile << "options_ = [];\n";
iFileName.erase(iFileName.size()-2);
mOutputFile << "M_.fname = '" << iFileName << "';\n";
mOutputFile << "%\n% Some global variables initialisation\n%\n";
mOutputFile << "global_initialization;\n";
mOutputFile << "diary off;\nwarning off;\n";
mOutputFile << "\ndelete " << iFileName << ".log;\n";
mOutputFile << "warning on;\nwarning backtrace;\n";
mOutputFile << "logname_ = '" << iFileName << ".log';\n";
mOutputFile << "diary '" << iFileName << ".log';\n";
if (ModelTree::offset == 0)
{
mOutputFile << "if exist('" << iFileName << "_static.c', 'file') == 2,\n";
mOutputFile << " clear " << iFileName << "_static\n";
mOutputFile << " mex -O " << iFileName << "_static.c\n";
mOutputFile << "end\n";
mOutputFile << "if exist('" << iFileName << "_dynamic.c', 'file') == 2,\n";
mOutputFile << " clear " << iFileName << "_dynamic\n";
mOutputFile << " mex -O " << iFileName << "_dynamic.c\n";
mOutputFile << "end\n";
}
else
{
mOutputFile << "if exist('" << iFileName << "_static.dll', 'file') == 3,\n";
mOutputFile << " clear " << iFileName << "_static\n";
mOutputFile << " !del " << iFileName << "_static.dll\n";
mOutputFile << "end\n";
mOutputFile << "if exist('" << iFileName << "_dynamic.dll', 'file') == 3,\n";
mOutputFile << " clear " << iFileName << "_dynamic\n";
mOutputFile << " !del " << iFileName << "_dynamic.dll\n";
mOutputFile << "end\n";
cout << "OutputFile::Open : Error : Can't open file " << iFileName
<< " for writing\n";
exit(-1);
}
}
else
{
cout << "OutputFile::Open : Error : Missing file name\n";
exit(-1);
}
mOutputFile << interfaces::comment() << "\n" << interfaces::comment();
mOutputFile << "Status : main Dynare file \n";
mOutputFile << interfaces::comment() << "\n" << interfaces::comment();
mOutputFile << "Warning : this file is generated automatically by Dynare\n";
mOutputFile << interfaces::comment();
mOutputFile << " from model file (.mod)\n\n";
if (clear_all)
mOutputFile << "clear all\n";
mOutputFile << "tic;\n";
mOutputFile << "global M_ oo_ exedet_ exdet_ recur_ recurs_ \n";
mOutputFile << "global options_ endval_\n";
mOutputFile << "global ys0_ recurs0_ ex0_ ct_\n";
mOutputFile << "options_ = [];\n";
mOutputFile << "M_.fname = '" << iFileName << "';\n";
mOutputFile << interfaces::comment() << "\n" << interfaces::comment();
mOutputFile << "Some global variables initialisation\n";
mOutputFile << interfaces::comment() << "\n";
mOutputFile << "global_initialization;\n";
mOutputFile << "diary off;\nwarning off;\n";
mOutputFile << "\n" << interfaces::delete_file(iFileName + ".log;\n");
mOutputFile << "warning on;\nwarning backtrace;\n";
mOutputFile << "logname_ = '" << iFileName << ".log';\n";
mOutputFile << "diary '" << iFileName << ".log';\n";
if (ModelTree::offset == 0)
{
mOutputFile << "if ";
mOutputFile << interfaces::file_exist(iFileName + "_static.c)")+"\n";
mOutputFile << " clear " << iFileName << "_static\n";
mOutputFile << " " + interfaces::compile(iFileName +"_static.c")+"\n";
mOutputFile << "end\n";
mOutputFile << "if ";
mOutputFile << interfaces::file_exist(iFileName + "_dynamic.c)")+"\n";
mOutputFile << " clear " << iFileName << "_dynamic\n";
mOutputFile << " " + interfaces::compile(iFileName+"_dynamic.c")+"\n";
mOutputFile << "end\n";
}
else
{
mOutputFile << "erase_compiled_function('" + iFileName +"_static');\n";
mOutputFile << "erase_compiled_function('" + iFileName +"_dynamic');\n";
mOutputFile << interfaces::load_model_function_files(iFileName);
}
}
//------------------------------------------------------------------------------
void OutputFile::Save(ostringstream& iOutput)
{
mOutputFile << SymbolTable::get();
mOutputFile << ModelTree::get();
mOutputFile << iOutput.str();
mOutputFile << "\ndisp(['Total computing time : ' sec2hms(round(toc)) ]);\n";
mOutputFile.close();
mOutputFile << SymbolTable::get();
mOutputFile << ModelTree::get();
mOutputFile << iOutput.str();
mOutputFile << "\ndisp(['Total computing time : ' sec2hms(round(toc)) ]);\n";
mOutputFile.close();
}
//------------------------------------------------------------------------------
#ifdef TEST_OUTPUTFILE
......@@ -100,113 +104,113 @@ void OutputFile::Save(ostringstream& iOutput)
#include "TmpSymbolTable.h"
int main(void)
{
OutputFile outputfile;
SymbolTable st;
Expression exp;
NumericalConstants numconst;
NumericalInitialization numinit;
OutputFile outputfile;
SymbolTable st;
Expression exp;
NumericalConstants numconst;
NumericalInitialization numinit;
outputfile.Open("Test.m");
outputfile.Open("Test.m");
SymbolTable::AddSymbolDeclar("a",eExogenous);//0
SymbolTable::AddSymbolDeclar("b",eParameter);//1
SymbolTable::AddSymbolDeclar("c",eExogenous);//2