1
/*=============================================================================
3
Copyright (c) 2001-2003 Joel de Guzman
4
Copyright (c) 2002-2003 Hartmut Kaiser
5
http://spirit.sourceforge.net/
7
Permission to copy, use, modify, sell and distribute this software is
8
granted provided this copyright notice appears in all copies. This
9
software is provided "as is" without express or implied warranty, and
10
with no claim as to its suitability for any purpose.
11
=============================================================================*/
12
#ifndef BOOST_SPIRIT_CLOSURE_HPP
13
#define BOOST_SPIRIT_CLOSURE_HPP
15
///////////////////////////////////////////////////////////////////////////////
16
#include "boost/spirit/core/parser.hpp"
17
#include "boost/spirit/core/composite/composite.hpp"
18
#include "boost/spirit/attribute/parametric.hpp"
19
#include "boost/spirit/attribute/closure_context.hpp"
21
#include "boost/spirit/phoenix/closures.hpp"
22
#include "boost/spirit/phoenix/primitives.hpp"
23
#include "boost/spirit/phoenix/casts.hpp"
24
#include "boost/spirit/phoenix/operators.hpp"
25
#include "boost/spirit/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
///////////////////////////////////////////////////////////////////////////
58
// closure_context class
60
///////////////////////////////////////////////////////////////////////////
61
template <typename ClosureT>
66
typedef typename phoenix::tuple_element<0,
67
typename ClosureT::tuple_t>::type attr_t;
68
typedef ClosureT base_t;
69
typedef closure_context_linker<closure_context<ClosureT> >
72
closure_context(ClosureT const& clos)
77
template <typename ParserT, typename ScannerT>
78
void pre_parse(ParserT const&, ScannerT const&) {}
80
template <typename ResultT, typename ParserT, typename ScannerT>
81
ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
82
{ hit.value() = frame[phoenix::tuple_index<0>()]; return hit; }
86
phoenix::closure_frame<typename ClosureT::phoenix_closure_t> frame;
89
///////////////////////////////////////////////////////////////////////////
91
// init_closure_context class
93
// The init_closure_context class is a special parser context type
94
// which additionally initializes a closure contained in the derived
95
// parser with values from a given tuple. Please note, that this
96
// given tuple does not contain the required values directly, it
97
// contains phoenix::actor objects. These actors have to be
98
// dereferenced to gain the values to be used for initialization
99
// (this is done by the help of the phoenix::convert_actors<>
102
///////////////////////////////////////////////////////////////////////////
104
template <typename ClosureT>
105
class init_closure_context
107
typedef typename ClosureT::tuple_t tuple_t;
108
typedef typename ClosureT::closure_t closure_t;
112
init_closure_context(ClosureT const& clos)
113
: frame(clos.subject(), phoenix::convert_actors<tuple_t>(clos.init)) {}
115
~init_closure_context() {}
117
template <typename ParserT, typename ScannerT>
118
void pre_parse(ParserT const& p, ScannerT const&) {}
120
template <typename ResultT, typename ParserT, typename ScannerT>
121
ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&)
122
{ hit.value() = frame[phoenix::tuple_index<0>()]; return hit; }
126
phoenix::closure_frame<closure_t> frame;
129
///////////////////////////////////////////////////////////////////////////
131
// init_closure_parser class
133
///////////////////////////////////////////////////////////////////////////
134
template <typename ParserT, typename ActorTupleT>
135
struct init_closure_parser
136
: public unary<ParserT, parser<init_closure_parser<ParserT, ActorTupleT> > >
138
typedef init_closure_parser<ParserT, ActorTupleT> self_t;
139
typedef unary<ParserT, parser<self_t> > base_t;
140
typedef typename ParserT::phoenix_closure_t closure_t;
141
typedef typename ParserT::tuple_t tuple_t;
142
typedef typename phoenix::tuple_element<0, tuple_t>::type attr_t;
144
template <typename ScannerT>
147
typedef typename match_result<ScannerT, attr_t>::type type;
150
init_closure_parser(ParserT const& p, ActorTupleT const& init_)
151
: base_t(p), init(init_) {}
153
template <typename ScannerT>
154
typename parser_result<self_t, ScannerT>::type
155
parse_main(ScannerT const& scan) const
157
return this->subject().parse_main(scan);
160
template <typename ScannerT>
161
typename parser_result<self_t, ScannerT>::type
162
parse(ScannerT const& scan) const
164
typedef init_closure_context<self_t> init_context_t;
165
typedef parser_scanner_linker<ScannerT> scanner_t;
166
typedef closure_context_linker<init_context_t> context_t;
167
typedef typename parser_result<self_t, ScannerT>::type result_t;
168
BOOST_SPIRIT_CONTEXT_PARSE(
169
scan, *this, scanner_t, context_t, result_t);
175
///////////////////////////////////////////////////////////////////////////
179
///////////////////////////////////////////////////////////////////////////
182
, typename T0 = phoenix::nil_t
183
, typename T1 = phoenix::nil_t
184
, typename T2 = phoenix::nil_t
186
#if BOOST_SPIRIT_CLOSURE_LIMIT > 3
187
, typename T3 = phoenix::nil_t
188
, typename T4 = phoenix::nil_t
189
, typename T5 = phoenix::nil_t
191
#if BOOST_SPIRIT_CLOSURE_LIMIT > 6
192
, typename T6 = phoenix::nil_t
193
, typename T7 = phoenix::nil_t
194
, typename T8 = phoenix::nil_t
196
#if BOOST_SPIRIT_CLOSURE_LIMIT > 9
197
, typename T9 = phoenix::nil_t
198
, typename T10 = phoenix::nil_t
199
, typename T11 = phoenix::nil_t
201
#if BOOST_SPIRIT_CLOSURE_LIMIT > 12
202
, typename T12 = phoenix::nil_t
203
, typename T13 = phoenix::nil_t
204
, typename T14 = phoenix::nil_t
212
public phoenix::closure<
214
#if BOOST_SPIRIT_CLOSURE_LIMIT > 3
216
#if BOOST_SPIRIT_CLOSURE_LIMIT > 6
218
#if BOOST_SPIRIT_CLOSURE_LIMIT > 9
220
#if BOOST_SPIRIT_CLOSURE_LIMIT > 12
228
typedef phoenix::closure<
230
#if BOOST_SPIRIT_CLOSURE_LIMIT > 3
232
#if BOOST_SPIRIT_CLOSURE_LIMIT > 6
234
#if BOOST_SPIRIT_CLOSURE_LIMIT > 9
236
#if BOOST_SPIRIT_CLOSURE_LIMIT > 12
244
typedef closure_context<DerivedT> context_t;
246
template <typename DerivedT2>
249
DerivedT2& aux_derived()
250
{ return *static_cast<DerivedT2*>(this); }
252
DerivedT2 const& aux_derived() const
253
{ return *static_cast<DerivedT2 const*>(this); }
255
// initialization functions
256
template <typename A>
260
typename phoenix::as_actor<A>::type
263
operator()(A const &a) const
265
typedef typename phoenix::as_actor<A>::type a_t;
266
typedef phoenix::tuple<a_t> actor_tuple_t;
268
return init_closure_parser<DerivedT2, actor_tuple_t>(
271
phoenix::as_actor<A>::convert(a)
276
template <typename A, typename B>
280
typename phoenix::as_actor<A>::type,
281
typename phoenix::as_actor<B>::type
284
operator()(A const &a, B const &b) const
286
typedef typename phoenix::as_actor<A>::type a_t;
287
typedef typename phoenix::as_actor<B>::type b_t;
288
typedef phoenix::tuple<a_t, b_t> actor_tuple_t;
290
return init_closure_parser<DerivedT2, actor_tuple_t>(
293
phoenix::as_actor<A>::convert(a),
294
phoenix::as_actor<B>::convert(b)
299
template <typename A, typename B, typename C>
303
typename phoenix::as_actor<A>::type,
304
typename phoenix::as_actor<B>::type,
305
typename phoenix::as_actor<C>::type
308
operator()(A const &a, B const &b, C const &c) const
310
typedef typename phoenix::as_actor<A>::type a_t;
311
typedef typename phoenix::as_actor<B>::type b_t;
312
typedef typename phoenix::as_actor<C>::type c_t;
313
typedef phoenix::tuple<a_t, b_t, c_t> actor_tuple_t;
315
return init_closure_parser<DerivedT2, actor_tuple_t>(
318
phoenix::as_actor<A>::convert(a),
319
phoenix::as_actor<B>::convert(b),
320
phoenix::as_actor<C>::convert(c)
325
#if BOOST_SPIRIT_CLOSURE_LIMIT > 3
328
typename A, typename B, typename C, typename D
333
typename phoenix::as_actor<A>::type,
334
typename phoenix::as_actor<B>::type,
335
typename phoenix::as_actor<C>::type,
336
typename phoenix::as_actor<D>::type
340
A const &a, B const &b, C const &c, D const &d
343
typedef typename phoenix::as_actor<A>::type a_t;
344
typedef typename phoenix::as_actor<B>::type b_t;
345
typedef typename phoenix::as_actor<C>::type c_t;
346
typedef typename phoenix::as_actor<D>::type d_t;
347
typedef phoenix::tuple<
351
return init_closure_parser<DerivedT2, actor_tuple_t>(
354
phoenix::as_actor<A>::convert(a),
355
phoenix::as_actor<B>::convert(b),
356
phoenix::as_actor<C>::convert(c),
357
phoenix::as_actor<D>::convert(d)
363
typename A, typename B, typename C, typename D, typename E
368
typename phoenix::as_actor<A>::type,
369
typename phoenix::as_actor<B>::type,
370
typename phoenix::as_actor<C>::type,
371
typename phoenix::as_actor<D>::type,
372
typename phoenix::as_actor<E>::type
376
A const &a, B const &b, C const &c, D const &d, E const &e
379
typedef typename phoenix::as_actor<A>::type a_t;
380
typedef typename phoenix::as_actor<B>::type b_t;
381
typedef typename phoenix::as_actor<C>::type c_t;
382
typedef typename phoenix::as_actor<D>::type d_t;
383
typedef typename phoenix::as_actor<E>::type e_t;
384
typedef phoenix::tuple<
385
a_t, b_t, c_t, d_t, e_t
388
return init_closure_parser<DerivedT2, actor_tuple_t>(
391
phoenix::as_actor<A>::convert(a),
392
phoenix::as_actor<B>::convert(b),
393
phoenix::as_actor<C>::convert(c),
394
phoenix::as_actor<D>::convert(d),
395
phoenix::as_actor<E>::convert(e)
401
typename A, typename B, typename C, typename D, typename E,
407
typename phoenix::as_actor<A>::type,
408
typename phoenix::as_actor<B>::type,
409
typename phoenix::as_actor<C>::type,
410
typename phoenix::as_actor<D>::type,
411
typename phoenix::as_actor<E>::type,
412
typename phoenix::as_actor<F>::type
416
A const &a, B const &b, C const &c, D const &d, E const &e,
420
typedef typename phoenix::as_actor<A>::type a_t;
421
typedef typename phoenix::as_actor<B>::type b_t;
422
typedef typename phoenix::as_actor<C>::type c_t;
423
typedef typename phoenix::as_actor<D>::type d_t;
424
typedef typename phoenix::as_actor<E>::type e_t;
425
typedef typename phoenix::as_actor<F>::type f_t;
426
typedef phoenix::tuple<
427
a_t, b_t, c_t, d_t, e_t, f_t
430
return init_closure_parser<DerivedT2, actor_tuple_t>(
433
phoenix::as_actor<A>::convert(a),
434
phoenix::as_actor<B>::convert(b),
435
phoenix::as_actor<C>::convert(c),
436
phoenix::as_actor<D>::convert(d),
437
phoenix::as_actor<E>::convert(e),
438
phoenix::as_actor<F>::convert(f)
443
#if BOOST_SPIRIT_CLOSURE_LIMIT > 6
446
typename A, typename B, typename C, typename D, typename E,
447
typename F, typename G
452
typename phoenix::as_actor<A>::type,
453
typename phoenix::as_actor<B>::type,
454
typename phoenix::as_actor<C>::type,
455
typename phoenix::as_actor<D>::type,
456
typename phoenix::as_actor<E>::type,
457
typename phoenix::as_actor<F>::type,
458
typename phoenix::as_actor<G>::type
462
A const &a, B const &b, C const &c, D const &d, E const &e,
463
F const &f, G const &g
466
typedef typename phoenix::as_actor<A>::type a_t;
467
typedef typename phoenix::as_actor<B>::type b_t;
468
typedef typename phoenix::as_actor<C>::type c_t;
469
typedef typename phoenix::as_actor<D>::type d_t;
470
typedef typename phoenix::as_actor<E>::type e_t;
471
typedef typename phoenix::as_actor<F>::type f_t;
472
typedef typename phoenix::as_actor<G>::type g_t;
473
typedef phoenix::tuple<
474
a_t, b_t, c_t, d_t, e_t, f_t, g_t
477
return init_closure_parser<DerivedT2, actor_tuple_t>(
480
phoenix::as_actor<A>::convert(a),
481
phoenix::as_actor<B>::convert(b),
482
phoenix::as_actor<C>::convert(c),
483
phoenix::as_actor<D>::convert(d),
484
phoenix::as_actor<E>::convert(e),
485
phoenix::as_actor<F>::convert(f),
486
phoenix::as_actor<G>::convert(g)
492
typename A, typename B, typename C, typename D, typename E,
493
typename F, typename G, typename H
498
typename phoenix::as_actor<A>::type,
499
typename phoenix::as_actor<B>::type,
500
typename phoenix::as_actor<C>::type,
501
typename phoenix::as_actor<D>::type,
502
typename phoenix::as_actor<E>::type,
503
typename phoenix::as_actor<F>::type,
504
typename phoenix::as_actor<G>::type,
505
typename phoenix::as_actor<H>::type
509
A const &a, B const &b, C const &c, D const &d, E const &e,
510
F const &f, G const &g, H const &h
513
typedef typename phoenix::as_actor<A>::type a_t;
514
typedef typename phoenix::as_actor<B>::type b_t;
515
typedef typename phoenix::as_actor<C>::type c_t;
516
typedef typename phoenix::as_actor<D>::type d_t;
517
typedef typename phoenix::as_actor<E>::type e_t;
518
typedef typename phoenix::as_actor<F>::type f_t;
519
typedef typename phoenix::as_actor<G>::type g_t;
520
typedef typename phoenix::as_actor<H>::type h_t;
521
typedef phoenix::tuple<
522
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t
525
return init_closure_parser<DerivedT2, actor_tuple_t>(
528
phoenix::as_actor<A>::convert(a),
529
phoenix::as_actor<B>::convert(b),
530
phoenix::as_actor<C>::convert(c),
531
phoenix::as_actor<D>::convert(d),
532
phoenix::as_actor<E>::convert(e),
533
phoenix::as_actor<F>::convert(f),
534
phoenix::as_actor<G>::convert(g),
535
phoenix::as_actor<H>::convert(h)
541
typename A, typename B, typename C, typename D, typename E,
542
typename F, typename G, typename H, typename I
547
typename phoenix::as_actor<A>::type,
548
typename phoenix::as_actor<B>::type,
549
typename phoenix::as_actor<C>::type,
550
typename phoenix::as_actor<D>::type,
551
typename phoenix::as_actor<E>::type,
552
typename phoenix::as_actor<F>::type,
553
typename phoenix::as_actor<G>::type,
554
typename phoenix::as_actor<H>::type,
555
typename phoenix::as_actor<I>::type
559
A const &a, B const &b, C const &c, D const &d, E const &e,
560
F const &f, G const &g, H const &h, I const &i
563
typedef typename phoenix::as_actor<A>::type a_t;
564
typedef typename phoenix::as_actor<B>::type b_t;
565
typedef typename phoenix::as_actor<C>::type c_t;
566
typedef typename phoenix::as_actor<D>::type d_t;
567
typedef typename phoenix::as_actor<E>::type e_t;
568
typedef typename phoenix::as_actor<F>::type f_t;
569
typedef typename phoenix::as_actor<G>::type g_t;
570
typedef typename phoenix::as_actor<H>::type h_t;
571
typedef typename phoenix::as_actor<I>::type i_t;
572
typedef phoenix::tuple<
573
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t
576
return init_closure_parser<DerivedT2, actor_tuple_t>(
579
phoenix::as_actor<A>::convert(a),
580
phoenix::as_actor<B>::convert(b),
581
phoenix::as_actor<C>::convert(c),
582
phoenix::as_actor<D>::convert(d),
583
phoenix::as_actor<E>::convert(e),
584
phoenix::as_actor<F>::convert(f),
585
phoenix::as_actor<G>::convert(g),
586
phoenix::as_actor<H>::convert(h),
587
phoenix::as_actor<I>::convert(i)
592
#if BOOST_SPIRIT_CLOSURE_LIMIT > 9
595
typename A, typename B, typename C, typename D, typename E,
596
typename F, typename G, typename H, typename I, typename J
601
typename phoenix::as_actor<A>::type,
602
typename phoenix::as_actor<B>::type,
603
typename phoenix::as_actor<C>::type,
604
typename phoenix::as_actor<D>::type,
605
typename phoenix::as_actor<E>::type,
606
typename phoenix::as_actor<F>::type,
607
typename phoenix::as_actor<G>::type,
608
typename phoenix::as_actor<H>::type,
609
typename phoenix::as_actor<I>::type,
610
typename phoenix::as_actor<J>::type
614
A const &a, B const &b, C const &c, D const &d, E const &e,
615
F const &f, G const &g, H const &h, I const &i, J const &j
618
typedef typename phoenix::as_actor<A>::type a_t;
619
typedef typename phoenix::as_actor<B>::type b_t;
620
typedef typename phoenix::as_actor<C>::type c_t;
621
typedef typename phoenix::as_actor<D>::type d_t;
622
typedef typename phoenix::as_actor<E>::type e_t;
623
typedef typename phoenix::as_actor<F>::type f_t;
624
typedef typename phoenix::as_actor<G>::type g_t;
625
typedef typename phoenix::as_actor<H>::type h_t;
626
typedef typename phoenix::as_actor<I>::type i_t;
627
typedef typename phoenix::as_actor<J>::type j_t;
628
typedef phoenix::tuple<
629
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t
632
return init_closure_parser<DerivedT2, actor_tuple_t>(
635
phoenix::as_actor<A>::convert(a),
636
phoenix::as_actor<B>::convert(b),
637
phoenix::as_actor<C>::convert(c),
638
phoenix::as_actor<D>::convert(d),
639
phoenix::as_actor<E>::convert(e),
640
phoenix::as_actor<F>::convert(f),
641
phoenix::as_actor<G>::convert(g),
642
phoenix::as_actor<H>::convert(h),
643
phoenix::as_actor<I>::convert(i),
644
phoenix::as_actor<J>::convert(j)
650
typename A, typename B, typename C, typename D, typename E,
651
typename F, typename G, typename H, typename I, typename J,
657
typename phoenix::as_actor<A>::type,
658
typename phoenix::as_actor<B>::type,
659
typename phoenix::as_actor<C>::type,
660
typename phoenix::as_actor<D>::type,
661
typename phoenix::as_actor<E>::type,
662
typename phoenix::as_actor<F>::type,
663
typename phoenix::as_actor<G>::type,
664
typename phoenix::as_actor<H>::type,
665
typename phoenix::as_actor<I>::type,
666
typename phoenix::as_actor<J>::type,
667
typename phoenix::as_actor<K>::type
671
A const &a, B const &b, C const &c, D const &d, E const &e,
672
F const &f, G const &g, H const &h, I const &i, J const &j,
676
typedef typename phoenix::as_actor<A>::type a_t;
677
typedef typename phoenix::as_actor<B>::type b_t;
678
typedef typename phoenix::as_actor<C>::type c_t;
679
typedef typename phoenix::as_actor<D>::type d_t;
680
typedef typename phoenix::as_actor<E>::type e_t;
681
typedef typename phoenix::as_actor<F>::type f_t;
682
typedef typename phoenix::as_actor<G>::type g_t;
683
typedef typename phoenix::as_actor<H>::type h_t;
684
typedef typename phoenix::as_actor<I>::type i_t;
685
typedef typename phoenix::as_actor<J>::type j_t;
686
typedef typename phoenix::as_actor<K>::type k_t;
687
typedef phoenix::tuple<
688
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
692
return init_closure_parser<DerivedT2, actor_tuple_t>(
695
phoenix::as_actor<A>::convert(a),
696
phoenix::as_actor<B>::convert(b),
697
phoenix::as_actor<C>::convert(c),
698
phoenix::as_actor<D>::convert(d),
699
phoenix::as_actor<E>::convert(e),
700
phoenix::as_actor<F>::convert(f),
701
phoenix::as_actor<G>::convert(g),
702
phoenix::as_actor<H>::convert(h),
703
phoenix::as_actor<I>::convert(i),
704
phoenix::as_actor<J>::convert(j),
705
phoenix::as_actor<K>::convert(k)
711
typename A, typename B, typename C, typename D, typename E,
712
typename F, typename G, typename H, typename I, typename J,
713
typename K, typename L
718
typename phoenix::as_actor<A>::type,
719
typename phoenix::as_actor<B>::type,
720
typename phoenix::as_actor<C>::type,
721
typename phoenix::as_actor<D>::type,
722
typename phoenix::as_actor<E>::type,
723
typename phoenix::as_actor<F>::type,
724
typename phoenix::as_actor<G>::type,
725
typename phoenix::as_actor<H>::type,
726
typename phoenix::as_actor<I>::type,
727
typename phoenix::as_actor<J>::type,
728
typename phoenix::as_actor<K>::type,
729
typename phoenix::as_actor<L>::type
733
A const &a, B const &b, C const &c, D const &d, E const &e,
734
F const &f, G const &g, H const &h, I const &i, J const &j,
735
K const &k, L const &l
738
typedef typename phoenix::as_actor<A>::type a_t;
739
typedef typename phoenix::as_actor<B>::type b_t;
740
typedef typename phoenix::as_actor<C>::type c_t;
741
typedef typename phoenix::as_actor<D>::type d_t;
742
typedef typename phoenix::as_actor<E>::type e_t;
743
typedef typename phoenix::as_actor<F>::type f_t;
744
typedef typename phoenix::as_actor<G>::type g_t;
745
typedef typename phoenix::as_actor<H>::type h_t;
746
typedef typename phoenix::as_actor<I>::type i_t;
747
typedef typename phoenix::as_actor<J>::type j_t;
748
typedef typename phoenix::as_actor<K>::type k_t;
749
typedef typename phoenix::as_actor<L>::type l_t;
750
typedef phoenix::tuple<
751
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
755
return init_closure_parser<DerivedT2, actor_tuple_t>(
758
phoenix::as_actor<A>::convert(a),
759
phoenix::as_actor<B>::convert(b),
760
phoenix::as_actor<C>::convert(c),
761
phoenix::as_actor<D>::convert(d),
762
phoenix::as_actor<E>::convert(e),
763
phoenix::as_actor<F>::convert(f),
764
phoenix::as_actor<G>::convert(g),
765
phoenix::as_actor<H>::convert(h),
766
phoenix::as_actor<I>::convert(i),
767
phoenix::as_actor<J>::convert(j),
768
phoenix::as_actor<K>::convert(k),
769
phoenix::as_actor<L>::convert(l)
774
#if BOOST_SPIRIT_CLOSURE_LIMIT > 12
777
typename A, typename B, typename C, typename D, typename E,
778
typename F, typename G, typename H, typename I, typename J,
779
typename K, typename L, typename M
784
typename phoenix::as_actor<A>::type,
785
typename phoenix::as_actor<B>::type,
786
typename phoenix::as_actor<C>::type,
787
typename phoenix::as_actor<D>::type,
788
typename phoenix::as_actor<E>::type,
789
typename phoenix::as_actor<F>::type,
790
typename phoenix::as_actor<G>::type,
791
typename phoenix::as_actor<H>::type,
792
typename phoenix::as_actor<I>::type,
793
typename phoenix::as_actor<J>::type,
794
typename phoenix::as_actor<K>::type,
795
typename phoenix::as_actor<L>::type,
796
typename phoenix::as_actor<M>::type
800
A const &a, B const &b, C const &c, D const &d, E const &e,
801
F const &f, G const &g, H const &h, I const &i, J const &j,
802
K const &k, L const &l, M const &m
805
typedef typename phoenix::as_actor<A>::type a_t;
806
typedef typename phoenix::as_actor<B>::type b_t;
807
typedef typename phoenix::as_actor<C>::type c_t;
808
typedef typename phoenix::as_actor<D>::type d_t;
809
typedef typename phoenix::as_actor<E>::type e_t;
810
typedef typename phoenix::as_actor<F>::type f_t;
811
typedef typename phoenix::as_actor<G>::type g_t;
812
typedef typename phoenix::as_actor<H>::type h_t;
813
typedef typename phoenix::as_actor<I>::type i_t;
814
typedef typename phoenix::as_actor<J>::type j_t;
815
typedef typename phoenix::as_actor<K>::type k_t;
816
typedef typename phoenix::as_actor<L>::type l_t;
817
typedef typename phoenix::as_actor<M>::type m_t;
818
typedef phoenix::tuple<
819
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
823
return init_closure_parser<DerivedT2, actor_tuple_t>(
826
phoenix::as_actor<A>::convert(a),
827
phoenix::as_actor<B>::convert(b),
828
phoenix::as_actor<C>::convert(c),
829
phoenix::as_actor<D>::convert(d),
830
phoenix::as_actor<E>::convert(e),
831
phoenix::as_actor<F>::convert(f),
832
phoenix::as_actor<G>::convert(g),
833
phoenix::as_actor<H>::convert(h),
834
phoenix::as_actor<I>::convert(i),
835
phoenix::as_actor<J>::convert(j),
836
phoenix::as_actor<K>::convert(k),
837
phoenix::as_actor<L>::convert(l),
838
phoenix::as_actor<M>::convert(m)
844
typename A, typename B, typename C, typename D, typename E,
845
typename F, typename G, typename H, typename I, typename J,
846
typename K, typename L, typename M, typename N
851
typename phoenix::as_actor<A>::type,
852
typename phoenix::as_actor<B>::type,
853
typename phoenix::as_actor<C>::type,
854
typename phoenix::as_actor<D>::type,
855
typename phoenix::as_actor<E>::type,
856
typename phoenix::as_actor<F>::type,
857
typename phoenix::as_actor<G>::type,
858
typename phoenix::as_actor<H>::type,
859
typename phoenix::as_actor<I>::type,
860
typename phoenix::as_actor<J>::type,
861
typename phoenix::as_actor<K>::type,
862
typename phoenix::as_actor<L>::type,
863
typename phoenix::as_actor<M>::type,
864
typename phoenix::as_actor<N>::type
868
A const &a, B const &b, C const &c, D const &d, E const &e,
869
F const &f, G const &g, H const &h, I const &i, J const &j,
870
K const &k, L const &l, M const &m, N const &n
873
typedef typename phoenix::as_actor<A>::type a_t;
874
typedef typename phoenix::as_actor<B>::type b_t;
875
typedef typename phoenix::as_actor<C>::type c_t;
876
typedef typename phoenix::as_actor<D>::type d_t;
877
typedef typename phoenix::as_actor<E>::type e_t;
878
typedef typename phoenix::as_actor<F>::type f_t;
879
typedef typename phoenix::as_actor<G>::type g_t;
880
typedef typename phoenix::as_actor<H>::type h_t;
881
typedef typename phoenix::as_actor<I>::type i_t;
882
typedef typename phoenix::as_actor<J>::type j_t;
883
typedef typename phoenix::as_actor<K>::type k_t;
884
typedef typename phoenix::as_actor<L>::type l_t;
885
typedef typename phoenix::as_actor<M>::type m_t;
886
typedef typename phoenix::as_actor<N>::type n_t;
887
typedef phoenix::tuple<
888
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
892
return init_closure_parser<DerivedT2, actor_tuple_t>(
895
phoenix::as_actor<A>::convert(a),
896
phoenix::as_actor<B>::convert(b),
897
phoenix::as_actor<C>::convert(c),
898
phoenix::as_actor<D>::convert(d),
899
phoenix::as_actor<E>::convert(e),
900
phoenix::as_actor<F>::convert(f),
901
phoenix::as_actor<G>::convert(g),
902
phoenix::as_actor<H>::convert(h),
903
phoenix::as_actor<I>::convert(i),
904
phoenix::as_actor<J>::convert(j),
905
phoenix::as_actor<K>::convert(k),
906
phoenix::as_actor<L>::convert(l),
907
phoenix::as_actor<M>::convert(m),
908
phoenix::as_actor<N>::convert(n)
914
typename A, typename B, typename C, typename D, typename E,
915
typename F, typename G, typename H, typename I, typename J,
916
typename K, typename L, typename M, typename N, typename O
921
typename phoenix::as_actor<A>::type,
922
typename phoenix::as_actor<B>::type,
923
typename phoenix::as_actor<C>::type,
924
typename phoenix::as_actor<D>::type,
925
typename phoenix::as_actor<E>::type,
926
typename phoenix::as_actor<F>::type,
927
typename phoenix::as_actor<G>::type,
928
typename phoenix::as_actor<H>::type,
929
typename phoenix::as_actor<I>::type,
930
typename phoenix::as_actor<J>::type,
931
typename phoenix::as_actor<K>::type,
932
typename phoenix::as_actor<L>::type,
933
typename phoenix::as_actor<M>::type,
934
typename phoenix::as_actor<N>::type,
935
typename phoenix::as_actor<O>::type
939
A const &a, B const &b, C const &c, D const &d, E const &e,
940
F const &f, G const &g, H const &h, I const &i, J const &j,
941
K const &k, L const &l, M const &m, N const &n, O const &o
944
typedef typename phoenix::as_actor<A>::type a_t;
945
typedef typename phoenix::as_actor<B>::type b_t;
946
typedef typename phoenix::as_actor<C>::type c_t;
947
typedef typename phoenix::as_actor<D>::type d_t;
948
typedef typename phoenix::as_actor<E>::type e_t;
949
typedef typename phoenix::as_actor<F>::type f_t;
950
typedef typename phoenix::as_actor<G>::type g_t;
951
typedef typename phoenix::as_actor<H>::type h_t;
952
typedef typename phoenix::as_actor<I>::type i_t;
953
typedef typename phoenix::as_actor<J>::type j_t;
954
typedef typename phoenix::as_actor<K>::type k_t;
955
typedef typename phoenix::as_actor<L>::type l_t;
956
typedef typename phoenix::as_actor<M>::type m_t;
957
typedef typename phoenix::as_actor<N>::type n_t;
958
typedef typename phoenix::as_actor<O>::type o_t;
959
typedef phoenix::tuple<
960
a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t,
961
k_t, l_t, m_t, n_t, o_t
964
return init_closure_parser<DerivedT2, actor_tuple_t>(
967
phoenix::as_actor<A>::convert(a),
968
phoenix::as_actor<B>::convert(b),
969
phoenix::as_actor<C>::convert(c),
970
phoenix::as_actor<D>::convert(d),
971
phoenix::as_actor<E>::convert(e),
972
phoenix::as_actor<F>::convert(f),
973
phoenix::as_actor<G>::convert(g),
974
phoenix::as_actor<H>::convert(h),
975
phoenix::as_actor<I>::convert(i),
976
phoenix::as_actor<J>::convert(j),
977
phoenix::as_actor<K>::convert(k),
978
phoenix::as_actor<L>::convert(l),
979
phoenix::as_actor<M>::convert(m),
980
phoenix::as_actor<N>::convert(n),
981
phoenix::as_actor<O>::convert(o)
995
///////////////////////////////////////////////////////////////////////////
997
// overloads for chseq_p and str_p taking in phoenix actors
999
///////////////////////////////////////////////////////////////////////////
1000
template <typename ActorT>
1001
struct container_begin
1003
typedef container_begin<ActorT> self_t;
1005
template <typename TupleT>
1008
typedef typename phoenix::actor_result<ActorT, TupleT>
1009
::plain_type::iterator type;
1012
container_begin(ActorT actor_)
1015
template <typename TupleT>
1016
typename phoenix::actor_result<self_t, TupleT>::type
1017
eval(TupleT const& /*args*/) const
1018
{ return actor().begin(); }
1023
template <typename ActorT>
1024
struct container_end
1026
typedef container_begin<ActorT> self_t;
1028
template <typename TupleT>
1031
typedef typename phoenix::actor_result<ActorT, TupleT>
1032
::plain_type::iterator type;
1035
container_end(ActorT actor_)
1038
template <typename TupleT>
1039
typename phoenix::actor_result<self_t, TupleT>::type
1040
eval(TupleT const& /*args*/) const
1041
{ return actor().end(); }
1046
template <typename BaseT>
1048
phoenix::actor<container_begin<phoenix::actor<BaseT> > >,
1049
phoenix::actor<container_end<phoenix::actor<BaseT> > >
1051
f_chseq_p(phoenix::actor<BaseT> const& a)
1053
typedef phoenix::actor<container_begin<phoenix::actor<BaseT> > >
1055
typedef phoenix::actor<container_end<phoenix::actor<BaseT> > >
1057
typedef f_chseq<container_begin_t, container_end_t> result_t;
1059
return result_t(container_begin_t(a), container_end_t(a));
1062
template <typename BaseT>
1064
phoenix::actor<container_begin<phoenix::actor<BaseT> > >,
1065
phoenix::actor<container_end<phoenix::actor<BaseT> > >
1067
f_str_p(phoenix::actor<BaseT> const& a)
1069
typedef phoenix::actor<container_begin<phoenix::actor<BaseT> > >
1071
typedef phoenix::actor<container_end<phoenix::actor<BaseT> > >
1073
typedef f_strlit<container_begin_t, container_end_t> result_t;
1075
return result_t(container_begin_t(a), container_end_t(a));
1078
}} // namespace boost::spirit