Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49608 - in trunk/boost/xpressive: . detail detail/core detail/core/matcher detail/static detail/static/transforms
From: eric_at_[hidden]
Date: 2008-11-05 23:43:17


Author: eric_niebler
Date: 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
New Revision: 49608
URL: http://svn.boost.org/trac/boost/changeset/49608

Log:
use the latest proto
Text files modified:
   trunk/boost/xpressive/basic_regex.hpp | 18 +-
   trunk/boost/xpressive/detail/core/access.hpp | 4
   trunk/boost/xpressive/detail/core/matcher/action_matcher.hpp | 228 +++++++++++++------------
   trunk/boost/xpressive/detail/core/matcher/end_matcher.hpp | 2
   trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp | 12
   trunk/boost/xpressive/detail/detail_fwd.hpp | 10
   trunk/boost/xpressive/detail/static/compile.hpp | 15 +
   trunk/boost/xpressive/detail/static/grammar.hpp | 18 +-
   trunk/boost/xpressive/detail/static/is_pure.hpp | 28 +-
   trunk/boost/xpressive/detail/static/modifier.hpp | 6
   trunk/boost/xpressive/detail/static/placeholders.hpp | 1
   trunk/boost/xpressive/detail/static/static.hpp | 2
   trunk/boost/xpressive/detail/static/transforms/as_action.hpp | 261 ++++++++++++++---------------
   trunk/boost/xpressive/detail/static/transforms/as_alternate.hpp | 94 ++++++----
   trunk/boost/xpressive/detail/static/transforms/as_independent.hpp | 189 +++++++++++----------
   trunk/boost/xpressive/detail/static/transforms/as_inverse.hpp | 2
   trunk/boost/xpressive/detail/static/transforms/as_marker.hpp | 42 ++--
   trunk/boost/xpressive/detail/static/transforms/as_matcher.hpp | 32 +-
   trunk/boost/xpressive/detail/static/transforms/as_modifier.hpp | 56 ++++--
   trunk/boost/xpressive/detail/static/transforms/as_quantifier.hpp | 349 ++++++++++++++++++++++-----------------
   trunk/boost/xpressive/detail/static/transforms/as_sequence.hpp | 42 ++--
   trunk/boost/xpressive/detail/static/transforms/as_set.hpp | 131 ++++++++------
   trunk/boost/xpressive/detail/static/visitor.hpp | 1
   trunk/boost/xpressive/detail/static/width_of.hpp | 106 ++++++++----
   trunk/boost/xpressive/match_results.hpp | 10
   trunk/boost/xpressive/regex_actions.hpp | 47 ++--
   trunk/boost/xpressive/regex_algorithms.hpp | 4
   trunk/boost/xpressive/regex_primitives.hpp | 63 ++++---
   trunk/boost/xpressive/xpressive_fwd.hpp | 4
   trunk/boost/xpressive/xpressive_typeof.hpp | 2
   30 files changed, 966 insertions(+), 813 deletions(-)

Modified: trunk/boost/xpressive/basic_regex.hpp
==============================================================================
--- trunk/boost/xpressive/basic_regex.hpp (original)
+++ trunk/boost/xpressive/basic_regex.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -24,7 +24,7 @@
 // Doxygen can't handle proto :-(
 #ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
 # include <boost/xpressive/detail/static/grammar.hpp>
-# include <boost/xpressive/proto/extends.hpp>
+# include <boost/proto/extends.hpp>
 #endif
 
 #if BOOST_XPRESSIVE_HAS_MS_STACK_GUARD
@@ -85,7 +85,7 @@
     /// \return *this
     basic_regex<BidiIter> &operator =(basic_regex<BidiIter> const &that)
     {
- proto::arg(*this) = proto::arg(that);
+ proto::value(*this) = proto::value(that);
         return *this;
     }
 
@@ -123,14 +123,14 @@
     ///
     std::size_t mark_count() const
     {
- return proto::arg(*this) ? proto::arg(*this)->mark_count_ : 0;
+ return proto::value(*this) ? proto::value(*this)->mark_count_ : 0;
     }
 
     /// Returns a token which uniquely identifies this regular expression.
     ///
     regex_id_type regex_id() const
     {
- return proto::arg(*this) ? proto::arg(*this)->xpr_.get() : 0;
+ return proto::value(*this) ? proto::value(*this)->xpr_.get() : 0;
     }
 
     /// Swaps the contents of this basic_regex object with another.
@@ -145,7 +145,7 @@
     /// \throw nothrow
     void swap(basic_regex<BidiIter> &that) // throw()
     {
- proto::arg(*this).swap(proto::arg(that));
+ proto::value(*this).swap(proto::value(that));
     }
 
     /// Factory method for building a regex object from a range of characters.
@@ -215,7 +215,7 @@
         bool success = false, stack_error = false;
         __try
         {
- success = proto::arg(*this)->xpr_->match(state);
+ success = proto::value(*this)->xpr_->match(state);
         }
         __except(_exception_code() == 0xC00000FDUL)
         {
@@ -225,7 +225,7 @@
         detail::throw_on_stack_error(stack_error);
         return success;
         #else
- return proto::arg(*this)->xpr_->match(state);
+ return proto::value(*this)->xpr_->match(state);
         #endif
     }
 
@@ -233,7 +233,7 @@
     /// INTERNAL ONLY
     bool invalid_() const
     {
- return !proto::arg(*this) || !proto::arg(*this)->xpr_;
+ return !proto::value(*this) || !proto::value(*this)->xpr_;
     }
 
     // Compiles valid static regexes into a state machine.
@@ -241,7 +241,7 @@
     template<typename Expr>
     void compile_(Expr const &expr, mpl::true_)
     {
- detail::static_compile(expr, proto::arg(*this).get());
+ detail::static_compile(expr, proto::value(*this).get());
     }
 
     // No-op for invalid static regexes.

Modified: trunk/boost/xpressive/detail/core/access.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/access.hpp (original)
+++ trunk/boost/xpressive/detail/core/access.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -32,7 +32,7 @@
 
     static std::size_t get_hidden_mark_count(basic_regex<BidiIter> const &rex)
     {
- return proto::arg(rex)->hidden_mark_count_;
+ return proto::value(rex)->hidden_mark_count_;
     }
 
     static bool invalid(basic_regex<BidiIter> const &rex)
@@ -48,7 +48,7 @@
     static shared_ptr<detail::regex_impl<BidiIter> > const &
     get_regex_impl(basic_regex<BidiIter> const &rex)
     {
- return proto::arg(rex).get();
+ return proto::value(rex).get();
     }
 
     static void init_sub_match_vector

Modified: trunk/boost/xpressive/detail/core/matcher/action_matcher.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/matcher/action_matcher.hpp (original)
+++ trunk/boost/xpressive/detail/core/matcher/action_matcher.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -22,18 +22,19 @@
 #include <boost/assert.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/throw_exception.hpp>
+#include <boost/utility/result_of.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/core/quant_style.hpp>
 #include <boost/xpressive/detail/core/action.hpp>
 #include <boost/xpressive/detail/core/state.hpp>
-#include <boost/xpressive/proto/proto.hpp>
-#include <boost/xpressive/proto/context.hpp>
+#include <boost/proto/core.hpp>
+#include <boost/proto/context.hpp>
 #include <boost/xpressive/match_results.hpp> // for type_info_less
 #include <boost/xpressive/detail/static/transforms/as_action.hpp> // for 'read_attr'
 #if BOOST_VERSION >= 103500
-# include <boost/xpressive/proto/fusion.hpp>
+# include <boost/proto/fusion.hpp>
 # include <boost/fusion/include/transform_view.hpp>
 # include <boost/fusion/include/invoke.hpp>
 # include <boost/fusion/include/push_front.hpp>
@@ -57,11 +58,9 @@
 
     template<typename Expr, long N>
     struct child_
- : remove_reference<typename mpl::if_<
- is_const<Expr>
- , typename proto::result_of::arg_c<Expr, N>::const_reference
- , typename proto::result_of::arg_c<Expr, N>::reference
- >::type>
+ : remove_reference<
+ typename proto::result_of::child_c<Expr &, N>::type
+ >
     {};
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -75,8 +74,8 @@
         typedef typename child_<Expr, 1>::type right_type;
 
         typedef
- typename proto::result_of::arg<
- typename proto::result_of::arg_c<right_type, 0>::type
+ typename proto::result_of::value<
+ typename proto::result_of::child_c<right_type, 0>::type
>::type
         function_type;
 
@@ -97,7 +96,7 @@
         result_type operator()(Expr &expr, Context &ctx) const
         {
             return fusion::invoke<function_type>(
- proto::arg(proto::arg_c<0>(proto::right(expr)))
+ proto::value(proto::child_c<0>(proto::right(expr)))
               , evaluated_args(
                     fusion::push_front(fusion::pop_front(proto::right(expr)), boost::ref(proto::left(expr)))
                   , proto::eval_fun<Context>(ctx)
@@ -117,7 +116,7 @@
         typedef typename child_<Expr, 1>::type right_type;
 
         typedef
- typename proto::result_of::arg<right_type>::type
+ typename proto::result_of::value<right_type>::type
         function_type;
 
         typedef typename boost::result_of<
@@ -126,7 +125,7 @@
 
         result_type operator()(Expr &expr, Context &ctx) const
         {
- return proto::arg(proto::right(expr))(
+ return proto::value(proto::right(expr))(
                 proto::eval(proto::left(expr), ctx)
             );
         }
@@ -165,7 +164,7 @@
             typedef Arg &result_type;
             result_type operator()(Expr &expr, action_context const &) const
             {
- return proto::arg(expr).get();
+ return proto::value(expr).get();
             }
         };
 
@@ -175,7 +174,7 @@
             typedef Arg const &result_type;
             result_type operator()(Expr &expr, action_context const &) const
             {
- return proto::arg(expr);
+ return proto::value(expr);
             }
         };
 
@@ -185,7 +184,7 @@
             typedef typename action_arg<Type, Int>::reference result_type;
             result_type operator()(Expr &expr, action_context const &ctx) const
             {
- action_args_type::const_iterator where_ = ctx.args().find(&typeid(proto::arg(expr)));
+ action_args_type::const_iterator where_ = ctx.args().find(&typeid(proto::value(expr)));
                 if(where_ == ctx.args().end())
                 {
                     BOOST_THROW_EXCEPTION(
@@ -195,7 +194,7 @@
                         )
                     );
                 }
- return proto::arg(expr).cast(where_->second);
+ return proto::value(expr).cast(where_->second);
             }
         };
 
@@ -207,7 +206,7 @@
 
         template<typename Expr>
         struct eval<Expr, proto::tag::terminal>
