Release 1.39.0
[boost.git] / Boost_1_39_0 / boost / spirit / home / qi / detail / fail_function.hpp
blobcdacd3dfa88e254e5e5a51021d3b1cd773032cd6
1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
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(SPIRIT_FAIL_FUNCTION_APR_22_2006_0159PM)
8 #define SPIRIT_FAIL_FUNCTION_APR_22_2006_0159PM
10 #include <boost/spirit/home/support/unused.hpp>
12 namespace boost { namespace spirit { namespace qi { namespace detail
14 template <typename Iterator, typename Context, typename Skipper>
15 struct fail_function
17 fail_function(
18 Iterator& first, Iterator const& last
19 , Context& context, Skipper const& skipper)
20 : first(first)
21 , last(last)
22 , context(context)
23 , skipper(skipper)
27 template <typename Component, typename Attribute>
28 bool operator()(Component const& component, Attribute& attr)
30 // return true if the parser fails
31 typedef typename Component::director director;
32 return !director::parse(component, first, last, context, skipper, attr);
35 template <typename Component>
36 bool operator()(Component const& component)
38 // return true if the parser fails
39 typedef typename Component::director director;
40 return !director::parse(component, first, last, context, skipper, unused);
43 Iterator& first;
44 Iterator const& last;
45 Context& context;
46 Skipper const& skipper;
48 }}}}
50 #endif