File indexing completed on 2025-01-18 09:53:36
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_VMD_DETAIL_MATCH_IDENTIFIER_HPP)
0008 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_HPP
0009
0010 #include <boost/preprocessor/arithmetic/inc.hpp>
0011 #include <boost/preprocessor/cat.hpp>
0012 #include <boost/preprocessor/comparison/equal.hpp>
0013 #include <boost/preprocessor/comparison/not_equal.hpp>
0014 #include <boost/preprocessor/control/iif.hpp>
0015 #include <boost/preprocessor/control/while.hpp>
0016 #include <boost/preprocessor/logical/bitand.hpp>
0017 #include <boost/preprocessor/tuple/elem.hpp>
0018 #include <boost/preprocessor/tuple/replace.hpp>
0019 #include <boost/preprocessor/tuple/size.hpp>
0020 #include <boost/vmd/is_empty.hpp>
0021 #include <boost/vmd/detail/idprefix.hpp>
0022 #include <boost/vmd/detail/match_identifier_common.hpp>
0023
0024 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_ID(state) \
0025 BOOST_PP_TUPLE_ELEM(0,state) \
0026
0027
0028 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE(state) \
0029 BOOST_PP_TUPLE_ELEM(1,state) \
0030
0031
0032 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE_SIZE(state) \
0033 BOOST_PP_TUPLE_ELEM(2,state) \
0034
0035
0036 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_CURRENT(state) \
0037 BOOST_PP_TUPLE_ELEM \
0038 ( \
0039 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state), \
0040 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE(state) \
0041 ) \
0042
0043
0044 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state) \
0045 BOOST_PP_TUPLE_ELEM(3,state) \
0046
0047
0048 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_RESULT(state) \
0049 BOOST_PP_TUPLE_ELEM(4,state) \
0050
0051
0052 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_PRED(d,state) \
0053 BOOST_PP_BITAND \
0054 ( \
0055 BOOST_PP_EQUAL_D \
0056 ( \
0057 d, \
0058 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_RESULT(state), \
0059 0 \
0060 ), \
0061 BOOST_PP_NOT_EQUAL_D \
0062 ( \
0063 d, \
0064 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state), \
0065 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_TUPLE_SIZE(state) \
0066 ) \
0067 ) \
0068
0069
0070 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_FOUND(d,state) \
0071 BOOST_PP_TUPLE_REPLACE_D \
0072 ( \
0073 d, \
0074 state, \
0075 4, \
0076 BOOST_PP_INC \
0077 ( \
0078 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state) \
0079 ) \
0080 ) \
0081
0082
0083 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CONTINUE(d,state) \
0084 BOOST_PP_TUPLE_REPLACE_D \
0085 ( \
0086 d, \
0087 state, \
0088 3, \
0089 BOOST_PP_INC \
0090 ( \
0091 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_INDEX(state) \
0092 ) \
0093 ) \
0094
0095
0096 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP(d,state) \
0097 BOOST_PP_IIF \
0098 ( \
0099 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CMP_IDS \
0100 ( \
0101 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_ID(state), \
0102 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_STATE_KEY_CURRENT(state) \
0103 ), \
0104 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_FOUND, \
0105 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP_CONTINUE \
0106 ) \
0107 (d,state) \
0108
0109
0110
0111
0112
0113
0114
0115
0116 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER(id,keytuple) \
0117 BOOST_PP_TUPLE_ELEM \
0118 ( \
0119 4, \
0120 BOOST_PP_WHILE \
0121 ( \
0122 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_PRED, \
0123 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP, \
0124 ( \
0125 id, \
0126 keytuple, \
0127 BOOST_PP_TUPLE_SIZE(keytuple), \
0128 0, \
0129 0 \
0130 ) \
0131 ) \
0132 ) \
0133
0134
0135
0136
0137
0138
0139
0140
0141 #define BOOST_VMD_DETAIL_MATCH_IDENTIFIER_D(d,id,keytuple) \
0142 BOOST_PP_TUPLE_ELEM \
0143 ( \
0144 4, \
0145 BOOST_PP_WHILE_ ## d \
0146 ( \
0147 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_PRED, \
0148 BOOST_VMD_DETAIL_MATCH_IDENTIFIER_OP, \
0149 ( \
0150 id, \
0151 keytuple, \
0152 BOOST_PP_TUPLE_SIZE(keytuple), \
0153 0, \
0154 0 \
0155 ) \
0156 ) \
0157 ) \
0158
0159
0160 #endif