- : eval_terminal<Expr, typename proto::result_of::arg<Expr>::type>
+ : eval_terminal<Expr, typename proto::result_of::value<Expr>::type>
         {};
 
         // Evaluate attributes like a1|42
@@ -215,9 +214,9 @@
         struct eval<Expr, attr_with_default_tag>
         {
             typedef
- typename proto::result_of::arg<
+ typename proto::result_of::value<
                     typename proto::result_of::left<
- typename proto::result_of::arg<
+ typename proto::result_of::child<
                             Expr
>::type
>::type
@@ -228,9 +227,9 @@
 
             result_type operator ()(Expr const &expr, action_context const &ctx) const
             {
- return proto::arg(proto::left(proto::arg(expr))).t_
- ? *proto::arg(proto::left(proto::arg(expr))).t_
- : proto::eval(proto::right(proto::arg(expr)), ctx);
+ return proto::value(proto::left(proto::child(expr))).t_
+ ? *proto::value(proto::left(proto::child(expr))).t_
+ : proto::eval(proto::right(proto::child(expr)), ctx);
             }
         };
 
@@ -271,49 +270,50 @@
     ///////////////////////////////////////////////////////////////////////////////
     // subreg_transform
     //
- struct subreg_transform : proto::callable
+ struct subreg_transform : proto::transform<subreg_transform>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef State unref_state;
- typedef typename proto::terminal<sub_match<typename unref_state::iterator> >::type type;
- };
+ typedef typename impl::state state_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &, State const &state, Visitor &visitor) const
- {
- sub_match<typename State::iterator> const &sub = state.sub_matches_[ visitor ];
- return proto::as_expr(sub);
- }
+ typedef
+ typename proto::terminal<sub_match<typename state_type::iterator> >::type
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ return result_type::make(state.sub_matches_[ data ]);
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // mark_transform
     //
- struct mark_transform : proto::callable
+ struct mark_transform : proto::transform<mark_transform>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef State unref_state;
+ typedef typename impl::state state_type;
             typedef
- typename proto::terminal<sub_match<typename unref_state::iterator> >::type
- type;
- };
+ typename proto::terminal<sub_match<typename state_type::iterator> >::type
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &) const
- {
- sub_match<typename State::iterator> const &sub = state.sub_matches_[ proto::arg(expr).mark_number_ ];
- return proto::as_expr(sub);
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param
+ ) const
+ {
+ return result_type::make(state.sub_matches_[ proto::value(expr).mark_number_ ]);
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -341,83 +341,89 @@
     ///////////////////////////////////////////////////////////////////////////////
     // attr_transform
     //
- struct attr_transform : proto::callable
+ struct attr_transform : proto::transform<attr_transform>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
+ typedef typename impl::expr expr_type;
+
             typedef
- typename proto::result_of::as_expr<
- opt<typename Expr::proto_arg0::matcher_type::value_type::second_type>
- >::type
- type;
- };
+ typename expr_type::proto_child0::matcher_type::value_type::second_type
+ attr_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &, State const &state, Visitor &) const
- {
- typedef typename Expr::proto_arg0::matcher_type::value_type::second_type attr_type;
- int slot = typename Expr::proto_arg0::nbr_type();
- attr_type const *attr = static_cast<attr_type const *>(state.attr_context_.attr_slots_[slot-1]);
- return proto::as_expr(opt<attr_type>(attr));
- }
+ typedef
+ typename proto::terminal<opt<attr_type> >::type
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param
+ , typename impl::state_param state
+ , typename impl::data_param
+ ) const
+ {
+ int slot = typename expr_type::proto_child0::nbr_type();
+ attr_type const *attr = static_cast<attr_type const *>(state.attr_context_.attr_slots_[slot-1]);
+ return result_type::make(opt<attr_type>(attr));
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // attr_with_default_transform
     //
     template<typename Grammar, typename Callable = proto::callable>
- struct attr_with_default_transform : proto::callable
+ struct attr_with_default_transform : proto::transform<attr_with_default_transform<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef
                 typename proto::unary_expr<
                     attr_with_default_tag
- , typename Grammar::template result<void(Expr, State, Visitor)>::type
+ , typename Grammar::template impl<Expr, State, Data>::result_type
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- typename result<void(Expr, State, Visitor)>::type that = {
- Grammar()(expr, state, visitor)
- };
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ result_type that = {
+ typename Grammar::template impl<Expr, State, Data>()(expr, state, data)
+ };
+ return that;
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // by_ref_transform
     //
- struct by_ref_transform : proto::callable
+ struct by_ref_transform : proto::transform<by_ref_transform>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef
- typename proto::terminal<typename proto::result_of::arg<Expr>::const_reference>::type
- type;
- };
+ typename proto::result_of::value<typename impl::expr_param>::type
+ reference;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &) const
- {
- typedef typename result<void(Expr, State, Visitor)>::type that_type;
- return that_type::make(proto::arg(expr));
- }
+ typedef
+ typename proto::terminal<reference>::type
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ return result_type::make(proto::value(expr));
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -457,9 +463,15 @@
         bool match(match_state<BidiIter> &state, Next const &next) const
         {
             // Bind the arguments
- int sub = this->sub_; // BUGBUG this is a hack
- typedef typename BindActionArgs::template result<void(Actor, match_state<BidiIter>, int)>::type action_type;
- action<action_type> actor(BindActionArgs()(this->actor_, state, sub));
+ typedef
+ typename boost::result_of<BindActionArgs(
+ Actor const &
+ , match_state<BidiIter> &
+ , int const &
+ )>::type
+ action_type;
+
+ action<action_type> actor(BindActionArgs()(this->actor_, state, this->sub_));
 
             // Put the action in the action list
             actionable const **action_list_tail = state.action_list_tail_;

Modified: trunk/boost/xpressive/detail/core/matcher/end_matcher.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/matcher/end_matcher.hpp (original)
+++ trunk/boost/xpressive/detail/core/matcher/end_matcher.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -88,7 +88,7 @@
             {
                 actor->execute(state.action_args_);
             }
-
+
             return true;
         }
     };

Modified: trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp (original)
+++ trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -19,7 +19,7 @@
 #include <boost/xpressive/detail/core/quant_style.hpp>
 #include <boost/xpressive/detail/core/matcher/action_matcher.hpp>
 #include <boost/xpressive/detail/core/state.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
@@ -46,7 +46,7 @@
             typedef Arg &result_type;
             result_type operator()(Expr &expr, predicate_context const &) const
             {
- return proto::arg(expr).get();
+ return proto::value(expr).get();
             }
         };
 
@@ -66,7 +66,7 @@
             typedef sub_match<BidiIter> const &result_type;
             result_type operator()(Expr &expr, predicate_context const &ctx) const
             {
- return ctx.sub_matches_[proto::arg(expr).mark_number_];
+ return ctx.sub_matches_[proto::value(expr).mark_number_];
             }
         };
 
@@ -78,7 +78,7 @@
 
         template<typename Expr>
         struct eval<Expr, proto::tag::terminal>
- : eval_terminal<Expr, typename proto::result_of::arg<Expr>::type>
+ : eval_terminal<Expr, typename proto::result_of::value<Expr>::type>
         {};
 
         #if BOOST_VERSION >= 103500
@@ -131,14 +131,14 @@
         bool match_(match_state<BidiIter> &state, Next const &next, mpl::true_) const
         {
             sub_match<BidiIter> const &sub = state.sub_match(this->sub_);
- return proto::arg(proto::arg_c<1>(this->predicate_))(sub) && next.match(state);
+ return proto::value(proto::child_c<1>(this->predicate_))(sub) && next.match(state);
         }
 
         template<typename BidiIter, typename Next>
         bool match_(match_state<BidiIter> &state, Next const &next, mpl::false_) const
         {
             predicate_context<BidiIter> ctx(this->sub_, state.sub_matches_);
- return proto::eval(proto::arg_c<1>(this->predicate_), ctx) && next.match(state);
+ return proto::eval(proto::child_c<1>(this->predicate_), ctx) && next.match(state);
         }
     };
 

Modified: trunk/boost/xpressive/detail/detail_fwd.hpp
==============================================================================
--- trunk/boost/xpressive/detail/detail_fwd.hpp (original)
+++ trunk/boost/xpressive/detail/detail_fwd.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -39,7 +39,7 @@
     struct type_info_less;
 
     typedef std::map<std::type_info const *, void *, type_info_less> action_args_type;
-
+
     struct action_context;
 
     template<typename BidiIter>
@@ -405,13 +405,15 @@
     using proto::otherwise;
     using proto::switch_;
     using proto::make;
- using proto::_arg;
+ using proto::_child;
+ using proto::_value;
     using proto::_left;
     using proto::_right;
     using proto::not_;
     using proto::_state;
- using proto::_visitor;
+ using proto::_data;
     using proto::callable;
+ using proto::transform;
     using proto::fold;
     using proto::reverse_fold;
     using proto::fold_tree;
@@ -421,7 +423,7 @@
     using proto::bitwise_or;
     using proto::logical_not;
     using proto::dereference;
- using proto::posit;
+ using proto::unary_plus;
     using proto::negate;
     using proto::complement;
     using proto::comma;

Modified: trunk/boost/xpressive/detail/static/compile.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/compile.hpp (original)
+++ trunk/boost/xpressive/detail/static/compile.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -15,7 +15,7 @@
 
 #include <boost/mpl/bool.hpp>
 #include <boost/iterator/iterator_traits.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 #include <boost/xpressive/regex_traits.hpp>
 #include <boost/xpressive/detail/core/regex_impl.hpp>
 #include <boost/xpressive/detail/core/linker.hpp>
@@ -39,9 +39,14 @@
         impl->traits_ = new traits_holder<Traits>(traits);
 
         // "compile" the regex and wrap it in an xpression_adaptor.
- xpression_visitor<BidiIter, mpl::false_, Traits> visitor(traits, impl);
+ typedef xpression_visitor<BidiIter, mpl::false_, Traits> visitor_type;
+ visitor_type visitor(traits, impl);
         intrusive_ptr<matchable_ex<BidiIter> const> adxpr = make_adaptor<matchable_ex<BidiIter> >(
- Grammar<char_type>()(xpr, end_xpression(), visitor)
+ typename Grammar<char_type>::template impl<Xpr const &, end_xpression, visitor_type &>()(
+ xpr
+ , end_xpression()
+ , visitor
+ )
         );
 
         // Link and optimize the regex
@@ -81,9 +86,9 @@
     static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> > const &impl)
     {
         // use specified traits
- typedef typename proto::result_of::arg<typename proto::result_of::left<Xpr>::type>::type::locale_type locale_type;
+ typedef typename proto::result_of::value<typename proto::result_of::left<Xpr>::type>::type::locale_type locale_type;
         typedef typename regex_traits_type<locale_type, BidiIter>::type traits_type;
- static_compile_impl2(proto::right(xpr), impl, traits_type(proto::arg(proto::left(xpr)).getloc()));
+ static_compile_impl2(proto::right(xpr), impl, traits_type(proto::value(proto::left(xpr)).getloc()));
     }
 
     ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/boost/xpressive/detail/static/grammar.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/grammar.hpp (original)
