/////////////////////////////////////////////////////////////////////////////// // productions.hpp // // Copyright 2004 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) #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_PRODUCTIONS_PRODUCTIONS_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_STATIC_PRODUCTIONS_PRODUCTIONS_HPP_EAN_10_04_2005 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace xpressive { namespace detail { /////////////////////////////////////////////////////////////////////////////// // struct is_set_initializer_predicate { template struct apply { typedef typename is_same::type, set_initializer_type>::type type; }; }; /////////////////////////////////////////////////////////////////////////////// // struct action_transform { template struct apply { typedef proto::binary_op < typename proto::left_type::type , typename proto::right_type::type , proto::right_shift_tag > type; }; template static typename apply::type call(Op const &op, State const &, Visitor &) { return proto::left(op) >> proto::right(op); } }; /////////////////////////////////////////////////////////////////////////////// // subscript_compiler struct subscript_compiler : proto::conditional_compiler < is_set_initializer_predicate , proto::transform_compiler , proto::transform_compiler > { }; }}} /////////////////////////////////////////////////////////////////////////////// // misc regex compiler productions namespace boost { namespace proto { template struct value_type > { // store regex objects in the parse tree by reference typedef reference_wrapper const> type; }; // production for sequences in sequence template<> struct compiler : fold_compiler { }; template<> struct compiler : xpressive::detail::subscript_compiler { }; }} #endif