Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:46

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Hartmut Kaiser
0003     Copyright (c) 2001-2011 Joel de Guzman
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(BOOST_PP_IS_ITERATING)
0009 
0010 #if !defined(BOOST_SPIRIT_MATCH_MANIP_ATTR_MAY_05_2007_1202PM)
0011 #define BOOST_SPIRIT_MATCH_MANIP_ATTR_MAY_05_2007_1202PM
0012 
0013 #include <boost/spirit/home/qi/stream/match_manip.hpp>
0014 
0015 #include <boost/fusion/include/vector.hpp>
0016 #include <boost/preprocessor/iterate.hpp>
0017 #include <boost/preprocessor/repetition/enum.hpp>
0018 #include <boost/preprocessor/repetition/enum_params.hpp>
0019 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0020 
0021 #define BOOST_PP_FILENAME_1                                                   \
0022     <boost/spirit/home/qi/stream/match_manip_attr.hpp>
0023 #define BOOST_PP_ITERATION_LIMITS (2, SPIRIT_ARGUMENTS_LIMIT)
0024 #include BOOST_PP_ITERATE()
0025 
0026 #endif
0027 
0028 ///////////////////////////////////////////////////////////////////////////////
0029 //
0030 //  Preprocessor vertical repetition code
0031 //
0032 ///////////////////////////////////////////////////////////////////////////////
0033 #else // defined(BOOST_PP_IS_ITERATING)
0034 
0035 #define N BOOST_PP_ITERATION()
0036 #define BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE(z, n, A) BOOST_PP_CAT(A, n) &
0037 
0038 ///////////////////////////////////////////////////////////////////////////////
0039 namespace boost { namespace spirit { namespace qi
0040 {
0041     ///////////////////////////////////////////////////////////////////////////
0042     template <typename Expr, BOOST_PP_ENUM_PARAMS(N, typename A)>
0043     inline detail::match_manip<Expr, mpl::false_, mpl::true_, unused_type
0044       , fusion::vector<
0045             BOOST_PP_ENUM(N, BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE, A)
0046         > > 
0047     match(
0048         Expr const& xpr
0049       , BOOST_PP_ENUM_BINARY_PARAMS(N, A, & attr))
0050     {
0051         using qi::detail::match_manip;
0052 
0053         // Report invalid expression error as early as possible.
0054         // If you got an error_invalid_expression error message here,
0055         // then the expression (expr) is not a valid spirit qi expression.
0056         BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
0057 
0058         typedef fusion::vector<
0059             BOOST_PP_ENUM(N, BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE, A)
0060         > vector_type;
0061 
0062         vector_type attr (BOOST_PP_ENUM_PARAMS(N, attr));
0063         return match_manip<Expr, mpl::false_, mpl::true_, unused_type, vector_type>(
0064             xpr, unused, attr);
0065     }
0066 
0067     ///////////////////////////////////////////////////////////////////////////
0068     template <typename Expr, typename Skipper
0069       , BOOST_PP_ENUM_PARAMS(N, typename A)>
0070     inline detail::match_manip<Expr, mpl::false_, mpl::true_, Skipper
0071       , fusion::vector<
0072             BOOST_PP_ENUM(N, BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE, A)
0073         > > 
0074     phrase_match(
0075         Expr const& xpr
0076       , Skipper const& s
0077       , BOOST_SCOPED_ENUM(skip_flag) post_skip
0078       , BOOST_PP_ENUM_BINARY_PARAMS(N, A, & attr))
0079     {
0080         using qi::detail::match_manip;
0081 
0082         // Report invalid expression error as early as possible.
0083         // If you got an error_invalid_expression error message here,
0084         // then either the expression (expr) or skipper is not a valid
0085         // spirit qi expression.
0086         BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
0087         BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Skipper);
0088 
0089         typedef fusion::vector<
0090             BOOST_PP_ENUM(N, BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE, A)
0091         > vector_type;
0092 
0093         vector_type attr (BOOST_PP_ENUM_PARAMS(N, attr));
0094         return match_manip<Expr, mpl::false_, mpl::true_, Skipper, vector_type>(
0095             xpr, s, post_skip, attr);
0096     }
0097 
0098     template <typename Expr, typename Skipper
0099       , BOOST_PP_ENUM_PARAMS(N, typename A)>
0100     inline detail::match_manip<Expr, mpl::false_, mpl::true_, Skipper
0101       , fusion::vector<
0102             BOOST_PP_ENUM(N, BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE, A)
0103         > > 
0104     phrase_match(
0105         Expr const& xpr
0106       , Skipper const& s
0107       , BOOST_PP_ENUM_BINARY_PARAMS(N, A, & attr))
0108     {
0109         using qi::detail::match_manip;
0110 
0111         // Report invalid expression error as early as possible.
0112         // If you got an error_invalid_expression error message here,
0113         // then either the expression (expr) or skipper is not a valid
0114         // spirit qi expression.
0115         BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
0116         BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Skipper);
0117 
0118         typedef fusion::vector<
0119             BOOST_PP_ENUM(N, BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE, A)
0120         > vector_type;
0121 
0122         vector_type attr (BOOST_PP_ENUM_PARAMS(N, attr));
0123         return match_manip<Expr, mpl::false_, mpl::true_, Skipper, vector_type>(
0124             xpr, s, attr);
0125     }
0126 
0127 }}}
0128 
0129 #undef BOOST_SPIRIT_QI_ATTRIBUTE_REFERENCE
0130 #undef N
0131 
0132 #endif
0133