+++ trunk/boost/xpressive/detail/static/grammar.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -16,7 +16,7 @@
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/assert.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 #include <boost/xpressive/detail/static/is_pure.hpp>
 #include <boost/xpressive/detail/static/transforms/as_matcher.hpp>
 #include <boost/xpressive/detail/static/transforms/as_alternate.hpp>
@@ -75,7 +75,7 @@
         template<typename Char, typename Gram, typename Greedy>
         struct as_repeat
           : if_<
- make<detail::use_simple_repeat<_arg, Char> >
+ make<detail::use_simple_repeat<_child, Char> >
               , as_simple_quantifier<Gram, Greedy>
               , as_default_quantifier<Greedy>
>
@@ -97,8 +97,8 @@
             {};
 
             template<typename Dummy>
- struct case_<tag::posit, Dummy>
- : posit<Gram>
+ struct case_<tag::unary_plus, Dummy>
+ : unary_plus<Gram>
             {};
 
             template<typename Dummy>
@@ -210,7 +210,7 @@
             struct case_<optional_tag<Greedy> , Dummy>
               : when<
                     unary_expr<optional_tag<Greedy>, Gram>
- , in_sequence<call<as_optional<Gram, Greedy>(_arg)> >
+ , in_sequence<call<as_optional<Gram, Greedy>(_child)> >
>
             {};
 
@@ -223,9 +223,9 @@
             {};
 
             template<typename Dummy>
- struct case_<tag::posit, Dummy>
+ struct case_<tag::unary_plus, Dummy>
               : when<
- posit<Gram>
+ unary_plus<Gram>
                   , call<Gram(as_repeat<Char, Gram, mpl::true_>)>
>
             {};
@@ -250,7 +250,7 @@
             struct case_<tag::negate, Dummy>
               : when<
                     negate<switch_<NonGreedyRepeatCases<Gram> > >
- , call<Gram(call<as_repeat<Char, Gram, mpl::false_>(_arg)>)>
+ , call<Gram(call<as_repeat<Char, Gram, mpl::false_>(_child)>)>
>
             {};
 
@@ -258,7 +258,7 @@
             struct case_<tag::complement, Dummy>
               : when<
                     complement<switch_<InvertibleCases<Char, Gram> > >
- , in_sequence<call<as_inverse(call<switch_<InvertibleCases<Char, Gram> >(_arg)>)> >
+ , in_sequence<call<as_inverse(call<switch_<InvertibleCases<Char, Gram> >(_child)>)> >
>
             {};
 

Modified: trunk/boost/xpressive/detail/static/is_pure.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/is_pure.hpp (original)
+++ trunk/boost/xpressive/detail/static/is_pure.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -63,14 +63,14 @@
 
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, proto::tag::terminal>
- : use_simple_repeat_terminal<typename proto::result_of::arg<Expr>::type, Char>
+ : use_simple_repeat_terminal<typename proto::result_of::value<Expr>::type, Char>
     {};
 
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, proto::tag::shift_right>
       : mpl::and_<
- use_simple_repeat_<typename Expr::proto_arg0::proto_base_expr, Char>
- , use_simple_repeat_<typename Expr::proto_arg1::proto_base_expr, Char>
+ use_simple_repeat_<typename Expr::proto_child_ref0::proto_base_expr, Char>
+ , use_simple_repeat_<typename Expr::proto_child_ref1::proto_base_expr, Char>
>
     {};
 
@@ -78,8 +78,8 @@
     struct use_simple_repeat_<Expr, Char, proto::tag::bitwise_or>
       : mpl::and_<
             mpl::not_equal_to<unknown_width, width_of<Expr, Char> >
- , use_simple_repeat_<typename Expr::proto_arg0::proto_base_expr, Char>
- , use_simple_repeat_<typename Expr::proto_arg1::proto_base_expr, Char>
+ , use_simple_repeat_<typename Expr::proto_child_ref0::proto_base_expr, Char>
+ , use_simple_repeat_<typename Expr::proto_child_ref1::proto_base_expr, Char>
>
     {};
 
@@ -105,12 +105,16 @@
     // either (s1 = ...) or (a1 = ...) or (set = ...)
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, proto::tag::assign>
- : use_simple_repeat_assign<typename proto::result_of::arg<typename Expr::proto_arg0::proto_base_expr>::type>
+ : use_simple_repeat_assign<
+ typename proto::result_of::value<
+ typename Expr::proto_child_ref0::proto_base_expr
+ >::type
+ >
     {};
 
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, modifier_tag>
- : use_simple_repeat_<typename Expr::proto_arg1::proto_base_expr, Char>
+ : use_simple_repeat_<typename Expr::proto_child_ref1::proto_base_expr, Char>
     {};
 
     template<typename Expr, typename Char>
@@ -131,7 +135,7 @@
     // when complementing a set or an assertion, the purity is that of the set (true) or the assertion
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, proto::tag::complement>
- : use_simple_repeat_<typename Expr::proto_arg0::proto_base_expr, Char>
+ : use_simple_repeat_<typename Expr::proto_child_ref0::proto_base_expr, Char>
     {};
 
     // The comma is used in list-initialized sets, which are pure
@@ -154,12 +158,12 @@
 
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, proto::tag::subscript>
- : use_simple_repeat_subscript<Expr, Char, typename Expr::proto_arg0::proto_base_expr>
+ : use_simple_repeat_subscript<Expr, Char, typename Expr::proto_child_ref0::proto_base_expr>
     {};
 
     // Quantified expressions are variable-width and cannot use the simple quantifier
     template<typename Expr, typename Char>
- struct use_simple_repeat_<Expr, Char, proto::tag::posit>
+ struct use_simple_repeat_<Expr, Char, proto::tag::unary_plus>
       : mpl::false_
     {};
 
@@ -180,12 +184,12 @@
 
     template<typename Expr, typename Char, uint_t Count>
     struct use_simple_repeat_<Expr, Char, generic_quant_tag<Count, Count> >
- : use_simple_repeat_<typename Expr::proto_arg0::proto_base_expr, Char>
+ : use_simple_repeat_<typename Expr::proto_child_ref0::proto_base_expr, Char>
     {};
 
     template<typename Expr, typename Char>
     struct use_simple_repeat_<Expr, Char, proto::tag::negate>
- : use_simple_repeat_<typename Expr::proto_arg0::proto_base_expr, Char>
+ : use_simple_repeat_<typename Expr::proto_child_ref0::proto_base_expr, Char>
     {};
 
     ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/boost/xpressive/detail/static/modifier.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/modifier.hpp (original)
+++ trunk/boost/xpressive/detail/static/modifier.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -17,7 +17,7 @@
 #endif
 
 #include <boost/xpressive/detail/detail_fwd.hpp>
-#include <boost/xpressive/proto/traits.hpp>
+#include <boost/proto/traits.hpp>
 #include <boost/xpressive/regex_constants.hpp>
 
 namespace boost { namespace xpressive { namespace detail
@@ -36,7 +36,7 @@
             typedef typename proto::binary_expr<
                 modifier_tag
               , typename proto::terminal<Modifier>::type
- , typename proto::result_of::as_arg<Expr const>::type
+ , typename proto::result_of::as_child<Expr const>::type
>::type type;
         };
 
@@ -44,7 +44,7 @@
         typename apply<Expr>::type const
         operator ()(Expr const &expr) const
         {
- typename apply<Expr>::type that = {{this->mod_}, proto::as_arg(expr)};
+ typename apply<Expr>::type that = {{this->mod_}, proto::as_child(expr)};
             return that;
         }
 

Modified: trunk/boost/xpressive/detail/static/placeholders.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/placeholders.hpp (original)
+++ trunk/boost/xpressive/detail/static/placeholders.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -108,6 +108,7 @@
     BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, false)
 
     typedef Nbr nbr_type;
+ static Nbr nbr() { return Nbr(); }
 };
 
 }}} // namespace boost::xpressive::detail

Modified: trunk/boost/xpressive/detail/static/static.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/static.hpp (original)
+++ trunk/boost/xpressive/detail/static/static.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -251,7 +251,7 @@
 //
 inline int get_mark_number(basic_mark_tag const &mark)
 {
- return proto::arg(mark).mark_number_;
+ return proto::value(mark).mark_number_;
 }
 
 }}} // namespace boost::xpressive::detail

Modified: trunk/boost/xpressive/detail/static/transforms/as_action.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_action.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_action.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -23,8 +23,13 @@
 #include <boost/xpressive/detail/core/matcher/attr_end_matcher.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
 #include <boost/xpressive/detail/static/transforms/as_quantifier.hpp>
-#include <boost/xpressive/proto/proto.hpp>
-#include <boost/xpressive/proto/transform.hpp>
+#include <boost/proto/core.hpp>
+#include <boost/proto/transform/arg.hpp>
+#include <boost/proto/transform/call.hpp>
+#include <boost/proto/transform/make.hpp>
+#include <boost/proto/transform/when.hpp>
+#include <boost/proto/transform/fold.hpp>
+#include <boost/proto/transform/fold_tree.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
@@ -37,6 +42,7 @@
     {
         typedef Nbr nbr_type;
         typedef Matcher matcher_type;
+ static Nbr nbr() { return Nbr(); }
     };
 
     template<typename Nbr, typename Matcher>
@@ -59,7 +65,7 @@
             // Ignore nested actions, because attributes are scoped
             when< subscript<_, _>, _state >
           , when< terminal<_>, _state >
- , when< proto::assign<terminal<detail::attribute_placeholder<Nbr> >, _>, call<_arg(_right)> >
+ , when< proto::assign<terminal<detail::attribute_placeholder<Nbr> >, _>, call<_value(_right)> >
           , otherwise< fold<_, _state, FindAttr<Nbr> > >
>
     {};
@@ -69,59 +75,35 @@
     // For patterns like (a1 = RHS)[ref(i) = a1], transform to
     // (a1 = RHS)[ref(i) = read_attr<1, RHS>] so that when reading the attribute
     // we know what type is stored in the attribute slot.
- struct as_read_attr : proto::callable
+ struct as_read_attr : proto::transform<as_read_attr>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
+ typedef typename impl::expr expr_type;
+ typedef
+ typename FindAttr<typename expr_type::proto_child0::nbr_type>::template impl<
+ State
+ , mpl::void_
+ , int
+ >::result_type
+ attr_type;
+
             typedef
- typename proto::result_of::as_expr<
+ typename proto::terminal<
                     detail::read_attr<
