Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*=============================================================================
0002     Copyright (c) 2014 Thomas Bernard
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_NO_CASE_SEPT_16_2014_0912PM)
0008 #define BOOST_SPIRIT_X3_NO_CASE_SEPT_16_2014_0912PM
0009 
0010 #include <boost/spirit/home/x3/support/context.hpp>
0011 #include <boost/spirit/home/x3/support/unused.hpp>
0012 #include <boost/spirit/home/x3/support/no_case.hpp>
0013 #include <boost/spirit/home/x3/core/parser.hpp>
0014 
0015 namespace boost { namespace spirit { namespace x3
0016 {
0017     // propagate no_case information through the context
0018     template <typename Subject>
0019     struct no_case_directive : unary_parser<Subject, no_case_directive<Subject>>
0020     {
0021         typedef unary_parser<Subject, no_case_directive<Subject> > base_type;
0022         static bool const is_pass_through_unary = true;
0023         static bool const handles_container = Subject::handles_container;
0024 
0025         constexpr no_case_directive(Subject const& subject)
0026           : base_type(subject) {}
0027 
0028         template <typename Iterator, typename Context
0029           , typename RContext, typename Attribute>
0030         bool parse(Iterator& first, Iterator const& last
0031           , Context const& context, RContext& rcontext, Attribute& attr) const
0032         {
0033             return this->subject.parse(
0034                 first, last
0035               , make_context<no_case_tag>(no_case_compare_, context)
0036               , rcontext
0037               , attr);
0038         }
0039     };
0040 
0041     struct no_case_gen
0042     {
0043         template <typename Subject>
0044         constexpr no_case_directive<typename extension::as_parser<Subject>::value_type>
0045         operator[](Subject const& subject) const
0046         {
0047             return { as_parser(subject) };
0048         }
0049     };
0050 
0051     constexpr auto no_case = no_case_gen{};
0052 }}}
0053 
0054 #endif