1 /*=============================================================================
2 Copyright (c) 2001-2003 Joel de Guzman
3 Copyright (c) 2002-2003 Hartmut Kaiser
4 http://spirit.sourceforge.net/
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 #ifndef BOOST_SPIRIT_CLOSURE_HPP
10 #define BOOST_SPIRIT_CLOSURE_HPP
12 ///////////////////////////////////////////////////////////////////////////////
13 #include <boost/spirit/home/classic/namespace.hpp>
14 #include <boost/spirit/home/classic/core/parser.hpp>
15 #include <boost/spirit/home/classic/core/composite/composite.hpp>
16 #include <boost/spirit/home/classic/core/non_terminal/parser_context.hpp>
17 #include <boost/spirit/home/classic/attribute/parametric.hpp>
18 #include <boost/spirit/home/classic/attribute/closure_context.hpp>
19 #include <boost/spirit/home/classic/attribute/closure_fwd.hpp>
21 #include <boost/spirit/home/classic/phoenix/closures.hpp>
22 #include <boost/spirit/home/classic/phoenix/primitives.hpp>
23 #include <boost/spirit/home/classic/phoenix/casts.hpp>
24 #include <boost/spirit/home/classic/phoenix/operators.hpp>
25 #include <boost/spirit/home/classic/phoenix/tuple_helpers.hpp>
27 #include <boost/static_assert.hpp>
29 ///////////////////////////////////////////////////////////////////////////////
31 // Spirit predefined maximum closure limit. This limit defines the maximum
32 // number of elements a closure can hold. This number defaults to 3. The
33 // actual maximum is rounded up in multiples of 3. Thus, if this value
34 // is 4, the actual limit is 6. The ultimate maximum limit in this
35 // implementation is 15.
37 // It should NOT be greater than PHOENIX_LIMIT!
39 ///////////////////////////////////////////////////////////////////////////////
41 #if !defined(BOOST_SPIRIT_CLOSURE_LIMIT)
42 #define BOOST_SPIRIT_CLOSURE_LIMIT PHOENIX_LIMIT
45 ///////////////////////////////////////////////////////////////////////////////
47 // ensure BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT and SPIRIT_CLOSURE_LIMIT <= 15
49 ///////////////////////////////////////////////////////////////////////////////
50 BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT);
51 BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= 15);
53 ///////////////////////////////////////////////////////////////////////////////
54 namespace boost { namespace spirit {
56 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
58 ///////////////////////////////////////////////////////////////////////////
60 // closure_context class
62 ///////////////////////////////////////////////////////////////////////////
63 template <typename ClosureT>
64 class closure_context : public parser_context_base
68 typedef typename ::phoenix::tuple_element<0,
69 typename ClosureT::tuple_t>::type attr_t;
70 typedef ClosureT base_t;
71 typedef closure_context_linker<closure_context<ClosureT> >
74 closure_context(ClosureT const& clos)
79 template <typename ParserT, typename ScannerT>
80 void pre_parse(ParserT const&, ScannerT const&) {}
82 template <typename ResultT, typename ParserT, typename ScannerT>
83 ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
84 { hit.value(frame[::phoenix::tuple_index<0>()]); return hit; }
88 ::phoenix::closure_frame<typename ClosureT::phoenix_closure_t> frame;
91 ///////////////////////////////////////////////////////////////////////////
93 // init_closure_context class
95 // The init_closure_context class is a special parser context type
96 // which additionally initializes a closure contained in the derived
97 // parser with values from a given tuple. Please note, that this
98 // given tuple does not contain the required values directly, it
99 // contains phoenix::actor objects. These actors have to be
100 // dereferenced to gain the values to be used for initialization
101 // (this is done by the help of the phoenix::convert_actors<>
104 ///////////////////////////////////////////////////////////////////////////
106 template <typename ClosureT>
107 class init_closure_context : public parser_context_base
109 typedef typename ClosureT::tuple_t tuple_t;
110 typedef typename ClosureT::closure_t closure_t;
114 init_closure_context(ClosureT const& clos)
115 : frame(clos.subject(), ::phoenix::convert_actors<tuple_t>(clos.init)) {}
117 ~init_closure_context() {}
119 template <typename ParserT, typename ScannerT>
120 void pre_parse(ParserT const& /*p*/, ScannerT const&) {}
122 template <typename ResultT, typename ParserT, typename ScannerT>
123 ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
124 { hit.value(frame[::phoenix::tuple_index<0>()]); return hit; }
128 ::phoenix::closure_frame<closure_t> frame;
131 ///////////////////////////////////////////////////////////////////////////
133 // init_closure_parser class
135 ///////////////////////////////////////////////////////////////////////////
136 template <typename ParserT, typename ActorTupleT>
137 struct init_closure_parser
138 : public unary<ParserT, parser<init_closure_parser<ParserT, ActorTupleT> > >
140 typedef init_closure_parser<ParserT, ActorTupleT> self_t;
141 typedef unary<ParserT, parser<self_t> > base_t;
142 typedef typename ParserT::phoenix_closure_t closure_t;
143 typedef typename ParserT::tuple_t tuple_t;
144 typedef typename ::phoenix::tuple_element<0, tuple_t>::type attr_t;
146 template <typename ScannerT>
149 typedef typename match_result<ScannerT, attr_t>::type type;
152 init_closure_parser(ParserT const& p, ActorTupleT const& init_)
153 : base_t(p), init(init_) {}
155 template <typename ScannerT>
156 typename parser_result<self_t, ScannerT>::type
157 parse_main(ScannerT const& scan) const
159 return this->subject().parse_main(scan);
162 template <typename ScannerT>
163 typename parser_result<self_t, ScannerT>::type
164 parse(ScannerT const& scan) const
166 typedef init_closure_context<self_t> init_context_t;
167 typedef parser_scanner_linker<ScannerT> scanner_t;
168 typedef closure_context_linker<init_context_t> context_t;
169 typedef typename parser_result<self_t, ScannerT>::type result_t;
170 BOOST_SPIRIT_CONTEXT_PARSE(
171 scan, *this, scanner_t, context_t, result_t);
177 ///////////////////////////////////////////////////////////////////////////
181 ///////////////////////////////////////////////////////////////////////////
188 #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
193 #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
198 #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
203 #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
213 public ::phoenix::closure<
215 #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
217 #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
219 #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
221 #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
229 typedef ::phoenix::closure<
231 #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
233 #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
235 #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
237 #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
245 typedef closure_context<DerivedT> context_t;
247 template <typename DerivedT2>
250 DerivedT2& aux_derived()
251 { return *static_cast<DerivedT2*>(this); }
253 DerivedT2 const& aux_derived() const
254 { return *static_cast<DerivedT2 const*>(this); }
256 // initialization functions
257 template <typename A>
261 typename ::phoenix::as_actor<A>::type
264 operator()(A const &a) const
266 typedef typename ::phoenix::as_actor<A>::type a_t;
267 typedef ::phoenix::tuple<a_t> actor_tuple_t;
269 return init_closure_parser<DerivedT2, actor_tuple_t>(
272 ::phoenix::as_actor<A>::convert(a)
277 template <typename A, typename B>
281 typename ::phoenix::as_actor<A>::type,
282 typename ::phoenix::as_actor<B>::type
285 operator()(A const &a, B const &b) const
287 typedef typename ::phoenix::as_actor<A>::type a_t;
288 typedef typename ::phoenix::as_actor<B>::type b_t;
289 typedef ::phoenix::tuple<a_t, b_t> actor_tuple_t;
291 return init_closure_parser<DerivedT2, actor_tuple_t>(
294 ::phoenix::as_actor<A>::convert(a),
295 ::phoenix::as_actor<B>::convert(b)
300 template <typename A, typename B, typename C>
304 typename ::phoenix::as_actor<A>::type,
305 typename ::phoenix::as_actor<B>::type,
306 typename ::phoenix::as_actor<C>::type
309 operator()(A const &a, B const &b, C const &c) const
311 typedef typename ::phoenix::as_actor<A>::type a_t;
312 typedef typename ::phoenix::as_actor<B>::type b_t;
313 typedef typename ::phoenix::as_actor<C>::type c_t;
314 typedef ::phoenix::tuple<a_t, b_t, c_t> actor_tuple_t;
316 return init_closure_parser<DerivedT2, actor_tuple_t>(
319 ::phoenix::as_actor<A>::convert(a),
320 ::phoenix::as_actor<B>::convert(b),
321 ::phoenix::as_actor<C>::convert(c)
326 #if BOOST_SPIRIT_CLOSURE_LIMIT > 3
329 typename A, typename B, typename C, typename D
334 typename ::phoenix::as_actor<A>::type,
335 typename ::phoenix::as_actor<B>::type,
336 typename ::phoenix::as_actor<C>::type,
337 typename ::phoenix::as_actor<D>::type
341 A const &a, B const &b, C const &c, D const &d
344 typedef typename ::phoenix::as_actor<A>::type a_t;
345 typedef typename ::phoenix::as_actor<B>::type b_t;
346 typedef typename ::phoenix::as_actor<C>::type c_t;
347 typedef typename ::phoenix::as_actor<D>::type d_t;
348 typedef ::phoenix::tuple<
352 return init_closure_parser<DerivedT2, actor_tuple_t>(
355 ::phoenix::as_actor<A>::convert(a),
356 ::phoenix::as_actor<B>::convert(b),
357 ::phoenix::as_actor<C>::convert(c),
358 ::phoenix::as_actor<D>::convert(d)
364 typename A, typename B, typename C, typename D, typename E
369 typename ::phoenix::as_actor<A>::type,
370 typename ::phoenix::as_actor<B>::type,
371 typename ::phoenix::as_actor<C>::type,
372 typename ::phoenix::as_actor<D>::type,
373 typename ::phoenix::as_actor<E>::type
377 A const &a, B const &b, C const &c, D const &d, E const &e
380 typedef typename ::phoenix::as_actor<A>::type a_t;
381 typedef typename ::phoenix::as_actor<B>::type b_t;
382 typedef typename ::phoenix::as_actor<C>::type c_t;
383 typedef typename ::phoenix::as_actor<D>::type d_t;
384 typedef typename ::phoenix::as_actor<E>::type e_t;
385 typedef ::phoenix::tuple<
386 a_t, b_t, c_t, d_t, e_t
389 return init_closure_parser<DerivedT2, actor_tuple_t>(
392 ::phoenix::as_actor<A>::convert(a),
393 ::phoenix::as_actor<B>::convert(b),
394 ::phoenix::as_actor<C>::convert(c),
395 ::phoenix::as_actor<D>::convert(d),
396 ::phoenix::as_actor<E>::convert(e)
402 typename A, typename B, typename C, typename D, typename E,
408 typename ::phoenix::as_actor<A>::type,
409 typename ::phoenix::as_actor<B>::type,
410 typename ::phoenix::as_actor<C>::type,
411 typename ::phoenix::as_actor<D>::type,
412 typename ::phoenix::as_actor<E>::type,
413 typename ::phoenix::as_actor<F>::type
417 A const &a, B const &b, C const &c, D const &d, E const &e,
421 typedef typename ::phoenix::as_actor<A>::type a_t;
422 typedef typename ::phoenix::as_actor<B>::type b_t;
423 typedef typename ::phoenix::as_actor<C>::type c_t;
424 typedef typename ::phoenix::as_actor<D>::type d_t;
425 typedef typename ::phoenix::as_actor<E>::type e_t;
426 typedef typename ::phoenix::as_actor<F>::type f_t;
427 typedef ::phoenix::tuple<
428 a_t, b_t, c_t, d_t, e_t, f_t
431 return init_closure_parser<DerivedT2, actor_tuple_t>(
434 ::phoenix::as_actor<A>::convert(a),
435 ::phoenix::as_actor<B>::convert(b),
436 ::phoenix::as_actor<C>::convert(c),
437 ::phoenix::as_actor<D>::convert(d),
438 ::phoenix::as_actor<E>::convert(e),
439 ::phoenix::as_actor<F>::convert(f)
444 #if BOOST_SPIRIT_CLOSURE_LIMIT > 6
447 typename A, typename B, typename C, typename D, typename E,
448 typename F, typename G
453 typename ::phoenix::as_actor<A>::type,
454 typename ::phoenix::as_actor<B>::type,
455 typename ::phoenix::as_actor<C>::type,
456 typename ::phoenix::as_actor<D>::type,
457 typename ::phoenix::as_actor<E>::type,
458 typename ::phoenix::as_actor<F>::type,
459 typename ::phoenix::as_actor<G>::type
463 A const &a, B const &b, C const &c, D const &d, E const &e,
464 F const &f, G const &g
467 typedef typename ::phoenix::as_actor<A>::type a_t;
468 typedef typename ::phoenix::as_actor<B>::type b_t;
469 typedef typename ::phoenix::as_actor<C>::type c_t;
470 typedef typename ::phoenix::as_actor<D>::type d_t;
471 typedef typename ::phoenix::as_actor<E>::type e_t;
472 typedef typename ::phoenix::as_actor<F>::type f_t;
473 typedef typename ::phoenix::as_actor<G>::type g_t;
474 typedef ::phoenix::tuple<
475 a_t, b_t, c_t, d_t, e_t, f_t, g_t
478 return init_closure_parser<DerivedT2, actor_tuple_t>(
481 ::phoenix::as_actor<A>::convert(a),
482 ::phoenix::as_actor<B>::convert(b),
483 ::phoenix::as_actor<C>::convert(c),
484 ::phoenix::as_actor<D>::convert(d),
485 ::phoenix::as_actor<E>::convert(e),
486 ::phoenix::as_actor<F>::convert(f),
487 ::phoenix::as_actor<G>::convert(g)
493 typename A, typename B, typename C, typename D, typename E,
494 typename F, typename G, typename H
499 typename ::phoenix::as_actor<A>::type,
500 typename ::phoenix::as_actor<B>::type,
501 typename ::phoenix::as_actor<C>::type,
502 typename ::phoenix::as_actor<D>::type,
503 typename ::phoenix::as_actor<E>::type,
504 typename ::phoenix::as_actor<F>::type,
505 typename ::phoenix::as_actor<G>::type,
506 typename ::phoenix::as_actor<H>::type
510 A const &a, B const &b, C const &c, D const &d, E const &e,
511 F const &f, G const &g, H const &h
514 typedef typename ::phoenix::as_actor<A>::type a_t;
515 typedef typename ::phoenix::as_actor<B>::type b_t;
516 typedef typename ::phoenix::as_actor<C>::type c_t;
517 typedef typename ::phoenix::as_actor<D>::type d_t;
518 typedef typename ::phoenix::as_actor<E>::type e_t;
519 typedef typename ::phoenix::as_actor<F>::type f_t;
520 typedef typename ::phoenix::as_actor<G>::type g_t;
521 typedef typename ::phoenix::as_actor<H>::type h_t;
522 typedef ::phoenix::tuple<
523 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t
526 return init_closure_parser<DerivedT2, actor_tuple_t>(
529 ::phoenix::as_actor<A>::convert(a),
530 ::phoenix::as_actor<B>::convert(b),
531 ::phoenix::as_actor<C>::convert(c),
532 ::phoenix::as_actor<D>::convert(d),
533 ::phoenix::as_actor<E>::convert(e),
534 ::phoenix::as_actor<F>::convert(f),
535 ::phoenix::as_actor<G>::convert(g),
536 ::phoenix::as_actor<H>::convert(h)
542 typename A, typename B, typename C, typename D, typename E,
543 typename F, typename G, typename H, typename I
548 typename ::phoenix::as_actor<A>::type,
549 typename ::phoenix::as_actor<B>::type,
550 typename ::phoenix::as_actor<C>::type,
551 typename ::phoenix::as_actor<D>::type,
552 typename ::phoenix::as_actor<E>::type,
553 typename ::phoenix::as_actor<F>::type,
554 typename ::phoenix::as_actor<G>::type,
555 typename ::phoenix::as_actor<H>::type,
556 typename ::phoenix::as_actor<I>::type
560 A const &a, B const &b, C const &c, D const &d, E const &e,
561 F const &f, G const &g, H const &h, I const &i
564 typedef typename ::phoenix::as_actor<A>::type a_t;
565 typedef typename ::phoenix::as_actor<B>::type b_t;
566 typedef typename ::phoenix::as_actor<C>::type c_t;
567 typedef typename ::phoenix::as_actor<D>::type d_t;
568 typedef typename ::phoenix::as_actor<E>::type e_t;
569 typedef typename ::phoenix::as_actor<F>::type f_t;
570 typedef typename ::phoenix::as_actor<G>::type g_t;
571 typedef typename ::phoenix::as_actor<H>::type h_t;
572 typedef typename ::phoenix::as_actor<I>::type i_t;
573 typedef ::phoenix::tuple<
574 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t
577 return init_closure_parser<DerivedT2, actor_tuple_t>(
580 ::phoenix::as_actor<A>::convert(a),
581 ::phoenix::as_actor<B>::convert(b),
582 ::phoenix::as_actor<C>::convert(c),
583 ::phoenix::as_actor<D>::convert(d),
584 ::phoenix::as_actor<E>::convert(e),
585 ::phoenix::as_actor<F>::convert(f),
586 ::phoenix::as_actor<G>::convert(g),
587 ::phoenix::as_actor<H>::convert(h),
588 ::phoenix::as_actor<I>::convert(i)
593 #if BOOST_SPIRIT_CLOSURE_LIMIT > 9
596 typename A, typename B, typename C, typename D, typename E,
597 typename F, typename G, typename H, typename I, typename J
602 typename ::phoenix::as_actor<A>::type,
603 typename ::phoenix::as_actor<B>::type,
604 typename ::phoenix::as_actor<C>::type,
605 typename ::phoenix::as_actor<D>::type,
606 typename ::phoenix::as_actor<E>::type,
607 typename ::phoenix::as_actor<F>::type,
608 typename ::phoenix::as_actor<G>::type,
609 typename ::phoenix::as_actor<H>::type,
610 typename ::phoenix::as_actor<I>::type,
611 typename ::phoenix::as_actor<J>::type
615 A const &a, B const &b, C const &c, D const &d, E const &e,
616 F const &f, G const &g, H const &h, I const &i, J const &j
619 typedef typename ::phoenix::as_actor<A>::type a_t;
620 typedef typename ::phoenix::as_actor<B>::type b_t;
621 typedef typename ::phoenix::as_actor<C>::type c_t;
622 typedef typename ::phoenix::as_actor<D>::type d_t;
623 typedef typename ::phoenix::as_actor<E>::type e_t;
624 typedef typename ::phoenix::as_actor<F>::type f_t;
625 typedef typename ::phoenix::as_actor<G>::type g_t;
626 typedef typename ::phoenix::as_actor<H>::type h_t;
627 typedef typename ::phoenix::as_actor<I>::type i_t;
628 typedef typename ::phoenix::as_actor<J>::type j_t;
629 typedef ::phoenix::tuple<
630 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t
633 return init_closure_parser<DerivedT2, actor_tuple_t>(
636 ::phoenix::as_actor<A>::convert(a),
637 ::phoenix::as_actor<B>::convert(b),
638 ::phoenix::as_actor<C>::convert(c),
639 ::phoenix::as_actor<D>::convert(d),
640 ::phoenix::as_actor<E>::convert(e),
641 ::phoenix::as_actor<F>::convert(f),
642 ::phoenix::as_actor<G>::convert(g),
643 ::phoenix::as_actor<H>::convert(h),
644 ::phoenix::as_actor<I>::convert(i),
645 ::phoenix::as_actor<J>::convert(j)
651 typename A, typename B, typename C, typename D, typename E,
652 typename F, typename G, typename H, typename I, typename J,
658 typename ::phoenix::as_actor<A>::type,
659 typename ::phoenix::as_actor<B>::type,
660 typename ::phoenix::as_actor<C>::type,
661 typename ::phoenix::as_actor<D>::type,
662 typename ::phoenix::as_actor<E>::type,
663 typename ::phoenix::as_actor<F>::type,
664 typename ::phoenix::as_actor<G>::type,
665 typename ::phoenix::as_actor<H>::type,
666 typename ::phoenix::as_actor<I>::type,
667 typename ::phoenix::as_actor<J>::type,
668 typename ::phoenix::as_actor<K>::type
672 A const &a, B const &b, C const &c, D const &d, E const &e,
673 F const &f, G const &g, H const &h, I const &i, J const &j,
677 typedef typename ::phoenix::as_actor<A>::type a_t;
678 typedef typename ::phoenix::as_actor<B>::type b_t;
679 typedef typename ::phoenix::as_actor<C>::type c_t;
680 typedef typename ::phoenix::as_actor<D>::type d_t;
681 typedef typename ::phoenix::as_actor<E>::type e_t;
682 typedef typename ::phoenix::as_actor<F>::type f_t;
683 typedef typename ::phoenix::as_actor<G>::type g_t;
684 typedef typename ::phoenix::as_actor<H>::type h_t;
685 typedef typename ::phoenix::as_actor<I>::type i_t;
686 typedef typename ::phoenix::as_actor<J>::type j_t;
687 typedef typename ::phoenix::as_actor<K>::type k_t;
688 typedef ::phoenix::tuple<
689 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
693 return init_closure_parser<DerivedT2, actor_tuple_t>(
696 ::phoenix::as_actor<A>::convert(a),
697 ::phoenix::as_actor<B>::convert(b),
698 ::phoenix::as_actor<C>::convert(c),
699 ::phoenix::as_actor<D>::convert(d),
700 ::phoenix::as_actor<E>::convert(e),
701 ::phoenix::as_actor<F>::convert(f),
702 ::phoenix::as_actor<G>::convert(g),
703 ::phoenix::as_actor<H>::convert(h),
704 ::phoenix::as_actor<I>::convert(i),
705 ::phoenix::as_actor<J>::convert(j),
706 ::phoenix::as_actor<K>::convert(k)
712 typename A, typename B, typename C, typename D, typename E,
713 typename F, typename G, typename H, typename I, typename J,
714 typename K, typename L
719 typename ::phoenix::as_actor<A>::type,
720 typename ::phoenix::as_actor<B>::type,
721 typename ::phoenix::as_actor<C>::type,
722 typename ::phoenix::as_actor<D>::type,
723 typename ::phoenix::as_actor<E>::type,
724 typename ::phoenix::as_actor<F>::type,
725 typename ::phoenix::as_actor<G>::type,
726 typename ::phoenix::as_actor<H>::type,
727 typename ::phoenix::as_actor<I>::type,
728 typename ::phoenix::as_actor<J>::type,
729 typename ::phoenix::as_actor<K>::type,
730 typename ::phoenix::as_actor<L>::type
734 A const &a, B const &b, C const &c, D const &d, E const &e,
735 F const &f, G const &g, H const &h, I const &i, J const &j,
736 K const &k, L const &l
739 typedef typename ::phoenix::as_actor<A>::type a_t;
740 typedef typename ::phoenix::as_actor<B>::type b_t;
741 typedef typename ::phoenix::as_actor<C>::type c_t;
742 typedef typename ::phoenix::as_actor<D>::type d_t;
743 typedef typename ::phoenix::as_actor<E>::type e_t;
744 typedef typename ::phoenix::as_actor<F>::type f_t;
745 typedef typename ::phoenix::as_actor<G>::type g_t;
746 typedef typename ::phoenix::as_actor<H>::type h_t;
747 typedef typename ::phoenix::as_actor<I>::type i_t;
748 typedef typename ::phoenix::as_actor<J>::type j_t;
749 typedef typename ::phoenix::as_actor<K>::type k_t;
750 typedef typename ::phoenix::as_actor<L>::type l_t;
751 typedef ::phoenix::tuple<
752 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
756 return init_closure_parser<DerivedT2, actor_tuple_t>(
759 ::phoenix::as_actor<A>::convert(a),
760 ::phoenix::as_actor<B>::convert(b),
761 ::phoenix::as_actor<C>::convert(c),
762 ::phoenix::as_actor<D>::convert(d),
763 ::phoenix::as_actor<E>::convert(e),
764 ::phoenix::as_actor<F>::convert(f),
765 ::phoenix::as_actor<G>::convert(g),
766 ::phoenix::as_actor<H>::convert(h),
767 ::phoenix::as_actor<I>::convert(i),
768 ::phoenix::as_actor<J>::convert(j),
769 ::phoenix::as_actor<K>::convert(k),
770 ::phoenix::as_actor<L>::convert(l)
775 #if BOOST_SPIRIT_CLOSURE_LIMIT > 12
778 typename A, typename B, typename C, typename D, typename E,
779 typename F, typename G, typename H, typename I, typename J,
780 typename K, typename L, typename M
785 typename ::phoenix::as_actor<A>::type,
786 typename ::phoenix::as_actor<B>::type,
787 typename ::phoenix::as_actor<C>::type,
788 typename ::phoenix::as_actor<D>::type,
789 typename ::phoenix::as_actor<E>::type,
790 typename ::phoenix::as_actor<F>::type,
791 typename ::phoenix::as_actor<G>::type,
792 typename ::phoenix::as_actor<H>::type,
793 typename ::phoenix::as_actor<I>::type,
794 typename ::phoenix::as_actor<J>::type,
795 typename ::phoenix::as_actor<K>::type,
796 typename ::phoenix::as_actor<L>::type,
797 typename ::phoenix::as_actor<M>::type
801 A const &a, B const &b, C const &c, D const &d, E const &e,
802 F const &f, G const &g, H const &h, I const &i, J const &j,
803 K const &k, L const &l, M const &m
806 typedef typename ::phoenix::as_actor<A>::type a_t;
807 typedef typename ::phoenix::as_actor<B>::type b_t;
808 typedef typename ::phoenix::as_actor<C>::type c_t;
809 typedef typename ::phoenix::as_actor<D>::type d_t;
810 typedef typename ::phoenix::as_actor<E>::type e_t;
811 typedef typename ::phoenix::as_actor<F>::type f_t;
812 typedef typename ::phoenix::as_actor<G>::type g_t;
813 typedef typename ::phoenix::as_actor<H>::type h_t;
814 typedef typename ::phoenix::as_actor<I>::type i_t;
815 typedef typename ::phoenix::as_actor<J>::type j_t;
816 typedef typename ::phoenix::as_actor<K>::type k_t;
817 typedef typename ::phoenix::as_actor<L>::type l_t;
818 typedef typename ::phoenix::as_actor<M>::type m_t;
819 typedef ::phoenix::tuple<
820 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
824 return init_closure_parser<DerivedT2, actor_tuple_t>(
827 ::phoenix::as_actor<A>::convert(a),
828 ::phoenix::as_actor<B>::convert(b),
829 ::phoenix::as_actor<C>::convert(c),
830 ::phoenix::as_actor<D>::convert(d),
831 ::phoenix::as_actor<E>::convert(e),
832 ::phoenix::as_actor<F>::convert(f),
833 ::phoenix::as_actor<G>::convert(g),
834 ::phoenix::as_actor<H>::convert(h),
835 ::phoenix::as_actor<I>::convert(i),
836 ::phoenix::as_actor<J>::convert(j),
837 ::phoenix::as_actor<K>::convert(k),
838 ::phoenix::as_actor<L>::convert(l),
839 ::phoenix::as_actor<M>::convert(m)
845 typename A, typename B, typename C, typename D, typename E,
846 typename F, typename G, typename H, typename I, typename J,
847 typename K, typename L, typename M, typename N
852 typename ::phoenix::as_actor<A>::type,
853 typename ::phoenix::as_actor<B>::type,
854 typename ::phoenix::as_actor<C>::type,
855 typename ::phoenix::as_actor<D>::type,
856 typename ::phoenix::as_actor<E>::type,
857 typename ::phoenix::as_actor<F>::type,
858 typename ::phoenix::as_actor<G>::type,
859 typename ::phoenix::as_actor<H>::type,
860 typename ::phoenix::as_actor<I>::type,
861 typename ::phoenix::as_actor<J>::type,
862 typename ::phoenix::as_actor<K>::type,
863 typename ::phoenix::as_actor<L>::type,
864 typename ::phoenix::as_actor<M>::type,
865 typename ::phoenix::as_actor<N>::type
869 A const &a, B const &b, C const &c, D const &d, E const &e,
870 F const &f, G const &g, H const &h, I const &i, J const &j,
871 K const &k, L const &l, M const &m, N const &n
874 typedef typename ::phoenix::as_actor<A>::type a_t;
875 typedef typename ::phoenix::as_actor<B>::type b_t;
876 typedef typename ::phoenix::as_actor<C>::type c_t;
877 typedef typename ::phoenix::as_actor<D>::type d_t;
878 typedef typename ::phoenix::as_actor<E>::type e_t;
879 typedef typename ::phoenix::as_actor<F>::type f_t;
880 typedef typename ::phoenix::as_actor<G>::type g_t;
881 typedef typename ::phoenix::as_actor<H>::type h_t;
882 typedef typename ::phoenix::as_actor<I>::type i_t;
883 typedef typename ::phoenix::as_actor<J>::type j_t;
884 typedef typename ::phoenix::as_actor<K>::type k_t;
885 typedef typename ::phoenix::as_actor<L>::type l_t;
886 typedef typename ::phoenix::as_actor<M>::type m_t;
887 typedef typename ::phoenix::as_actor<N>::type n_t;
888 typedef ::phoenix::tuple<
889 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
893 return init_closure_parser<DerivedT2, actor_tuple_t>(
896 ::phoenix::as_actor<A>::convert(a),
897 ::phoenix::as_actor<B>::convert(b),
898 ::phoenix::as_actor<C>::convert(c),
899 ::phoenix::as_actor<D>::convert(d),
900 ::phoenix::as_actor<E>::convert(e),
901 ::phoenix::as_actor<F>::convert(f),
902 ::phoenix::as_actor<G>::convert(g),
903 ::phoenix::as_actor<H>::convert(h),
904 ::phoenix::as_actor<I>::convert(i),
905 ::phoenix::as_actor<J>::convert(j),
906 ::phoenix::as_actor<K>::convert(k),
907 ::phoenix::as_actor<L>::convert(l),
908 ::phoenix::as_actor<M>::convert(m),
909 ::phoenix::as_actor<N>::convert(n)
915 typename A, typename B, typename C, typename D, typename E,
916 typename F, typename G, typename H, typename I, typename J,
917 typename K, typename L, typename M, typename N, typename O
922 typename ::phoenix::as_actor<A>::type,
923 typename ::phoenix::as_actor<B>::type,
924 typename ::phoenix::as_actor<C>::type,
925 typename ::phoenix::as_actor<D>::type,
926 typename ::phoenix::as_actor<E>::type,
927 typename ::phoenix::as_actor<F>::type,
928 typename ::phoenix::as_actor<G>::type,
929 typename ::phoenix::as_actor<H>::type,
930 typename ::phoenix::as_actor<I>::type,
931 typename ::phoenix::as_actor<J>::type,
932 typename ::phoenix::as_actor<K>::type,
933 typename ::phoenix::as_actor<L>::type,
934 typename ::phoenix::as_actor<M>::type,
935 typename ::phoenix::as_actor<N>::type,
936 typename ::phoenix::as_actor<O>::type
940 A const &a, B const &b, C const &c, D const &d, E const &e,
941 F const &f, G const &g, H const &h, I const &i, J const &j,
942 K const &k, L const &l, M const &m, N const &n, O const &o
945 typedef typename ::phoenix::as_actor<A>::type a_t;
946 typedef typename ::phoenix::as_actor<B>::type b_t;
947 typedef typename ::phoenix::as_actor<C>::type c_t;
948 typedef typename ::phoenix::as_actor<D>::type d_t;
949 typedef typename ::phoenix::as_actor<E>::type e_t;
950 typedef typename ::phoenix::as_actor<F>::type f_t;
951 typedef typename ::phoenix::as_actor<G>::type g_t;
952 typedef typename ::phoenix::as_actor<H>::type h_t;
953 typedef typename ::phoenix::as_actor<I>::type i_t;
954 typedef typename ::phoenix::as_actor<J>::type j_t;
955 typedef typename ::phoenix::as_actor<K>::type k_t;
956 typedef typename ::phoenix::as_actor<L>::type l_t;
957 typedef typename ::phoenix::as_actor<M>::type m_t;
958 typedef typename ::phoenix::as_actor<N>::type n_t;
959 typedef typename ::phoenix::as_actor<O>::type o_t;
960 typedef ::phoenix::tuple<
961 a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
962 k_t, l_t, m_t, n_t, o_t
965 return init_closure_parser<DerivedT2, actor_tuple_t>(
968 ::phoenix::as_actor<A>::convert(a),
969 ::phoenix::as_actor<B>::convert(b),
970 ::phoenix::as_actor<C>::convert(c),
971 ::phoenix::as_actor<D>::convert(d),
972 ::phoenix::as_actor<E>::convert(e),
973 ::phoenix::as_actor<F>::convert(f),
974 ::phoenix::as_actor<G>::convert(g),
975 ::phoenix::as_actor<H>::convert(h),
976 ::phoenix::as_actor<I>::convert(i),
977 ::phoenix::as_actor<J>::convert(j),
978 ::phoenix::as_actor<K>::convert(k),
979 ::phoenix::as_actor<L>::convert(l),
980 ::phoenix::as_actor<M>::convert(m),
981 ::phoenix::as_actor<N>::convert(n),
982 ::phoenix::as_actor<O>::convert(o)
996 ///////////////////////////////////////////////////////////////////////////
998 // overloads for chseq_p and str_p taking in phoenix actors
1000 ///////////////////////////////////////////////////////////////////////////
1001 template <typename ActorT>
1002 struct container_begin
1004 typedef container_begin<ActorT> self_t;
1006 template <typename TupleT>
1009 typedef typename ::phoenix::actor_result<ActorT, TupleT>
1010 ::plain_type::iterator type;
1013 container_begin(ActorT actor_)
1016 template <typename TupleT>
1017 typename ::phoenix::actor_result<self_t, TupleT>::type
1018 eval(TupleT const& /*args*/) const
1019 { return actor().begin(); }
1024 template <typename ActorT>
1025 struct container_end
1027 typedef container_begin<ActorT> self_t;
1029 template <typename TupleT>
1032 typedef typename ::phoenix::actor_result<ActorT, TupleT>
1033 ::plain_type::iterator type;
1036 container_end(ActorT actor_)
1039 template <typename TupleT>
1040 typename ::phoenix::actor_result<self_t, TupleT>::type
1041 eval(TupleT const& /*args*/) const
1042 { return actor().end(); }
1047 template <typename BaseT>
1049 ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >,
1050 ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1052 f_chseq_p(::phoenix::actor<BaseT> const& a)
1054 typedef ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >
1056 typedef ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1058 typedef f_chseq<container_begin_t, container_end_t> result_t;
1060 return result_t(container_begin_t(a), container_end_t(a));
1063 template <typename BaseT>
1065 ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >,
1066 ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1068 f_str_p(::phoenix::actor<BaseT> const& a)
1070 typedef ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >
1072 typedef ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > >
1074 typedef f_strlit<container_begin_t, container_end_t> result_t;
1076 return result_t(container_begin_t(a), container_end_t(a));
1079 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
1081 }} // namespace BOOST_SPIRIT_CLASSIC_NS