- typename Expr::proto_arg0::nbr_type
- , typename FindAttr<typename Expr::proto_arg0::nbr_type>::template result<void(
- State
- , mpl::void_
- , int
- )>::type
+ typename expr_type::proto_child0::nbr_type
+ , BOOST_PROTO_UNCVREF(attr_type)
>
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &, State const &, Visitor &) const
- {
- typename result<void(Expr, State, Visitor)>::type that = {{}};
- return that;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // by_value
- // Store all terminals within an action by value to avoid dangling references.
- struct by_value : proto::callable
- {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
- {
- typedef
- typename proto::result_of::as_expr<
- typename proto::result_of::arg<Expr>::type
- >::type
- type;
+ result_type operator ()(proto::ignore, proto::ignore, proto::ignore) const
+ {
+ result_type that = {{}};
+ return that;
+ }
         };
-
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &) const
- {
- return proto::as_expr(proto::arg(expr));
- }
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -131,7 +113,7 @@
     struct DeepCopy
       : or_<
             when< terminal<detail::attribute_placeholder<_> >, as_read_attr>
- , when< terminal<_>, by_value >
+ , when< terminal<_>, proto::_deep_copy(_)>
           , otherwise< nary_expr<_, vararg<DeepCopy> > >
>
     {};
@@ -139,14 +121,13 @@
     ///////////////////////////////////////////////////////////////////////////////
     // attr_nbr
     // For an attribute placeholder, return the attribute's slot number.
- struct attr_nbr : proto::callable
+ struct attr_nbr : proto::transform<attr_nbr>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename Expr::proto_arg0::nbr_type::type type;
+ typedef typename impl::expr expr_type;
+ typedef typename expr_type::proto_child0::nbr_type::type result_type;
         };
     };
 
@@ -168,80 +149,91 @@
     ///////////////////////////////////////////////////////////////////////////////
     // max_attr
     // Take the maximum of the current attr slot number and the state.
- struct max_attr : proto::callable
+ struct max_attr : proto::transform<max_attr>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename mpl::max<State, typename MaxAttr::template result<void(Expr, State, Visitor)>::type >::type type;
+ typedef
+ typename mpl::max<
+ typename impl::state
+ , typename MaxAttr::template impl<Expr, State, Data>::result_type
+ >::type
+ result_type;
         };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_attr_matcher
     // turn a1=matcher into attr_matcher<Matcher>(1)
- struct as_attr_matcher : proto::callable
+ struct as_attr_matcher : proto::transform<as_attr_matcher>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
+ typedef typename impl::expr expr_type;
+ typedef typename impl::data data_type;
             typedef
                 detail::attr_matcher<
- typename proto::result_of::arg<typename Expr::proto_arg1>::type
- , typename Visitor::traits_type
- , typename Visitor::icase_type
+ typename proto::result_of::value<typename expr_type::proto_child1>::type
+ , typename data_type::traits_type
+ , typename data_type::icase_type
>
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- return typename result<void(Expr, State, Visitor)>::type(
- Expr::proto_arg0::proto_base_expr::proto_arg0::nbr_type::value
- , proto::arg(proto::right(expr))
- , visitor.traits()
- );
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ return result_type(
+ proto::value(proto::left(expr)).nbr()
+ , proto::value(proto::right(expr))
+ , data.traits()
+ );
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // add_attrs
     // Wrap an expression in attr_begin_matcher/attr_end_matcher pair
- struct add_attrs : proto::callable
+ struct add_attrs : proto::transform<add_attrs>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef
+ detail::attr_begin_matcher<
+ typename MaxAttr::template impl<Expr, mpl::int_<0>, int>::result_type
+ >
+ begin_type;
+
+ typedef typename impl::expr expr_type;
+
+ typedef
                 typename shift_right<
- typename terminal<
- detail::attr_begin_matcher<typename MaxAttr::template result<void(Expr, mpl::int_<0>, int)>::type >
- >::type
+ typename terminal<begin_type>::type
                   , typename shift_right<
                         Expr
                       , terminal<detail::attr_end_matcher>::type
>::type
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &) const
- {
- detail::attr_begin_matcher<typename MaxAttr::template result<void(Expr, mpl::int_<0>, int)>::type > begin;
- detail::attr_end_matcher end;
- typename result<void(Expr, State, Visitor)>::type that = {{begin}, {expr, {end}}};
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ begin_type begin;
+ detail::attr_end_matcher end;
+ result_type that = {{begin}, {expr, {end}}};
+ return that;
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -262,19 +254,20 @@
     // If A and B use attributes, wrap the above expression in
     // a attr_begin_matcher<Count> / attr_end_matcher pair, where Count is
     // the number of attribute slots used by the pattern/action.
- struct as_action : proto::callable
+ struct as_action : proto::transform<as_action>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef typename proto::result_of::left<Expr>::type expr_type;
             typedef typename proto::result_of::right<Expr>::type action_type;
- typedef typename DeepCopy::template result<void(action_type, expr_type, int)>::type action_copy_type;
 
             typedef
- typename InsertMark::template result<void(expr_type, State, Visitor)>::type
+ typename DeepCopy::impl<action_type, expr_type, int>::result_type
+ action_copy_type;
+
+ typedef
+ typename InsertMark::impl<expr_type, State, Data>::result_type
             marked_expr_type;
 
             typedef
@@ -293,35 +286,35 @@
             no_attr_type;
 
             typedef
- typename InsertAttrs::template result<void(no_attr_type, State, Visitor)>::type
- type;
- };
+ typename InsertAttrs::impl<no_attr_type, State, Data>::result_type
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- typedef result<void(Expr, State, Visitor)> apply_type;
- typedef typename apply_type::matcher_type matcher_type;
-
- int dummy = 0;
- typename apply_type::marked_expr_type marked_expr =
- InsertMark()(proto::left(expr), state, visitor);
-
- typename apply_type::no_attr_type that =
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
             {
- marked_expr
- , {
- matcher_type
- (
- DeepCopy()(proto::right(expr), proto::left(expr), dummy)
- , proto::arg(proto::left(marked_expr)).mark_number_
- )
- }
- };
-
- return InsertAttrs()(that, state, visitor);
- }
+ int dummy = 0;
+ marked_expr_type marked_expr =
+ InsertMark::impl<expr_type, State, Data>()(proto::left(expr), state, data);
+
+ no_attr_type that = {
+ marked_expr
+ , {
+ matcher_type(
+ DeepCopy::impl<action_type, expr_type, int>()(
+ proto::right(expr)
+ , proto::left(expr)
+ , dummy
+ )
+ , proto::value(proto::left(marked_expr)).mark_number_
+ )
+ }
+ };
+ return InsertAttrs::impl<no_attr_type, State, Data>()(that, state, data);
+ }
+ };
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/transforms/as_alternate.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_alternate.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_alternate.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -16,7 +16,7 @@
 #include <boost/config.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
 #include <boost/xpressive/detail/core/matcher/alternate_matcher.hpp>
@@ -61,57 +61,69 @@
     {
         ///////////////////////////////////////////////////////////////////////////////
         // in_alternate_list
- template<typename Grammar>
- struct in_alternate_list : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct in_alternate_list : proto::transform<in_alternate_list<Grammar, Callable> >
         {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
             {
- typedef detail::alternates_list<
- typename Grammar::template result<void(Expr, detail::alternate_end_xpression, Visitor)>::type
- , State
- > type;
+ typedef
+ detail::alternates_list<
+ typename Grammar::template impl<
+ Expr
+ , detail::alternate_end_xpression
+ , Data
+ >::result_type
+ , State
+ >
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ return result_type(
+ typename Grammar::template impl<Expr, detail::alternate_end_xpression, Data>()(
+ expr
+ , detail::alternate_end_xpression()
+ , data
+ )
+ , state
+ );
+ }
             };
-
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- return typename result<void(Expr, State, Visitor)>::type(
- Grammar()(expr, detail::alternate_end_xpression(), visitor)
- , state
- );
- }
         };
 
         ///////////////////////////////////////////////////////////////////////////////
         // as_alternate_matcher
- template<typename Grammar>
- struct as_alternate_matcher : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct as_alternate_matcher : proto::transform<as_alternate_matcher<Grammar, Callable> >
         {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
             {
- typedef detail::alternate_matcher<
- typename Grammar::template result<void(Expr, State, Visitor)>::type
- , typename Visitor::traits_type
- > type;
+ typedef typename impl::data data_type;
+ typedef
+ detail::alternate_matcher<
+ typename Grammar::template impl<Expr, State, Data>::result_type
+ , typename data_type::traits_type
+ >
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ return result_type(
+ typename Grammar::template impl<Expr, State, Data>()(expr, state, data)
+ );
+ }
             };
-
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- return typename result<void(Expr, State, Visitor)>::type(
- Grammar()(expr, state, visitor)
- );
- }
         };
-
     }
 
 }}

Modified: trunk/boost/xpressive/detail/static/transforms/as_independent.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_independent.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_independent.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -16,8 +16,11 @@
 #include <boost/mpl/sizeof.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
-#include <boost/xpressive/proto/proto.hpp>
-#include <boost/xpressive/proto/transform.hpp>
+#include <boost/proto/core.hpp>
+#include <boost/proto/transform/arg.hpp>
+#include <boost/proto/transform/when.hpp>
+#include <boost/proto/transform/fold.hpp>
+#include <boost/proto/transform/fold_tree.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
@@ -92,109 +95,119 @@
>
     {};
 
- template<typename Grammar>
- struct as_lookahead : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct as_lookahead : proto::transform<as_lookahead<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename proto::result_of::arg<Expr>::type arg_type;
-
+ typedef typename proto::result_of::child<Expr>::type arg_type;
+
+ typedef
+ typename IndependentEndXpression::impl<arg_type, int, int>::result_type
+ end_xpr_type;
+
             typedef
- typename Grammar::template result<void(
- arg_type
- , typename IndependentEndXpression::result<void(arg_type, int, int)>::type
- , Visitor
- )>::type
+ typename Grammar::template impl<arg_type, end_xpr_type, Data>::result_type
             xpr_type;
- typedef detail::lookahead_matcher<xpr_type> type;
- };
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- typedef result<void(Expr, State, Visitor)> result_type;
- int i = 0;
- return typename result_type::type(
- Grammar()(
- proto::arg(expr)
- , IndependentEndXpression()(proto::arg(expr), i, i)
- , visitor
- )
- , false
- );
- }
+ typedef
+ detail::lookahead_matcher<xpr_type>
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ int i = 0;
+ return result_type(
+ typename Grammar::template impl<arg_type, end_xpr_type, Data>()(
+ proto::child(expr)
+ , IndependentEndXpression::impl<arg_type, int, int>()(proto::child(expr), i, i)
+ , data
+ )
+ , false
+ );
+ }
+ };
     };
 
