Update of /cvsroot/boost/boost/boost/xpressive/detail/static
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27152/detail/static

Modified Files:
        as_xpr.hpp placeholders.hpp 
Added Files:
        grammar.hpp 
Log Message:
fix matches<> to not instantiate intermediate basic_expr types, preliminary 
proto meta-grammar for static xpressive

--- NEW FILE: grammar.hpp ---
///////////////////////////////////////////////////////////////////////////////
// grammar.hpp
//
//  Copyright 2004 Eric Niebler. 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)

#ifndef BOOST_XPRESSIVE_DETAIL_STATIC_GRAMMAR_HPP_EAN_11_12_2006
#define BOOST_XPRESSIVE_DETAIL_STATIC_GRAMMAR_HPP_EAN_11_12_2006

// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif

#include <boost/xpressive/proto/proto_fwd.hpp>
#include <boost/xpressive/proto/matches.hpp>
#include <boost/xpressive/proto/traits.hpp>
#include <boost/xpressive/detail/detail_fwd.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_pointer.hpp>

namespace boost { namespace xpressive
{
    namespace detail
    {
        template<typename T>
        struct is_generic_repeat
          : mpl::false_
        {};

        template<uint_t Min, uint_t Max>
        struct is_generic_repeat<generic_quant_tag<Min, Max> >
          : mpl::true_
        {};
    }

    struct XpressiveGrammar;

    struct XpressiveListSet
      : proto::or_<
            proto::and_<
                proto::meta::comma< XpressiveListSet, mpl::_ >
              , proto::if_< is_integral< 
proto::meta::arg<proto::meta::right<mpl::_> > > >
            >
          , proto::and_<
                proto::meta::assign<detail::set_initializer_type, mpl::_>
              , proto::if_< is_integral< 
proto::meta::arg<proto::meta::right<mpl::_> > > >
            >
        >
    {};

    struct XpressiveSet
      : proto::or_<
            proto::meta::subscript<detail::set_initializer_type, mpl::_>
          , XpressiveListSet
        >
    {};

    struct XpressiveComplementedSet
      : proto::or_<
            proto::meta::complement<XpressiveSet>
          , XpressiveSet
        >
    {};

    struct XpressiveTaggedSubExpression
      : proto::meta::assign<detail::basic_mark_tag, mpl::_>
    {};

    struct XpressiveLiterals
      : proto::or_<
            proto::meta::terminal<std::basic_string<mpl::_, mpl::_, mpl::_> >
          , proto::and_<
                proto::meta::terminal<mpl::_>
              , proto::or_<
                    proto::if_<is_integral<proto::meta::arg<mpl::_> > >
                  , proto::if_<is_pointer<proto::meta::arg<mpl::_> > >
                >
            >
        >
    {};

    struct XpressiveTerminal
      : proto::or_<
            proto::meta::terminal<detail::epsilon_matcher>
          , proto::meta::terminal<detail::posix_charset_placeholder>
          , proto::meta::terminal<detail::assert_bos_matcher>
          , proto::meta::terminal<detail::assert_eos_matcher>
          , proto::or_<
                proto::meta::terminal<detail::assert_bol_placeholder>
              , proto::meta::terminal<detail::assert_eol_placeholder>
              , proto::meta::terminal<detail::assert_word_placeholder<mpl::_> >
              , proto::meta::terminal<detail::literal_placeholder<mpl::_, 
mpl::_> >
              , proto::or_<
                    proto::meta::terminal<detail::logical_newline_placeholder>
                  , proto::meta::terminal<detail::any_matcher>
                  , proto::meta::terminal<detail::self_placeholder>
                  , proto::meta::terminal<detail::mark_placeholder>
                  , proto::or_<
                        proto::meta::terminal<detail::range_placeholder<mpl::_> 
>
                      , proto::meta::terminal<detail::regex_placeholder<mpl::_, 
mpl::_> >
                      , proto::or_<
                            XpressiveLiterals
                          , XpressiveComplementedSet
                          , XpressiveTaggedSubExpression
                        >
                    >
                >
            >
        >
    {};

    struct XpressiveQuantified
      : proto::or_<
            proto::meta::unary_star< XpressiveGrammar >
          , proto::meta::unary_plus< XpressiveGrammar >
          , proto::meta::logical_not< XpressiveGrammar >
          , proto::and_<
                proto::if_<detail::is_generic_repeat<proto::meta::tag<mpl::_> > 
>
              , proto::if_<proto::matches<proto::meta::arg<mpl::_>, 
XpressiveGrammar> >
            >
        >
    {};

    struct XpressiveLazyQuantified
      : proto::or_<
            proto::meta::unary_minus< XpressiveQuantified >
          , XpressiveQuantified
          , XpressiveTerminal
        >
    {};

    struct XpressiveSequence
      : proto::or_<
            proto::meta::right_shift< XpressiveGrammar, XpressiveGrammar >
          , XpressiveLazyQuantified
        >
    {};

    struct XpressiveAlternate
      : proto::or_<
            proto::meta::bitwise_or< XpressiveGrammar, XpressiveGrammar >
          , XpressiveSequence
        >
    {};

    struct XpressiveGrammar
      : XpressiveAlternate
    {};

}}

#endif

Index: as_xpr.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/static/as_xpr.hpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- as_xpr.hpp  6 Nov 2006 03:10:41 -0000       1.9
+++ as_xpr.hpp  13 Nov 2006 15:53:45 -0000      1.10
@@ -86,7 +86,7 @@
         <
             is_string_literal<Literal>
           , string_placeholder_generator<Literal>
-          , mpl::identity<literal_placeholder<Literal, false> >
+          , mpl::identity<literal_placeholder<Literal, mpl::false_> >
         >::type type;
 
         template<typename Literal2>
@@ -100,7 +100,7 @@
     template<typename BidiIter>
     struct as_matcher_type<basic_regex<BidiIter>, false>
     {
-        typedef regex_placeholder<BidiIter, false> type;
+        typedef regex_placeholder<BidiIter, mpl::false_> type;
 
         template<typename Regex>
         static type call(Regex const &rex)

Index: placeholders.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/static/placeholders.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- placeholders.hpp    29 Oct 2006 06:14:41 -0000      1.4
+++ placeholders.hpp    13 Nov 2006 15:53:45 -0000      1.5
@@ -24,12 +24,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 // literal_placeholder
 //
-template<typename Char, bool Not>
+template<typename Char, typename Not>
 struct literal_placeholder
 {
     BOOST_XPR_QUANT_STYLE(quant_fixed_width, 1, true)
 
-    typedef mpl::bool_<Not> not_type;
+    typedef Not not_type;
     Char ch_;
 };
 
@@ -57,7 +57,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 // regex_placeholder
 //
-template<typename BidiIter, bool ByRef>
+template<typename BidiIter, typename ByRef>
 struct regex_placeholder
 {
     BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, false)


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to