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