- template<typename Grammar>
- struct as_lookbehind : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct as_lookbehind : proto::transform<as_lookbehind<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename proto::result_of::arg<Expr>::type arg_type;
+ typedef typename proto::result_of::child<Expr>::type arg_type;
+
             typedef
- typename Grammar::template result<void(
- arg_type
- , typename IndependentEndXpression::result<void(arg_type, int, int)>::type
- , Visitor
- )>::type
+ typename IndependentEndXpression::impl<arg_type, int, int>::result_type
+ end_xpr_type;
+
+ typedef
+ typename Grammar::template impl<arg_type, end_xpr_type, Data>::result_type
             xpr_type;
- typedef detail::lookbehind_matcher<xpr_type> type;
- };
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- typedef typename result<void(Expr, State, Visitor)>::xpr_type xpr_type;
- int i = 0;
- xpr_type const &expr2 = Grammar()(
- proto::arg(expr)
- , IndependentEndXpression()(proto::arg(expr), i, i)
- , visitor
- );
- std::size_t width = expr2.get_width().value();
- return detail::lookbehind_matcher<xpr_type>(expr2, width, false);
- }
+ typedef
+ detail::lookbehind_matcher<xpr_type>
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ int i = 0;
+ xpr_type expr2 = typename Grammar::template impl<arg_type, end_xpr_type, Data>()(
+ proto::child(expr)
+ , IndependentEndXpression::impl<arg_type, int, int>()(proto::child(expr), i, i)
+ , data
+ );
+ std::size_t width = expr2.get_width().value();
+ return result_type(expr2, width, false);
+ }
+ };
     };
 
- template<typename Grammar>
- struct as_keeper : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct as_keeper : proto::transform<as_keeper<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename proto::result_of::arg<Expr>::type arg_type;
- typedef detail::keeper_matcher<
- typename Grammar::template result<void(
- arg_type
- , typename IndependentEndXpression::result<void(arg_type, int, int)>::type
- , Visitor
- )>::type
- > type;
- };
+ typedef typename proto::result_of::child<Expr>::type arg_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- int i = 0;
- return typename result<void(Expr, State, Visitor)>::type(
- Grammar()(
- proto::arg(expr)
- , IndependentEndXpression()(proto::arg(expr), i, i)
- , visitor
- )
- );
- }
+ typedef
+ typename IndependentEndXpression::impl<arg_type, int, int>::result_type
+ end_xpr_type;
+
+ typedef
+ typename Grammar::template impl<arg_type, end_xpr_type, Data>::result_type
+ xpr_type;
+
+ typedef
+ detail::keeper_matcher<xpr_type>
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ int i = 0;
+ return result_type(
+ typename Grammar::template impl<arg_type, end_xpr_type, Data>()(
+ proto::child(expr)
+ , IndependentEndXpression::impl<arg_type, int, int>()(proto::child(expr), i, i)
+ , data
+ )
+ );
+ }
+ };
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/transforms/as_inverse.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_inverse.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_inverse.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -17,7 +17,7 @@
 #include <boost/mpl/not.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 
 #define UNCV(x) typename remove_const<x>::type
 #define UNREF(x) typename remove_reference<x>::type

Modified: trunk/boost/xpressive/detail/static/transforms/as_marker.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_marker.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_marker.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -15,7 +15,7 @@
 
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 
 namespace boost { namespace xpressive { namespace grammar_detail
 {
@@ -23,38 +23,36 @@
     ///////////////////////////////////////////////////////////////////////////////
     // as_marker
     // Insert mark tags before and after the expression
- struct as_marker : proto::callable
+ struct as_marker : proto::transform<as_marker>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef
                 typename shift_right<
                     terminal<detail::mark_begin_matcher>::type
                   , typename shift_right<
- typename proto::result_of::right<Expr>::type
+ typename proto::result_of::right<typename impl::expr>::type
                       , terminal<detail::mark_end_matcher>::type
>::type
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &) const
- {
- int mark_nbr = detail::get_mark_number(proto::left(expr));
- detail::mark_begin_matcher begin(mark_nbr);
- detail::mark_end_matcher end(mark_nbr);
-
- typename result<void(Expr, State, Visitor)>::type that
- = {{begin}, {proto::right(expr), {end}}};
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ int mark_nbr = detail::get_mark_number(proto::left(expr));
+ detail::mark_begin_matcher begin(mark_nbr);
+ detail::mark_end_matcher end(mark_nbr);
+
+ result_type that = {{begin}, {proto::right(expr), {end}}};
+ return that;
+ }
+ };
     };
-
 }}}
 
 #endif

Modified: trunk/boost/xpressive/detail/static/transforms/as_matcher.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_matcher.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_matcher.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -19,26 +19,28 @@
 
 namespace boost { namespace xpressive { namespace grammar_detail
 {
- struct as_matcher : proto::callable
+ struct as_matcher : proto::transform<as_matcher>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
+ typedef typename impl::data data_type;
+
             typedef
- typename Visitor::template apply<
- typename proto::result_of::arg<Expr>::type
+ typename data_type::template apply<
+ typename proto::result_of::value<typename impl::expr>::type
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- return visitor.call(proto::arg(expr));
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ return data.call(proto::value(expr));
+ }
+ };
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/transforms/as_modifier.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_modifier.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_modifier.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -16,7 +16,7 @@
 #include <boost/mpl/sizeof.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 
 #define UNCV(x) typename remove_const<x>::type
 #define UNREF(x) typename remove_reference<x>::type
@@ -36,28 +36,44 @@
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_modifier
- template<typename Grammar>
- struct as_modifier : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct as_modifier : proto::transform<as_modifier<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename proto::result_of::arg<typename proto::result_of::left<Expr>::type>::type modifier_type;
- typedef typename modifier_type::BOOST_NESTED_TEMPLATE apply<Visitor>::type visitor_type;
- typedef typename Grammar::template result<void(typename proto::result_of::right<Expr>::type, State, visitor_type)>::type type;
+ typedef
+ typename proto::result_of::value<
+ typename proto::result_of::left<typename impl::expr>::type
+ >::type
+ modifier_type;
+
+ typedef
+ typename modifier_type::template apply<typename impl::data>::type
+ visitor_type;
+
+ typedef
+ typename proto::result_of::right<Expr>::type
+ expr_type;
+
+ typedef
+ typename Grammar::template impl<expr_type, State, visitor_type &>::result_type
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ visitor_type new_visitor(proto::value(proto::left(expr)).call(data));
+ return typename Grammar::template impl<expr_type, State, visitor_type &>()(
+ proto::right(expr)
+ , state
+ , new_visitor
+ );
+ }
         };
-
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- typedef result<void(Expr, State, Visitor)> result_;
- typedef typename result_::visitor_type new_visitor_type;
- new_visitor_type new_visitor(proto::arg(proto::left(expr)).call(visitor));
- return Grammar()(proto::right(expr), state, new_visitor);
- }
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/transforms/as_quantifier.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_quantifier.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_quantifier.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -17,7 +17,7 @@
 #include <boost/type_traits/is_same.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
@@ -41,7 +41,7 @@
     struct min_type : Tag::min_type {};
 
     template<>
- struct min_type<proto::tag::posit> : mpl::integral_c<uint_t, 1> {};
+ struct min_type<proto::tag::unary_plus> : mpl::integral_c<uint_t, 1> {};
 
     template<>
     struct min_type<proto::tag::dereference> : mpl::integral_c<uint_t, 0> {};
@@ -53,7 +53,7 @@
     struct max_type : Tag::max_type {};
 
     template<>
- struct max_type<proto::tag::posit> : mpl::integral_c<uint_t, UINT_MAX-1> {};
+ struct max_type<proto::tag::unary_plus> : mpl::integral_c<uint_t, UINT_MAX-1> {};
 
     template<>
     struct max_type<proto::tag::dereference> : mpl::integral_c<uint_t, UINT_MAX-1> {};
@@ -63,45 +63,61 @@
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_simple_quantifier
- template<typename Grammar, typename Greedy>
- struct as_simple_quantifier : proto::callable
+ template<typename Grammar, typename Greedy, typename Callable = proto::callable>
+ struct as_simple_quantifier : proto::transform<as_simple_quantifier<Grammar, Greedy, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename proto::result_of::arg<Expr>::type arg_type;
- typedef typename Grammar::template result<void(arg_type, detail::true_xpression, Visitor)>::type xpr_type;
- typedef detail::simple_repeat_matcher<xpr_type, Greedy> matcher_type;
- typedef typename proto::terminal<matcher_type>::type type;
- };
+ typedef
+ typename proto::result_of::child<Expr>::type
+ arg_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- typedef result<void(Expr, State, Visitor)> result_;
- typedef typename result_::arg_type arg_type;
- typedef typename result_::xpr_type xpr_type;
- typedef typename result_::matcher_type matcher_type;
- typedef typename Expr::proto_tag tag;
-
- xpr_type const &xpr = Grammar()(proto::arg(expr), detail::true_xpression(), visitor);
- matcher_type matcher(xpr, (uint_t)min_type<tag>(), (uint_t)max_type<tag>(), xpr.get_width().value());
- return proto::terminal<matcher_type>::type::make(matcher);
- }
+ typedef
+ typename Grammar::template impl<arg_type, detail::true_xpression, Data>::result_type
+ xpr_type;
+
+ typedef
+ detail::simple_repeat_matcher<xpr_type, Greedy>
+ matcher_type;
+
+ typedef
+ typename proto::terminal<matcher_type>::type
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ xpr_type xpr = typename Grammar::template impl<arg_type, detail::true_xpression, Data>()(
+ proto::child(expr)
+ , detail::true_xpression()
+ , data
+ );
+
+ typedef typename impl::expr expr_type;
+ matcher_type matcher(
+ xpr
+ , (uint_t)min_type<typename expr_type::proto_tag>::value
+ , (uint_t)max_type<typename expr_type::proto_tag>::value
+ , xpr.get_width().value()
+ );
+
+ return result_type::make(matcher);
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // add_hidden_mark
- struct add_hidden_mark : proto::callable
+ struct add_hidden_mark : proto::transform<add_hidden_mark>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
+ typedef typename impl::expr expr_type;
             typedef
                 typename shift_right<
                     terminal<detail::mark_begin_matcher>::type
@@ -110,22 +126,23 @@
                       , terminal<detail::mark_end_matcher>::type
