File indexing completed on 2025-02-28 09:59:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #if !defined(BOOST_SPIRIT_PARSER_TRAITS_IPP)
0012 #define BOOST_SPIRIT_PARSER_TRAITS_IPP
0013
0014 #include <boost/spirit/home/classic/core/composite/operators.hpp>
0015
0016
0017 namespace boost { namespace spirit {
0018
0019 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0020
0021 namespace impl
0022 {
0023
0024
0025
0026 struct parser_type_traits_base {
0027
0028 BOOST_STATIC_CONSTANT(bool, is_alternative = false);
0029 BOOST_STATIC_CONSTANT(bool, is_sequence = false);
0030 BOOST_STATIC_CONSTANT(bool, is_sequential_or = false);
0031 BOOST_STATIC_CONSTANT(bool, is_intersection = false);
0032 BOOST_STATIC_CONSTANT(bool, is_difference = false);
0033 BOOST_STATIC_CONSTANT(bool, is_exclusive_or = false);
0034 BOOST_STATIC_CONSTANT(bool, is_optional = false);
0035 BOOST_STATIC_CONSTANT(bool, is_kleene_star = false);
0036 BOOST_STATIC_CONSTANT(bool, is_positive = false);
0037 };
0038
0039 template <typename ParserT>
0040 struct parser_type_traits : public parser_type_traits_base {
0041
0042
0043
0044 };
0045
0046 template <typename A, typename B>
0047 struct parser_type_traits<alternative<A, B> >
0048 : public parser_type_traits_base {
0049
0050 BOOST_STATIC_CONSTANT(bool, is_alternative = true);
0051 };
0052
0053 template <typename A, typename B>
0054 struct parser_type_traits<sequence<A, B> >
0055 : public parser_type_traits_base {
0056
0057 BOOST_STATIC_CONSTANT(bool, is_sequence = true);
0058 };
0059
0060 template <typename A, typename B>
0061 struct parser_type_traits<sequential_or<A, B> >
0062 : public parser_type_traits_base {
0063
0064 BOOST_STATIC_CONSTANT(bool, is_sequential_or = true);
0065 };
0066
0067 template <typename A, typename B>
0068 struct parser_type_traits<intersection<A, B> >
0069 : public parser_type_traits_base {
0070
0071 BOOST_STATIC_CONSTANT(bool, is_intersection = true);
0072 };
0073
0074 template <typename A, typename B>
0075 struct parser_type_traits<difference<A, B> >
0076 : public parser_type_traits_base {
0077
0078 BOOST_STATIC_CONSTANT(bool, is_difference = true);
0079 };
0080
0081 template <typename A, typename B>
0082 struct parser_type_traits<exclusive_or<A, B> >
0083 : public parser_type_traits_base {
0084
0085 BOOST_STATIC_CONSTANT(bool, is_exclusive_or = true);
0086 };
0087
0088 template <typename S>
0089 struct parser_type_traits<optional<S> >
0090 : public parser_type_traits_base {
0091
0092 BOOST_STATIC_CONSTANT(bool, is_optional = true);
0093 };
0094
0095 template <typename S>
0096 struct parser_type_traits<kleene_star<S> >
0097 : public parser_type_traits_base {
0098
0099 BOOST_STATIC_CONSTANT(bool, is_kleene_star = true);
0100 };
0101
0102 template <typename S>
0103 struct parser_type_traits<positive<S> >
0104 : public parser_type_traits_base {
0105
0106 BOOST_STATIC_CONSTANT(bool, is_positive = true);
0107 };
0108
0109 }
0110
0111
0112 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0113
0114 }}
0115
0116 #endif