10.hpp 906 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef BOOST_METAPARSE_GETTING_STARTED_10_HPP
  2. #define BOOST_METAPARSE_GETTING_STARTED_10_HPP
  3. // Automatically generated header file
  4. // Definitions before section 9
  5. #include "9.hpp"
  6. // Definitions of section 9
  7. #include <boost/mpl/negate.hpp>
  8. using unary_exp1 =
  9. foldr_start_with_parser<
  10. minus_token,
  11. int_token,
  12. boost::mpl::lambda<boost::mpl::negate<boost::mpl::_1>>::type
  13. >;
  14. using mult_exp4 =
  15. foldl_start_with_parser<
  16. sequence<one_of<times_token, divides_token>, unary_exp1>,
  17. unary_exp1,
  18. boost::mpl::quote2<binary_op>
  19. >;
  20. using exp_parser18 =
  21. build_parser<
  22. foldl_start_with_parser<
  23. sequence<one_of<plus_token, minus_token>, mult_exp4>,
  24. mult_exp4,
  25. boost::mpl::quote2<binary_op>
  26. >
  27. >;
  28. // query:
  29. // exp_parser18::apply<BOOST_METAPARSE_STRING("---13")>::type
  30. // query:
  31. // exp_parser18::apply<BOOST_METAPARSE_STRING("13")>::type
  32. #endif