Boost logo

Boost-Commit :

From: joel_at_[hidden]
Date: 2007-10-23 21:26:11


Author: djowel
Date: 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
New Revision: 40387
URL: http://svn.boost.org/trac/boost/changeset/40387

Log:
updates
Text files modified:
   branches/fusion/2_1/boost/xpressive/detail/core/action.hpp | 6 +--
   branches/fusion/2_1/boost/xpressive/detail/core/matcher/action_matcher.hpp | 64 +++++++++++++++++++++++++++++----------
   branches/fusion/2_1/boost/xpressive/detail/core/matcher/end_matcher.hpp | 2
   branches/fusion/2_1/boost/xpressive/detail/core/state.hpp | 4 +-
   branches/fusion/2_1/boost/xpressive/detail/detail_fwd.hpp | 34 ++++++++++++++++++++
   branches/fusion/2_1/boost/xpressive/detail/static/transforms/as_independent.hpp | 8 +++++
   branches/fusion/2_1/boost/xpressive/proto/fusion.hpp | 9 +---
   branches/fusion/2_1/boost/xpressive/proto/make_expr.hpp | 4 +-
   branches/fusion/2_1/boost/xpressive/proto/proto_typeof.hpp | 1
   branches/fusion/2_1/boost/xpressive/regex_actions.hpp | 16 ++++++++-
   branches/fusion/2_1/boost/xpressive/xpressive_fwd.hpp | 12 +++++++
   branches/fusion/2_1/boost/xpressive/xpressive_typeof.hpp | 46 ++++++++++++++++++++++++++--
   12 files changed, 167 insertions(+), 39 deletions(-)

Modified: branches/fusion/2_1/boost/xpressive/detail/core/action.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/detail/core/action.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/detail/core/action.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -21,7 +21,6 @@
     ///////////////////////////////////////////////////////////////////////////////
     // actionable
     //
- template<typename BidiIter>
     struct actionable
     {
         virtual ~actionable() {}
@@ -29,10 +28,9 @@
 
         actionable()
           : next(0)
- {
- }
+ {}
 
- actionable<BidiIter> const *next;
+ actionable const *next;
     };
 
 }}} // namespace boost::xpressive::detail

Modified: branches/fusion/2_1/boost/xpressive/detail/core/matcher/action_matcher.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/detail/core/matcher/action_matcher.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/detail/core/matcher/action_matcher.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -40,24 +40,28 @@
 {
 
     #if BOOST_VERSION >= 103500
+ struct DataMember
+ : proto::mem_ptr<proto::_, proto::terminal<proto::_> >
+ {};
+
+ 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>
+ {};
+
     ///////////////////////////////////////////////////////////////////////////////
     // mem_ptr_eval
     // Rewrites expressions of the form x->*foo(a) into foo(x, a) and then
     // evaluates them.
- template<typename Expr, typename Context>
+ template<typename Expr, typename Context, bool IsDataMember = proto::matches<Expr, DataMember>::value>
     struct mem_ptr_eval
     {
- typedef typename remove_reference<typename mpl::if_<
- is_const<Expr>
- , typename proto::result_of::right<Expr>::const_reference
- , typename proto::result_of::right<Expr>::reference
- >::type>::type right_type;
-
- typedef typename remove_reference<typename mpl::if_<
- is_const<Expr>
- , typename proto::result_of::left<Expr>::const_reference
- , typename proto::result_of::left<Expr>::reference
- >::type>::type left_type;
+ typedef typename child_<Expr, 0>::type left_type;
+ typedef typename child_<Expr, 1>::type right_type;
 
         typedef
             typename proto::result_of::arg<
@@ -90,6 +94,32 @@
             );
         }
     };
