/*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(BOOST_SPIRIT_CHAR_CLASS_APR_16_2006_1051AM) #define BOOST_SPIRIT_CHAR_CLASS_APR_16_2006_1051AM #include #include #include #include #include #include #include #include namespace boost { namespace spirit { namespace qi { /////////////////////////////////////////////////////////////////////////// // generic isxxx parser (for alnum, alpha, graph, etc.) /////////////////////////////////////////////////////////////////////////// template struct char_class : char_parser, typename Tag::char_set::char_type> { typedef typename Tag::char_set char_set; typedef typename Tag::char_class char_class_; template static bool test(Component const&, CharParam ch, Context&) { using spirit::char_class::classify; return classify::is(char_class_(), ch); } template static std::string what(Component const& component, Context const& ctx) { typedef spirit::char_class::what what_; return what_::is(char_class_()); } }; }}} namespace boost { namespace spirit { namespace traits { /////////////////////////////////////////////////////////////////////////// // no_case char_class conversions /////////////////////////////////////////////////////////////////////////// namespace detail { using spirit::char_class::key; using spirit::char_class::lower_case_tag; using spirit::char_class::upper_case_tag; using spirit::char_class::tag::alpha; template struct make_no_case_char_class : mpl::identity > {}; template struct make_no_case_char_class > : mpl::identity > > {}; template struct make_no_case_char_class > : mpl::identity > > {}; } template < typename Domain, typename Elements, typename Modifier, typename Tag > struct make_modified_component< Domain, qi::char_class, Elements, Modifier , typename enable_if< is_member_of_modifier >::type > { typedef typename detail::make_no_case_char_class::type director; typedef component type; static type call(Elements const&) { return type(fusion::nil()); } }; }}} #endif