1 #ifndef STAN_LANG_GRAMMARS_EXPRESSION_GRAMMAR_DEF_HPP
2 #define STAN_LANG_GRAMMARS_EXPRESSION_GRAMMAR_DEF_HPP
5 #include <boost/spirit/include/qi.hpp>
6 #include <boost/spirit/include/phoenix_core.hpp>
21 template <
typename Iterator>
22 expression_grammar<Iterator>::expression_grammar(variable_map& var_map,
23 std::stringstream& error_msgs)
24 : expression_grammar::base_type(expression_r),
26 error_msgs_(error_msgs),
27 expression07_g(var_map, error_msgs, *
this) {
28 using boost::spirit::qi::_1;
29 using boost::spirit::qi::lit;
30 using boost::spirit::qi::_pass;
31 using boost::spirit::qi::_val;
32 using boost::spirit::qi::labels::_r1;
34 expression_r.name(
"expression");
36 %= conditional_op_r(_r1)
37 | expression15_r(_r1);
40 conditional_op_r.name(
"conditional op expression, cond ? t_val : f_val ");
42 %= expression15_r(_r1)
47 boost::phoenix::ref(error_msgs))];
49 expression15_r.name(
"expression");
55 boost::phoenix::ref(error_msgs))]);
57 expression14_r.name(
"expression");
63 boost::phoenix::ref(error_msgs))]);
65 expression10_r.name(
"expression");
71 boost::phoenix::ref(error_msgs))])
76 boost::phoenix::ref(error_msgs))]));
78 expression09_r.name(
"expression");
84 boost::phoenix::ref(error_msgs))])
88 boost::phoenix::ref(error_msgs))])
92 boost::phoenix::ref(error_msgs))])
96 boost::phoenix::ref(error_msgs))]));
boost::phoenix::function< binary_op_expr > binary_op_f
boost::phoenix::function< validate_conditional_op > validate_conditional_op_f
Probability, optimization and sampling library.
BOOST_FUSION_ADAPT_STRUCT(stan::lang::conditional_op,(stan::lang::expression, cond_)(stan::lang::expression, true_val_)(stan::lang::expression, false_val_)) namespace stan
boost::phoenix::function< assign_lhs > assign_lhs_f