Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:45:07

0001 /*=============================================================================
0002     Copyright (c) 2010 Thomas Heller
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 
0008 #ifndef BOOST_PHOENIX_CORE_DETAIL_EXPRESSION_HPP
0009 #define BOOST_PHOENIX_CORE_DETAIL_EXPRESSION_HPP
0010 
0011 #include <boost/preprocessor/empty.hpp>
0012 #include <boost/preprocessor/arithmetic/add.hpp>
0013 #include <boost/preprocessor/arithmetic/dec.hpp>
0014 #include <boost/preprocessor/comma_if.hpp>
0015 #include <boost/preprocessor/comparison/equal.hpp>
0016 #include <boost/preprocessor/seq/size.hpp>
0017 #include <boost/preprocessor/seq/enum.hpp>
0018 #include <boost/preprocessor/seq/for_each.hpp>
0019 #include <boost/preprocessor/seq/pop_back.hpp>
0020 #include <boost/preprocessor/seq/reverse.hpp>
0021 #include <boost/preprocessor/tuple/elem.hpp>
0022 #include <boost/preprocessor/enum_params.hpp>
0023 #include <boost/preprocessor/repeat_from_to.hpp>
0024 
0025 #define BOOST_PHOENIX_DEFINE_EXPRESSION(NAME_SEQ, SEQ)                          \
0026     BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(                                       \
0027         NAME_SEQ                                                                \
0028       , SEQ                                                                     \
0029       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_DEFAULT                      \
0030       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_DEFAULT                            \
0031       , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_DEFAULT                  \
0032       , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_DEFAULT                 \
0033       , _                                                                       \
0034     )                                                                           \
0035 /**/
0036 
0037 #define BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT)    \
0038     BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(                                       \
0039         NAME_SEQ                                                                \
0040       , GRAMMAR_SEQ                                                             \
0041       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_VARARG                       \
0042       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG                             \
0043       , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG                   \
0044       , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG                  \
0045       , LIMIT                                                                   \
0046     )                                                                           \
0047 /**/
0048 
0049 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXT(ACTOR, NAME_SEQ, GRAMMAR_SEQ)       \
0050     BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(                                       \
0051         NAME_SEQ                                                                \
0052       , GRAMMAR_SEQ                                                             \
0053       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_EXT                          \
0054       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_DEFAULT                            \
0055       , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_DEFAULT                  \
0056       , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_DEFAULT                 \
0057       , ACTOR                                                                   \
0058     )                                                                           \
0059 /**/
0060 
0061 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG(ACTOR, NAME, GRAMMAR, LIMIT) \
0062     BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(                                       \
0063         NAME_SEQ                                                                \
0064       , GRAMMAR_SEQ                                                             \
0065       , BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_VARARG_EXT                   \
0066       , BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG                             \
0067       , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG                   \
0068       , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG                  \
0069       , ACTOR                                                                   \
0070     )                                                                           \
0071 /**/
0072 
0073 #define BOOST_PHOENIX_DEFINE_EXPRESSION_NAMESPACE(R, D, E)                      \
0074 namespace E {                                                                   \
0075 /**/
0076 
0077 #define BOOST_PHOENIX_DEFINE_EXPRESSION_NAMESPACE_END(R, D, E)                  \
0078 }                                                                               \
0079 /**/
0080 
0081 #define BOOST_PHOENIX_DEFINE_EXPRESSION_NS(R, D, E)                             \
0082 E ::                                                                            \
0083 /**/
0084 
0085 #define BOOST_PHOENIX_DEFINE_EXPRESSION_BASE(NAME_SEQ, GRAMMAR_SEQ, EXPRESSION, RULE, RESULT_OF_MAKE, MAKE_EXPRESSION, DATA) \
0086 BOOST_PP_SEQ_FOR_EACH(                                                          \
0087     BOOST_PHOENIX_DEFINE_EXPRESSION_NAMESPACE                                   \
0088   , _                                                                           \
0089   , BOOST_PP_SEQ_POP_BACK(NAME_SEQ)                                             \
0090 )                                                                               \
0091     namespace tag                                                               \
0092     {                                                                           \
0093         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) {};            \
0094         template <typename Ostream>                                             \
0095         inline Ostream &operator<<(                                             \
0096             Ostream & os                                                        \
0097           , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)))                  \
0098         {                                                                       \
0099             os << BOOST_PP_STRINGIZE(                                           \
0100                 BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))               \
0101             );                                                                  \
0102             return os;                                                          \
0103         }                                                                       \
0104     }                                                                           \
0105     namespace expression                                                        \
0106     {                                                                           \
0107         EXPRESSION(NAME_SEQ, GRAMMAR_SEQ, DATA)                                 \
0108     }                                                                           \
0109     namespace rule                                                              \
0110     {                                                                           \
0111         RULE(NAME_SEQ, GRAMMAR_SEQ, DATA)                                       \
0112     }                                                                           \
0113     namespace functional                                                        \
0114     {                                                                           \
0115         typedef                                                                 \
0116             boost::proto::functional::make_expr<                                \
0117                     tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))     \
0118             >                                                                   \
0119             BOOST_PP_CAT(                                                       \
0120                 make_                                                           \
0121               , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))               \
0122             );                                                                  \
0123     }                                                                           \
0124     namespace result_of                                                         \
0125     {                                                                           \
0126         RESULT_OF_MAKE(NAME_SEQ, GRAMMAR_SEQ, DATA)                             \
0127     }                                                                           \
0128     MAKE_EXPRESSION(NAME_SEQ, GRAMMAR_SEQ, DATA)                                \
0129                                                                                 \
0130 BOOST_PP_SEQ_FOR_EACH(                                                          \
0131     BOOST_PHOENIX_DEFINE_EXPRESSION_NAMESPACE_END                               \
0132   , _                                                                           \
0133   , BOOST_PP_SEQ_POP_BACK(NAME_SEQ)                                             \
0134 )                                                                               \
0135 namespace boost { namespace phoenix                                             \
0136 {                                                                               \
0137     template <typename Dummy>                                                   \
0138     struct meta_grammar::case_<                                                 \
0139         :: BOOST_PP_SEQ_FOR_EACH(                                               \
0140             BOOST_PHOENIX_DEFINE_EXPRESSION_NS                                  \
0141           , _                                                                   \
0142           , BOOST_PP_SEQ_POP_BACK(NAME_SEQ)                                     \
0143         ) tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))               \
0144       , Dummy                                                                   \
0145     >                                                                           \
0146         : enable_rule<                                                          \
0147             :: BOOST_PP_SEQ_FOR_EACH(                                           \
0148                 BOOST_PHOENIX_DEFINE_EXPRESSION_NS                              \
0149               , _                                                               \
0150               , BOOST_PP_SEQ_POP_BACK(NAME_SEQ)                                 \
0151             ) rule:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))          \
0152          , Dummy                                                                \
0153         >                                                                       \
0154     {};                                                                         \
0155 } }                                                                             \
0156 /**/
0157 
0158 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
0159         template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))>     \
0160         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                \
0161             : boost::phoenix::expr<                                             \
0162                 :: BOOST_PP_SEQ_FOR_EACH(                                       \
0163                     BOOST_PHOENIX_DEFINE_EXPRESSION_NS                          \
0164                   , _                                                           \
0165                   , BOOST_PP_SEQ_POP_BACK(NAME_SEQ)                             \
0166                 ) tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))       \
0167               , BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ), A)>        \
0168         {};                                                                     \
0169 /**/
0170         
0171 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D)  \
0172     struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                    \
0173         : expression:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))        \
0174             <BOOST_PP_SEQ_ENUM(GRAMMAR_SEQ)>                                    \
0175     {};                                                                         \
0176 /**/
0177 
0178 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
0179     template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))>         \
0180     struct BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))) \
0181         : boost::result_of<                                                     \
0182             functional::                                                        \
0183                 BOOST_PP_CAT(                                                   \
0184                     make_                                                       \
0185                   , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))           \
0186                 )(BOOST_PHOENIX_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)))              \
0187         >                                                                       \
0188     {};                                                                         \
0189 /**/
0190 
0191 #define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_DEFAULT(NAME_SEQ, GRAMMAR_SEQ, D) \
0192     template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))>         \
0193     inline                                                                      \
0194     typename                                                                    \
0195         result_of::BOOST_PP_CAT(                                                \
0196             make_                                                               \
0197           , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                   \
0198         )<                                                                      \
0199             BOOST_PHOENIX_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))                     \
0200         >::type const                                                           \
0201     BOOST_PP_CAT(                                                               \
0202         make_                                                                   \
0203       , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                       \
0204     )(                                                                          \
0205         BOOST_PHOENIX_A_const_ref_a(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))             \
0206     )                                                                           \
0207     {                                                                           \
0208         return                                                                  \
0209             functional::BOOST_PP_CAT(                                           \
0210                 make_                                                           \
0211               , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))               \
0212             )()(                                                                \
0213               BOOST_PHOENIX_a(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))                   \
0214             );                                                                  \
0215     }                                                                           \
0216 /**/
0217 
0218 #ifndef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0219 
0220 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_VARARG(NAME_SEQ, _G, _L)     \
0221     template <typename A0, typename... A>                                       \
0222     struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                    \
0223         : boost::phoenix::expr<                                                 \
0224             tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))             \
0225           , A0, A...                                                            \
0226         >                                                                       \
0227     {};                                                                         \
0228 /**/
0229 
0230 #else // BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0231 
0232 #define BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG_R(_, N, NAME)                    \
0233     template <                                                                  \
0234         BOOST_PHOENIX_typename_A(                                               \
0235             BOOST_PP_ADD(                                                       \
0236                 N                                                               \
0237               , BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(2, 1, NAME))              \
0238             )                                                                   \
0239         )                                                                       \
0240     >                                                                           \
0241     struct BOOST_PP_TUPLE_ELEM(2, 0, NAME)<                                     \
0242         BOOST_PHOENIX_A(                                                        \
0243             BOOST_PP_ADD(N, BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(2, 1, NAME))) \
0244         )                                                                       \
0245     >                                                                           \
0246         : boost::phoenix::expr<                                                 \
0247             tag:: BOOST_PP_TUPLE_ELEM(2, 0, NAME)                               \
0248           , BOOST_PHOENIX_A(                                                    \
0249                 BOOST_PP_ADD(                                                   \
0250                     N                                                           \
0251                   , BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(2, 1, NAME))          \
0252                 )                                                               \
0253             )                                                                   \
0254         >                                                                       \
0255     {};                                                                         \
0256 /**/
0257 
0258 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
0259         template <                                                              \
0260             BOOST_PHOENIX_typename_A_void(                                      \
0261                 BOOST_PP_ADD(                                                   \
0262                     LIMIT, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)))        \
0263             )                                                                   \
0264           , typename Dummy = void                                               \
0265         >                                                                       \
0266         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ));               \
0267                                                                                 \
0268         BOOST_PP_REPEAT_FROM_TO(                                                \
0269             1                                                                   \
0270           , BOOST_PP_ADD(LIMIT, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ)))   \
0271           , BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG_R                            \
0272           , (                                                                   \
0273                 BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))               \
0274               , BOOST_PP_SEQ_POP_BACK(GRAMMAR_SEQ)                              \
0275             )                                                                   \
0276         )                                                                       \
0277 /**/
0278 #endif // BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0279 
0280 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
0281         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                \
0282             : expression:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)) <  \
0283                 BOOST_PP_IF(                                                    \
0284                     BOOST_PP_EQUAL(1, BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))           \
0285                   , BOOST_PP_EMPTY                                              \
0286                   , BOOST_PP_IDENTITY(                                          \
0287                       BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_POP_BACK(GRAMMAR_SEQ))     \
0288                     )                                                           \
0289                 )()                                                             \
0290                 BOOST_PP_COMMA_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))) \
0291                 boost::proto::vararg<                                           \
0292                     BOOST_PP_SEQ_ELEM(                                          \
0293                         BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))            \
0294                       , GRAMMAR_SEQ                                             \
0295                     )                                                           \
0296                 >                                                               \
0297             >                                                                   \
0298         {};                                                                     \
0299 /**/
0300 
0301 #ifndef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0302 
0303 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG(NAME_SEQ, _G, _L) \
0304     template <typename A0, typename... A>                                       \
0305     struct BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))) \
0306         : boost::result_of<                                                     \
0307             functional:: BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)))( \
0308                 A0, A...                                                        \
0309             )                                                                   \
0310         >                                                                       \
0311     {};                                                                         \
0312 /**/
0313 
0314 #else // BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0315 
0316 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG_R(Z, N, NAME)     \
0317     template <BOOST_PHOENIX_typename_A(N)>                                      \
0318     struct BOOST_PP_CAT(make_, NAME) <BOOST_PHOENIX_A(N)>                       \
0319         : boost::result_of<                                                     \
0320             functional:: BOOST_PP_CAT(make_, NAME)(                             \
0321                 BOOST_PHOENIX_A(N)                                              \
0322             )                                                                   \
0323         >                                                                       \
0324     {};                                                                         \
0325 /**/
0326 
0327 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
0328     template <BOOST_PHOENIX_typename_A_void(LIMIT), typename Dummy = void>      \
0329     struct BOOST_PP_CAT(                                                        \
0330         make_                                                                   \
0331       , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                       \
0332     );                                                                          \
0333     BOOST_PP_REPEAT_FROM_TO(                                                    \
0334         1                                                                       \
0335       , LIMIT                                                                   \
0336       , BOOST_PHOENIX_DEFINE_EXPRESSION_RESULT_OF_MAKE_VARARG_R                 \
0337       , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                       \
0338     )                                                                           \
0339 /**/
0340 #endif // BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0341 
0342 #ifndef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0343 
0344 #define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
0345     template <typename A0, typename... A>                                       \
0346     inline                                                                      \
0347     typename                                                                    \
0348         result_of:: BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)))< \
0349             A0, A...                                                            \
0350         >::type                                                                 \
0351     BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)))(A0 const& a0, A const&... a) \
0352     {                                                                           \
0353         return functional::BOOST_PP_CAT(make_, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ)))()(a0, a...); \
0354     }                                                                           \
0355 /**/
0356 
0357 #else // BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0358 
0359 #define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG_R(Z, N, NAME)    \
0360     template <BOOST_PHOENIX_typename_A(N)>                                      \
0361     inline                                                                      \
0362     typename                                                                    \
0363         result_of:: BOOST_PP_CAT(make_, NAME)<                                  \
0364             BOOST_PHOENIX_A(N)                                                  \
0365         >::type                                                                 \
0366     BOOST_PP_CAT(make_, NAME)(BOOST_PHOENIX_A_const_ref_a(N))                   \
0367     {                                                                           \
0368         return functional::BOOST_PP_CAT(make_, NAME)()(BOOST_PHOENIX_a(N));     \
0369     }                                                                           \
0370 /**/
0371 
0372 #define BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG(NAME_SEQ, GRAMMAR_SEQ, LIMIT) \
0373     BOOST_PP_REPEAT_FROM_TO(                                                    \
0374         1                                                                       \
0375       , LIMIT                                                                   \
0376       , BOOST_PHOENIX_DEFINE_EXPRESSION_MAKE_EXPRESSION_VARARG_R                \
0377       , BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                       \
0378     )                                                                           \
0379 /**/
0380 #endif // BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
0381 
0382 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXPRESSION_EXT(NAME_SEQ, GRAMMAR_SEQ, ACTOR) \
0383         template <BOOST_PHOENIX_typename_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))>     \
0384         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))                \
0385             : ::boost::phoenix::expr_ext<                                       \
0386                 ACTOR                                                           \
0387               , tag:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(NAME_SEQ))         \
0388               , BOOST_PHOENIX_A(BOOST_PP_SEQ_SIZE(GRAMMAR_SEQ))>                \
0389         {};                                                                     \
0390 /**/
0391 
0392 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG_R(_, N, NAME)                \
0393     template <                                                                  \
0394         BOOST_PHOENIX_typename_A(                                               \
0395             BOOST_PP_ADD(                                                       \
0396                 N                                                               \
0397               , BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 1, NAME))              \
0398             )                                                                   \
0399         )                                                                       \
0400     >                                                                           \
0401     struct BOOST_PP_TUPLE_ELEM(3, 0, NAME)<                                     \
0402         BOOST_PHOENIX_A(                                                        \
0403             BOOST_PP_ADD(N, BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 1, NAME))) \
0404         )                                                                       \
0405     >                                                                           \
0406         : expr_ext<                                                             \
0407             BOOST_PP_TUPLE_ELEM(3, 2, NAME)                                     \
0408           , tag:: BOOST_PP_TUPLE_ELEM(3, 0, NAME)                               \
0409           , BOOST_PHOENIX_A(                                                    \
0410                 BOOST_PP_ADD(                                                   \
0411                     N                                                           \
0412                   , BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 1, NAME))          \
0413                 )                                                               \
0414             )                                                                   \
0415         >                                                                       \
0416     {};                                                                         \
0417 /**/
0418 
0419 #define BOOST_PHOENIX_DEFINE_EXPRESSION_EXRPESSION_VARARG_EXT(N, G, D)          \
0420         template <                                                              \
0421             BOOST_PHOENIX_typename_A_void(                                      \
0422                 BOOST_PP_ADD(LIMIT, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(G)))         \
0423             )                                                                   \
0424           , typename Dummy = void                                               \
0425         >                                                                       \
0426         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(N));                      \
0427                                                                                 \
0428         BOOST_PP_REPEAT_FROM_TO(                                                \
0429             1                                                                   \
0430           , BOOST_PP_ADD(LIMIT, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(G)))             \
0431           , BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG_R                        \
0432           , (                                                                   \
0433               BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(N))                        \
0434             , BOOST_PP_SEQ_POP_BACK(G)                                          \
0435             , ACTOR                                                             \
0436           )                                                                     \
0437         )                                                                       \
0438 /**/
0439 
0440 #define BOOST_PHOENIX_DEFINE_EXPRESSION_RULE_VARARG_EXT(N, GRAMMAR, D)          \
0441         struct BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(N))                       \
0442             : expression:: BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REVERSE(N)) <         \
0443                 BOOST_PP_IF(                                                    \
0444                     BOOST_PP_EQUAL(1, BOOST_PP_SEQ_SIZE(GRAMMAR))               \
0445                   , BOOST_PP_EMPTY                                              \
0446                   , BOOST_PP_IDENTITY(                                          \
0447                       BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_POP_BACK(GRAMMAR))         \
0448                     )                                                           \
0449                 )()                                                             \
0450                 BOOST_PP_COMMA_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR)))     \
0451                 proto::vararg<                                                  \
0452                     BOOST_PP_SEQ_ELEM(                                          \
0453                         BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(GRAMMAR))                \
0454                       , GRAMMAR                                                 \
0455                     )                                                           \
0456                 >                                                               \
0457             >                                                                   \
0458         {};                                                                     \
0459 
0460 
0461 #endif