File indexing completed on 2025-09-17 08:40:27
0001 #ifndef BOOST_PARSER_DETAIL_PP_UTILITIES_HPP_INCLUDED
0002 #define BOOST_PARSER_DETAIL_PP_UTILITIES_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009 #define BOOST_PARSER_PP_EXPAND(x) x
0010
0011 #define BOOST_PARSER_PP_CAT(x, y) BOOST_PARSER_PP_CAT_I(x, y)
0012 #define BOOST_PARSER_PP_CAT_I(x, ...) x ## __VA_ARGS__
0013
0014 #if defined(_MSC_VER) && !defined(__clang__)
0015
0016 #define BOOST_PARSER_PP_FIRST(x) BOOST_PARSER_PP_FIRST_I((x))
0017 #define BOOST_PARSER_PP_FIRST_I(x) BOOST_PARSER_PP_FIRST_II x
0018 #define BOOST_PARSER_PP_FIRST_II(x, ...) x
0019
0020 #else
0021
0022 #define BOOST_PARSER_PP_FIRST(x) BOOST_PARSER_PP_FIRST_I(x)
0023 #define BOOST_PARSER_PP_FIRST_I(x, ...) x
0024
0025 #endif
0026
0027 #define BOOST_PARSER_PP_IS_PAREN_I(x) BOOST_PARSER_PP_CAT(BOOST_PARSER_PP_IS_PAREN_I_, BOOST_PARSER_PP_IS_PAREN_II x)
0028 #define BOOST_PARSER_PP_IS_PAREN_II(...) 0
0029 #define BOOST_PARSER_PP_IS_PAREN_I_0 1,
0030 #define BOOST_PARSER_PP_IS_PAREN_I_BOOST_PARSER_PP_IS_PAREN_II 0,
0031
0032 #define BOOST_PARSER_PP_IS_PAREN(x) BOOST_PARSER_PP_FIRST(BOOST_PARSER_PP_IS_PAREN_I(x))
0033
0034 #define BOOST_PARSER_PP_EMPTY
0035
0036 #define BOOST_PARSER_PP_IS_EMPTY(x) BOOST_PARSER_PP_IS_EMPTY_I(BOOST_PARSER_PP_IS_PAREN(x), BOOST_PARSER_PP_IS_PAREN(x BOOST_PARSER_PP_EMPTY ()))
0037 #define BOOST_PARSER_PP_IS_EMPTY_I(x, y) BOOST_PARSER_PP_IS_EMPTY_II(x, y)
0038 #define BOOST_PARSER_PP_IS_EMPTY_II(x, y) BOOST_PARSER_PP_IS_EMPTY_III(x, y)
0039 #define BOOST_PARSER_PP_IS_EMPTY_III(x, y) BOOST_PARSER_PP_IS_EMPTY_III_ ## x ## y
0040 #define BOOST_PARSER_PP_IS_EMPTY_III_00 0
0041 #define BOOST_PARSER_PP_IS_EMPTY_III_01 1
0042 #define BOOST_PARSER_PP_IS_EMPTY_III_10 0
0043 #define BOOST_PARSER_PP_IS_EMPTY_III_11 0
0044
0045 #define BOOST_PARSER_PP_CALL(F, a, x) BOOST_PARSER_PP_CAT(BOOST_PARSER_PP_CALL_I_, BOOST_PARSER_PP_IS_EMPTY(x))(F, a, x)
0046 #define BOOST_PARSER_PP_CALL_I_0(F, a, x) F(a, x)
0047 #define BOOST_PARSER_PP_CALL_I_1(F, a, x)
0048
0049 #define BOOST_PARSER_PP_PARSE(x) BOOST_PARSER_PP_CAT(BOOST_PARSER_PP_PARSE_I_, BOOST_PARSER_PP_PARSE_II x)
0050 #define BOOST_PARSER_PP_PARSE_II(...) 0, (__VA_ARGS__),
0051 #define BOOST_PARSER_PP_PARSE_I_BOOST_PARSER_PP_PARSE_II 0, ~,
0052 #define BOOST_PARSER_PP_PARSE_I_0 1
0053
0054 #if defined(_MSC_VER) && !defined(__clang__)
0055
0056 #define BOOST_PARSER_PP_NAME(x) BOOST_PARSER_PP_NAME_I(BOOST_PARSER_PP_PARSE(x))
0057 #define BOOST_PARSER_PP_NAME_I(x) BOOST_PARSER_PP_NAME_II((x))
0058 #define BOOST_PARSER_PP_NAME_II(x) BOOST_PARSER_PP_NAME_III x
0059 #define BOOST_PARSER_PP_NAME_III(x, y, z) #z
0060
0061 #else
0062
0063 #define BOOST_PARSER_PP_NAME(x) BOOST_PARSER_PP_NAME_I(BOOST_PARSER_PP_PARSE(x))
0064 #define BOOST_PARSER_PP_NAME_I(x) BOOST_PARSER_PP_NAME_II(x)
0065 #define BOOST_PARSER_PP_NAME_II(x, y, z) #z
0066
0067 #endif
0068
0069
0070
0071
0072 #define BOOST_PARSER_PP_POINTER(C, x) BOOST_PARSER_PP_POINTER_I(C, BOOST_PARSER_PP_PARSE(x))
0073
0074 #define BOOST_PARSER_PP_EXPAND_V(...) __VA_ARGS__
0075
0076 #if defined(_MSC_VER) && !defined(__clang__)
0077
0078 #define BOOST_PARSER_PP_POINTER_I(C, x) BOOST_PARSER_PP_POINTER_II((C, x))
0079 #define BOOST_PARSER_PP_POINTER_II(x) BOOST_PARSER_PP_POINTER_III x
0080 #define BOOST_PARSER_PP_POINTER_III(C, x, y, z) BOOST_PARSER_PP_POINTER_III_##x(C, y, z)
0081 #define BOOST_PARSER_PP_POINTER_III_0(C, y, z) &C::z
0082 #define BOOST_PARSER_PP_POINTER_III_1(C, y, z) ::boost::describe::detail::mfn<C, BOOST_PARSER_PP_EXPAND_V y>(&C::z)
0083
0084 #else
0085
0086 #define BOOST_PARSER_PP_POINTER_I(C, x) BOOST_PARSER_PP_POINTER_II(C, x)
0087 #define BOOST_PARSER_PP_POINTER_II(C, x, y, z) BOOST_PARSER_PP_POINTER_III_##x(C, y, z)
0088 #define BOOST_PARSER_PP_POINTER_III_0(C, y, z) &C::z
0089 #define BOOST_PARSER_PP_POINTER_III_1(C, y, z) ::boost::describe::detail::mfn<C, BOOST_PARSER_PP_EXPAND_V y>(&C::z)
0090
0091 #endif
0092
0093 #endif