>::type
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- // we're inserting a hidden mark ... so grab the next hidden mark number.
- int mark_nbr = visitor.get_hidden_mark();
- detail::mark_begin_matcher begin(mark_nbr);
- detail::mark_end_matcher end(mark_nbr);
-
- typename result<void(Expr, State, Visitor)>::type that
- = {{begin}, {expr, {end}}};
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ // we're inserting a hidden mark ... so grab the next hidden mark number.
+ int mark_nbr = data.get_hidden_mark();
+ detail::mark_begin_matcher begin(mark_nbr);
+ detail::mark_end_matcher end(mark_nbr);
+
+ result_type that = {{begin}, {expr, {end}}};
+ return that;
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -140,15 +157,17 @@
     ///////////////////////////////////////////////////////////////////////////////
     // as_default_quantifier_impl
     template<typename Greedy, uint_t Min, uint_t Max>
- struct as_default_quantifier_impl : proto::callable
+ struct as_default_quantifier_impl : proto::transform<as_default_quantifier_impl<Greedy, Min, Max> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef
- typename InsertMark::template result<void(typename proto::result_of::arg<Expr>::type, State, Visitor)>::type
+ typename proto::result_of::child<Expr>::type
+ xpr_type;
+
+ typedef
+ typename InsertMark::impl<xpr_type, State, Data>::result_type
             marked_sub_type;
 
             typedef
@@ -159,31 +178,33 @@
                       , typename terminal<detail::repeat_end_matcher<Greedy> >::type
>::type
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- // Ensure this sub-expression is book-ended with mark matchers
- typename result<void(Expr, State, Visitor)>::marked_sub_type const &
- marked_sub = InsertMark()(proto::arg(expr), state, visitor);
-
- // Get the mark_number from the begin_mark_matcher
- int mark_number = proto::arg(proto::left(marked_sub)).mark_number_;
- BOOST_ASSERT(0 != mark_number);
-
- uint_t min_ = (uint_t)min_type<typename Expr::proto_tag>();
- uint_t max_ = (uint_t)max_type<typename Expr::proto_tag>();
-
- detail::repeat_begin_matcher begin(mark_number);
- detail::repeat_end_matcher<Greedy> end(mark_number, min_, max_);
-
- typename result<void(Expr, State, Visitor)>::type that
- = {{begin}, {marked_sub, {end}}};
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ // Ensure this sub-expression is book-ended with mark matchers
+ marked_sub_type marked_sub =
+ InsertMark::impl<xpr_type, State, Data>()(proto::child(expr), state, data);
+
+ // Get the mark_number from the begin_mark_matcher
+ int mark_number = proto::value(proto::left(marked_sub)).mark_number_;
+ BOOST_ASSERT(0 != mark_number);
+
+ typedef typename impl::expr expr_type;
+ uint_t min_ = (uint_t)min_type<typename expr_type::proto_tag>();
+ uint_t max_ = (uint_t)max_type<typename expr_type::proto_tag>();
+
+ detail::repeat_begin_matcher begin(mark_number);
+ detail::repeat_end_matcher<Greedy> end(mark_number, min_, max_);
+
+ result_type that = {{begin}, {marked_sub, {end}}};
+ return that;
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -194,56 +215,69 @@
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_default_optional
- template<typename Grammar, typename Greedy>
- struct as_default_optional : proto::callable
+ template<typename Grammar, typename Greedy, typename Callable = proto::callable>
+ struct as_default_optional : proto::transform<as_default_optional<Grammar, Greedy, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef detail::optional_matcher<
- typename Grammar::template result<void(Expr, detail::alternate_end_xpression, Visitor)>::type
- , Greedy
- > type;
- };
+ typedef
+ detail::alternate_end_xpression
+ end_xpr;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- return typename result<void(Expr, State, Visitor)>::type(
- Grammar()(expr, detail::alternate_end_xpression(), visitor)
- );
- }
+ typedef
+ detail::optional_matcher<
+ typename Grammar::template impl<Expr, end_xpr, Data>::result_type
+ , Greedy
+ >
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ return result_type(
+ typename Grammar::template impl<Expr, end_xpr, Data>()(expr, end_xpr(), data)
+ );
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_mark_optional
- template<typename Grammar, typename Greedy>
- struct as_mark_optional : proto::callable
+ template<typename Grammar, typename Greedy, typename Callable = proto::callable>
+ struct as_mark_optional : proto::transform<as_mark_optional<Grammar, Greedy, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef detail::optional_mark_matcher<
- typename Grammar::template result<void(Expr, detail::alternate_end_xpression, Visitor)>::type
- , Greedy
- > type;
- };
+ typedef
+ detail::alternate_end_xpression
+ end_xpr;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- int mark_number = proto::arg(proto::left(expr)).mark_number_;
- return typename result<void(Expr, State, Visitor)>::type(
- Grammar()(expr, detail::alternate_end_xpression(), visitor)
- , mark_number
- );
- }
+ typedef
+ detail::optional_mark_matcher<
+ typename Grammar::template impl<Expr, end_xpr, Data>::result_type
+ , Greedy
+ >
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ int mark_number = proto::value(proto::left(expr)).mark_number_;
+
+ return result_type(
+ typename Grammar::template impl<Expr, end_xpr, Data>()(expr, end_xpr(), data)
+ , mark_number
+ );
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -267,24 +301,30 @@
 
     ///////////////////////////////////////////////////////////////////////////////
     // make_optional_
- template<typename Greedy>
- struct make_optional_ : proto::callable
+ template<typename Greedy, typename Callable = proto::callable>
+ struct make_optional_ : proto::transform<make_optional_<Greedy, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename unary_expr<optional_tag<Greedy>, Expr>::type type;
- };
+ typedef typename impl::expr expr_type;
+ typedef
+ typename unary_expr<
+ optional_tag<Greedy>
+ , Expr
+ >::type
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename unary_expr<optional_tag<Greedy>, Expr>::type
- operator ()(Expr const &expr, State const &, Visitor &) const
- {
- typename unary_expr<optional_tag<Greedy>, Expr>::type that = {expr};
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ result_type that = {expr};
+ return that;
+ }
+ };
     };
 
     ///////////////////////////////////////////////////////////////////////////////
@@ -298,40 +338,39 @@
     // as_default_quantifier_impl
     template<typename Greedy>
     struct as_default_quantifier_impl<Greedy, 0, 1>
- : call<make_optional_<Greedy>(_arg)>
+ : call<make_optional_<Greedy>(_child)>
     {};
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_default_quantifier
- template<typename Greedy>
- struct as_default_quantifier : proto::callable
+ template<typename Greedy, typename Callable = proto::callable>
+ struct as_default_quantifier : proto::transform<as_default_quantifier<Greedy, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
+ typedef typename impl::expr expr_type;
             typedef
                 as_default_quantifier_impl<
                     Greedy
- , min_type<typename Expr::proto_tag>::value
- , max_type<typename Expr::proto_tag>::value
+ , min_type<typename expr_type::proto_tag>::value
+ , max_type<typename expr_type::proto_tag>::value
>
- impl;
+ other;
 
- typedef typename impl::template result<void(Expr, State, Visitor)>::type type;
- };
+ typedef
+ typename other::template impl<Expr, State, Data>::result_type
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- return as_default_quantifier_impl<
- Greedy
- , min_type<typename Expr::proto_tag>::value
- , max_type<typename Expr::proto_tag>::value
- >()(expr, state, visitor);
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ return typename other::template impl<Expr, State, Data>()(expr, state, data);
+ }
+ };
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/transforms/as_sequence.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_sequence.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_sequence.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -20,29 +20,31 @@
 
 namespace boost { namespace xpressive { namespace grammar_detail
 {
- template<typename Grammar>
- struct in_sequence : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct in_sequence : proto::transform<in_sequence<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef detail::static_xpression<
- typename Grammar::template result<void(Expr, State, Visitor)>::type
- , State
- > type;
- };
+ typedef
+ detail::static_xpression<
+ typename Grammar::template impl<Expr, State, Data>::result_type
+ , State
+ >
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &visitor) const
- {
- return typename result<void(Expr, State, Visitor)>::type(
- Grammar()(expr, state, visitor)
- , state
- );
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param data
+ ) const
+ {
+ return result_type(
+ typename Grammar::template impl<Expr, State, Data>()(expr, state, data)
+ , state
+ );
+ }
+ };
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/transforms/as_set.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/transforms/as_set.hpp (original)
+++ trunk/boost/xpressive/detail/static/transforms/as_set.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -14,7 +14,7 @@
 #endif
 
 #include <boost/mpl/assert.hpp>
-#include <boost/xpressive/proto/proto.hpp>
+#include <boost/proto/core.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/static/static.hpp>
 #include <boost/xpressive/detail/utility/chset/chset.hpp>
@@ -64,52 +64,53 @@
     void fill_list_set(Char *&buffer, Expr const &expr, Traits const &traits)
     {
         fill_list_set(buffer, proto::left(expr), traits);
- *buffer++ = traits.translate(detail::char_cast<Char>(proto::arg(proto::right(expr)), traits));
+ *buffer++ = traits.translate(detail::char_cast<Char>(proto::value(proto::right(expr)), traits));
     }
 
     ///////////////////////////////////////////////////////////////////////////////
     // as_list_set_matcher
- template<typename Char>
- struct as_list_set_matcher
+ template<typename Char, typename Callable = proto::callable>
+ struct as_list_set_matcher : proto::transform<as_list_set_matcher<Char, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef detail::set_matcher<
- typename Visitor::traits_type
- , typename ListSet<Char>::template result<void(Expr, State, Visitor)>::type
- > type;
+ typedef typename impl::data data_type;
+ typedef
+ detail::set_matcher<
+ typename data_type::traits_type
+ , typename ListSet<Char>::template impl<Expr, State, Data>::result_type
+ >
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ result_type set;
+ typedef typename impl::data data_type;
+ typename data_type::char_type *buffer = set.set_;
+ fill_list_set(buffer, expr, data.traits());
+ return set;
+ }
         };
-
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- detail::set_matcher<
- typename Visitor::traits_type
- , typename ListSet<Char>::template result<void(Expr, State, Visitor)>::type
- > set;
- typename Visitor::char_type *buffer = set.set_;
- fill_list_set(buffer, expr, visitor.traits());
- return set;
- }
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     // merge_charset
     //
- template<typename Grammar, typename CharSet, typename Visitor>
+ template<typename Grammar, typename CharSet, typename Data>
     struct merge_charset
     {
- typedef typename Visitor::traits_type traits_type;
+ typedef typename Data::traits_type traits_type;
         typedef typename CharSet::char_type char_type;
         typedef typename CharSet::icase_type icase_type;
 
- merge_charset(CharSet &charset, Visitor &visitor)
+ merge_charset(CharSet &charset, Data &data)
           : charset_(charset)
- , visitor_(visitor)
+ , visitor_(data)
         {}
 
         template<typename Expr>
@@ -124,7 +125,13 @@
         template<typename Expr, typename Tag>
         void call_(Expr const &expr, Tag) const
         {
- this->set_(Grammar()(expr, detail::end_xpression(), this->visitor_));
+ this->set_(
+ typename Grammar::template impl<Expr const &, detail::end_xpression, Data &>()(
+ expr
+ , detail::end_xpression()
+ , this->visitor_
+ )
+ );
         }
 
         template<typename Expr>
@@ -166,46 +173,50 @@
         }
 
         CharSet &charset_;
