diff --git a/parser.src/ComputingTasks.cc b/parser.src/ComputingTasks.cc index 42be74bf4..cea7f8f65 100644 --- a/parser.src/ComputingTasks.cc +++ b/parser.src/ComputingTasks.cc @@ -60,8 +60,10 @@ SimulStatement::writeOutput(ostream &output, const string &basename) const output << "simul(oo_.dr);\n"; } -SimulSparseStatement::SimulSparseStatement(const OptionsList &options_list_arg) : - options_list(options_list_arg) +SimulSparseStatement::SimulSparseStatement(const OptionsList &options_list_arg, + int compiler_arg) : + options_list(options_list_arg), + compiler(compiler_arg) { } @@ -81,10 +83,10 @@ SimulSparseStatement::writeOutput(ostream &output, const string &basename) const output << "end\n"; output << "disp('compiling...');\n"; if (compiler == 0) - output << "mex " << filename << "_dynamic.c;\n"; + output << "mex " << basename << "_dynamic.c;\n"; else - output << "mex " << filename << "_dynamic.cc;\n"; - output << "oo_.endo_simul=" << filename << "_dynamic;\n"; + output << "mex " << basename << "_dynamic.cc;\n"; + output << "oo_.endo_simul=" << basename << "_dynamic;\n"; } StochSimulStatement::StochSimulStatement(const TmpSymbolTable &tmp_symbol_table_arg, @@ -452,7 +454,9 @@ ObservationTrendsStatement::writeOutput(ostream &output, const string &basename) if (type == eEndogenous) { output << "tmp1 = strmatch('" << it->first << "',options_.varobs,'exact');\n"; - output << "options_.trend_coeffs{tmp1} = '" << it->second << "';\n"; + output << "options_.trend_coeffs{tmp1} = '"; + it->second->writeOutput(output); + output << "';" << endl; } else cout << "Error : Non-variable symbol used in TREND_COEFF: " << it->first << endl; @@ -490,20 +494,24 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const { const string &name = it->first; const string &weight = it->second.first; - const string &expression = it->second.second; + const NodeID expression = it->second.second; int id = symbol_table.getID(name) + 1; if (symbol_table.getType(name) == eEndogenous) { output << "calib_var_index{1} = [calib_var_index{1};" << id << "," << id << "];\n"; output << "calib_weights{1} = [calib_weights{1}; " << weight << "];\n"; - output << "calib_targets{1} =[calib_targets{1}; " << expression << "];\n"; + output << "calib_targets{1} =[calib_targets{1}; "; + expression->writeOutput(output); + output << "];\n"; } else if (symbol_table.getType(name) == eExogenous) { output << "calib_var_index{3} = [calib_var_index{3};" << id << "," << id << "];\n"; output << "calib_weights{3} = [calib_weights{3}; " << weight << "];\n"; - output << "calib_targets{3} =[calib_targets{3}; " << expression << "];\n"; + output << "calib_targets{3} =[calib_targets{3}; "; + expression->writeOutput(output); + output << "];\n"; } } @@ -514,7 +522,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const const string &name1 = it->first.first; const string &name2 = it->first.second; const string &weight = it->second.first; - const string &expression = it->second.second; + const NodeID expression = it->second.second; int id1 = symbol_table.getID(name1) + 1; int id2 = symbol_table.getID(name2) + 1; @@ -522,13 +530,17 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const { output << "calib_var_index{1} = [calib_var_index{1};" << id1 << "," << id2 << "];\n"; output << "calib_weights{1} = [calib_weights{1}; " << weight << "];\n"; - output << "calib_targets{1} =[calib_targets{1}; " << expression << "];\n"; + output << "calib_targets{1} =[calib_targets{1}; "; + expression->writeOutput(output); + output << "];\n"; } else if (symbol_table.getType(name1) == eExogenous) { output << "calib_var_index{3} = [calib_var_index{3};" << id1 << "," << id2 << "];\n"; output << "calib_weights{3} = [calib_weights{3}; " << weight << "];\n"; - output << "calib_targets{3} =[calib_targets{3}; " << expression << "];\n"; + output << "calib_targets{3} =[calib_targets{3}; "; + expression->writeOutput(output); + output << "];\n"; } } @@ -541,7 +553,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const const string &name = it->first.first; int iar = it->first.second + 3; const string &weight = it->second.first; - const string &expression = it->second.second; + const NodeID expression = it->second.second; int id = symbol_table.getID(name) + 1; @@ -559,7 +571,9 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const output << "calib_var_index{" << iar << "} = [calib_var_index{" << iar << "};" << id << "];\n"; output << "calib_weights{" << iar << "} = [calib_weights{" << iar << "}; " << weight << "];\n"; - output << "calib_targets{" << iar << "} =[calib_targets{" << iar << "}; " << expression << "];\n"; + output << "calib_targets{" << iar << "} =[calib_targets{" << iar << "}; "; + expression->writeOutput(output); + output << "];\n"; } } @@ -671,9 +685,11 @@ OptimWeightsStatement::writeOutput(ostream &output, const string &basename) cons it != var_weights.end(); it++) { const string &name = it->first; - const string &value = it->second; + const NodeID value = it->second; int id = symbol_table.getID(name) + 1; - output << "optim_weights_(" << id << "," << id << ") = " << value << ";\n"; + output << "optim_weights_(" << id << "," << id << ") = "; + value->writeOutput(output); + output << ";" << endl; output << "obj_var_ = [obj_var_; " << id << "];\n"; } @@ -682,10 +698,12 @@ OptimWeightsStatement::writeOutput(ostream &output, const string &basename) cons { const string &name1 = it->first.first; const string &name2 = it->first.second; - const string &value = it->second; + const NodeID value = it->second; int id1 = symbol_table.getID(name1) + 1; int id2 = symbol_table.getID(name2) + 1; - output << "optim_weights_(" << id1 << "," << id2 << ") = " << value << ";\n"; + output << "optim_weights_(" << id1 << "," << id2 << ") = "; + value->writeOutput(output); + output << ";" << endl; output << "obj_var_ = [obj_var_; " << id1 << " " << id2 << "];\n"; } } @@ -770,7 +788,7 @@ void PlannerObjectiveStatement::computingPass() { model_tree->computeStaticHessian = true; - model_tree->computingPass(); + model_tree->computingPass(eval_context_type()); } void diff --git a/parser.src/DataTree.cc b/parser.src/DataTree.cc index 3b48fe290..1e21ba09e 100644 --- a/parser.src/DataTree.cc +++ b/parser.src/DataTree.cc @@ -43,21 +43,14 @@ DataTree::AddVariable(const string &name, int lag) symbol_table.SetReferenced(name); + int symb_id = symbol_table.getID(name); Type type = symbol_table.getType(name); - int id; - if (type == eEndogenous - || type == eExogenousDet - || type == eExogenous - || type == eRecursiveVariable) - id = variable_table.AddVariable(name, lag); - else - id = symbol_table.getID(name); - variable_node_map_type::iterator it = variable_node_map.find(make_pair(id, type)); + variable_node_map_type::iterator it = variable_node_map.find(make_pair(make_pair(symb_id, type), lag)); if (it != variable_node_map.end()) return it->second; else - return new VariableNode(*this, id, type); + return new VariableNode(*this, symb_id, type, lag); } NodeID @@ -346,3 +339,9 @@ DataTree::AddLocalParameter(const string &name, NodeID value) throw (LocalParame local_parameters_table[id] = value; } + +NodeID +DataTree::AddUnknownFunction(const string &function_name, const vector &arguments) +{ + return new UnknownFunctionNode(*this, function_name, arguments); +} diff --git a/parser.src/DynareBison.cc b/parser.src/DynareBison.cc index 6bc8a3e60..c7d6c71c1 100644 --- a/parser.src/DynareBison.cc +++ b/parser.src/DynareBison.cc @@ -36,7 +36,7 @@ #include "DynareBison.hh" /* User implementation prologue. */ -#line 37 "DynareBison.yy" +#line 32 "DynareBison.yy" #include "ParsingDriver.hh" @@ -273,7 +273,7 @@ namespace yy /* User initialization code. */ - #line 22 "DynareBison.yy" + #line 18 "DynareBison.yy" { // Initialize the location filenames yylloc.begin.filename = yylloc.end.filename = &driver.file; @@ -395,803 +395,823 @@ namespace yy switch (yyn) { case 46: -#line 143 "DynareBison.yy" +#line 138 "DynareBison.yy" { driver.dsample((yysemantic_stack_[(3) - (2)].string_val));;} break; case 47: -#line 144 "DynareBison.yy" +#line 139 "DynareBison.yy" {driver.dsample((yysemantic_stack_[(4) - (2)].string_val), (yysemantic_stack_[(4) - (3)].string_val));;} break; case 48: -#line 147 "DynareBison.yy" +#line 142 "DynareBison.yy" {driver.rplot();;} break; case 53: -#line 167 "DynareBison.yy" +#line 162 "DynareBison.yy" { driver.declare_endogenous((yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 54: -#line 169 "DynareBison.yy" +#line 164 "DynareBison.yy" { driver.declare_endogenous((yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 55: -#line 171 "DynareBison.yy" +#line 166 "DynareBison.yy" { driver.declare_endogenous((yysemantic_stack_[(1) - (1)].string_val)); ;} break; case 56: -#line 173 "DynareBison.yy" +#line 168 "DynareBison.yy" { driver.declare_endogenous((yysemantic_stack_[(3) - (2)].string_val), (yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 57: -#line 175 "DynareBison.yy" +#line 170 "DynareBison.yy" { driver.declare_endogenous((yysemantic_stack_[(4) - (3)].string_val), (yysemantic_stack_[(4) - (4)].string_val)); ;} break; case 58: -#line 177 "DynareBison.yy" +#line 172 "DynareBison.yy" { driver.declare_endogenous((yysemantic_stack_[(2) - (1)].string_val), (yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 59: -#line 182 "DynareBison.yy" +#line 177 "DynareBison.yy" { driver.declare_exogenous((yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 60: -#line 184 "DynareBison.yy" +#line 179 "DynareBison.yy" { driver.declare_exogenous((yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 61: -#line 186 "DynareBison.yy" +#line 181 "DynareBison.yy" { driver.declare_exogenous((yysemantic_stack_[(1) - (1)].string_val)); ;} break; case 62: -#line 188 "DynareBison.yy" +#line 183 "DynareBison.yy" { driver.declare_exogenous((yysemantic_stack_[(3) - (2)].string_val), (yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 63: -#line 190 "DynareBison.yy" +#line 185 "DynareBison.yy" { driver.declare_exogenous((yysemantic_stack_[(4) - (3)].string_val), (yysemantic_stack_[(4) - (4)].string_val)); ;} break; case 64: -#line 192 "DynareBison.yy" +#line 187 "DynareBison.yy" { driver.declare_exogenous((yysemantic_stack_[(2) - (1)].string_val), (yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 65: -#line 197 "DynareBison.yy" +#line 192 "DynareBison.yy" { driver.declare_exogenous_det((yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 66: -#line 199 "DynareBison.yy" +#line 194 "DynareBison.yy" { driver.declare_exogenous_det((yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 67: -#line 201 "DynareBison.yy" +#line 196 "DynareBison.yy" { driver.declare_exogenous_det((yysemantic_stack_[(1) - (1)].string_val)); ;} break; case 68: -#line 203 "DynareBison.yy" +#line 198 "DynareBison.yy" { driver.declare_exogenous_det((yysemantic_stack_[(3) - (2)].string_val), (yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 69: -#line 205 "DynareBison.yy" +#line 200 "DynareBison.yy" { driver.declare_exogenous_det((yysemantic_stack_[(4) - (3)].string_val), (yysemantic_stack_[(4) - (4)].string_val)); ;} break; case 70: -#line 207 "DynareBison.yy" +#line 202 "DynareBison.yy" { driver.declare_exogenous_det((yysemantic_stack_[(2) - (1)].string_val), (yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 71: -#line 212 "DynareBison.yy" +#line 207 "DynareBison.yy" { driver.declare_parameter((yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 72: -#line 214 "DynareBison.yy" +#line 209 "DynareBison.yy" { driver.declare_parameter((yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 73: -#line 216 "DynareBison.yy" +#line 211 "DynareBison.yy" { driver.declare_parameter((yysemantic_stack_[(1) - (1)].string_val)); ;} break; case 74: -#line 218 "DynareBison.yy" +#line 213 "DynareBison.yy" { driver.declare_parameter((yysemantic_stack_[(3) - (2)].string_val), (yysemantic_stack_[(3) - (3)].string_val)); ;} break; case 75: -#line 220 "DynareBison.yy" +#line 215 "DynareBison.yy" { driver.declare_parameter((yysemantic_stack_[(4) - (3)].string_val), (yysemantic_stack_[(4) - (4)].string_val)); ;} break; case 76: -#line 222 "DynareBison.yy" +#line 217 "DynareBison.yy" { driver.declare_parameter((yysemantic_stack_[(2) - (1)].string_val), (yysemantic_stack_[(2) - (2)].string_val)); ;} break; case 77: -#line 227 "DynareBison.yy" +#line 222 "DynareBison.yy" { driver.periods((yysemantic_stack_[(3) - (2)].string_val)); ;} break; case 78: -#line 231 "DynareBison.yy" +#line 226 "DynareBison.yy" { driver.periods((yysemantic_stack_[(4) - (3)].string_val)); ;} break; case 79: -#line 238 "DynareBison.yy" +#line 233 "DynareBison.yy" { driver.cutoff((yysemantic_stack_[(3) - (2)].string_val)); ;} break; case 80: -#line 242 "DynareBison.yy" +#line 237 "DynareBison.yy" { driver.cutoff((yysemantic_stack_[(4) - (3)].string_val)); ;} break; case 81: -#line 249 "DynareBison.yy" - {driver.init_param((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].exp_val));;} +#line 244 "DynareBison.yy" + {driver.init_param((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].node_val));;} break; case 82: -#line 254 "DynareBison.yy" - { (yyval.exp_val) = (yysemantic_stack_[(3) - (2)].exp_val);;} +#line 249 "DynareBison.yy" + { (yyval.node_val) = (yysemantic_stack_[(3) - (2)].node_val);;} break; case 83: -#line 256 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_variable((yysemantic_stack_[(1) - (1)].string_val));;} +#line 251 "DynareBison.yy" + {(yyval.node_val) = driver.add_expression_variable((yysemantic_stack_[(1) - (1)].string_val));;} break; case 84: -#line 258 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_constant((yysemantic_stack_[(1) - (1)].string_val));;} +#line 253 "DynareBison.yy" + {(yyval.node_val) = driver.add_constant((yysemantic_stack_[(1) - (1)].string_val));;} break; case 85: -#line 260 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_constant((yysemantic_stack_[(1) - (1)].string_val));;} +#line 255 "DynareBison.yy" + {(yyval.node_val) = driver.add_constant((yysemantic_stack_[(1) - (1)].string_val));;} break; case 86: -#line 262 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::PLUS);;} +#line 257 "DynareBison.yy" + {(yyval.node_val) = driver.add_plus((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 87: -#line 264 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::MINUS);;} +#line 259 "DynareBison.yy" + {(yyval.node_val) = driver.add_minus((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 88: -#line 266 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::DIVIDE);;} +#line 261 "DynareBison.yy" + {(yyval.node_val) = driver.add_divide((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 89: -#line 268 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::TIMES);;} +#line 263 "DynareBison.yy" + {(yyval.node_val) = driver.add_times((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 90: -#line 270 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::POWER);;} +#line 265 "DynareBison.yy" + {(yyval.node_val) = driver.add_power((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 91: -#line 272 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(2) - (2)].exp_val), token::UMINUS);;} +#line 267 "DynareBison.yy" + {(yyval.node_val) = driver.add_uminus((yysemantic_stack_[(2) - (2)].node_val));;} break; case 92: -#line 274 "DynareBison.yy" - {(yyval.exp_val) = (yysemantic_stack_[(2) - (2)].exp_val);;} +#line 269 "DynareBison.yy" + {(yyval.node_val) = (yysemantic_stack_[(2) - (2)].node_val);;} break; case 93: -#line 276 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::EXP);;} +#line 271 "DynareBison.yy" + {(yyval.node_val) = driver.add_exp((yysemantic_stack_[(4) - (3)].node_val));;} break; case 94: -#line 278 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::LOG);;} +#line 273 "DynareBison.yy" + {(yyval.node_val) = driver.add_log((yysemantic_stack_[(4) - (3)].node_val));;} break; case 95: -#line 280 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::LOG10);;} +#line 275 "DynareBison.yy" + {(yyval.node_val) = driver.add_log10((yysemantic_stack_[(4) - (3)].node_val));;} break; case 96: -#line 282 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::SIN);;} +#line 277 "DynareBison.yy" + {(yyval.node_val) = driver.add_sin((yysemantic_stack_[(4) - (3)].node_val));;} break; case 97: -#line 284 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::COS);;} +#line 279 "DynareBison.yy" + {(yyval.node_val) = driver.add_cos((yysemantic_stack_[(4) - (3)].node_val));;} break; case 98: -#line 286 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::TAN);;} +#line 281 "DynareBison.yy" + {(yyval.node_val) = driver.add_tan((yysemantic_stack_[(4) - (3)].node_val));;} break; case 99: -#line 288 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::ASIN);;} +#line 283 "DynareBison.yy" + {(yyval.node_val) = driver.add_asin((yysemantic_stack_[(4) - (3)].node_val));;} break; case 100: -#line 290 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::ACOS);;} +#line 285 "DynareBison.yy" + {(yyval.node_val) = driver.add_acos((yysemantic_stack_[(4) - (3)].node_val));;} break; case 101: -#line 292 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::ATAN);;} +#line 287 "DynareBison.yy" + {(yyval.node_val) = driver.add_atan((yysemantic_stack_[(4) - (3)].node_val));;} break; case 102: -#line 294 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), token::SQRT);;} +#line 289 "DynareBison.yy" + {(yyval.node_val) = driver.add_sqrt((yysemantic_stack_[(4) - (3)].node_val));;} break; case 103: -#line 296 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), (yysemantic_stack_[(4) - (1)].string_val));;} +#line 291 "DynareBison.yy" + {(yyval.node_val) = driver.add_unknown_function((yysemantic_stack_[(4) - (1)].string_val));;} break; case 104: -#line 298 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(4) - (3)].exp_val), (yysemantic_stack_[(4) - (1)].string_val));;} +#line 296 "DynareBison.yy" + { driver.add_unknown_function_arg((yysemantic_stack_[(1) - (1)].node_val)); ;} break; case 105: -#line 303 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::COMMA);;} +#line 298 "DynareBison.yy" + { driver.add_unknown_function_arg((yysemantic_stack_[(3) - (3)].node_val)); ;} break; case 106: -#line 305 "DynareBison.yy" - {(yyval.exp_val) = driver.add_expression_token((yysemantic_stack_[(3) - (1)].exp_val), (yysemantic_stack_[(3) - (3)].exp_val), token::COMMA);;} +#line 302 "DynareBison.yy" + {driver.end_initval();;} break; case 107: -#line 309 "DynareBison.yy" +#line 304 "DynareBison.yy" {driver.end_initval();;} break; case 108: -#line 311 "DynareBison.yy" - {driver.end_initval();;} - break; - - case 109: -#line 315 "DynareBison.yy" +#line 308 "DynareBison.yy" {driver.init_val_filename((yysemantic_stack_[(3) - (3)].string_val));;} break; - case 110: -#line 320 "DynareBison.yy" + case 109: +#line 313 "DynareBison.yy" {driver.end_endval();;} break; - case 113: -#line 330 "DynareBison.yy" - {driver.init_val((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].exp_val));;} + case 112: +#line 323 "DynareBison.yy" + {driver.init_val((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].node_val));;} break; - case 114: -#line 335 "DynareBison.yy" + case 113: +#line 328 "DynareBison.yy" { driver.end_histval(); ;} break; - case 117: -#line 345 "DynareBison.yy" - {driver.hist_val((yysemantic_stack_[(7) - (1)].string_val), (yysemantic_stack_[(7) - (3)].string_val), (yysemantic_stack_[(7) - (6)].exp_val));;} + case 116: +#line 338 "DynareBison.yy" + {driver.hist_val((yysemantic_stack_[(7) - (1)].string_val), (yysemantic_stack_[(7) - (3)].string_val), (yysemantic_stack_[(7) - (6)].node_val));;} break; - case 120: -#line 353 "DynareBison.yy" + case 119: +#line 346 "DynareBison.yy" { driver.init_compiler(0); ;} break; - case 121: -#line 354 "DynareBison.yy" + case 120: +#line 347 "DynareBison.yy" { driver.init_compiler(1); ;} break; + case 122: +#line 352 "DynareBison.yy" + { driver.begin_model(); ;} + break; + case 123: -#line 359 "DynareBison.yy" +#line 352 "DynareBison.yy" + { driver.reset_data_tree(); ;} + break; + + case 124: +#line 353 "DynareBison.yy" { driver.begin_model(); ;} break; case 125: -#line 360 "DynareBison.yy" - { driver.begin_model(); ;} +#line 354 "DynareBison.yy" + { driver.reset_data_tree(); ;} break; - case 127: -#line 362 "DynareBison.yy" + case 126: +#line 355 "DynareBison.yy" { driver.begin_model(); driver.use_dll(); ;} break; + case 127: +#line 356 "DynareBison.yy" + { driver.reset_data_tree(); ;} + break; + + case 128: +#line 357 "DynareBison.yy" + { driver.begin_model(); driver.sparse_dll(); ;} + break; + case 129: -#line 364 "DynareBison.yy" - { driver.sparse_dll(); driver.begin_model(); ;} +#line 358 "DynareBison.yy" + { driver.reset_data_tree(); ;} + break; + + case 130: +#line 359 "DynareBison.yy" + { driver.begin_model(); driver.sparse_dll(); ;} break; case 131: -#line 366 "DynareBison.yy" - { driver.sparse_dll(); driver.begin_model(); ;} +#line 360 "DynareBison.yy" + { driver.reset_data_tree(); ;} + break; + + case 136: +#line 372 "DynareBison.yy" + {(yyval.node_val) = driver.add_model_equal((yysemantic_stack_[(4) - (1)].node_val), (yysemantic_stack_[(4) - (3)].node_val));;} break; case 137: -#line 379 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_equal((yysemantic_stack_[(4) - (1)].model_val), (yysemantic_stack_[(4) - (3)].model_val));;} +#line 374 "DynareBison.yy" + {(yyval.node_val) = driver.add_model_equal_with_zero_rhs((yysemantic_stack_[(2) - (1)].node_val));;} break; case 138: -#line 381 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_equal_with_zero_rhs((yysemantic_stack_[(2) - (1)].model_val));;} +#line 378 "DynareBison.yy" + {(yyval.node_val) = (yysemantic_stack_[(3) - (2)].node_val);;} break; - case 139: -#line 385 "DynareBison.yy" - {(yyval.model_val) = (yysemantic_stack_[(3) - (2)].model_val);;} + case 140: +#line 381 "DynareBison.yy" + {(yyval.node_val) = driver.add_constant((yysemantic_stack_[(1) - (1)].string_val));;} break; case 141: -#line 388 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_constant((yysemantic_stack_[(1) - (1)].string_val));;} +#line 383 "DynareBison.yy" + {(yysemantic_stack_[(1) - (1)].string_val)->append(".0"); (yyval.node_val) = driver.add_constant((yysemantic_stack_[(1) - (1)].string_val));;} break; case 142: -#line 390 "DynareBison.yy" - {(yysemantic_stack_[(1) - (1)].string_val)->append(".0"); (yyval.model_val) = driver.add_model_constant((yysemantic_stack_[(1) - (1)].string_val));;} +#line 385 "DynareBison.yy" + {(yyval.node_val) = driver.add_plus((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 143: -#line 392 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_plus((yysemantic_stack_[(3) - (1)].model_val), (yysemantic_stack_[(3) - (3)].model_val));;} +#line 387 "DynareBison.yy" + {(yyval.node_val) = driver.add_minus((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 144: -#line 394 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_minus((yysemantic_stack_[(3) - (1)].model_val), (yysemantic_stack_[(3) - (3)].model_val));;} +#line 389 "DynareBison.yy" + {(yyval.node_val) = driver.add_divide((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 145: -#line 396 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_divide((yysemantic_stack_[(3) - (1)].model_val), (yysemantic_stack_[(3) - (3)].model_val));;} +#line 391 "DynareBison.yy" + {(yyval.node_val) = driver.add_times((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 146: -#line 398 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_times((yysemantic_stack_[(3) - (1)].model_val), (yysemantic_stack_[(3) - (3)].model_val));;} +#line 393 "DynareBison.yy" + {(yyval.node_val) = driver.add_power((yysemantic_stack_[(3) - (1)].node_val), (yysemantic_stack_[(3) - (3)].node_val));;} break; case 147: -#line 400 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_power((yysemantic_stack_[(3) - (1)].model_val), (yysemantic_stack_[(3) - (3)].model_val));;} +#line 395 "DynareBison.yy" + { (yyval.node_val) = driver.add_uminus((yysemantic_stack_[(2) - (2)].node_val));;} break; case 148: -#line 402 "DynareBison.yy" - { (yyval.model_val) = driver.add_model_uminus((yysemantic_stack_[(2) - (2)].model_val));;} +#line 397 "DynareBison.yy" + {(yyval.node_val) = (yysemantic_stack_[(2) - (2)].node_val);;} break; case 149: -#line 404 "DynareBison.yy" - {(yyval.model_val) = (yysemantic_stack_[(2) - (2)].model_val);;} +#line 399 "DynareBison.yy" + {(yyval.node_val) = driver.add_exp((yysemantic_stack_[(4) - (3)].node_val));;} break; case 150: -#line 406 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_exp((yysemantic_stack_[(4) - (3)].model_val));;} +#line 401 "DynareBison.yy" + {(yyval.node_val) = driver.add_log((yysemantic_stack_[(4) - (3)].node_val));;} break; case 151: -#line 408 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_log((yysemantic_stack_[(4) - (3)].model_val));;} +#line 403 "DynareBison.yy" + {(yyval.node_val) = driver.add_log10((yysemantic_stack_[(4) - (3)].node_val));;} break; case 152: -#line 410 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_log10((yysemantic_stack_[(4) - (3)].model_val));;} +#line 405 "DynareBison.yy" + {(yyval.node_val) = driver.add_sin((yysemantic_stack_[(4) - (3)].node_val));;} break; case 153: -#line 412 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_sin((yysemantic_stack_[(4) - (3)].model_val));;} +#line 407 "DynareBison.yy" + {(yyval.node_val) = driver.add_cos((yysemantic_stack_[(4) - (3)].node_val));;} break; case 154: -#line 414 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_cos((yysemantic_stack_[(4) - (3)].model_val));;} +#line 409 "DynareBison.yy" + {(yyval.node_val) = driver.add_tan((yysemantic_stack_[(4) - (3)].node_val));;} break; case 155: -#line 416 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_tan((yysemantic_stack_[(4) - (3)].model_val));;} +#line 411 "DynareBison.yy" + {(yyval.node_val) = driver.add_asin((yysemantic_stack_[(4) - (3)].node_val));;} break; case 156: -#line 418 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_asin((yysemantic_stack_[(4) - (3)].model_val));;} +#line 413 "DynareBison.yy" + {(yyval.node_val) = driver.add_acos((yysemantic_stack_[(4) - (3)].node_val));;} break; case 157: -#line 420 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_acos((yysemantic_stack_[(4) - (3)].model_val));;} +#line 415 "DynareBison.yy" + {(yyval.node_val) = driver.add_atan((yysemantic_stack_[(4) - (3)].node_val));;} break; case 158: -#line 422 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_atan((yysemantic_stack_[(4) - (3)].model_val));;} +#line 417 "DynareBison.yy" + {(yyval.node_val) = driver.add_sqrt((yysemantic_stack_[(4) - (3)].node_val));;} break; case 159: -#line 424 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_sqrt((yysemantic_stack_[(4) - (3)].model_val));;} +#line 421 "DynareBison.yy" + {driver.declare_and_init_local_parameter((yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].node_val));;} break; case 160: -#line 428 "DynareBison.yy" - {driver.declare_and_init_local_parameter((yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].model_val));;} +#line 425 "DynareBison.yy" + {(yyval.node_val) = driver.add_model_variable((yysemantic_stack_[(1) - (1)].string_val));;} break; case 161: -#line 432 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_variable((yysemantic_stack_[(1) - (1)].string_val));;} +#line 427 "DynareBison.yy" + {(yyval.node_val) = driver.add_model_variable((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].string_val));;} break; case 162: -#line 434 "DynareBison.yy" - {(yyval.model_val) = driver.add_model_variable((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].string_val));;} - break; - - case 163: -#line 438 "DynareBison.yy" +#line 431 "DynareBison.yy" {driver.end_shocks();;} break; - case 164: -#line 442 "DynareBison.yy" + case 163: +#line 435 "DynareBison.yy" {driver.end_mshocks();;} break; - case 167: -#line 452 "DynareBison.yy" + case 166: +#line 445 "DynareBison.yy" {driver.add_det_shock((yysemantic_stack_[(9) - (2)].string_val));;} break; + case 167: +#line 447 "DynareBison.yy" + {driver.add_stderr_shock((yysemantic_stack_[(6) - (2)].string_val), (yysemantic_stack_[(6) - (5)].node_val));;} + break; + case 168: -#line 454 "DynareBison.yy" - {driver.add_stderr_shock((yysemantic_stack_[(6) - (2)].string_val), (yysemantic_stack_[(6) - (5)].exp_val));;} +#line 449 "DynareBison.yy" + {driver.add_var_shock((yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].node_val));;} break; case 169: -#line 456 "DynareBison.yy" - {driver.add_var_shock((yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].exp_val));;} +#line 451 "DynareBison.yy" + {driver.add_covar_shock((yysemantic_stack_[(7) - (2)].string_val), (yysemantic_stack_[(7) - (4)].string_val), (yysemantic_stack_[(7) - (6)].node_val));;} break; case 170: -#line 458 "DynareBison.yy" - {driver.add_covar_shock((yysemantic_stack_[(7) - (2)].string_val), (yysemantic_stack_[(7) - (4)].string_val), (yysemantic_stack_[(7) - (6)].exp_val));;} +#line 453 "DynareBison.yy" + {driver.add_correl_shock((yysemantic_stack_[(7) - (2)].string_val), (yysemantic_stack_[(7) - (4)].string_val), (yysemantic_stack_[(7) - (6)].node_val));;} break; case 171: -#line 460 "DynareBison.yy" - {driver.add_correl_shock((yysemantic_stack_[(7) - (2)].string_val), (yysemantic_stack_[(7) - (4)].string_val), (yysemantic_stack_[(7) - (6)].exp_val));;} - break; - - case 172: -#line 465 "DynareBison.yy" +#line 458 "DynareBison.yy" {driver.add_period((yysemantic_stack_[(2) - (2)].string_val));;} break; - case 173: -#line 467 "DynareBison.yy" + case 172: +#line 460 "DynareBison.yy" {driver.add_period((yysemantic_stack_[(4) - (2)].string_val),(yysemantic_stack_[(4) - (4)].string_val));;} break; - case 174: -#line 469 "DynareBison.yy" + case 173: +#line 462 "DynareBison.yy" {driver.add_period((yysemantic_stack_[(3) - (3)].string_val));;} break; - case 175: -#line 471 "DynareBison.yy" + case 174: +#line 464 "DynareBison.yy" {driver.add_period((yysemantic_stack_[(5) - (3)].string_val), (yysemantic_stack_[(5) - (5)].string_val));;} break; - case 176: -#line 473 "DynareBison.yy" + case 175: +#line 466 "DynareBison.yy" {driver.add_period((yysemantic_stack_[(3) - (1)].string_val), (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 177: -#line 475 "DynareBison.yy" + case 176: +#line 468 "DynareBison.yy" {driver.add_period((yysemantic_stack_[(1) - (1)].string_val));;} break; + case 177: +#line 474 "DynareBison.yy" + {driver.add_value_const((yysemantic_stack_[(2) - (2)].string_val));;} + break; + case 178: -#line 481 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(2) - (2)].string_val));;} +#line 476 "DynareBison.yy" + {driver.add_value_const((yysemantic_stack_[(2) - (2)].string_val));;} break; case 179: -#line 483 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(2) - (2)].string_val));;} +#line 478 "DynareBison.yy" + {driver.add_value_var((yysemantic_stack_[(2) - (2)].string_val));;} break; case 180: -#line 485 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(2) - (2)].string_val));;} +#line 480 "DynareBison.yy" + {driver.add_value_const((yysemantic_stack_[(1) - (1)].string_val));;} break; case 181: -#line 487 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(1) - (1)].string_val));;} +#line 482 "DynareBison.yy" + {driver.add_value_const((yysemantic_stack_[(1) - (1)].string_val));;} break; case 182: -#line 489 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(1) - (1)].string_val));;} +#line 484 "DynareBison.yy" + {driver.add_value_var((yysemantic_stack_[(1) - (1)].string_val));;} break; case 183: -#line 491 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(1) - (1)].string_val));;} +#line 486 "DynareBison.yy" + {driver.add_value((yysemantic_stack_[(4) - (3)].node_val));;} break; case 184: -#line 493 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(4) - (3)].exp_val));;} +#line 488 "DynareBison.yy" + {driver.add_value((yysemantic_stack_[(3) - (2)].node_val));;} break; case 185: -#line 495 "DynareBison.yy" - {driver.add_value((yysemantic_stack_[(3) - (2)].exp_val));;} - break; - - case 186: -#line 500 "DynareBison.yy" +#line 493 "DynareBison.yy" {driver.do_sigma_e();;} break; + case 186: +#line 498 "DynareBison.yy" + {driver.end_of_row();;} + break; + case 187: -#line 505 "DynareBison.yy" +#line 500 "DynareBison.yy" {driver.end_of_row();;} break; case 188: -#line 507 "DynareBison.yy" - {driver.end_of_row();;} +#line 505 "DynareBison.yy" + {driver.add_to_row((yysemantic_stack_[(5) - (4)].node_val));;} break; case 189: -#line 512 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(5) - (4)].exp_val));;} +#line 507 "DynareBison.yy" + {driver.add_to_row_const((yysemantic_stack_[(3) - (3)].string_val));;} break; case 190: -#line 514 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(3) - (3)].string_val));;} +#line 509 "DynareBison.yy" + {driver.add_to_row_const((yysemantic_stack_[(3) - (3)].string_val));;} break; case 191: -#line 516 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(3) - (3)].string_val));;} +#line 511 "DynareBison.yy" + {driver.add_to_row((yysemantic_stack_[(4) - (3)].node_val));;} break; case 192: -#line 518 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(4) - (3)].exp_val));;} +#line 513 "DynareBison.yy" + {driver.add_to_row_const((yysemantic_stack_[(2) - (2)].string_val));;} break; case 193: -#line 520 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(2) - (2)].string_val));;} +#line 515 "DynareBison.yy" + {driver.add_to_row_const((yysemantic_stack_[(2) - (2)].string_val));;} break; case 194: -#line 522 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(2) - (2)].string_val));;} +#line 517 "DynareBison.yy" + {driver.add_to_row((yysemantic_stack_[(3) - (2)].node_val));;} break; case 195: -#line 524 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(3) - (2)].exp_val));;} +#line 519 "DynareBison.yy" + {driver.add_to_row_const((yysemantic_stack_[(1) - (1)].string_val));;} break; case 196: -#line 526 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(1) - (1)].string_val));;} +#line 521 "DynareBison.yy" + {driver.add_to_row_const((yysemantic_stack_[(1) - (1)].string_val));;} break; case 197: -#line 528 "DynareBison.yy" - {driver.add_to_row((yysemantic_stack_[(1) - (1)].string_val));;} - break; - - case 198: -#line 533 "DynareBison.yy" +#line 526 "DynareBison.yy" { driver.steady(); ;} break; - case 199: -#line 537 "DynareBison.yy" + case 198: +#line 530 "DynareBison.yy" {driver.steady();;} break; - case 203: -#line 549 "DynareBison.yy" + case 202: +#line 542 "DynareBison.yy" {driver.check();;} break; - case 204: -#line 551 "DynareBison.yy" + case 203: +#line 544 "DynareBison.yy" {driver.check();;} break; + case 207: +#line 556 "DynareBison.yy" + {driver.simulate();;} + break; + case 208: -#line 563 "DynareBison.yy" +#line 558 "DynareBison.yy" {driver.simulate();;} break; - case 209: -#line 565 "DynareBison.yy" - {driver.simulate();;} + case 212: +#line 570 "DynareBison.yy" + {driver.stoch_simul();;} break; case 213: -#line 577 "DynareBison.yy" +#line 572 "DynareBison.yy" {driver.stoch_simul();;} break; case 214: -#line 579 "DynareBison.yy" +#line 574 "DynareBison.yy" {driver.stoch_simul();;} break; case 215: -#line 581 "DynareBison.yy" +#line 576 "DynareBison.yy" {driver.stoch_simul();;} break; - case 216: -#line 583 "DynareBison.yy" - {driver.stoch_simul();;} - break; - - case 239: -#line 614 "DynareBison.yy" + case 238: +#line 607 "DynareBison.yy" {driver.add_tmp_var((yysemantic_stack_[(2) - (2)].string_val));;} break; - case 240: -#line 616 "DynareBison.yy" + case 239: +#line 609 "DynareBison.yy" {driver.add_tmp_var((yysemantic_stack_[(4) - (2)].string_val), (yysemantic_stack_[(4) - (4)].string_val));;} break; - case 241: -#line 618 "DynareBison.yy" + case 240: +#line 611 "DynareBison.yy" {driver.add_tmp_var((yysemantic_stack_[(3) - (3)].string_val));;} break; - case 242: -#line 620 "DynareBison.yy" + case 241: +#line 613 "DynareBison.yy" {driver.add_tmp_var((yysemantic_stack_[(5) - (3)].string_val), (yysemantic_stack_[(5) - (5)].string_val));;} break; - case 243: -#line 622 "DynareBison.yy" + case 242: +#line 615 "DynareBison.yy" {driver.add_tmp_var((yysemantic_stack_[(1) - (1)].string_val));;} break; - case 244: -#line 624 "DynareBison.yy" + case 243: +#line 617 "DynareBison.yy" {driver.add_tmp_var((yysemantic_stack_[(3) - (1)].string_val), (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 245: -#line 629 "DynareBison.yy" + case 244: +#line 622 "DynareBison.yy" {(yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} break; + case 245: +#line 624 "DynareBison.yy" + {(yysemantic_stack_[(2) - (2)].string_val)->insert(0, "-"); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} + break; + case 246: -#line 631 "DynareBison.yy" - {(yysemantic_stack_[(2) - (2)].string_val)->insert(0, "-"); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} +#line 626 "DynareBison.yy" + {(yyval.string_val) = (yysemantic_stack_[(1) - (1)].string_val);;} break; case 247: -#line 633 "DynareBison.yy" - {(yyval.string_val) = (yysemantic_stack_[(1) - (1)].string_val);;} - break; - - case 248: -#line 638 "DynareBison.yy" +#line 631 "DynareBison.yy" {(yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} break; - case 249: -#line 640 "DynareBison.yy" + case 248: +#line 633 "DynareBison.yy" {(yysemantic_stack_[(2) - (2)].string_val)->insert(0, "-"); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} break; - case 250: -#line 642 "DynareBison.yy" + case 249: +#line 635 "DynareBison.yy" {(yyval.string_val) = (yysemantic_stack_[(1) - (1)].string_val);;} break; - case 251: -#line 647 "DynareBison.yy" + case 250: +#line 640 "DynareBison.yy" { driver.estimated_params(); ;} break; + case 251: +#line 645 "DynareBison.yy" + {driver.add_estimated_params_element();;} + break; + case 252: -#line 652 "DynareBison.yy" +#line 647 "DynareBison.yy" {driver.add_estimated_params_element();;} break; - case 253: -#line 654 "DynareBison.yy" - {driver.add_estimated_params_element();;} - break; - - case 255: -#line 663 "DynareBison.yy" + case 254: +#line 656 "DynareBison.yy" {driver.estim_params.type = 1; driver.estim_params.name = *(yysemantic_stack_[(2) - (2)].string_val); delete (yysemantic_stack_[(2) - (2)].string_val); ;} break; - case 256: -#line 668 "DynareBison.yy" + case 255: +#line 661 "DynareBison.yy" {driver.estim_params.type = 2; driver.estim_params.name = *(yysemantic_stack_[(1) - (1)].string_val); delete (yysemantic_stack_[(1) - (1)].string_val); ;} break; - case 257: -#line 673 "DynareBison.yy" + case 256: +#line 666 "DynareBison.yy" {driver.estim_params.type = 3; driver.estim_params.name = *(yysemantic_stack_[(4) - (2)].string_val); driver.estim_params.name2 = *(yysemantic_stack_[(4) - (4)].string_val); @@ -1200,16 +1220,16 @@ namespace yy ;} break; - case 258: -#line 683 "DynareBison.yy" + case 257: +#line 676 "DynareBison.yy" { driver.estim_params.prior=*(yysemantic_stack_[(3) - (1)].string_val); delete (yysemantic_stack_[(3) - (1)].string_val); ;} break; - case 259: -#line 688 "DynareBison.yy" + case 258: +#line 681 "DynareBison.yy" {driver.estim_params.init_val=*(yysemantic_stack_[(5) - (1)].string_val); driver.estim_params.prior=*(yysemantic_stack_[(5) - (3)].string_val); delete (yysemantic_stack_[(5) - (1)].string_val); @@ -1217,8 +1237,8 @@ namespace yy ;} break; - case 260: -#line 694 "DynareBison.yy" + case 259: +#line 687 "DynareBison.yy" {driver.estim_params.init_val=*(yysemantic_stack_[(9) - (1)].string_val); driver.estim_params.low_bound=*(yysemantic_stack_[(9) - (3)].string_val); driver.estim_params.up_bound=*(yysemantic_stack_[(9) - (5)].string_val); @@ -1230,16 +1250,16 @@ namespace yy ;} break; - case 261: -#line 704 "DynareBison.yy" + case 260: +#line 697 "DynareBison.yy" { driver.estim_params.init_val=*(yysemantic_stack_[(1) - (1)].string_val); delete (yysemantic_stack_[(1) - (1)].string_val); ;} break; - case 262: -#line 709 "DynareBison.yy" + case 261: +#line 702 "DynareBison.yy" {driver.estim_params.init_val=*(yysemantic_stack_[(5) - (1)].string_val); driver.estim_params.low_bound=*(yysemantic_stack_[(5) - (3)].string_val); driver.estim_params.up_bound=*(yysemantic_stack_[(5) - (5)].string_val); @@ -1249,8 +1269,8 @@ namespace yy ;} break; - case 263: -#line 720 "DynareBison.yy" + case 262: +#line 713 "DynareBison.yy" {driver.estim_params.mean=*(yysemantic_stack_[(3) - (1)].string_val); driver.estim_params.std=*(yysemantic_stack_[(3) - (3)].string_val); delete (yysemantic_stack_[(3) - (1)].string_val); @@ -1258,8 +1278,8 @@ namespace yy ;} break; - case 264: -#line 726 "DynareBison.yy" + case 263: +#line 719 "DynareBison.yy" {driver.estim_params.mean=*(yysemantic_stack_[(5) - (1)].string_val); driver.estim_params.std=*(yysemantic_stack_[(5) - (3)].string_val); driver.estim_params.p3=*(yysemantic_stack_[(5) - (5)].string_val); @@ -1269,8 +1289,8 @@ namespace yy ;} break; - case 265: -#line 734 "DynareBison.yy" + case 264: +#line 727 "DynareBison.yy" {driver.estim_params.mean=*(yysemantic_stack_[(7) - (1)].string_val); driver.estim_params.std=*(yysemantic_stack_[(7) - (3)].string_val); driver.estim_params.p3=*(yysemantic_stack_[(7) - (5)].string_val); @@ -1282,8 +1302,8 @@ namespace yy ;} break; - case 266: -#line 744 "DynareBison.yy" + case 265: +#line 737 "DynareBison.yy" {driver.estim_params.mean=*(yysemantic_stack_[(9) - (1)].string_val); driver.estim_params.std=*(yysemantic_stack_[(9) - (3)].string_val); driver.estim_params.p3=*(yysemantic_stack_[(9) - (5)].string_val); @@ -1297,23 +1317,23 @@ namespace yy ;} break; - case 267: -#line 758 "DynareBison.yy" + case 266: +#line 751 "DynareBison.yy" { driver.estimated_params_init(); ;} break; + case 267: +#line 755 "DynareBison.yy" + {driver.add_estimated_params_element();;} + break; + case 268: -#line 762 "DynareBison.yy" +#line 757 "DynareBison.yy" {driver.add_estimated_params_element();;} break; case 269: -#line 764 "DynareBison.yy" - {driver.add_estimated_params_element();;} - break; - - case 270: -#line 768 "DynareBison.yy" +#line 761 "DynareBison.yy" {driver.estim_params.type = 1; driver.estim_params.name = *(yysemantic_stack_[(5) - (2)].string_val); driver.estim_params.init_val=*(yysemantic_stack_[(5) - (4)].string_val); @@ -1322,8 +1342,8 @@ namespace yy ;} break; - case 271: -#line 775 "DynareBison.yy" + case 270: +#line 768 "DynareBison.yy" {driver.estim_params.type = 3; driver.estim_params.name = *(yysemantic_stack_[(7) - (2)].string_val); driver.estim_params.name2 = *(yysemantic_stack_[(7) - (4)].string_val); @@ -1334,8 +1354,8 @@ namespace yy ;} break; - case 272: -#line 784 "DynareBison.yy" + case 271: +#line 777 "DynareBison.yy" {driver.estim_params.type = 2; driver.estim_params.name = *(yysemantic_stack_[(4) - (1)].string_val); driver.estim_params.init_val=*(yysemantic_stack_[(4) - (3)].string_val); @@ -1344,23 +1364,23 @@ namespace yy ;} break; - case 273: -#line 793 "DynareBison.yy" + case 272: +#line 786 "DynareBison.yy" { driver.estimated_params_bounds(); ;} break; + case 273: +#line 790 "DynareBison.yy" + {driver.add_estimated_params_element();;} + break; + case 274: -#line 797 "DynareBison.yy" +#line 792 "DynareBison.yy" {driver.add_estimated_params_element();;} break; case 275: -#line 799 "DynareBison.yy" - {driver.add_estimated_params_element();;} - break; - - case 276: -#line 803 "DynareBison.yy" +#line 796 "DynareBison.yy" {driver.estim_params.type = 1; driver.estim_params.name = *(yysemantic_stack_[(7) - (2)].string_val); driver.estim_params.low_bound=*(yysemantic_stack_[(7) - (4)].string_val); @@ -1371,8 +1391,8 @@ namespace yy ;} break; - case 277: -#line 812 "DynareBison.yy" + case 276: +#line 805 "DynareBison.yy" {driver.estim_params.type = 3; driver.estim_params.name = *(yysemantic_stack_[(9) - (2)].string_val); driver.estim_params.name2 = *(yysemantic_stack_[(9) - (4)].string_val); @@ -1385,8 +1405,8 @@ namespace yy ;} break; - case 278: -#line 823 "DynareBison.yy" + case 277: +#line 816 "DynareBison.yy" {driver.estim_params.type = 2; driver.estim_params.name = *(yysemantic_stack_[(6) - (1)].string_val); driver.estim_params.low_bound=*(yysemantic_stack_[(6) - (3)].string_val); @@ -1397,713 +1417,713 @@ namespace yy ;} break; - case 279: -#line 835 "DynareBison.yy" + case 278: +#line 828 "DynareBison.yy" {(yyval.string_val) = new string("1");;} break; - case 280: -#line 837 "DynareBison.yy" + case 279: +#line 830 "DynareBison.yy" {(yyval.string_val) = new string("2");;} break; - case 281: -#line 839 "DynareBison.yy" + case 280: +#line 832 "DynareBison.yy" {(yyval.string_val) = new string("3");;} break; - case 282: -#line 841 "DynareBison.yy" + case 281: +#line 834 "DynareBison.yy" {(yyval.string_val) = new string("4");;} break; - case 283: -#line 843 "DynareBison.yy" + case 282: +#line 836 "DynareBison.yy" {(yyval.string_val) = new string("5");;} break; - case 284: -#line 847 "DynareBison.yy" + case 283: +#line 840 "DynareBison.yy" {(yyval.string_val) = new string("NaN");;} break; + case 287: +#line 845 "DynareBison.yy" + {(yysemantic_stack_[(2) - (2)].string_val)->insert(0, "-"); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} + break; + case 288: -#line 852 "DynareBison.yy" +#line 847 "DynareBison.yy" {(yysemantic_stack_[(2) - (2)].string_val)->insert(0, "-"); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} break; case 289: #line 854 "DynareBison.yy" - {(yysemantic_stack_[(2) - (2)].string_val)->insert(0, "-"); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} + {driver.run_estimation();;} break; case 290: -#line 861 "DynareBison.yy" +#line 856 "DynareBison.yy" {driver.run_estimation();;} break; case 291: -#line 863 "DynareBison.yy" +#line 858 "DynareBison.yy" {driver.run_estimation();;} break; case 292: -#line 865 "DynareBison.yy" +#line 860 "DynareBison.yy" {driver.run_estimation();;} break; - case 293: -#line 867 "DynareBison.yy" - {driver.run_estimation();;} + case 334: +#line 911 "DynareBison.yy" + {driver.run_prior_analysis();;} break; case 335: -#line 918 "DynareBison.yy" +#line 913 "DynareBison.yy" {driver.run_prior_analysis();;} break; - case 336: -#line 920 "DynareBison.yy" - {driver.run_prior_analysis();;} + case 351: +#line 939 "DynareBison.yy" + {driver.run_posterior_analysis();;} break; case 352: -#line 946 "DynareBison.yy" +#line 941 "DynareBison.yy" {driver.run_posterior_analysis();;} break; case 353: -#line 948 "DynareBison.yy" - {driver.run_posterior_analysis();;} - break; - - case 354: -#line 952 "DynareBison.yy" +#line 945 "DynareBison.yy" {driver.optim_options_string((yysemantic_stack_[(7) - (2)].string_val), (yysemantic_stack_[(7) - (6)].string_val));;} break; - case 355: -#line 953 "DynareBison.yy" + case 354: +#line 946 "DynareBison.yy" {driver.optim_options_num((yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (5)].string_val));;} break; - case 358: -#line 963 "DynareBison.yy" + case 357: +#line 956 "DynareBison.yy" {driver.set_varobs();;} break; - case 359: -#line 968 "DynareBison.yy" + case 358: +#line 961 "DynareBison.yy" { driver.set_trends(); ;} break; - case 362: -#line 977 "DynareBison.yy" - {driver.set_trend_element((yysemantic_stack_[(5) - (1)].string_val), (yysemantic_stack_[(5) - (3)].exp_val));;} + case 361: +#line 970 "DynareBison.yy" + {driver.set_trend_element((yysemantic_stack_[(5) - (1)].string_val), (yysemantic_stack_[(5) - (3)].node_val));;} break; - case 363: -#line 980 "DynareBison.yy" + case 362: +#line 973 "DynareBison.yy" {driver.set_unit_root_vars();;} break; - case 364: -#line 984 "DynareBison.yy" + case 363: +#line 977 "DynareBison.yy" { driver.optim_weights(); ;} break; + case 364: +#line 981 "DynareBison.yy" + {driver.set_optim_weights((yysemantic_stack_[(4) - (2)].string_val), (yysemantic_stack_[(4) - (3)].node_val));;} + break; + case 365: -#line 988 "DynareBison.yy" - {driver.set_optim_weights((yysemantic_stack_[(4) - (2)].string_val), (yysemantic_stack_[(4) - (3)].exp_val));;} +#line 983 "DynareBison.yy" + {driver.set_optim_weights((yysemantic_stack_[(6) - (2)].string_val), (yysemantic_stack_[(6) - (4)].string_val), (yysemantic_stack_[(6) - (5)].node_val));;} break; case 366: -#line 990 "DynareBison.yy" - {driver.set_optim_weights((yysemantic_stack_[(6) - (2)].string_val), (yysemantic_stack_[(6) - (4)].string_val), (yysemantic_stack_[(6) - (5)].exp_val));;} +#line 985 "DynareBison.yy" + {driver.set_optim_weights((yysemantic_stack_[(3) - (1)].string_val), (yysemantic_stack_[(3) - (2)].node_val));;} break; case 367: -#line 992 "DynareBison.yy" - {driver.set_optim_weights((yysemantic_stack_[(3) - (1)].string_val), (yysemantic_stack_[(3) - (2)].exp_val));;} +#line 987 "DynareBison.yy" + {driver.set_optim_weights((yysemantic_stack_[(5) - (1)].string_val), (yysemantic_stack_[(5) - (3)].string_val), (yysemantic_stack_[(5) - (4)].node_val));;} break; case 368: -#line 994 "DynareBison.yy" - {driver.set_optim_weights((yysemantic_stack_[(5) - (1)].string_val), (yysemantic_stack_[(5) - (3)].string_val), (yysemantic_stack_[(5) - (4)].exp_val));;} - break; - - case 369: -#line 997 "DynareBison.yy" +#line 990 "DynareBison.yy" {driver.set_osr_params();;} break; + case 369: +#line 993 "DynareBison.yy" + {driver.run_osr();;} + break; + case 370: -#line 1000 "DynareBison.yy" +#line 994 "DynareBison.yy" {driver.run_osr();;} break; case 371: -#line 1001 "DynareBison.yy" +#line 995 "DynareBison.yy" {driver.run_osr();;} break; case 372: -#line 1002 "DynareBison.yy" +#line 996 "DynareBison.yy" {driver.run_osr();;} break; case 373: -#line 1003 "DynareBison.yy" - {driver.run_osr();;} +#line 999 "DynareBison.yy" + {driver.run_olr();;} break; case 374: -#line 1006 "DynareBison.yy" +#line 1000 "DynareBison.yy" {driver.run_olr();;} break; case 375: -#line 1007 "DynareBison.yy" +#line 1001 "DynareBison.yy" {driver.run_olr();;} break; case 376: -#line 1008 "DynareBison.yy" +#line 1002 "DynareBison.yy" {driver.run_olr();;} break; - case 377: -#line 1009 "DynareBison.yy" - {driver.run_olr();;} - break; - - case 382: -#line 1020 "DynareBison.yy" + case 381: +#line 1013 "DynareBison.yy" {driver.set_olr_inst();;} break; - case 383: -#line 1024 "DynareBison.yy" + case 382: +#line 1017 "DynareBison.yy" { driver.run_calib_var(); ;} break; + case 385: +#line 1024 "DynareBison.yy" + {driver.set_calib_var((yysemantic_stack_[(5) - (1)].string_val), (yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].node_val));;} + break; + case 386: -#line 1031 "DynareBison.yy" - {driver.set_calib_var((yysemantic_stack_[(5) - (1)].string_val), (yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].exp_val));;} +#line 1025 "DynareBison.yy" + {driver.set_calib_covar((yysemantic_stack_[(7) - (1)].string_val), (yysemantic_stack_[(7) - (3)].string_val), (yysemantic_stack_[(7) - (4)].string_val), (yysemantic_stack_[(7) - (6)].node_val));;} break; case 387: -#line 1032 "DynareBison.yy" - {driver.set_calib_covar((yysemantic_stack_[(7) - (1)].string_val), (yysemantic_stack_[(7) - (3)].string_val), (yysemantic_stack_[(7) - (4)].string_val), (yysemantic_stack_[(7) - (6)].exp_val));;} +#line 1026 "DynareBison.yy" + {driver.set_calib_ac((yysemantic_stack_[(9) - (2)].string_val), (yysemantic_stack_[(9) - (4)].string_val), (yysemantic_stack_[(9) - (6)].string_val), (yysemantic_stack_[(9) - (8)].node_val));;} break; case 388: -#line 1033 "DynareBison.yy" - {driver.set_calib_ac((yysemantic_stack_[(9) - (2)].string_val), (yysemantic_stack_[(9) - (4)].string_val), (yysemantic_stack_[(9) - (6)].string_val), (yysemantic_stack_[(9) - (8)].exp_val));;} - break; - - case 389: -#line 1036 "DynareBison.yy" +#line 1029 "DynareBison.yy" { (yyval.string_val) = new string("1"); ;} break; + case 389: +#line 1030 "DynareBison.yy" + {(yyval.string_val) = (yysemantic_stack_[(3) - (2)].string_val);;} + break; + case 390: -#line 1037 "DynareBison.yy" +#line 1031 "DynareBison.yy" {(yyval.string_val) = (yysemantic_stack_[(3) - (2)].string_val);;} break; case 391: -#line 1038 "DynareBison.yy" - {(yyval.string_val) = (yysemantic_stack_[(3) - (2)].string_val);;} - break; - - case 392: -#line 1041 "DynareBison.yy" +#line 1034 "DynareBison.yy" {driver.run_calib(0);;} break; - case 393: -#line 1042 "DynareBison.yy" + case 392: +#line 1035 "DynareBison.yy" {driver.run_calib(1);;} break; - case 394: -#line 1045 "DynareBison.yy" + case 393: +#line 1038 "DynareBison.yy" {driver.run_dynatype((yysemantic_stack_[(5) - (3)].string_val));;} break; - case 395: -#line 1046 "DynareBison.yy" + case 394: +#line 1039 "DynareBison.yy" {driver.run_dynatype((yysemantic_stack_[(6) - (3)].string_val));;} break; - case 396: -#line 1047 "DynareBison.yy" + case 395: +#line 1040 "DynareBison.yy" {driver.run_dynatype((yysemantic_stack_[(3) - (2)].string_val));;} break; - case 397: -#line 1048 "DynareBison.yy" + case 396: +#line 1041 "DynareBison.yy" {driver.run_dynatype((yysemantic_stack_[(7) - (3)].string_val), (yysemantic_stack_[(7) - (5)].string_val));;} break; - case 398: -#line 1049 "DynareBison.yy" + case 397: +#line 1042 "DynareBison.yy" {driver.run_dynatype((yysemantic_stack_[(8) - (3)].string_val), (yysemantic_stack_[(8) - (5)].string_val));;} break; - case 399: -#line 1050 "DynareBison.yy" + case 398: +#line 1043 "DynareBison.yy" {driver.run_dynatype((yysemantic_stack_[(5) - (2)].string_val),(yysemantic_stack_[(5) - (4)].string_val));;} break; - case 400: -#line 1052 "DynareBison.yy" + case 399: +#line 1045 "DynareBison.yy" {driver.run_dynasave((yysemantic_stack_[(5) - (3)].string_val));;} break; - case 401: -#line 1053 "DynareBison.yy" + case 400: +#line 1046 "DynareBison.yy" {driver.run_dynasave((yysemantic_stack_[(6) - (3)].string_val));;} break; - case 402: -#line 1054 "DynareBison.yy" + case 401: +#line 1047 "DynareBison.yy" {driver.run_dynasave((yysemantic_stack_[(3) - (2)].string_val));;} break; - case 403: -#line 1055 "DynareBison.yy" + case 402: +#line 1048 "DynareBison.yy" {driver.run_dynasave((yysemantic_stack_[(7) - (3)].string_val), (yysemantic_stack_[(7) - (5)].string_val));;} break; - case 404: -#line 1056 "DynareBison.yy" + case 403: +#line 1049 "DynareBison.yy" {driver.run_dynasave((yysemantic_stack_[(8) - (3)].string_val), (yysemantic_stack_[(8) - (5)].string_val));;} break; - case 405: -#line 1057 "DynareBison.yy" + case 404: +#line 1050 "DynareBison.yy" {driver.run_dynasave((yysemantic_stack_[(5) - (2)].string_val), (yysemantic_stack_[(5) - (4)].string_val));;} break; - case 406: -#line 1060 "DynareBison.yy" + case 405: +#line 1053 "DynareBison.yy" {driver.run_model_comparison();;} break; - case 412: -#line 1072 "DynareBison.yy" + case 411: +#line 1065 "DynareBison.yy" {driver.add_mc_filename((yysemantic_stack_[(1) - (1)].string_val));;} break; - case 413: -#line 1073 "DynareBison.yy" + case 412: +#line 1066 "DynareBison.yy" {driver.add_mc_filename((yysemantic_stack_[(3) - (3)].string_val));;} break; - case 414: -#line 1074 "DynareBison.yy" + case 413: +#line 1067 "DynareBison.yy" {driver.add_mc_filename((yysemantic_stack_[(4) - (1)].string_val), (yysemantic_stack_[(4) - (3)].string_val));;} break; - case 415: -#line 1075 "DynareBison.yy" + case 414: +#line 1068 "DynareBison.yy" {driver.add_mc_filename((yysemantic_stack_[(6) - (3)].string_val), (yysemantic_stack_[(6) - (5)].string_val));;} break; - case 416: -#line 1078 "DynareBison.yy" + case 415: +#line 1071 "DynareBison.yy" {(yyval.string_val) = (yysemantic_stack_[(1) - (1)].string_val);;} break; - case 417: -#line 1079 "DynareBison.yy" + case 416: +#line 1072 "DynareBison.yy" {(yysemantic_stack_[(2) - (1)].string_val)->append(*(yysemantic_stack_[(2) - (2)].string_val)); delete (yysemantic_stack_[(2) - (2)].string_val); (yyval.string_val) = (yysemantic_stack_[(2) - (1)].string_val);;} break; - case 419: -#line 1083 "DynareBison.yy" + case 418: +#line 1076 "DynareBison.yy" { (yyval.string_val) = new string("\\"); ;} break; - case 420: -#line 1084 "DynareBison.yy" + case 419: +#line 1077 "DynareBison.yy" { (yyval.string_val) = new string("/"); ;} break; - case 421: -#line 1085 "DynareBison.yy" + case 420: +#line 1078 "DynareBison.yy" { (yyval.string_val) = new string(":"); ;} break; - case 422: -#line 1086 "DynareBison.yy" + case 421: +#line 1079 "DynareBison.yy" { (yyval.string_val) = new string("."); ;} break; - case 423: -#line 1089 "DynareBison.yy" + case 422: +#line 1082 "DynareBison.yy" { driver.begin_planner_objective(); ;} break; - case 424: -#line 1089 "DynareBison.yy" - { driver.end_planner_objective((yysemantic_stack_[(3) - (3)].model_val)); ;} + case 423: +#line 1082 "DynareBison.yy" + { driver.end_planner_objective((yysemantic_stack_[(3) - (3)].node_val)); ;} + break; + + case 425: +#line 1086 "DynareBison.yy" + {driver.ramsey_policy();;} break; case 426: -#line 1093 "DynareBison.yy" +#line 1088 "DynareBison.yy" {driver.ramsey_policy();;} break; case 427: -#line 1095 "DynareBison.yy" +#line 1090 "DynareBison.yy" {driver.ramsey_policy();;} break; case 428: -#line 1097 "DynareBison.yy" +#line 1092 "DynareBison.yy" {driver.ramsey_policy();;} break; - case 429: -#line 1099 "DynareBison.yy" - {driver.ramsey_policy();;} - break; - - case 434: -#line 1111 "DynareBison.yy" + case 433: +#line 1104 "DynareBison.yy" {driver.option_num("dr_algo", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 435: -#line 1112 "DynareBison.yy" + case 434: +#line 1105 "DynareBison.yy" {driver.option_num("solve_algo", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 436: -#line 1113 "DynareBison.yy" + case 435: +#line 1106 "DynareBison.yy" {driver.option_num("simul_algo", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 437: -#line 1114 "DynareBison.yy" + case 436: +#line 1107 "DynareBison.yy" {driver.linear();;} break; - case 438: -#line 1115 "DynareBison.yy" + case 437: +#line 1108 "DynareBison.yy" {driver.option_num("order", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 439: -#line 1116 "DynareBison.yy" + case 438: +#line 1109 "DynareBison.yy" {driver.option_num("replic", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 440: -#line 1117 "DynareBison.yy" + case 439: +#line 1110 "DynareBison.yy" {driver.option_num("drop", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 441: -#line 1118 "DynareBison.yy" + case 440: +#line 1111 "DynareBison.yy" {driver.option_num("ar", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 442: -#line 1119 "DynareBison.yy" + case 441: +#line 1112 "DynareBison.yy" {driver.option_num("nocorr", "1");;} break; - case 443: -#line 1120 "DynareBison.yy" + case 442: +#line 1113 "DynareBison.yy" {driver.option_num("nofunctions", "1");;} break; - case 444: -#line 1121 "DynareBison.yy" + case 443: +#line 1114 "DynareBison.yy" {driver.option_num("nomoments", "1");;} break; - case 445: -#line 1122 "DynareBison.yy" + case 444: +#line 1115 "DynareBison.yy" {driver.option_num("irf", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 446: -#line 1123 "DynareBison.yy" + case 445: +#line 1116 "DynareBison.yy" {driver.option_num("hp_filter", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 447: -#line 1124 "DynareBison.yy" + case 446: +#line 1117 "DynareBison.yy" {driver.option_num("hp_ngrid", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 448: -#line 1125 "DynareBison.yy" + case 447: +#line 1118 "DynareBison.yy" {driver.option_num("periods", (yysemantic_stack_[(3) - (3)].string_val)); driver.option_num("simul", "1");;} break; - case 449: -#line 1126 "DynareBison.yy" + case 448: +#line 1119 "DynareBison.yy" {driver.option_num("cutoff", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 450: -#line 1127 "DynareBison.yy" + case 449: +#line 1120 "DynareBison.yy" {driver.option_num("simul", "1");;} break; - case 451: -#line 1128 "DynareBison.yy" + case 450: +#line 1121 "DynareBison.yy" { driver.option_num("simul_seed", (yysemantic_stack_[(3) - (3)].string_val));} break; + case 451: +#line 1122 "DynareBison.yy" + { driver.option_num("qz_criterium", (yysemantic_stack_[(3) - (3)].string_val));} + break; + case 452: -#line 1129 "DynareBison.yy" +#line 1123 "DynareBison.yy" { driver.option_num("qz_criterium", (yysemantic_stack_[(3) - (3)].string_val));} break; case 453: -#line 1130 "DynareBison.yy" - { driver.option_num("qz_criterium", (yysemantic_stack_[(3) - (3)].string_val));} - break; - - case 454: -#line 1132 "DynareBison.yy" +#line 1125 "DynareBison.yy" {driver.option_str("datafile", (yysemantic_stack_[(3) - (3)].string_val));;} break; + case 454: +#line 1126 "DynareBison.yy" + {driver.option_num("nobs", (yysemantic_stack_[(3) - (3)].string_val));;} + break; + case 455: -#line 1133 "DynareBison.yy" +#line 1127 "DynareBison.yy" {driver.option_num("nobs", (yysemantic_stack_[(3) - (3)].string_val));;} break; case 456: -#line 1134 "DynareBison.yy" - {driver.option_num("nobs", (yysemantic_stack_[(3) - (3)].string_val));;} - break; - - case 457: -#line 1136 "DynareBison.yy" +#line 1129 "DynareBison.yy" {driver.option_num("first_obs", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 458: -#line 1137 "DynareBison.yy" + case 457: +#line 1130 "DynareBison.yy" {driver.option_num("prefilter", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 459: -#line 1138 "DynareBison.yy" + case 458: +#line 1131 "DynareBison.yy" {driver.option_num("presample", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 460: -#line 1139 "DynareBison.yy" + case 459: +#line 1132 "DynareBison.yy" {driver.option_num("lik_algo", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 461: -#line 1140 "DynareBison.yy" + case 460: +#line 1133 "DynareBison.yy" {driver.option_num("lik_init", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 462: -#line 1141 "DynareBison.yy" + case 461: +#line 1134 "DynareBison.yy" {driver.option_num("nograph","1");;} break; - case 463: -#line 1142 "DynareBison.yy" + case 462: +#line 1135 "DynareBison.yy" {driver.option_num("nograph", "0");;} break; - case 464: -#line 1143 "DynareBison.yy" + case 463: +#line 1136 "DynareBison.yy" {driver.option_num("conf_sig", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 465: -#line 1144 "DynareBison.yy" + case 464: +#line 1137 "DynareBison.yy" {driver.option_num("mh_replic", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 466: -#line 1145 "DynareBison.yy" + case 465: +#line 1138 "DynareBison.yy" {driver.option_num("mh_drop", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 467: -#line 1146 "DynareBison.yy" + case 466: +#line 1139 "DynareBison.yy" {driver.option_num("mh_jscale", (yysemantic_stack_[(3) - (3)].string_val));;} break; + case 468: +#line 1141 "DynareBison.yy" + {driver.option_num("mh_init_scale", (yysemantic_stack_[(3) - (3)].string_val));;} + break; + case 469: -#line 1148 "DynareBison.yy" +#line 1142 "DynareBison.yy" {driver.option_num("mh_init_scale", (yysemantic_stack_[(3) - (3)].string_val));;} break; case 470: -#line 1149 "DynareBison.yy" - {driver.option_num("mh_init_scale", (yysemantic_stack_[(3) - (3)].string_val));;} - break; - - case 471: -#line 1150 "DynareBison.yy" +#line 1143 "DynareBison.yy" {driver.option_str("mode_file", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 472: -#line 1151 "DynareBison.yy" + case 471: +#line 1144 "DynareBison.yy" {driver.option_num("mode_compute", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 473: -#line 1152 "DynareBison.yy" + case 472: +#line 1145 "DynareBison.yy" {driver.option_num("mode_check", "1");;} break; - case 474: -#line 1153 "DynareBison.yy" + case 473: +#line 1146 "DynareBison.yy" {driver.option_num("prior_trunc", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 475: -#line 1154 "DynareBison.yy" + case 474: +#line 1147 "DynareBison.yy" {driver.option_num("mh_mode", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 476: -#line 1155 "DynareBison.yy" + case 475: +#line 1148 "DynareBison.yy" {driver.option_num("mh_nblck", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 477: -#line 1156 "DynareBison.yy" + case 476: +#line 1149 "DynareBison.yy" {driver.option_num("load_mh_file", "1");;} break; - case 478: -#line 1157 "DynareBison.yy" + case 477: +#line 1150 "DynareBison.yy" {driver.option_num("loglinear", "1");;} break; - case 479: -#line 1158 "DynareBison.yy" + case 478: +#line 1151 "DynareBison.yy" {driver.option_num("nodiagnostic", "1");;} break; - case 480: -#line 1159 "DynareBison.yy" + case 479: +#line 1152 "DynareBison.yy" {driver.option_num("bayesian_irf", "1");;} break; - case 481: -#line 1160 "DynareBison.yy" + case 480: +#line 1153 "DynareBison.yy" {driver.option_num("TeX", "1");;} break; - case 482: -#line 1161 "DynareBison.yy" + case 481: +#line 1154 "DynareBison.yy" {driver.option_num("forecast", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 483: -#line 1162 "DynareBison.yy" + case 482: +#line 1155 "DynareBison.yy" {driver.option_num("smoother", "1");;} break; - case 484: -#line 1163 "DynareBison.yy" + case 483: +#line 1156 "DynareBison.yy" {driver.option_num("moments_varendo", "1");;} break; - case 485: -#line 1164 "DynareBison.yy" + case 484: +#line 1157 "DynareBison.yy" {driver.option_num("filtered_vars", "1");;} break; - case 486: -#line 1165 "DynareBison.yy" + case 485: +#line 1158 "DynareBison.yy" {driver.option_num("relative_irf", "1");;} break; - case 487: -#line 1166 "DynareBison.yy" + case 486: +#line 1159 "DynareBison.yy" {driver.option_num("kalman_algo", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 488: -#line 1167 "DynareBison.yy" + case 487: +#line 1160 "DynareBison.yy" {driver.option_num("kalman_tol", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 489: -#line 1168 "DynareBison.yy" + case 488: +#line 1161 "DynareBison.yy" {driver.option_num("olr_beta", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 490: -#line 1171 "DynareBison.yy" + case 489: +#line 1164 "DynareBison.yy" { driver.option_str("model_comparison_approximation", "Laplace"); ;} break; - case 491: -#line 1173 "DynareBison.yy" + case 490: +#line 1166 "DynareBison.yy" { driver.option_str("model_comparison_approximation", "MODIFIEDHARMONICMEAN"); ;} break; - case 492: -#line 1175 "DynareBison.yy" + case 491: +#line 1168 "DynareBison.yy" {driver.option_num("noprint", "0");;} break; - case 493: -#line 1176 "DynareBison.yy" + case 492: +#line 1169 "DynareBison.yy" {driver.option_num("noprint", "1");;} break; - case 494: -#line 1177 "DynareBison.yy" + case 493: +#line 1170 "DynareBison.yy" {driver.option_str("xls_sheet", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 495: -#line 1178 "DynareBison.yy" + case 494: +#line 1171 "DynareBison.yy" {driver.option_str("xls_range", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 496: -#line 1179 "DynareBison.yy" + case 495: +#line 1172 "DynareBison.yy" {driver.option_num("filter_step_ahead", (yysemantic_stack_[(3) - (3)].string_val));;} break; - case 497: -#line 1180 "DynareBison.yy" + case 496: +#line 1173 "DynareBison.yy" {driver.option_num("noconstant", "0");;} break; - case 498: -#line 1181 "DynareBison.yy" + case 497: +#line 1174 "DynareBison.yy" {driver.option_num("noconstant", "1");;} break; - case 499: -#line 1182 "DynareBison.yy" + case 498: +#line 1175 "DynareBison.yy" {driver.option_num("load_mh_file", "-1");;} break; - case 500: -#line 1183 "DynareBison.yy" + case 499: +#line 1176 "DynareBison.yy" {driver.option_num("planner_discount",(yysemantic_stack_[(3) - (3)].string_val));;} break; - case 501: -#line 1186 "DynareBison.yy" + case 500: +#line 1179 "DynareBison.yy" { (yysemantic_stack_[(3) - (1)].string_val)->append(":"); (yysemantic_stack_[(3) - (1)].string_val)->append(*(yysemantic_stack_[(3) - (3)].string_val)); @@ -2112,18 +2132,18 @@ namespace yy ;} break; - case 503: -#line 1195 "DynareBison.yy" + case 502: +#line 1188 "DynareBison.yy" { (yysemantic_stack_[(3) - (1)].string_val)->append(":"); (yysemantic_stack_[(3) - (1)].string_val)->append(*(yysemantic_stack_[(3) - (3)].string_val)); delete (yysemantic_stack_[(3) - (3)].string_val); (yyval.string_val) = (yysemantic_stack_[(3) - (1)].string_val); ;} break; - case 504: -#line 1198 "DynareBison.yy" + case 503: +#line 1191 "DynareBison.yy" { (yysemantic_stack_[(2) - (2)].string_val)->insert(0, "["); (yyval.string_val) = (yysemantic_stack_[(2) - (2)].string_val);;} break; - case 505: -#line 1200 "DynareBison.yy" + case 504: +#line 1193 "DynareBison.yy" { (yysemantic_stack_[(2) - (1)].string_val)->append(" "); (yysemantic_stack_[(2) - (1)].string_val)->append(*(yysemantic_stack_[(2) - (2)].string_val)); @@ -2132,14 +2152,14 @@ namespace yy ;} break; - case 506: -#line 1208 "DynareBison.yy" + case 505: +#line 1201 "DynareBison.yy" { (yysemantic_stack_[(2) - (1)].string_val)->append("]"); (yyval.string_val) = (yysemantic_stack_[(2) - (1)].string_val); ;} break; /* Line 675 of lalr1.cc. */ -#line 2143 "DynareBison.cc" +#line 2163 "DynareBison.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); @@ -2346,115 +2366,114 @@ namespace yy /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const short int parser::yypact_ninf_ = -911; + const short int parser::yypact_ninf_ = -887; const short int parser::yypact_[] = { - 964, 185, -38, 411, 268, 35, -6, 62, -23, 117, - -10, 81, 114, 119, 475, 478, -34, 148, 105, 166, - 158, 225, 189, 160, 225, 291, 99, -911, 214, 344, - 225, 371, 400, 505, 538, 187, 209, 225, 462, 468, - 474, 225, 658, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, 535, 52, -911, - 479, 552, 441, 12, 108, 527, 430, 533, 543, 577, - -911, 772, 164, 40, 208, 219, 560, 543, 576, -911, - 289, 226, 53, 243, 569, -911, 1088, 261, 262, 572, - -911, 1088, 263, 276, 493, 303, 616, 494, 829, 250, - 250, 337, 53, 507, -911, 570, -911, 479, -911, 1133, - 373, -911, 1018, 379, 380, 548, 386, 559, 389, 574, - 390, 392, -911, -911, 540, 612, -16, 439, -911, 673, - -33, -911, -911, 561, -911, 562, -911, -911, 628, 277, - -911, 639, 299, 686, 58, -911, 643, -911, 692, -911, - 694, 696, -911, 697, 701, -911, 702, 703, 705, 712, - 713, -911, -911, 718, 720, 726, 727, 729, 732, -911, - -911, 733, 734, -911, 743, -911, -911, -911, 747, 749, - 750, 751, -911, -911, 761, 765, -31, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, 773, 707, -911, - 728, -911, 730, 193, -911, 678, 737, 681, 740, 205, - -911, 741, 685, 744, 207, -911, 662, 61, -911, 64, - 795, 668, 753, -911, -9, 695, 706, 825, -911, -911, - 138, -911, -911, -911, -911, 784, 789, 91, -911, -911, - -911, 715, 243, 243, 717, 719, 721, 724, 725, 735, - 745, 752, 754, 756, 243, 602, 757, 251, -911, 833, - 836, 839, 845, 853, 854, -911, -911, -911, 859, 860, - 876, 877, -911, 889, -911, 895, 897, -911, -911, 145, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, 566, 369, 172, -911, -911, -911, 810, - 858, -911, 779, -911, -911, -911, 783, 829, 829, 785, - 796, 797, 798, 799, 800, 802, 804, 805, 808, 829, - 541, -911, 173, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, 175, -911, 93, - 29, 266, -911, -911, 279, -911, -911, 385, -911, -911, - 911, -911, 401, -911, -911, -911, -911, -911, 844, 891, - -911, -911, 846, 905, -911, -911, 861, 906, -911, -911, - 831, 835, 912, 425, 973, -911, -911, 946, 479, 849, - -911, -911, 850, -14, 931, 856, -1, 933, 243, -911, - -911, -911, 971, 941, 864, 978, 979, 981, 983, 984, - 985, 990, 991, 517, 1005, 997, 998, 999, 1000, 977, - 6, 892, 1006, 1008, 1023, 989, 993, 772, 54, 994, - 1046, 944, -911, -911, -911, 60, 945, 184, 947, -911, - -911, 950, 184, 952, -911, -911, 19, -911, -911, -911, - 1003, 930, 1011, 30, -911, 23, -911, 43, -911, 934, - 939, 239, 226, -21, 956, 49, -911, -911, 243, 957, - -49, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 635, 243, 243, 243, 243, 243, -911, 243, -911, - -911, 1058, 1061, 1060, 1065, 1067, 1072, 184, 1077, 1079, - 531, 1087, 1089, 1093, 1088, 112, 1055, 1194, -911, 803, - 218, -911, 1014, -911, 19, 1013, 465, 829, 829, 829, - 829, 829, 829, 829, 829, 829, 829, 709, 829, 829, - 829, 829, 829, 986, 250, 236, 252, -911, -911, -911, - 243, 341, 59, 570, 988, 479, 1009, 1133, 260, 1111, - 1018, 273, -911, 1031, -911, 1033, -911, 1040, -911, 1116, - 1015, 1010, 1016, 243, -911, -911, -911, -911, -911, 393, - 1017, -911, -911, 398, 1027, 1201, -911, -911, 1118, 4, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, 1032, - -911, -911, -911, -911, 1021, -911, -911, -911, 428, -911, - 1097, 1100, -911, -911, -911, -911, -911, -911, -911, -911, - 532, 1041, 1063, 1068, 1131, 1076, 184, 1135, 1057, 184, - -911, 1173, 1175, 1066, -911, 543, 1185, -911, -911, -911, - 829, -911, -911, -911, 404, -911, -911, 1070, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -30, 274, - -911, 1152, 243, 1158, -25, 663, 408, 722, 781, 794, - 865, 879, 885, 968, 982, 1012, 1024, -911, -49, -49, - 957, 957, 1101, 1052, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, -911, -911, - 440, 243, -911, 1160, 1207, -911, 452, -911, 1084, 1069, - 1083, 1096, 1114, 1121, 1127, 1134, 1141, 1147, 1154, -911, - 465, 465, 1013, 1013, 1101, -911, -911, -911, 456, -911, - 477, 1161, 29, 1090, -911, -911, 57, 243, -911, -911, - -911, -911, -911, -911, 487, -911, -911, -911, 488, -911, - -911, -911, 1094, 1229, -911, -911, 1217, -911, 286, -911, - 288, -911, 1105, -911, -911, -911, 1191, -911, 414, 1198, - -911, -911, -911, -911, -911, -911, 184, 60, 1214, 184, - 1215, 1216, -911, 1138, -911, -911, 1257, 375, 829, 1225, - 43, -911, 753, 753, 753, -21, -911, 184, -911, 1277, - 1231, 1284, 1307, 243, 243, -911, 243, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, 1171, -911, - 1240, 243, -911, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -911, 59, -911, - -911, -911, 243, 1167, -911, -911, 1015, 243, -911, -911, - 530, -911, 564, 1310, 1206, 1032, -911, -911, -911, 1238, - 1239, 1245, 184, 1178, 184, 184, -911, 243, -911, 1249, - -911, -911, 1224, 56, 213, 482, 335, 1235, 243, -911, - 243, 1222, 28, 1255, 787, 787, -911, -911, 1263, 1174, - -911, 1365, 1273, -911, -911, -911, 1268, -911, 184, 184, - 184, 1270, -911, 1248, 1250, 1279, -911, 753, -911, -911, - -911, 184, -911, 1286, 1297, 1369, 1264, 1378, 1301, -911, - -911, -911, 243, -911, 18, 1295, -911, 1311, 184, -911, - -911, -911, 512, 1272, -911, -911, -911, 1389, 1285, 74, - 1304, 1370, -911, 184, 217, 1291, -911, -911, -911, 1400, - -911, -911, 539, 542, 243, 72, -911, -911, -911, 1287, - 1316, 1318, -911, -911, -911, -911, 1181, -911, -911, 243, - -911, -911, -911, 184, 184, -911, 1187, 1319, -911, -911, - 184, -911 + 990, 436, -96, 452, 365, 46, -17, -15, -29, 164, + 5, 81, 107, 142, 458, 482, 206, 210, 352, 242, + 186, 327, 258, 188, 327, 343, 237, -887, 265, 270, + 327, 274, 430, 496, 514, 193, 195, 327, 374, 392, + 424, 327, 647, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, 501, 262, -887, + 413, 490, 375, 36, 126, 472, 140, 474, 494, 541, + -887, 761, -9, 144, 203, 216, 505, 494, 551, -887, + 348, 19, 96, 558, 512, -887, 1114, 162, 232, 518, + -887, 1114, 236, 260, 479, 264, 555, 454, 855, 797, + 797, 298, 96, 456, -887, 535, -887, 413, -887, 1159, + 308, -887, 1044, 311, 313, 522, 318, 524, 337, 526, + 359, 369, -887, -887, 492, 583, -28, 60, -887, 635, + 278, -887, -887, 519, -887, 531, -887, -887, 613, -32, + -887, 619, 136, 666, 45, -887, 621, -887, 678, -887, + 686, 690, -887, 691, 698, -887, 700, 702, 706, 709, + 715, -887, -887, 716, 721, 722, 723, 732, 736, -887, + -887, 738, 739, -887, 740, -887, -887, -887, 750, 758, + 765, 770, -887, -887, 772, 773, 385, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, 776, 696, -887, + 734, -887, 755, 67, -887, 699, 759, 712, 766, 255, + -887, 774, 713, 779, 259, -887, 692, 54, -887, 55, + 818, 694, 742, -887, 386, 703, 733, 824, -887, -887, + 401, -887, -887, -887, -887, 780, 781, 71, -887, -887, + -887, 701, 558, 558, 710, 714, 743, 745, 747, 748, + 751, 752, 754, 767, 558, 521, 768, 57, -887, 840, + 843, 865, 866, 877, 892, -887, -887, -887, 896, 897, + 900, 913, -887, 914, -887, 924, 925, -887, -887, 405, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, 805, 61, 407, -887, -887, -887, 819, + 881, -887, 802, -887, -887, -887, 804, 855, 855, 809, + 810, 811, 812, 826, 829, 831, 834, 835, 836, 855, + 729, -887, 408, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, 409, -887, 90, + 24, 414, -887, -887, 420, -887, -887, 422, -887, -887, + 929, -887, 427, -887, -887, -887, -887, -887, 872, 931, + -887, -887, 886, 933, -887, -887, 898, 937, -887, -887, + 858, 861, 953, 52, 1001, -887, -887, 984, 413, 879, + -887, -887, 880, -22, 957, 882, 32, 967, 558, -887, + -887, -887, 1012, 976, 894, 1005, 1009, 1010, 1011, 1016, + 1022, 1023, 1017, 360, 1033, 1025, 1026, 1027, 1031, 1004, + 7, 934, 1034, 1040, 1056, 1020, 1028, 761, 73, 1029, + 1072, 970, -887, -887, -887, 63, 973, 233, 978, -887, + -887, 979, 233, 980, -887, -887, 20, -887, -887, -887, + 1039, 960, 1045, 30, -887, 23, -887, 102, -887, 966, + 983, 217, 19, 226, 993, 34, -887, -887, 558, 995, + 468, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 493, 558, 558, 558, 558, 558, -887, 558, -887, + -887, 1061, 1093, 1098, 1103, 1105, 1113, 233, 1115, 1119, + 361, 1120, 1128, 1130, 1114, 190, 1065, 575, -887, 830, + 208, -887, 1035, -887, 20, 1042, 530, 855, 855, 855, + 855, 855, 855, 855, 855, 855, 855, 506, 855, 855, + 855, 855, 855, 1006, 797, 221, 223, -887, -887, -887, + 558, 341, 62, 535, 1014, 413, 1032, 1159, 225, 1151, + 1044, 227, -887, 1057, -887, 1069, -887, 1070, -887, 1146, + 1041, 1043, 1049, 558, -887, -887, -887, -887, -887, 377, + 1053, -887, -887, 379, 1063, 1187, -887, -887, 1152, 4, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, 1036, + -887, -887, -887, -887, 1062, -887, -887, -887, 380, -887, + 1126, 1157, -887, -887, -887, -887, -887, -887, -887, -887, + 362, 1067, 1094, 1102, 1161, 1106, 233, 1165, 1091, 233, + -887, 1201, 1202, 1096, -887, 494, 1222, -887, -887, -887, + 855, -887, -887, -887, 429, -887, -887, 1104, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -36, -19, + -887, 1186, 558, 1190, 197, 845, 431, 549, 590, 624, + 650, 657, 778, 784, 798, 891, 905, -887, 468, 468, + 995, 995, 1129, 911, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + 381, 558, -887, 1196, 1193, -887, 389, -887, 1127, 994, + 1008, 1038, 1050, 1078, 1095, 1109, 1122, 1140, 1147, -887, + 530, 530, 1042, 1042, 1129, -887, -887, -887, 390, -887, + 395, 1153, 24, 1135, -887, -887, 27, 558, -887, -887, + -887, -887, -887, -887, 423, -887, -887, -887, 428, -887, + -887, -887, 1142, 1263, -887, -887, 1200, -887, 229, -887, + 376, -887, 1118, -887, -887, -887, 1237, -887, 444, 1244, + -887, -887, -887, -887, -887, -887, 233, 63, 1207, 233, + 1208, 1209, -887, 1177, -887, -887, 1314, 199, 855, 1211, + 102, -887, 742, 742, 742, 226, -887, 233, -887, 1321, + 1218, 1332, 1316, 558, 558, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, 1210, -887, 1224, 558, + -887, -887, -887, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, 62, -887, -887, -887, + 558, 1160, -887, -887, 1041, 558, -887, -887, 435, -887, + 440, 1317, 1212, 1036, -887, -887, -887, 1239, 1253, 1255, + 233, 1233, 233, 233, -887, 558, -887, 1234, -887, -887, + 1241, 59, 182, 213, 150, 1252, 558, -887, 558, 1235, + 80, 1242, 845, -887, -887, 1248, 1167, -887, 1369, 1257, + -887, -887, -887, 1279, -887, 233, 233, 233, 1285, -887, + 1264, 1265, 1266, -887, 742, -887, -887, -887, 233, -887, + 1272, 1280, 1375, 1270, 1383, 1306, -887, -887, -887, 558, + -887, 17, 1300, -887, 1301, 233, -887, -887, -887, 478, + 1277, -887, -887, -887, 1389, 1278, 74, 1290, 1363, -887, + 233, 183, 1284, -887, -887, -887, 1393, -887, -887, 367, + 510, 558, 77, -887, -887, -887, 1281, 1309, 1310, -887, + -887, -887, -887, 1173, -887, -887, 558, -887, -887, -887, + 233, 233, -887, 1180, 1312, -887, -887, 233, -887 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -2465,134 +2484,133 @@ namespace yy { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 422, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 28, 29, 43, 44, 45, 42, 5, 6, 11, 8, 9, 10, 7, 12, 13, 14, 15, 16, 17, 18, 22, 24, 23, 19, 20, 21, 25, 26, 27, 30, 31, 32, 37, 38, 33, - 34, 35, 36, 39, 40, 41, 392, 0, 0, 203, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, - 290, 0, 0, 0, 0, 0, 0, 0, 0, 123, - 0, 0, 0, 0, 0, 374, 0, 0, 0, 0, - 370, 0, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 208, 0, 198, 0, 213, 0, - 0, 426, 0, 0, 0, 55, 0, 61, 0, 67, - 0, 0, 1, 3, 0, 0, 389, 0, 385, 0, - 0, 206, 207, 0, 79, 0, 46, 402, 0, 0, - 396, 0, 0, 0, 0, 112, 0, 480, 0, 497, - 0, 0, 485, 0, 0, 463, 0, 0, 0, 0, - 0, 477, 478, 0, 0, 0, 0, 0, 0, 499, - 473, 0, 0, 484, 0, 498, 479, 462, 0, 0, - 0, 0, 483, 481, 0, 0, 0, 295, 331, 320, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 332, 333, 334, 239, 0, 292, - 0, 256, 0, 0, 253, 0, 0, 0, 0, 0, - 275, 0, 0, 0, 0, 269, 0, 0, 116, 0, - 0, 0, 0, 437, 0, 0, 0, 0, 493, 492, - 0, 408, 409, 410, 411, 0, 0, 0, 166, 84, + 34, 35, 36, 39, 40, 41, 391, 0, 0, 202, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 242, + 289, 0, 0, 0, 0, 0, 0, 0, 0, 122, + 0, 0, 0, 0, 0, 373, 0, 0, 0, 0, + 369, 0, 0, 0, 73, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 207, 0, 197, 0, 212, 0, + 0, 425, 0, 0, 0, 55, 0, 61, 0, 67, + 0, 0, 1, 3, 0, 0, 388, 0, 384, 0, + 0, 205, 206, 0, 79, 0, 46, 401, 0, 0, + 395, 0, 0, 0, 0, 111, 0, 479, 0, 496, + 0, 0, 484, 0, 0, 462, 0, 0, 0, 0, + 0, 476, 477, 0, 0, 0, 0, 0, 0, 498, + 472, 0, 0, 483, 0, 497, 478, 461, 0, 0, + 0, 0, 482, 480, 0, 0, 0, 294, 330, 319, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 331, 332, 333, 238, 0, 291, + 0, 255, 0, 0, 252, 0, 0, 0, 0, 0, + 274, 0, 0, 0, 0, 268, 0, 0, 115, 0, + 0, 0, 0, 436, 0, 0, 0, 0, 492, 491, + 0, 407, 408, 409, 410, 0, 0, 0, 165, 84, 85, 83, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, - 0, 0, 0, 0, 0, 442, 443, 444, 0, 0, - 0, 0, 486, 0, 450, 0, 0, 379, 380, 0, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 232, 233, 234, 235, 236, 237, 238, 231, - 378, 376, 382, 0, 0, 0, 372, 369, 76, 71, - 0, 52, 0, 77, 141, 142, 161, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 360, 0, + 0, 0, 0, 0, 0, 441, 442, 443, 0, 0, + 0, 0, 485, 0, 449, 0, 0, 378, 379, 0, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 231, 232, 233, 234, 235, 236, 237, 230, + 377, 375, 381, 0, 0, 0, 371, 368, 76, 71, + 0, 52, 0, 77, 140, 141, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 424, 140, 0, 338, 343, 339, 340, 341, 342, 344, - 345, 346, 347, 348, 349, 350, 351, 0, 48, 0, - 0, 0, 211, 212, 0, 201, 202, 0, 218, 215, - 0, 432, 0, 431, 433, 428, 363, 58, 53, 0, - 49, 64, 59, 0, 50, 70, 65, 0, 51, 358, - 0, 0, 0, 0, 0, 383, 384, 0, 0, 0, - 80, 47, 0, 0, 0, 0, 0, 0, 0, 110, - 111, 244, 0, 0, 0, 0, 0, 0, 0, 0, + 423, 139, 0, 337, 342, 338, 339, 340, 341, 343, + 344, 345, 346, 347, 348, 349, 350, 0, 48, 0, + 0, 0, 210, 211, 0, 200, 201, 0, 217, 214, + 0, 431, 0, 430, 432, 427, 362, 58, 53, 0, + 49, 64, 59, 0, 50, 70, 65, 0, 51, 357, + 0, 0, 0, 0, 0, 382, 383, 0, 0, 0, + 80, 47, 0, 0, 0, 0, 0, 0, 0, 109, + 110, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 241, 0, 255, 251, 252, 284, 0, 284, 0, 273, - 274, 0, 284, 0, 267, 268, 0, 114, 115, 107, - 0, 0, 0, 0, 135, 0, 136, 0, 131, 0, - 0, 0, 0, 0, 0, 0, 164, 165, 0, 91, + 240, 0, 254, 250, 251, 283, 0, 283, 0, 272, + 273, 0, 283, 0, 266, 267, 0, 113, 114, 106, + 0, 0, 0, 0, 134, 0, 135, 0, 130, 0, + 0, 0, 0, 0, 0, 0, 163, 164, 0, 91, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 0, 359, - 360, 0, 0, 0, 0, 0, 0, 284, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 364, 0, - 0, 74, 72, 78, 0, 148, 149, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 81, 0, 358, + 359, 0, 0, 0, 0, 0, 0, 283, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 363, 0, + 0, 74, 72, 78, 0, 147, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 163, 196, 197, - 0, 0, 188, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 56, 54, 62, 60, 68, 66, 393, 0, - 389, 0, 0, 0, 435, 205, 204, 405, 400, 0, - 0, 399, 394, 0, 0, 0, 464, 454, 0, 0, - 496, 457, 482, 445, 487, 488, 460, 461, 466, 469, - 470, 467, 475, 476, 465, 472, 471, 456, 455, 0, - 458, 459, 474, 494, 0, 495, 294, 291, 0, 240, - 0, 0, 279, 286, 280, 285, 282, 287, 281, 283, - 0, 0, 0, 261, 0, 0, 284, 0, 0, 284, - 247, 0, 0, 0, 109, 0, 0, 124, 133, 134, - 0, 138, 121, 120, 0, 119, 122, 0, 127, 125, - 490, 491, 407, 418, 420, 421, 422, 419, 0, 412, - 416, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 162, 195, 196, + 0, 0, 187, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 56, 54, 62, 60, 68, 66, 392, 0, + 388, 0, 0, 0, 434, 204, 203, 404, 399, 0, + 0, 398, 393, 0, 0, 0, 463, 453, 0, 0, + 495, 456, 481, 444, 486, 487, 459, 460, 465, 468, + 469, 466, 474, 475, 464, 471, 470, 455, 454, 0, + 457, 458, 473, 493, 0, 494, 293, 290, 0, 239, + 0, 0, 278, 285, 279, 284, 281, 286, 280, 282, + 0, 0, 0, 260, 0, 0, 283, 0, 0, 283, + 246, 0, 0, 0, 108, 0, 0, 123, 132, 133, + 0, 137, 120, 119, 0, 118, 121, 0, 126, 124, + 489, 490, 406, 417, 419, 420, 421, 418, 0, 411, + 415, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 87, 86, - 88, 89, 90, 0, 441, 449, 434, 440, 446, 447, - 489, 438, 448, 453, 452, 439, 436, 451, 381, 375, - 0, 0, 367, 0, 0, 371, 0, 75, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, - 144, 143, 145, 146, 147, 425, 337, 335, 0, 352, - 0, 0, 0, 0, 193, 194, 0, 0, 210, 209, - 200, 199, 217, 214, 0, 500, 430, 427, 0, 57, - 63, 69, 0, 0, 391, 390, 0, 401, 0, 395, - 0, 113, 502, 504, 506, 505, 0, 356, 0, 0, - 293, 242, 257, 289, 288, 254, 284, 284, 0, 284, - 0, 0, 272, 0, 246, 245, 0, 0, 0, 0, - 0, 129, 0, 0, 0, 0, 406, 284, 417, 0, - 0, 0, 0, 0, 0, 103, 0, 104, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 0, 377, - 0, 0, 365, 373, 162, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 336, 353, 195, 187, 186, - 190, 191, 0, 0, 216, 429, 389, 0, 386, 403, - 0, 397, 0, 0, 0, 0, 468, 501, 258, 0, - 0, 0, 284, 0, 284, 284, 270, 0, 108, 0, - 137, 118, 0, 0, 0, 0, 413, 0, 0, 169, - 0, 177, 0, 0, 105, 106, 362, 368, 0, 0, - 192, 0, 0, 404, 398, 503, 0, 357, 284, 284, - 284, 0, 278, 0, 0, 0, 160, 0, 132, 128, - 126, 284, 414, 0, 0, 0, 172, 0, 0, 168, - 366, 189, 0, 387, 284, 263, 259, 262, 284, 276, - 271, 117, 0, 0, 171, 170, 176, 0, 174, 0, - 0, 0, 355, 284, 0, 0, 130, 415, 173, 0, - 250, 183, 0, 0, 0, 0, 182, 181, 388, 0, - 264, 0, 277, 175, 249, 248, 0, 180, 167, 0, - 179, 178, 354, 284, 284, 185, 0, 265, 260, 184, - 284, 266 + 88, 89, 90, 0, 440, 448, 433, 439, 445, 446, + 488, 437, 447, 452, 451, 438, 435, 450, 380, 374, + 0, 0, 366, 0, 0, 370, 0, 75, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, + 143, 142, 144, 145, 146, 424, 336, 334, 0, 351, + 0, 0, 0, 0, 192, 193, 0, 0, 209, 208, + 199, 198, 216, 213, 0, 499, 429, 426, 0, 57, + 63, 69, 0, 0, 390, 389, 0, 400, 0, 394, + 0, 112, 501, 503, 505, 504, 0, 355, 0, 0, + 292, 241, 256, 288, 287, 253, 283, 283, 0, 283, + 0, 0, 271, 0, 245, 244, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 405, 283, 416, 0, + 0, 0, 0, 0, 0, 103, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 0, 376, 0, 0, + 364, 372, 161, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 335, 352, 194, 186, 185, 189, 190, + 0, 0, 215, 428, 388, 0, 385, 402, 0, 396, + 0, 0, 0, 0, 467, 500, 257, 0, 0, 0, + 283, 0, 283, 283, 269, 0, 107, 0, 136, 117, + 0, 0, 0, 0, 412, 0, 0, 168, 0, 176, + 0, 0, 105, 361, 367, 0, 0, 191, 0, 0, + 403, 397, 502, 0, 356, 283, 283, 283, 0, 277, + 0, 0, 0, 159, 0, 131, 127, 125, 283, 413, + 0, 0, 0, 171, 0, 0, 167, 365, 188, 0, + 386, 283, 262, 258, 261, 283, 275, 270, 116, 0, + 0, 170, 169, 175, 0, 173, 0, 0, 0, 354, + 283, 0, 0, 129, 414, 172, 0, 249, 182, 0, + 0, 0, 0, 181, 180, 387, 0, 263, 0, 276, + 174, 248, 247, 0, 179, 166, 0, 178, 177, 353, + 283, 283, 184, 0, 264, 259, 183, 283, 265 }; /* YYPGOTO[NTERM-NUM]. */ const short int parser::yypgoto_[] = { - -911, -911, 1405, -911, -911, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -911, -911, -296, -911, -911, - -911, -911, -102, -172, -911, -911, 1172, -911, 598, -911, - -911, -911, -911, -911, -911, -779, -494, -108, -488, -911, - -911, -911, 1320, -253, -911, -911, -911, -911, 659, -911, - -911, 851, -911, -911, 1002, -911, -911, 852, -911, -911, - -100, -20, -520, 442, -911, -911, 1195, -911, -911, -910, - -911, -911, 1180, -911, -911, 1190, -794, -471, -911, -911, - 974, -911, 1330, 868, -911, 549, -911, -911, -911, -911, - 1146, -911, -911, -911, -911, -911, -911, 901, 1345, -911, - -911, -911, 1312, -584, -911, -911, -911, -911, -911, 948, - -911, 613, -678, -911, -911, -911, -911, -911, 857, -911, - -79, -911, 1361, -911, -911, -911, -911, -911, -911, -911, - -92, -911, -911, -112, -477, -911, -911, -911, -911, -911, - -911, -911, -911, -911, -911, -93, -89, -911, -911, -911, - -911, -911, -911, -911, -911, -88, -911, -911, -911, -911, - -911, -87, -74, -73, -72, -71, -69, -911, -911, -911, - -911, -911, -911, -911, -68, -67, -66, -911, -911, -911, - -911, -911, 834, -911, 992 + -887, -887, 1398, -887, -887, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -887, -887, -296, -887, -887, + -887, -887, -102, -172, -887, -887, 1164, -887, 592, -887, + -887, -887, -887, -887, -887, -780, -501, -108, -491, -887, + -887, -887, 1311, -234, -887, -887, -887, -887, 652, -887, + -887, 841, -887, -887, 997, -887, -887, 844, -887, -887, + -116, -20, -561, 437, -887, -887, 1185, -887, -887, -886, + -887, -887, 1176, -887, -887, 1182, -793, -468, -887, -887, + 965, -887, 1323, 860, -887, 542, -887, -887, -887, -887, + 1139, -887, -887, -887, -887, -887, -887, 893, 1337, -887, + -887, -887, 1302, -578, -887, -887, -887, -887, -887, 938, + -887, 606, -676, -887, -887, -887, -887, -887, 852, -887, + -82, -887, 1353, -887, -887, -887, -887, -887, -887, -887, + -92, -887, -887, -124, -477, -887, -887, -887, -887, -887, + -887, -887, -887, -887, -887, -87, -77, -887, -887, -887, + -887, -887, -887, -887, -887, -76, -887, -887, -887, -887, + -887, -73, -71, -70, -69, -68, -66, -887, -887, -887, + -887, -887, -887, -887, -65, -62, -60, -887, -887, -887, + -887, -887, 825, -887, 985 }; /* YYDEFGOTO[NTERM-NUM]. */ @@ -2602,11 +2620,11 @@ namespace yy -1, 42, 43, 44, 45, 46, 47, 48, 49, 50, 146, 148, 150, 125, 51, 52, 53, 315, 726, 54, 281, 55, 174, 175, 56, 277, 278, 704, 705, 57, - 282, 854, 853, 932, 707, 513, 514, 515, 516, 391, - 58, 59, 297, 298, 942, 1015, 60, 601, 602, 61, + 282, 854, 853, 930, 707, 513, 514, 515, 516, 391, + 58, 59, 297, 298, 940, 1012, 60, 601, 602, 61, 414, 415, 62, 160, 161, 63, 411, 412, 64, 417, - 337, 102, 693, 1017, 65, 263, 264, 265, 681, 918, - 66, 274, 275, 67, 269, 270, 682, 919, 68, 216, + 337, 102, 693, 1014, 65, 263, 264, 265, 681, 916, + 66, 274, 275, 67, 269, 270, 682, 917, 68, 216, 217, 69, 392, 393, 70, 827, 828, 71, 72, 317, 318, 73, 74, 364, 75, 76, 77, 338, 339, 78, 79, 157, 158, 444, 80, 81, 82, 83, 290, 291, @@ -2627,308 +2645,306 @@ namespace yy const short int parser::yytable_[] = { - 117, 118, 460, 122, 123, 279, 529, 530, 227, 219, - 131, 162, 228, 237, 243, 140, 143, 144, 541, 698, - 390, 151, 218, 413, 683, 699, 685, 244, 245, 246, - 247, 688, 248, 251, 252, 253, 813, 394, 394, 418, - 706, 858, 421, 920, 527, 822, 700, 657, 713, 986, - 673, 697, 260, 165, 768, 99, 155, 320, 416, 675, - 690, 598, 374, 94, 862, 295, 672, 567, 99, 976, - 599, 375, 722, 933, 934, 935, 93, 968, 702, 459, - 544, 545, 507, 546, 863, 509, 750, 677, 374, 900, - 703, 794, 673, 448, 674, 487, 855, 375, 901, 376, - 795, 675, 676, 295, 1010, 295, 1010, 460, 714, 261, - 442, 88, 526, 690, 597, 690, 111, 517, 449, 856, - 488, 156, 126, 99, 1038, 376, 98, 173, 113, 677, - 276, 96, 715, 173, 443, 628, 716, 717, 678, 103, - 127, 1027, 518, 1011, 95, 680, 691, 692, 632, 262, - 588, 589, 590, 591, 977, 592, 527, 377, 378, 824, - 638, 166, 635, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 701, 296, 1001, 723, 679, 978, 388, 600, - 389, 99, 512, 377, 378, 796, 99, 680, 992, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 724, 1012, - 1013, 1012, 1013, 667, 388, 260, 389, 902, 512, 797, - 1021, 296, 97, 296, 493, 840, 673, 266, 843, 271, - 266, 1028, 1029, 672, 1014, 675, 499, 99, 504, 99, - 104, 271, 725, 257, 969, 727, 728, 729, 730, 731, + 117, 118, 460, 122, 123, 279, 529, 530, 162, 219, + 131, 413, 698, 768, 227, 140, 143, 144, 541, 218, + 390, 151, 699, 418, 228, 237, 421, 683, 243, 685, + 244, 245, 246, 247, 688, 248, 251, 394, 394, 252, + 706, 253, 813, 858, 918, 822, 700, 99, 657, 673, + 713, 697, 94, 88, 96, 416, 598, 722, 675, 898, + 257, 690, 374, 527, 155, 599, 459, 567, 899, 672, + 983, 375, 931, 932, 933, 507, 509, 165, 549, 260, + 965, 445, 568, 295, 621, 287, 677, 93, 493, 750, + 855, 374, 526, 622, 794, 673, 288, 674, 442, 376, + 375, 99, 295, 795, 675, 676, 1007, 460, 295, 1007, + 714, 597, 289, 856, 173, 690, 320, 258, 690, 453, + 98, 973, 443, 276, 173, 454, 316, 628, 376, 156, + 569, 857, 677, 95, 715, 97, 261, 702, 716, 717, + 259, 678, 99, 1008, 680, 1035, 1024, 691, 692, 703, + 588, 589, 590, 591, 103, 592, 260, 377, 378, 824, + 723, 638, 635, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 701, 998, 600, 527, 262, 900, 388, 679, + 389, 632, 512, 724, 989, 166, 377, 378, 796, 672, + 680, 296, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 1009, 1010, 966, 1009, 1010, 974, 388, 1018, 389, + 296, 512, 797, 261, 374, 266, 296, 674, 840, 713, + 926, 843, 667, 375, 1011, 676, 1025, 1026, 271, 975, + 104, 257, 725, 99, 967, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 374, 738, 739, 740, 741, - 742, 674, 743, 677, 375, 177, 99, 167, 858, 676, - 178, 759, 261, 105, 522, 168, 100, 101, 106, 575, - 576, 564, 549, 764, 267, 299, 272, 267, 99, 181, - 182, 587, 376, 184, 300, 710, 185, 99, 272, 523, - 258, 91, 287, 186, 99, 678, 565, 112, 564, 594, - 92, 594, 262, 288, 791, 99, 711, 115, 116, 120, - 121, 680, 301, 259, 268, 114, 273, 268, 203, 289, - 316, 99, 951, 570, 595, 207, 596, 816, 273, 99, - 257, 257, 257, 679, 86, 87, 138, 139, 119, 283, - 377, 378, 99, 713, 211, 257, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 99, 212, 99, 141, 142, - 124, 388, 213, 389, 129, 512, 921, 765, 923, 162, - 302, 303, 369, 706, 214, 215, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 787, 937, 258, 258, 258, - 568, 313, 603, 314, 227, 219, 928, 284, 228, 237, - 243, 789, 258, 714, 713, 605, 257, 285, 218, 803, - 361, 362, 366, 244, 245, 246, 247, 604, 248, 251, - 252, 253, 807, 133, 857, 367, 860, 715, 453, 370, - 606, 716, 717, 629, 454, 909, 633, 911, 569, 698, - 698, 698, 257, 155, 173, 699, 699, 699, 257, 257, - 456, 961, 371, 963, 964, 428, 457, 621, 432, 436, - 445, 257, 257, 258, 714, 880, 622, 257, 668, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 1016, - 780, 781, 782, 783, 784, 971, 408, 985, 715, 987, - 792, 413, 716, 717, 130, 1030, 793, 257, 698, 258, - 993, 903, 394, 970, 699, 258, 258, 802, 156, 257, - 421, 607, 429, 1002, 374, 433, 437, 1005, 258, 258, - 132, 257, 419, 375, 258, 257, 416, 610, 425, 426, - 850, 145, 1020, 1006, 866, 430, 608, 147, 434, 438, - 915, 439, 817, 149, 374, 760, 257, 819, 154, 649, - 766, 376, 611, 375, 258, 851, 257, 257, 650, 867, - 89, 90, 1037, 753, 833, 916, 258, 943, 944, 1041, - 945, 1024, 754, 834, 1025, 788, 790, 830, 258, 170, - 844, 376, 258, 845, 163, 948, 159, 171, 804, 879, - 164, 808, 849, 847, 590, 591, 169, 592, 299, 257, - 176, 883, 172, 258, 280, 895, 949, 300, 368, 377, - 378, 952, 173, 258, 258, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 107, 108, 896, 109, 110, 276, - 388, 965, 389, 257, 512, 301, 904, 905, 316, 377, - 378, 363, 973, 373, 974, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 134, 135, 258, 372, 152, 330, - 388, 410, 389, 427, 512, 1, 2, 3, 588, 589, - 590, 591, 4, 592, 431, 460, 5, 6, 7, 953, - 8, 441, 9, 10, 11, 12, 1000, 136, 137, 435, - 258, 440, 566, 302, 303, 13, 447, 452, 14, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 455, 458, - 450, 451, 461, 954, 313, 462, 314, 463, 1026, 464, - 465, 15, 16, 17, 466, 467, 468, 18, 469, 542, - 543, 544, 545, 1036, 546, 470, 471, 19, 20, 21, - 929, 472, 22, 473, 23, 24, 25, 26, 27, 474, - 475, 547, 476, 28, 29, 477, 478, 479, 30, 31, - 32, 33, 542, 543, 544, 545, 480, 546, 34, 35, - 481, 36, 482, 483, 484, 37, 490, 177, 38, 39, - 40, 41, 178, 179, 485, 374, 737, 180, 486, 864, - 542, 543, 544, 545, 375, 546, 489, 491, 910, 492, - 912, 181, 182, 183, 495, 184, 496, 497, 185, 498, - 501, 502, 506, 503, 865, 186, 187, 188, 510, 511, - 189, 190, 376, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 299, 588, 589, 590, 591, - 203, 592, 204, 205, 300, 206, 519, 207, 521, 542, - 543, 544, 545, 524, 546, 208, 551, 520, 525, 552, - 779, 374, 553, 209, 210, 528, 211, 531, 554, 532, - 375, 533, 301, 868, 534, 535, 555, 556, 212, 159, - 377, 378, 557, 558, 213, 536, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 537, 214, 215, 376, 559, - 560, 388, 538, 389, 539, 512, 540, 548, 542, 543, - 544, 545, 561, 546, 542, 543, 544, 545, 562, 546, - 563, 542, 543, 544, 545, 571, 546, 572, 573, 763, - 302, 303, 869, 574, 609, 577, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 870, 578, 579, 580, 581, - 582, 313, 583, 314, 584, 585, 377, 378, 586, 612, - 613, 614, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 1, 2, 3, 615, 617, 616, 388, 4, 389, - 618, 620, 5, 6, 7, 619, 8, 624, 9, 10, - 11, 12, 542, 543, 544, 545, 623, 546, 626, 627, - 630, 13, 634, 636, 14, 631, 542, 543, 544, 545, - 637, 546, 542, 543, 544, 545, 871, 546, 638, 641, - 642, 319, 643, 648, 644, 645, 646, 15, 16, 17, - 872, 647, 320, 18, 321, 322, 873, 651, 652, 653, - 654, 655, 659, 19, 20, 21, 656, 660, 22, 661, - 23, 24, 25, 26, 27, 662, 323, 324, 663, 28, - 29, 186, 664, 669, 30, 31, 32, 33, 283, 670, - 671, 684, 694, 686, 34, 35, 687, 36, 689, 695, - 696, 37, 721, 708, 38, 39, 40, 41, 709, 546, - 325, 319, 326, 745, 327, 542, 543, 544, 545, 744, - 546, 746, 320, 329, 321, 322, 747, 330, 748, 542, - 543, 544, 545, 749, 546, 331, 332, 333, 751, 874, - 752, 334, 335, 336, 761, 159, 323, 324, 755, 767, - 756, 186, 420, 875, 757, 785, 319, 799, 283, 542, - 543, 544, 545, 805, 546, 592, 809, 320, 810, 321, - 322, 542, 543, 544, 545, 811, 546, 812, 801, 822, - 325, 814, 326, 876, 327, 443, 831, 815, 818, 832, - 328, 323, 324, 329, 829, 877, 186, 330, 820, 542, - 543, 544, 545, 283, 546, 331, 332, 333, 826, 836, - 835, 334, 335, 336, 837, 159, 588, 589, 590, 591, - 838, 592, 839, 878, 841, 325, 842, 326, 848, 327, - 588, 589, 590, 591, 844, 592, 845, 846, 329, 852, - 885, 859, 330, 588, 589, 590, 591, 861, 592, 881, - 331, 332, 333, -1, 886, 884, 334, 335, 336, 899, - 159, 588, 589, 590, 591, 906, 592, 887, 588, 589, - 590, 591, 907, 592, 588, 589, 590, 591, 913, 592, - 914, 588, 589, 590, 591, 888, 592, 917, 588, 589, - 590, 591, 889, 592, 588, 589, 590, 591, 890, 592, - 927, 588, 589, 590, 591, 891, 592, 926, 542, 543, - 544, 545, 892, 546, 542, 543, 544, 545, 893, 546, - 938, 542, 543, 544, 545, 894, 546, 940, 542, 543, - 544, 545, 897, 546, 542, 543, 544, 545, 950, 546, - 946, 542, 543, 544, 545, 981, 546, 962, 542, 543, - 544, 545, 1035, 546, 542, 543, 544, 545, 1039, 546, - 922, 924, 925, 762, 542, 543, 544, 545, 941, 546, - 821, 955, 588, 589, 590, 591, 882, 592, 542, 543, - 544, 545, 956, 546, 958, 959, 908, 542, 543, 544, - 545, 960, 546, 967, 930, 975, 588, 589, 590, 591, - 939, 592, 542, 543, 544, 545, 972, 546, 982, 947, - 542, 543, 544, 545, 984, 546, 988, 989, 966, 990, - 542, 543, 544, 545, 979, 546, 542, 543, 544, 545, - 996, 546, 980, 542, 543, 544, 545, 997, 546, 998, - 999, 1003, 983, 1007, 542, 543, 544, 545, 991, 546, - 1008, 542, 543, 544, 545, 994, 546, 1004, 1009, 1019, - 1022, 1023, 1033, 1032, 1034, 1040, 995, 153, 931, 508, - 625, 898, 409, 1018, 505, 798, 800, 1031, 494, 500, - 407, 666, 786, 550, 957, 758, 365, 806, 936, 446, - 712, 286, 658, 825 + 742, 376, 743, 262, 375, 99, 105, 99, 858, 99, + 126, 678, 99, 710, 99, 673, 155, 266, 173, 575, + 576, 271, 267, 764, 675, 167, 499, 99, 127, 714, + 504, 587, 376, 168, 711, 272, 862, 456, 258, 170, + 99, 106, 99, 457, 99, 713, 99, 171, 99, 679, + 968, 257, 677, 715, 791, 257, 863, 716, 717, 377, + 378, 361, 268, 100, 101, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 267, 273, 948, 816, 272, 257, + 388, 156, 389, 369, 512, 115, 116, 120, 121, 759, + 377, 378, 138, 139, 141, 142, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 714, 111, 765, 258, 112, + 680, 388, 258, 389, 268, 512, 162, 257, 273, 919, + 787, 921, 789, 706, 803, 113, 807, 257, 907, 715, + 257, 362, 257, 716, 717, 366, 258, 428, 91, 935, + 370, 114, 649, 753, 833, 219, 99, 92, 283, 1021, + 227, 650, 754, 834, 448, 218, 432, 119, 844, 367, + 228, 237, 124, 371, 243, 129, 244, 245, 246, 247, + 130, 248, 251, 132, 258, 252, 860, 253, 436, 449, + 698, 698, 698, 629, 258, 1013, 633, 258, 257, 258, + 699, 699, 699, 145, 429, 99, 257, 408, 257, 257, + 257, 1027, 958, 133, 960, 961, 284, 419, 257, 257, + 425, 147, 426, 433, 257, 878, 285, 430, 668, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 413, + 780, 781, 782, 783, 784, 437, 434, 982, 698, 984, + 792, 802, 257, 149, 421, 258, 793, 257, 699, 1003, + 990, 901, 394, 258, 257, 258, 258, 258, 438, 257, + 374, 487, 517, 999, 154, 258, 258, 1002, 439, 375, + 159, 258, 163, 416, 164, 909, 817, 522, 819, 830, + 877, 564, 1017, 564, 594, 594, 488, 518, 881, 893, + 603, 169, 1022, 172, 894, 760, 605, 376, 607, 258, + 766, 845, 523, 610, 258, 850, 565, 864, 570, 595, + 596, 258, 1034, 173, 176, 604, 258, 941, 942, 1038, + 913, 606, 902, 608, 276, 788, 790, 903, 611, 280, + 851, 316, 865, 945, 950, 86, 87, 363, 804, 951, + 299, 808, 849, 847, 368, 914, 372, 544, 545, 300, + 546, 89, 90, 373, 946, 377, 378, 107, 108, 949, + 410, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 542, 543, 544, 545, 330, 546, 388, 301, 389, 962, + 512, 109, 110, 588, 589, 590, 591, 427, 592, 431, + 970, 435, 971, 440, 737, 134, 135, 152, 542, 543, + 544, 545, 441, 546, 1, 2, 3, 779, 447, 590, + 591, 4, 592, 136, 137, 5, 6, 7, 450, 8, + 547, 9, 10, 11, 12, 460, 542, 543, 544, 545, + 451, 546, 452, 997, 13, 302, 303, 14, 455, 458, + 461, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 866, 462, 542, 543, 544, 545, 313, 546, 314, 463, + 15, 16, 17, 464, 465, 1023, 18, 542, 543, 544, + 545, 466, 546, 467, 762, 468, 19, 20, 21, 469, + 1033, 22, 470, 23, 24, 25, 26, 27, 471, 472, + 927, 867, 28, 29, 473, 474, 475, 30, 31, 32, + 33, 542, 543, 544, 545, 476, 546, 34, 35, 477, + 36, 478, 479, 480, 37, 490, 177, 38, 39, 40, + 41, 178, 179, 481, 374, 868, 180, 542, 543, 544, + 545, 482, 546, 375, 542, 543, 544, 545, 483, 546, + 181, 182, 183, 484, 184, 485, 486, 185, 908, 489, + 910, 869, 177, 491, 186, 187, 188, 178, 870, 189, + 190, 376, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 492, 495, 181, 182, 496, 203, + 184, 204, 205, 185, 206, 498, 207, 299, 497, 502, + 186, 510, 506, 501, 208, 511, 300, 521, 503, 524, + 525, 528, 209, 210, 519, 211, 588, 589, 590, 591, + 531, 592, 299, 551, 532, 203, 552, 212, 159, 377, + 378, 300, 207, 213, 301, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 520, 214, 215, 374, 553, 554, + 388, 211, 389, 533, 512, 534, 375, 535, 536, 301, + 555, 537, 538, 212, 539, 542, 543, 544, 545, 213, + 546, 542, 543, 544, 545, 556, 546, 540, 548, 557, + 558, 214, 215, 559, 376, 542, 543, 544, 545, 871, + 546, 566, 302, 303, 571, 872, 560, 561, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 562, 563, 873, + 572, 573, 609, 313, 574, 314, 763, 302, 303, 577, + 578, 579, 580, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 542, 543, 544, 545, 581, 546, 313, 582, + 314, 583, 377, 378, 584, 585, 586, 612, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 1, 2, 3, + 613, 614, 615, 388, 4, 389, 617, 618, 5, 6, + 7, 619, 8, 616, 9, 10, 11, 12, 542, 543, + 544, 545, 620, 546, 623, 624, 630, 13, 626, 627, + 14, 631, 542, 543, 544, 545, 634, 546, 542, 543, + 544, 545, 874, 546, 636, 637, 641, 319, 638, 648, + 642, 643, 644, 15, 16, 17, 875, 645, 320, 18, + 321, 322, 876, 646, 647, 651, 652, 653, 654, 19, + 20, 21, 655, 656, 22, 660, 23, 24, 25, 26, + 27, 661, 323, 324, 659, 28, 29, 186, 662, 663, + 30, 31, 32, 33, 283, 670, 671, 664, 669, 684, + 34, 35, 744, 36, 686, 687, 689, 37, 694, 695, + 38, 39, 40, 41, 696, 708, 325, 319, 326, 721, + 327, 588, 589, 590, 591, 745, 592, 546, 320, 329, + 321, 322, 709, 330, 761, 588, 589, 590, 591, 746, + 592, 331, 332, 333, 747, 883, 748, 334, 335, 336, + 767, 159, 323, 324, 749, 785, 751, 186, 420, 884, + 752, 755, 319, 799, 283, 588, 589, 590, 591, 756, + 592, 757, 809, 320, 592, 321, 322, 588, 589, 590, + 591, 801, 592, 805, 810, 811, 325, 812, 326, 885, + 327, 443, 826, 822, 814, 831, 328, 323, 324, 329, + 815, 886, 186, 330, 818, 588, 589, 590, 591, 283, + 592, 331, 332, 333, 820, 829, 835, 334, 335, 336, + 836, 159, 588, 589, 590, 591, 832, 592, 837, 887, + 838, 325, 839, 326, 841, 327, 588, 589, 590, 591, + 842, 592, 844, 845, 329, 848, 888, 846, 330, 588, + 589, 590, 591, 852, 592, 859, 331, 332, 333, 861, + 889, -1, 334, 335, 336, 879, 159, 588, 589, 590, + 591, 911, 592, 890, 588, 589, 590, 591, 882, 592, + 542, 543, 544, 545, 897, 546, 905, 542, 543, 544, + 545, 891, 546, 904, 542, 543, 544, 545, 892, 546, + 542, 543, 544, 545, 895, 546, 912, 542, 543, 544, + 545, 947, 546, 915, 542, 543, 544, 545, 978, 546, + 542, 543, 544, 545, 1032, 546, 924, 542, 543, 544, + 545, 1036, 546, 920, 922, 923, 821, 925, 588, 589, + 590, 591, 880, 592, 936, 542, 543, 544, 545, 906, + 546, 542, 543, 544, 545, 938, 546, 939, 952, 943, + 928, 588, 589, 590, 591, 955, 592, 937, 953, 542, + 543, 544, 545, 944, 546, 542, 543, 544, 545, 956, + 546, 957, 959, 963, 542, 543, 544, 545, 972, 546, + 964, 976, 979, 542, 543, 544, 545, 977, 546, 542, + 543, 544, 545, 969, 546, 981, 980, 542, 543, 544, + 545, 985, 546, 986, 987, 988, 993, 542, 543, 544, + 545, 991, 546, 994, 995, 996, 1000, 1001, 1004, 992, + 1005, 1006, 1016, 1019, 1020, 1030, 1031, 1029, 1037, 1015, + 153, 508, 929, 409, 896, 625, 800, 798, 494, 1028, + 505, 500, 666, 407, 786, 954, 550, 758, 365, 446, + 712, 934, 806, 286, 825, 658 }; /* YYCHECK. */ const unsigned short int parser::yycheck_[] = { - 20, 21, 174, 23, 24, 107, 302, 303, 101, 101, - 30, 90, 101, 101, 101, 35, 36, 37, 314, 513, - 128, 41, 101, 135, 495, 513, 497, 101, 101, 101, - 101, 502, 101, 101, 101, 101, 620, 129, 130, 139, - 517, 719, 142, 837, 297, 41, 23, 41, 69, 959, - 32, 21, 12, 41, 574, 69, 4, 14, 137, 41, - 41, 32, 32, 69, 89, 12, 6, 363, 69, 41, - 41, 41, 23, 852, 853, 854, 41, 21, 35, 21, - 129, 130, 21, 132, 109, 21, 557, 69, 32, 32, - 47, 32, 32, 126, 34, 126, 126, 41, 41, 69, - 41, 41, 42, 12, 32, 12, 32, 279, 129, 69, - 126, 149, 21, 41, 21, 41, 150, 126, 151, 149, - 151, 69, 23, 69, 1034, 69, 149, 69, 23, 69, - 69, 69, 153, 69, 150, 149, 157, 158, 78, 149, - 41, 69, 151, 69, 150, 127, 127, 128, 149, 109, - 127, 128, 129, 130, 126, 132, 409, 127, 128, 155, - 154, 149, 458, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 149, 120, 156, 126, 116, 149, 148, 150, - 150, 69, 152, 127, 128, 126, 69, 127, 967, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 149, 127, - 128, 127, 128, 149, 148, 12, 150, 150, 152, 150, - 1004, 120, 150, 120, 21, 686, 32, 12, 689, 12, - 12, 149, 150, 6, 150, 41, 21, 69, 21, 69, - 149, 12, 528, 69, 21, 531, 532, 533, 534, 535, + 20, 21, 174, 23, 24, 107, 302, 303, 90, 101, + 30, 135, 513, 574, 101, 35, 36, 37, 314, 101, + 128, 41, 513, 139, 101, 101, 142, 495, 101, 497, + 101, 101, 101, 101, 502, 101, 101, 129, 130, 101, + 517, 101, 620, 719, 837, 41, 23, 69, 41, 32, + 69, 21, 69, 149, 69, 137, 32, 23, 41, 32, + 69, 41, 32, 297, 4, 41, 21, 363, 41, 6, + 956, 41, 852, 853, 854, 21, 21, 41, 21, 12, + 21, 21, 21, 12, 32, 66, 69, 41, 21, 557, + 126, 32, 21, 41, 32, 32, 77, 34, 126, 69, + 41, 69, 12, 41, 41, 42, 32, 279, 12, 32, + 129, 21, 93, 149, 69, 41, 14, 126, 41, 151, + 149, 41, 150, 69, 69, 157, 69, 149, 69, 69, + 69, 150, 69, 150, 153, 150, 69, 35, 157, 158, + 149, 78, 69, 69, 127, 1031, 69, 127, 128, 47, + 127, 128, 129, 130, 149, 132, 12, 127, 128, 155, + 126, 154, 458, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 149, 156, 150, 409, 109, 150, 148, 116, + 150, 149, 152, 149, 964, 149, 127, 128, 126, 6, + 127, 120, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 127, 128, 21, 127, 128, 126, 148, 1001, 150, + 120, 152, 150, 69, 32, 12, 120, 34, 686, 69, + 21, 689, 149, 41, 150, 42, 149, 150, 12, 149, + 149, 69, 528, 69, 21, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 32, 542, 543, 544, 545, - 546, 34, 548, 69, 41, 5, 69, 149, 936, 42, - 10, 149, 69, 149, 126, 157, 149, 150, 149, 377, - 378, 126, 21, 569, 69, 32, 69, 69, 69, 29, - 30, 389, 69, 33, 41, 46, 36, 69, 69, 151, - 126, 23, 66, 43, 69, 78, 151, 149, 126, 126, - 32, 126, 109, 77, 600, 69, 67, 149, 150, 149, - 150, 127, 69, 149, 109, 149, 109, 109, 68, 93, - 69, 69, 906, 151, 151, 75, 151, 623, 109, 69, - 69, 69, 69, 116, 149, 150, 149, 150, 149, 50, - 127, 128, 69, 69, 94, 69, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 69, 106, 69, 149, 150, - 69, 148, 112, 150, 150, 152, 837, 149, 839, 448, - 127, 128, 69, 850, 124, 125, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 149, 857, 126, 126, 126, - 21, 148, 126, 150, 487, 487, 21, 108, 487, 487, - 487, 149, 126, 129, 69, 126, 69, 118, 487, 149, - 149, 149, 149, 487, 487, 487, 487, 151, 487, 487, - 487, 487, 149, 23, 150, 149, 722, 153, 151, 126, - 151, 157, 158, 453, 157, 149, 456, 149, 69, 933, - 934, 935, 69, 4, 69, 933, 934, 935, 69, 69, - 151, 922, 149, 924, 925, 69, 157, 32, 69, 69, - 21, 69, 69, 126, 129, 761, 41, 69, 488, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 999, - 588, 589, 590, 591, 592, 150, 149, 958, 153, 960, - 149, 603, 157, 158, 150, 1015, 155, 69, 992, 126, - 971, 797, 594, 21, 992, 126, 126, 607, 69, 69, - 610, 126, 126, 984, 32, 126, 126, 988, 126, 126, - 149, 69, 149, 41, 126, 69, 605, 126, 149, 149, - 126, 69, 1003, 21, 126, 149, 151, 69, 149, 149, - 126, 149, 149, 69, 32, 565, 69, 149, 13, 32, - 570, 69, 151, 41, 126, 151, 69, 69, 41, 151, - 149, 150, 1033, 32, 32, 151, 126, 863, 864, 1040, - 866, 32, 41, 41, 32, 595, 596, 149, 126, 149, - 41, 69, 126, 41, 32, 881, 107, 157, 608, 149, - 149, 611, 700, 695, 129, 130, 69, 132, 32, 69, - 23, 149, 69, 126, 28, 149, 902, 41, 115, 127, - 128, 907, 69, 126, 126, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 149, 150, 149, 149, 150, 69, - 148, 927, 150, 69, 152, 69, 149, 149, 69, 127, - 128, 69, 938, 149, 940, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 149, 150, 126, 41, 0, 89, - 148, 154, 150, 115, 152, 7, 8, 9, 127, 128, - 129, 130, 14, 132, 115, 847, 18, 19, 20, 149, - 22, 69, 24, 25, 26, 27, 982, 149, 150, 115, - 126, 151, 126, 127, 128, 37, 23, 69, 40, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 69, 23, - 149, 149, 69, 149, 148, 23, 150, 23, 1014, 23, - 23, 63, 64, 65, 23, 23, 23, 69, 23, 127, - 128, 129, 130, 1029, 132, 23, 23, 79, 80, 81, - 848, 23, 84, 23, 86, 87, 88, 89, 90, 23, - 23, 149, 23, 95, 96, 23, 23, 23, 100, 101, - 102, 103, 127, 128, 129, 130, 23, 132, 110, 111, - 23, 113, 23, 23, 23, 117, 69, 5, 120, 121, - 122, 123, 10, 11, 23, 32, 151, 15, 23, 126, - 127, 128, 129, 130, 41, 132, 23, 69, 818, 69, - 820, 29, 30, 31, 126, 33, 69, 126, 36, 69, - 69, 126, 150, 69, 151, 43, 44, 45, 23, 151, - 48, 49, 69, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 32, 127, 128, 129, 130, - 68, 132, 70, 71, 41, 73, 151, 75, 23, 127, - 128, 129, 130, 69, 132, 83, 23, 151, 69, 23, - 151, 32, 23, 91, 92, 150, 94, 150, 23, 150, - 41, 150, 69, 151, 150, 150, 23, 23, 106, 107, - 127, 128, 23, 23, 112, 150, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 150, 124, 125, 69, 23, - 23, 148, 150, 150, 150, 152, 150, 150, 127, 128, - 129, 130, 23, 132, 127, 128, 129, 130, 23, 132, - 23, 127, 128, 129, 130, 115, 132, 69, 149, 126, - 127, 128, 151, 150, 23, 150, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 151, 150, 150, 150, 150, - 150, 148, 150, 150, 150, 150, 127, 128, 150, 115, - 69, 115, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 7, 8, 9, 69, 69, 115, 148, 14, 150, - 149, 69, 18, 19, 20, 150, 22, 41, 24, 25, - 26, 27, 127, 128, 129, 130, 23, 132, 149, 149, - 69, 37, 69, 32, 40, 149, 127, 128, 129, 130, - 69, 132, 127, 128, 129, 130, 151, 132, 154, 41, - 41, 3, 41, 32, 41, 41, 41, 63, 64, 65, - 151, 41, 14, 69, 16, 17, 151, 32, 41, 41, - 41, 41, 150, 79, 80, 81, 69, 41, 84, 41, - 86, 87, 88, 89, 90, 32, 38, 39, 69, 95, - 96, 43, 69, 69, 100, 101, 102, 103, 50, 23, - 126, 126, 69, 126, 110, 111, 126, 113, 126, 149, - 69, 117, 126, 149, 120, 121, 122, 123, 149, 132, - 72, 3, 74, 32, 76, 127, 128, 129, 130, 41, - 132, 41, 14, 85, 16, 17, 41, 89, 41, 127, - 128, 129, 130, 41, 132, 97, 98, 99, 41, 151, - 41, 103, 104, 105, 69, 107, 38, 39, 41, 115, - 41, 43, 114, 151, 41, 149, 3, 149, 50, 127, - 128, 129, 130, 32, 132, 132, 115, 14, 115, 16, - 17, 127, 128, 129, 130, 115, 132, 41, 149, 41, - 72, 151, 74, 151, 76, 150, 69, 151, 151, 69, - 82, 38, 39, 85, 153, 151, 43, 89, 151, 127, - 128, 129, 130, 50, 132, 97, 98, 99, 156, 126, - 149, 103, 104, 105, 126, 107, 127, 128, 129, 130, - 69, 132, 126, 151, 69, 72, 149, 74, 23, 76, - 127, 128, 129, 130, 41, 132, 41, 151, 85, 149, - 151, 69, 89, 127, 128, 129, 130, 69, 132, 69, - 97, 98, 99, 132, 151, 151, 103, 104, 105, 149, - 107, 127, 128, 129, 130, 151, 132, 151, 127, 128, - 129, 130, 23, 132, 127, 128, 129, 130, 153, 132, - 69, 127, 128, 129, 130, 151, 132, 69, 127, 128, - 129, 130, 151, 132, 127, 128, 129, 130, 151, 132, - 23, 127, 128, 129, 130, 151, 132, 149, 127, 128, - 129, 130, 151, 132, 127, 128, 129, 130, 151, 132, - 23, 127, 128, 129, 130, 151, 132, 23, 127, 128, - 129, 130, 151, 132, 127, 128, 129, 130, 151, 132, - 149, 127, 128, 129, 130, 151, 132, 149, 127, 128, - 129, 130, 151, 132, 127, 128, 129, 130, 151, 132, - 126, 126, 126, 149, 127, 128, 129, 130, 41, 132, - 149, 41, 127, 128, 129, 130, 149, 132, 127, 128, - 129, 130, 156, 132, 126, 126, 149, 127, 128, 129, - 130, 126, 132, 149, 149, 153, 127, 128, 129, 130, - 149, 132, 127, 128, 129, 130, 151, 132, 23, 149, - 127, 128, 129, 130, 126, 132, 126, 149, 149, 149, - 127, 128, 129, 130, 149, 132, 127, 128, 129, 130, - 41, 132, 149, 127, 128, 129, 130, 153, 132, 41, - 119, 126, 149, 151, 127, 128, 129, 130, 149, 132, - 41, 127, 128, 129, 130, 149, 132, 126, 153, 69, - 149, 41, 126, 156, 126, 126, 149, 42, 850, 277, - 448, 792, 132, 149, 274, 603, 605, 1015, 263, 269, - 130, 487, 594, 317, 915, 564, 121, 610, 855, 157, - 522, 110, 480, 639 + 546, 69, 548, 109, 41, 69, 149, 69, 934, 69, + 23, 78, 69, 46, 69, 32, 4, 12, 69, 377, + 378, 12, 69, 569, 41, 149, 21, 69, 41, 129, + 21, 389, 69, 157, 67, 69, 89, 151, 126, 149, + 69, 149, 69, 157, 69, 69, 69, 157, 69, 116, + 150, 69, 69, 153, 600, 69, 109, 157, 158, 127, + 128, 149, 109, 149, 150, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 69, 109, 904, 623, 69, 69, + 148, 69, 150, 69, 152, 149, 150, 149, 150, 149, + 127, 128, 149, 150, 149, 150, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 129, 150, 149, 126, 149, + 127, 148, 126, 150, 109, 152, 448, 69, 109, 837, + 149, 839, 149, 850, 149, 23, 149, 69, 149, 153, + 69, 149, 69, 157, 158, 149, 126, 69, 23, 857, + 126, 149, 32, 32, 32, 487, 69, 32, 50, 32, + 487, 41, 41, 41, 126, 487, 69, 149, 41, 149, + 487, 487, 69, 149, 487, 150, 487, 487, 487, 487, + 150, 487, 487, 149, 126, 487, 722, 487, 69, 151, + 931, 932, 933, 453, 126, 996, 456, 126, 69, 126, + 931, 932, 933, 69, 126, 69, 69, 149, 69, 69, + 69, 1012, 920, 23, 922, 923, 108, 149, 69, 69, + 149, 69, 149, 126, 69, 761, 118, 149, 488, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 603, + 588, 589, 590, 591, 592, 126, 149, 955, 989, 957, + 149, 607, 69, 69, 610, 126, 155, 69, 989, 21, + 968, 797, 594, 126, 69, 126, 126, 126, 149, 69, + 32, 126, 126, 981, 13, 126, 126, 985, 149, 41, + 107, 126, 32, 605, 149, 149, 149, 126, 149, 149, + 149, 126, 1000, 126, 126, 126, 151, 151, 149, 149, + 126, 69, 32, 69, 149, 565, 126, 69, 126, 126, + 570, 41, 151, 126, 126, 126, 151, 126, 151, 151, + 151, 126, 1030, 69, 23, 151, 126, 863, 864, 1037, + 126, 151, 149, 151, 69, 595, 596, 149, 151, 28, + 151, 69, 151, 879, 149, 149, 150, 69, 608, 149, + 32, 611, 700, 695, 115, 151, 41, 129, 130, 41, + 132, 149, 150, 149, 900, 127, 128, 149, 150, 905, + 154, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 127, 128, 129, 130, 89, 132, 148, 69, 150, 925, + 152, 149, 150, 127, 128, 129, 130, 115, 132, 115, + 936, 115, 938, 151, 151, 149, 150, 0, 127, 128, + 129, 130, 69, 132, 7, 8, 9, 151, 23, 129, + 130, 14, 132, 149, 150, 18, 19, 20, 149, 22, + 149, 24, 25, 26, 27, 847, 127, 128, 129, 130, + 149, 132, 69, 979, 37, 127, 128, 40, 69, 23, + 69, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 151, 23, 127, 128, 129, 130, 148, 132, 150, 23, + 63, 64, 65, 23, 23, 1011, 69, 127, 128, 129, + 130, 23, 132, 23, 149, 23, 79, 80, 81, 23, + 1026, 84, 23, 86, 87, 88, 89, 90, 23, 23, + 848, 151, 95, 96, 23, 23, 23, 100, 101, 102, + 103, 127, 128, 129, 130, 23, 132, 110, 111, 23, + 113, 23, 23, 23, 117, 69, 5, 120, 121, 122, + 123, 10, 11, 23, 32, 151, 15, 127, 128, 129, + 130, 23, 132, 41, 127, 128, 129, 130, 23, 132, + 29, 30, 31, 23, 33, 23, 23, 36, 818, 23, + 820, 151, 5, 69, 43, 44, 45, 10, 151, 48, + 49, 69, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 69, 126, 29, 30, 69, 68, + 33, 70, 71, 36, 73, 69, 75, 32, 126, 126, + 43, 23, 150, 69, 83, 151, 41, 23, 69, 69, + 69, 150, 91, 92, 151, 94, 127, 128, 129, 130, + 150, 132, 32, 23, 150, 68, 23, 106, 107, 127, + 128, 41, 75, 112, 69, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 151, 124, 125, 32, 23, 23, + 148, 94, 150, 150, 152, 150, 41, 150, 150, 69, + 23, 150, 150, 106, 150, 127, 128, 129, 130, 112, + 132, 127, 128, 129, 130, 23, 132, 150, 150, 23, + 23, 124, 125, 23, 69, 127, 128, 129, 130, 151, + 132, 126, 127, 128, 115, 151, 23, 23, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 23, 23, 151, + 69, 149, 23, 148, 150, 150, 126, 127, 128, 150, + 150, 150, 150, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 127, 128, 129, 130, 150, 132, 148, 150, + 150, 150, 127, 128, 150, 150, 150, 115, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 7, 8, 9, + 69, 115, 69, 148, 14, 150, 69, 149, 18, 19, + 20, 150, 22, 115, 24, 25, 26, 27, 127, 128, + 129, 130, 69, 132, 23, 41, 69, 37, 149, 149, + 40, 149, 127, 128, 129, 130, 69, 132, 127, 128, + 129, 130, 151, 132, 32, 69, 41, 3, 154, 32, + 41, 41, 41, 63, 64, 65, 151, 41, 14, 69, + 16, 17, 151, 41, 41, 32, 41, 41, 41, 79, + 80, 81, 41, 69, 84, 41, 86, 87, 88, 89, + 90, 41, 38, 39, 150, 95, 96, 43, 32, 69, + 100, 101, 102, 103, 50, 23, 126, 69, 69, 126, + 110, 111, 41, 113, 126, 126, 126, 117, 69, 149, + 120, 121, 122, 123, 69, 149, 72, 3, 74, 126, + 76, 127, 128, 129, 130, 32, 132, 132, 14, 85, + 16, 17, 149, 89, 69, 127, 128, 129, 130, 41, + 132, 97, 98, 99, 41, 151, 41, 103, 104, 105, + 115, 107, 38, 39, 41, 149, 41, 43, 114, 151, + 41, 41, 3, 149, 50, 127, 128, 129, 130, 41, + 132, 41, 115, 14, 132, 16, 17, 127, 128, 129, + 130, 149, 132, 32, 115, 115, 72, 41, 74, 151, + 76, 150, 156, 41, 151, 69, 82, 38, 39, 85, + 151, 151, 43, 89, 151, 127, 128, 129, 130, 50, + 132, 97, 98, 99, 151, 153, 149, 103, 104, 105, + 126, 107, 127, 128, 129, 130, 69, 132, 126, 151, + 69, 72, 126, 74, 69, 76, 127, 128, 129, 130, + 149, 132, 41, 41, 85, 23, 151, 151, 89, 127, + 128, 129, 130, 149, 132, 69, 97, 98, 99, 69, + 151, 132, 103, 104, 105, 69, 107, 127, 128, 129, + 130, 153, 132, 151, 127, 128, 129, 130, 151, 132, + 127, 128, 129, 130, 149, 132, 23, 127, 128, 129, + 130, 151, 132, 151, 127, 128, 129, 130, 151, 132, + 127, 128, 129, 130, 151, 132, 69, 127, 128, 129, + 130, 151, 132, 69, 127, 128, 129, 130, 151, 132, + 127, 128, 129, 130, 151, 132, 149, 127, 128, 129, + 130, 151, 132, 126, 126, 126, 149, 23, 127, 128, + 129, 130, 149, 132, 23, 127, 128, 129, 130, 149, + 132, 127, 128, 129, 130, 23, 132, 41, 41, 149, + 149, 127, 128, 129, 130, 126, 132, 149, 156, 127, + 128, 129, 130, 149, 132, 127, 128, 129, 130, 126, + 132, 126, 149, 149, 127, 128, 129, 130, 153, 132, + 149, 149, 23, 127, 128, 129, 130, 149, 132, 127, + 128, 129, 130, 151, 132, 126, 149, 127, 128, 129, + 130, 126, 132, 149, 149, 149, 41, 127, 128, 129, + 130, 149, 132, 153, 41, 119, 126, 126, 151, 149, + 41, 153, 69, 149, 41, 126, 126, 156, 126, 149, + 42, 277, 850, 132, 792, 448, 605, 603, 263, 1012, + 274, 269, 487, 130, 594, 913, 317, 564, 121, 157, + 522, 855, 610, 110, 639, 480 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -3022,25 +3038,24 @@ namespace yy 149, 69, 69, 32, 41, 149, 126, 126, 69, 126, 236, 69, 149, 236, 41, 41, 151, 181, 23, 196, 126, 151, 149, 191, 190, 126, 149, 150, 271, 69, - 176, 69, 89, 109, 126, 151, 126, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 149, - 176, 69, 149, 149, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 149, 149, 151, 207, 149, - 32, 41, 150, 176, 149, 149, 151, 23, 149, 149, - 220, 149, 220, 153, 69, 126, 151, 69, 228, 236, - 235, 236, 126, 236, 126, 126, 149, 23, 21, 196, - 149, 187, 192, 194, 194, 194, 270, 236, 23, 149, - 23, 41, 203, 176, 176, 176, 149, 149, 176, 176, - 151, 262, 176, 149, 149, 41, 156, 244, 126, 126, - 126, 236, 149, 236, 236, 176, 149, 149, 21, 21, - 21, 150, 151, 176, 176, 153, 41, 126, 149, 149, - 149, 151, 23, 149, 126, 236, 228, 236, 126, 149, - 149, 149, 194, 236, 149, 149, 41, 153, 41, 119, - 176, 156, 236, 126, 126, 236, 21, 151, 41, 153, - 32, 69, 127, 128, 150, 204, 221, 222, 149, 69, - 236, 235, 149, 41, 32, 32, 176, 69, 149, 150, - 221, 222, 156, 126, 126, 151, 176, 236, 228, 151, - 126, 236 + 176, 69, 89, 109, 126, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 151, 151, 149, 176, 69, + 149, 149, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 149, 149, 151, 207, 149, 32, 41, + 150, 176, 149, 149, 151, 23, 149, 149, 220, 149, + 220, 153, 69, 126, 151, 69, 228, 236, 235, 236, + 126, 236, 126, 126, 149, 23, 21, 196, 149, 187, + 192, 194, 194, 194, 270, 236, 23, 149, 23, 41, + 203, 176, 176, 149, 149, 176, 176, 151, 262, 176, + 149, 149, 41, 156, 244, 126, 126, 126, 236, 149, + 236, 236, 176, 149, 149, 21, 21, 21, 150, 151, + 176, 176, 153, 41, 126, 149, 149, 149, 151, 23, + 149, 126, 236, 228, 236, 126, 149, 149, 149, 194, + 236, 149, 149, 41, 153, 41, 119, 176, 156, 236, + 126, 126, 236, 21, 151, 41, 153, 32, 69, 127, + 128, 150, 204, 221, 222, 149, 69, 236, 235, 149, + 41, 32, 32, 176, 69, 149, 150, 221, 222, 156, + 126, 126, 151, 176, 236, 228, 151, 126, 236 }; #if YYDEBUG @@ -3082,47 +3097,47 @@ namespace yy 171, 172, 172, 172, 172, 172, 172, 173, 173, 174, 174, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 177, 177, 178, 178, 179, - 180, 181, 181, 182, 183, 184, 184, 185, 186, 186, - 187, 187, 187, 189, 188, 190, 188, 191, 188, 192, - 188, 193, 188, 194, 194, 194, 194, 195, 195, 196, + 176, 176, 176, 176, 177, 177, 178, 178, 179, 180, + 181, 181, 182, 183, 184, 184, 185, 186, 186, 187, + 187, 187, 189, 188, 190, 188, 191, 188, 192, 188, + 193, 188, 194, 194, 194, 194, 195, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 197, 198, 198, 199, 200, 201, 201, 202, 202, 202, - 202, 202, 203, 203, 203, 203, 203, 203, 204, 204, - 204, 204, 204, 204, 204, 204, 205, 206, 206, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, - 209, 209, 210, 211, 211, 212, 212, 213, 214, 214, - 215, 215, 216, 217, 217, 217, 217, 218, 218, 219, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, + 198, 198, 199, 200, 201, 201, 202, 202, 202, 202, + 202, 203, 203, 203, 203, 203, 203, 204, 204, 204, + 204, 204, 204, 204, 204, 205, 206, 206, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 208, 208, 209, + 209, 210, 211, 211, 212, 212, 213, 214, 214, 215, + 215, 216, 217, 217, 217, 217, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, - 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, - 220, 220, 220, 220, 220, 221, 221, 221, 222, 222, - 222, 223, 224, 224, 225, 226, 226, 226, 227, 227, - 227, 227, 227, 228, 228, 228, 228, 229, 230, 230, - 231, 231, 231, 232, 233, 233, 234, 234, 234, 235, - 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, - 237, 237, 237, 237, 238, 238, 239, 239, 239, 239, + 219, 219, 219, 219, 219, 219, 219, 219, 220, 220, + 220, 220, 220, 220, 221, 221, 221, 222, 222, 222, + 223, 224, 224, 225, 226, 226, 226, 227, 227, 227, + 227, 227, 228, 228, 228, 228, 229, 230, 230, 231, + 231, 231, 232, 233, 233, 234, 234, 234, 235, 235, + 235, 235, 235, 236, 236, 236, 236, 236, 236, 237, + 237, 237, 237, 238, 238, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 240, 240, 241, 241, 242, + 239, 239, 239, 239, 240, 240, 241, 241, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 243, 243, 244, 244, 245, 245, 246, 247, - 248, 248, 249, 250, 251, 252, 252, 252, 252, 253, - 254, 254, 254, 254, 255, 255, 255, 255, 256, 256, - 257, 257, 258, 259, 260, 260, 261, 261, 261, 262, - 262, 262, 263, 263, 264, 264, 264, 264, 264, 264, - 265, 265, 265, 265, 265, 265, 266, 267, 267, 268, - 268, 268, 269, 269, 269, 269, 270, 270, 271, 271, - 271, 271, 271, 273, 274, 272, 275, 275, 275, 275, - 276, 276, 277, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 296, 297, 298, 298, 299, 300, 301, - 302, 303, 304, 304, 305, 306, 307, 308, 309, 310, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, - 330, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 341, 342, 342, 343 + 242, 243, 243, 244, 244, 245, 245, 246, 247, 248, + 248, 249, 250, 251, 252, 252, 252, 252, 253, 254, + 254, 254, 254, 255, 255, 255, 255, 256, 256, 257, + 257, 258, 259, 260, 260, 261, 261, 261, 262, 262, + 262, 263, 263, 264, 264, 264, 264, 264, 264, 265, + 265, 265, 265, 265, 265, 266, 267, 267, 268, 268, + 268, 269, 269, 269, 269, 270, 270, 271, 271, 271, + 271, 271, 273, 274, 272, 275, 275, 275, 275, 276, + 276, 277, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 296, 297, 298, 298, 299, 300, 301, 302, + 303, 304, 304, 305, 306, 307, 308, 309, 310, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 341, 342, 342, 343 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -3139,47 +3154,47 @@ namespace yy 2, 2, 3, 1, 3, 4, 2, 3, 4, 3, 4, 4, 3, 1, 1, 1, 3, 3, 3, 3, 3, 2, 2, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 3, 3, 4, 7, 3, - 4, 2, 1, 4, 4, 2, 1, 7, 3, 1, - 1, 1, 1, 0, 5, 0, 8, 0, 8, 0, - 10, 0, 8, 2, 2, 1, 1, 4, 2, 3, - 1, 1, 1, 3, 3, 3, 3, 3, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 1, 4, 4, 4, 2, 1, 9, 6, 5, - 7, 7, 2, 4, 3, 5, 3, 1, 2, 2, - 2, 1, 1, 1, 4, 3, 6, 3, 1, 5, - 3, 3, 4, 2, 2, 3, 1, 1, 2, 5, - 3, 1, 1, 2, 5, 3, 1, 1, 2, 5, - 3, 1, 1, 2, 5, 3, 6, 3, 1, 1, + 4, 4, 4, 4, 1, 3, 4, 7, 3, 4, + 2, 1, 4, 4, 2, 1, 7, 3, 1, 1, + 1, 1, 0, 5, 0, 8, 0, 8, 0, 10, + 0, 8, 2, 2, 1, 1, 4, 2, 3, 1, + 1, 1, 3, 3, 3, 3, 3, 2, 2, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, + 1, 4, 4, 4, 2, 1, 9, 6, 5, 7, + 7, 2, 4, 3, 5, 3, 1, 2, 2, 2, + 1, 1, 1, 4, 3, 6, 3, 1, 5, 3, + 3, 4, 2, 2, 3, 1, 1, 2, 5, 3, + 1, 1, 2, 5, 3, 1, 1, 2, 5, 3, + 1, 1, 2, 5, 3, 6, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 4, 3, 5, 1, 3, 2, 2, 1, 2, 2, - 1, 4, 2, 1, 4, 2, 1, 4, 3, 5, - 9, 1, 5, 3, 5, 7, 9, 4, 2, 1, - 5, 7, 4, 4, 2, 1, 7, 9, 6, 1, - 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, - 2, 5, 3, 6, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, + 3, 5, 1, 3, 2, 2, 1, 2, 2, 1, + 4, 2, 1, 4, 2, 1, 4, 3, 5, 9, + 1, 5, 3, 5, 7, 9, 4, 2, 1, 5, + 7, 4, 4, 2, 1, 7, 9, 6, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 2, 2, 2, + 5, 3, 6, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 6, 3, 1, 1, + 1, 1, 1, 1, 5, 6, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 6, 7, 5, 1, 3, 3, 4, - 2, 1, 5, 3, 4, 4, 6, 3, 5, 3, - 2, 5, 3, 6, 2, 5, 3, 6, 1, 1, - 1, 3, 3, 4, 2, 1, 5, 7, 9, 0, - 3, 3, 2, 5, 5, 6, 3, 7, 8, 5, - 5, 6, 3, 7, 8, 5, 6, 3, 1, 1, - 1, 1, 1, 3, 4, 6, 1, 2, 1, 1, - 1, 1, 1, 0, 0, 5, 2, 5, 3, 6, - 3, 1, 1, 1, 3, 3, 3, 1, 3, 3, - 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 1, 1, 3, 3, 3, 3, 5, 3, - 3, 3, 3, 1, 3, 3, 3, 1, 1, 1, - 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, - 3, 3, 1, 1, 3, 3, 3, 1, 1, 1, - 3, 3, 1, 3, 2, 2, 2 + 1, 5, 6, 7, 5, 1, 3, 3, 4, 2, + 1, 5, 3, 4, 4, 6, 3, 5, 3, 2, + 5, 3, 6, 2, 5, 3, 6, 1, 1, 1, + 3, 3, 4, 2, 1, 5, 7, 9, 0, 3, + 3, 2, 5, 5, 6, 3, 7, 8, 5, 5, + 6, 3, 7, 8, 5, 6, 3, 1, 1, 1, + 1, 1, 3, 4, 6, 1, 2, 1, 1, 1, + 1, 1, 0, 0, 5, 2, 5, 3, 6, 3, + 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, + 3, 1, 1, 1, 3, 3, 3, 3, 3, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 1, 1, 3, 3, 3, 3, 5, 3, 3, + 3, 3, 1, 3, 3, 3, 1, 1, 1, 1, + 1, 3, 1, 1, 1, 1, 3, 3, 3, 3, + 3, 1, 1, 3, 3, 3, 1, 1, 1, 3, + 3, 1, 3, 2, 2, 2 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE @@ -3301,155 +3316,154 @@ namespace yy 150, 176, 151, -1, 137, 150, 176, 151, -1, 138, 150, 176, 151, -1, 139, 150, 176, 151, -1, 140, 150, 176, 151, -1, 141, 150, 176, 151, -1, 148, - 150, 176, 151, -1, 69, 150, 176, 151, -1, 69, - 150, 177, 151, -1, 176, 126, 176, -1, 177, 126, - 176, -1, 40, 149, 181, 21, -1, 40, 150, 179, - 151, 149, 181, 21, -1, 28, 23, 69, -1, 22, - 149, 181, 21, -1, 181, 182, -1, 182, -1, 69, - 23, 176, 149, -1, 37, 149, 184, 21, -1, 184, - 185, -1, 185, -1, 69, 150, 221, 151, 23, 176, - 149, -1, 186, 126, 187, -1, 187, -1, 47, -1, - 35, -1, 293, -1, -1, 63, 149, 189, 194, 21, - -1, -1, 63, 150, 281, 151, 149, 190, 194, 21, - -1, -1, 63, 150, 118, 151, 149, 191, 194, 21, - -1, -1, 63, 150, 108, 126, 186, 151, 192, 149, - 194, 21, -1, -1, 63, 150, 108, 151, 193, 149, - 194, 21, -1, 194, 195, -1, 194, 197, -1, 195, - -1, 197, -1, 196, 23, 196, 149, -1, 196, 149, - -1, 150, 196, 151, -1, 198, -1, 32, -1, 41, - -1, 196, 128, 196, -1, 196, 127, 196, -1, 196, - 129, 196, -1, 196, 130, 196, -1, 196, 132, 196, - -1, 127, 196, -1, 128, 196, -1, 133, 150, 196, - 151, -1, 134, 150, 196, 151, -1, 135, 150, 196, - 151, -1, 136, 150, 196, 151, -1, 137, 150, 196, - 151, -1, 138, 150, 196, 151, -1, 139, 150, 196, - 151, -1, 140, 150, 196, 151, -1, 141, 150, 196, - 151, -1, 148, 150, 196, 151, -1, 152, 69, 23, - 196, 149, -1, 69, -1, 69, 150, 221, 151, -1, - 101, 149, 201, 21, -1, 65, 149, 201, 21, -1, - 201, 202, -1, 202, -1, 120, 69, 149, 89, 203, - 149, 119, 204, 149, -1, 120, 69, 149, 109, 176, - 149, -1, 120, 69, 23, 176, 149, -1, 120, 69, - 126, 69, 23, 176, 149, -1, 12, 69, 126, 69, - 23, 176, 149, -1, 203, 41, -1, 203, 41, 153, - 41, -1, 203, 126, 41, -1, 203, 126, 41, 153, - 41, -1, 41, 153, 41, -1, 41, -1, 204, 222, - -1, 204, 221, -1, 204, 69, -1, 222, -1, 221, - -1, 69, -1, 204, 150, 176, 151, -1, 150, 176, - 151, -1, 102, 23, 154, 206, 155, 149, -1, 206, - 149, 207, -1, 207, -1, 207, 126, 150, 176, 151, - -1, 207, 126, 32, -1, 207, 126, 41, -1, 207, - 150, 176, 151, -1, 207, 32, -1, 207, 41, -1, - 150, 176, 151, -1, 32, -1, 41, -1, 110, 149, - -1, 110, 150, 209, 151, 149, -1, 209, 126, 210, - -1, 210, -1, 279, -1, 9, 149, -1, 9, 150, - 212, 151, 149, -1, 212, 126, 213, -1, 213, -1, - 279, -1, 103, 149, -1, 103, 150, 215, 151, 149, - -1, 215, 126, 216, -1, 216, -1, 292, -1, 111, - 149, -1, 111, 150, 218, 151, 149, -1, 111, 220, - 149, -1, 111, 150, 218, 151, 220, 149, -1, 218, - 126, 219, -1, 219, -1, 278, -1, 279, -1, 280, - -1, 281, -1, 282, -1, 283, -1, 284, -1, 285, - -1, 286, -1, 287, -1, 288, -1, 289, -1, 326, - -1, 290, -1, 291, -1, 292, -1, 293, -1, 294, - -1, 295, -1, 296, -1, 220, 69, -1, 220, 69, - 23, 69, -1, 220, 126, 69, -1, 220, 126, 69, - 23, 69, -1, 69, -1, 69, 23, 69, -1, 128, - 41, -1, 127, 41, -1, 41, -1, 128, 32, -1, - 127, 32, -1, 32, -1, 25, 149, 224, 21, -1, - 224, 225, -1, 225, -1, 226, 126, 227, 149, -1, - 109, 69, -1, 69, -1, 12, 69, 126, 69, -1, - 235, 126, 228, -1, 236, 126, 235, 126, 228, -1, - 236, 126, 236, 126, 236, 126, 235, 126, 228, -1, - 236, -1, 236, 126, 236, 126, 236, -1, 236, 126, - 236, -1, 236, 126, 236, 126, 236, -1, 236, 126, - 236, 126, 236, 126, 236, -1, 236, 126, 236, 126, - 236, 126, 236, 126, 236, -1, 27, 149, 230, 21, - -1, 230, 231, -1, 231, -1, 109, 69, 126, 236, - 149, -1, 12, 69, 126, 69, 126, 236, 149, -1, - 69, 126, 236, 149, -1, 26, 149, 233, 21, -1, - 233, 234, -1, 234, -1, 109, 69, 126, 236, 126, - 236, 149, -1, 12, 69, 126, 69, 126, 236, 126, - 236, 149, -1, 69, 126, 236, 126, 236, 149, -1, - 6, -1, 34, -1, 78, -1, 42, -1, 116, -1, - -1, 41, -1, 32, -1, 69, -1, 127, 41, -1, - 127, 32, -1, 24, 149, -1, 24, 150, 238, 151, - 149, -1, 24, 220, 149, -1, 24, 150, 238, 151, - 220, 149, -1, 238, 126, 239, -1, 239, -1, 297, - -1, 298, -1, 299, -1, 300, -1, 301, -1, 302, - -1, 303, -1, 304, -1, 305, -1, 306, -1, 307, - -1, 308, -1, 309, -1, 310, -1, 311, -1, 312, - -1, 313, -1, 314, -1, 315, -1, 316, -1, 317, - -1, 318, -1, 319, -1, 320, -1, 289, -1, 321, - -1, 322, -1, 323, -1, 324, -1, 325, -1, 327, - -1, 328, -1, 333, -1, 334, -1, 335, -1, 279, - -1, 336, -1, 337, -1, 338, -1, 95, 150, 241, - 151, 149, -1, 95, 150, 241, 151, 220, 149, -1, - 241, 126, 242, -1, 242, -1, 304, -1, 305, -1, - 314, -1, 320, -1, 289, -1, 321, -1, 322, -1, - 323, -1, 324, -1, 325, -1, 333, -1, 334, -1, - 335, -1, 96, 150, 241, 151, 149, -1, 96, 150, - 241, 151, 220, 149, -1, 156, 69, 156, 126, 156, - 69, 156, -1, 156, 69, 156, 126, 236, -1, 244, - -1, 245, 126, 244, -1, 123, 220, 149, -1, 79, - 149, 248, 21, -1, 248, 249, -1, 249, -1, 69, - 150, 176, 151, 149, -1, 117, 220, 149, -1, 84, - 149, 252, 21, -1, 252, 69, 176, 149, -1, 252, - 69, 126, 69, 176, 149, -1, 69, 176, 149, -1, - 69, 126, 69, 176, 149, -1, 87, 220, 149, -1, - 86, 149, -1, 86, 150, 257, 151, 149, -1, 86, - 220, 149, -1, 86, 150, 257, 151, 220, 149, -1, - 80, 149, -1, 80, 150, 257, 151, 149, -1, 80, - 220, 149, -1, 80, 150, 257, 151, 220, 149, -1, - 329, -1, 219, -1, 256, -1, 257, 126, 256, -1, - 81, 220, 149, -1, 8, 149, 260, 21, -1, 260, - 261, -1, 261, -1, 69, 262, 23, 176, 149, -1, - 69, 126, 69, 262, 23, 176, 149, -1, 4, 69, - 150, 41, 151, 262, 23, 176, 149, -1, -1, 150, - 41, 151, -1, 150, 32, 151, -1, 7, 149, -1, - 7, 150, 13, 151, 149, -1, 20, 150, 69, 151, - 149, -1, 20, 150, 69, 151, 220, 149, -1, 20, - 69, 149, -1, 20, 150, 69, 157, 69, 151, 149, - -1, 20, 150, 69, 157, 69, 151, 220, 149, -1, - 20, 69, 157, 69, 149, -1, 19, 150, 69, 151, - 149, -1, 19, 150, 69, 151, 220, 149, -1, 19, - 69, 149, -1, 19, 150, 69, 157, 69, 151, 149, - -1, 19, 150, 69, 157, 69, 151, 220, 149, -1, - 19, 69, 157, 69, 149, -1, 64, 150, 267, 151, - 269, 149, -1, 267, 126, 268, -1, 268, -1, 330, - -1, 331, -1, 332, -1, 270, -1, 269, 126, 270, - -1, 270, 150, 236, 151, -1, 269, 126, 270, 150, - 236, 151, -1, 271, -1, 270, 271, -1, 69, -1, - 158, -1, 129, -1, 153, -1, 157, -1, -1, -1, - 90, 273, 196, 274, 149, -1, 113, 149, -1, 113, - 150, 276, 151, 149, -1, 113, 220, 149, -1, 113, - 150, 276, 151, 220, 149, -1, 276, 126, 277, -1, - 277, -1, 219, -1, 339, -1, 16, 23, 41, -1, - 107, 23, 41, -1, 104, 23, 41, -1, 50, -1, - 85, 23, 41, -1, 99, 23, 41, -1, 17, 23, - 41, -1, 3, 23, 41, -1, 72, -1, 74, -1, - 76, -1, 43, 23, 41, -1, 38, 23, 41, -1, - 39, 23, 41, -1, 89, 23, 41, -1, 14, 23, - 32, -1, 103, -1, 105, 23, 41, -1, 97, 23, - 41, -1, 97, 23, 32, -1, 15, 23, 69, -1, - 70, 23, 343, -1, 70, 23, 41, -1, 31, 23, - 41, -1, 91, 23, 41, -1, 92, 23, 41, -1, - 48, 23, 41, -1, 49, 23, 41, -1, 75, -1, - 36, -1, 10, 23, 32, -1, 58, 23, 41, -1, - 53, 23, 32, -1, 55, 23, 32, -1, 83, 23, - 150, 245, 151, -1, 54, 23, 32, -1, 54, 23, - 41, -1, 62, 23, 69, -1, 61, 23, 41, -1, - 60, -1, 94, 23, 32, -1, 56, 23, 41, -1, - 57, 23, 41, -1, 51, -1, 52, -1, 73, -1, - 5, -1, 112, -1, 33, 23, 41, -1, 106, -1, - 68, -1, 30, -1, 98, -1, 44, 23, 41, -1, - 45, 23, 41, -1, 82, 23, 236, -1, 66, 23, - 46, -1, 66, 23, 67, -1, 93, -1, 77, -1, - 124, 23, 69, -1, 125, 23, 340, -1, 29, 23, - 343, -1, 11, -1, 71, -1, 59, -1, 114, 23, - 32, -1, 69, 153, 69, -1, 41, -1, 41, 153, - 41, -1, 154, 341, -1, 342, 341, -1, 342, 155, - -1 + 150, 176, 151, -1, 69, 150, 177, 151, -1, 176, + -1, 177, 126, 176, -1, 40, 149, 181, 21, -1, + 40, 150, 179, 151, 149, 181, 21, -1, 28, 23, + 69, -1, 22, 149, 181, 21, -1, 181, 182, -1, + 182, -1, 69, 23, 176, 149, -1, 37, 149, 184, + 21, -1, 184, 185, -1, 185, -1, 69, 150, 221, + 151, 23, 176, 149, -1, 186, 126, 187, -1, 187, + -1, 47, -1, 35, -1, 293, -1, -1, 63, 149, + 189, 194, 21, -1, -1, 63, 150, 281, 151, 149, + 190, 194, 21, -1, -1, 63, 150, 118, 151, 149, + 191, 194, 21, -1, -1, 63, 150, 108, 126, 186, + 151, 192, 149, 194, 21, -1, -1, 63, 150, 108, + 151, 193, 149, 194, 21, -1, 194, 195, -1, 194, + 197, -1, 195, -1, 197, -1, 196, 23, 196, 149, + -1, 196, 149, -1, 150, 196, 151, -1, 198, -1, + 32, -1, 41, -1, 196, 128, 196, -1, 196, 127, + 196, -1, 196, 129, 196, -1, 196, 130, 196, -1, + 196, 132, 196, -1, 127, 196, -1, 128, 196, -1, + 133, 150, 196, 151, -1, 134, 150, 196, 151, -1, + 135, 150, 196, 151, -1, 136, 150, 196, 151, -1, + 137, 150, 196, 151, -1, 138, 150, 196, 151, -1, + 139, 150, 196, 151, -1, 140, 150, 196, 151, -1, + 141, 150, 196, 151, -1, 148, 150, 196, 151, -1, + 152, 69, 23, 196, 149, -1, 69, -1, 69, 150, + 221, 151, -1, 101, 149, 201, 21, -1, 65, 149, + 201, 21, -1, 201, 202, -1, 202, -1, 120, 69, + 149, 89, 203, 149, 119, 204, 149, -1, 120, 69, + 149, 109, 176, 149, -1, 120, 69, 23, 176, 149, + -1, 120, 69, 126, 69, 23, 176, 149, -1, 12, + 69, 126, 69, 23, 176, 149, -1, 203, 41, -1, + 203, 41, 153, 41, -1, 203, 126, 41, -1, 203, + 126, 41, 153, 41, -1, 41, 153, 41, -1, 41, + -1, 204, 222, -1, 204, 221, -1, 204, 69, -1, + 222, -1, 221, -1, 69, -1, 204, 150, 176, 151, + -1, 150, 176, 151, -1, 102, 23, 154, 206, 155, + 149, -1, 206, 149, 207, -1, 207, -1, 207, 126, + 150, 176, 151, -1, 207, 126, 32, -1, 207, 126, + 41, -1, 207, 150, 176, 151, -1, 207, 32, -1, + 207, 41, -1, 150, 176, 151, -1, 32, -1, 41, + -1, 110, 149, -1, 110, 150, 209, 151, 149, -1, + 209, 126, 210, -1, 210, -1, 279, -1, 9, 149, + -1, 9, 150, 212, 151, 149, -1, 212, 126, 213, + -1, 213, -1, 279, -1, 103, 149, -1, 103, 150, + 215, 151, 149, -1, 215, 126, 216, -1, 216, -1, + 292, -1, 111, 149, -1, 111, 150, 218, 151, 149, + -1, 111, 220, 149, -1, 111, 150, 218, 151, 220, + 149, -1, 218, 126, 219, -1, 219, -1, 278, -1, + 279, -1, 280, -1, 281, -1, 282, -1, 283, -1, + 284, -1, 285, -1, 286, -1, 287, -1, 288, -1, + 289, -1, 326, -1, 290, -1, 291, -1, 292, -1, + 293, -1, 294, -1, 295, -1, 296, -1, 220, 69, + -1, 220, 69, 23, 69, -1, 220, 126, 69, -1, + 220, 126, 69, 23, 69, -1, 69, -1, 69, 23, + 69, -1, 128, 41, -1, 127, 41, -1, 41, -1, + 128, 32, -1, 127, 32, -1, 32, -1, 25, 149, + 224, 21, -1, 224, 225, -1, 225, -1, 226, 126, + 227, 149, -1, 109, 69, -1, 69, -1, 12, 69, + 126, 69, -1, 235, 126, 228, -1, 236, 126, 235, + 126, 228, -1, 236, 126, 236, 126, 236, 126, 235, + 126, 228, -1, 236, -1, 236, 126, 236, 126, 236, + -1, 236, 126, 236, -1, 236, 126, 236, 126, 236, + -1, 236, 126, 236, 126, 236, 126, 236, -1, 236, + 126, 236, 126, 236, 126, 236, 126, 236, -1, 27, + 149, 230, 21, -1, 230, 231, -1, 231, -1, 109, + 69, 126, 236, 149, -1, 12, 69, 126, 69, 126, + 236, 149, -1, 69, 126, 236, 149, -1, 26, 149, + 233, 21, -1, 233, 234, -1, 234, -1, 109, 69, + 126, 236, 126, 236, 149, -1, 12, 69, 126, 69, + 126, 236, 126, 236, 149, -1, 69, 126, 236, 126, + 236, 149, -1, 6, -1, 34, -1, 78, -1, 42, + -1, 116, -1, -1, 41, -1, 32, -1, 69, -1, + 127, 41, -1, 127, 32, -1, 24, 149, -1, 24, + 150, 238, 151, 149, -1, 24, 220, 149, -1, 24, + 150, 238, 151, 220, 149, -1, 238, 126, 239, -1, + 239, -1, 297, -1, 298, -1, 299, -1, 300, -1, + 301, -1, 302, -1, 303, -1, 304, -1, 305, -1, + 306, -1, 307, -1, 308, -1, 309, -1, 310, -1, + 311, -1, 312, -1, 313, -1, 314, -1, 315, -1, + 316, -1, 317, -1, 318, -1, 319, -1, 320, -1, + 289, -1, 321, -1, 322, -1, 323, -1, 324, -1, + 325, -1, 327, -1, 328, -1, 333, -1, 334, -1, + 335, -1, 279, -1, 336, -1, 337, -1, 338, -1, + 95, 150, 241, 151, 149, -1, 95, 150, 241, 151, + 220, 149, -1, 241, 126, 242, -1, 242, -1, 304, + -1, 305, -1, 314, -1, 320, -1, 289, -1, 321, + -1, 322, -1, 323, -1, 324, -1, 325, -1, 333, + -1, 334, -1, 335, -1, 96, 150, 241, 151, 149, + -1, 96, 150, 241, 151, 220, 149, -1, 156, 69, + 156, 126, 156, 69, 156, -1, 156, 69, 156, 126, + 236, -1, 244, -1, 245, 126, 244, -1, 123, 220, + 149, -1, 79, 149, 248, 21, -1, 248, 249, -1, + 249, -1, 69, 150, 176, 151, 149, -1, 117, 220, + 149, -1, 84, 149, 252, 21, -1, 252, 69, 176, + 149, -1, 252, 69, 126, 69, 176, 149, -1, 69, + 176, 149, -1, 69, 126, 69, 176, 149, -1, 87, + 220, 149, -1, 86, 149, -1, 86, 150, 257, 151, + 149, -1, 86, 220, 149, -1, 86, 150, 257, 151, + 220, 149, -1, 80, 149, -1, 80, 150, 257, 151, + 149, -1, 80, 220, 149, -1, 80, 150, 257, 151, + 220, 149, -1, 329, -1, 219, -1, 256, -1, 257, + 126, 256, -1, 81, 220, 149, -1, 8, 149, 260, + 21, -1, 260, 261, -1, 261, -1, 69, 262, 23, + 176, 149, -1, 69, 126, 69, 262, 23, 176, 149, + -1, 4, 69, 150, 41, 151, 262, 23, 176, 149, + -1, -1, 150, 41, 151, -1, 150, 32, 151, -1, + 7, 149, -1, 7, 150, 13, 151, 149, -1, 20, + 150, 69, 151, 149, -1, 20, 150, 69, 151, 220, + 149, -1, 20, 69, 149, -1, 20, 150, 69, 157, + 69, 151, 149, -1, 20, 150, 69, 157, 69, 151, + 220, 149, -1, 20, 69, 157, 69, 149, -1, 19, + 150, 69, 151, 149, -1, 19, 150, 69, 151, 220, + 149, -1, 19, 69, 149, -1, 19, 150, 69, 157, + 69, 151, 149, -1, 19, 150, 69, 157, 69, 151, + 220, 149, -1, 19, 69, 157, 69, 149, -1, 64, + 150, 267, 151, 269, 149, -1, 267, 126, 268, -1, + 268, -1, 330, -1, 331, -1, 332, -1, 270, -1, + 269, 126, 270, -1, 270, 150, 236, 151, -1, 269, + 126, 270, 150, 236, 151, -1, 271, -1, 270, 271, + -1, 69, -1, 158, -1, 129, -1, 153, -1, 157, + -1, -1, -1, 90, 273, 196, 274, 149, -1, 113, + 149, -1, 113, 150, 276, 151, 149, -1, 113, 220, + 149, -1, 113, 150, 276, 151, 220, 149, -1, 276, + 126, 277, -1, 277, -1, 219, -1, 339, -1, 16, + 23, 41, -1, 107, 23, 41, -1, 104, 23, 41, + -1, 50, -1, 85, 23, 41, -1, 99, 23, 41, + -1, 17, 23, 41, -1, 3, 23, 41, -1, 72, + -1, 74, -1, 76, -1, 43, 23, 41, -1, 38, + 23, 41, -1, 39, 23, 41, -1, 89, 23, 41, + -1, 14, 23, 32, -1, 103, -1, 105, 23, 41, + -1, 97, 23, 41, -1, 97, 23, 32, -1, 15, + 23, 69, -1, 70, 23, 343, -1, 70, 23, 41, + -1, 31, 23, 41, -1, 91, 23, 41, -1, 92, + 23, 41, -1, 48, 23, 41, -1, 49, 23, 41, + -1, 75, -1, 36, -1, 10, 23, 32, -1, 58, + 23, 41, -1, 53, 23, 32, -1, 55, 23, 32, + -1, 83, 23, 150, 245, 151, -1, 54, 23, 32, + -1, 54, 23, 41, -1, 62, 23, 69, -1, 61, + 23, 41, -1, 60, -1, 94, 23, 32, -1, 56, + 23, 41, -1, 57, 23, 41, -1, 51, -1, 52, + -1, 73, -1, 5, -1, 112, -1, 33, 23, 41, + -1, 106, -1, 68, -1, 30, -1, 98, -1, 44, + 23, 41, -1, 45, 23, 41, -1, 82, 23, 236, + -1, 66, 23, 46, -1, 66, 23, 67, -1, 93, + -1, 77, -1, 124, 23, 69, -1, 125, 23, 340, + -1, 29, 23, 343, -1, 11, -1, 71, -1, 59, + -1, 114, 23, 32, -1, 69, 153, 69, -1, 41, + -1, 41, 153, 41, -1, 154, 341, -1, 342, 341, + -1, 342, 155, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -3467,104 +3481,104 @@ namespace yy 181, 184, 187, 191, 193, 197, 202, 205, 209, 214, 218, 223, 228, 232, 234, 236, 238, 242, 246, 250, 254, 258, 261, 264, 269, 274, 279, 284, 289, 294, - 299, 304, 309, 314, 319, 324, 328, 332, 337, 345, - 349, 354, 357, 359, 364, 369, 372, 374, 382, 386, - 388, 390, 392, 394, 395, 401, 402, 411, 412, 421, - 422, 433, 434, 443, 446, 449, 451, 453, 458, 461, - 465, 467, 469, 471, 475, 479, 483, 487, 491, 494, - 497, 502, 507, 512, 517, 522, 527, 532, 537, 542, - 547, 553, 555, 560, 565, 570, 573, 575, 585, 592, - 598, 606, 614, 617, 622, 626, 632, 636, 638, 641, - 644, 647, 649, 651, 653, 658, 662, 669, 673, 675, - 681, 685, 689, 694, 697, 700, 704, 706, 708, 711, - 717, 721, 723, 725, 728, 734, 738, 740, 742, 745, - 751, 755, 757, 759, 762, 768, 772, 779, 783, 785, - 787, 789, 791, 793, 795, 797, 799, 801, 803, 805, - 807, 809, 811, 813, 815, 817, 819, 821, 823, 825, - 828, 833, 837, 843, 845, 849, 852, 855, 857, 860, - 863, 865, 870, 873, 875, 880, 883, 885, 890, 894, - 900, 910, 912, 918, 922, 928, 936, 946, 951, 954, - 956, 962, 970, 975, 980, 983, 985, 993, 1003, 1010, - 1012, 1014, 1016, 1018, 1020, 1021, 1023, 1025, 1027, 1030, - 1033, 1036, 1042, 1046, 1053, 1057, 1059, 1061, 1063, 1065, - 1067, 1069, 1071, 1073, 1075, 1077, 1079, 1081, 1083, 1085, - 1087, 1089, 1091, 1093, 1095, 1097, 1099, 1101, 1103, 1105, - 1107, 1109, 1111, 1113, 1115, 1117, 1119, 1121, 1123, 1125, - 1127, 1129, 1131, 1133, 1135, 1137, 1143, 1150, 1154, 1156, - 1158, 1160, 1162, 1164, 1166, 1168, 1170, 1172, 1174, 1176, - 1178, 1180, 1182, 1188, 1195, 1203, 1209, 1211, 1215, 1219, - 1224, 1227, 1229, 1235, 1239, 1244, 1249, 1256, 1260, 1266, - 1270, 1273, 1279, 1283, 1290, 1293, 1299, 1303, 1310, 1312, - 1314, 1316, 1320, 1324, 1329, 1332, 1334, 1340, 1348, 1358, - 1359, 1363, 1367, 1370, 1376, 1382, 1389, 1393, 1401, 1410, - 1416, 1422, 1429, 1433, 1441, 1450, 1456, 1463, 1467, 1469, - 1471, 1473, 1475, 1477, 1481, 1486, 1493, 1495, 1498, 1500, - 1502, 1504, 1506, 1508, 1509, 1510, 1516, 1519, 1525, 1529, - 1536, 1540, 1542, 1544, 1546, 1550, 1554, 1558, 1560, 1564, - 1568, 1572, 1576, 1578, 1580, 1582, 1586, 1590, 1594, 1598, - 1602, 1604, 1608, 1612, 1616, 1620, 1624, 1628, 1632, 1636, - 1640, 1644, 1648, 1650, 1652, 1656, 1660, 1664, 1668, 1674, - 1678, 1682, 1686, 1690, 1692, 1696, 1700, 1704, 1706, 1708, - 1710, 1712, 1714, 1718, 1720, 1722, 1724, 1726, 1730, 1734, - 1738, 1742, 1746, 1748, 1750, 1754, 1758, 1762, 1764, 1766, - 1768, 1772, 1776, 1778, 1782, 1785, 1788 + 299, 304, 309, 314, 319, 321, 325, 330, 338, 342, + 347, 350, 352, 357, 362, 365, 367, 375, 379, 381, + 383, 385, 387, 388, 394, 395, 404, 405, 414, 415, + 426, 427, 436, 439, 442, 444, 446, 451, 454, 458, + 460, 462, 464, 468, 472, 476, 480, 484, 487, 490, + 495, 500, 505, 510, 515, 520, 525, 530, 535, 540, + 546, 548, 553, 558, 563, 566, 568, 578, 585, 591, + 599, 607, 610, 615, 619, 625, 629, 631, 634, 637, + 640, 642, 644, 646, 651, 655, 662, 666, 668, 674, + 678, 682, 687, 690, 693, 697, 699, 701, 704, 710, + 714, 716, 718, 721, 727, 731, 733, 735, 738, 744, + 748, 750, 752, 755, 761, 765, 772, 776, 778, 780, + 782, 784, 786, 788, 790, 792, 794, 796, 798, 800, + 802, 804, 806, 808, 810, 812, 814, 816, 818, 821, + 826, 830, 836, 838, 842, 845, 848, 850, 853, 856, + 858, 863, 866, 868, 873, 876, 878, 883, 887, 893, + 903, 905, 911, 915, 921, 929, 939, 944, 947, 949, + 955, 963, 968, 973, 976, 978, 986, 996, 1003, 1005, + 1007, 1009, 1011, 1013, 1014, 1016, 1018, 1020, 1023, 1026, + 1029, 1035, 1039, 1046, 1050, 1052, 1054, 1056, 1058, 1060, + 1062, 1064, 1066, 1068, 1070, 1072, 1074, 1076, 1078, 1080, + 1082, 1084, 1086, 1088, 1090, 1092, 1094, 1096, 1098, 1100, + 1102, 1104, 1106, 1108, 1110, 1112, 1114, 1116, 1118, 1120, + 1122, 1124, 1126, 1128, 1130, 1136, 1143, 1147, 1149, 1151, + 1153, 1155, 1157, 1159, 1161, 1163, 1165, 1167, 1169, 1171, + 1173, 1175, 1181, 1188, 1196, 1202, 1204, 1208, 1212, 1217, + 1220, 1222, 1228, 1232, 1237, 1242, 1249, 1253, 1259, 1263, + 1266, 1272, 1276, 1283, 1286, 1292, 1296, 1303, 1305, 1307, + 1309, 1313, 1317, 1322, 1325, 1327, 1333, 1341, 1351, 1352, + 1356, 1360, 1363, 1369, 1375, 1382, 1386, 1394, 1403, 1409, + 1415, 1422, 1426, 1434, 1443, 1449, 1456, 1460, 1462, 1464, + 1466, 1468, 1470, 1474, 1479, 1486, 1488, 1491, 1493, 1495, + 1497, 1499, 1501, 1502, 1503, 1509, 1512, 1518, 1522, 1529, + 1533, 1535, 1537, 1539, 1543, 1547, 1551, 1553, 1557, 1561, + 1565, 1569, 1571, 1573, 1575, 1579, 1583, 1587, 1591, 1595, + 1597, 1601, 1605, 1609, 1613, 1617, 1621, 1625, 1629, 1633, + 1637, 1641, 1643, 1645, 1649, 1653, 1657, 1661, 1667, 1671, + 1675, 1679, 1683, 1685, 1689, 1693, 1697, 1699, 1701, 1703, + 1705, 1707, 1711, 1713, 1715, 1717, 1719, 1723, 1727, 1731, + 1735, 1739, 1741, 1743, 1747, 1751, 1755, 1757, 1759, 1761, + 1765, 1769, 1771, 1775, 1778, 1781 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned short int parser::yyrline_[] = { - 0, 89, 89, 90, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 136, 137, 138, 139, 143, 144, 147, 150, - 154, 158, 162, 166, 168, 170, 172, 174, 176, 181, - 183, 185, 187, 189, 191, 196, 198, 200, 202, 204, - 206, 211, 213, 215, 217, 219, 221, 226, 230, 237, - 241, 248, 253, 255, 257, 259, 261, 263, 265, 267, - 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, - 289, 291, 293, 295, 297, 302, 304, 308, 310, 315, - 319, 324, 325, 329, 334, 339, 340, 344, 348, 349, - 353, 354, 355, 359, 359, 360, 360, 362, 362, 364, - 364, 366, 366, 371, 372, 373, 374, 378, 380, 385, - 386, 387, 389, 391, 393, 395, 397, 399, 401, 403, - 405, 407, 409, 411, 413, 415, 417, 419, 421, 423, - 427, 431, 433, 438, 442, 446, 447, 451, 453, 455, - 457, 459, 464, 466, 468, 470, 472, 474, 480, 482, - 484, 486, 488, 490, 492, 494, 499, 504, 506, 511, - 513, 515, 517, 519, 521, 523, 525, 527, 532, 536, - 540, 541, 544, 548, 550, 554, 555, 558, 562, 564, - 568, 569, 572, 576, 578, 580, 582, 586, 587, 590, - 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 613, - 615, 617, 619, 621, 623, 628, 630, 632, 637, 639, - 641, 646, 651, 653, 658, 662, 667, 672, 682, 687, - 693, 703, 708, 719, 725, 733, 743, 757, 761, 763, - 767, 774, 783, 792, 796, 798, 802, 811, 822, 834, - 836, 838, 840, 842, 847, 848, 849, 850, 851, 853, - 860, 862, 864, 866, 871, 872, 875, 876, 877, 878, - 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, - 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, - 909, 910, 911, 912, 913, 917, 919, 924, 925, 929, - 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, - 940, 941, 945, 947, 952, 953, 957, 958, 962, 967, - 972, 973, 976, 980, 983, 987, 989, 991, 993, 997, - 1000, 1001, 1002, 1003, 1006, 1007, 1008, 1009, 1012, 1013, - 1016, 1017, 1020, 1023, 1027, 1028, 1031, 1032, 1033, 1036, - 1037, 1038, 1041, 1042, 1045, 1046, 1047, 1048, 1049, 1050, - 1052, 1053, 1054, 1055, 1056, 1057, 1059, 1063, 1064, 1067, - 1068, 1069, 1072, 1073, 1074, 1075, 1078, 1079, 1082, 1083, - 1084, 1085, 1086, 1089, 1089, 1089, 1092, 1094, 1096, 1098, - 1103, 1104, 1107, 1108, 1111, 1112, 1113, 1114, 1115, 1116, - 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, - 1127, 1128, 1129, 1130, 1132, 1133, 1134, 1136, 1137, 1138, - 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, - 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, - 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, 1168, - 1170, 1172, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, - 1183, 1185, 1193, 1194, 1198, 1199, 1208 + 0, 84, 84, 85, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 131, 132, 133, 134, 138, 139, 142, 145, + 149, 153, 157, 161, 163, 165, 167, 169, 171, 176, + 178, 180, 182, 184, 186, 191, 193, 195, 197, 199, + 201, 206, 208, 210, 212, 214, 216, 221, 225, 232, + 236, 243, 248, 250, 252, 254, 256, 258, 260, 262, + 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, + 284, 286, 288, 290, 295, 297, 301, 303, 308, 312, + 317, 318, 322, 327, 332, 333, 337, 341, 342, 346, + 347, 348, 352, 352, 353, 353, 355, 355, 357, 357, + 359, 359, 364, 365, 366, 367, 371, 373, 378, 379, + 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, + 400, 402, 404, 406, 408, 410, 412, 414, 416, 420, + 424, 426, 431, 435, 439, 440, 444, 446, 448, 450, + 452, 457, 459, 461, 463, 465, 467, 473, 475, 477, + 479, 481, 483, 485, 487, 492, 497, 499, 504, 506, + 508, 510, 512, 514, 516, 518, 520, 525, 529, 533, + 534, 537, 541, 543, 547, 548, 551, 555, 557, 561, + 562, 565, 569, 571, 573, 575, 579, 580, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 606, 608, + 610, 612, 614, 616, 621, 623, 625, 630, 632, 634, + 639, 644, 646, 651, 655, 660, 665, 675, 680, 686, + 696, 701, 712, 718, 726, 736, 750, 754, 756, 760, + 767, 776, 785, 789, 791, 795, 804, 815, 827, 829, + 831, 833, 835, 840, 841, 842, 843, 844, 846, 853, + 855, 857, 859, 864, 865, 868, 869, 870, 871, 872, + 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, + 903, 904, 905, 906, 910, 912, 917, 918, 922, 923, + 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, + 934, 938, 940, 945, 946, 950, 951, 955, 960, 965, + 966, 969, 973, 976, 980, 982, 984, 986, 990, 993, + 994, 995, 996, 999, 1000, 1001, 1002, 1005, 1006, 1009, + 1010, 1013, 1016, 1020, 1021, 1024, 1025, 1026, 1029, 1030, + 1031, 1034, 1035, 1038, 1039, 1040, 1041, 1042, 1043, 1045, + 1046, 1047, 1048, 1049, 1050, 1052, 1056, 1057, 1060, 1061, + 1062, 1065, 1066, 1067, 1068, 1071, 1072, 1075, 1076, 1077, + 1078, 1079, 1082, 1082, 1082, 1085, 1087, 1089, 1091, 1096, + 1097, 1100, 1101, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1125, 1126, 1127, 1129, 1130, 1131, 1132, + 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, + 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, + 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1163, + 1165, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, + 1178, 1186, 1187, 1191, 1192, 1201 }; // Print the state stack on the debug stream. @@ -3653,7 +3667,7 @@ namespace yy } const int parser::yyeof_ = 0; - const int parser::yylast_ = 1473; + const int parser::yylast_ = 1465; const int parser::yynnts_ = 185; const int parser::yyempty_ = -2; const int parser::yyfinal_ = 152; @@ -3666,7 +3680,7 @@ namespace yy } // namespace yy -#line 1210 "DynareBison.yy" +#line 1203 "DynareBison.yy" void diff --git a/parser.src/DynareBison.yy b/parser.src/DynareBison.yy index 9527de975..ceee068c8 100644 --- a/parser.src/DynareBison.yy +++ b/parser.src/DynareBison.yy @@ -7,11 +7,7 @@ using namespace std; class ParsingDriver; -#include "SymbolTableTypes.hh" #include "ExprNode.hh" - -//! Type for semantic value of non-derivable expressions -typedef pair ExpObj; %} %parse-param { ParsingDriver &driver } @@ -30,8 +26,7 @@ typedef pair ExpObj; %union { string *string_val; - ExpObj *exp_val; - NodeID model_val; + NodeID node_val; }; %{ @@ -75,8 +70,8 @@ typedef pair ExpObj; %nonassoc POWER %token EXP LOG LOG10 SIN COS TAN ASIN ACOS ATAN SINH COSH TANH ASINH ACOSH ATANH SQRT -%type expression comma_expression -%type equation hand_side model_var +%type expression +%type equation hand_side model_var %type signed_float signed_integer prior %type value filename filename_elem vec_int_elem vec_int_1 vec_int %type calib_arg2 range @@ -255,54 +250,52 @@ cutoff | NAME {$$ = driver.add_expression_variable($1);} | FLOAT_NUMBER - {$$ = driver.add_expression_constant($1);} + {$$ = driver.add_constant($1);} | INT_NUMBER - {$$ = driver.add_expression_constant($1);} + {$$ = driver.add_constant($1);} | expression PLUS expression - {$$ = driver.add_expression_token($1, $3, token::PLUS);} + {$$ = driver.add_plus($1, $3);} | expression MINUS expression - {$$ = driver.add_expression_token($1, $3, token::MINUS);} + {$$ = driver.add_minus($1, $3);} | expression DIVIDE expression - {$$ = driver.add_expression_token($1, $3, token::DIVIDE);} + {$$ = driver.add_divide($1, $3);} | expression TIMES expression - {$$ = driver.add_expression_token($1, $3, token::TIMES);} + {$$ = driver.add_times($1, $3);} | expression POWER expression - {$$ = driver.add_expression_token($1, $3, token::POWER);} + {$$ = driver.add_power($1, $3);} | MINUS expression %prec UMINUS - {$$ = driver.add_expression_token($2, token::UMINUS);} + {$$ = driver.add_uminus($2);} | PLUS expression {$$ = $2;} | EXP '(' expression ')' - {$$ = driver.add_expression_token($3, token::EXP);} + {$$ = driver.add_exp($3);} | LOG '(' expression ')' - {$$ = driver.add_expression_token($3, token::LOG);} + {$$ = driver.add_log($3);} | LOG10 '(' expression ')' - {$$ = driver.add_expression_token($3, token::LOG10);} + {$$ = driver.add_log10($3);} | SIN '(' expression ')' - {$$ = driver.add_expression_token($3, token::SIN);} + {$$ = driver.add_sin($3);} | COS '(' expression ')' - {$$ = driver.add_expression_token($3, token::COS);} + {$$ = driver.add_cos($3);} | TAN '(' expression ')' - {$$ = driver.add_expression_token($3, token::TAN);} + {$$ = driver.add_tan($3);} | ASIN '(' expression ')' - {$$ = driver.add_expression_token($3, token::ASIN);} + {$$ = driver.add_asin($3);} | ACOS '(' expression ')' - {$$ = driver.add_expression_token($3, token::ACOS);} + {$$ = driver.add_acos($3);} | ATAN '(' expression ')' - {$$ = driver.add_expression_token($3, token::ATAN);} + {$$ = driver.add_atan($3);} | SQRT '(' expression ')' - {$$ = driver.add_expression_token($3, token::SQRT);} - | NAME '(' expression ')' - {$$ = driver.add_expression_token($3, $1);} + {$$ = driver.add_sqrt($3);} | NAME '(' comma_expression ')' - {$$ = driver.add_expression_token($3, $1);} + {$$ = driver.add_unknown_function($1);} ; comma_expression : - expression COMMA expression - {$$ = driver.add_expression_token($1, $3, token::COMMA);} + expression + { driver.add_unknown_function_arg($1); } | comma_expression COMMA expression - {$$ = driver.add_expression_token($1, $3, token::COMMA);} + { driver.add_unknown_function_arg($3); } initval : INITVAL ';' initval_list END @@ -356,15 +349,15 @@ cutoff ; model - : MODEL ';' { driver.begin_model(); } equation_list END + : MODEL ';' { driver.begin_model(); } equation_list END { driver.reset_data_tree(); } | MODEL '(' o_linear ')' ';' { driver.begin_model(); } - equation_list END + equation_list END { driver.reset_data_tree(); } | MODEL '(' USE_DLL ')' ';' { driver.begin_model(); driver.use_dll(); } - equation_list END - | MODEL '(' SPARSE_DLL COMMA model_sparse_options_list ')' { driver.sparse_dll(); driver.begin_model(); } ';' - equation_list END - | MODEL '(' SPARSE_DLL ')' { driver.sparse_dll(); driver.begin_model(); } ';' - equation_list END + equation_list END { driver.reset_data_tree(); } + | MODEL '(' SPARSE_DLL COMMA model_sparse_options_list ')' { driver.begin_model(); driver.sparse_dll(); } ';' + equation_list END { driver.reset_data_tree(); } + | MODEL '(' SPARSE_DLL ')' { driver.begin_model(); driver.sparse_dll(); } ';' + equation_list END { driver.reset_data_tree(); } ; equation_list @@ -385,43 +378,43 @@ cutoff : '(' hand_side ')' {$$ = $2;} | model_var | FLOAT_NUMBER - {$$ = driver.add_model_constant($1);} + {$$ = driver.add_constant($1);} | INT_NUMBER - {$1->append(".0"); $$ = driver.add_model_constant($1);} + {$1->append(".0"); $$ = driver.add_constant($1);} | hand_side PLUS hand_side - {$$ = driver.add_model_plus($1, $3);} + {$$ = driver.add_plus($1, $3);} | hand_side MINUS hand_side - {$$ = driver.add_model_minus($1, $3);} + {$$ = driver.add_minus($1, $3);} | hand_side DIVIDE hand_side - {$$ = driver.add_model_divide($1, $3);} + {$$ = driver.add_divide($1, $3);} | hand_side TIMES hand_side - {$$ = driver.add_model_times($1, $3);} + {$$ = driver.add_times($1, $3);} | hand_side POWER hand_side - {$$ = driver.add_model_power($1, $3);} + {$$ = driver.add_power($1, $3);} | MINUS hand_side %prec UMINUS - { $$ = driver.add_model_uminus($2);} + { $$ = driver.add_uminus($2);} | PLUS hand_side {$$ = $2;} | EXP '(' hand_side ')' - {$$ = driver.add_model_exp($3);} + {$$ = driver.add_exp($3);} | LOG '(' hand_side ')' - {$$ = driver.add_model_log($3);} + {$$ = driver.add_log($3);} | LOG10 '(' hand_side ')' - {$$ = driver.add_model_log10($3);} + {$$ = driver.add_log10($3);} | SIN '(' hand_side ')' - {$$ = driver.add_model_sin($3);} + {$$ = driver.add_sin($3);} | COS '(' hand_side ')' - {$$ = driver.add_model_cos($3);} + {$$ = driver.add_cos($3);} | TAN '(' hand_side ')' - {$$ = driver.add_model_tan($3);} + {$$ = driver.add_tan($3);} | ASIN '(' hand_side ')' - {$$ = driver.add_model_asin($3);} + {$$ = driver.add_asin($3);} | ACOS '(' hand_side ')' - {$$ = driver.add_model_acos($3);} + {$$ = driver.add_acos($3);} | ATAN '(' hand_side ')' - {$$ = driver.add_model_atan($3);} + {$$ = driver.add_atan($3);} | SQRT '(' hand_side ')' - {$$ = driver.add_model_sqrt($3);} + {$$ = driver.add_sqrt($3);} ; pound_expression: '#' NAME EQUAL hand_side ';' @@ -478,17 +471,17 @@ cutoff value_list : value_list signed_float - {driver.add_value($2);} + {driver.add_value_const($2);} | value_list signed_integer - {driver.add_value($2);} + {driver.add_value_const($2);} | value_list NAME - {driver.add_value($2);} + {driver.add_value_var($2);} | signed_float - {driver.add_value($1);} + {driver.add_value_const($1);} | signed_integer - {driver.add_value($1);} + {driver.add_value_const($1);} | NAME - {driver.add_value($1);} + {driver.add_value_var($1);} | value_list '(' expression ')' {driver.add_value($3);} | '(' expression ')' @@ -511,21 +504,21 @@ cutoff : triangular_row COMMA '(' expression ')' {driver.add_to_row($4);} | triangular_row COMMA FLOAT_NUMBER - {driver.add_to_row($3);} + {driver.add_to_row_const($3);} | triangular_row COMMA INT_NUMBER - {driver.add_to_row($3);} + {driver.add_to_row_const($3);} | triangular_row '(' expression ')' {driver.add_to_row($3);} | triangular_row FLOAT_NUMBER - {driver.add_to_row($2);} + {driver.add_to_row_const($2);} | triangular_row INT_NUMBER - {driver.add_to_row($2);} + {driver.add_to_row_const($2);} | '(' expression ')' {driver.add_to_row($2);} | FLOAT_NUMBER - {driver.add_to_row($1);} + {driver.add_to_row_const($1);} | INT_NUMBER - {driver.add_to_row($1);} + {driver.add_to_row_const($1);} ; steady diff --git a/parser.src/ExprNode.cc b/parser.src/ExprNode.cc index a20e0daf3..4f0c20a8d 100644 --- a/parser.src/ExprNode.cc +++ b/parser.src/ExprNode.cc @@ -84,6 +84,12 @@ ExprNode::computeTemporaryTerms(map &reference_count, // Nothing to do for a terminal node } +void +ExprNode::writeOutput(ostream &output) +{ + writeOutput(output, oMatlabOutsideModel, temporary_terms_type()); +} + NumConstNode::NumConstNode(DataTree &datatree_arg, int id_arg) : ExprNode(datatree_arg), id(id_arg) @@ -114,10 +120,10 @@ NumConstNode::writeOutput(ostream &output, ExprNodeOutputType output_type, output << datatree.num_constants.get(id); } -void -NumConstNode::Evaluate() const +double +NumConstNode::eval(const eval_context_type &eval_context) const throw (EvalException) { - datatree.interprete_.Stack.push(atof(datatree.num_constants.get(id).c_str())); + return(atof(datatree.num_constants.get(id).c_str())); } void @@ -125,13 +131,23 @@ NumConstNode::collectEndogenous(NodeID &Id) { } -VariableNode::VariableNode(DataTree &datatree_arg, int id_arg, Type type_arg) : +VariableNode::VariableNode(DataTree &datatree_arg, int symb_id_arg, Type type_arg, int lag_arg) : ExprNode(datatree_arg), - id(id_arg), - type(type_arg) + symb_id(symb_id_arg), + type(type_arg), + lag(lag_arg) { // Add myself to the variable map - datatree.variable_node_map[make_pair(id, type)] = this; + datatree.variable_node_map[make_pair(make_pair(symb_id, type), lag)] = this; + + // Add myself to the variable table if necessary and initialize var_id + if (type == eEndogenous + || type == eExogenousDet + || type == eExogenous + || type == eRecursiveVariable) + var_id = datatree.variable_table.AddVariable(datatree.symbol_table.getNameByID(type, symb_id), lag); + else + var_id = -1; // Fill in non_null_derivatives switch(type) @@ -141,21 +157,15 @@ VariableNode::VariableNode(DataTree &datatree_arg, int id_arg, Type type_arg) : case eExogenousDet: case eRecursiveVariable: // For a variable, the only non-null derivative is with respect to itself - non_null_derivatives.insert(id); + non_null_derivatives.insert(var_id); break; case eParameter: // All derivatives are null, do nothing break; case eLocalParameter: // Non null derivatives are those of the value of the local parameter - non_null_derivatives = datatree.local_parameters_table[id]->non_null_derivatives; + non_null_derivatives = datatree.local_parameters_table[symb_id]->non_null_derivatives; break; - case eNumericalConstant: - case eUNDEF: - case eTempResult: - // Impossible cases - cerr << "Incorrect symbol type used in VariableNode" << endl; - exit(-1); } } @@ -168,20 +178,14 @@ VariableNode::computeDerivative(int varID) case eExogenous: case eExogenousDet: case eRecursiveVariable: - if (varID == id) + if (varID == var_id) return datatree.One; else return datatree.Zero; case eParameter: return datatree.Zero; case eLocalParameter: - return datatree.local_parameters_table[id]->getDerivative(varID); - case eNumericalConstant: - case eUNDEF: - case eTempResult: - // Impossible cases - cerr << "Incorrect symbol type used in VariableNode" << endl; - exit(-1); + return datatree.local_parameters_table[symb_id]->getDerivative(varID); } cerr << "Impossible case!" << endl; exit(-1); @@ -201,18 +205,19 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type, output << "T" << idx << "[it_]"; return; } - int idx, lag; + + int i; switch(type) { case eParameter: if (output_type == oMatlabOutsideModel) - output << "M_.params" << "(" << id + 1 << ")"; + output << "M_.params" << "(" << symb_id + 1 << ")"; else - output << "params" << LPAR(output_type) << id + OFFSET(output_type) << RPAR(output_type); + output << "params" << LPAR(output_type) << symb_id + OFFSET(output_type) << RPAR(output_type); break; case eLocalParameter: - output << datatree.symbol_table.getNameByID(eLocalParameter, id); + output << datatree.symbol_table.getNameByID(eLocalParameter, symb_id); break; case eEndogenous: @@ -220,55 +225,52 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type, { case oMatlabDynamicModel: case oCDynamicModel: - idx = datatree.variable_table.getPrintIndex(id) + OFFSET(output_type); - output << "y" << LPAR(output_type) << idx << RPAR(output_type); + i = datatree.variable_table.getPrintIndex(var_id) + OFFSET(output_type); + output << "y" << LPAR(output_type) << i << RPAR(output_type); break; case oMatlabStaticModel: case oCStaticModel: - idx = datatree.variable_table.getSymbolID(id) + OFFSET(output_type); - output << "y" << LPAR(output_type) << idx << RPAR(output_type); + i = symb_id + OFFSET(output_type); + output << "y" << LPAR(output_type) << i << RPAR(output_type); break; case oCDynamicModelSparseDLL: - idx = datatree.variable_table.getSymbolID(id); - lag = datatree.variable_table.getLag((long int) id); if (lag > 0) - output << "y" << LPAR(output_type) << "(it_+" << lag << ")*y_size+" << idx << RPAR(output_type); + output << "y" << LPAR(output_type) << "(it_+" << lag << ")*y_size+" << symb_id << RPAR(output_type); else if (lag < 0) - output << "y" << LPAR(output_type) << "(it_" << lag << ")*y_size+" << idx << RPAR(output_type); + output << "y" << LPAR(output_type) << "(it_" << lag << ")*y_size+" << symb_id << RPAR(output_type); else - output << "y" << LPAR(output_type) << "Per_y_+" << idx << RPAR(output_type); + output << "y" << LPAR(output_type) << "Per_y_+" << symb_id << RPAR(output_type); break; case oMatlabOutsideModel: - output << "oo_.steady_state" << "(" << id + 1 << ")"; + output << "oo_.steady_state" << "(" << symb_id + 1 << ")"; break; } break; case eExogenous: - idx = datatree.variable_table.getSymbolID(id) + OFFSET(output_type); - lag = datatree.variable_table.getLag(id); + i = symb_id + OFFSET(output_type); switch(output_type) { case oMatlabDynamicModel: if (lag > 0) - output << "x(it_+" << lag << ", " << idx << ")"; + output << "x(it_+" << lag << ", " << i << ")"; else if (lag < 0) - output << "x(it_" << lag << ", " << idx << ")"; + output << "x(it_" << lag << ", " << i << ")"; else - output << "x(it_, " << idx << ")"; + output << "x(it_, " << i << ")"; break; case oCDynamicModel: + case oCDynamicModelSparseDLL: if (lag == 0) - output << "x[it_+" << idx << "*nb_row_x]"; + output << "x[it_+" << i << "*nb_row_x]"; else if (lag > 0) - output << "x[it_+" << lag << "+" << idx << "*nb_row_x]"; + output << "x[it_+" << lag << "+" << i << "*nb_row_x]"; else - output << "x[it_" << lag << "+" << idx << "*nb_row_x]"; + output << "x[it_" << lag << "+" << i << "*nb_row_x]"; break; case oMatlabStaticModel: case oCStaticModel: - case oCDynamicModelSparseDLL: - output << "x" << LPAR(output_type) << idx << RPAR(output_type); + output << "x" << LPAR(output_type) << i << RPAR(output_type); break; case oMatlabOutsideModel: if (lag != 0) @@ -276,36 +278,35 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type, cerr << "VariableNode::writeOutput: lag != 0 for exogenous variable outside model scope!" << endl; exit(-1); } - output << "oo_.exo_steady_state" << "(" << idx << ")"; + output << "oo_.exo_steady_state" << "(" << i << ")"; break; } break; case eExogenousDet: - idx = datatree.variable_table.getSymbolID(id) + datatree.symbol_table.exo_nbr + OFFSET(output_type); - lag = datatree.variable_table.getLag(id); + i = symb_id + datatree.symbol_table.exo_nbr + OFFSET(output_type); switch(output_type) { case oMatlabDynamicModel: if (lag > 0) - output << "x(it_+" << lag << ", " << idx << ")"; + output << "x(it_+" << lag << ", " << i << ")"; else if (lag < 0) - output << "x(it_" << lag << ", " << idx << ")"; + output << "x(it_" << lag << ", " << i << ")"; else - output << "x(it_, " << idx << ")"; + output << "x(it_, " << i << ")"; break; case oCDynamicModel: + case oCDynamicModelSparseDLL: if (lag == 0) - output << "x[it_+" << idx << "*nb_row_xd]"; + output << "x[it_+" << i << "*nb_row_xd]"; else if (lag > 0) - output << "x[it_+" << lag << "+" << idx << "*nb_row_xd]"; + output << "x[it_+" << lag << "+" << i << "*nb_row_xd]"; else - output << "x[it_" << lag << "+" << idx << "*nb_row_xd]"; + output << "x[it_" << lag << "+" << i << "*nb_row_xd]"; break; case oMatlabStaticModel: case oCStaticModel: - case oCDynamicModelSparseDLL: - output << "x" << LPAR(output_type) << idx << RPAR(output_type); + output << "x" << LPAR(output_type) << i << RPAR(output_type); break; case oMatlabOutsideModel: if (lag != 0) @@ -313,7 +314,7 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type, cerr << "VariableNode::writeOutput: lag != 0 for exogenous determistic variable outside model scope!" << endl; exit(-1); } - output << "oo_.exo_det_steady_state" << "(" << datatree.variable_table.getSymbolID(id) + 1 << ")"; + output << "oo_.exo_det_steady_state" << "(" << symb_id + 1 << ")"; break; } break; @@ -321,33 +322,27 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type, case eRecursiveVariable: cerr << "Recursive variable not implemented" << endl; exit(-1); - case eTempResult: - case eNumericalConstant: - case eUNDEF: - // Impossible cases - cerr << "Incorrect symbol type used in VariableNode" << endl; - exit(-1); } } -void -VariableNode::Evaluate() const +double +VariableNode::eval(const eval_context_type &eval_context) const throw (EvalException) { - if (type == eParameter) - datatree.interprete_.Stack.push(datatree.interprete_.GetDataValue(id, type)); - else - datatree.interprete_.Stack.push(datatree.interprete_.GetDataValue(datatree.variable_table.getSymbolID(id), type)); + if (lag != 0) + throw EvalException(); + + eval_context_type::const_iterator it = eval_context.find(make_pair(symb_id, type)); + if (it == eval_context.end()) + throw EvalException(); + + return it->second; } void VariableNode::collectEndogenous(NodeID &Id) { - int idx; if (type == eEndogenous) - { - idx = datatree.variable_table.getSymbolID(id); - Id->present_endogenous.insert(make_pair(idx, datatree.variable_table.getLag((long int) id))); - } + Id->present_endogenous.insert(make_pair(symb_id, lag)); } UnaryOpNode::UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg) : @@ -663,67 +658,50 @@ UnaryOpNode::writeOutput(ostream &output, ExprNodeOutputType output_type, output << ")"; } -void -UnaryOpNode::Evaluate() const +double +UnaryOpNode::eval(const eval_context_type &eval_context) const throw (EvalException) { - this->arg->Evaluate(); - datatree.interprete_.u2 = datatree.interprete_.Stack.top(); - datatree.interprete_.Stack.pop(); + double v = arg->eval(eval_context); + switch(op_code) { case oUminus: - datatree.interprete_.u1=-datatree.interprete_.u2; - break; + return(-v); case oExp: - datatree.interprete_.u1=exp(datatree.interprete_.u2); - break; + return(exp(v)); case oLog: - datatree.interprete_.u1=log(datatree.interprete_.u2); - break; + return(log(v)); case oLog10: - datatree.interprete_.u1=log10(datatree.interprete_.u2); - break; + return(log10(v)); case oCos: - datatree.interprete_.u1=cos(datatree.interprete_.u2); - break; + return(cos(v)); case oSin: - datatree.interprete_.u1=sin(datatree.interprete_.u2); - break; + return(sin(v)); case oTan: - datatree.interprete_.u1=tan(datatree.interprete_.u2); - break; + return(tan(v)); case oAcos: - datatree.interprete_.u1=acos(datatree.interprete_.u2); - break; + return(acos(v)); case oAsin: - datatree.interprete_.u1=asin(datatree.interprete_.u2); - break; + return(asin(v)); case oAtan: - datatree.interprete_.u1=atan(datatree.interprete_.u2); - break; + return(atan(v)); case oCosh: - datatree.interprete_.u1=cosh(datatree.interprete_.u2); - break; + return(cosh(v)); case oSinh: - datatree.interprete_.u1=sinh(datatree.interprete_.u2); - break; + return(sinh(v)); case oTanh: - datatree.interprete_.u1=tanh(datatree.interprete_.u2); - break; + return(tanh(v)); case oAcosh: - datatree.interprete_.u1=acosh(datatree.interprete_.u2); - break; + return(acosh(v)); case oAsinh: - datatree.interprete_.u1=asinh(datatree.interprete_.u2); - break; + return(asinh(v)); case oAtanh: - datatree.interprete_.u1=atanh(datatree.interprete_.u2); - break; + return(atanh(v)); case oSqrt: - datatree.interprete_.u1=sqrt(datatree.interprete_.u2); - break; + return(sqrt(v)); } - datatree.interprete_.Stack.push(datatree.interprete_.u1); + // Impossible + throw EvalException(); } void @@ -928,37 +906,28 @@ BinaryOpNode::computeTemporaryTerms(map &reference_count, } } -void -BinaryOpNode::Evaluate() const +double +BinaryOpNode::eval(const eval_context_type &eval_context) const throw (EvalException) { - // Write current operator symbol - this->arg1->Evaluate(); - this->arg2->Evaluate(); - datatree.interprete_.u2 = datatree.interprete_.Stack.top(); - datatree.interprete_.Stack.pop(); - datatree.interprete_.u1 = datatree.interprete_.Stack.top(); - datatree.interprete_.Stack.pop(); + double v1 = arg1->eval(eval_context); + double v2 = arg2->eval(eval_context); + switch(op_code) { case oPlus: - datatree.interprete_.u1+=datatree.interprete_.u2; - break; + return(v1 + v2); case oMinus: - datatree.interprete_.u1-=datatree.interprete_.u2; - break; + return(v1 - v2); case oTimes: - datatree.interprete_.u1*=datatree.interprete_.u2; - break; + return(v1 * v2); case oDivide: - datatree.interprete_.u1/=datatree.interprete_.u2; - break; + return(v1 / v2); case oPower: - datatree.interprete_.u1=pow(datatree.interprete_.u1,datatree.interprete_.u2); - break; + return(pow(v1, v2)); case oEqual: - break; + default: + throw EvalException(); } - datatree.interprete_.Stack.push(datatree.interprete_.u1); } void @@ -1060,3 +1029,67 @@ BinaryOpNode::collectEndogenous(NodeID &Id) arg1->collectEndogenous(Id); arg2->collectEndogenous(Id); } + +UnknownFunctionNode::UnknownFunctionNode(DataTree &datatree_arg, + const string &function_name_arg, + const vector &arguments_arg) : + ExprNode(datatree_arg), + function_name(function_name_arg), + arguments(arguments_arg) +{ +} + +NodeID +UnknownFunctionNode::computeDerivative(int varID) +{ + cerr << "UnknownFunctionNode::computeDerivative: operation impossible!" << endl; + exit(-1); +} + +void +UnknownFunctionNode::computeTemporaryTerms(map &reference_count, + temporary_terms_type &temporary_terms, + bool is_matlab) const +{ + cerr << "UnknownFunctionNode::computeTemporaryTerms: operation impossible!" << endl; + exit(-1); +} + +void UnknownFunctionNode::writeOutput(ostream &output, ExprNodeOutputType output_type, + const temporary_terms_type &temporary_terms) const +{ + output << function_name << "("; + for(vector::const_iterator it = arguments.begin(); + it != arguments.end(); it++) + { + if (it != arguments.begin()) + output << ","; + + (*it)->writeOutput(output, output_type, temporary_terms); + } + output << ")"; +} + +void +UnknownFunctionNode::computeTemporaryTerms(map &reference_count, + temporary_terms_type &temporary_terms, + map &first_occurence, + int Curr_block, + Model_Block *ModelBlock) const +{ + cerr << "UnknownFunctionNode::computeTemporaryTerms: not implemented" << endl; + exit(-1); +} + +void +UnknownFunctionNode::collectEndogenous(NodeID &Id) +{ + cerr << "UnknownFunctionNode::collectEndogenous: not implemented" << endl; + exit(-1); +} + +double +UnknownFunctionNode::eval(const eval_context_type &eval_context) const throw (EvalException) +{ + throw EvalException(); +} diff --git a/parser.src/Expression.cc b/parser.src/Expression.cc deleted file mode 100644 index acd0cc27b..000000000 --- a/parser.src/Expression.cc +++ /dev/null @@ -1,285 +0,0 @@ -/*! \file - \version 1.0 - \date 04/09/2004 - \par This file implements the Expression class methodes. -*/ -//------------------------------------------------------------------------------ -#include -using namespace std; -//------------------------------------------------------------------------------ -#include "Expression.hh" -#include "OperatorTable.hh" - -Expression::Expression() -{ - // Empty -} - -//------------------------------------------------------------------------------ -Expression::~Expression() -{ - // Empty -} - -void -Expression::setNumericalConstants(NumericalConstants *num_constants_arg) -{ - num_constants = num_constants_arg; -} - -int Expression::AddToken(int id1,Type type1,int id2,Type type2,int op_code) -{ - Token token; - // Making token structure - token.id1 = id1; - token.type1 = type1; - token.id2 = id2; - token.type2 = type2; - token.op_code = op_code; - token.op_name = OperatorTable::str(op_code); - // Inserting token into expression_list - expression_list.push_back(token); - return expression_list.size() -1; -} - -//------------------------------------------------------------------------------ -int Expression::AddToken(int id1,Type type1,int op_code) -{ - Token token; - // Making token structure - token.id1 = id1; - token.type1 = type1; - token.id2 = -1; - token.type2 = eUNDEF; - token.op_code = op_code; - token.op_name = OperatorTable::str(op_code);; - // Inserting token into expression_list - expression_list.push_back(token); - return expression_list.size() -1; -} - -//------------------------------------------------------------------------------ -int Expression::AddToken(int id1,Type type1, string ufunction) -{ - Token token; - // Making token structure - token.id1 = id1; - token.type1 = type1; - token.id2 = -1; - token.type2 = eUNDEF; - token.op_code = token::NAME; - token.op_name = ufunction; - // Inserting token into expression_list - expression_list.push_back(token); - return expression_list.size() -1; -} - -//------------------------------------------------------------------------------ -void Expression::set(void) -{ - // Stack of temporary tokens - stack > stack_token; - // Dtack of temporary expressions - stack > stack_expression; - // Temporary output - ostringstream exp; - // temporary variables for saving arguments and name oparator - string argument1, argument2, op_name; - // Define type for type operator (binary or unary) - enum OperatorType - { - unary, - binary - }; - OperatorType op_type; - int current_op, last_op; - - // Clearing output string - output.str(""); - // Starting from the end of list - stack_token.push(expression_list.back()); - // Main loop : - // Repeat for last token from the stack - // (1) if argument is temporary result, and not yet followed, - // set it as followed (flag) and push corresponding token - // on the token stack - // (2) argument followed, or final argument - // (2.1) if argument is followed - // - set argument1 (or argument2) by last expression on - // expression tack - // - pop last expression from expression stack - // (2.2) if final argument - // set argument1 (or argument2) by final argument - // (3) set op_name by last token from the token stack - // (3) pop last token from the token stack - // (4) write temporary expression (using argument1, argument2 - // and op_name) and push it on the expression stack - // (5) - - while (stack_token.size() > 0) - { - // First argument is a temporary result, - // pushing token on token stack and setting that argument to be followed - if ((stack_token.top().type1 == eTempResult) && - (stack_token.top().followed1 == false)) - { - stack_token.top().followed1 = true; - stack_token.push(expression_list[stack_token.top().id1]); - } - // Second argument is a temporary result, - // pushing token on stack and setting that argument to be followed - else if ((stack_token.top().type2 == eTempResult) && - (stack_token.top().followed2 == false)) - { - stack_token.top().followed2 = true; - stack_token.push(expression_list[stack_token.top().id2]); - } - // Writing expression - else - { - // Final token, no argment followed - if ((stack_token.top().followed1 == false) && - (stack_token.top().followed2 == false)) - { - argument1 = getArgument(stack_token.top().type1,stack_token.top().id1); - current_op = stack_token.top().op_code; - // Testing if unary or binary token - if (stack_token.top().id2 >= 0) - { - argument2 = getArgument(stack_token.top().type2,stack_token.top().id2); - op_type = binary; - } - else - { - op_type = unary; - } - } - // Both arguments are followed, writing stacked expressions - else if ((stack_token.top().followed1 == true) && - (stack_token.top().followed2 == true)) - { - // Testing if unary or binary token - if (stack_token.top().id2 >= 0) - { - argument2 = stack_expression.top(); - stack_expression.pop(); - op_type = binary; - - } - else - { - op_type = unary; - } - argument1 = stack_expression.top(); - current_op = stack_token.top().op_code; - stack_expression.pop(); - - } - // Only argument 1 is followed, combining expressions - else if (stack_token.top().followed1 == true) - { - argument1 = stack_expression.top(); - current_op = stack_token.top().op_code; - stack_expression.pop(); - // Testing if unary or binary token - if (stack_token.top().id2 >= 0) - { - argument2 = getArgument(stack_token.top().type2,stack_token.top().id2); - op_type = binary; - } - else - { - op_type = unary; - } - } - // Only argument 2 is followed, combining experssions - else if (stack_token.top().followed2 == true) - { - argument1 = getArgument(stack_token.top().type1,stack_token.top().id1); - argument2 = stack_expression.top(); - stack_expression.pop(); - current_op = stack_token.top().op_code; - op_type = binary; - } - op_name = stack_token.top().op_name; - exp.str(""); - stack_token.pop(); - // Saving last operator for the followed argument - if (stack_token.size() > 0) - { - last_op = stack_token.top().op_code; - } - else - { - last_op = current_op; - } - if (op_type == binary) - { - // Comma operator, no parentheses - // parentheses are writing with function operator - if (current_op == token::COMMA) - { - exp << argument1 << op_name << argument2 ; - } - else - { - exp << "(" << argument1 << op_name << argument2 << ")"; - } - } - else - { - // Case of functions - if (OperatorTable::isfunction(current_op) == true) - exp << op_name << "(" << argument1 << ")"; - else - exp << "(" << op_name << argument1 << ")"; - } - stack_expression.push(exp.str()); - - } - } - output << stack_expression.top(); - expression_list.clear(); -} - -//------------------------------------------------------------------------------ -string Expression::getArgument(Type type,int id) -{ - ostringstream argument; - - if (type == eExogenous) - { - argument << "oo_.exo_steady_state"<< "(" << id+1 << ")"; - } - else if (type == eExogenousDet) - { - argument << "oo_.exo_det_steady_state" << "(" << id+1 << ")"; - } - else if (type == eEndogenous) - { - argument << "oo_.steady_state" << "(" << id+1 << ")"; - } - else if (type == eParameter) - { - argument << "M_.params" << "(" << id+1 << ")"; - } - else if (type == eNumericalConstant) - { - argument << num_constants->get(id); - } - return argument.str(); -} - -//------------------------------------------------------------------------------ -string Expression::get() -{ - return output.str(); -} - -//------------------------------------------------------------------------------ -void Expression::clear(void) -{ - expression_list.clear(); -} - -//------------------------------------------------------------------------------ diff --git a/parser.src/Makefile b/parser.src/Makefile index 58be55227..c22f7d581 100644 --- a/parser.src/Makefile +++ b/parser.src/Makefile @@ -37,7 +37,6 @@ COMMON_OBJ=\ DynareBison.o\ ComputingTasks.o\ DynareMain.o\ - Expression.o\ ModelTree.o\ NumericalConstants.o\ NumericalInitialization.o\ @@ -56,7 +55,6 @@ COMMON_OBJ=\ ModelBlocks.o \ BlockTriangular.o \ Model_Graph.o \ - interprete.o \ SymbolGaussElim.o MATLAB_OBJ = InterfaceMatlab.o diff --git a/parser.src/ModFile.cc b/parser.src/ModFile.cc index 6dd2a3a6c..55ec564ec 100644 --- a/parser.src/ModFile.cc +++ b/parser.src/ModFile.cc @@ -4,7 +4,8 @@ #include "ModFile.hh" #include "Interface.hh" -ModFile::ModFile() : model_tree(symbol_table, num_constants), +ModFile::ModFile() : expressions_tree(symbol_table, num_constants), + model_tree(symbol_table, num_constants), linear(false) { } @@ -59,7 +60,7 @@ ModFile::computingPass() model_tree.computeThirdDerivatives = true; } - model_tree.computingPass(); + model_tree.computingPass(global_eval_context); for(vector::iterator it = statements.begin(); it != statements.end(); it++) diff --git a/parser.src/ModelTree.cc b/parser.src/ModelTree.cc index 0da1817de..cc3b2e43b 100644 --- a/parser.src/ModelTree.cc +++ b/parser.src/ModelTree.cc @@ -15,6 +15,7 @@ ModelTree::ModelTree(SymbolTable &symbol_table_arg, DataTree(symbol_table_arg, num_constants_arg), mode(eStandardMode), compiler(LCC_COMPILE), + cutoff(1e-6), computeJacobian(false), computeJacobianExo(false), computeHessian(false), @@ -752,7 +753,7 @@ ModelTree::writeStaticModel(ostream &StaticOutput) const } // Writing ouputs - if (mode == eStandardMode) + if (mode != eDLLMode) { StaticOutput << "global M_ \n"; StaticOutput << "if M_.param_nbr > 0\n params = M_.params;\nend\n"; @@ -1785,8 +1786,8 @@ ModelTree::checkPass() const } } -inline void -ModelTree::Evaluate_Jacobian() +void +ModelTree::evaluateJacobian(const eval_context_type &eval_context) { int i=0; bool *IM; @@ -1797,9 +1798,7 @@ ModelTree::Evaluate_Jacobian() if (variable_table.getType(it->first.second) == eEndogenous) { NodeID Id = it->second; - Id->Evaluate(); - interprete_.u1 = interprete_.Stack.top(); - interprete_.Stack.pop(); + double val = Id->eval(eval_context); int eq=it->first.first; int var=variable_table.getSymbolID(it->first.second); int k1=variable_table.getLag(it->first.second); @@ -1808,7 +1807,7 @@ ModelTree::Evaluate_Jacobian() IM=block_triangular.bGet_IM(k1); a_variable_lag=k1; } - if (IM[eq*symbol_table.endo_nbr+var] && (fabs(interprete_.u1)0) - cout << i << " elements in the incidence matrices are below the cutoff (" << interprete_.cutoff << ") and are discarded\n"; + cout << i << " elements in the incidence matrices are below the cutoff (" << cutoff << ") and are discarded\n"; } -inline void +void ModelTree::BlockLinear(Model_Block *ModelBlock) { int i,j,l,m; @@ -1881,7 +1880,7 @@ ModelTree::BlockLinear(Model_Block *ModelBlock) } void -ModelTree::computingPass() +ModelTree::computingPass(const eval_context_type &eval_context) { cout << equations.size() << " equation(s) found" << endl; @@ -1906,8 +1905,7 @@ ModelTree::computingPass() int HSize; int *Table=variable_table.GetVariableTable(&Size,&HSize); - interprete_.create_id_map(Table,Size,HSize); - Evaluate_Jacobian(); + evaluateJacobian(eval_context); if (block_triangular.bt_verbose) { diff --git a/parser.src/NumericalInitialization.cc b/parser.src/NumericalInitialization.cc index 1c99143a1..90ae99272 100644 --- a/parser.src/NumericalInitialization.cc +++ b/parser.src/NumericalInitialization.cc @@ -2,7 +2,7 @@ #include "Interface.hh" InitParamStatement::InitParamStatement(const string ¶m_name_arg, - const string ¶m_value_arg, + const NodeID param_value_arg, const SymbolTable &symbol_table_arg) : param_name(param_name_arg), param_value(param_value_arg), @@ -14,7 +14,9 @@ void InitParamStatement::writeOutput(ostream &output, const string &basename) const { int id = symbol_table.getID(param_name) + 1; - output << "M_.params( " << id << " ) = " << param_value << ";\n"; + output << "M_.params( " << id << " ) = "; + param_value->writeOutput(output); + output << ";" << endl; output << param_name << " = M_.params( " << id << " );\n"; } @@ -32,17 +34,21 @@ InitOrEndValStatement::writeInitValues(ostream &output) const it != init_values.end(); it++) { const string &name = it->first; - const string &expression = it->second; + const NodeID expression = it->second; Type type = symbol_table.getType(name); int id = symbol_table.getID(name) + 1; if (type == eEndogenous) - output << "oo_.steady_state( " << id << " ) = " << expression << ";\n"; + output << "oo_.steady_state"; else if (type == eExogenous) - output << "oo_.exo_steady_state( " << id << " ) = " << expression << ";\n"; + output << "oo_.exo_steady_state"; else if (type == eExogenousDet) - output << "oo_.exo_det_steady_state( " << id << " ) = " << expression << ";\n"; + output << "oo_.exo_det_steady_state"; + + output << "( " << id << " ) = "; + expression->writeOutput(output); + output << ";" << endl; } } @@ -111,16 +117,19 @@ HistValStatement::writeOutput(ostream &output, const string &basename) const { const string &name = it->first.first; const int &lag = it->first.second; - const string &expression = it->second; + const NodeID expression = it->second; Type type = symbol_table.getType(name); int id = symbol_table.getID(name) + 1; if (type == eEndogenous) - output << "oo_.endo_simul( " << id << ", M_.maximum_lag + " << lag + 1 << ") = " << expression << ";\n"; + output << "oo_.endo_simul( " << id << ", M_.maximum_lag + " << lag + 1 << ") = "; else if (type == eExogenous) - output << "oo_.exo_simul( M_.maximum_lag + " << lag + 1 << ", " << id << " ) = " << expression << ";\n"; + output << "oo_.exo_simul( M_.maximum_lag + " << lag + 1 << ", " << id << " ) = "; else if (type != eExogenousDet) - output << "oo_.exo_det_simul( M_.maximum_lag + " << lag + 1 << ", " << id << " ) = " << expression << ";\n"; + output << "oo_.exo_det_simul( M_.maximum_lag + " << lag + 1 << ", " << id << " ) = "; + + expression->writeOutput(output); + output << ";" << endl; } } diff --git a/parser.src/ParsingDriver.cc b/parser.src/ParsingDriver.cc index 3159dd985..5a2f7fe06 100644 --- a/parser.src/ParsingDriver.cc +++ b/parser.src/ParsingDriver.cc @@ -22,19 +22,17 @@ ParsingDriver::check_symbol_existence(const string &name) error("Unknown symbol: " + name); } -string -ParsingDriver::get_expression(ExpObj *exp) +void +ParsingDriver::set_current_data_tree(DataTree *data_tree_arg) { - // Here we don't call "delete exp", since this will be done by the calling function - if (exp->second == eTempResult) - { - expression.set(); - string sexp = expression.get(); - expression.clear(); - return sexp; - } - else - return expression.getArgument(exp->second, exp->first); + data_tree = data_tree_arg; + model_tree = dynamic_cast(data_tree_arg); +} + +void +ParsingDriver::reset_data_tree() +{ + set_current_data_tree(&mod_file->expressions_tree); } ModFile * @@ -44,9 +42,10 @@ ParsingDriver::parse(const string &f) mod_file->symbol_table.error = error; - expression.setNumericalConstants(&mod_file->num_constants); tmp_symbol_table = new TmpSymbolTable(mod_file->symbol_table); + reset_data_tree(); + file = f; scan_begin(); yy::parser parser(*this); @@ -106,22 +105,10 @@ ParsingDriver::declare_parameter(string *name, string *tex_name) delete tex_name; } -ExpObj * -ParsingDriver::add_expression_constant(string *constant) -{ - int id = mod_file->num_constants.AddConstant(*constant); - - if(mod_file->model_tree.interprete_.eval) - mod_file->model_tree.interprete_.Stack.push(mod_file->model_tree.interprete_.S_to_Val(constant)); - - delete constant; - return new ExpObj(id, eNumericalConstant); -} - NodeID -ParsingDriver::add_model_constant(string *constant) +ParsingDriver::add_constant(string *constant) { - NodeID id = model_tree->AddNumConstant(*constant); + NodeID id = data_tree->AddNumConstant(*constant); delete constant; return id; } @@ -133,10 +120,10 @@ ParsingDriver::add_model_variable(string *name) NodeID id = model_tree->AddVariable(*name); Type type = mod_file->symbol_table.getType(*name); - if ((type == eEndogenous) && (mod_file->model_tree.mode == eSparseDLLMode)) + if ((type == eEndogenous) && (model_tree->mode == eSparseDLLMode)) { int ID = mod_file->symbol_table.getID(*name); - mod_file->model_tree.block_triangular.fill_IM(model_tree->equation_number(), ID, 0); + model_tree->block_triangular.fill_IM(model_tree->equation_number(), ID, 0); } delete name; @@ -158,113 +145,22 @@ ParsingDriver::add_model_variable(string *name, string *olag) } NodeID id = model_tree->AddVariable(*name, lag); - if ((type == eEndogenous) && (mod_file->model_tree.mode == eSparseDLLMode)) - mod_file->model_tree.block_triangular.fill_IM(model_tree->equation_number(), mod_file->symbol_table.getID(*name), lag); + if ((type == eEndogenous) && (model_tree->mode == eSparseDLLMode)) + model_tree->block_triangular.fill_IM(model_tree->equation_number(), mod_file->symbol_table.getID(*name), lag); delete name; delete olag; return id; } -ExpObj * +NodeID ParsingDriver::add_expression_variable(string *name) { check_symbol_existence(*name); - int id = mod_file->symbol_table.getID(*name); - Type type = mod_file->symbol_table.getType(*name); - - if(mod_file->model_tree.interprete_.eval) - mod_file->model_tree.interprete_.Stack.push(mod_file->model_tree.interprete_.get_value(name,0)); + NodeID id = data_tree->AddVariable(*name); delete name; - return new ExpObj(id, type); -} - -ExpObj * -ParsingDriver::add_expression_token(ExpObj *arg1, ExpObj *arg2, int op) -{ - int id = expression.AddToken(arg1->first, arg1->second, - arg2->first, arg2->second, - op); - - if (mod_file->model_tree.interprete_.eval) - { - mod_file->model_tree.interprete_.u2 = mod_file->model_tree.interprete_.Stack.top(); - mod_file->model_tree.interprete_.Stack.pop(); - mod_file->model_tree.interprete_.u1 = mod_file->model_tree.interprete_.Stack.top(); - mod_file->model_tree.interprete_.Stack.pop(); - if (op == token::PLUS) - mod_file->model_tree.interprete_.u1+=mod_file->model_tree.interprete_.u2; - else if (op == token::MINUS) - mod_file->model_tree.interprete_.u1-=mod_file->model_tree.interprete_.u2; - else if (op == token::DIVIDE) - mod_file->model_tree.interprete_.u1/=mod_file->model_tree.interprete_.u2; - else if (op == token::TIMES) - mod_file->model_tree.interprete_.u1*=mod_file->model_tree.interprete_.u2; - else if (op == token::POWER) - mod_file->model_tree.interprete_.u1=pow(mod_file->model_tree.interprete_.u1,mod_file->model_tree.interprete_.u2); - mod_file->model_tree.interprete_.Stack.push(mod_file->model_tree.interprete_.u1); - } - - delete arg1; - delete arg2; - return new ExpObj(id, eTempResult); -} - -ExpObj * -ParsingDriver::add_expression_token(ExpObj *arg1, int op) -{ - int id = expression.AddToken(arg1->first, arg1->second, op); - - if (mod_file->model_tree.interprete_.eval) - { - mod_file->model_tree.interprete_.u2 = mod_file->model_tree.interprete_.Stack.top(); - mod_file->model_tree.interprete_.Stack.pop(); - if (op == token::UMINUS) - mod_file->model_tree.interprete_.u1=-mod_file->model_tree.interprete_.u2; - else if (op == token::EXP) - mod_file->model_tree.interprete_.u1=exp(mod_file->model_tree.interprete_.u2); - else if (op == token::LOG) - mod_file->model_tree.interprete_.u1=log(mod_file->model_tree.interprete_.u2); - else if (op == token::LOG10) - mod_file->model_tree.interprete_.u1=log10(mod_file->model_tree.interprete_.u2); - else if (op == token::SIN) - mod_file->model_tree.interprete_.u1=sin(mod_file->model_tree.interprete_.u2); - else if (op == token::COS) - mod_file->model_tree.interprete_.u1=cos(mod_file->model_tree.interprete_.u2); - else if (op == token::TAN) - mod_file->model_tree.interprete_.u1=tan(mod_file->model_tree.interprete_.u2); - else if (op == token::ASIN) - mod_file->model_tree.interprete_.u1=asin(mod_file->model_tree.interprete_.u2); - else if (op == token::ACOS) - mod_file->model_tree.interprete_.u1=acos(mod_file->model_tree.interprete_.u2); - else if (op == token::ATAN) - mod_file->model_tree.interprete_.u1=atan(mod_file->model_tree.interprete_.u2); - else if (op == token::SQRT) - mod_file->model_tree.interprete_.u1=sqrt(mod_file->model_tree.interprete_.u2); - mod_file->model_tree.interprete_.Stack.push(mod_file->model_tree.interprete_.u1); - } - - delete arg1; - return new ExpObj(id, eTempResult); -} - -ExpObj * -ParsingDriver::add_expression_token(ExpObj *arg1, string *op_name) -{ - int id = expression.AddToken(arg1->first, arg1->second, *op_name); - - if (mod_file->model_tree.interprete_.eval) - { - mod_file->model_tree.interprete_.u2 = mod_file->model_tree.interprete_.Stack.top(); - mod_file->model_tree.interprete_.Stack.pop(); - mod_file->model_tree.interprete_.Stack.push(mod_file->model_tree.interprete_.get_value(op_name,mod_file->model_tree.interprete_.u2)); - mod_file->model_tree.interprete_.Stack.push(mod_file->model_tree.interprete_.u1); - } - - delete arg1; - delete op_name; - return new ExpObj(id, eTempResult); + return id; } void @@ -302,24 +198,30 @@ ParsingDriver::dsample(string *arg1, string *arg2) } void -ParsingDriver::init_param(string *name, ExpObj *rhs) +ParsingDriver::init_param(string *name, NodeID rhs) { check_symbol_existence(*name); if (mod_file->symbol_table.getType(*name) != eParameter) error(*name + " is not a parameter"); - mod_file->addStatement(new InitParamStatement(*name, get_expression(rhs), mod_file->symbol_table)); + mod_file->addStatement(new InitParamStatement(*name, rhs, mod_file->symbol_table)); - mod_file->model_tree.interprete_.u2 = mod_file->model_tree.interprete_.Stack.top(); - mod_file->model_tree.interprete_.Stack.pop(); - mod_file->model_tree.interprete_.put_value(name,mod_file->symbol_table.getID(*name), eParameter, mod_file->model_tree.interprete_.u2); + // Update global eval context + try + { + double val = rhs->eval(mod_file->global_eval_context); + int symb_id = mod_file->symbol_table.getID(*name); + mod_file->global_eval_context[make_pair(symb_id, eParameter)] = val; + } + catch(ExprNode::EvalException &e) + { + } delete name; - delete rhs; } void -ParsingDriver::init_val(string *name, ExpObj *rhs) +ParsingDriver::init_val(string *name, NodeID rhs) { check_symbol_existence(*name); Type type = mod_file->symbol_table.getType(*name); @@ -329,17 +231,20 @@ ParsingDriver::init_val(string *name, ExpObj *rhs) && type != eExogenousDet) error("initval/endval: " + *name + " should be an endogenous or exogenous variable"); - init_values.push_back(make_pair(*name, get_expression(rhs))); + init_values.push_back(make_pair(*name, rhs)); - if(mod_file->model_tree.interprete_.eval) + // Update global evaluation context + try + { + double val = rhs->eval(mod_file->global_eval_context); + int symb_id = mod_file->symbol_table.getID(*name); + mod_file->global_eval_context[make_pair(symb_id, type)] = val; + } + catch(ExprNode::EvalException &e) { - mod_file->model_tree.interprete_.u2 = mod_file->model_tree.interprete_.Stack.top(); - mod_file->model_tree.interprete_.Stack.pop(); - mod_file->model_tree.interprete_.put_value(name, mod_file->symbol_table.getID(*name), type, mod_file->model_tree.interprete_.u2); } delete name; - delete rhs; } void @@ -351,7 +256,7 @@ ParsingDriver::init_val_filename(string *filename) } void -ParsingDriver::hist_val(string *name, string *lag, ExpObj *rhs) +ParsingDriver::hist_val(string *name, string *lag, NodeID rhs) { check_symbol_existence(*name); Type type = mod_file->symbol_table.getType(*name); @@ -367,33 +272,23 @@ ParsingDriver::hist_val(string *name, string *lag, ExpObj *rhs) if (hist_values.find(key) != hist_values.end()) error("hist_val: (" + *name + ", " + *lag + ") declared twice"); - hist_values[key] = get_expression(rhs); + hist_values[key] = rhs; delete name; delete lag; - delete rhs; -} - -void -ParsingDriver::initialize_model(void) -{ - //Initialize the incidence matrix - //cout << "mod_file->symbol_table.endo_nbr=" << mod_file->symbol_table.endo_nbr << "\n"; - mod_file->model_tree.block_triangular.init_incidence_matrix(mod_file->symbol_table.endo_nbr); } void ParsingDriver::use_dll() { - // Seetting variable momber offset to use C outputs - mod_file->model_tree.mode = eDLLMode; + model_tree->mode = eDLLMode; } void ParsingDriver::sparse_dll() { - // Seetting variable momber offset to use C outputs - mod_file->model_tree.mode = eSparseDLLMode; + model_tree->mode = eSparseDLLMode; + model_tree->block_triangular.init_incidence_matrix(mod_file->symbol_table.endo_nbr); } void @@ -420,9 +315,7 @@ ParsingDriver::end_histval() void ParsingDriver::begin_model() { - model_tree = &mod_file->model_tree; - if (mod_file->model_tree.mode == eSparseDLLMode) - initialize_model(); + set_current_data_tree(&mod_file->model_tree); } void @@ -482,35 +375,33 @@ ParsingDriver::add_det_shock(string *var) } void -ParsingDriver::add_stderr_shock(string *var, ExpObj *value) +ParsingDriver::add_stderr_shock(string *var, NodeID value) { check_symbol_existence(*var); if (var_shocks.find(*var) != var_shocks.end() || std_shocks.find(*var) != std_shocks.end()) error("shocks: variance or stderr of shock on " + *var + " declared twice"); - std_shocks[*var] = get_expression(value); + std_shocks[*var] = value; delete var; - delete value; } void -ParsingDriver::add_var_shock(string *var, ExpObj *value) +ParsingDriver::add_var_shock(string *var, NodeID value) { check_symbol_existence(*var); if (var_shocks.find(*var) != var_shocks.end() || std_shocks.find(*var) != std_shocks.end()) error("shocks: variance or stderr of shock on " + *var + " declared twice"); - var_shocks[*var] = get_expression(value); + var_shocks[*var] = value; delete var; - delete value; } void -ParsingDriver::add_covar_shock(string *var1, string *var2, ExpObj *value) +ParsingDriver::add_covar_shock(string *var1, string *var2, NodeID value) { check_symbol_existence(*var1); check_symbol_existence(*var2); @@ -524,15 +415,14 @@ ParsingDriver::add_covar_shock(string *var1, string *var2, ExpObj *value) error("shocks: covariance or correlation shock on variable pair (" + *var1 + ", " + *var2 + ") declared twice"); - covar_shocks[key] = get_expression(value); + covar_shocks[key] = value; delete var1; delete var2; - delete value; } void -ParsingDriver::add_correl_shock(string *var1, string *var2, ExpObj *value) +ParsingDriver::add_correl_shock(string *var1, string *var2, NodeID value) { check_symbol_existence(*var1); check_symbol_existence(*var2); @@ -546,11 +436,10 @@ ParsingDriver::add_correl_shock(string *var1, string *var2, ExpObj *value) error("shocks: covariance or correlation shock on variable pair (" + *var1 + ", " + *var2 + ") declared twice"); - corr_shocks[key] = get_expression(value); + corr_shocks[key] = value; delete var1; delete var2; - delete value; } void @@ -572,17 +461,21 @@ ParsingDriver::add_period(string *p1) } void -ParsingDriver::add_value(string *value) +ParsingDriver::add_value_const(string *value) { - det_shocks_values.push_back(*value); - delete value; + add_value(add_constant(value)); } void -ParsingDriver::add_value(ExpObj *value) +ParsingDriver::add_value_var(string *name) { - det_shocks_values.push_back(get_expression(value)); - delete value; + add_value(add_expression_variable(name)); +} + +void +ParsingDriver::add_value(NodeID value) +{ + det_shocks_values.push_back(value); } void @@ -607,17 +500,15 @@ ParsingDriver::end_of_row() } void -ParsingDriver::add_to_row(string *s) +ParsingDriver::add_to_row_const(string *s) { - sigmae_row.push_back(*s); - delete s; + sigmae_row.push_back(add_constant(s)); } void -ParsingDriver::add_to_row(ExpObj *v) +ParsingDriver::add_to_row(NodeID v) { - sigmae_row.push_back(get_expression(v)); - delete v; + sigmae_row.push_back(v); } void @@ -656,7 +547,7 @@ ParsingDriver::option_num(const string &name_option, const string &opt) if ((name_option == "periods") && (mod_file->model_tree.mode == eSparseDLLMode)) mod_file->model_tree.block_triangular.periods = atoi(opt.c_str()); else if (name_option == "cutoff") - mod_file->model_tree.interprete_.set_cutoff(atof(opt.c_str())); + mod_file->model_tree.cutoff = atof(opt.c_str()); options_list.num_options[name_option] = opt; } @@ -718,7 +609,7 @@ void ParsingDriver::stoch_simul() void ParsingDriver::simulate() { - if(mod_file->model_tree.mode == eSparseDLLMode) + if (mod_file->model_tree.mode == eSparseDLLMode) simul_sparse(); else simul(); @@ -727,20 +618,14 @@ void ParsingDriver::simulate() void ParsingDriver::simul_sparse() { - SimulSparseStatement *st=new SimulSparseStatement(options_list); - st->filename=file; - string tmp=st->filename.substr(st->filename.length()-4); - if(tmp==".mod"||tmp==".dyn") - st->filename.erase(st->filename.length()-4); - st->compiler=mod_file->model_tree.compiler; - mod_file->addStatement(st); + mod_file->addStatement(new SimulSparseStatement(options_list, mod_file->model_tree.compiler)); options_list.clear(); } void ParsingDriver::init_compiler(int compiler_type) { - mod_file->model_tree.compiler=compiler_type; + mod_file->model_tree.compiler = compiler_type; } void @@ -863,31 +748,29 @@ ParsingDriver::set_trends() } void -ParsingDriver::set_trend_element(string *arg1, ExpObj *arg2) +ParsingDriver::set_trend_element(string *arg1, NodeID arg2) { check_symbol_existence(*arg1); if (trend_elements.find(*arg1) != trend_elements.end()) error("observation_trends: " + *arg1 + " declared twice"); - trend_elements[*arg1] = get_expression(arg2); + trend_elements[*arg1] = arg2; delete arg1; - delete arg2; } void -ParsingDriver::set_optim_weights(string *name, ExpObj *value) +ParsingDriver::set_optim_weights(string *name, NodeID value) { check_symbol_existence(*name); if (mod_file->symbol_table.getType(*name) != eEndogenous) error("optim_weights: " + *name + " isn't an endogenous variable"); if (var_weights.find(*name) != var_weights.end()) error("optim_weights: " + *name + " declared twice"); - var_weights[*name] = get_expression(value); + var_weights[*name] = value; delete name; - delete value; } void -ParsingDriver::set_optim_weights(string *name1, string *name2, ExpObj *value) +ParsingDriver::set_optim_weights(string *name1, string *name2, NodeID value) { check_symbol_existence(*name1); if (mod_file->symbol_table.getType(*name1) != eEndogenous) @@ -903,10 +786,9 @@ ParsingDriver::set_optim_weights(string *name1, string *name2, ExpObj *value) error("optim_weights: pair of variables (" + *name1 + ", " + *name2 + ") declared twice"); - covar_weights[covar_key] = get_expression(value); + covar_weights[covar_key] = value; delete name1; delete name2; - delete value; } void @@ -948,7 +830,7 @@ ParsingDriver::run_olr() } void -ParsingDriver::set_calib_var(string *name, string *weight, ExpObj *expression) +ParsingDriver::set_calib_var(string *name, string *weight, NodeID expression) { check_symbol_existence(*name); if (mod_file->symbol_table.getType(*name) != eEndogenous @@ -958,16 +840,15 @@ 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] = make_pair(*weight, get_expression(expression)); + calib_var[*name] = make_pair(*weight, expression); delete name; delete weight; - delete expression; } void ParsingDriver::set_calib_covar(string *name1, string *name2, - string *weight, ExpObj *expression) + string *weight, NodeID expression) { check_symbol_existence(*name1); check_symbol_existence(*name2); @@ -983,17 +864,16 @@ ParsingDriver::set_calib_covar(string *name1, string *name2, error("calib_var: pair of variables (" + *name1 + ", " + *name2 + ") declared twice"); - calib_covar[covar_key] = make_pair(*weight, get_expression(expression)); + calib_covar[covar_key] = make_pair(*weight, expression); delete name1; delete name2; delete weight; - delete expression; } void ParsingDriver::set_calib_ac(string *name, string *ar, - string *weight, ExpObj *expression) + string *weight, NodeID expression) { check_symbol_existence(*name); if (mod_file->symbol_table.getType(*name) != eEndogenous) @@ -1005,12 +885,11 @@ 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] = make_pair(*weight, get_expression(expression)); + calib_ac[ac_key] = make_pair(*weight, expression); delete name; delete ar; delete weight; - delete expression; } void @@ -1068,7 +947,7 @@ ParsingDriver::run_model_comparison() void ParsingDriver::begin_planner_objective() { - model_tree = new ModelTree(mod_file->symbol_table, mod_file->num_constants); + set_current_data_tree(new ModelTree(mod_file->symbol_table, mod_file->num_constants)); } void @@ -1079,6 +958,8 @@ ParsingDriver::end_planner_objective(NodeID expr) model_tree->addEquation(eq); mod_file->addStatement(new PlannerObjectiveStatement(model_tree)); + + reset_data_tree(); } void @@ -1119,135 +1000,149 @@ ParsingDriver::declare_and_init_local_parameter(string *name, NodeID rhs) } NodeID -ParsingDriver::add_model_plus(NodeID arg1, NodeID arg2) +ParsingDriver::add_plus(NodeID arg1, NodeID arg2) { - return model_tree->AddPlus(arg1, arg2); + return data_tree->AddPlus(arg1, arg2); } NodeID -ParsingDriver::add_model_minus(NodeID arg1, NodeID arg2) +ParsingDriver::add_minus(NodeID arg1, NodeID arg2) { - return model_tree->AddMinus(arg1, arg2); + return data_tree->AddMinus(arg1, arg2); } NodeID -ParsingDriver::add_model_uminus(NodeID arg1) +ParsingDriver::add_uminus(NodeID arg1) { - return model_tree->AddUMinus(arg1); + return data_tree->AddUMinus(arg1); } NodeID -ParsingDriver::add_model_times(NodeID arg1, NodeID arg2) +ParsingDriver::add_times(NodeID arg1, NodeID arg2) { - return model_tree->AddTimes(arg1, arg2); + return data_tree->AddTimes(arg1, arg2); } NodeID -ParsingDriver::add_model_divide(NodeID arg1, NodeID arg2) +ParsingDriver::add_divide(NodeID arg1, NodeID arg2) { - return model_tree->AddDivide(arg1, arg2); + return data_tree->AddDivide(arg1, arg2); } NodeID -ParsingDriver::add_model_power(NodeID arg1, NodeID arg2) +ParsingDriver::add_power(NodeID arg1, NodeID arg2) { - return model_tree->AddPower(arg1, arg2); + return data_tree->AddPower(arg1, arg2); } NodeID -ParsingDriver::add_model_exp(NodeID arg1) +ParsingDriver::add_exp(NodeID arg1) { - return model_tree->AddExp(arg1); + return data_tree->AddExp(arg1); } NodeID -ParsingDriver::add_model_log(NodeID arg1) +ParsingDriver::add_log(NodeID arg1) { - return model_tree->AddLog(arg1); + return data_tree->AddLog(arg1); } NodeID -ParsingDriver::add_model_log10(NodeID arg1) +ParsingDriver::add_log10(NodeID arg1) { - return model_tree->AddLog10(arg1); + return data_tree->AddLog10(arg1); } NodeID -ParsingDriver::add_model_cos(NodeID arg1) +ParsingDriver::add_cos(NodeID arg1) { - return model_tree->AddCos(arg1); + return data_tree->AddCos(arg1); } NodeID -ParsingDriver::add_model_sin(NodeID arg1) +ParsingDriver::add_sin(NodeID arg1) { - return model_tree->AddSin(arg1); + return data_tree->AddSin(arg1); } NodeID -ParsingDriver::add_model_tan(NodeID arg1) +ParsingDriver::add_tan(NodeID arg1) { - return model_tree->AddTan(arg1); + return data_tree->AddTan(arg1); } NodeID -ParsingDriver::add_model_acos(NodeID arg1) +ParsingDriver::add_acos(NodeID arg1) { - return model_tree->AddACos(arg1); + return data_tree->AddACos(arg1); } NodeID -ParsingDriver::add_model_asin(NodeID arg1) +ParsingDriver::add_asin(NodeID arg1) { - return model_tree->AddASin(arg1); + return data_tree->AddASin(arg1); } NodeID -ParsingDriver::add_model_atan(NodeID arg1) +ParsingDriver::add_atan(NodeID arg1) { - return model_tree->AddATan(arg1); + return data_tree->AddATan(arg1); } NodeID -ParsingDriver::add_model_cosh(NodeID arg1) +ParsingDriver::add_cosh(NodeID arg1) { - return model_tree->AddCosH(arg1); + return data_tree->AddCosH(arg1); } NodeID -ParsingDriver::add_model_sinh(NodeID arg1) +ParsingDriver::add_sinh(NodeID arg1) { - return model_tree->AddSinH(arg1); + return data_tree->AddSinH(arg1); } NodeID -ParsingDriver::add_model_tanh(NodeID arg1) +ParsingDriver::add_tanh(NodeID arg1) { - return model_tree->AddTanH(arg1); + return data_tree->AddTanH(arg1); } NodeID -ParsingDriver::add_model_acosh(NodeID arg1) +ParsingDriver::add_acosh(NodeID arg1) { - return model_tree->AddACosH(arg1); + return data_tree->AddACosH(arg1); } NodeID -ParsingDriver::add_model_asinh(NodeID arg1) +ParsingDriver::add_asinh(NodeID arg1) { - return model_tree->AddASinH(arg1); + return data_tree->AddASinH(arg1); } NodeID -ParsingDriver::add_model_atanh(NodeID arg1) +ParsingDriver::add_atanh(NodeID arg1) { - return model_tree->AddATanH(arg1); + return data_tree->AddATanH(arg1); } NodeID -ParsingDriver::add_model_sqrt(NodeID arg1) +ParsingDriver::add_sqrt(NodeID arg1) { - return model_tree->AddSqRt(arg1); + return data_tree->AddSqRt(arg1); +} + +void +ParsingDriver::add_unknown_function_arg(NodeID arg) +{ + unknown_function_args.push_back(arg); +} + +NodeID +ParsingDriver::add_unknown_function(string *function_name) +{ + NodeID id = data_tree->AddUnknownFunction(*function_name, unknown_function_args); + unknown_function_args.clear(); + return id; } void diff --git a/parser.src/Shocks.cc b/parser.src/Shocks.cc index 6879ac345..a2e6e0a92 100644 --- a/parser.src/Shocks.cc +++ b/parser.src/Shocks.cc @@ -43,15 +43,22 @@ AbstractShocksStatement::writeDetShocks(ostream &output) const { const int &period1 = it->second[i].period1; const int &period2 = it->second[i].period2; - const string &value = it->second[i].value; + const NodeID value = it->second[i].value; if (period1 == period2) - output << "set_shocks(" << set_shocks_index << "," << period1 - << ", " << id << ", " << value << ");\n"; + { + output << "set_shocks(" << set_shocks_index << "," << period1 + << ", " << id << ", "; + value->writeOutput(output); + output << ");" << endl; + } else - output << "set_shocks(" << set_shocks_index << "," << period1 - << ":" << period2 << ", " << id - << ", " << value << ");\n"; + { + output << "set_shocks(" << set_shocks_index << "," << period1 + << ":" << period2 << ", " << id << ", "; + value->writeOutput(output); + output << ");" << endl; + } if (exo_det && (period2 > exo_det_length)) exo_det_length = period2; @@ -68,15 +75,19 @@ AbstractShocksStatement::writeVarAndStdShocks(ostream &output) const for(it = var_shocks.begin(); it != var_shocks.end(); it++) { int id = symbol_table.getID(it->first) + 1; - const string &value = it->second; - output << "M_.Sigma_e(" << id << ", " << id << ") = " << value << ";\n"; + const NodeID value = it->second; + output << "M_.Sigma_e(" << id << ", " << id << ") = "; + value->writeOutput(output); + output << ";" << endl; } for(it = std_shocks.begin(); it != std_shocks.end(); it++) { int id = symbol_table.getID(it->first) + 1; - const string &value = it->second; - output << "M_.Sigma_e(" << id << ", " << id << ") = " << value << "^2;\n"; + const NodeID value = it->second; + output << "M_.Sigma_e(" << id << ", " << id << ") = ("; + value->writeOutput(output); + output << ")^2;" << endl; } } @@ -89,9 +100,10 @@ AbstractShocksStatement::writeCovarAndCorrShocks(ostream &output) const { int id1 = symbol_table.getID(it->first.first) + 1; int id2 = symbol_table.getID(it->first.second) + 1; - const string &value = it->second; - output << "M_.Sigma_e(" << id1 << ", " << id2 << ") = " << value - << "; M_.Sigma_e(" << id2 << ", " << id1 << ") = M_.Sigma_e(" + const NodeID value = it->second; + output << "M_.Sigma_e(" << id1 << ", " << id2 << ") = "; + value->writeOutput(output); + output << "; M_.Sigma_e(" << id2 << ", " << id1 << ") = M_.Sigma_e(" << id1 << ", " << id2 << ");\n"; } @@ -99,9 +111,10 @@ AbstractShocksStatement::writeCovarAndCorrShocks(ostream &output) const { int id1 = symbol_table.getID(it->first.first) + 1; int id2 = symbol_table.getID(it->first.second) + 1; - const string &value = it->second; - output << "M_.Sigma_e(" << id1 << ", " << id2 << ") = " << value - << "*sqrt(M_.Sigma_e(" << id1 << ", " << id1 << ")*M_.Sigma_e(" + const NodeID value = it->second; + output << "M_.Sigma_e(" << id1 << ", " << id2 << ") = "; + value->writeOutput(output); + output << "*sqrt(M_.Sigma_e(" << id1 << ", " << id1 << ")*M_.Sigma_e(" << id2 << ", " << id2 << "); M_.Sigma_e(" << id2 << ", " << id1 << ") = M_.Sigma_e(" << id1 << ", " << id2 << ");\n"; } diff --git a/parser.src/SigmaeInitialization.cc b/parser.src/SigmaeInitialization.cc index d363fc873..a13fa1a2d 100644 --- a/parser.src/SigmaeInitialization.cc +++ b/parser.src/SigmaeInitialization.cc @@ -72,7 +72,8 @@ SigmaeStatement::writeOutput(ostream &output, const string &basename) const ir1 = ir; } - output << matrix[ir1][ic1] << " "; + matrix[ir1][ic1]->writeOutput(output); + output << " "; } output << ";...\n"; } diff --git a/parser.src/include/ComputingTasks.hh b/parser.src/include/ComputingTasks.hh index c2b0d2535..5cda3bc9d 100644 --- a/parser.src/include/ComputingTasks.hh +++ b/parser.src/include/ComputingTasks.hh @@ -41,10 +41,9 @@ class SimulSparseStatement : public Statement { private: const OptionsList options_list; + const int compiler; public: - string filename; - int compiler; - SimulSparseStatement(const OptionsList &options_list_arg); + SimulSparseStatement(const OptionsList &options_list_arg, int compiler_arg); virtual void checkPass(ModFileStructure &mod_file_struct); virtual void writeOutput(ostream &output, const string &basename) const; }; @@ -167,7 +166,7 @@ public: class ObservationTrendsStatement : public Statement { public: - typedef map > trend_elements_type; + typedef map trend_elements_type; private: const trend_elements_type trend_elements; const SymbolTable &symbol_table; @@ -332,8 +331,8 @@ public: class OptimWeightsStatement : public Statement { public: - typedef map > var_weights_type; - typedef map, string, less > > covar_weights_type; + typedef map var_weights_type; + typedef map, NodeID> covar_weights_type; private: const var_weights_type var_weights; const covar_weights_type covar_weights; @@ -358,11 +357,11 @@ class CalibVarStatement : public Statement { public: //! Maps a variable to a pair (weight, expression) - typedef map, less > calib_var_type; + typedef map > calib_var_type; //! Maps a pair of variables to a pair (weight, expression) - typedef map, pair, less > > calib_covar_type; + typedef map, pair > calib_covar_type; //! Maps a pair (variable, autocorr) to a pair (weight, expression) - typedef map, pair, less > > calib_ac_type; + typedef map, pair > calib_ac_type; private: const calib_var_type calib_var; const calib_covar_type calib_covar; diff --git a/parser.src/include/DataTree.hh b/parser.src/include/DataTree.hh index 957ebe09b..a986592ee 100644 --- a/parser.src/include/DataTree.hh +++ b/parser.src/include/DataTree.hh @@ -12,8 +12,6 @@ using namespace std; #include "VariableTable.hh" #include "ExprNode.hh" -#include "interprete.hh" - class DataTree { friend class ExprNode; @@ -38,7 +36,8 @@ protected: typedef map num_const_node_map_type; num_const_node_map_type num_const_node_map; - typedef map, NodeID> variable_node_map_type; + //! Type (symbol_id, type, lag) used as key + typedef map, int>, NodeID> variable_node_map_type; variable_node_map_type variable_node_map; typedef map, NodeID> unary_op_node_map_type; unary_op_node_map_type unary_op_node_map; @@ -53,8 +52,6 @@ public: //! The variable table VariableTable variable_table; NodeID Zero, One, MinusOne; - //! Complete set to interpret the model parameters and variables - interprete interprete_; //! Raised when a local parameter is declared twice class LocalParameterException @@ -113,6 +110,9 @@ public: //! Adds "arg1=arg2" to model tree NodeID AddEqual(NodeID iArg1, NodeID iArg2); void AddLocalParameter(const string &name, NodeID value) throw (LocalParameterException); + //! Adds an unknown function node + /*! \todo Use a map to share identical nodes */ + NodeID AddUnknownFunction(const string &function_name, const vector &arguments); }; inline NodeID diff --git a/parser.src/include/DynareBison.hh b/parser.src/include/DynareBison.hh index faad70757..8d339481f 100644 --- a/parser.src/include/DynareBison.hh +++ b/parser.src/include/DynareBison.hh @@ -54,15 +54,11 @@ using namespace std; class ParsingDriver; -#include "SymbolTableTypes.hh" #include "ExprNode.hh" -//! Type for semantic value of non-derivable expressions -typedef pair ExpObj; - /* Line 35 of lalr1.cc. */ -#line 66 "DynareBison.hh" +#line 62 "DynareBison.hh" #include "location.hh" @@ -113,14 +109,13 @@ namespace yy /// Symbol semantic values. #ifndef YYSTYPE union semantic_type -#line 31 "DynareBison.yy" +#line 27 "DynareBison.yy" { string *string_val; - ExpObj *exp_val; - NodeID model_val; + NodeID node_val; } /* Line 35 of lalr1.cc. */ -#line 124 "DynareBison.hh" +#line 119 "DynareBison.hh" ; #else typedef YYSTYPE semantic_type; diff --git a/parser.src/include/ExprNode.hh b/parser.src/include/ExprNode.hh index a965ceed7..2c186fab9 100644 --- a/parser.src/include/ExprNode.hh +++ b/parser.src/include/ExprNode.hh @@ -5,6 +5,7 @@ using namespace std; #include #include +#include #include "SymbolTableTypes.hh" @@ -31,6 +32,11 @@ enum ExprNodeOutputType oMatlabOutsideModel //!< Matlab code, outside model block (for example in initval) }; +//! Type for evaluation contexts +/*! The key is a pair (symbol id, symbol type) + Lags are assumed to be null */ +typedef map, double> eval_context_type; + /* Equal to 1 for Matlab langage, or to 0 for C language In Matlab, array indexes begin at 1, while they begin at 0 in C */ #define OFFSET(output_type) ((output_type == oMatlabStaticModel) \ @@ -105,6 +111,9 @@ public: //! Writes output of node, using a Txxx notation for nodes in temporary_terms virtual void writeOutput(ostream &output, ExprNodeOutputType output_type, const temporary_terms_type &temporary_terms) const = 0; + //! Writes output of node (with no temporary terms and with "outside model" output type) + void writeOutput(ostream &output); + //! Collects the Endogenous in a expression virtual void collectEndogenous(NodeID &Id) = 0; virtual void computeTemporaryTerms(map &reference_count, @@ -114,7 +123,12 @@ public: Model_Block *ModelBlock) const; int present_endogenous_size() const; int present_endogenous_find(int var, int lag) const; - virtual void Evaluate() const = 0; + + class EvalException + { + }; + + virtual double eval(const eval_context_type &eval_context) const throw (EvalException) = 0; }; //! Object used to compare two nodes (using their indexes) @@ -137,23 +151,25 @@ public: NumConstNode(DataTree &datatree_arg, int id_arg); virtual void writeOutput(ostream &output, ExprNodeOutputType output_type, const temporary_terms_type &temporary_terms) const; virtual void collectEndogenous(NodeID &Id); - virtual void Evaluate() const; + virtual double eval(const eval_context_type &eval_context) const throw (EvalException); }; //! Symbol or variable node class VariableNode : public ExprNode { private: - //! Id of the symbol/variable - /*! For an endogenous, exogenous or recursive variable, the id is taken from the variable table (before sorting). For other types of symbols, it's the id from the symbol table. */ - const int id; + //! Id from the symbol table + const int symb_id; const Type type; + const int lag; + //! Id from the variable table (-1 if not a endogenous/exogenous/recursive) + int var_id; virtual NodeID computeDerivative(int varID); public: - VariableNode(DataTree &datatree_arg, int id_arg, Type type_arg); + VariableNode(DataTree &datatree_arg, int symb_id_arg, Type type_arg, int lag_arg); virtual void writeOutput(ostream &output, ExprNodeOutputType output_type, const temporary_terms_type &temporary_terms = temporary_terms_type()) const; virtual void collectEndogenous(NodeID &Id); - virtual void Evaluate() const; + virtual double eval(const eval_context_type &eval_context) const throw (EvalException); }; enum UnaryOpcode @@ -186,7 +202,7 @@ private: const UnaryOpcode op_code; virtual NodeID computeDerivative(int varID); - int cost(const temporary_terms_type &temporary_terms, bool is_matlab) const; + virtual int cost(const temporary_terms_type &temporary_terms, bool is_matlab) const; public: UnaryOpNode(DataTree &datatree_arg, UnaryOpcode op_code_arg, const NodeID arg_arg); virtual void computeTemporaryTerms(map &reference_count, temporary_terms_type &temporary_terms, bool is_matlab) const; @@ -197,7 +213,7 @@ public: int Curr_block, Model_Block *ModelBlock) const; virtual void collectEndogenous(NodeID &Id); - virtual void Evaluate() const; + virtual double eval(const eval_context_type &eval_context) const throw (EvalException); }; enum BinaryOpcode @@ -218,7 +234,7 @@ private: const NodeID arg1, arg2; const BinaryOpcode op_code; virtual NodeID computeDerivative(int varID); - int cost(const temporary_terms_type &temporary_terms, bool is_matlab) const; + virtual int cost(const temporary_terms_type &temporary_terms, bool is_matlab) const; public: BinaryOpNode(DataTree &datatree_arg, const NodeID arg1_arg, BinaryOpcode op_code_arg, const NodeID arg2_arg); @@ -231,7 +247,27 @@ public: int Curr_block, Model_Block *ModelBlock) const; virtual void collectEndogenous(NodeID &Id); - virtual void Evaluate() const; + virtual double eval(const eval_context_type &eval_context) const throw (EvalException); +}; + +class UnknownFunctionNode : public ExprNode +{ +private: + const string function_name; + const vector arguments; + virtual NodeID computeDerivative(int varID); +public: + UnknownFunctionNode(DataTree &datatree_arg, const string &function_name_arg, + const vector &arguments_arg); + virtual void computeTemporaryTerms(map &reference_count, temporary_terms_type &temporary_terms, bool is_matlab) const; + virtual void writeOutput(ostream &output, ExprNodeOutputType output_type, const temporary_terms_type &temporary_terms) const; + virtual void computeTemporaryTerms(map &reference_count, + temporary_terms_type &temporary_terms, + map &first_occurence, + int Curr_block, + Model_Block *ModelBlock) const; + virtual void collectEndogenous(NodeID &Id); + virtual double eval(const eval_context_type &eval_context) const throw (EvalException); }; typedef struct IM_compact diff --git a/parser.src/include/Expression.hh b/parser.src/include/Expression.hh deleted file mode 100644 index d896f3508..000000000 --- a/parser.src/include/Expression.hh +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef _EXPRESSION_HH -#define _EXPRESSION_HH -//------------------------------------------------------------------------------ -/** \file - * \version 1.0 - * \date 04/13/2004 - * \par This file defines the Expression class . - */ -//------------------------------------------------------------------------------ -#include -#include -#include - -#include "SymbolTableTypes.hh" -#include "NumericalConstants.hh" - -struct Token -{ - /*! ID of first operand */ - int id1; - /*! Type of first operand */ - Type type1; - /*! Flag : operand 1 is followed or not */ - bool followed1; - /*! ID of second operand */ - int id2; - /*! Type of second operand */ - Type type2; - /*! Flag : operand 2 is followed or not */ - bool followed2; - /*! Operator code */ - int op_code; - /*! Operator name */ - std::string op_name; - /*! costructor */ - Token(){followed1=followed2=false;}; -}; -//------------------------------------------------------------------------------ -/*! - \class Expression - \brief Handles expressions appearing - in initialization statements. These expressions aren't meant to be derived -*/ -class Expression -{ -private : - /*! Vector tokens */ - std::vector expression_list; - /*! Output string of the class */ - std::ostringstream output; - //! Pointer to numerical constants table - NumericalConstants *num_constants; - -public : - /*! Constructor */ - Expression(); - /*! Destructor */ - ~Expression(); - //! Set numerical constants pointer - void setNumericalConstants(NumericalConstants *num_constants_arg); - /*! Adds binary token to expression list */ - int AddToken(int id1,Type type1, int id2,Type type2,int op_code); - /*! Adds unary token to expression list */ - int AddToken(int id1,Type type1, int op_code); - /*! Adds unkown function to expression list */ - int AddToken(int id1,Type type1, std::string ufunction); - /*! Returns output string */ - std::string get(); - /*! Clear expression list */ - void clear(void); - /*! Print expression to output string */ - void set(void); - /*! Gets output argument name */ - std::string getArgument(Type type, int id); -}; -//------------------------------------------------------------------------------ -#endif diff --git a/parser.src/include/ModFile.hh b/parser.src/include/ModFile.hh index 180cd216c..0161e49a5 100644 --- a/parser.src/include/ModFile.hh +++ b/parser.src/include/ModFile.hh @@ -21,10 +21,15 @@ public: SymbolTable symbol_table; //! Numerical constants table NumericalConstants num_constants; + //! Expressions outside model block + DataTree expressions_tree; //! Model equations and their derivatives ModelTree model_tree; //! Option linear bool linear; + //! Global evaluation context + /*! Filled using initval blocks and parameters initializations */ + eval_context_type global_eval_context; private: //! List of statements diff --git a/parser.src/include/ModelTree.hh b/parser.src/include/ModelTree.hh index 33135429e..1857ebf73 100644 --- a/parser.src/include/ModelTree.hh +++ b/parser.src/include/ModelTree.hh @@ -95,10 +95,8 @@ private: void writeSparseDLLDynamicHFile(const string &dynamic_basename) const; //! Writes dynamic model file when SparseDLL option is on void writeSparseDLLDynamicCFileAndBinFile(const string &dynamic_basename, const string &bin_basename) const; - //! Evaluates part of a model tree - inline double Evaluate_Expression(NodeID StartID); - inline void Evaluate_Jacobian(); - inline void BlockLinear(Model_Block *ModelBlock); + void evaluateJacobian(const eval_context_type &eval_context); + void BlockLinear(Model_Block *ModelBlock); string reform(string name) const; public: @@ -107,6 +105,8 @@ public: ModelTreeMode mode; //! Type of compiler used in matlab for SPARSE_DLL option: 0 = LCC or 1 = GCC int compiler; + //! Absolute value under which a number is considered to be zero + double cutoff; //! Declare a node as an equation of the model void addEquation(NodeID eq); @@ -124,7 +124,7 @@ public: bool computeThirdDerivatives; //! Execute computations (variable sorting + derivation) /*! You must set computeJacobian, computeJacobianExo, computeHessian, computeStaticHessian and computeThirdDerivatives to correct values before calling this function */ - void computingPass(); + void computingPass(const eval_context_type &eval_context); //! Writes model initialization and lead/lag incidence matrix to output void writeOutput(ostream &output) const; //! Writes static model file diff --git a/parser.src/include/NumericalInitialization.hh b/parser.src/include/NumericalInitialization.hh index 9592d7eb5..e3c77ffd5 100644 --- a/parser.src/include/NumericalInitialization.hh +++ b/parser.src/include/NumericalInitialization.hh @@ -7,16 +7,17 @@ using namespace std; #include #include "SymbolTable.hh" +#include "ExprNode.hh" #include "Statement.hh" class InitParamStatement : public Statement { private: const string param_name; - const string param_value; + const NodeID param_value; const SymbolTable &symbol_table; public: - InitParamStatement(const string ¶m_name_arg, const string ¶m_value_arg, + InitParamStatement(const string ¶m_name_arg, const NodeID param_value_arg, const SymbolTable &symbol_table_arg); virtual void writeOutput(ostream &output, const string &basename) const; }; @@ -28,7 +29,7 @@ public: We use a vector instead of a map, since the order of declaration matters: an initialization can depend on a previously initialized variable inside the block */ - typedef vector > init_values_type; + typedef vector > init_values_type; protected: const init_values_type init_values; const SymbolTable &symbol_table; @@ -62,7 +63,7 @@ public: Contrary to Initval and Endval, we use a map, since it is impossible to reuse a given initialization value in a second initialization inside the block. */ - typedef map, string> hist_values_type; + typedef map, NodeID> hist_values_type; private: const hist_values_type hist_values; const SymbolTable &symbol_table; diff --git a/parser.src/include/ParsingDriver.hh b/parser.src/include/ParsingDriver.hh index 3cd0e7ee8..8752babee 100644 --- a/parser.src/include/ParsingDriver.hh +++ b/parser.src/include/ParsingDriver.hh @@ -2,11 +2,11 @@ #define _PARSING_DRIVER_HH #include +#include #include #include "ModFile.hh" -#include "Expression.hh" #include "TmpSymbolTable.hh" #include "DynareBison.hh" #include "ComputingTasks.hh" @@ -39,23 +39,25 @@ private: /*! Body defined at the end of DynareFlex.ll, for convenience reasons. */ void scan_end(); - //! Returns string output of last expression parsed - string get_expression(ExpObj *exp); - //! Checks that a given symbol exists, and stops with an error message if it doesn't void check_symbol_existence(const string &name); //! Creates option "optim_opt" in OptionsList if it doesn't exist, else add a comma, and adds the option name void optim_options_helper(const string &name); - //! Stores expressions - Expression expression; //! Stores temporary symbol table TmpSymbolTable *tmp_symbol_table; + //! The data tree in which to add expressions currently parsed + DataTree *data_tree; + //! The model tree in which to add expressions currently parsed + /*! It is only a dynamic cast of data_tree pointer, and is therefore null if data_tree is not a ModelTree instance */ ModelTree *model_tree; + //! Sets data_tree and model_tree pointers + void set_current_data_tree(DataTree *data_tree_arg); + //! Stores options lists OptionsList options_list; //! Temporary storage for trend elements @@ -79,7 +81,7 @@ private: //! Temporary storage for periods of deterministic shocks vector > det_shocks_periods; //! Temporary storage for values of deterministic shocks - vector det_shocks_values; + vector det_shocks_values; //! Temporary storage for variances of shocks ShocksStatement::var_and_std_shocks_type var_shocks; //! Temporary storage for standard errors of shocks @@ -97,6 +99,9 @@ private: //! Temporary storage for histval blocks HistValStatement::hist_values_type hist_values; + //! Temporary storage for argument list of unknown function + vector unknown_function_args; + //! The mod file representation constructed by this ParsingDriver ModFile *mod_file; @@ -144,12 +149,10 @@ public: //! Check if a given symbol exists in the parsing context bool exists_symbol(const char *s); - //! Sets variable offset of ModelTree class to use C output + //! Sets mode of ModelTree class to use C output void use_dll(); - //! Sets variable offset of ModelTree class to block decompose the model and to use C output + //! Sets mode of ModelTree class to block decompose the model and triggers the creation of the incidence matrix void sparse_dll(); - //! Initialize the model => creation of the incidence matrix - void initialize_model(); //! Sets the compiler type used in conjunction with SPARCE_DLL void init_compiler(int compiler_type); //! Sets the FILENAME for the initial value in initval @@ -164,22 +167,14 @@ public: void declare_parameter(string *name, string *tex_name = new string); //! Declares and initializes a local parameter void declare_and_init_local_parameter(string *name, NodeID rhs); - //! Adds an Expression's numerical constant - ExpObj *add_expression_constant(string *constant); - //! Adds a model constant to ModelTree - NodeID add_model_constant(string *constant); + //! Adds a constant to DataTree + NodeID add_constant(string *constant); //! Adds a model variable to ModelTree and VariableTable NodeID add_model_variable(string *name); //! Adds a model lagged variable to ModelTree and VariableTable NodeID add_model_variable(string *name, string *olag); //! Adds an Expression's variable - ExpObj *add_expression_variable(string *name); - //! Adds a binary token to an expression - ExpObj *add_expression_token(ExpObj *arg1, ExpObj *arg2, int op); - //! Adds an unary token to an expression - ExpObj *add_expression_token(ExpObj *arg1, int op); - //! Adds a unary token to an expression, with function name unknown - ExpObj *add_expression_token(ExpObj *arg1, string *op_name); + NodeID add_expression_variable(string *name); //! Adds a "periods" statement void periods(string *periods); //! Adds a "cutoff" statement @@ -189,11 +184,11 @@ public: //! Adds a "dsample" statement void dsample(string *arg1, string *arg2); //! Writes parameter intitialisation expression - void init_param(string *name, ExpObj *rhs); + void init_param(string *name, NodeID rhs); //! Writes an initval block - void init_val(string *name, ExpObj *rhs); + void init_val(string *name, NodeID rhs); //! Writes an histval block - void hist_val(string *name, string *lag, ExpObj *rhs); + void hist_val(string *name, string *lag, NodeID rhs); //! Writes end of an initval block void end_initval(); //! Writes end of an endval block @@ -209,29 +204,31 @@ public: //! Adds a deterministic chock void add_det_shock(string *var); //! Adds a std error chock - void add_stderr_shock(string *var, ExpObj *value); + void add_stderr_shock(string *var, NodeID value); //! Adds a variance chock - void add_var_shock(string *var, ExpObj *value); + void add_var_shock(string *var, NodeID value); //! Adds a covariance chock - void add_covar_shock(string *var1, string *var2, ExpObj *value); + void add_covar_shock(string *var1, string *var2, NodeID value); //! Adds a correlated chock - void add_correl_shock(string *var1, string *var2, ExpObj *value); + void add_correl_shock(string *var1, string *var2, NodeID value); //! Adds a shock period range void add_period(string *p1, string *p2); //! Adds a shock period void add_period(string *p1); - //! Adds a shock value - void add_value(string *value); - //! Adds a shock value - void add_value(ExpObj *value); + //! Adds a shock value (when only a numerical constant) + void add_value_const(string *value); + //! Adds a shock value (when only a variable name) + void add_value_var(string *name); + //! Adds a shock value (when it is a complete expression) + void add_value(NodeID value); //! Writes a Sigma_e block void do_sigma_e(); //! Ends row of Sigma_e block void end_of_row(); - //! Adds an element to current row of Sigma_e - void add_to_row(string *s); - //! Adds an element to current row of Sigma_e - void add_to_row(ExpObj *v); + //! Adds a constant element to current row of Sigma_e + void add_to_row_const(string *s); + //! Adds an expression element to current row of Sigma_e + void add_to_row(NodeID v); //! Write a steady command void steady(); //! Sets an option to a numerical value @@ -283,19 +280,19 @@ public: //! Prints varops instructions void set_varobs(); void set_trends(); - void set_trend_element(string *arg1, ExpObj *arg2); + void set_trend_element(string *arg1, NodeID arg2); void set_unit_root_vars(); void optim_weights(); - void set_optim_weights(string *name, ExpObj *value); - void set_optim_weights(string *name1, string *name2, ExpObj *value); + void set_optim_weights(string *name, NodeID value); + void set_optim_weights(string *name1, string *name2, NodeID value); void set_osr_params(); void run_osr(); void set_olr_inst(); void run_olr(); void run_calib_var(); - void set_calib_var(string *name, string *weight, ExpObj *expression); - void set_calib_covar(string *name1, string *name2, string *weight, ExpObj *expression); - void set_calib_ac(string *name, string *ar, string *weight, ExpObj *expression); + void set_calib_var(string *name, string *weight, NodeID expression); + void set_calib_covar(string *name1, string *name2, string *weight, NodeID expression); + void set_calib_ac(string *name, string *ar, string *weight, NodeID expression); void run_calib(int covar); void run_dynasave(string *arg1, string *arg2 = new string); void run_dynatype(string *arg1, string *arg2 = new string); @@ -312,51 +309,57 @@ public: //! Writes token "arg=0" to model tree NodeID add_model_equal_with_zero_rhs(NodeID arg); //! Writes token "arg1+arg2" to model tree - NodeID add_model_plus(NodeID arg1, NodeID arg2); + NodeID add_plus(NodeID arg1, NodeID arg2); //! Writes token "arg1-arg2" to model tree - NodeID add_model_minus(NodeID arg1, NodeID arg2); + NodeID add_minus(NodeID arg1, NodeID arg2); //! Writes token "-arg1" to model tree - NodeID add_model_uminus(NodeID arg1); + NodeID add_uminus(NodeID arg1); //! Writes token "arg1*arg2" to model tree - NodeID add_model_times(NodeID arg1, NodeID arg2); + NodeID add_times(NodeID arg1, NodeID arg2); //! Writes token "arg1/arg2" to model tree - NodeID add_model_divide(NodeID arg1, NodeID arg2); + NodeID add_divide(NodeID arg1, NodeID arg2); //! Writes token "arg1^arg2" to model tree - NodeID add_model_power(NodeID arg1, NodeID arg2); + NodeID add_power(NodeID arg1, NodeID arg2); //! Writes token "exp(arg1)" to model tree - NodeID add_model_exp(NodeID arg1); + NodeID add_exp(NodeID arg1); //! Writes token "log(arg1)" to model tree - NodeID add_model_log(NodeID arg1); + NodeID add_log(NodeID arg1); //! Writes token "log10(arg1)" to model tree - NodeID add_model_log10(NodeID arg1); + NodeID add_log10(NodeID arg1); //! Writes token "cos(arg1)" to model tree - NodeID add_model_cos(NodeID arg1); + NodeID add_cos(NodeID arg1); //! Writes token "sin(arg1)" to model tree - NodeID add_model_sin(NodeID arg1); + NodeID add_sin(NodeID arg1); //! Writes token "tan(arg1)" to model tree - NodeID add_model_tan(NodeID arg1); + NodeID add_tan(NodeID arg1); //! Writes token "acos(arg1)" to model tree - NodeID add_model_acos(NodeID arg1); + NodeID add_acos(NodeID arg1); //! Writes token "asin(arg1)" to model tree - NodeID add_model_asin(NodeID arg1); + NodeID add_asin(NodeID arg1); //! Writes token "atan(arg1)" to model tree - NodeID add_model_atan(NodeID arg1); + NodeID add_atan(NodeID arg1); //! Writes token "cosh(arg1)" to model tree - NodeID add_model_cosh(NodeID arg1); + NodeID add_cosh(NodeID arg1); //! Writes token "sinh(arg1)" to model tree - NodeID add_model_sinh(NodeID arg1); + NodeID add_sinh(NodeID arg1); //! Writes token "tanh(arg1)" to model tree - NodeID add_model_tanh(NodeID arg1); + NodeID add_tanh(NodeID arg1); //! Writes token "acosh(arg1)" to model tree - NodeID add_model_acosh(NodeID arg1); + NodeID add_acosh(NodeID arg1); //! Writes token "asin(arg1)" to model tree - NodeID add_model_asinh(NodeID arg1); + NodeID add_asinh(NodeID arg1); //! Writes token "atanh(arg1)" to model tree - NodeID add_model_atanh(NodeID arg1); + NodeID add_atanh(NodeID arg1); //! Writes token "sqrt(arg1)" to model tree - NodeID add_model_sqrt(NodeID arg1); + NodeID add_sqrt(NodeID arg1); + //! Adds an unknwon function argument + void add_unknown_function_arg(NodeID arg); + //! Adds an unknown function call node + NodeID add_unknown_function(string *function_name); //! Adds a native statement void add_native(const char *s); + //! Resets data_tree and model_tree pointers to default (i.e. mod_file->expressions_tree) + void reset_data_tree(); }; #endif // ! PARSING_DRIVER_HH diff --git a/parser.src/include/Shocks.hh b/parser.src/include/Shocks.hh index cbadc9b1f..945800c53 100644 --- a/parser.src/include/Shocks.hh +++ b/parser.src/include/Shocks.hh @@ -9,6 +9,7 @@ using namespace std; #include "Statement.hh" #include "SymbolTable.hh" +#include "ExprNode.hh" class AbstractShocksStatement : public Statement { @@ -17,11 +18,11 @@ public: { int period1; int period2; - string value; + NodeID value; }; typedef map > det_shocks_type; - typedef map var_and_std_shocks_type; - typedef map, string> covar_and_corr_shocks_type; + typedef map var_and_std_shocks_type; + typedef map, NodeID> covar_and_corr_shocks_type; protected: //! Is this statement a "mshocks" statement ? (instead of a "shocks" statement) const bool mshocks; diff --git a/parser.src/include/SigmaeInitialization.hh b/parser.src/include/SigmaeInitialization.hh index 18a5f25e3..47015b20e 100644 --- a/parser.src/include/SigmaeInitialization.hh +++ b/parser.src/include/SigmaeInitialization.hh @@ -6,6 +6,7 @@ using namespace std; #include #include +#include "ExprNode.hh" #include "Statement.hh" //! Stores a Sigma_e statement @@ -19,7 +20,7 @@ public: eUpper = 1 //!< Upper triangular matrix }; //! Type of a matrix row - typedef vector row_type; + typedef vector row_type; //! Type of a complete matrix typedef vector matrix_type; diff --git a/parser.src/include/SymbolTable.hh b/parser.src/include/SymbolTable.hh index bdd80b2a5..c19b21340 100644 --- a/parser.src/include/SymbolTable.hh +++ b/parser.src/include/SymbolTable.hh @@ -7,10 +7,13 @@ \par This file defines the SymbolTable class . */ //------------------------------------------------------------------------------ +using namespace std; + #include #include #include #include +#include #include "SymbolTableTypes.hh" @@ -114,7 +117,10 @@ inline Type SymbolTable::getType(const std::string &name) const { symboltable_const_iterator iter = symboltable.find(name); if (iter == symboltable.end()) - return eUNDEF; + { + cerr << "SymbolTable::getType: unknwon symbol: " << name << endl; + exit(-1); + } else return iter->second.type; } diff --git a/parser.src/include/SymbolTableTypes.hh b/parser.src/include/SymbolTableTypes.hh index c24454367..0444b0cac 100644 --- a/parser.src/include/SymbolTableTypes.hh +++ b/parser.src/include/SymbolTableTypes.hh @@ -1,15 +1,7 @@ #ifndef _SYMBOLTABLETYPES_HH #define _SYMBOLTABLETYPES_HH -//------------------------------------------------------------------------------ -/*! \file - \version 1.0 - \date 04/26/2004 - \par This file defines types related to SymbolTable. -*/ -#include - -/*! Symbol type enum */ +//! Symbol type enum enum Type { eEndogenous = 0, //!< Endogenous @@ -18,35 +10,27 @@ enum Type eRecursiveVariable = 3, //!< Recursive variable (reserved for future use) eParameter = 4, //!< Parameter eLocalParameter = 10, //!< Parameter local to a model - eTempResult = 6, //!< Temporary result, used only in Expression class - eNumericalConstant = 7, //!< Numerical constant, used only in Expression class - eUNDEF = 9 //!< Undefined }; -/*! Symbol reference flag enum */ + +//! Symbol reference flag enum enum Reference { eNotReferenced, //!< Not yet referenced in model eReferenced, //!< Already referenced in model }; -/*! - \class Symbol - \brief Symbol structure -*/ + struct Symbol { - /*! Symbol type */ + //! Symbol type Type type; - /*! Symbol ID : for each type */ + //! Symbol ID : for each type int id; - /*! Symbol reference flag */ + //! Symbol reference flag Reference referenced; - Symbol() + Symbol() : id(-1), referenced(eNotReferenced) { - type = eUNDEF; - id = -1; - referenced = eNotReferenced; } -} ; -//------------------------------------------------------------------------------ +}; + #endif diff --git a/parser.src/include/interprete.hh b/parser.src/include/interprete.hh deleted file mode 100644 index 511170dde..000000000 --- a/parser.src/include/interprete.hh +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _INTERPRETE_HH -#define _INTERPRETE_HH -#include -#include -#include -#include -#include "SymbolTable.hh" -#include "VariableTable.hh" -#include "ExprNode.hh" -//#define PRINT_IT - - -using namespace std; -typedef struct t_val_index -{ - int index,type,indexed; - double value; -}; - -typedef struct t_val1_index -{ - string name; - double value; -}; - - -typedef stack STACK_SIMPLE00; -typedef map > t_map_to_val_index; -typedef map t_map_int; - -class interprete -{ -public: - double cutoff; - bool eval; - double u1, u2; - STACK_SIMPLE00 Stack; - interprete(); - double S_to_Val(string *str); - double get_value(string *str, double ll); - void put_value(string *str, int num,int Type, double val); - void print_all(); - void create_id_map(int* Table, int Size, int HSize); - double GetDataValue(/*NodeID*/int id, Type type); - void set_cutoff(double r); -private: - string tmp_put_value_name; - t_map_to_val_index variable; - t_map_int i_endo_variable, i_exo_variable, i_param_variable; -}; -#endif diff --git a/parser.src/interprete.cc b/parser.src/interprete.cc deleted file mode 100644 index 99bf9bb8d..000000000 --- a/parser.src/interprete.cc +++ /dev/null @@ -1,95 +0,0 @@ -#include "interprete.hh" - -interprete::interprete() -{ - eval=true; - cutoff=1.0e-6; -} - -void -interprete::set_cutoff(double r) -{ - cutoff=r; -} - -double -interprete::S_to_Val(string *str) -{ - double v=atof((*str).c_str()); -#ifdef PRINT_IT - cout << "v=" << v << "\n"; -#endif - return(v); -} - -double -interprete::get_value(string *str, double ll) -{ -#ifdef PRINT_IT - cout << "value[" << *str << "]=" << variable[(*str)].value << "\n"; -#endif - return(variable[(*str)].value); -} - -void -interprete::put_value(string *str, int num,int Type, double val) -{ -#ifdef PRINT_IT - cout << "*str=" << *str << " val=" << val << "\n"; -#endif - tmp_put_value_name=*str; - variable[(*str)].value=val; - variable[(*str)].index=num; - variable[(*str)].type=Type; -} - -void -interprete::print_all() -{ - map::iterator iter; - for( iter = variable.begin(); iter != variable.end(); iter++ ) - { - cout << "Name= " << iter->first << ", Value= " << iter->second.value << ", Index= " << iter->second.index << ", Type= " << iter->second.type << ", Indexed=" << iter->second.index << endl; - } -} - -void -interprete::create_id_map(int *Table, int Size, int HSize) -{ - map::iterator iter; - for( iter = variable.begin(); iter != variable.end(); iter++ ) - { - if(iter->second.type==0) - { - i_endo_variable[iter->second.index].name=iter->first; - i_endo_variable[iter->second.index].value=iter->second.value; - } - else if(iter->second.type==1) - { - i_exo_variable[iter->second.index].name=iter->first; - i_exo_variable[iter->second.index].value=iter->second.value; - } - else if(iter->second.type==4) - { - i_param_variable[iter->second.index].name=iter->first; - i_param_variable[iter->second.index].value=iter->second.value; - } - } -} - -double -interprete::GetDataValue(int id, Type type) -{ - switch(type) - { - case eParameter: - return(i_param_variable[(long int) id].value); - case eEndogenous: - return(i_endo_variable[(long int) id].value); - case eExogenous: - return(i_exo_variable[(long int) id].value); - default: - cerr << "interprete::GetDataValue: unhandled type!!"; - exit(-1); - } -}