Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:49

0001 #ifndef BOOST_METAPARSE_V1_BUILD_PARSER_HPP
0002 #define BOOST_METAPARSE_V1_BUILD_PARSER_HPP
0003 
0004 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2009 - 2010.
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/metaparse/v1/fwd/build_parser.hpp>
0010 #include <boost/metaparse/v1/start.hpp>
0011 #include <boost/metaparse/v1/get_result.hpp>
0012 #include <boost/metaparse/v1/get_position.hpp>
0013 #include <boost/metaparse/v1/get_message.hpp>
0014 #include <boost/metaparse/v1/get_line.hpp>
0015 #include <boost/metaparse/v1/get_col.hpp>
0016 #include <boost/metaparse/v1/is_error.hpp>
0017 
0018 #include <boost/mpl/eval_if.hpp>
0019 
0020 #include <boost/static_assert.hpp>
0021 
0022 namespace boost
0023 {
0024   namespace metaparse
0025   {
0026     namespace v1
0027     {
0028       template <int Line, int Col, class Msg>
0029       struct x__________________PARSING_FAILED__________________x
0030       {
0031         BOOST_STATIC_ASSERT(Line == Line + 1);
0032       };
0033 
0034       template <class P, class S>
0035       struct parsing_failed :
0036         x__________________PARSING_FAILED__________________x<
0037           get_line<
0038             get_position<typename P::template apply<S, start> >
0039           >::type::value,
0040           get_col<
0041             get_position<typename P::template apply<S, start> >
0042           >::type::value,
0043           typename get_message<typename P::template apply<S, start> >::type
0044         >
0045       {};
0046 
0047       template <class P>
0048       struct build_parser
0049       {
0050         typedef build_parser type;
0051         
0052         template <class S>
0053         struct apply :
0054           boost::mpl::eval_if<
0055             typename is_error<typename P::template apply<S, start> >::type,
0056             parsing_failed<P, S>,
0057             get_result<typename P::template apply<S, start> >
0058           >
0059         {};
0060       };
0061     }
0062   }
0063 }
0064 
0065 #endif
0066