/////////////////////////////////////////////////////////////////////////////// // independent_compiler.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_INDEPENDENT_COMPILER_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_STATIC_PRODUCTIONS_INDEPENDENT_COMPILER_HPP_EAN_10_04_2005 #include #include #include #include #include namespace boost { namespace xpressive { namespace detail { template struct lookahead_tag : proto::unary_tag {}; template struct lookbehind_tag : proto::unary_tag {}; struct keeper_tag : proto::unary_tag {}; /////////////////////////////////////////////////////////////////////////////// // lookahead_branch template struct lookahead_branch { typedef true_xpression state_type; template struct apply { typedef static_xpression, State> type; }; template static static_xpression, State> call(Op const &op, State const &state, Visitor &) { return make_static_xpression(lookahead_matcher(op, !Positive), state); } }; /////////////////////////////////////////////////////////////////////////////// // lookbehind_branch template struct lookbehind_branch { typedef true_xpression state_type; template struct apply { typedef static_xpression, State> type; }; template static static_xpression, State> call(Op const &op, State const &state, Visitor &) { return make_static_xpression(lookbehind_matcher(op, !Positive), state); } }; /////////////////////////////////////////////////////////////////////////////// // keeper_branch struct keeper_branch { typedef true_xpression state_type; template struct apply { typedef static_xpression, State> type; }; template static static_xpression, State> call(Op const &op, State const &state, Visitor &) { return make_static_xpression(keeper_matcher(op), state); } }; }}} namespace boost { namespace proto { // ericne, 28/nov/05: CW9_4 doesn't like partial specializations of the form: // template struct foo > template<> struct compiler, xpressive::detail::seq_tag, void> : branch_compiler, xpressive::detail::ind_tag> { }; template<> struct compiler, xpressive::detail::seq_tag, void> : branch_compiler, xpressive::detail::ind_tag> { }; template<> struct compiler, xpressive::detail::seq_tag, void> : branch_compiler, xpressive::detail::ind_tag> { }; template<> struct compiler, xpressive::detail::seq_tag, void> : branch_compiler, xpressive::detail::ind_tag> { }; template<> struct compiler : branch_compiler { }; template struct compiler : transform_compiler { }; }} #endif