Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-13 08:51:44

0001 /*=============================================================================
0002     Copyright (c) 2001-2014 Joel de Guzman
0003     Copyright (c) 2001-2011 Hartmut Kaiser
0004     Copyright (c) 2017 wanghan02
0005     Copyright (c) 2024 Nana Sakisaka
0006 
0007     Distributed under the Boost Software License, Version 1.0. (See accompanying
0008     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 =============================================================================*/
0010 #if !defined(BOOST_SPIRIT_X3_PLUS_MARCH_13_2007_0127PM)
0011 #define BOOST_SPIRIT_X3_PLUS_MARCH_13_2007_0127PM
0012 
0013 #include <boost/spirit/home/x3/core/parser.hpp>
0014 #include <boost/spirit/home/x3/support/expectation.hpp>
0015 #include <boost/spirit/home/x3/support/traits/container_traits.hpp>
0016 #include <boost/spirit/home/x3/support/traits/attribute_of.hpp>
0017 #include <boost/spirit/home/x3/core/detail/parse_into_container.hpp>
0018 
0019 namespace boost { namespace spirit { namespace x3
0020 {
0021     template <typename Subject>
0022     struct plus : unary_parser<Subject, plus<Subject>>
0023     {
0024         typedef unary_parser<Subject, plus<Subject>> base_type;
0025         static bool const handles_container = true;
0026 
0027         constexpr plus(Subject const& subject)
0028           : base_type(subject) {}
0029 
0030         template <typename Iterator, typename Context
0031           , typename RContext, typename Attribute>
0032         bool parse(Iterator& first, Iterator const& last
0033           , Context const& context, RContext& rcontext, Attribute& attr) const
0034         {
0035             if (!detail::parse_into_container(
0036                 this->subject, first, last, context, rcontext, attr))
0037                 return false;
0038 
0039             while (detail::parse_into_container(
0040                 this->subject, first, last, context, rcontext, attr))
0041                 ;
0042             return !has_expectation_failure(context);
0043         }
0044     };
0045 
0046     template <typename Subject>
0047     constexpr plus<typename extension::as_parser<Subject>::value_type>
0048     operator+(Subject const& subject)
0049     {
0050         return { as_parser(subject) };
0051     }
0052 }}}
0053 
0054 namespace boost { namespace spirit { namespace x3 { namespace traits
0055 {
0056     template <typename Subject, typename Context>
0057     struct attribute_of<x3::plus<Subject>, Context>
0058         : build_container<
0059             typename attribute_of<Subject, Context>::type> {};
0060 }}}}
0061 
0062 #endif