Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:08:56

0001 /*=============================================================================
0002     Copyright (c) 2001-2003 Joel de Guzman
0003     Copyright (c) 2002-2003 Hartmut Kaiser
0004     http://spirit.sourceforge.net/
0005 
0006   Distributed under the Boost Software License, Version 1.0. (See accompanying
0007   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 =============================================================================*/
0009 #ifndef BOOST_SPIRIT_CLOSURE_HPP
0010 #define BOOST_SPIRIT_CLOSURE_HPP
0011 
0012 ///////////////////////////////////////////////////////////////////////////////
0013 #include <boost/spirit/home/classic/namespace.hpp>
0014 #include <boost/spirit/home/classic/core/parser.hpp>
0015 #include <boost/spirit/home/classic/core/composite/composite.hpp>
0016 #include <boost/spirit/home/classic/core/non_terminal/parser_context.hpp>
0017 #include <boost/spirit/home/classic/attribute/parametric.hpp>
0018 #include <boost/spirit/home/classic/attribute/closure_context.hpp>
0019 #include <boost/spirit/home/classic/attribute/closure_fwd.hpp>
0020 
0021 #include <boost/spirit/home/classic/phoenix/closures.hpp>
0022 #include <boost/spirit/home/classic/phoenix/primitives.hpp>
0023 #include <boost/spirit/home/classic/phoenix/casts.hpp>
0024 #include <boost/spirit/home/classic/phoenix/operators.hpp>
0025 #include <boost/spirit/home/classic/phoenix/tuple_helpers.hpp>
0026 
0027 #include <boost/static_assert.hpp>
0028 
0029 ///////////////////////////////////////////////////////////////////////////////
0030 //
0031 //  Spirit predefined maximum closure limit. This limit defines the maximum
0032 //  number of elements a closure can hold. This number defaults to 3. The
0033 //  actual maximum is rounded up in multiples of 3. Thus, if this value
0034 //  is 4, the actual limit is 6. The ultimate maximum limit in this
0035 //  implementation is 15.
0036 //
0037 //  It should NOT be greater than PHOENIX_LIMIT!
0038 //
0039 ///////////////////////////////////////////////////////////////////////////////
0040 
0041 #if !defined(BOOST_SPIRIT_CLOSURE_LIMIT)
0042 #define BOOST_SPIRIT_CLOSURE_LIMIT PHOENIX_LIMIT
0043 #endif
0044 
0045 ///////////////////////////////////////////////////////////////////////////////
0046 //
0047 // ensure BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT and SPIRIT_CLOSURE_LIMIT <= 15
0048 //
0049 ///////////////////////////////////////////////////////////////////////////////
0050 BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT);
0051 BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= 15);
0052 
0053 ///////////////////////////////////////////////////////////////////////////////
0054 namespace boost { namespace spirit {
0055 
0056 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0057 
0058     ///////////////////////////////////////////////////////////////////////////
0059     //
0060     //  closure_context class
0061     //
0062     ///////////////////////////////////////////////////////////////////////////
0063     template <typename ClosureT>
0064     class closure_context : public parser_context_base
0065     {
0066     public:
0067 
0068         typedef typename ::phoenix::tuple_element<0,
0069             typename ClosureT::tuple_t>::type attr_t;
0070         typedef ClosureT base_t;
0071         typedef closure_context_linker<closure_context<ClosureT> >
0072         context_linker_t;
0073 
0074         closure_context(ClosureT const& clos)
0075         : frame(clos) {}
0076 
0077         ~closure_context() {}
0078 
0079         template <typename ParserT, typename ScannerT>
0080         void pre_parse(ParserT const&, ScannerT const&) {}
0081 
0082         template <typename ResultT, typename ParserT, typename ScannerT>
0083         ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
0084         { hit.value(frame[::phoenix::tuple_index_names::_1]); return hit; }
0085 
0086     private:
0087 
0088         ::phoenix::closure_frame<typename ClosureT::phoenix_closure_t> frame;
0089     };
0090 
0091     ///////////////////////////////////////////////////////////////////////////
0092     //
0093     //  init_closure_context class
0094     //
0095     //      The init_closure_context class is a special parser context type
0096     //      which additionally initializes a closure contained in the derived
0097     //      parser with values from a given tuple. Please note, that this
0098     //      given tuple does not contain the required values directly, it
0099     //      contains phoenix::actor objects. These actors have to be
0100     //      dereferenced to gain the values to be used for initialization
0101     //      (this is done by the help of the phoenix::convert_actors<>
0102     //      template).
0103     //
0104     ///////////////////////////////////////////////////////////////////////////
0105 
0106     template <typename ClosureT>
0107     class init_closure_context : public parser_context_base
0108     {
0109         typedef typename ClosureT::tuple_t      tuple_t;
0110         typedef typename ClosureT::closure_t    closure_t;
0111 
0112     public:
0113 
0114         init_closure_context(ClosureT const& clos)
0115         : frame(clos.subject(), ::phoenix::convert_actors<tuple_t>(clos.init)) {}
0116 
0117         ~init_closure_context() {}
0118 
0119         template <typename ParserT, typename ScannerT>
0120         void pre_parse(ParserT const& /*p*/, ScannerT const&) {}
0121 
0122         template <typename ResultT, typename ParserT, typename ScannerT>
0123         ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
0124         { hit.value(frame[::phoenix::tuple_index_names::_1]); return hit; }
0125 
0126     private:
0127 
0128         ::phoenix::closure_frame<closure_t> frame;
0129     };
0130 
0131     ///////////////////////////////////////////////////////////////////////////
0132     //
0133     //  init_closure_parser class
0134     //
0135     ///////////////////////////////////////////////////////////////////////////
0136     template <typename ParserT, typename ActorTupleT>
0137     struct init_closure_parser
0138     : public unary<ParserT, parser<init_closure_parser<ParserT, ActorTupleT> > >
0139     {
0140         typedef init_closure_parser<ParserT, ActorTupleT>           self_t;
0141         typedef unary<ParserT, parser<self_t> >                     base_t;
0142         typedef typename ParserT::phoenix_closure_t                 closure_t;
0143         typedef typename ParserT::tuple_t                           tuple_t;
0144         typedef typename ::phoenix::tuple_element<0, tuple_t>::type   attr_t;
0145 
0146         template <typename ScannerT>
0147         struct result
0148         {
0149             typedef typename match_result<ScannerT, attr_t>::type type;
0150         };
0151 
0152         init_closure_parser(ParserT const& p, ActorTupleT const& init_)
0153         : base_t(p), init(init_) {}
0154 
0155         template <typename ScannerT>
0156         typename parser_result<self_t, ScannerT>::type
0157         parse_main(ScannerT const& scan) const
0158         {
0159             return this->subject().parse_main(scan);
0160         }
0161 
0162         template <typename ScannerT>
0163         typename parser_result<self_t, ScannerT>::type
0164         parse(ScannerT const& scan) const
0165         {
0166             typedef init_closure_context<self_t> init_context_t;
0167             typedef parser_scanner_linker<ScannerT> scanner_t;
0168             typedef closure_context_linker<init_context_t> context_t;
0169             typedef typename parser_result<self_t, ScannerT>::type result_t;
0170             BOOST_SPIRIT_CONTEXT_PARSE(
0171                 scan, *this, scanner_t, context_t, result_t);
0172         }
0173 
0174         ActorTupleT init;
0175     };
0176 
0177     ///////////////////////////////////////////////////////////////////////////
0178     //
0179     //  closure class
0180     //
0181     ///////////////////////////////////////////////////////////////////////////
0182     template <
0183             typename DerivedT
0184         ,   typename T0
0185         ,   typename T1
0186         ,   typename T2
0187 
0188     #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
0189         ,   typename T3
0190         ,   typename T4
0191         ,   typename T5
0192 
0193     #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
0194         ,   typename T6
0195         ,   typename T7
0196         ,   typename T8
0197 
0198     #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
0199         ,   typename T9
0200         ,   typename T10
0201         ,   typename T11
0202 
0203     #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
0204         ,   typename T12
0205         ,   typename T13
0206         ,   typename T14
0207     #endif
0208     #endif
0209     #endif
0210     #endif
0211     >
0212     struct closure :
0213         public ::phoenix::closure<
0214             T0, T1, T2
0215     #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
0216         ,   T3, T4, T5
0217     #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
0218         ,   T6, T7, T8
0219     #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
0220         ,   T9, T10, T11
0221     #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
0222         ,   T12, T13, T14
0223     #endif
0224     #endif
0225     #endif
0226     #endif
0227         >
0228     {
0229         typedef ::phoenix::closure<
0230                 T0, T1, T2
0231     #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
0232             ,   T3, T4, T5
0233     #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
0234             ,   T6, T7, T8
0235     #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
0236             ,   T9, T10, T11
0237     #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
0238             ,   T12, T13, T14
0239     #endif
0240     #endif
0241     #endif
0242     #endif
0243             > phoenix_closure_t;
0244 
0245         typedef closure_context<DerivedT> context_t;
0246 
0247         template <typename DerivedT2>
0248         struct aux
0249         {
0250             DerivedT2& aux_derived()
0251             { return *static_cast<DerivedT2*>(this); }
0252 
0253             DerivedT2 const& aux_derived() const
0254             { return *static_cast<DerivedT2 const*>(this); }
0255 
0256         // initialization functions
0257             template <typename A>
0258             init_closure_parser<
0259                 DerivedT2,
0260                 ::phoenix::tuple<
0261                     typename ::phoenix::as_actor<A>::type
0262                 >
0263             >
0264             operator()(A const &a) const
0265             {
0266                 typedef typename ::phoenix::as_actor<A>::type a_t;
0267                 typedef ::phoenix::tuple<a_t> actor_tuple_t;
0268 
0269                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0270                         aux_derived(),
0271                         actor_tuple_t(
0272                             ::phoenix::as_actor<A>::convert(a)
0273                         )
0274                     );
0275             }
0276 
0277             template <typename A, typename B>
0278             init_closure_parser<
0279                 DerivedT2,
0280                 ::phoenix::tuple<
0281                     typename ::phoenix::as_actor<A>::type,
0282                     typename ::phoenix::as_actor<B>::type
0283                 >
0284             >
0285             operator()(A const &a, B const &b) const
0286             {
0287                 typedef typename ::phoenix::as_actor<A>::type a_t;
0288                 typedef typename ::phoenix::as_actor<B>::type b_t;
0289                 typedef ::phoenix::tuple<a_t, b_t> actor_tuple_t;
0290 
0291                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0292                         aux_derived(),
0293                         actor_tuple_t(
0294                             ::phoenix::as_actor<A>::convert(a),
0295                             ::phoenix::as_actor<B>::convert(b)
0296                         )
0297                     );
0298             }
0299 
0300             template <typename A, typename B, typename C>
0301             init_closure_parser<
0302                 DerivedT2,
0303                 ::phoenix::tuple<
0304                     typename ::phoenix::as_actor<A>::type,
0305                     typename ::phoenix::as_actor<B>::type,
0306                     typename ::phoenix::as_actor<C>::type
0307                 >
0308             >
0309             operator()(A const &a, B const &b, C const &c) const
0310             {
0311                 typedef typename ::phoenix::as_actor<A>::type a_t;
0312                 typedef typename ::phoenix::as_actor<B>::type b_t;
0313                 typedef typename ::phoenix::as_actor<C>::type c_t;
0314                 typedef ::phoenix::tuple<a_t, b_t, c_t> actor_tuple_t;
0315 
0316                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0317                         aux_derived(),
0318                         actor_tuple_t(
0319                             ::phoenix::as_actor<A>::convert(a),
0320                             ::phoenix::as_actor<B>::convert(b),
0321                             ::phoenix::as_actor<C>::convert(c)
0322                         )
0323                     );
0324             }
0325 
0326     #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
0327 
0328             template <
0329                 typename A, typename B, typename C, typename D
0330             >
0331             init_closure_parser<
0332                 DerivedT2,
0333                 ::phoenix::tuple<
0334                     typename ::phoenix::as_actor<A>::type,
0335                     typename ::phoenix::as_actor<B>::type,
0336                     typename ::phoenix::as_actor<C>::type,
0337                     typename ::phoenix::as_actor<D>::type
0338                 >
0339             >
0340             operator()(
0341                 A const &a, B const &b, C const &c, D const &d
0342             ) const
0343             {
0344                 typedef typename ::phoenix::as_actor<A>::type a_t;
0345                 typedef typename ::phoenix::as_actor<B>::type b_t;
0346                 typedef typename ::phoenix::as_actor<C>::type c_t;
0347                 typedef typename ::phoenix::as_actor<D>::type d_t;
0348                 typedef ::phoenix::tuple<
0349                             a_t, b_t, c_t, d_t
0350                         > actor_tuple_t;
0351 
0352                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0353                         aux_derived(),
0354                         actor_tuple_t(
0355                             ::phoenix::as_actor<A>::convert(a),
0356                             ::phoenix::as_actor<B>::convert(b),
0357                             ::phoenix::as_actor<C>::convert(c),
0358                             ::phoenix::as_actor<D>::convert(d)
0359                         )
0360                     );
0361             }
0362 
0363             template <
0364                 typename A, typename B, typename C, typename D, typename E
0365             >
0366             init_closure_parser<
0367                 DerivedT2,
0368                 ::phoenix::tuple<
0369                     typename ::phoenix::as_actor<A>::type,
0370                     typename ::phoenix::as_actor<B>::type,
0371                     typename ::phoenix::as_actor<C>::type,
0372                     typename ::phoenix::as_actor<D>::type,
0373                     typename ::phoenix::as_actor<E>::type
0374                 >
0375             >
0376             operator()(
0377                 A const &a, B const &b, C const &c, D const &d, E const &e
0378             ) const
0379             {
0380                 typedef typename ::phoenix::as_actor<A>::type a_t;
0381                 typedef typename ::phoenix::as_actor<B>::type b_t;
0382                 typedef typename ::phoenix::as_actor<C>::type c_t;
0383                 typedef typename ::phoenix::as_actor<D>::type d_t;
0384                 typedef typename ::phoenix::as_actor<E>::type e_t;
0385                 typedef ::phoenix::tuple<
0386                             a_t, b_t, c_t, d_t, e_t
0387                         > actor_tuple_t;
0388 
0389                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0390                         aux_derived(),
0391                         actor_tuple_t(
0392                             ::phoenix::as_actor<A>::convert(a),
0393                             ::phoenix::as_actor<B>::convert(b),
0394                             ::phoenix::as_actor<C>::convert(c),
0395                             ::phoenix::as_actor<D>::convert(d),
0396                             ::phoenix::as_actor<E>::convert(e)
0397                         )
0398                     );
0399             }
0400 
0401             template <
0402                 typename A, typename B, typename C, typename D, typename E,
0403                 typename F
0404             >
0405             init_closure_parser<
0406                 DerivedT2,
0407                 ::phoenix::tuple<
0408                     typename ::phoenix::as_actor<A>::type,
0409                     typename ::phoenix::as_actor<B>::type,
0410                     typename ::phoenix::as_actor<C>::type,
0411                     typename ::phoenix::as_actor<D>::type,
0412                     typename ::phoenix::as_actor<E>::type,
0413                     typename ::phoenix::as_actor<F>::type
0414                 >
0415             >
0416             operator()(
0417                 A const &a, B const &b, C const &c, D const &d, E const &e,
0418                 F const &f
0419             ) const
0420             {
0421                 typedef typename ::phoenix::as_actor<A>::type a_t;
0422                 typedef typename ::phoenix::as_actor<B>::type b_t;
0423                 typedef typename ::phoenix::as_actor<C>::type c_t;
0424                 typedef typename ::phoenix::as_actor<D>::type d_t;
0425                 typedef typename ::phoenix::as_actor<E>::type e_t;
0426                 typedef typename ::phoenix::as_actor<F>::type f_t;
0427                 typedef ::phoenix::tuple<
0428                             a_t, b_t, c_t, d_t, e_t, f_t
0429                         > actor_tuple_t;
0430 
0431                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0432                         aux_derived(),
0433                         actor_tuple_t(
0434                             ::phoenix::as_actor<A>::convert(a),
0435                             ::phoenix::as_actor<B>::convert(b),
0436                             ::phoenix::as_actor<C>::convert(c),
0437                             ::phoenix::as_actor<D>::convert(d),
0438                             ::phoenix::as_actor<E>::convert(e),
0439                             ::phoenix::as_actor<F>::convert(f)
0440                         )
0441                     );
0442             }
0443 
0444     #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
0445 
0446             template <
0447                 typename A, typename B, typename C, typename D, typename E,
0448                 typename F, typename G
0449             >
0450             init_closure_parser<
0451                 DerivedT2,
0452                 ::phoenix::tuple<
0453                     typename ::phoenix::as_actor<A>::type,
0454                     typename ::phoenix::as_actor<B>::type,
0455                     typename ::phoenix::as_actor<C>::type,
0456                     typename ::phoenix::as_actor<D>::type,
0457                     typename ::phoenix::as_actor<E>::type,
0458                     typename ::phoenix::as_actor<F>::type,
0459                     typename ::phoenix::as_actor<G>::type
0460                 >
0461             >
0462             operator()(
0463                 A const &a, B const &b, C const &c, D const &d, E const &e,
0464                 F const &f, G const &g
0465             ) const
0466             {
0467                 typedef typename ::phoenix::as_actor<A>::type a_t;
0468                 typedef typename ::phoenix::as_actor<B>::type b_t;
0469                 typedef typename ::phoenix::as_actor<C>::type c_t;
0470                 typedef typename ::phoenix::as_actor<D>::type d_t;
0471                 typedef typename ::phoenix::as_actor<E>::type e_t;
0472                 typedef typename ::phoenix::as_actor<F>::type f_t;
0473                 typedef typename ::phoenix::as_actor<G>::type g_t;
0474                 typedef ::phoenix::tuple<
0475                             a_t, b_t, c_t, d_t, e_t, f_t, g_t
0476                         > actor_tuple_t;
0477 
0478                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0479                         aux_derived(),
0480                         actor_tuple_t(
0481                             ::phoenix::as_actor<A>::convert(a),
0482                             ::phoenix::as_actor<B>::convert(b),
0483                             ::phoenix::as_actor<C>::convert(c),
0484                             ::phoenix::as_actor<D>::convert(d),
0485                             ::phoenix::as_actor<E>::convert(e),
0486                             ::phoenix::as_actor<F>::convert(f),
0487                             ::phoenix::as_actor<G>::convert(g)
0488                         )
0489                     );
0490             }
0491 
0492             template <
0493                 typename A, typename B, typename C, typename D, typename E,
0494                 typename F, typename G, typename H
0495             >
0496             init_closure_parser<
0497                 DerivedT2,
0498                 ::phoenix::tuple<
0499                     typename ::phoenix::as_actor<A>::type,
0500                     typename ::phoenix::as_actor<B>::type,
0501                     typename ::phoenix::as_actor<C>::type,
0502                     typename ::phoenix::as_actor<D>::type,
0503                     typename ::phoenix::as_actor<E>::type,
0504                     typename ::phoenix::as_actor<F>::type,
0505                     typename ::phoenix::as_actor<G>::type,
0506                     typename ::phoenix::as_actor<H>::type
0507                 >
0508             >
0509             operator()(
0510                 A const &a, B const &b, C const &c, D const &d, E const &e,
0511                 F const &f, G const &g, H const &h
0512             ) const
0513             {
0514                 typedef typename ::phoenix::as_actor<A>::type a_t;
0515                 typedef typename ::phoenix::as_actor<B>::type b_t;
0516                 typedef typename ::phoenix::as_actor<C>::type c_t;
0517                 typedef typename ::phoenix::as_actor<D>::type d_t;
0518                 typedef typename ::phoenix::as_actor<E>::type e_t;
0519                 typedef typename ::phoenix::as_actor<F>::type f_t;
0520                 typedef typename ::phoenix::as_actor<G>::type g_t;
0521                 typedef typename ::phoenix::as_actor<H>::type h_t;
0522                 typedef ::phoenix::tuple<
0523                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t
0524                         > actor_tuple_t;
0525 
0526                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0527                         aux_derived(),
0528                         actor_tuple_t(
0529                             ::phoenix::as_actor<A>::convert(a),
0530                             ::phoenix::as_actor<B>::convert(b),
0531                             ::phoenix::as_actor<C>::convert(c),
0532                             ::phoenix::as_actor<D>::convert(d),
0533                             ::phoenix::as_actor<E>::convert(e),
0534                             ::phoenix::as_actor<F>::convert(f),
0535                             ::phoenix::as_actor<G>::convert(g),
0536                             ::phoenix::as_actor<H>::convert(h)
0537                         )
0538                     );
0539             }
0540 
0541             template <
0542                 typename A, typename B, typename C, typename D, typename E,
0543                 typename F, typename G, typename H, typename I
0544             >
0545             init_closure_parser<
0546                 DerivedT2,
0547                 ::phoenix::tuple<
0548                     typename ::phoenix::as_actor<A>::type,
0549                     typename ::phoenix::as_actor<B>::type,
0550                     typename ::phoenix::as_actor<C>::type,
0551                     typename ::phoenix::as_actor<D>::type,
0552                     typename ::phoenix::as_actor<E>::type,
0553                     typename ::phoenix::as_actor<F>::type,
0554                     typename ::phoenix::as_actor<G>::type,
0555                     typename ::phoenix::as_actor<H>::type,
0556                     typename ::phoenix::as_actor<I>::type
0557                 >
0558             >
0559             operator()(
0560                 A const &a, B const &b, C const &c, D const &d, E const &e,
0561                 F const &f, G const &g, H const &h, I const &i
0562             ) const
0563             {
0564                 typedef typename ::phoenix::as_actor<A>::type a_t;
0565                 typedef typename ::phoenix::as_actor<B>::type b_t;
0566                 typedef typename ::phoenix::as_actor<C>::type c_t;
0567                 typedef typename ::phoenix::as_actor<D>::type d_t;
0568                 typedef typename ::phoenix::as_actor<E>::type e_t;
0569                 typedef typename ::phoenix::as_actor<F>::type f_t;
0570                 typedef typename ::phoenix::as_actor<G>::type g_t;
0571                 typedef typename ::phoenix::as_actor<H>::type h_t;
0572                 typedef typename ::phoenix::as_actor<I>::type i_t;
0573                 typedef ::phoenix::tuple<
0574                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t
0575                         > actor_tuple_t;
0576 
0577                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0578                         aux_derived(),
0579                         actor_tuple_t(
0580                             ::phoenix::as_actor<A>::convert(a),
0581                             ::phoenix::as_actor<B>::convert(b),
0582                             ::phoenix::as_actor<C>::convert(c),
0583                             ::phoenix::as_actor<D>::convert(d),
0584                             ::phoenix::as_actor<E>::convert(e),
0585                             ::phoenix::as_actor<F>::convert(f),
0586                             ::phoenix::as_actor<G>::convert(g),
0587                             ::phoenix::as_actor<H>::convert(h),
0588                             ::phoenix::as_actor<I>::convert(i)
0589                         )
0590                     );
0591             }
0592 
0593     #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
0594 
0595             template <
0596                 typename A, typename B, typename C, typename D, typename E,
0597                 typename F, typename G, typename H, typename I, typename J
0598             >
0599             init_closure_parser<
0600                 DerivedT2,
0601                 ::phoenix::tuple<
0602                     typename ::phoenix::as_actor<A>::type,
0603                     typename ::phoenix::as_actor<B>::type,
0604                     typename ::phoenix::as_actor<C>::type,
0605                     typename ::phoenix::as_actor<D>::type,
0606                     typename ::phoenix::as_actor<E>::type,
0607                     typename ::phoenix::as_actor<F>::type,
0608                     typename ::phoenix::as_actor<G>::type,
0609                     typename ::phoenix::as_actor<H>::type,
0610                     typename ::phoenix::as_actor<I>::type,
0611                     typename ::phoenix::as_actor<J>::type
0612                 >
0613             >
0614             operator()(
0615                 A const &a, B const &b, C const &c, D const &d, E const &e,
0616                 F const &f, G const &g, H const &h, I const &i, J const &j
0617             ) const
0618             {
0619                 typedef typename ::phoenix::as_actor<A>::type a_t;
0620                 typedef typename ::phoenix::as_actor<B>::type b_t;
0621                 typedef typename ::phoenix::as_actor<C>::type c_t;
0622                 typedef typename ::phoenix::as_actor<D>::type d_t;
0623                 typedef typename ::phoenix::as_actor<E>::type e_t;
0624                 typedef typename ::phoenix::as_actor<F>::type f_t;
0625                 typedef typename ::phoenix::as_actor<G>::type g_t;
0626                 typedef typename ::phoenix::as_actor<H>::type h_t;
0627                 typedef typename ::phoenix::as_actor<I>::type i_t;
0628                 typedef typename ::phoenix::as_actor<J>::type j_t;
0629                 typedef ::phoenix::tuple<
0630                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t
0631                         > actor_tuple_t;
0632 
0633                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0634                         aux_derived(),
0635                         actor_tuple_t(
0636                             ::phoenix::as_actor<A>::convert(a),
0637                             ::phoenix::as_actor<B>::convert(b),
0638                             ::phoenix::as_actor<C>::convert(c),
0639                             ::phoenix::as_actor<D>::convert(d),
0640                             ::phoenix::as_actor<E>::convert(e),
0641                             ::phoenix::as_actor<F>::convert(f),
0642                             ::phoenix::as_actor<G>::convert(g),
0643                             ::phoenix::as_actor<H>::convert(h),
0644                             ::phoenix::as_actor<I>::convert(i),
0645                             ::phoenix::as_actor<J>::convert(j)
0646                         )
0647                     );
0648             }
0649 
0650             template <
0651                 typename A, typename B, typename C, typename D, typename E,
0652                 typename F, typename G, typename H, typename I, typename J,
0653                 typename K
0654             >
0655             init_closure_parser<
0656                 DerivedT2,
0657                 ::phoenix::tuple<
0658                     typename ::phoenix::as_actor<A>::type,
0659                     typename ::phoenix::as_actor<B>::type,
0660                     typename ::phoenix::as_actor<C>::type,
0661                     typename ::phoenix::as_actor<D>::type,
0662                     typename ::phoenix::as_actor<E>::type,
0663                     typename ::phoenix::as_actor<F>::type,
0664                     typename ::phoenix::as_actor<G>::type,
0665                     typename ::phoenix::as_actor<H>::type,
0666                     typename ::phoenix::as_actor<I>::type,
0667                     typename ::phoenix::as_actor<J>::type,
0668                     typename ::phoenix::as_actor<K>::type
0669                 >
0670             >
0671             operator()(
0672                 A const &a, B const &b, C const &c, D const &d, E const &e,
0673                 F const &f, G const &g, H const &h, I const &i, J const &j,
0674                 K const &k
0675             ) const
0676             {
0677                 typedef typename ::phoenix::as_actor<A>::type a_t;
0678                 typedef typename ::phoenix::as_actor<B>::type b_t;
0679                 typedef typename ::phoenix::as_actor<C>::type c_t;
0680                 typedef typename ::phoenix::as_actor<D>::type d_t;
0681                 typedef typename ::phoenix::as_actor<E>::type e_t;
0682                 typedef typename ::phoenix::as_actor<F>::type f_t;
0683                 typedef typename ::phoenix::as_actor<G>::type g_t;
0684                 typedef typename ::phoenix::as_actor<H>::type h_t;
0685                 typedef typename ::phoenix::as_actor<I>::type i_t;
0686                 typedef typename ::phoenix::as_actor<J>::type j_t;
0687                 typedef typename ::phoenix::as_actor<K>::type k_t;
0688                 typedef ::phoenix::tuple<
0689                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
0690                             k_t
0691                         > actor_tuple_t;
0692 
0693                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0694                         aux_derived(),
0695                         actor_tuple_t(
0696                             ::phoenix::as_actor<A>::convert(a),
0697                             ::phoenix::as_actor<B>::convert(b),
0698                             ::phoenix::as_actor<C>::convert(c),
0699                             ::phoenix::as_actor<D>::convert(d),
0700                             ::phoenix::as_actor<E>::convert(e),
0701                             ::phoenix::as_actor<F>::convert(f),
0702                             ::phoenix::as_actor<G>::convert(g),
0703                             ::phoenix::as_actor<H>::convert(h),
0704                             ::phoenix::as_actor<I>::convert(i),
0705                             ::phoenix::as_actor<J>::convert(j),
0706                             ::phoenix::as_actor<K>::convert(k)
0707                         )
0708                     );
0709             }
0710 
0711             template <
0712                 typename A, typename B, typename C, typename D, typename E,
0713                 typename F, typename G, typename H, typename I, typename J,
0714                 typename K, typename L
0715             >
0716             init_closure_parser<
0717                 DerivedT2,
0718                 ::phoenix::tuple<
0719                     typename ::phoenix::as_actor<A>::type,
0720                     typename ::phoenix::as_actor<B>::type,
0721                     typename ::phoenix::as_actor<C>::type,
0722                     typename ::phoenix::as_actor<D>::type,
0723                     typename ::phoenix::as_actor<E>::type,
0724                     typename ::phoenix::as_actor<F>::type,
0725                     typename ::phoenix::as_actor<G>::type,
0726                     typename ::phoenix::as_actor<H>::type,
0727                     typename ::phoenix::as_actor<I>::type,
0728                     typename ::phoenix::as_actor<J>::type,
0729                     typename ::phoenix::as_actor<K>::type,
0730                     typename ::phoenix::as_actor<L>::type
0731                 >
0732             >
0733             operator()(
0734                 A const &a, B const &b, C const &c, D const &d, E const &e,
0735                 F const &f, G const &g, H const &h, I const &i, J const &j,
0736                 K const &k, L const &l
0737             ) const
0738             {
0739                 typedef typename ::phoenix::as_actor<A>::type a_t;
0740                 typedef typename ::phoenix::as_actor<B>::type b_t;
0741                 typedef typename ::phoenix::as_actor<C>::type c_t;
0742                 typedef typename ::phoenix::as_actor<D>::type d_t;
0743                 typedef typename ::phoenix::as_actor<E>::type e_t;
0744                 typedef typename ::phoenix::as_actor<F>::type f_t;
0745                 typedef typename ::phoenix::as_actor<G>::type g_t;
0746                 typedef typename ::phoenix::as_actor<H>::type h_t;
0747                 typedef typename ::phoenix::as_actor<I>::type i_t;
0748                 typedef typename ::phoenix::as_actor<J>::type j_t;
0749                 typedef typename ::phoenix::as_actor<K>::type k_t;
0750                 typedef typename ::phoenix::as_actor<L>::type l_t;
0751                 typedef ::phoenix::tuple<
0752                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
0753                             k_t, l_t
0754                         > actor_tuple_t;
0755 
0756                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0757                         aux_derived(),
0758                         actor_tuple_t(
0759                             ::phoenix::as_actor<A>::convert(a),
0760                             ::phoenix::as_actor<B>::convert(b),
0761                             ::phoenix::as_actor<C>::convert(c),
0762                             ::phoenix::as_actor<D>::convert(d),
0763                             ::phoenix::as_actor<E>::convert(e),
0764                             ::phoenix::as_actor<F>::convert(f),
0765                             ::phoenix::as_actor<G>::convert(g),
0766                             ::phoenix::as_actor<H>::convert(h),
0767                             ::phoenix::as_actor<I>::convert(i),
0768                             ::phoenix::as_actor<J>::convert(j),
0769                             ::phoenix::as_actor<K>::convert(k),
0770                             ::phoenix::as_actor<L>::convert(l)
0771                         )
0772                     );
0773             }
0774 
0775     #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
0776 
0777             template <
0778                 typename A, typename B, typename C, typename D, typename E,
0779                 typename F, typename G, typename H, typename I, typename J,
0780                 typename K, typename L, typename M
0781             >
0782             init_closure_parser<
0783                 DerivedT2,
0784                 ::phoenix::tuple<
0785                     typename ::phoenix::as_actor<A>::type,
0786                     typename ::phoenix::as_actor<B>::type,
0787                     typename ::phoenix::as_actor<C>::type,
0788                     typename ::phoenix::as_actor<D>::type,
0789                     typename ::phoenix::as_actor<E>::type,
0790                     typename ::phoenix::as_actor<F>::type,
0791                     typename ::phoenix::as_actor<G>::type,
0792                     typename ::phoenix::as_actor<H>::type,
0793                     typename ::phoenix::as_actor<I>::type,
0794                     typename ::phoenix::as_actor<J>::type,
0795                     typename ::phoenix::as_actor<K>::type,
0796                     typename ::phoenix::as_actor<L>::type,
0797                     typename ::phoenix::as_actor<M>::type
0798                 >
0799             >
0800             operator()(
0801                 A const &a, B const &b, C const &c, D const &d, E const &e,
0802                 F const &f, G const &g, H const &h, I const &i, J const &j,
0803                 K const &k, L const &l, M const &m
0804             ) const
0805             {
0806                 typedef typename ::phoenix::as_actor<A>::type a_t;
0807                 typedef typename ::phoenix::as_actor<B>::type b_t;
0808                 typedef typename ::phoenix::as_actor<C>::type c_t;
0809                 typedef typename ::phoenix::as_actor<D>::type d_t;
0810                 typedef typename ::phoenix::as_actor<E>::type e_t;
0811                 typedef typename ::phoenix::as_actor<F>::type f_t;
0812                 typedef typename ::phoenix::as_actor<G>::type g_t;
0813                 typedef typename ::phoenix::as_actor<H>::type h_t;
0814                 typedef typename ::phoenix::as_actor<I>::type i_t;
0815                 typedef typename ::phoenix::as_actor<J>::type j_t;
0816                 typedef typename ::phoenix::as_actor<K>::type k_t;
0817                 typedef typename ::phoenix::as_actor<L>::type l_t;
0818                 typedef typename ::phoenix::as_actor<M>::type m_t;
0819                 typedef ::phoenix::tuple<
0820                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
0821                             k_t, l_t, m_t
0822                         > actor_tuple_t;
0823 
0824                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0825                         aux_derived(),
0826                         actor_tuple_t(
0827                             ::phoenix::as_actor<A>::convert(a),
0828                             ::phoenix::as_actor<B>::convert(b),
0829                             ::phoenix::as_actor<C>::convert(c),
0830                             ::phoenix::as_actor<D>::convert(d),
0831                             ::phoenix::as_actor<E>::convert(e),
0832                             ::phoenix::as_actor<F>::convert(f),
0833                             ::phoenix::as_actor<G>::convert(g),
0834                             ::phoenix::as_actor<H>::convert(h),
0835                             ::phoenix::as_actor<I>::convert(i),
0836                             ::phoenix::as_actor<J>::convert(j),
0837                             ::phoenix::as_actor<K>::convert(k),
0838                             ::phoenix::as_actor<L>::convert(l),
0839                             ::phoenix::as_actor<M>::convert(m)
0840                         )
0841                     );
0842             }
0843 
0844             template <
0845                 typename A, typename B, typename C, typename D, typename E,
0846                 typename F, typename G, typename H, typename I, typename J,
0847                 typename K, typename L, typename M, typename N
0848             >
0849             init_closure_parser<
0850                 DerivedT2,
0851                 ::phoenix::tuple<
0852                     typename ::phoenix::as_actor<A>::type,
0853                     typename ::phoenix::as_actor<B>::type,
0854                     typename ::phoenix::as_actor<C>::type,
0855                     typename ::phoenix::as_actor<D>::type,
0856                     typename ::phoenix::as_actor<E>::type,
0857                     typename ::phoenix::as_actor<F>::type,
0858                     typename ::phoenix::as_actor<G>::type,
0859                     typename ::phoenix::as_actor<H>::type,
0860                     typename ::phoenix::as_actor<I>::type,
0861                     typename ::phoenix::as_actor<J>::type,
0862                     typename ::phoenix::as_actor<K>::type,
0863                     typename ::phoenix::as_actor<L>::type,
0864                     typename ::phoenix::as_actor<M>::type,
0865                     typename ::phoenix::as_actor<N>::type
0866                 >
0867             >
0868             operator()(
0869                 A const &a, B const &b, C const &c, D const &d, E const &e,
0870                 F const &f, G const &g, H const &h, I const &i, J const &j,
0871                 K const &k, L const &l, M const &m, N const &n
0872             ) const
0873             {
0874                 typedef typename ::phoenix::as_actor<A>::type a_t;
0875                 typedef typename ::phoenix::as_actor<B>::type b_t;
0876                 typedef typename ::phoenix::as_actor<C>::type c_t;
0877                 typedef typename ::phoenix::as_actor<D>::type d_t;
0878                 typedef typename ::phoenix::as_actor<E>::type e_t;
0879                 typedef typename ::phoenix::as_actor<F>::type f_t;
0880                 typedef typename ::phoenix::as_actor<G>::type g_t;
0881                 typedef typename ::phoenix::as_actor<H>::type h_t;
0882                 typedef typename ::phoenix::as_actor<I>::type i_t;
0883                 typedef typename ::phoenix::as_actor<J>::type j_t;
0884                 typedef typename ::phoenix::as_actor<K>::type k_t;
0885                 typedef typename ::phoenix::as_actor<L>::type l_t;
0886                 typedef typename ::phoenix::as_actor<M>::type m_t;
0887                 typedef typename ::phoenix::as_actor<N>::type n_t;
0888                 typedef ::phoenix::tuple<
0889                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
0890                             k_t, l_t, m_t, n_t
0891                         > actor_tuple_t;
0892 
0893                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0894                         aux_derived(),
0895                         actor_tuple_t(
0896                             ::phoenix::as_actor<A>::convert(a),
0897                             ::phoenix::as_actor<B>::convert(b),
0898                             ::phoenix::as_actor<C>::convert(c),
0899                             ::phoenix::as_actor<D>::convert(d),
0900                             ::phoenix::as_actor<E>::convert(e),
0901                             ::phoenix::as_actor<F>::convert(f),
0902                             ::phoenix::as_actor<G>::convert(g),
0903                             ::phoenix::as_actor<H>::convert(h),
0904                             ::phoenix::as_actor<I>::convert(i),
0905                             ::phoenix::as_actor<J>::convert(j),
0906                             ::phoenix::as_actor<K>::convert(k),
0907                             ::phoenix::as_actor<L>::convert(l),
0908                             ::phoenix::as_actor<M>::convert(m),
0909                             ::phoenix::as_actor<N>::convert(n)
0910                         )
0911                     );
0912             }
0913 
0914             template <
0915                 typename A, typename B, typename C, typename D, typename E,
0916                 typename F, typename G, typename H, typename I, typename J,
0917                 typename K, typename L, typename M, typename N, typename O
0918             >
0919             init_closure_parser<
0920                 DerivedT2,
0921                 ::phoenix::tuple<
0922                     typename ::phoenix::as_actor<A>::type,
0923                     typename ::phoenix::as_actor<B>::type,
0924                     typename ::phoenix::as_actor<C>::type,
0925                     typename ::phoenix::as_actor<D>::type,
0926                     typename ::phoenix::as_actor<E>::type,
0927                     typename ::phoenix::as_actor<F>::type,
0928                     typename ::phoenix::as_actor<G>::type,
0929                     typename ::phoenix::as_actor<H>::type,
0930                     typename ::phoenix::as_actor<I>::type,
0931                     typename ::phoenix::as_actor<J>::type,
0932                     typename ::phoenix::as_actor<K>::type,
0933                     typename ::phoenix::as_actor<L>::type,
0934                     typename ::phoenix::as_actor<M>::type,
0935                     typename ::phoenix::as_actor<N>::type,
0936                     typename ::phoenix::as_actor<O>::type
0937                 >
0938             >
0939             operator()(
0940                 A const &a, B const &b, C const &c, D const &d, E const &e,
0941                 F const &f, G const &g, H const &h, I const &i, J const &j,
0942                 K const &k, L const &l, M const &m, N const &n, O const &o
0943             ) const
0944             {
0945                 typedef typename ::phoenix::as_actor<A>::type a_t;
0946                 typedef typename ::phoenix::as_actor<B>::type b_t;
0947                 typedef typename ::phoenix::as_actor<C>::type c_t;
0948                 typedef typename ::phoenix::as_actor<D>::type d_t;
0949                 typedef typename ::phoenix::as_actor<E>::type e_t;
0950                 typedef typename ::phoenix::as_actor<F>::type f_t;
0951                 typedef typename ::phoenix::as_actor<G>::type g_t;
0952                 typedef typename ::phoenix::as_actor<H>::type h_t;
0953                 typedef typename ::phoenix::as_actor<I>::type i_t;
0954                 typedef typename ::phoenix::as_actor<J>::type j_t;
0955                 typedef typename ::phoenix::as_actor<K>::type k_t;
0956                 typedef typename ::phoenix::as_actor<L>::type l_t;
0957                 typedef typename ::phoenix::as_actor<M>::type m_t;
0958                 typedef typename ::phoenix::as_actor<N>::type n_t;
0959                 typedef typename ::phoenix::as_actor<O>::type o_t;
0960                 typedef ::phoenix::tuple<
0961                             a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
0962                             k_t, l_t, m_t, n_t, o_t
0963                         > actor_tuple_t;
0964 
0965                 return init_closure_parser<DerivedT2, actor_tuple_t>(
0966                         aux_derived(),
0967                         actor_tuple_t(
0968                             ::phoenix::as_actor<A>::convert(a),
0969                             ::phoenix::as_actor<B>::convert(b),
0970                             ::phoenix::as_actor<C>::convert(c),
0971                             ::phoenix::as_actor<D>::convert(d),
0972                             ::phoenix::as_actor<E>::convert(e),
0973                             ::phoenix::as_actor<F>::convert(f),
0974                             ::phoenix::as_actor<G>::convert(g),
0975                             ::phoenix::as_actor<H>::convert(h),
0976                             ::phoenix::as_actor<I>::convert(i),
0977                             ::phoenix::as_actor<J>::convert(j),
0978                             ::phoenix::as_actor<K>::convert(k),
0979                             ::phoenix::as_actor<L>::convert(l),
0980                             ::phoenix::as_actor<M>::convert(m),
0981                             ::phoenix::as_actor<N>::convert(n),
0982                             ::phoenix::as_actor<O>::convert(o)
0983                         )
0984                     );
0985             }
0986 
0987     #endif
0988     #endif
0989     #endif
0990     #endif
0991         };
0992 
0993         ~closure() {}
0994     };
0995 
0996     ///////////////////////////////////////////////////////////////////////////
0997     //
0998     //  overloads for chseq_p and str_p taking in phoenix actors
0999     //
1000     ///////////////////////////////////////////////////////////////////////////
1001     template <typename ActorT>
1002     struct container_begin
1003     {
1004         typedef container_begin<ActorT> self_t;
1005 
1006         template <typename TupleT>
1007         struct result
1008         {
1009             typedef typename ::phoenix::actor_result<ActorT, TupleT>
1010                 ::plain_type::iterator type;
1011         };
1012 
1013         container_begin(ActorT actor_)
1014         : actor(actor_) {}
1015 
1016         template <typename TupleT>
1017         typename ::phoenix::actor_result<self_t, TupleT>::type
1018         eval(TupleT const& /*args*/) const
1019         { return actor().begin(); }
1020 
1021         ActorT actor;
1022     };
1023 
1024     template <typename ActorT>
1025     struct container_end
1026     {
1027         typedef container_begin<ActorT> self_t;
1028 
1029         template <typename TupleT>
1030         struct result
1031         {
1032             typedef typename ::phoenix::actor_result<ActorT, TupleT>
1033                 ::plain_type::iterator type;
1034         };
1035 
1036         container_end(ActorT actor_)
1037         : actor(actor_) {}
1038 
1039         template <typename TupleT>
1040         typename ::phoenix::actor_result<self_t, TupleT>::type
1041         eval(TupleT const& /*args*/) const
1042         { return actor().end(); }
1043 
1044         ActorT actor;
1045     };
1046 
1047     template <typename BaseT>
1048     inline f_chseq<
1049         ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >,
1050         ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1051     >
1052     f_chseq_p(::phoenix::actor<BaseT> const& a)
1053     {
1054         typedef ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >
1055             container_begin_t;
1056         typedef ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1057             container_end_t;
1058         typedef f_chseq<container_begin_t, container_end_t> result_t;
1059 
1060         return result_t(container_begin_t(a), container_end_t(a));
1061     }
1062 
1063     template <typename BaseT>
1064     inline f_strlit<
1065         ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >,
1066         ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1067     >
1068     f_str_p(::phoenix::actor<BaseT> const& a)
1069     {
1070         typedef ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >
1071             container_begin_t;
1072         typedef ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1073             container_end_t;
1074         typedef f_strlit<container_begin_t, container_end_t> result_t;
1075 
1076         return result_t(container_begin_t(a), container_end_t(a));
1077     }
1078 
1079 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
1080 
1081 }} // namespace BOOST_SPIRIT_CLASSIC_NS
1082 
1083 #endif