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 Joel de Guzman
0003     Copyright (c) 2001-2011 Hartmut Kaiser
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 #ifndef BOOST_SPIRIT_QI_OPERATOR_SEQUENCE_HPP
0009 #define BOOST_SPIRIT_QI_OPERATOR_SEQUENCE_HPP
0010 
0011 #if defined(_MSC_VER)
0012 #pragma once
0013 #endif
0014 
0015 #include <boost/spirit/home/qi/operator/sequence_base.hpp>
0016 #include <boost/spirit/home/qi/detail/fail_function.hpp>
0017 #include <boost/spirit/home/qi/meta_compiler.hpp>
0018 #include <boost/proto/operators.hpp>
0019 #include <boost/proto/tags.hpp>
0020 
0021 namespace boost { namespace spirit
0022 {
0023     ///////////////////////////////////////////////////////////////////////////
0024     // Enablers
0025     ///////////////////////////////////////////////////////////////////////////
0026     template <>
0027     struct use_operator<qi::domain, proto::tag::shift_right> // enables >>
0028       : mpl::true_ {};
0029 
0030     template <>
0031     struct flatten_tree<qi::domain, proto::tag::shift_right> // flattens >>
0032       : mpl::true_ {};
0033 }}
0034 
0035 namespace boost { namespace spirit { namespace qi
0036 {
0037     template <typename Elements>
0038     struct sequence : sequence_base<sequence<Elements>, Elements>
0039     {
0040         friend struct sequence_base<sequence<Elements>, Elements>;
0041 
0042         sequence(Elements const& elements)
0043           : sequence_base<sequence<Elements>, Elements>(elements) {}
0044 
0045     private:
0046 
0047         template <typename Iterator, typename Context, typename Skipper>
0048         static detail::fail_function<Iterator, Context, Skipper>
0049         fail_function(
0050             Iterator& first, Iterator const& last
0051           , Context& context, Skipper const& skipper)
0052         {
0053             return detail::fail_function<Iterator, Context, Skipper>
0054                 (first, last, context, skipper);
0055         }
0056 
0057         std::string id() const { return "sequence"; }
0058     };
0059 
0060     ///////////////////////////////////////////////////////////////////////////
0061     // Parser generators: make_xxx function (objects)
0062     ///////////////////////////////////////////////////////////////////////////
0063     template <typename Elements, typename Modifiers>
0064     struct make_composite<proto::tag::shift_right, Elements, Modifiers>
0065       : make_nary_composite<Elements, sequence>
0066     {};
0067 
0068 //     ///////////////////////////////////////////////////////////////////////////
0069 //     // Define what attributes are compatible with a sequence
0070 //     template <typename Attribute, typename Elements, typename Context, typename Iterator>
0071 //     struct is_attribute_compatible<Attribute, sequence<Elements>, Context, Iterator>
0072 //       : mpl::or_<
0073 //             is_convertible<Attribute
0074 //               , typename traits::attribute_of<sequence<Elements>, Context, Iterator>::type> 
0075 //           , traits::is_fusion_sequence_compatible<qi::domain, Attribute
0076 //               , sequence<Elements>, Context, Iterator> 
0077 //           , traits::is_container_compatible<qi::domain, Attribute
0078 //               , sequence<Elements>, Context, Iterator>
0079 //         >
0080 //     {};
0081 }}}
0082 
0083 namespace boost { namespace spirit { namespace traits
0084 {
0085     ///////////////////////////////////////////////////////////////////////////
0086     template <typename Elements>
0087     struct has_semantic_action<qi::sequence<Elements> >
0088       : nary_has_semantic_action<Elements> {};
0089 
0090     ///////////////////////////////////////////////////////////////////////////
0091     template <typename Elements, typename Attribute, typename Context
0092       , typename Iterator>
0093     struct handles_container<qi::sequence<Elements>, Attribute, Context
0094           , Iterator>
0095       : mpl::true_ {};
0096 }}}
0097 
0098 #endif