- Visitor &visitor_;
+ Data &visitor_;
     };
 
     ///////////////////////////////////////////////////////////////////////////////
     //
- template<typename Grammar>
- struct as_set_matcher : proto::callable
+ template<typename Grammar, typename Callable = proto::callable>
+ struct as_set_matcher : proto::transform<as_set_matcher<Grammar, Callable> >
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
- typedef typename Visitor::char_type char_type;
+ typedef typename impl::data data_type;
+ typedef typename data_type::char_type char_type;
 
             // if sizeof(char_type)==1, merge everything into a basic_chset
             // BUGBUG this is not optimal.
- typedef typename mpl::if_<
- detail::is_narrow_char<char_type>
- , detail::basic_chset<char_type>
- , detail::compound_charset<typename Visitor::traits_type>
- >::type charset_type;
-
- typedef detail::charset_matcher<
- typename Visitor::traits_type
- , typename Visitor::icase_type
- , charset_type
- > type;
+ typedef
+ typename mpl::if_<
+ detail::is_narrow_char<char_type>
+ , detail::basic_chset<char_type>
+ , detail::compound_charset<typename data_type::traits_type>
+ >::type
+ charset_type;
+
+ typedef
+ detail::charset_matcher<
+ typename data_type::traits_type
+ , typename data_type::icase_type
+ , charset_type
+ >
+ result_type;
+
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param
+ , typename impl::data_param data
+ ) const
+ {
+ result_type matcher;
+ merge_charset<Grammar, result_type, typename impl::data> merge(matcher, data);
+ merge(expr); // Walks the tree and fills in the charset
+ return matcher;
+ }
         };
-
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &, Visitor &visitor) const
- {
- typedef typename result<void(Expr, State, Visitor)>::type set_type;
- set_type matcher;
- merge_charset<Grammar, set_type, Visitor> merge(matcher, visitor);
- merge(expr); // Walks the tree and fills in the charset
- return matcher;
- }
     };
 
 }}}

Modified: trunk/boost/xpressive/detail/static/visitor.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/visitor.hpp (original)
+++ trunk/boost/xpressive/detail/static/visitor.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -14,7 +14,6 @@
 #endif
 
 #include <boost/ref.hpp>
-#include <boost/mpl/bind.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/core/regex_impl.hpp>

Modified: trunk/boost/xpressive/detail/static/width_of.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/width_of.hpp (original)
+++ trunk/boost/xpressive/detail/static/width_of.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -23,10 +23,49 @@
 #include <boost/mpl/equal_to.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
-#include <boost/xpressive/proto/traits.hpp>
+#include <boost/proto/traits.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
+ template<typename Expr, typename Char, typename Tag = typename Expr::proto_tag>
+ struct width_of;
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // add_widths
+ //
+ template<std::size_t N, std::size_t M>
+ struct add_widths
+ : mpl::size_t<N + M>
+ {};
+
+ template<std::size_t M>
+ struct add_widths<unknown_width::value, M>
+ : unknown_width
+ {};
+
+ template<std::size_t N>
+ struct add_widths<N, unknown_width::value>
+ : unknown_width
+ {};
+
+ template<>
+ struct add_widths<unknown_width::value, unknown_width::value>
+ : unknown_width
+ {};
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // or_widths
+ //
+ template<std::size_t N, std::size_t M>
+ struct or_widths
+ : unknown_width
+ {};
+
+ template<std::size_t N>
+ struct or_widths<N, N>
+ : mpl::size_t<N>
+ {};
+
     ///////////////////////////////////////////////////////////////////////////////
     // is_char
     //
@@ -86,43 +125,29 @@
     ///////////////////////////////////////////////////////////////////////////////
     // width_of
     //
- template<typename Expr, typename Char, typename Tag = typename Expr::proto_tag>
+ template<typename Expr, typename Char, typename Tag>
     struct width_of
     {};
 
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::terminal>
- : width_of_terminal<typename proto::result_of::arg<Expr>::type, Char>
+ : width_of_terminal<typename proto::result_of::value<Expr>::type, Char>
     {};
 
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::shift_right>
- : mpl::if_<
- mpl::or_<
- mpl::equal_to<unknown_width, width_of<typename Expr::proto_arg0::proto_base_expr, Char> >
- , mpl::equal_to<unknown_width, width_of<typename Expr::proto_arg1::proto_base_expr, Char> >
- >
- , unknown_width
- , mpl::plus<
- width_of<typename Expr::proto_arg0::proto_base_expr, Char>
- , width_of<typename Expr::proto_arg1::proto_base_expr, Char>
- >
- >::type
+ : add_widths<
+ width_of<typename Expr::proto_child_ref0::proto_base_expr, Char>::value
+ , width_of<typename Expr::proto_child_ref1::proto_base_expr, Char>::value
+ >
     {};
 
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::bitwise_or>
- : mpl::if_<
- mpl::or_<
- mpl::equal_to<unknown_width, width_of<typename Expr::proto_arg0::proto_base_expr, Char> >
- , mpl::not_equal_to<
- width_of<typename Expr::proto_arg0::proto_base_expr, Char>
- , width_of<typename Expr::proto_arg1::proto_base_expr, Char>
- >
- >
- , unknown_width
- , width_of<typename Expr::proto_arg0::proto_base_expr, Char>
- >::type
+ : or_widths<
+ width_of<typename Expr::proto_child_ref0::proto_base_expr, Char>::value
+ , width_of<typename Expr::proto_child_ref1::proto_base_expr, Char>::value
+ >
     {};
 
     template<typename Expr, typename Char, typename Left>
@@ -131,7 +156,7 @@
 
     template<typename Expr, typename Char>
     struct width_of_assign<Expr, Char, mark_placeholder>
- : width_of<typename Expr::proto_arg1::proto_base_expr, Char>
+ : width_of<typename Expr::proto_child_ref1::proto_base_expr, Char>
     {};
 
     template<typename Expr, typename Char>
@@ -147,12 +172,18 @@
     // either (s1 = ...) or (a1 = ...) or (set = ...)
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::assign>
- : width_of_assign<Expr, Char, typename proto::result_of::arg<typename Expr::proto_arg0::proto_base_expr>::type>
+ : width_of_assign<
+ Expr
+ , Char
+ , typename proto::result_of::value<
+ typename Expr::proto_child_ref0::proto_base_expr
+ >::type
+ >
     {};
 
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, modifier_tag>
- : width_of<typename Expr::proto_arg1::proto_base_expr, Char>
+ : width_of<typename Expr::proto_child_ref1::proto_base_expr, Char>
     {};
 
     template<typename Expr, typename Char>
@@ -178,7 +209,7 @@
     };
 
     template<typename Expr, typename Char>
- struct width_of<Expr, Char, proto::tag::posit>
+ struct width_of<Expr, Char, proto::tag::unary_plus>
       : unknown_width
     {};
 
@@ -200,10 +231,10 @@
     template<typename Expr, typename Char, uint_t Count>
     struct width_of<Expr, Char, generic_quant_tag<Count, Count> >
       : mpl::if_<
- mpl::equal_to<unknown_width, width_of<typename Expr::proto_arg0::proto_base_expr, Char> >
+ mpl::equal_to<unknown_width, width_of<typename Expr::proto_child_ref0::proto_base_expr, Char> >
           , unknown_width
           , mpl::times<
- width_of<typename Expr::proto_arg0::proto_base_expr, Char>
+ width_of<typename Expr::proto_child_ref0::proto_base_expr, Char>
               , mpl::size_t<Count>
>
>::type
@@ -211,13 +242,13 @@
 
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::negate>
- : width_of<typename Expr::proto_arg0::proto_base_expr, Char>
+ : width_of<typename Expr::proto_child_ref0::proto_base_expr, Char>
     {};
 
     // when complementing a set or an assertion, the width is that of the set (1) or the assertion (0)
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::complement>
- : width_of<typename Expr::proto_arg0::proto_base_expr, Char>
+ : width_of<typename Expr::proto_child_ref0::proto_base_expr, Char>
     {};
 
     // The comma is used in list-initialized sets, and the width of sets are 1
@@ -238,14 +269,19 @@
       : mpl::size_t<1>
     {
         // If Left is "set" then make sure that Right has a width_of 1
- BOOST_MPL_ASSERT_RELATION(1, ==, (width_of<typename Expr::proto_arg1::proto_base_expr, Char>::value));
+ BOOST_MPL_ASSERT_RELATION(
+ 1
+ , ==
+ , (width_of<typename Expr::proto_child_ref1::proto_base_expr, Char>::value));
     };
 
     template<typename Expr, typename Char>
     struct width_of<Expr, Char, proto::tag::subscript>
- : width_of_subscript<Expr, Char, typename Expr::proto_arg0::proto_base_expr>
+ : width_of_subscript<Expr, Char, typename Expr::proto_child_ref0::proto_base_expr>
     {};
 
 }}} // namespace boost::xpressive::detail
 
+#undef UNREF
+
 #endif

Modified: trunk/boost/xpressive/match_results.hpp
==============================================================================
--- trunk/boost/xpressive/match_results.hpp (original)
+++ trunk/boost/xpressive/match_results.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -57,8 +57,8 @@
 #include <boost/xpressive/detail/utility/literals.hpp>
 #include <boost/xpressive/detail/utility/algorithm.hpp>
 #include <boost/xpressive/detail/utility/counted_base.hpp>
