1 #ifndef BOOST_METAPARSE_V1_BUILD_PARSER_HPP
2 #define BOOST_METAPARSE_V1_BUILD_PARSER_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2010.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/metaparse/v1/fwd/build_parser.hpp>
10 #include <boost/metaparse/v1/start.hpp>
11 #include <boost/metaparse/v1/get_result.hpp>
12 #include <boost/metaparse/v1/get_position.hpp>
13 #include <boost/metaparse/v1/get_message.hpp>
14 #include <boost/metaparse/v1/get_line.hpp>
15 #include <boost/metaparse/v1/get_col.hpp>
16 #include <boost/metaparse/v1/is_error.hpp>
18 #include <boost/mpl/eval_if.hpp>
20 #include <boost/static_assert.hpp>
28 template <int Line, int Col, class Msg>
29 struct x__________________PARSING_FAILED__________________x
31 BOOST_STATIC_ASSERT(Line == Line + 1);
34 template <class P, class S>
35 struct parsing_failed :
36 x__________________PARSING_FAILED__________________x<
38 get_position<typename P::template apply<S, start> >
41 get_position<typename P::template apply<S, start> >
43 typename get_message<typename P::template apply<S, start> >::type
50 typedef build_parser type;
55 typename is_error<typename P::template apply<S, start> >::type,
57 get_result<typename P::template apply<S, start> >