Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #ifndef BOOST_PP_IS_ITERATING
|
Chris@16
|
8
|
Chris@16
|
9 #include <boost/preprocessor/iterate.hpp>
|
Chris@16
|
10 #include <boost/preprocessor/repetition/enum_params.hpp>
|
Chris@16
|
11 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
Chris@16
|
12
|
Chris@16
|
13 #define BOOST_PP_FILENAME_1 \
|
Chris@16
|
14 <boost/spirit/home/qi/nonterminal/detail/fcall.hpp>
|
Chris@16
|
15 #define BOOST_PP_ITERATION_LIMITS (1, SPIRIT_ARGUMENTS_LIMIT)
|
Chris@16
|
16 #include BOOST_PP_ITERATE()
|
Chris@16
|
17
|
Chris@16
|
18 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
19 //
|
Chris@16
|
20 // Preprocessor vertical repetition code
|
Chris@16
|
21 //
|
Chris@16
|
22 ///////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
23 #else // defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
24
|
Chris@16
|
25 #define N BOOST_PP_ITERATION()
|
Chris@16
|
26
|
Chris@16
|
27 template <BOOST_PP_ENUM_PARAMS(N, typename A)>
|
Chris@16
|
28 typename lazy_enable_if_c<
|
Chris@16
|
29 (params_size == N)
|
Chris@16
|
30 , proto::terminal<
|
Chris@16
|
31 spirit::qi::parameterized_nonterminal<
|
Chris@16
|
32 parameterized_subject_type
|
Chris@16
|
33 , fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)> >
|
Chris@16
|
34 >
|
Chris@16
|
35 >::type
|
Chris@16
|
36 operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& f)) const
|
Chris@16
|
37 {
|
Chris@16
|
38 typedef fusion::vector<BOOST_PP_ENUM_PARAMS(N, A)> vector_type;
|
Chris@16
|
39 typedef spirit::qi::parameterized_nonterminal<
|
Chris@16
|
40 parameterized_subject_type, vector_type> parameterized_type;
|
Chris@16
|
41 typedef typename proto::terminal<parameterized_type>::type result_type;
|
Chris@16
|
42
|
Chris@16
|
43 return result_type::make(
|
Chris@16
|
44 parameterized_type(
|
Chris@16
|
45 this->get_parameterized_subject()
|
Chris@16
|
46 , fusion::make_vector(BOOST_PP_ENUM_PARAMS(N, f)))
|
Chris@16
|
47 );
|
Chris@16
|
48 }
|
Chris@16
|
49
|
Chris@16
|
50 #undef N
|
Chris@16
|
51 #endif // defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
52
|
Chris@16
|
53
|