Chris@16: /*============================================================================= Chris@16: Copyright (c) 2001-2011 Hartmut Kaiser Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: =============================================================================*/ Chris@16: #if !defined(BOOST_SPIRIT_DETAIL_PARSE_DEC_02_2009_0411PM) Chris@16: #define BOOST_SPIRIT_DETAIL_PARSE_DEC_02_2009_0411PM Chris@16: Chris@16: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace spirit { namespace qi { namespace detail Chris@16: { Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct parse_impl Chris@16: { Chris@16: // Report invalid expression error as early as possible. Chris@16: // If you got an error_invalid_expression error message here, Chris@16: // then the expression (expr) is not a valid spirit qi expression. Chris@16: // Did you intend to use the auto_ facilities while forgetting to Chris@16: // #include ? Chris@16: BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct parse_impl >::type> Chris@16: { Chris@16: template Chris@16: static bool call( Chris@16: Iterator& first Chris@16: , Iterator last Chris@16: , Expr const& expr) Chris@16: { Chris@16: return compile(expr).parse( Chris@16: first, last, unused, unused, unused); Chris@16: } Chris@16: }; Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct phrase_parse_impl Chris@16: { Chris@16: // Report invalid expression error as early as possible. Chris@16: // If you got an error_invalid_expression error message here, Chris@16: // then the expression (expr) is not a valid spirit qi expression. Chris@16: // Did you intend to use the auto_ facilities while forgetting to Chris@16: // #include ? Chris@16: BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Expr); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct phrase_parse_impl >::type> Chris@16: { Chris@16: template Chris@16: static bool call( Chris@16: Iterator& first Chris@16: , Iterator last Chris@16: , Expr const& expr Chris@16: , Skipper const& skipper Chris@16: , BOOST_SCOPED_ENUM(skip_flag) post_skip) Chris@16: { Chris@16: // Report invalid expression error as early as possible. Chris@16: // If you got an error_invalid_expression error message here, Chris@16: // then the skipper is not a valid spirit qi expression. Chris@16: BOOST_SPIRIT_ASSERT_MATCH(qi::domain, Skipper); Chris@16: Chris@16: typedef Chris@16: typename result_of::compile::type Chris@16: skipper_type; Chris@16: skipper_type const skipper_ = compile(skipper); Chris@16: Chris@16: if (!compile(expr).parse( Chris@16: first, last, unused, skipper_, unused)) Chris@16: return false; Chris@16: Chris@16: if (post_skip == skip_flag::postskip) Chris@16: qi::skip_over(first, last, skipper_); Chris@16: return true; Chris@16: } Chris@16: }; Chris@16: Chris@16: }}}} Chris@16: Chris@16: #endif Chris@16: