#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES) #include #elif !defined(BOOST_PP_IS_ITERATING) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/when.hpp") #endif /////////////////////////////////////////////////////////////////////////////// /// \file when.hpp /// Definition of when transform. // // Copyright 2008 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) #endif #define BOOST_PP_ITERATION_PARAMS_1 \ (3, (0, BOOST_PROTO_MAX_ARITY, )) #include BOOST_PP_ITERATE() #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES) #pragma wave option(output: null) #endif #else #define N BOOST_PP_ITERATION() /// \brief A grammar element and a PrimitiveTransform that associates /// a transform with the grammar. /// /// Use when\<\> to override a grammar's default transform /// with a custom transform. It is for used when composing larger /// transforms by associating smaller transforms with individual /// rules in your grammar, as in the following transform which /// counts the number of terminals in an expression. /// /// \code /// // Count the terminals in an expression tree. /// // Must be invoked with initial state == mpl::int_<0>(). /// struct CountLeaves /// : or_< /// when, mpl::next<_state>()> /// , otherwise > /// > /// {}; /// \endcode /// /// The when\ form accepts either a /// CallableTransform or an ObjectTransform as its second parameter. /// when\<\> uses is_callable\::value to /// distinguish between the two, and uses call\<\> to /// evaluate CallableTransforms and make\<\> to evaluate /// ObjectTransforms. template struct when : detail::when_impl {}; #if N > 0 /// \brief A grammar element and a PrimitiveTransform that associates /// a transform with the grammar. /// /// Use when\<\> to override a grammar's default transform /// with a custom transform. It is for used when composing larger /// transforms by associating smaller transforms with individual /// rules in your grammar, as in the following transform which /// counts the number of terminals in an expression. /// /// \code /// // Count the terminals in an expression tree. /// // Must be invoked with initial state == mpl::int_<0>(). /// struct CountLeaves /// : or_< /// when, mpl::next<_state>()> /// , otherwise > /// > /// {}; /// \endcode /// /// The when\ form accepts either a /// CallableTransform or an ObjectTransform as its second parameter. /// when\<\> uses is_callable\::value to /// distinguish between the two, and uses call\<\> to /// evaluate CallableTransforms and make\<\> to evaluate /// ObjectTransforms. template struct when : detail::when_impl {}; #endif #undef N #endif