+
+ ///////////////////////////////////////////////////////////////////////////////
+ // mem_ptr_eval
+ // Rewrites expressions of the form x->*foo into foo(x) and then
+ // evaluates them.
+ template<typename Expr, typename Context>
+ struct mem_ptr_eval<Expr, Context, true>
+ {
+ typedef typename child_<Expr, 0>::type left_type;
+ typedef typename child_<Expr, 1>::type right_type;
+
+ typedef
+ typename proto::result_of::arg<right_type>::type
+ function_type;
+
+ typedef typename boost::result_of<
+ function_type(typename proto::result_of::eval<left_type, Context>::type)
+ >::type result_type;
+
+ result_type operator()(Expr &expr, Context &ctx) const
+ {
+ return proto::arg(proto::right(expr))(
+ proto::eval(proto::left(expr), ctx)
+ );
+ }
+ };
     #endif
 
     struct attr_with_default_tag
@@ -202,12 +232,12 @@
     ///////////////////////////////////////////////////////////////////////////////
     // action
     //
- template<typename BidiIter, typename Actor>
+ template<typename Actor>
     struct action
- : actionable<BidiIter>
+ : actionable
     {
         action(Actor const &actor)
- : actionable<BidiIter>()
+ : actionable()
           , actor_(actor)
         {
         }
@@ -407,10 +437,10 @@
         {
             // Bind the arguments
             typedef typename BindActionArgs::apply<Actor, match_state<BidiIter>, int>::type action_type;
- action<BidiIter, action_type> actor(BindActionArgs::call(this->actor_, state, this->sub_));
+ action<action_type> actor(BindActionArgs::call(this->actor_, state, this->sub_));
 
             // Put the action in the action list
- actionable<BidiIter> const **action_list_tail = state.action_list_tail_;
+ actionable const **action_list_tail = state.action_list_tail_;
             *state.action_list_tail_ = &actor;
             state.action_list_tail_ = &actor.next;
 

Modified: branches/fusion/2_1/boost/xpressive/detail/core/matcher/end_matcher.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/detail/core/matcher/end_matcher.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/detail/core/matcher/end_matcher.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -65,7 +65,7 @@
             s0.matched = true;
 
             // Now execute any actions that have been queued
- for(actionable<BidiIter> const *actor = state.action_list_.next; 0 != actor; actor = actor->next)
+ for(actionable const *actor = state.action_list_.next; 0 != actor; actor = actor->next)
             {
                 actor->execute(state.action_args_);
             }

Modified: branches/fusion/2_1/boost/xpressive/detail/core/state.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/detail/core/state.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/detail/core/state.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -110,7 +110,7 @@
     typedef detail::matchable<BidiIter> matchable;
     typedef xpressive::match_results<BidiIter> match_results;
     typedef detail::sub_match_impl<BidiIter> sub_match_impl;
- typedef detail::actionable<BidiIter> actionable;
+ typedef detail::actionable actionable;
 
     BidiIter cur_;
     sub_match_impl *sub_matches_;
@@ -314,7 +314,7 @@
 {
     sub_match_impl<BidiIter> *old_sub_matches_;
     std::size_t nested_results_count_;
- actionable<BidiIter> const **action_list_tail_;
+ actionable const **action_list_tail_;
     attr_context attr_context_;
 };
 

Modified: branches/fusion/2_1/boost/xpressive/detail/detail_fwd.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/detail/detail_fwd.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/detail/detail_fwd.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -296,7 +296,6 @@
     template<typename T, typename U>
     struct action_arg;
 
- template<typename BidiIter>
     struct actionable;
 
     template<typename Char>
@@ -387,6 +386,39 @@
 
 }}} // namespace boost::xpressive::detail
 
