File indexing completed on 2025-01-18 09:40:48
0001 #ifndef BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_HPP
0002 #define BOOST_METAPARSE_V1_CPP98_ONE_CHAR_EXCEPT_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/metaparse/v1/error/unexpected_character.hpp>
0010 #include <boost/metaparse/v1/cpp98/impl/is_none.hpp>
0011 #include <boost/metaparse/v1/cpp98/impl/one_char_except_not_used.hpp>
0012 #include <boost/metaparse/v1/one_char.hpp>
0013 #include <boost/metaparse/v1/accept_when.hpp>
0014 #include <boost/metaparse/limit_one_char_except_size.hpp>
0015
0016 #include <boost/preprocessor/cat.hpp>
0017 #include <boost/preprocessor/arithmetic/dec.hpp>
0018 #include <boost/preprocessor/arithmetic/mul.hpp>
0019 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
0020 #include <boost/preprocessor/repetition/repeat.hpp>
0021 #include <boost/preprocessor/repetition/enum.hpp>
0022 #include <boost/preprocessor/punctuation/comma_if.hpp>
0023 #include <boost/preprocessor/tuple/eat.hpp>
0024
0025 namespace boost
0026 {
0027 namespace metaparse
0028 {
0029 namespace v1
0030 {
0031 template <
0032 BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
0033 BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
0034 class C,
0035 impl::one_char_except_not_used
0036 )
0037 >
0038 struct one_char_except;
0039
0040 #ifdef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
0041 # error MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE already defined
0042 #endif
0043 #define MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE(z, n, unused) \
0044 template <BOOST_PP_ENUM_PARAMS(n, class T)> \
0045 struct one_char_except< \
0046 BOOST_PP_ENUM_PARAMS(n, T) \
0047 BOOST_PP_COMMA_IF( \
0048 BOOST_PP_MUL( \
0049 n, \
0050 BOOST_PP_SUB( \
0051 BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
0052 n \
0053 ) \
0054 ) \
0055 ) \
0056 BOOST_PP_ENUM( \
0057 BOOST_PP_SUB( \
0058 BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE), \
0059 n \
0060 ), \
0061 impl::one_char_except_not_used BOOST_PP_TUPLE_EAT(3), \
0062 ~ \
0063 ) \
0064 > :\
0065 accept_when< \
0066 one_char, \
0067 impl::BOOST_PP_CAT(is_none, n)<BOOST_PP_ENUM_PARAMS(n, T)>, \
0068 error::unexpected_character \
0069 > \
0070 {};
0071
0072 BOOST_PP_REPEAT(
0073 BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
0074 MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE,
0075 ~
0076 )
0077
0078 #undef MPLLBIS_METAPARSE_ONE_CHAR_EXCEPT_CASE
0079 }
0080 }
0081 }
0082
0083 #endif
0084