diff --git a/parser.src/DynareBison.cc b/parser.src/DynareBison.cc index 50d1f6bb8..6149362b7 100644 --- a/parser.src/DynareBison.cc +++ b/parser.src/DynareBison.cc @@ -33,7 +33,7 @@ version 2.2 of Bison. */ -#include "dynareBison.hh" +#include "DynareBison.hh" /* User implementation prologue. */ #line 32 "DynareBison.yy" @@ -42,7 +42,7 @@ /* Line 317 of lalr1.cc. */ -#line 46 "dynareBison.cc" +#line 46 "DynareBison.cc" #ifndef YY_ # if YYENABLE_NLS @@ -279,7 +279,7 @@ namespace yy yylloc.begin.filename = yylloc.end.filename = &driver.file; } /* Line 547 of yacc.c. */ -#line 283 "dynareBison.cc" +#line 283 "DynareBison.cc" /* Initialize the stacks. The initial state will be pushed in yynewstate, since the latter expects the semantical and the location values to have been already stored, initialize these @@ -2178,7 +2178,7 @@ namespace yy /* Line 675 of lalr1.cc. */ -#line 2182 "dynareBison.cc" +#line 2182 "DynareBison.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); diff --git a/parser.src/ExprNode.cc b/parser.src/ExprNode.cc index c99f4751b..0425f940f 100644 --- a/parser.src/ExprNode.cc +++ b/parser.src/ExprNode.cc @@ -972,7 +972,7 @@ BinaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type, // Treat special case of power operator in C if (op_code == oPower && (!OFFSET(output_type))) { - output << "pow1("; + output << "pow("; arg1->writeOutput(output, output_type, temporary_terms); output << ","; arg2->writeOutput(output, output_type, temporary_terms); diff --git a/parser.src/InterfaceMatlab.cc b/parser.src/InterfaceMatlab.cc index f2a9ee8c2..4a502803b 100644 --- a/parser.src/InterfaceMatlab.cc +++ b/parser.src/InterfaceMatlab.cc @@ -16,12 +16,12 @@ namespace interfaces std::string file_exist(std::string s) { - return "exist(" + s + ")"; + return "exist('" + s + "')"; } std::string compile(std::string s) { - return "mex -O" + s + "\n"; + return "mex -O " + s + "\n"; } std::string function_close() diff --git a/parser.src/ModFile.cc b/parser.src/ModFile.cc index 55ec564ec..b973b6341 100644 --- a/parser.src/ModFile.cc +++ b/parser.src/ModFile.cc @@ -117,12 +117,12 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all) const if (model_tree.mode == eDLLMode) { mOutputFile << "if "; - mOutputFile << interfaces::file_exist(basename + "_static.c)") << endl; + mOutputFile << interfaces::file_exist(basename + "_static.c") << endl; mOutputFile << " clear " << basename << "_static" << endl; mOutputFile << " " << interfaces::compile(basename +"_static.c") << endl; mOutputFile << "end" << endl; mOutputFile << "if "; - mOutputFile << interfaces::file_exist(basename + "_dynamic.c)") << endl; + mOutputFile << interfaces::file_exist(basename + "_dynamic.c") << endl; mOutputFile << " clear " << basename << "_dynamic" << endl; mOutputFile << " " + interfaces::compile(basename+"_dynamic.c") << endl; mOutputFile << "end" << endl; diff --git a/parser.src/ModelTree.cc b/parser.src/ModelTree.cc index 738935441..fdfe8ba8b 100644 --- a/parser.src/ModelTree.cc +++ b/parser.src/ModelTree.cc @@ -173,6 +173,10 @@ ModelTree::writeModelLocalVariables(ostream &output, ExprNodeOutputType output_t { int id = it->first; NodeID value = it->second; + + if (!OFFSET(output_type)) + output << "double "; + output << symbol_table.getNameByID(eModelLocalVariable, id) << " = "; // Use an empty set for the temporary terms value->writeOutput(output, output_type, temporary_terms_type()); @@ -746,7 +750,7 @@ ModelTree::writeDynamicCFile(const string &dynamic_basename) const << " }" << endl << " params = mxGetPr(mxGetFieldByNumber(M_, 0, mxGetFieldNumber(M_,\"params\")));" << endl << " /* Gets it_ from global workspace of Matlab */" << endl - << " //it_ = (int) floor(mxGetScalar(mexGetVariable(\"global\", \"it_\")))-1;" << endl + << " /* it_ = (int) floor(mxGetScalar(mexGetVariable(\"global\", \"it_\")))-1; */" << endl << " /* Call the C subroutines. */" << endl << " Dynamic(y, x, residual, g1, g2);" << endl << "}" << endl; diff --git a/parser.src/include/DynareBison.hh b/parser.src/include/DynareBison.hh index 70b5916fb..34dae59ee 100644 --- a/parser.src/include/DynareBison.hh +++ b/parser.src/include/DynareBison.hh @@ -58,7 +58,7 @@ class ParsingDriver; /* Line 35 of lalr1.cc. */ -#line 62 "dynareBison.hh" +#line 62 "DynareBison.hh" #include "location.hh" @@ -115,7 +115,7 @@ namespace yy NodeID node_val; } /* Line 35 of lalr1.cc. */ -#line 119 "dynareBison.hh" +#line 119 "DynareBison.hh" ; #else typedef YYSTYPE semantic_type;