+namespace boost { namespace xpressive { namespace op
+{
+ struct push;
+ struct push_back;
+ struct pop;
+ struct push_front;
+ struct pop_back;
+ struct pop_front;
+ struct back;
+ struct front;
+ struct top;
+ struct first;
+ struct second;
+ struct matched;
+ struct length;
+ struct str;
+ struct insert;
+ struct make_pair;
+
+ template<typename T>
+ struct as;
+ template<typename T>
+ struct static_cast_;
+ template<typename T>
+ struct dynamic_cast_;
+ template<typename T>
+ struct const_cast_;
+ template<typename T>
+ struct construct;
+ template<typename T>
+ struct throw_;
+}}} // namespace boost::xpressive::op
+
 /// INTERNAL ONLY
 namespace boost { namespace xpressive
 {

Modified: branches/fusion/2_1/boost/xpressive/detail/static/transforms/as_independent.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/detail/static/transforms/as_independent.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/detail/static/transforms/as_independent.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -21,6 +21,14 @@
 
 namespace boost { namespace xpressive { namespace detail
 {
+ struct keeper_tag
+ {};
+
+ struct lookahead_tag
+ {};
+
+ struct lookbehind_tag
+ {};
 
     template<typename Grammar>
     struct as_lookahead

Modified: branches/fusion/2_1/boost/xpressive/proto/fusion.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/proto/fusion.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/proto/fusion.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -86,14 +86,11 @@
 
         template<typename This, typename Expr>
         struct result<This(Expr)>
- {
- typedef
- typename Context::template eval<UNREF(Expr)>::result_type
- type;
- };
+ : proto::result_of::eval<UNREF(Expr), Context>
+ {};
 
         template<typename Expr>
- typename result<eval_fun(Expr)>::type
+ typename proto::result_of::eval<Expr, Context>::type
         operator()(Expr &expr) const
         {
             return proto::eval(expr, this->ctx_);

Modified: branches/fusion/2_1/boost/xpressive/proto/make_expr.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/proto/make_expr.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/proto/make_expr.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -241,8 +241,8 @@
                     BOOST_PROTO_VARARG_TEMPLATE_, ~ \
                   , BOOST_PP_SEQ_PUSH_FRONT( \
                         BOOST_PROTO_SEQ_PUSH_FRONT( \
- BOOST_PP_TUPLE_ELEM(4, 2, DATA)\
- , (BOOST_PP_TUPLE_ELEM(4, 3, DATA))\
+ BOOST_PP_TUPLE_ELEM(4, 2, DATA) \
+ , (BOOST_PP_TUPLE_ELEM(4, 3, DATA)) \
                         ) \
                       , BOOST_PP_TUPLE_ELEM(4, 1, DATA) \
                     ) \

Modified: branches/fusion/2_1/boost/xpressive/proto/proto_typeof.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/proto/proto_typeof.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/proto/proto_typeof.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -64,6 +64,7 @@
 BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::if_else_)
 BOOST_TYPEOF_REGISTER_TYPE(boost::proto::tag::function)
 
+BOOST_TYPEOF_REGISTER_TYPE(boost::proto::exprns_::is_proto_expr)
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::refns_::ref_, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::exprns_::expr, (typename)(typename)(long))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::utility::literal, (typename)(typename))

Modified: branches/fusion/2_1/boost/xpressive/regex_actions.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/regex_actions.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/regex_actions.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -32,7 +32,10 @@
 #include <boost/xpressive/detail/core/matcher/attr_begin_matcher.hpp>
 #include <boost/xpressive/detail/core/matcher/predicate_matcher.hpp>
 #include <boost/xpressive/detail/utility/ignore_unused.hpp>
-#include <boost/typeof/std/string.hpp> // very often needed by client code.
+
+// These are very often needed by client code.
+#include <boost/typeof/std/map.hpp>
+#include <boost/typeof/std/string.hpp>
 
 // Doxygen can't handle proto :-(
 #ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
@@ -720,18 +723,24 @@
       , ((op::const_cast_)(typename))
     )
 
+ /// val()
+ ///
     template<typename T>
     value<T> const val(T const &t)
     {
         return value<T>(t);
     }
 
+ /// ref()
+ ///
     template<typename T>
     reference<T> const ref(T &t)
     {
         return reference<T>(t);
     }
 
+ /// cref()
+ ///
     template<typename T>
     reference<T const> const cref(T const &t)
     {
@@ -746,7 +755,10 @@
     ///
     detail::let_<proto::terminal<detail::let_tag>::type> const let = {{{}}};
 
- template<typename T, int I = 0, typename Dummy = proto::is_proto_expr>
+ /// placeholder<T>, for defining a placeholder to stand in fo
+ /// a variable of type T in a semantic action.
+ ///
+ template<typename T, int I, typename Dummy>
     struct placeholder
     {
         typedef placeholder<T, I, Dummy> this_type;

Modified: branches/fusion/2_1/boost/xpressive/xpressive_fwd.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/xpressive_fwd.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/xpressive_fwd.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -133,6 +133,18 @@
>
     struct regex_compiler;
 
+ template<typename T>
+ struct value;
+
+ template<typename T>
+ struct reference;
+
+ template<typename T>
+ struct local;
+
+ template<typename T, int I = 0, typename Dummy = proto::is_proto_expr>
+ struct placeholder;
+
     ///////////////////////////////////////////////////////////////////////////////
     // Common typedefs
     //

Modified: branches/fusion/2_1/boost/xpressive/xpressive_typeof.hpp
==============================================================================
--- branches/fusion/2_1/boost/xpressive/xpressive_typeof.hpp (original)
+++ branches/fusion/2_1/boost/xpressive/xpressive_typeof.hpp 2007-10-23 21:26:10 EDT (Tue, 23 Oct 2007)
@@ -20,7 +20,7 @@
 # include <boost/typeof/std/locale.hpp>
 #endif
 #include <boost/xpressive/proto/proto_typeof.hpp>
-#include <boost/xpressive/xpressive_fwd.hpp>
+#include <boost/xpressive/detail/detail_fwd.hpp>
 
 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
 
@@ -34,6 +34,15 @@
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::lookbehind_tag)
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::generic_quant_tag, (unsigned int)(unsigned int))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::basic_regex, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::word_boundary, (bool))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::value, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::reference, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::local, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::placeholder, (typename)(int)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::tracking_ptr, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::regex_impl, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::let_, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::action_arg, (typename)(typename))
 
 ///////////////////////////////////////////////////////////////////////////////
 // Placeholders
