File indexing completed on 2025-01-19 09:47:44
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_SPIRIT_DETAIL_PARSE_DEC_02_2009_0411PM)
0008 #define BOOST_SPIRIT_DETAIL_PARSE_DEC_02_2009_0411PM
0009
0010 #if defined(_MSC_VER)
0011 #pragma once
0012 #endif
0013
0014 #include <boost/spirit/home/qi/meta_compiler.hpp>
0015 #include <boost/spirit/home/qi/skip_flag.hpp>
0016 #include <boost/spirit/home/qi/skip_over.hpp>
0017 #include <boost/spirit/home/support/unused.hpp>
0018 #include <boost/mpl/assert.hpp>
0019 #include <boost/mpl/bool.hpp>
0020
0021 namespace boost { namespace spirit { namespace qi { namespace detail
0022 {
0023
0024 template <typename Expr, typename Enable = void>
0025 struct parse_impl
0026 {
0027
0028
0029
0030
0031
0032 BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
0033 };
0034
0035 template <typename Expr>
0036 struct parse_impl<Expr
0037 , typename enable_if<traits::matches<qi::domain, Expr> >::type>
0038 {
0039 template <typename Iterator>
0040 static bool call(
0041 Iterator& first
0042 , Iterator last
0043 , Expr const& expr)
0044 {
0045 return compile<qi::domain>(expr).parse(
0046 first, last, unused, unused, unused);
0047 }
0048 };
0049
0050
0051 template <typename Expr, typename Enable = void>
0052 struct phrase_parse_impl
0053 {
0054
0055
0056
0057
0058
0059 BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr);
0060 };
0061
0062 template <typename Expr>
0063 struct phrase_parse_impl<Expr
0064 , typename enable_if<traits::matches<qi::domain, Expr> >::type>
0065 {
0066 template <typename Iterator, typename Skipper>
0067 static bool call(
0068 Iterator& first
0069 , Iterator last
0070 , Expr const& expr
0071 , Skipper const& skipper
0072 , BOOST_SCOPED_ENUM(skip_flag) post_skip)
0073 {
0074
0075
0076
0077 BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Skipper);
0078
0079 typedef
0080 typename result_of::compile<qi::domain, Skipper>::type
0081 skipper_type;
0082 skipper_type const skipper_ = compile<qi::domain>(skipper);
0083
0084 if (!compile<qi::domain>(expr).parse(
0085 first, last, unused, skipper_, unused))
0086 return false;
0087
0088 if (post_skip == skip_flag::postskip)
0089 qi::skip_over(first, last, skipper_);
0090 return true;
0091 }
0092 };
0093
0094 }}}}
0095
0096 #endif
0097