7#if !defined(STACKEVALUATOR_HPP)
8#define STACKEVALUATOR_HPP
13#include <boost/function.hpp>
14#include <boost/assert.hpp>
15#include <boost/variant/get.hpp>
16#include <boost/variant/variant.hpp>
17#include <boost/spirit/include/phoenix_core.hpp>
18#include <boost/spirit/include/phoenix_function.hpp>
19#include <boost/spirit/include/phoenix_operator.hpp>
25namespace client {
namespace code_gen
31 template <
typename ErrorHandler>
34 namespace phx = boost::phoenix;
38 (std::string(
"Error! "),
40 phx::cref(error_handler_.iters)[phx::arg_names::_1]);
46 double result = boost::get<double>(res);
57 std::map<std::string, client::function::type> functions) {
58 functions_.insert(functions.begin(), functions.end());
62 std::map<std::string, double> variableDictionary) {
83 std::map<std::string, client::function::type>
functions_;
py::list function(PolynomialPatch *patch, py::list point)
std::pair< std::string, type > named_t
std::vector< argument_t > arguments_t
boost::variant< double, bool, std::string > argument_t
boost::function< boost::tuple< double, bool >(arguments_t)> type
boost::function< void(int tag, std::string const &what)> error_handler
void registerVariables(std::map< std::string, double > variableDictionary)
client::function::arguments_t evaluation_stack_
void registerFunction(std::string name, client::function::type callback)
bool operator()(ast::nil)
std::map< std::string, client::function::type > functions_
StackEvaluator(ErrorHandler &error_handler_)
void registerFunctions(std::map< std::string, client::function::type > functions)
std::map< std::string, double > variableDictionary_