sl@0: /*============================================================================= sl@0: Copyright (c) 2001-2003 Joel de Guzman sl@0: Copyright (c) 2002-2003 Hartmut Kaiser sl@0: http://spirit.sourceforge.net/ sl@0: sl@0: Use, modification and distribution is subject to the Boost Software sl@0: License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: http://www.boost.org/LICENSE_1_0.txt) sl@0: =============================================================================*/ sl@0: #ifndef BOOST_SPIRIT_CLOSURE_HPP sl@0: #define BOOST_SPIRIT_CLOSURE_HPP sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // Spirit predefined maximum closure limit. This limit defines the maximum sl@0: // number of elements a closure can hold. This number defaults to 3. The sl@0: // actual maximum is rounded up in multiples of 3. Thus, if this value sl@0: // is 4, the actual limit is 6. The ultimate maximum limit in this sl@0: // implementation is 15. sl@0: // sl@0: // It should NOT be greater than PHOENIX_LIMIT! sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: sl@0: #if !defined(BOOST_SPIRIT_CLOSURE_LIMIT) sl@0: #define BOOST_SPIRIT_CLOSURE_LIMIT PHOENIX_LIMIT sl@0: #endif sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // ensure BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT and SPIRIT_CLOSURE_LIMIT <= 15 sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT); sl@0: BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= 15); sl@0: sl@0: /////////////////////////////////////////////////////////////////////////////// sl@0: namespace boost { namespace spirit { sl@0: sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // closure_context class sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: template sl@0: class closure_context : public parser_context_base sl@0: { sl@0: public: sl@0: sl@0: typedef typename phoenix::tuple_element<0, sl@0: typename ClosureT::tuple_t>::type attr_t; sl@0: typedef ClosureT base_t; sl@0: typedef closure_context_linker > sl@0: context_linker_t; sl@0: sl@0: closure_context(ClosureT const& clos) sl@0: : frame(clos) {} sl@0: sl@0: ~closure_context() {} sl@0: sl@0: template sl@0: void pre_parse(ParserT const&, ScannerT const&) {} sl@0: sl@0: template sl@0: ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&) sl@0: { hit.value(frame[phoenix::tuple_index<0>()]); return hit; } sl@0: sl@0: private: sl@0: sl@0: phoenix::closure_frame frame; sl@0: }; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // init_closure_context class sl@0: // sl@0: // The init_closure_context class is a special parser context type sl@0: // which additionally initializes a closure contained in the derived sl@0: // parser with values from a given tuple. Please note, that this sl@0: // given tuple does not contain the required values directly, it sl@0: // contains phoenix::actor objects. These actors have to be sl@0: // dereferenced to gain the values to be used for initialization sl@0: // (this is done by the help of the phoenix::convert_actors<> sl@0: // template). sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: sl@0: template sl@0: class init_closure_context : public parser_context_base sl@0: { sl@0: typedef typename ClosureT::tuple_t tuple_t; sl@0: typedef typename ClosureT::closure_t closure_t; sl@0: sl@0: public: sl@0: sl@0: init_closure_context(ClosureT const& clos) sl@0: : frame(clos.subject(), phoenix::convert_actors(clos.init)) {} sl@0: sl@0: ~init_closure_context() {} sl@0: sl@0: template sl@0: void pre_parse(ParserT const& /*p*/, ScannerT const&) {} sl@0: sl@0: template sl@0: ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&) sl@0: { hit.value(frame[phoenix::tuple_index<0>()]); return hit; } sl@0: sl@0: private: sl@0: sl@0: phoenix::closure_frame frame; sl@0: }; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // init_closure_parser class sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: template sl@0: struct init_closure_parser sl@0: : public unary > > sl@0: { sl@0: typedef init_closure_parser self_t; sl@0: typedef unary > base_t; sl@0: typedef typename ParserT::phoenix_closure_t closure_t; sl@0: typedef typename ParserT::tuple_t tuple_t; sl@0: typedef typename phoenix::tuple_element<0, tuple_t>::type attr_t; sl@0: sl@0: template sl@0: struct result sl@0: { sl@0: typedef typename match_result::type type; sl@0: }; sl@0: sl@0: init_closure_parser(ParserT const& p, ActorTupleT const& init_) sl@0: : base_t(p), init(init_) {} sl@0: sl@0: template sl@0: typename parser_result::type sl@0: parse_main(ScannerT const& scan) const sl@0: { sl@0: return this->subject().parse_main(scan); sl@0: } sl@0: sl@0: template sl@0: typename parser_result::type sl@0: parse(ScannerT const& scan) const sl@0: { sl@0: typedef init_closure_context init_context_t; sl@0: typedef parser_scanner_linker scanner_t; sl@0: typedef closure_context_linker context_t; sl@0: typedef typename parser_result::type result_t; sl@0: BOOST_SPIRIT_CONTEXT_PARSE( sl@0: scan, *this, scanner_t, context_t, result_t); sl@0: } sl@0: sl@0: ActorTupleT init; sl@0: }; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // closure class sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: template < sl@0: typename DerivedT sl@0: , typename T0 sl@0: , typename T1 sl@0: , typename T2 sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 sl@0: , typename T3 sl@0: , typename T4 sl@0: , typename T5 sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 sl@0: , typename T6 sl@0: , typename T7 sl@0: , typename T8 sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 sl@0: , typename T9 sl@0: , typename T10 sl@0: , typename T11 sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 sl@0: , typename T12 sl@0: , typename T13 sl@0: , typename T14 sl@0: #endif sl@0: #endif sl@0: #endif sl@0: #endif sl@0: > sl@0: struct closure : sl@0: public phoenix::closure< sl@0: T0, T1, T2 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 sl@0: , T3, T4, T5 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 sl@0: , T6, T7, T8 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 sl@0: , T9, T10, T11 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 sl@0: , T12, T13, T14 sl@0: #endif sl@0: #endif sl@0: #endif sl@0: #endif sl@0: > sl@0: { sl@0: typedef phoenix::closure< sl@0: T0, T1, T2 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 sl@0: , T3, T4, T5 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 sl@0: , T6, T7, T8 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 sl@0: , T9, T10, T11 sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 sl@0: , T12, T13, T14 sl@0: #endif sl@0: #endif sl@0: #endif sl@0: #endif sl@0: > phoenix_closure_t; sl@0: sl@0: typedef closure_context context_t; sl@0: sl@0: template sl@0: struct aux sl@0: { sl@0: DerivedT2& aux_derived() sl@0: { return *static_cast(this); } sl@0: sl@0: DerivedT2 const& aux_derived() const sl@0: { return *static_cast(this); } sl@0: sl@0: // initialization functions sl@0: template sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()(A const &a) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef phoenix::tuple actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()(A const &a, B const &b) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef phoenix::tuple actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()(A const &a, B const &b, C const &c) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef phoenix::tuple actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I, typename J sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i, J const &j sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef typename phoenix::as_actor::type j_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i), sl@0: phoenix::as_actor::convert(j) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I, typename J, sl@0: typename K sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i, J const &j, sl@0: K const &k sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef typename phoenix::as_actor::type j_t; sl@0: typedef typename phoenix::as_actor::type k_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, sl@0: k_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i), sl@0: phoenix::as_actor::convert(j), sl@0: phoenix::as_actor::convert(k) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I, typename J, sl@0: typename K, typename L sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i, J const &j, sl@0: K const &k, L const &l sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef typename phoenix::as_actor::type j_t; sl@0: typedef typename phoenix::as_actor::type k_t; sl@0: typedef typename phoenix::as_actor::type l_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, sl@0: k_t, l_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i), sl@0: phoenix::as_actor::convert(j), sl@0: phoenix::as_actor::convert(k), sl@0: phoenix::as_actor::convert(l) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I, typename J, sl@0: typename K, typename L, typename M sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i, J const &j, sl@0: K const &k, L const &l, M const &m sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef typename phoenix::as_actor::type j_t; sl@0: typedef typename phoenix::as_actor::type k_t; sl@0: typedef typename phoenix::as_actor::type l_t; sl@0: typedef typename phoenix::as_actor::type m_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, sl@0: k_t, l_t, m_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i), sl@0: phoenix::as_actor::convert(j), sl@0: phoenix::as_actor::convert(k), sl@0: phoenix::as_actor::convert(l), sl@0: phoenix::as_actor::convert(m) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I, typename J, sl@0: typename K, typename L, typename M, typename N sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i, J const &j, sl@0: K const &k, L const &l, M const &m, N const &n sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef typename phoenix::as_actor::type j_t; sl@0: typedef typename phoenix::as_actor::type k_t; sl@0: typedef typename phoenix::as_actor::type l_t; sl@0: typedef typename phoenix::as_actor::type m_t; sl@0: typedef typename phoenix::as_actor::type n_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, sl@0: k_t, l_t, m_t, n_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i), sl@0: phoenix::as_actor::convert(j), sl@0: phoenix::as_actor::convert(k), sl@0: phoenix::as_actor::convert(l), sl@0: phoenix::as_actor::convert(m), sl@0: phoenix::as_actor::convert(n) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: template < sl@0: typename A, typename B, typename C, typename D, typename E, sl@0: typename F, typename G, typename H, typename I, typename J, sl@0: typename K, typename L, typename M, typename N, typename O sl@0: > sl@0: init_closure_parser< sl@0: DerivedT2, sl@0: phoenix::tuple< sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type, sl@0: typename phoenix::as_actor::type sl@0: > sl@0: > sl@0: operator()( sl@0: A const &a, B const &b, C const &c, D const &d, E const &e, sl@0: F const &f, G const &g, H const &h, I const &i, J const &j, sl@0: K const &k, L const &l, M const &m, N const &n, O const &o sl@0: ) const sl@0: { sl@0: typedef typename phoenix::as_actor::type a_t; sl@0: typedef typename phoenix::as_actor::type b_t; sl@0: typedef typename phoenix::as_actor::type c_t; sl@0: typedef typename phoenix::as_actor::type d_t; sl@0: typedef typename phoenix::as_actor::type e_t; sl@0: typedef typename phoenix::as_actor::type f_t; sl@0: typedef typename phoenix::as_actor::type g_t; sl@0: typedef typename phoenix::as_actor::type h_t; sl@0: typedef typename phoenix::as_actor::type i_t; sl@0: typedef typename phoenix::as_actor::type j_t; sl@0: typedef typename phoenix::as_actor::type k_t; sl@0: typedef typename phoenix::as_actor::type l_t; sl@0: typedef typename phoenix::as_actor::type m_t; sl@0: typedef typename phoenix::as_actor::type n_t; sl@0: typedef typename phoenix::as_actor::type o_t; sl@0: typedef phoenix::tuple< sl@0: a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, sl@0: k_t, l_t, m_t, n_t, o_t sl@0: > actor_tuple_t; sl@0: sl@0: return init_closure_parser( sl@0: aux_derived(), sl@0: actor_tuple_t( sl@0: phoenix::as_actor::convert(a), sl@0: phoenix::as_actor::convert(b), sl@0: phoenix::as_actor::convert(c), sl@0: phoenix::as_actor::convert(d), sl@0: phoenix::as_actor::convert(e), sl@0: phoenix::as_actor::convert(f), sl@0: phoenix::as_actor::convert(g), sl@0: phoenix::as_actor::convert(h), sl@0: phoenix::as_actor::convert(i), sl@0: phoenix::as_actor::convert(j), sl@0: phoenix::as_actor::convert(k), sl@0: phoenix::as_actor::convert(l), sl@0: phoenix::as_actor::convert(m), sl@0: phoenix::as_actor::convert(n), sl@0: phoenix::as_actor::convert(o) sl@0: ) sl@0: ); sl@0: } sl@0: sl@0: #endif sl@0: #endif sl@0: #endif sl@0: #endif sl@0: }; sl@0: sl@0: ~closure() {} sl@0: }; sl@0: sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: // sl@0: // overloads for chseq_p and str_p taking in phoenix actors sl@0: // sl@0: /////////////////////////////////////////////////////////////////////////// sl@0: template sl@0: struct container_begin sl@0: { sl@0: typedef container_begin self_t; sl@0: sl@0: template sl@0: struct result sl@0: { sl@0: typedef typename phoenix::actor_result sl@0: ::plain_type::iterator type; sl@0: }; sl@0: sl@0: container_begin(ActorT actor_) sl@0: : actor(actor_) {} sl@0: sl@0: template sl@0: typename phoenix::actor_result::type sl@0: eval(TupleT const& /*args*/) const sl@0: { return actor().begin(); } sl@0: sl@0: ActorT actor; sl@0: }; sl@0: sl@0: template sl@0: struct container_end sl@0: { sl@0: typedef container_begin self_t; sl@0: sl@0: template sl@0: struct result sl@0: { sl@0: typedef typename phoenix::actor_result sl@0: ::plain_type::iterator type; sl@0: }; sl@0: sl@0: container_end(ActorT actor_) sl@0: : actor(actor_) {} sl@0: sl@0: template sl@0: typename phoenix::actor_result::type sl@0: eval(TupleT const& /*args*/) const sl@0: { return actor().end(); } sl@0: sl@0: ActorT actor; sl@0: }; sl@0: sl@0: template sl@0: inline f_chseq< sl@0: phoenix::actor > >, sl@0: phoenix::actor > > sl@0: > sl@0: f_chseq_p(phoenix::actor const& a) sl@0: { sl@0: typedef phoenix::actor > > sl@0: container_begin_t; sl@0: typedef phoenix::actor > > sl@0: container_end_t; sl@0: typedef f_chseq result_t; sl@0: sl@0: return result_t(container_begin_t(a), container_end_t(a)); sl@0: } sl@0: sl@0: template sl@0: inline f_strlit< sl@0: phoenix::actor > >, sl@0: phoenix::actor > > sl@0: > sl@0: f_str_p(phoenix::actor const& a) sl@0: { sl@0: typedef phoenix::actor > > sl@0: container_begin_t; sl@0: typedef phoenix::actor > > sl@0: container_end_t; sl@0: typedef f_strlit result_t; sl@0: sl@0: return result_t(container_begin_t(a), container_end_t(a)); sl@0: } sl@0: sl@0: }} // namespace boost::spirit sl@0: sl@0: #endif