@@ -44,11 +53,9 @@
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::assert_eol_placeholder)
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::logical_newline_placeholder)
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::self_placeholder)
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::string_placeholder, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::assert_word_placeholder, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::range_placeholder, (typename))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::regex_placeholder, (typename)(bool))
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::literal_placeholder, (typename)(bool))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::attribute_placeholder, (typename))
 
 ///////////////////////////////////////////////////////////////////////////////
 // Matchers
@@ -63,6 +70,7 @@
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::mark_end_matcher)
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::repeat_begin_matcher)
 BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::alternate_end_matcher)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::detail::attr_end_matcher)
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::assert_bol_matcher, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::assert_eol_matcher, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::literal_matcher, (typename)(bool)(bool))
@@ -84,6 +92,36 @@
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::lookahead_matcher, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::lookbehind_matcher, (typename))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::set_matcher, (typename)(int))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::predicate_matcher, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::action_matcher, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::attr_matcher, (typename)(typename)(bool))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::detail::attr_begin_matcher, (typename))
+
+///////////////////////////////////////////////////////////////////////////////
+// Ops
+//
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::push)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::push_back)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::pop)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::push_front)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::pop_back)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::pop_front)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::back)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::front)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::top)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::first)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::second)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::matched)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::length)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::str)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::insert)
+BOOST_TYPEOF_REGISTER_TYPE(boost::xpressive::op::make_pair)
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::op::as, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::op::static_cast_, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::op::dynamic_cast_, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::op::const_cast_, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::op::construct, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::xpressive::op::throw_, (typename))
 
 ///////////////////////////////////////////////////////////////////////////////
 // Modifiers


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