/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2001-2011 Hartmut Kaiser 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) =============================================================================*/ #if !defined(SPIRIT_EXPECT_APRIL_29_2007_0445PM) #define SPIRIT_EXPECT_APRIL_29_2007_0445PM #if defined(_MSC_VER) #pragma once #endif #include #include #include #include #include #include #include namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////// // Enablers /////////////////////////////////////////////////////////////////////////// template <> struct use_operator // enables > : mpl::true_ {}; template <> struct flatten_tree // flattens > : mpl::true_ {}; }} namespace boost { namespace spirit { namespace qi { template struct expectation_failure : std::runtime_error { expectation_failure(Iterator first_, Iterator last_, info const& what) : std::runtime_error("boost::spirit::qi::expectation_failure") , first(first_), last(last_), what_(what) {} ~expectation_failure() throw() {} Iterator first; Iterator last; info what_; }; template struct expect : sequence_base, Elements> { friend struct sequence_base, Elements>; expect(Elements const& elements) : sequence_base, Elements>(elements) {} private: template static detail::expect_function< Iterator, Context, Skipper , expectation_failure > fail_function( Iterator& first, Iterator const& last , Context& context, Skipper const& skipper) { return detail::expect_function< Iterator, Context, Skipper, expectation_failure > (first, last, context, skipper); } std::string id() const { return "expect"; } }; /////////////////////////////////////////////////////////////////////////// // Parser generators: make_xxx function (objects) /////////////////////////////////////////////////////////////////////////// template struct make_composite : make_nary_composite {}; }}} namespace boost { namespace spirit { namespace traits { /////////////////////////////////////////////////////////////////////////// template struct has_semantic_action > : nary_has_semantic_action {}; /////////////////////////////////////////////////////////////////////////// template struct handles_container, Attribute, Context , Iterator> : mpl::true_ {}; }}} #endif