File indexing completed on 2025-01-18 09:40:48
0001 #ifndef BOOST_METAPARSE_V1_IMPL_APPLY_PARSER_HPP
0002 #define BOOST_METAPARSE_V1_IMPL_APPLY_PARSER_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/metaparse/v1/unless_error.hpp>
0010 #include <boost/metaparse/v1/get_result.hpp>
0011 #include <boost/metaparse/v1/get_remaining.hpp>
0012 #include <boost/metaparse/v1/get_position.hpp>
0013 #include <boost/metaparse/v1/transform.hpp>
0014
0015 #include <boost/mpl/push_back.hpp>
0016
0017 namespace boost
0018 {
0019 namespace metaparse
0020 {
0021 namespace v1
0022 {
0023 namespace impl
0024 {
0025 struct apply_parser
0026 {
0027 private:
0028 template <class ListToAppend>
0029 struct do_append
0030 {
0031 template <class Item>
0032 struct apply : boost::mpl::push_back<ListToAppend, Item> {};
0033 };
0034
0035 template <class Accum, class S, class Pos, class Parser>
0036 struct apply_unchecked :
0037 transform<Parser,do_append<typename Accum::type> >::template apply<
0038 typename S::type,
0039 typename Pos::type
0040 >
0041 {};
0042
0043 public:
0044 template <class State, class Parser>
0045 struct apply :
0046 unless_error<
0047 State,
0048 apply_unchecked<
0049 get_result<State>,
0050 get_remaining<State>,
0051 get_position<State>,
0052 Parser
0053 >
0054 >
0055 {};
0056 };
0057 }
0058 }
0059 }
0060 }
0061
0062 #endif
0063