Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:02:37

0001 /*=============================================================================
0002     Copyright (c) 2001-2014 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 =============================================================================*/
0007 #if !defined(BOOST_SPIRIT_X3_NOT_PREDICATE_MARCH_23_2007_0618PM)
0008 #define BOOST_SPIRIT_X3_NOT_PREDICATE_MARCH_23_2007_0618PM
0009 
0010 #include <boost/spirit/home/x3/core/parser.hpp>
0011 
0012 namespace boost { namespace spirit { namespace x3
0013 {
0014     template <typename Subject>
0015     struct not_predicate : unary_parser<Subject, not_predicate<Subject>>
0016     {
0017         typedef unary_parser<Subject, not_predicate<Subject>> base_type;
0018 
0019         typedef unused_type attribute_type;
0020         static bool const has_attribute = false;
0021 
0022         constexpr not_predicate(Subject const& subject)
0023           : base_type(subject) {}
0024 
0025         template <typename Iterator, typename Context
0026           , typename RContext, typename Attribute>
0027         bool parse(Iterator& first, Iterator const& last
0028           , Context const& context, RContext& rcontext, Attribute& /*attr*/) const
0029         {
0030             Iterator i = first;
0031             return !this->subject.parse(i, last, context, rcontext, unused);
0032         }
0033     };
0034 
0035     template <typename Subject>
0036     constexpr not_predicate<typename extension::as_parser<Subject>::value_type>
0037     operator!(Subject const& subject)
0038     {
0039         return { as_parser(subject) };
0040     }
0041 }}}
0042 
0043 #endif