12.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef BOOST_METAPARSE_GETTING_STARTED_12_HPP
  2. #define BOOST_METAPARSE_GETTING_STARTED_12_HPP
  3. // Automatically generated header file
  4. // Definitions before section 11.3.2
  5. #include "11_3_2.hpp"
  6. // Definitions of section 11.3.2
  7. struct plus_exp6;
  8. using paren_exp5 = middle_of<lparen_token, plus_exp6, rparen_token>;
  9. using primary_exp4 = one_of<int_token, paren_exp5, fail<missing_primary_expression>>;
  10. using unary_exp4 =
  11. foldr_start_with_parser<
  12. minus_token,
  13. primary_exp4,
  14. boost::mpl::lambda<boost::mpl::negate<boost::mpl::_1>>::type
  15. >;
  16. using mult_exp7 =
  17. foldl_reject_incomplete_start_with_parser<
  18. sequence<one_of<times_token, divides_token>, unary_exp4>,
  19. unary_exp4,
  20. boost::mpl::quote2<binary_op>
  21. >;
  22. struct plus_exp6 :
  23. foldl_reject_incomplete_start_with_parser<
  24. sequence<one_of<plus_token, minus_token>, mult_exp7>,
  25. mult_exp7,
  26. boost::mpl::quote2<binary_op>
  27. > {};
  28. using exp_parser23 = build_parser<plus_exp6>;
  29. // query:
  30. // exp_parser23::apply<BOOST_METAPARSE_STRING("1+(2*")>::type
  31. // query:
  32. // exp_parser23::apply<BOOST_METAPARSE_STRING("1+(2*3")>::type
  33. #endif