diff --git a/parser.src/ComputingTasks.cc b/parser.src/ComputingTasks.cc index 65a42e3703122ad96c33e135b1a339806a70c77c..88020ee24199c76cfed0e076fd216d221c80ee33 100644 --- a/parser.src/ComputingTasks.cc +++ b/parser.src/ComputingTasks.cc @@ -82,7 +82,7 @@ StochSimulStatement::writeOutput(ostream &output, const string &basename) const } RamseyPolicyStatement::RamseyPolicyStatement(const TmpSymbolTable &tmp_symbol_table_arg, - const OptionsList &options_list_arg) : + const OptionsList &options_list_arg) : tmp_symbol_table(tmp_symbol_table_arg), options_list(options_list_arg) { diff --git a/parser.src/ExprNode.cc b/parser.src/ExprNode.cc index 1662179823567ff92c162dba195c49eb91715cab..4ec5e96ffe134ccb9e8db2b2ac14a51dddd10f60 100644 --- a/parser.src/ExprNode.cc +++ b/parser.src/ExprNode.cc @@ -46,7 +46,7 @@ ExprNode::precedence(const temporary_terms_type &temporary_terms) const } int -ExprNode::cost(temporary_terms_type &temporary_terms) const +ExprNode::cost(const temporary_terms_type &temporary_terms) const { // For a terminal node, the cost is null return 0; @@ -318,7 +318,7 @@ UnaryOpNode::computeDerivative(int varID) } int -UnaryOpNode::cost(temporary_terms_type &temporary_terms) const +UnaryOpNode::cost(const temporary_terms_type &temporary_terms) const { // For a temporary term, the cost is null temporary_terms_type::const_iterator it = temporary_terms.find(const_cast<UnaryOpNode *>(this)); @@ -617,7 +617,7 @@ BinaryOpNode::precedence(const temporary_terms_type &temporary_terms) const } int -BinaryOpNode::cost(temporary_terms_type &temporary_terms) const +BinaryOpNode::cost(const temporary_terms_type &temporary_terms) const { temporary_terms_type::const_iterator it = temporary_terms.find(const_cast<BinaryOpNode *>(this)); // For a temporary term, the cost is null diff --git a/parser.src/Makefile b/parser.src/Makefile index 55106485069c6b5bcbb42ce41dc913c2d272be4e..7ad72c5e5cc4eeedb9e378fa9216061666983b0c 100644 --- a/parser.src/Makefile +++ b/parser.src/Makefile @@ -101,10 +101,14 @@ DynareBison.cc include/DynareBison.hh: DynareBison.yy include/ParsingDriver.hh clean: rm -f *.o *.P \ *~ include/*~ \ - DynareBison.cc \ - include/DynareBison.hh \ DynareBison.output \ DynareFlex.cc \ $(DYNARE_M) \ $(DYNARE_S) +distclean: clean + rm -f DynareBison.cc \ + include/position.hh \ + include/stack.hh \ + include/location.hh \ + include/DynareBison.hh diff --git a/parser.src/ParsingDriver.cc b/parser.src/ParsingDriver.cc index d67f779d1cb12b9fa40ca04c48badf9adbc0dae3..ed288f02b585c890f975c9b21fad206819c93a7e 100644 --- a/parser.src/ParsingDriver.cc +++ b/parser.src/ParsingDriver.cc @@ -237,7 +237,7 @@ ParsingDriver::init_val(string *name, ExpObj *rhs) && type != eExogenousDet) error("initval/endval: " + *name + " should be an endogenous or exogenous variable"); - init_values.push_back(pair<string, string>(*name, get_expression(rhs))); + init_values.push_back(make_pair(*name, get_expression(rhs))); delete name; delete rhs; @@ -434,7 +434,7 @@ ParsingDriver::add_period(string *p1, string *p2) { int p1_val = atoi(p1->c_str()); int p2_val = atoi(p2->c_str()); - det_shocks_periods.push_back(pair<int, int>(p1_val, p2_val)); + det_shocks_periods.push_back(make_pair(p1_val, p2_val)); delete p1; delete p2; } @@ -443,7 +443,7 @@ void ParsingDriver::add_period(string *p1) { int p1_val = atoi(p1->c_str()); - det_shocks_periods.push_back(pair<int, int>(p1_val, p1_val)); + det_shocks_periods.push_back(make_pair(p1_val, p1_val)); delete p1; } @@ -510,7 +510,7 @@ ParsingDriver::option_num(const string &name_option, string *opt1, string *opt2) != options_list.paired_num_options.end()) error("option " + name_option + " declared twice"); - options_list.paired_num_options[name_option] = pair<string, string>(*opt1, *opt2); + options_list.paired_num_options[name_option] = make_pair(*opt1, *opt2); delete opt1; delete opt2; } @@ -802,7 +802,7 @@ ParsingDriver::set_calib_var(string *name, string *weight, ExpObj *expression) if (calib_var.find(*name) != calib_var.end()) error("calib_var: " + *name + " declared twice"); - calib_var[*name] = pair<string, string>(*weight, get_expression(expression)); + calib_var[*name] = make_pair(*weight, get_expression(expression)); delete name; delete weight; @@ -827,7 +827,7 @@ ParsingDriver::set_calib_covar(string *name1, string *name2, error("calib_var: pair of variables (" + *name1 + ", " + *name2 + ") declared twice"); - calib_covar[covar_key] = pair<string, string>(*weight, get_expression(expression)); + calib_covar[covar_key] = make_pair(*weight, get_expression(expression)); delete name1; delete name2; @@ -849,7 +849,7 @@ ParsingDriver::set_calib_ac(string *name, string *ar, if (calib_ac.find(ac_key) != calib_ac.end()) error("calib_var: autocorr " + *name + "(" + *ar + ") declared twice"); - calib_ac[ac_key] = pair<string, string>(*weight, get_expression(expression)); + calib_ac[ac_key] = make_pair(*weight, get_expression(expression)); delete name; delete ar; diff --git a/parser.src/include/ComputingTasks.hh b/parser.src/include/ComputingTasks.hh index 86048a3b48f7957fbb8b14ccaa400be8d6a25446..5df3cae1e5169ac3214438f9f528eabccb2e64d8 100644 --- a/parser.src/include/ComputingTasks.hh +++ b/parser.src/include/ComputingTasks.hh @@ -56,7 +56,7 @@ private: const OptionsList options_list; public: RamseyPolicyStatement(const TmpSymbolTable &tmp_symbol_table_arg, - const OptionsList &options_list_arg); + const OptionsList &options_list_arg); virtual void checkPass(ModFileStructure &mod_file_struct); virtual void writeOutput(ostream &output, const string &basename) const; }; diff --git a/parser.src/include/ExprNode.hh b/parser.src/include/ExprNode.hh index dfd1e16eebf6ded514d9d9774374b4fb94e88eb4..dd607cc7507a6d21e48c2b51ca4fe87b2536e48d 100644 --- a/parser.src/include/ExprNode.hh +++ b/parser.src/include/ExprNode.hh @@ -49,7 +49,7 @@ protected: //! Cost of computing current node /*! Nodes included in temporary_terms are considered having a null cost */ - virtual int cost(temporary_terms_type &temporary_terms) const; + virtual int cost(const temporary_terms_type &temporary_terms) const; public: ExprNode(DataTree &datatree_arg); @@ -137,7 +137,7 @@ private: const UnaryOpcode op_code; virtual NodeID computeDerivative(int varID); - int cost(temporary_terms_type &temporary_terms) const; + int cost(const temporary_terms_type &temporary_terms) const; public: UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg); virtual void computeTemporaryTerms(map<NodeID, int> &reference_count, temporary_terms_type &temporary_terms) const; @@ -162,7 +162,7 @@ private: const NodeID arg1, arg2; const BinaryOpcode op_code; virtual NodeID computeDerivative(int varID); - int cost(temporary_terms_type &temporary_terms) const; + int cost(const temporary_terms_type &temporary_terms) const; public: BinaryOpNode(DataTree &datatree_arg, const NodeID arg1_arg, BinaryOpcode op_code_arg, const NodeID arg2_arg);