// Copyright (c) 2001-2008 Hartmut Kaiser // // 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_META_GRAMMAR_MAY_05_2007_1230PM) #define BOOST_SPIRIT_META_GRAMMAR_MAY_05_2007_1230PM #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once // MS compatible compilers support #pragma once #endif #include #include #include #include namespace boost { namespace spirit { namespace qi { template struct stream_tag; } template struct is_stream_tag, qi::domain> : mpl::true_ {}; }} namespace boost { namespace spirit { namespace qi { /////////////////////////////////////////////////////////////////////////// // forwards /////////////////////////////////////////////////////////////////////////// template struct any_stream; template struct stream_director; struct main_meta_grammar; template struct is_valid_expr; template struct expr_transform; /////////////////////////////////////////////////////////////////////////// // stream tag /////////////////////////////////////////////////////////////////////////// template struct stream_tag { }; /////////////////////////////////////////////////////////////////////////// // stream specs /////////////////////////////////////////////////////////////////////////// template struct typed_stream : proto::terminal >::type { }; /////////////////////////////////////////////////////////////////////////// // get the director for a stream /////////////////////////////////////////////////////////////////////////// template struct extract_stream_director; template <> struct extract_stream_director { typedef any_stream type; }; template <> struct extract_stream_director { typedef any_stream type; }; template struct extract_stream_director > { typedef any_stream type; }; /////////////////////////////////////////////////////////////////////////// // utility meta-grammar /////////////////////////////////////////////////////////////////////////// struct utility_meta_grammar : // stream, wstream meta_grammar::compose_empty< proto::if_< is_stream_tag() >, qi::domain, mpl::identity > > { }; /////////////////////////////////////////////////////////////////////////// // These specializations non-intrusively hooks into the Qi meta-grammar. // (see qi/meta_grammar.hpp) /////////////////////////////////////////////////////////////////////////// template struct is_valid_expr< Expr, typename enable_if< proto::matches >::type > : mpl::true_ { }; template struct expr_transform< Expr, typename enable_if< proto::matches >::type > : mpl::identity { }; }}} #endif