0a1,21
> /* Copyright (c) 2012 Massachusetts Institute of Technology
> *
> * Permission is hereby granted, free of charge, to any person obtaining a copy
> * of this software and associated documentation files (the "Software"), to deal
> * in the Software without restriction, including without limitation the rights
> * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> * copies of the Software, and to permit persons to whom the Software is
> * furnished to do so, subject to the following conditions:
> *
> * The above copyright notice and this permission notice shall be included in
> * all copies or substantial portions of the Software.
> *
> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> * THE SOFTWARE.
> */
>
26c47,50
< void Calculator::evaluateString(const String& str_)
---
> void Calculator::evaluateString(const String& str_,
> const map<String, String> &config,
> DSENT::Model *ms_model,
> map<string, double> &outputs)
28a53
>
44a70
> outputs[print_str] = 0;
49,50c75,77
< double v = expr(ist, false);
< cout << scientific << print_str << v << endl;
---
> double v = expr(ist, false, config, ms_model);
> outputs[print_str] = v;
> cout << print_str << v << endl;
55,56c82,84
< double v = expr(ist, false);
< cout << scientific << v << endl;
---
> double v = expr(ist, false, config, ms_model);
> outputs["Missing Expression"] = v;
> cout << v << endl;
61c89
< expr(ist, false);
---
> expr(ist, false, config, ms_model);
64d91
< return;
149c176,178
< double Calculator::prim(istringstream& ist_, bool is_get_)
---
> double Calculator::prim(istringstream& ist_, bool is_get_,
> const map<String, String> &config,
> DSENT::Model *ms_model)
167c196
< v = expr(ist_, true);
---
> v = expr(ist_, true, config, ms_model);
176c205
< v = getEnvVar(m_value_string_);
---
> v = getEnvVar(m_value_string_, config, ms_model);
180c209
< return -prim(ist_, true);
---
> return -prim(ist_, true, config, ms_model);
182c211
< v = expr(ist_, true);
---
> v = expr(ist_, true, config, ms_model);
191c220,222
< double Calculator::term(istringstream& ist_, bool is_get_)
---
> double Calculator::term(istringstream& ist_, bool is_get_,
> const map<String, String> &config,
> DSENT::Model *ms_model)
193c224
< double left = prim(ist_, is_get_);
---
> double left = prim(ist_, is_get_, config, ms_model);
201c232
< left *= prim(ist_, true);
---
> left *= prim(ist_, true, config, ms_model);
204c235
< d = prim(ist_, true);
---
> d = prim(ist_, true, config, ms_model);
214c245,247
< double Calculator::expr(istringstream& ist_, bool is_get_)
---
> double Calculator::expr(istringstream& ist_, bool is_get_,
> const map<String, String> &config,
> DSENT::Model *ms_model)
216c249
< double left = term(ist_, is_get_);
---
> double left = term(ist_, is_get_, config, ms_model);
223c256
< left += term(ist_, true);
---
> left += term(ist_, true, config, ms_model);
226c259
< left -= term(ist_, true);
---
> left -= term(ist_, true, config, ms_model);
234c267,269
< double Calculator::getEnvVar(const String& var_name_) const
---
> double Calculator::getEnvVar(const String& var_name_,
> const map<String, String> &config,
> DSENT::Model *ms_model) const
239d273
<