-#include <boost/xpressive/proto/proto_fwd.hpp>
-#include <boost/xpressive/proto/eval.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/eval.hpp>
 
 namespace boost { namespace xpressive { namespace detail
 {
@@ -668,11 +668,11 @@
     {
         typedef typename proto::result_of::left<Arg>::type left_type;
         typedef typename proto::result_of::right<Arg>::type right_type;
- typedef typename proto::result_of::arg<left_type>::type arg_left_type;
- typedef typename proto::result_of::arg<right_type>::type arg_right_type;
+ typedef typename proto::result_of::value<left_type>::type arg_left_type;
+ typedef typename proto::result_of::value<right_type>::type arg_right_type;
         BOOST_MPL_ASSERT((proto::matches<Arg, detail::ActionArgBinding>));
         BOOST_MPL_ASSERT((is_same<typename arg_left_type::type, arg_right_type>));
- this->args_[&typeid(proto::arg(proto::left(arg)))] = &proto::arg(proto::right(arg));
+ this->args_[&typeid(proto::value(proto::left(arg)))] = &proto::value(proto::right(arg));
         return *this;
     }
 

Modified: trunk/boost/xpressive/regex_actions.hpp
==============================================================================
--- trunk/boost/xpressive/regex_actions.hpp (original)
+++ trunk/boost/xpressive/regex_actions.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -19,7 +19,6 @@
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/or.hpp>
 #include <boost/mpl/int.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/utility/enable_if.hpp>
@@ -41,7 +40,8 @@
 
 // Doxygen can't handle proto :-(
 #ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
-# include <boost/xpressive/proto/transform.hpp>
+# include <boost/proto/transform/arg.hpp>
+# include <boost/proto/transform/when.hpp>
 # include <boost/xpressive/detail/core/matcher/action_matcher.hpp>
 #endif
 
@@ -98,10 +98,10 @@
         {
             typedef int result_type;
 
- template<typename Visitor, typename Expr>
- int operator ()(Visitor &visitor, Expr const &expr) const
+ template<typename Data, typename Expr>
+ int operator ()(Data &data, Expr const &expr) const
             {
- visitor.let(expr);
+ data.let(expr);
                 return 0;
             }
         };
@@ -118,7 +118,7 @@
>
               , proto::function<
                     proto::_state // no-op
- , proto::vararg<proto::call<BindArg(proto::_visitor, proto::_)> >
+ , proto::vararg<proto::call<BindArg(proto::_data, proto::_)> >
>
>
         {};
@@ -130,14 +130,18 @@
         template<typename Expr>
         struct let_
         {
- BOOST_PROTO_EXTENDS(Expr, let_<Expr>, let_domain)
- BOOST_PROTO_EXTENDS_FUNCTION(Expr, let_<Expr>, let_domain)
+ BOOST_PROTO_BASIC_EXTENDS(Expr, let_<Expr>, let_domain)
+ BOOST_PROTO_EXTENDS_FUNCTION()
         };
 
         template<typename Args, typename BidiIter>
         void bind_args(let_<Args> const &args, match_results<BidiIter> &what)
         {
- BindArgs()(args, 0, what);
+ BindArgs::impl<let_<Args> const &, int, match_results<BidiIter> &>()(
+ args
+ , 0
+ , what
+ );
         }
 
         template<typename BidiIter>
@@ -679,12 +683,12 @@
 
         T &get()
         {
- return proto::arg(*this);
+ return proto::value(*this);
         }
 
         T const &get() const
         {
- return proto::arg(*this);
+ return proto::value(*this);
         }
     };
 
@@ -702,27 +706,24 @@
 
         T &get() const
         {
- return proto::arg(*this).get();
+ return proto::value(*this).get();
         }
     };
 
     template<typename T>
     struct local
- : private noncopyable
- , detail::value_wrapper<T>
+ : detail::value_wrapper<T>
       , proto::terminal<reference_wrapper<T> >::type
     {
         typedef typename proto::terminal<reference_wrapper<T> >::type base_type;
 
         local()
- : noncopyable()
- , detail::value_wrapper<T>()
+ : detail::value_wrapper<T>()
           , base_type(base_type::make(boost::ref(detail::value_wrapper<T>::value)))
         {}
 
         explicit local(T const &t)
- : noncopyable()
- , detail::value_wrapper<T>(t)
+ : detail::value_wrapper<T>(t)
           , base_type(base_type::make(boost::ref(detail::value_wrapper<T>::value)))
         {}
 
@@ -730,13 +731,16 @@
 
         T &get()
         {
- return proto::arg(*this);
+ return proto::value(*this);
         }
 
         T const &get() const
         {
- return proto::arg(*this);
+ return proto::value(*this);
         }
+
+ private:
+ local(local const &);
     };
 
     /// as (a.k.a., lexical_cast)
@@ -821,9 +825,6 @@
         typedef typename proto::terminal<detail::action_arg<T, mpl::int_<I> > >::type action_arg_type;
 
         BOOST_PROTO_EXTENDS(action_arg_type, this_type, proto::default_domain)
- BOOST_PROTO_EXTENDS_ASSIGN(action_arg_type, this_type, proto::default_domain)
- BOOST_PROTO_EXTENDS_SUBSCRIPT(action_arg_type, this_type, proto::default_domain)
- BOOST_PROTO_EXTENDS_FUNCTION(action_arg_type, this_type, proto::default_domain)
     };
 
     /// Usage: construct\<Type\>(arg1, arg2)

Modified: trunk/boost/xpressive/regex_algorithms.hpp
==============================================================================
--- trunk/boost/xpressive/regex_algorithms.hpp (original)
+++ trunk/boost/xpressive/regex_algorithms.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -51,7 +51,7 @@
 /// \param end The end of the sequence.
 /// \param what The \c match_results struct into which the sub_matches will be written
 /// \param re The regular expression object to use
-/// \param flags Optional match flags, used to control how the expression is matched
+/// \param flags Optional match flags, used to control how the expression is matched
 /// against the sequence. (See \c match_flag_type.)
 /// \return \c true if a match is found, \c false otherwise
 /// \throw \c regex_error on stack exhaustion
@@ -569,7 +569,7 @@
 ///
 /// \pre Type \c BidiIter meets the requirements of a Bidirectional Iterator (24.1.4).
 /// \pre Type \c OutIter meets the requirements of an Output Iterator (24.1.2).
-/// \pre Type \c Formatter models \c ForwardRange, <tt>Callable\<match_results\<BidiIter\> \></tt>,
+/// \pre Type \c Formatter models \c ForwardRange, <tt>Callable\<match_results\<BidiIter\> \></tt>,
 /// <tt>Callable\<match_results\<BidiIter\>, OutIter\></tt>, or
 /// <tt>Callable\<match_results\<BidiIter\>, OutIter, regex_constants::match_flag_type\></tt>;
 /// or else it is a null-terminated format string, or an expression template

Modified: trunk/boost/xpressive/regex_primitives.hpp
==============================================================================
--- trunk/boost/xpressive/regex_primitives.hpp (original)
+++ trunk/boost/xpressive/regex_primitives.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -24,8 +24,9 @@
 
 // Doxygen can't handle proto :-(
 #ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
-# include <boost/xpressive/proto/proto.hpp>
-# include <boost/xpressive/proto/transform.hpp>
+# include <boost/proto/core.hpp>
+# include <boost/proto/transform/arg.hpp>
+# include <boost/proto/transform/when.hpp>
 # include <boost/xpressive/detail/core/icase.hpp>
 # include <boost/xpressive/detail/static/compile.hpp>
 # include <boost/xpressive/detail/static/modifier.hpp>
@@ -46,7 +47,7 @@
             // Marks numbers must be integers greater than 0.
             BOOST_ASSERT(mark_nbr > 0);
             mark_placeholder mark = {mark_nbr};
- proto::arg(*this) = mark;
+ proto::value(*this) = mark;
         }
 
         operator basic_mark_tag const &() const
@@ -92,8 +93,8 @@
     // s1 or -s1
     struct SubMatch
       : proto::or_<
- proto::when<basic_mark_tag, push_back(proto::_visitor, mark_number(proto::_arg)) >
- , proto::when<proto::negate<basic_mark_tag>, push_back(proto::_visitor, minus_one()) >
+ proto::when<basic_mark_tag, push_back(proto::_data, mark_number(proto::_value)) >
+ , proto::when<proto::negate<basic_mark_tag>, push_back(proto::_data, minus_one()) >
>
     {};
 
@@ -119,12 +120,10 @@
     #endif
 
     // replace "Expr" with "keep(*State) >> Expr"
- struct skip_primitives : proto::callable
+ struct skip_primitives : proto::transform<skip_primitives>
     {
- template<typename Sig> struct result {};
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
+ template<typename Expr, typename State, typename Data>
+ struct impl : proto::transform_impl<Expr, State, Data>
         {
             typedef
                 typename proto::shift_right<
@@ -134,17 +133,18 @@
>::type
                   , Expr
>::type
- type;
- };
+ result_type;
 
- template<typename Expr, typename State, typename Visitor>
- typename result<void(Expr, State, Visitor)>::type
- operator ()(Expr const &expr, State const &state, Visitor &) const
- {
- typedef typename result<void(Expr, State, Visitor)>::type type;
- type that = {{{state}}, expr};
- return that;
- }
+ result_type operator ()(
+ typename impl::expr_param expr
+ , typename impl::state_param state
+ , typename impl::data_param
+ ) const
+ {
+ result_type that = {{{state}}, expr};
+ return that;
+ }
+ };
     };
 
     struct Primitives
@@ -185,12 +185,16 @@
         struct result<This(Expr)>
         {
             typedef
+ SkipGrammar::impl<
+ typename proto::result_of::as_expr<Expr>::type
+ , skip_type const &
+ , mpl::void_ &
+ >
+ skip_transform;
+
+ typedef
                 typename proto::shift_right<
- typename SkipGrammar::result<void(
- typename proto::result_of::as_expr<Expr>::type
- , skip_type
- , mpl::void_
- )>::type
+ typename skip_transform::result_type
                   , typename proto::dereference<skip_type>::type
>::type
             type;
@@ -201,9 +205,12 @@
         operator ()(Expr const &expr) const
         {
             mpl::void_ ignore;
- typedef typename result<skip_directive(Expr)>::type result_type;
- result_type result = {SkipGrammar()(proto::as_expr(expr), this->skip_, ignore), {skip_}};
- return result;
+ typedef result<skip_directive(Expr)> result_fun;
+ typename result_fun::type that = {
+ typename result_fun::skip_transform()(proto::as_expr(expr), this->skip_, ignore)
+ , {skip_}
+ };
+ return that;
         }
 
     private:

Modified: trunk/boost/xpressive/xpressive_fwd.hpp
==============================================================================
--- trunk/boost/xpressive/xpressive_fwd.hpp (original)
+++ trunk/boost/xpressive/xpressive_fwd.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -50,8 +50,8 @@
 # endif
 #endif
 
-#include <boost/xpressive/proto/proto_fwd.hpp>
-#include <boost/xpressive/proto/traits.hpp>
+#include <boost/proto/proto_fwd.hpp>
+#include <boost/proto/traits.hpp>
 
 namespace boost { namespace xpressive
 {

Modified: trunk/boost/xpressive/xpressive_typeof.hpp
==============================================================================
--- trunk/boost/xpressive/xpressive_typeof.hpp (original)
+++ trunk/boost/xpressive/xpressive_typeof.hpp 2008-11-05 23:43:14 EST (Wed, 05 Nov 2008)
@@ -19,7 +19,7 @@
 #ifndef BOOST_NO_STL_LOCALE
 # include <boost/typeof/std/locale.hpp>
 #endif
-#include <boost/xpressive/proto/proto_typeof.hpp>
+#include <boost/proto/proto_typeof.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk