1 /*=============================================================================
2 Copyright (c) 2001-2011 Hartmut Kaiser
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(BOOST_SPIRIT_MATCH_MANIP_AUTO_DEC_02_2009_0813PM)
8 #define BOOST_SPIRIT_MATCH_MANIP_AUTO_DEC_02_2009_0813PM
14 #include <boost/spirit/home/qi/stream/detail/match_manip.hpp>
15 #include <boost/spirit/home/qi/auto/create_parser.hpp>
16 #include <boost/utility/enable_if.hpp>
18 ///////////////////////////////////////////////////////////////////////////////
19 namespace boost { namespace spirit { namespace qi { namespace detail
21 ///////////////////////////////////////////////////////////////////////////
22 template <typename Expr>
24 , typename enable_if<traits::meta_create_exists<qi::domain, Expr> >::type>
26 typedef typename result_of::create_parser<Expr>::type expr_type;
28 expr_type, mpl::true_, mpl::false_, unused_type, Expr
31 static type call(Expr const& expr)
33 return type(create_parser<Expr>(), unused, const_cast<Expr&>(expr));
37 ///////////////////////////////////////////////////////////////////////////
38 template <typename Expr, typename Skipper>
39 struct phrase_match<Expr, Skipper
40 , typename enable_if<traits::meta_create_exists<qi::domain, Expr> >::type>
42 typedef typename result_of::create_parser<Expr>::type expr_type;
44 expr_type, mpl::true_, mpl::false_, Skipper, Expr
49 , Skipper const& skipper
50 , BOOST_SCOPED_ENUM(skip_flag) post_skip)
52 // Report invalid expression error as early as possible.
53 // If you got an error_invalid_expression error message here,
54 // then the delimiter is not a valid spirit karma expression.
55 BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Skipper);
56 return type(create_parser<Expr>(), skipper, post_skip
57 , const_cast<Expr&>(expr));