1 #ifndef BOOST_METAPARSE_V1_ONE_CHAR_EXCEPT_HPP
2 #define BOOST_METAPARSE_V1_ONE_CHAR_EXCEPT_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
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/error/unexpected_character.hpp>
10 #include <boost/metaparse/v1/impl/is_any.hpp>
11 #include <boost/metaparse/v1/impl/one_char_except_not_used.hpp>
12 #include <boost/metaparse/v1/one_char.hpp>
13 #include <boost/metaparse/v1/accept_when.hpp>
14 #include <boost/metaparse/v1/define_error.hpp>
15 #include <boost/metaparse/limit_one_char_except_size.hpp>
17 #include <boost/preprocessor/cat.hpp>
18 #include <boost/preprocessor/arithmetic/dec.hpp>
19 #include <boost/preprocessor/arithmetic/mul.hpp>
20 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
21 #include <boost/preprocessor/repetition/repeat.hpp>
22 #include <boost/preprocessor/repetition/enum.hpp>
23 #include <boost/preprocessor/punctuation/comma_if.hpp>
24 #include <boost/preprocessor/tuple/eat.hpp>
33 BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
34 BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
36 impl::one_char_except_not_used
39 struct one_char_except;
41 #ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
42 # error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined
44 #define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \
45 template <BOOST_PP_ENUM_PARAMS(n, class T)> \
46 struct one_char_except< \
47 BOOST_PP_ENUM_PARAMS(n, T) \
52 BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
59 BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
62 impl::one_char_except_not_used BOOST_PP_TUPLE_EAT(3), \
68 impl::BOOST_PP_CAT(is_any, n)<BOOST_PP_ENUM_PARAMS(n, T)>, \
69 error::unexpected_character \
74 BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
75 MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE,
79 #undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE