Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58323 - in trunk/boost/xpressive: . detail detail/core
From: eric_at_[hidden]
Date: 2009-12-12 05:23:03


Author: eric_niebler
Date: 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
New Revision: 58323
URL: http://svn.boost.org/trac/boost/changeset/58323

Log:
eliminate gcc warning in mark_tag constructor, code reorg, references #3734
Added:
   trunk/boost/xpressive/detail/core/regex_domain.hpp (contents, props changed)
Text files modified:
   trunk/boost/xpressive/basic_regex.hpp | 19 +++++--------------
   trunk/boost/xpressive/detail/core/access.hpp | 1 +
   trunk/boost/xpressive/detail/detail_fwd.hpp | 4 ++--
   trunk/boost/xpressive/match_results.hpp | 8 ++++++--
   trunk/boost/xpressive/regex_primitives.hpp | 19 ++++++++++++++-----
   trunk/boost/xpressive/xpressive_fwd.hpp | 5 +++--
   6 files changed, 31 insertions(+), 25 deletions(-)

Modified: trunk/boost/xpressive/basic_regex.hpp
==============================================================================
--- trunk/boost/xpressive/basic_regex.hpp (original)
+++ trunk/boost/xpressive/basic_regex.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -17,13 +17,11 @@
 
 #include <boost/config.hpp>
 #include <boost/mpl/bool.hpp>
-#include <boost/proto/traits.hpp>
-#include <boost/proto/domain.hpp>
-#include <boost/proto/generate.hpp>
 #include <boost/xpressive/xpressive_fwd.hpp>
 #include <boost/xpressive/regex_constants.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/core/regex_impl.hpp>
+#include <boost/xpressive/detail/core/regex_domain.hpp>
 
 // Doxygen can't handle proto :-(
 #ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
@@ -45,10 +43,6 @@
     {
         BOOST_XPR_ENSURE_(!stack_error, regex_constants::error_stack, "Regex stack space exhausted");
     }
-
- struct basic_regex_domain
- : proto::domain<proto::default_generator, proto::not_<proto::address_of<proto::_> > >
- {};
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -58,14 +52,14 @@
 template<typename BidiIter>
 struct basic_regex
   : proto::extends<
- typename proto::terminal<detail::tracking_ptr<detail::regex_impl<BidiIter> > >::type
+ proto::expr<proto::tag::terminal, proto::term<detail::tracking_ptr<detail::regex_impl<BidiIter> > >, 0>
       , basic_regex<BidiIter>
- , detail::basic_regex_domain
+ , detail::regex_domain
>
 {
 private:
- typedef typename proto::terminal<detail::tracking_ptr<detail::regex_impl<BidiIter> > >::type pimpl_type;
- typedef proto::extends<pimpl_type, basic_regex<BidiIter>, detail::basic_regex_domain > base_type;
+ typedef proto::expr<proto::tag::terminal, proto::term<detail::tracking_ptr<detail::regex_impl<BidiIter> > >, 0> pimpl_type;
+ typedef proto::extends<pimpl_type, basic_regex<BidiIter>, detail::regex_domain> base_type;
 
 public:
     typedef BidiIter iterator_type;
@@ -264,9 +258,6 @@
     void compile_(Expr const &, mpl::false_)
     {
     }
-
- /// INTERNAL ONLY
- void dump_(std::ostream &sout) const;
 };
 
 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION

Modified: trunk/boost/xpressive/detail/core/access.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/access.hpp (original)
+++ trunk/boost/xpressive/detail/core/access.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -15,6 +15,7 @@
 
 #include <vector>
 #include <boost/shared_ptr.hpp>
+#include <boost/proto/traits.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/dynamic/matchable.hpp>
 #include <boost/xpressive/match_results.hpp> // for type_info_less

Added: trunk/boost/xpressive/detail/core/regex_domain.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/xpressive/detail/core/regex_domain.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+/// \file regex_domain.hpp
+/// Contains the definition of the regex_domain type
+//
+// Copyright 2009 Eric Niebler. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_XPRESSIVE_DETAIL_CORE_REGEX_DOMAIN_HPP_EAN_12_12_2009
+#define BOOST_XPRESSIVE_DETAIL_CORE_REGEX_DOMAIN_HPP_EAN_12_12_2009
+
+#include <boost/xpressive/xpressive_fwd.hpp>
+#include <boost/proto/traits.hpp>
+#include <boost/proto/domain.hpp>
+#include <boost/proto/generate.hpp>
+
+namespace boost { namespace xpressive { namespace detail
+{
+ struct regex_domain
+ : proto::domain<proto::default_generator, proto::not_<proto::address_of<proto::_> > >
+ {};
+}}}
+
+#endif

Modified: trunk/boost/xpressive/detail/detail_fwd.hpp
==============================================================================
--- trunk/boost/xpressive/detail/detail_fwd.hpp (original)
+++ trunk/boost/xpressive/detail/detail_fwd.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -212,11 +212,11 @@
     template<typename Traits>
     struct logical_newline_matcher;
 
- typedef proto::terminal<logical_newline_placeholder>::type logical_newline_xpression;
+ typedef proto::expr<proto::tag::terminal, proto::term<logical_newline_placeholder>, 0> logical_newline_xpression;
 
     struct set_initializer;
 
- typedef proto::terminal<set_initializer>::type set_initializer_type;
+ typedef proto::expr<proto::tag::terminal, proto::term<set_initializer>, 0> set_initializer_type;
 
     struct lookahead_tag;
 

Modified: trunk/boost/xpressive/match_results.hpp
==============================================================================
--- trunk/boost/xpressive/match_results.hpp (original)
+++ trunk/boost/xpressive/match_results.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -58,8 +58,12 @@
 #include <boost/xpressive/detail/utility/literals.hpp>
 #include <boost/xpressive/detail/utility/algorithm.hpp>
 #include <boost/xpressive/detail/utility/counted_base.hpp>
-#include <boost/proto/proto_fwd.hpp>
-#include <boost/proto/eval.hpp>
+// Doxygen can't handle proto :-(
+#ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
+# include <boost/proto/proto_fwd.hpp>
+# include <boost/proto/traits.hpp>
+# include <boost/proto/eval.hpp>
+#endif
 
 namespace boost { namespace xpressive { namespace detail
 {

Modified: trunk/boost/xpressive/regex_primitives.hpp
==============================================================================
--- trunk/boost/xpressive/regex_primitives.hpp (original)
+++ trunk/boost/xpressive/regex_primitives.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -20,6 +20,7 @@
 #include <boost/preprocessor/cat.hpp>
 #include <boost/xpressive/detail/detail_fwd.hpp>
 #include <boost/xpressive/detail/core/matchers.hpp>
+#include <boost/xpressive/detail/core/regex_domain.hpp>
 #include <boost/xpressive/detail/utility/ignore_unused.hpp>
 
 // Doxygen can't handle proto :-(
@@ -536,16 +537,24 @@
 /// can be used to index into the <tt>match_results\<\></tt> object to retrieve the
 /// corresponding sub-match.
 struct mark_tag
- : proto::extends<detail::basic_mark_tag, mark_tag>
+ : proto::extends<detail::basic_mark_tag, mark_tag, detail::regex_domain>
 {
+private:
+ typedef proto::extends<detail::basic_mark_tag, mark_tag, detail::regex_domain> base_type;
+
+ static detail::basic_mark_tag make_tag(int mark_nbr)
+ {
+ detail::basic_mark_tag mark = {{mark_nbr}};
+ return mark;
+ }
+
+public:
     /// \brief Initialize a mark_tag placeholder
     /// \param mark_nbr An integer that uniquely identifies this \c mark_tag
     /// within the static regexes in which this \c mark_tag will be used.
     /// \pre <tt>mark_nbr \> 0</tt>
     mark_tag(int mark_nbr)
- : proto::extends<detail::basic_mark_tag, mark_tag>(
- detail::basic_mark_tag::make(mark_nbr)
- )
+ : base_type(mark_tag::make_tag(mark_nbr))
     {
         // Marks numbers must be integers greater than 0.
         BOOST_ASSERT(mark_nbr > 0);
@@ -557,7 +566,7 @@
         return this->proto_base();
     }
 
- using proto::extends<detail::basic_mark_tag, mark_tag>::operator =;
+ using base_type::operator =;
 };
 
 // This macro is used when declaring mark_tags that are global because

Modified: trunk/boost/xpressive/xpressive_fwd.hpp
==============================================================================
--- trunk/boost/xpressive/xpressive_fwd.hpp (original)
+++ trunk/boost/xpressive/xpressive_fwd.hpp 2009-12-12 05:23:02 EST (Sat, 12 Dec 2009)
@@ -51,7 +51,6 @@
 #endif
 
 #include <boost/proto/proto_fwd.hpp>
-#include <boost/proto/traits.hpp>
 
 namespace boost { namespace xpressive
 {
@@ -78,7 +77,9 @@
         };
 
         struct mark_placeholder;
- typedef proto::terminal<mark_placeholder>::type basic_mark_tag;
+ typedef proto::expr<proto::tag::terminal, proto::term<mark_placeholder>, 0> basic_mark_tag;
+
+ struct regex_domain;
 
     } // namespace detail
 


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