Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62550 - in trunk: boost/proto boost/proto/detail boost/proto/transform libs/proto/doc/reference libs/proto/doc/reference/concepts libs/proto/doc/reference/transform
From: eric_at_[hidden]
Date: 2010-06-08 01:07:03


Author: eric_niebler
Date: 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
New Revision: 62550
URL: http://svn.boost.org/trac/boost/changeset/62550

Log:
namespace reform, begin to make proto internals rely less on proto::expr
Text files modified:
   trunk/boost/proto/debug.hpp | 69 +-
   trunk/boost/proto/detail/expr0.hpp | 1
   trunk/boost/proto/domain.hpp | 269 +++++------
   trunk/boost/proto/extends.hpp | 19
   trunk/boost/proto/generate.hpp | 399 ++++++++--------
   trunk/boost/proto/make_expr.hpp | 133 -----
   trunk/boost/proto/matches.hpp | 894 +++++++++++++++++++--------------------
   trunk/boost/proto/operators.hpp | 47 +
   trunk/boost/proto/proto_fwd.hpp | 274 +++++-------
   trunk/boost/proto/proto_typeof.hpp | 3
   trunk/boost/proto/traits.hpp | 756 ++++++++++++++++----------------
   trunk/boost/proto/transform/when.hpp | 4
   trunk/libs/proto/doc/reference/concepts/Domain.xml | 13
   trunk/libs/proto/doc/reference/concepts/Expr.xml | 16
   trunk/libs/proto/doc/reference/expr.xml | 18
   trunk/libs/proto/doc/reference/extends.xml | 3
   trunk/libs/proto/doc/reference/matches.xml | 16
   trunk/libs/proto/doc/reference/traits.xml | 198 ++++----
   trunk/libs/proto/doc/reference/transform/when.xml | 8
   19 files changed, 1508 insertions(+), 1632 deletions(-)

Modified: trunk/boost/proto/debug.hpp
==============================================================================
--- trunk/boost/proto/debug.hpp (original)
+++ trunk/boost/proto/debug.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -9,18 +9,16 @@
 #ifndef BOOST_PROTO_DEBUG_HPP_EAN_12_31_2006
 #define BOOST_PROTO_DEBUG_HPP_EAN_12_31_2006
 
-#include <boost/preprocessor/iteration/local.hpp>
-#include <boost/preprocessor/repetition/repeat.hpp>
-#include <boost/preprocessor/stringize.hpp>
 #include <iomanip>
 #include <iostream>
 #include <typeinfo>
+#include <boost/preprocessor/stringize.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/proto/proto_fwd.hpp>
-#include <boost/proto/expr.hpp>
 #include <boost/proto/traits.hpp>
 #include <boost/proto/matches.hpp>
-#include <boost/proto/detail/dont_care.hpp>
+#include <boost/proto/fusion.hpp>
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
 
 namespace boost { namespace proto
 {
@@ -111,6 +109,8 @@
         /// purposes.
         struct display_expr
         {
+ BOOST_PROTO_CALLABLE()
+
             typedef void result_type;
 
             /// \param sout The \c ostream to which the expression tree
@@ -126,48 +126,39 @@
 
             /// \brief Pretty-print the current node in a Proto expression
             /// tree.
- template<typename Tag, typename Args>
- void operator()(proto::expr<Tag, Args, 0> const &expr) const
+ template<typename Expr>
+ void operator()(Expr const &expr) const
+ {
+ this->impl(expr, mpl::long_<arity_of<Expr>::value>());
+ }
+
+ private:
+ display_expr(display_expr const &);
+ display_expr &operator =(display_expr const &);
+
+ template<typename Expr>
+ void impl(Expr const &expr, mpl::long_<0>) const
             {
                 using namespace hidden_detail_;
- this->sout_ << std::setw(this->depth_) << (this->first_? "" : ", ")
- << Tag() << "(" << proto::value(expr) << ")\n";
+ typedef typename tag_of<Expr>::type tag;
+ this->sout_ << std::setw(this->depth_) << (this->first_? "" : ", ");
+ this->sout_ << tag() << "(" << proto::value(expr) << ")\n";
                 this->first_ = false;
             }
 
- #define BOOST_PROTO_CHILD(Z, N, DATA) \
- display(proto::child_c<N>(expr)); \
- /**/
-
- #define BOOST_PP_LOCAL_MACRO(N) \
- /** \overload */ \
- template<typename Tag, typename Args> \
- void operator()(proto::expr<Tag, Args, N> const &expr) const \
- { \
- using namespace hidden_detail_; \
- this->sout_ << std::setw(this->depth_) << (this->first_? "" : ", ") \
- << Tag() << "(\n"; \
- display_expr display(this->sout_, this->depth_ + 4); \
- BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, _) \
- this->sout_ << std::setw(this->depth_) << "" << ")\n"; \
- this->first_ = false; \
- } \
- /**/
-
- #define BOOST_PP_LOCAL_LIMITS (1, BOOST_PROTO_MAX_ARITY)
- #include BOOST_PP_LOCAL_ITERATE()
- #undef BOOST_PROTO_CHILD
-
- /// \overload
- ///
- template<typename T>
- void operator()(T const &t) const
+ template<typename Expr, typename Arity>
+ void impl(Expr const &expr, Arity) const
             {
- (*this)(t.proto_base());
+ using namespace hidden_detail_;
+ typedef typename tag_of<Expr>::type tag;
+ this->sout_ << std::setw(this->depth_) << (this->first_? "" : ", ");
+ this->sout_ << tag() << "(\n";
+ display_expr display(this->sout_, this->depth_ + 4);
+ fusion::for_each(expr, display);
+ this->sout_ << std::setw(this->depth_) << "" << ")\n";
+ this->first_ = false;
             }
 
- private:
- display_expr &operator =(display_expr const &);
             int depth_;
             mutable bool first_;
             std::ostream &sout_;

Modified: trunk/boost/proto/detail/expr0.hpp
==============================================================================
--- trunk/boost/proto/detail/expr0.hpp (original)
+++ trunk/boost/proto/detail/expr0.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -56,6 +56,7 @@
         #else
         typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
         #endif
+ typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar;
         typedef default_domain proto_domain;
         typedef default_generator proto_generator;
         typedef proto::tag::proto_expr fusion_tag;

Modified: trunk/boost/proto/domain.hpp
==============================================================================
--- trunk/boost/proto/domain.hpp (original)
+++ trunk/boost/proto/domain.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -31,149 +31,148 @@
         {};
     }
 
- namespace domainns_
+ /// \brief For use in defining domain tags to be used
+ /// with \c proto::extends\<\>. A \e Domain associates
+ /// an expression type with a \e Generator, and optionally
+ /// a \e Grammar.
+ ///
+ /// The Generator determines how new expressions in the
+ /// domain are constructed. Typically, a generator wraps
+ /// all new expressions in a wrapper that imparts
+ /// domain-specific behaviors to expressions within its
+ /// domain. (See \c proto::extends\<\>.)
+ ///
+ /// The Grammar determines whether a given expression is
+ /// valid within the domain, and automatically disables
+ /// any operator overloads which would cause an invalid
+ /// expression to be created. By default, the Grammar
+ /// parameter defaults to the wildcard, \c proto::_, which
+ /// makes all expressions valid within the domain.
+ ///
+ /// The Super declares the domain currently being defined
+ /// to be a sub-domain of Super. Expressions in sub-domains
+ /// can be freely combined with expressions in its super-
+ /// domain (and <I>its</I> super-domain, etc.).
+ ///
+ /// Example:
+ /// \code
+ /// template<typename Expr>
+ /// struct MyExpr;
+ ///
+ /// struct MyGrammar
+ /// : or_< terminal<_>, plus<MyGrammar, MyGrammar> >
+ /// {};
+ ///
+ /// // Define MyDomain, in which all expressions are
+ /// // wrapped in MyExpr<> and only expressions that
+ /// // conform to MyGrammar are allowed.
+ /// struct MyDomain
+ /// : domain<generator<MyExpr>, MyGrammar>
+ /// {};
+ ///
+ /// // Use MyDomain to define MyExpr
+ /// template<typename Expr>
+ /// struct MyExpr
+ /// : extends<Expr, MyExpr<Expr>, MyDomain>
+ /// {
+ /// // ...
+ /// };
+ /// \endcode
+ ///
+ template<
+ typename Generator // = default_generator
+ , typename Grammar // = proto::_
+ , typename Super // = detail::not_a_domain
+ >
+ struct domain
+ : Generator
     {
- /// \brief For use in defining domain tags to be used
- /// with \c proto::extends\<\>. A \e Domain associates
- /// an expression type with a \e Generator, and optionally
- /// a \e Grammar.
- ///
- /// The Generator determines how new expressions in the
- /// domain are constructed. Typically, a generator wraps
- /// all new expressions in a wrapper that imparts
- /// domain-specific behaviors to expressions within its
- /// domain. (See \c proto::extends\<\>.)
- ///
- /// The Grammar determines whether a given expression is
- /// valid within the domain, and automatically disables
- /// any operator overloads which would cause an invalid
- /// expression to be created. By default, the Grammar
- /// parameter defaults to the wildcard, \c proto::_, which
- /// makes all expressions valid within the domain.
- ///
- /// Example:
- /// \code
- /// template<typename Expr>
- /// struct MyExpr;
- ///
- /// struct MyGrammar
- /// : or_< terminal<_>, plus<MyGrammar, MyGrammar> >
- /// {};
- ///
- /// // Define MyDomain, in which all expressions are
- /// // wrapped in MyExpr<> and only expressions that
- /// // conform to MyGrammar are allowed.
- /// struct MyDomain
- /// : domain<generator<MyExpr>, MyGrammar>
- /// {};
- ///
- /// // Use MyDomain to define MyExpr
- /// template<typename Expr>
- /// struct MyExpr
- /// : extends<Expr, MyExpr<Expr>, MyDomain>
- /// {
- /// // ...
- /// };
- /// \endcode
- ///
- template<
- typename Generator // = default_generator
- , typename Grammar // = proto::_
- , typename Super // = detail::not_a_domain
- >
- struct domain
- : Generator
- {
- typedef Generator proto_generator;
- typedef Grammar proto_grammar;
- typedef Super proto_super_domain;
-
- /// INTERNAL ONLY
- typedef void proto_is_domain_;
- };
-
- /// \brief The domain expressions have by default, if
- /// \c proto::extends\<\> has not been used to associate
- /// a domain with an expression.
- ///
- struct default_domain
- : domain<>
- {};
-
- /// \brief A pseudo-domain for use in functions and
- /// metafunctions that require a domain parameter. It
- /// indicates that the domain of the parent node should
- /// be inferred from the domains of the child nodes.
- ///
- /// \attention \c deduce_domain is not itself a valid domain.
- ///
- struct deduce_domain
- : domain<detail::not_a_generator, detail::not_a_grammar, detail::not_a_domain>
- {};
- }
-
- namespace result_of
- {
- /// A metafunction that returns \c mpl::true_
- /// if the type \c T is the type of a Proto domain;
- /// \c mpl::false_ otherwise. If \c T inherits from
- /// \c proto::domain\<\>, \c is_domain\<T\> is
- /// \c mpl::true_.
- template<typename T, typename Void /* = void*/>
- struct is_domain
- : mpl::false_
- {};
+ typedef Generator proto_generator;
+ typedef Grammar proto_grammar;
+ typedef Super proto_super_domain;
 
         /// INTERNAL ONLY
- ///
- template<typename T>
- struct is_domain<T, typename T::proto_is_domain_>
- : mpl::true_
- {};
+ typedef void proto_is_domain_;
+ };
 
- /// A metafunction that returns the domain of
- /// a given type. If \c T is a Proto expression
- /// type, it returns that expression's associated
- /// domain. If not, it returns
- /// \c proto::default_domain.
- template<typename T, typename Void /* = void*/>
- struct domain_of
- {
- typedef default_domain type;
- };
+ /// \brief The domain expressions have by default, if
+ /// \c proto::extends\<\> has not been used to associate
+ /// a domain with an expression.
+ ///
+ struct default_domain
+ : domain<>
+ {};
+
+ /// \brief A pseudo-domain for use in functions and
+ /// metafunctions that require a domain parameter. It
+ /// indicates that the domain of the parent node should
+ /// be inferred from the domains of the child nodes.
+ ///
+ /// \attention \c deduce_domain is not itself a valid domain.
+ ///
+ struct deduce_domain
+ : domain<detail::not_a_generator, detail::not_a_grammar, detail::not_a_domain>
+ {};
+
+ /// A metafunction that returns \c mpl::true_
+ /// if the type \c T is the type of a Proto domain;
+ /// \c mpl::false_ otherwise. If \c T inherits from
+ /// \c proto::domain\<\>, \c is_domain\<T\> is
+ /// \c mpl::true_.
+ template<typename T, typename Void /* = void*/>
+ struct is_domain
+ : mpl::false_
+ {};
+
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct is_domain<T, typename T::proto_is_domain_>
+ : mpl::true_
+ {};
+
+ /// A metafunction that returns the domain of
+ /// a given type. If \c T is a Proto expression
+ /// type, it returns that expression's associated
+ /// domain. If not, it returns
+ /// \c proto::default_domain.
+ template<typename T, typename Void /* = void*/>
+ struct domain_of
+ {
+ typedef default_domain type;
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename T>
- struct domain_of<T, typename T::proto_is_expr_>
- {
- typedef typename T::proto_domain type;
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct domain_of<T, typename T::proto_is_expr_>
+ {
+ typedef typename T::proto_domain type;
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename T>
- struct domain_of<T &, void>
- {
- typedef typename domain_of<T>::type type;
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct domain_of<T &, void>
+ {
+ typedef typename domain_of<T>::type type;
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename T>
- struct domain_of<boost::reference_wrapper<T>, void>
- {
- typedef typename domain_of<T>::type type;
- };
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct domain_of<boost::reference_wrapper<T>, void>
+ {
+ typedef typename domain_of<T>::type type;
+ };
 
- /// INTERNAL ONLY
- ///
- template<typename T>
- struct domain_of<boost::reference_wrapper<T> const, void>
- {
- typedef typename domain_of<T>::type type;
- };
- }
+ /// INTERNAL ONLY
+ ///
+ template<typename T>
+ struct domain_of<boost::reference_wrapper<T> const, void>
+ {
+ typedef typename domain_of<T>::type type;
+ };
 }}
 
 #endif

Modified: trunk/boost/proto/extends.hpp
==============================================================================
--- trunk/boost/proto/extends.hpp (original)
+++ trunk/boost/proto/extends.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -165,6 +165,7 @@
         typedef typename proto_base_expr::proto_tag proto_tag; \
         typedef typename proto_base_expr::proto_args proto_args; \
         typedef typename proto_base_expr::proto_arity proto_arity; \
+ typedef typename proto_base_expr::proto_grammar proto_grammar; \
         typedef typename proto_base_expr::address_of_hack_type_ proto_address_of_hack_type_; \
         typedef void proto_is_expr_; /**< INTERNAL ONLY */ \
         BOOST_STATIC_CONSTANT(long, proto_arity_c = proto_base_expr::proto_arity_c); \
@@ -576,20 +577,20 @@
         template<typename This, typename Fun, typename Domain>
         struct virtual_member
         {
- typedef
- expr<tag::member, list2<This &, expr<tag::terminal, term<Fun> > const &>, 2>
- proto_base_expr;
             typedef Domain proto_domain;
             typedef typename Domain::proto_generator proto_generator;
             typedef virtual_member<This, Fun, Domain> proto_derived_expr;
- typedef typename proto_base_expr::proto_tag proto_tag;
- typedef typename proto_base_expr::proto_args proto_args;
- typedef typename proto_base_expr::proto_arity proto_arity;
- typedef typename proto_base_expr::address_of_hack_type_ proto_address_of_hack_type_;
+ typedef tag::member proto_tag;
+ typedef list2<This &, expr<tag::terminal, term<Fun> > const &> proto_args;
+ typedef mpl::long_<2> proto_arity;
+ typedef detail::not_a_valid_type proto_address_of_hack_type_;
             typedef void proto_is_expr_; /**< INTERNAL ONLY */
- BOOST_STATIC_CONSTANT(long, proto_arity_c = proto_base_expr::proto_arity_c);
+ BOOST_STATIC_CONSTANT(long, proto_arity_c = 2);
             typedef boost::proto::tag::proto_expr fusion_tag;
- BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_EXTENDS_CHILD, ~)
+ typedef This &proto_child0;
+ typedef expr<tag::terminal, term<Fun> > const &proto_child1;
+ typedef expr<proto_tag, proto_args, proto_arity_c> proto_base_expr;
+ typedef basic_expr<proto_tag, proto_args, proto_arity_c> proto_grammar;
             typedef void proto_is_aggregate_; /**< INTERNAL ONLY */
 
             BOOST_PROTO_EXTENDS_ASSIGN_()

Modified: trunk/boost/proto/generate.hpp
==============================================================================
--- trunk/boost/proto/generate.hpp (original)
+++ trunk/boost/proto/generate.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -73,241 +73,238 @@
 
         }
 
- namespace generatorns_
+ /// \brief A simple generator that passes an expression
+ /// through unchanged.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// The \c default_generator makes no modifications to the expressions
+ /// passed to it.
+ struct default_generator
         {
- /// \brief A simple generator that passes an expression
- /// through unchanged.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// The \c default_generator makes no modifications to the expressions
- /// passed to it.
- struct default_generator
- {
- BOOST_PROTO_CALLABLE()
-
- template<typename Sig>
- struct result;
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef Expr type;
- };
+ template<typename Sig>
+ struct result;
 
- /// \param expr A Proto expression
- /// \return expr
- template<typename Expr>
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- Expr
- #else
- Expr const &
- #endif
- operator ()(Expr const &e) const
- {
- return e;
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef Expr type;
             };
 
- /// \brief A generator that wraps expressions passed
- /// to it in the specified extension wrapper.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c generator\<\> wraps each expression passed to it in
- /// the \c Extends\<\> wrapper.
- template<template<typename> class Extends>
- struct generator
+ /// \param expr A Proto expression
+ /// \return expr
+ template<typename Expr>
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ Expr
+ #else
+ Expr const &
+ #endif
+ operator ()(Expr const &e) const
             {
- BOOST_PROTO_CALLABLE()
+ return e;
+ }
+ };
 
- template<typename Sig>
- struct result;
+ /// \brief A generator that wraps expressions passed
+ /// to it in the specified extension wrapper.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c generator\<\> wraps each expression passed to it in
+ /// the \c Extends\<\> wrapper.
+ template<template<typename> class Extends>
+ struct generator
+ {
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef Extends<Expr> type;
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
+ {
+ typedef Extends<Expr> type;
+ };
 
- /// \param expr A Proto expression
- /// \return Extends<Expr>(expr)
- template<typename Expr>
- Extends<Expr> operator ()(Expr const &e) const
- {
- return Extends<Expr>(e);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
+ {
+ typedef Extends<Expr> type;
             };
 
- /// \brief A generator that wraps expressions passed
- /// to it in the specified extension wrapper and uses
- /// aggregate initialization for the wrapper.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c pod_generator\<\> wraps each expression passed to it in
- /// the \c Extends\<\> wrapper, and uses aggregate initialzation
- /// for the wrapped object.
- template<template<typename> class Extends>
- struct pod_generator
+ /// \param expr A Proto expression
+ /// \return Extends<Expr>(expr)
+ template<typename Expr>
+ Extends<Expr> operator ()(Expr const &e) const
             {
- BOOST_PROTO_CALLABLE()
+ return Extends<Expr>(e);
+ }
+ };
 
- template<typename Sig>
- struct result;
+ /// \brief A generator that wraps expressions passed
+ /// to it in the specified extension wrapper and uses
+ /// aggregate initialization for the wrapper.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c pod_generator\<\> wraps each expression passed to it in
+ /// the \c Extends\<\> wrapper, and uses aggregate initialzation
+ /// for the wrapped object.
+ template<template<typename> class Extends>
+ struct pod_generator
+ {
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef Extends<Expr> type;
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef Extends<Expr> type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
+ {
+ typedef Extends<Expr> type;
+ };
 
- /// \param expr The expression to wrap
- /// \return <tt>Extends\<Expr\> that = {expr}; return that;</tt>
- template<typename Expr>
- Extends<Expr> operator ()(Expr const &e) const
- {
- Extends<Expr> that = {e};
- return that;
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
+ {
+ typedef Extends<Expr> type;
             };
 
- /// \brief A generator that replaces child nodes held by
- /// reference with ones held by value. Use with
- /// \c compose_generators to forward that result to another
- /// generator.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c by_value_generator ensures all child nodes are
- /// held by value. This generator is typically composed with a
- /// second generator for further processing, as
- /// <tt>compose_generators\<by_value_generator, MyGenerator\></tt>.
- struct by_value_generator
+ /// \param expr The expression to wrap
+ /// \return <tt>Extends\<Expr\> that = {expr}; return that;</tt>
+ template<typename Expr>
+ Extends<Expr> operator ()(Expr const &e) const
             {
- BOOST_PROTO_CALLABLE()
+ Extends<Expr> that = {e};
+ return that;
+ }
+ };
 
- template<typename Sig>
- struct result;
+ /// \brief A generator that replaces child nodes held by
+ /// reference with ones held by value. Use with
+ /// \c compose_generators to forward that result to another
+ /// generator.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c by_value_generator ensures all child nodes are
+ /// held by value. This generator is typically composed with a
+ /// second generator for further processing, as
+ /// <tt>compose_generators\<by_value_generator, MyGenerator\></tt>.
+ struct by_value_generator
+ {
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef
- typename detail::by_value_generator_<Expr>::type
- type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef
- typename detail::by_value_generator_<Expr>::type
- type;
- };
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef
+ typename detail::by_value_generator_<Expr>::type
+ type;
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef
- typename detail::by_value_generator_<Expr>::type
- type;
- };
-
- /// \param expr The expression to modify.
- /// \return <tt>deep_copy(expr)</tt>
- template<typename Expr>
- typename result<by_value_generator(Expr)>::type operator ()(Expr const &e) const
- {
- return detail::by_value_generator_<Expr>::make(e);
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
+ {
+ typedef
+ typename detail::by_value_generator_<Expr>::type
+ type;
             };
 
- /// \brief A composite generator that first applies one
- /// transform to an expression and then forwards the result
- /// on to another generator for further transformation.
- ///
- /// Generators are intended for use as the first template parameter
- /// to the \c domain\<\> class template and control if and how
- /// expressions within that domain are to be customized.
- /// \c compose_generators\<\> is a composite generator that first
- /// applies one transform to an expression and then forwards the
- /// result on to another generator for further transformation.
- template<typename First, typename Second>
- struct compose_generators
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
             {
- BOOST_PROTO_CALLABLE()
+ typedef
+ typename detail::by_value_generator_<Expr>::type
+ type;
+ };
 
- template<typename Sig>
- struct result;
+ /// \param expr The expression to modify.
+ /// \return <tt>deep_copy(expr)</tt>
+ template<typename Expr>
+ typename result<by_value_generator(Expr)>::type operator ()(Expr const &e) const
+ {
+ return detail::by_value_generator_<Expr>::make(e);
+ }
+ };
 
- template<typename This, typename Expr>
- struct result<This(Expr)>
- {
- typedef
- typename Second::template result<
- Second(typename First::template result<First(Expr)>::type)
- >::type
- type;
- };
+ /// \brief A composite generator that first applies one
+ /// transform to an expression and then forwards the result
+ /// on to another generator for further transformation.
+ ///
+ /// Generators are intended for use as the first template parameter
+ /// to the \c domain\<\> class template and control if and how
+ /// expressions within that domain are to be customized.
+ /// \c compose_generators\<\> is a composite generator that first
+ /// applies one transform to an expression and then forwards the
+ /// result on to another generator for further transformation.
+ template<typename First, typename Second>
+ struct compose_generators
+ {
+ BOOST_PROTO_CALLABLE()
 
- template<typename This, typename Expr>
- struct result<This(Expr &)>
- {
- typedef
- typename Second::template result<
- Second(typename First::template result<First(Expr)>::type)
- >::type
- type;
- };
+ template<typename Sig>
+ struct result;
 
- template<typename This, typename Expr>
- struct result<This(Expr const &)>
- {
- typedef
- typename Second::template result<
- Second(typename First::template result<First(Expr)>::type)
- >::type
- type;
- };
-
- /// \param expr The expression to modify.
- /// \return Second()(First()(expr))
- template<typename Expr>
- typename result<compose_generators(Expr)>::type operator ()(Expr const &e) const
- {
- return Second()(First()(e));
- }
+ template<typename This, typename Expr>
+ struct result<This(Expr)>
+ {
+ typedef
+ typename Second::template result<
+ Second(typename First::template result<First(Expr)>::type)
+ >::type
+ type;
             };
- }
+
+ template<typename This, typename Expr>
+ struct result<This(Expr &)>
+ {
+ typedef
+ typename Second::template result<
+ Second(typename First::template result<First(Expr)>::type)
+ >::type
+ type;
+ };
+
+ template<typename This, typename Expr>
+ struct result<This(Expr const &)>
+ {
+ typedef
+ typename Second::template result<
+ Second(typename First::template result<First(Expr)>::type)
+ >::type
+ type;
+ };
+
+ /// \param expr The expression to modify.
+ /// \return Second()(First()(expr))
+ template<typename Expr>
+ typename result<compose_generators(Expr)>::type operator ()(Expr const &e) const
+ {
+ return Second()(First()(e));
+ }
+ };
 
         /// INTERNAL ONLY
         template<>

Modified: trunk/boost/proto/make_expr.hpp
==============================================================================
--- trunk/boost/proto/make_expr.hpp (original)
+++ trunk/boost/proto/make_expr.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -255,73 +255,6 @@
               : make_expr_<tag::terminal, default_domain, A>
             {};
 
- template<typename Base, typename Expr>
- Expr implicit_expr_wrap(Base const &e, mpl::false_, Expr *)
- {
- return Expr(e);
- }
-
- template<typename Base, typename Expr>
- Expr implicit_expr_wrap(Base const &e, mpl::true_, Expr *)
- {
- Expr that = {e};
- return that;
- }
-
- template<typename A0, typename Void = void>
- struct implicit_expr_1
- {
- A0 &a0;
-
- template<typename Args>
- operator proto::expr<tag::terminal, Args, 0>() const
- {
- proto::expr<tag::terminal, Args, 0> that = {this->a0};
- return that;
- }
-
- template<typename Expr>
- operator Expr() const
- {
- typename Expr::proto_base_expr that = *this;
- return detail::implicit_expr_wrap(that, is_aggregate<Expr>(), static_cast<Expr *>(0));
- }
- };
-
- template<typename A0>
- struct implicit_expr_1<A0, typename A0::proto_is_expr_>
- {
- A0 &a0;
-
- #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, BOOST_TESTED_AT(1010))
- typedef typename remove_cv<A0>::type uncv_a0_type;
-
- operator uncv_a0_type &() const
- {
- return const_cast<uncv_a0_type &>(this->a0);
- }
- #else
- operator A0 &() const
- {
- return this->a0;
- }
- #endif
-
- template<typename Tag, typename Args>
- operator proto::expr<Tag, Args, 1>() const
- {
- proto::expr<Tag, Args, 1> that = {this->a0};
- return that;
- }
-
- template<typename Expr>
- operator Expr() const
- {
- typename Expr::proto_base_expr that = *this;
- return detail::implicit_expr_wrap(that, is_aggregate<Expr>(), static_cast<Expr *>(0));
- }
- };
-
         #define BOOST_PP_ITERATION_PARAMS_1 \
             (4, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 1)) \
             /**/
@@ -764,24 +697,6 @@
>::call(sequence2);
         }
 
- /// \brief Return a proxy object that holds its arguments by reference
- /// and is implicitly convertible to an expression.
- template<typename A0>
- detail::implicit_expr_1<A0> const
- implicit_expr(A0 &a0)
- {
- detail::implicit_expr_1<A0> that = {a0};
- return that;
- }
-
- // Additional overloads generated by the preprocessor...
-
- #define BOOST_PP_ITERATION_PARAMS_1 \
- (4, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/make_expr.hpp>, 4)) \
- /**/
-
- #include BOOST_PP_ITERATE()
-
         /// INTERNAL ONLY
         ///
         template<typename Tag, typename Domain>
@@ -825,37 +740,6 @@
     #define N BOOST_PP_ITERATION()
     #define M BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N)
 
- #if N > 1
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- struct BOOST_PP_CAT(implicit_expr_, N)
- {
- #define M0(Z, N, DATA) BOOST_PP_CAT(A, N) &BOOST_PP_CAT(a, N);
- BOOST_PP_REPEAT(N, M0, ~)
- #undef M0
-
- template<typename Tag, typename Args>
- operator proto::expr<Tag, Args, N>() const
- {
- #define M0(Z, N, DATA) \
- implicit_expr_1<BOOST_PP_CAT(A, N)> BOOST_PP_CAT(b, N) \
- = {this->BOOST_PP_CAT(a, N)}; \
- typename Args::BOOST_PP_CAT(child, N) BOOST_PP_CAT(c, N) = BOOST_PP_CAT(b, N); \
- /**/
- BOOST_PP_REPEAT(N, M0, ~)
- #undef M0
- proto::expr<Tag, Args, N> that = {BOOST_PP_ENUM_PARAMS(N, c)};
- return that;
- }
-
- template<typename Expr>
- operator Expr() const
- {
- typename Expr::proto_base_expr that = *this;
- return detail::implicit_expr_wrap(that, is_aggregate<Expr>(), static_cast<Expr *>(0));
- }
- };
- #endif
-
         template<typename Tag, typename Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
         struct make_expr_<Tag, Domain BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
             BOOST_PP_ENUM_TRAILING_PARAMS(M, void BOOST_PP_INTERCEPT), void>
@@ -1018,21 +902,4 @@
 
     #undef N
 
-#elif BOOST_PP_ITERATION_FLAGS() == 4
-
- #define N BOOST_PP_ITERATION()
-
- /// \overload
- ///
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- detail::BOOST_PP_CAT(implicit_expr_, N)<BOOST_PP_ENUM_PARAMS(N, A)> const
- implicit_expr(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a))
- {
- detail::BOOST_PP_CAT(implicit_expr_, N)<BOOST_PP_ENUM_PARAMS(N, A)> that
- = {BOOST_PP_ENUM_PARAMS(N, a)};
- return that;
- }
-
- #undef N
-
 #endif // BOOST_PP_IS_ITERATING

Modified: trunk/boost/proto/matches.hpp
==============================================================================
--- trunk/boost/proto/matches.hpp (original)
+++ trunk/boost/proto/matches.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -140,14 +140,20 @@
 
             template<typename Args1, typename Args2, typename Back>
             struct vararg_matches<Args1, Args2, Back, true, true, typename Back::proto_is_vararg_>
- : matches_<proto::expr<ignore, Args1, Args1::arity>, proto::expr<ignore, Args2, Args1::arity> >
+ : matches_<
+ proto::basic_expr<ignore, Args1, Args1::arity>
+ , proto::basic_expr<ignore, Args2, Args1::arity>
+ >
             {};
 
             template<typename Args1, typename Args2, typename Back>
             struct vararg_matches<Args1, Args2, Back, true, false, typename Back::proto_is_vararg_>
               : and_2<
- matches_<proto::expr<ignore, Args1, Args2::arity>, proto::expr<ignore, Args2, Args2::arity> >::value
- , vararg_matches_impl<Args1, typename Back::proto_base_expr, Args2::arity + 1, Args1::arity>
+ matches_<
+ proto::basic_expr<ignore, Args1, Args2::arity>
+ , proto::basic_expr<ignore, Args2, Args2::arity>
+ >::value
+ , vararg_matches_impl<Args1, typename Back::proto_grammar, Args2::arity + 1, Args1::arity>
>
             {};
 
@@ -297,56 +303,56 @@
             {};
 
             template<typename Tag, typename Args1, long N1, typename Args2, long N2>
- struct matches_< proto::expr<Tag, Args1, N1>, proto::expr<Tag, Args2, N2> >
+ struct matches_< proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<Tag, Args2, N2> >
               : vararg_matches< Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) >
             {};
 
             template<typename Tag, typename Args1, long N1, typename Args2, long N2>
- struct matches_< proto::expr<Tag, Args1, N1>, proto::expr<proto::_, Args2, N2> >
+ struct matches_< proto::basic_expr<Tag, Args1, N1>, proto::basic_expr<proto::_, Args2, N2> >
               : vararg_matches< Args1, Args2, typename Args2::back_, (N1+2 > N2), (N2 > N1) >
             {};
 
             template<typename Tag, typename Args1, typename Args2>
- struct matches_< proto::expr<Tag, Args1, 0>, proto::expr<Tag, Args2, 0> >
+ struct matches_< proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<Tag, Args2, 0> >
               : terminal_matches<typename Args1::child0, typename Args2::child0>
             {};
 
             template<typename Tag, typename Args1, typename Args2, long N2>
- struct matches_< proto::expr<Tag, Args1, 0>, proto::expr<proto::_, Args2, N2> >
+ struct matches_< proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, N2> >
               : mpl::false_
             {};
 
             template<typename Tag, typename Args1, typename Args2>
- struct matches_< proto::expr<Tag, Args1, 0>, proto::expr<proto::_, Args2, 0> >
+ struct matches_< proto::basic_expr<Tag, Args1, 0>, proto::basic_expr<proto::_, Args2, 0> >
               : terminal_matches<typename Args1::child0, typename Args2::child0>
             {};
 
             template<typename Tag, typename Args1, typename Args2>
- struct matches_< proto::expr<Tag, Args1, 1>, proto::expr<Tag, Args2, 1> >
+ struct matches_< proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<Tag, Args2, 1> >
               : matches_<
- typename detail::expr_traits<typename Args1::child0>::value_type::proto_base_expr
- , typename Args2::child0::proto_base_expr
+ typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar
+ , typename Args2::child0::proto_grammar
>
             {};
 
             template<typename Tag, typename Args1, typename Args2>
- struct matches_< proto::expr<Tag, Args1, 1>, proto::expr<proto::_, Args2, 1> >
+ struct matches_< proto::basic_expr<Tag, Args1, 1>, proto::basic_expr<proto::_, Args2, 1> >
               : matches_<
- typename detail::expr_traits<typename Args1::child0>::value_type::proto_base_expr
- , typename Args2::child0::proto_base_expr
+ typename detail::expr_traits<typename Args1::child0>::value_type::proto_grammar
+ , typename Args2::child0::proto_grammar
>
             {};
 
         #define BOOST_PROTO_MATCHES_N_FUN(Z, N, DATA) \
             matches_< \
- typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_base_expr\
- , typename Args2::BOOST_PP_CAT(child, N)::proto_base_expr \
+ typename detail::expr_traits<typename Args1::BOOST_PP_CAT(child, N)>::value_type::proto_grammar\
+ , typename Args2::BOOST_PP_CAT(child, N)::proto_grammar \
>
 
         #define BOOST_PROTO_DEFINE_MATCHES(Z, N, DATA) \
             matches_< \
- typename Expr::proto_base_expr \
- , typename BOOST_PP_CAT(G, N)::proto_base_expr \
+ Expr \
+ , typename BOOST_PP_CAT(G, N)::proto_grammar \
>
 
         #define BOOST_PROTO_DEFINE_LAMBDA_MATCHES(Z, N, DATA) \
@@ -370,21 +376,23 @@
         #undef BOOST_PROTO_DEFINE_LAMBDA_MATCHES
 
             // handle proto::if_
- template<typename Expr, typename If, typename Then, typename Else>
- struct matches_<Expr, proto::if_<If, Then, Else> >
+ template<typename Tag, typename Args, long Arity, typename If, typename Then, typename Else>
+ struct matches_<proto::basic_expr<Tag, Args, Arity>, proto::if_<If, Then, Else> >
               : mpl::eval_if_c<
                     remove_reference<
- typename when<_, If>::template impl<Expr, int, int>::result_type
+ typename when<_, If>::
+ template impl<proto::expr<Tag, Args, Arity>, int, int>::result_type
>::type::value
- , matches_<Expr, typename Then::proto_base_expr>
- , matches_<Expr, typename Else::proto_base_expr>
+ , matches_<proto::basic_expr<Tag, Args, Arity>, typename Then::proto_grammar>
+ , matches_<proto::basic_expr<Tag, Args, Arity>, typename Else::proto_grammar>
>::type
             {};
 
- template<typename Expr, typename If>
- struct matches_<Expr, proto::if_<If> >
+ template<typename Tag, typename Args, long Arity, typename If>
+ struct matches_<proto::basic_expr<Tag, Args, Arity>, proto::if_<If> >
               : detail::uncvref<
- typename when<_, If>::template impl<Expr, int, int>::result_type
+ typename when<_, If>::
+ template impl<proto::expr<Tag, Args, Arity>, int, int>::result_type
>::type
             {};
 
@@ -398,7 +406,7 @@
 
             template<typename Expr, typename G0>
             struct matches_<Expr, or_<G0> >
- : matches_<Expr, typename G0::proto_base_expr>
+ : matches_<Expr, typename G0::proto_grammar>
             {
                 typedef G0 which;
             };
@@ -411,179 +419,172 @@
 
             template<typename Expr, typename G0>
             struct matches_<Expr, and_<G0> >
- : matches_<Expr, typename G0::proto_base_expr>
+ : matches_<Expr, typename G0::proto_grammar>
             {};
 
             // handle proto::not_
             template<typename Expr, typename Grammar>
             struct matches_<Expr, not_<Grammar> >
- : mpl::not_<matches_<Expr, typename Grammar::proto_base_expr> >
+ : mpl::not_<matches_<Expr, typename Grammar::proto_grammar> >
             {};
 
             // handle proto::switch_
- template<typename Expr, typename Cases>
- struct matches_<Expr, switch_<Cases> >
+ template<typename Tag, typename Args, long Arity, typename Cases>
+ struct matches_<proto::basic_expr<Tag, Args, Arity>, switch_<Cases> >
               : matches_<
- Expr
- , typename Cases::template case_<typename Expr::proto_tag>::proto_base_expr
+ proto::basic_expr<Tag, Args, Arity>
+ , typename Cases::template case_<Tag>::proto_grammar
>
             {};
         }
 
- namespace result_of
- {
- /// \brief A Boolean metafunction that evaluates whether a given
- /// expression type matches a grammar.
- ///
- /// <tt>matches\<Expr,Grammar\></tt> inherits (indirectly) from
- /// \c mpl::true_ if <tt>Expr::proto_base_expr</tt> matches
- /// <tt>Grammar::proto_base_expr</tt>, and from \c mpl::false_
- /// otherwise.
- ///
- /// Non-terminal expressions are matched against a grammar
- /// according to the following rules:
- ///
- /// \li The wildcard pattern, \c _, matches any expression.
- /// \li An expression <tt>expr\<AT, listN\<A0,A1,...An\> \></tt>
- /// matches a grammar <tt>expr\<BT, listN\<B0,B1,...Bn\> \></tt>
- /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx for
- /// each \c x in <tt>[0,n)</tt>.
- /// \li An expression <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
- /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
- /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
- /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
- /// for each \c x in <tt>[0,m)</tt>.
- /// \li An expression \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
- /// matches some \c Bx for \c x in <tt>[0,n)</tt>.
- /// \li An expression \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
- /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
- /// \li An expression \c E matches <tt>if_\<T,U,V\></tt> if
- /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::::type::value</tt>
- /// is \c true and \c E matches \c U; or, if
- /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::::type::value</tt>
- /// is \c false and \c E matches \c V. (Note: \c U defaults to \c _
- /// and \c V defaults to \c not_\<_\>.)
- /// \li An expression \c E matches <tt>not_\<T\></tt> if \c E does
- /// not match \c T.
- /// \li An expression \c E matches <tt>switch_\<C\></tt> if
- /// \c E matches <tt>C::case_\<E::proto_tag\></tt>.
- ///
- /// A terminal expression <tt>expr\<AT,term\<A\> \></tt> matches
- /// a grammar <tt>expr\<BT,term\<B\> \></tt> if \c BT is \c AT or
- /// \c proto::_ and if one of the following is true:
- ///
- /// \li \c B is the wildcard pattern, \c _
- /// \li \c A is \c B
- /// \li \c A is <tt>B &</tt>
- /// \li \c A is <tt>B const &</tt>
- /// \li \c B is <tt>exact\<A\></tt>
- /// \li \c B is <tt>convertible_to\<X\></tt> and
- /// <tt>is_convertible\<A,X\>::::value</tt> is \c true.
- /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
- /// \c B is <tt>X[proto::N]</tt>.
- /// \li \c A is <tt>X(&)[M]</tt> and \c B is <tt>X(&)[proto::N]</tt>.
- /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
- /// \c B is <tt>X*</tt>.
- /// \li \c B lambda-matches \c A (see below).
- ///
- /// A type \c B lambda-matches \c A if one of the following is true:
- ///
- /// \li \c B is \c A
- /// \li \c B is the wildcard pattern, \c _
- /// \li \c B is <tt>T\<B0,B1,...Bn\></tt> and \c A is
- /// <tt>T\<A0,A1,...An\></tt> and for each \c x in
- /// <tt>[0,n)</tt>, \c Ax and \c Bx are types
- /// such that \c Ax lambda-matches \c Bx
- template<typename Expr, typename Grammar>
- struct matches
- : detail::matches_<
- typename Expr::proto_base_expr
- , typename Grammar::proto_base_expr
- >
- {};
+ /// \brief A Boolean metafunction that evaluates whether a given
+ /// expression type matches a grammar.
+ ///
+ /// <tt>matches\<Expr,Grammar\></tt> inherits (indirectly) from
+ /// \c mpl::true_ if <tt>Expr::proto_grammar</tt> matches
+ /// <tt>Grammar::proto_grammar</tt>, and from \c mpl::false_
+ /// otherwise.
+ ///
+ /// Non-terminal expressions are matched against a grammar
+ /// according to the following rules:
+ ///
+ /// \li The wildcard pattern, \c _, matches any expression.
+ /// \li An expression <tt>expr\<AT, listN\<A0,A1,...An\> \></tt>
+ /// matches a grammar <tt>expr\<BT, listN\<B0,B1,...Bn\> \></tt>
+ /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx for
+ /// each \c x in <tt>[0,n)</tt>.
+ /// \li An expression <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
+ /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
+ /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
+ /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
+ /// for each \c x in <tt>[0,m)</tt>.
+ /// \li An expression \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
+ /// matches some \c Bx for \c x in <tt>[0,n)</tt>.
+ /// \li An expression \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
+ /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
+ /// \li An expression \c E matches <tt>if_\<T,U,V\></tt> if
+ /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::::type::value</tt>
+ /// is \c true and \c E matches \c U; or, if
+ /// <tt>boost::result_of\<when\<_,T\>(E,int,int)\>::::type::value</tt>
+ /// is \c false and \c E matches \c V. (Note: \c U defaults to \c _
+ /// and \c V defaults to \c not_\<_\>.)
+ /// \li An expression \c E matches <tt>not_\<T\></tt> if \c E does
+ /// not match \c T.
+ /// \li An expression \c E matches <tt>switch_\<C\></tt> if
+ /// \c E matches <tt>C::case_\<E::proto_tag\></tt>.
+ ///
+ /// A terminal expression <tt>expr\<AT,term\<A\> \></tt> matches
+ /// a grammar <tt>expr\<BT,term\<B\> \></tt> if \c BT is \c AT or
+ /// \c proto::_ and if one of the following is true:
+ ///
+ /// \li \c B is the wildcard pattern, \c _
+ /// \li \c A is \c B
+ /// \li \c A is <tt>B &</tt>
+ /// \li \c A is <tt>B const &</tt>
+ /// \li \c B is <tt>exact\<A\></tt>
+ /// \li \c B is <tt>convertible_to\<X\></tt> and
+ /// <tt>is_convertible\<A,X\>::::value</tt> is \c true.
+ /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
+ /// \c B is <tt>X[proto::N]</tt>.
+ /// \li \c A is <tt>X(&)[M]</tt> and \c B is <tt>X(&)[proto::N]</tt>.
+ /// \li \c A is <tt>X[M]</tt> or <tt>X(&)[M]</tt> and
+ /// \c B is <tt>X*</tt>.
+ /// \li \c B lambda-matches \c A (see below).
+ ///
+ /// A type \c B lambda-matches \c A if one of the following is true:
+ ///
+ /// \li \c B is \c A
+ /// \li \c B is the wildcard pattern, \c _
+ /// \li \c B is <tt>T\<B0,B1,...Bn\></tt> and \c A is
+ /// <tt>T\<A0,A1,...An\></tt> and for each \c x in
+ /// <tt>[0,n)</tt>, \c Ax and \c Bx are types
+ /// such that \c Ax lambda-matches \c Bx
+ template<typename Expr, typename Grammar>
+ struct matches
+ : detail::matches_<
+ typename Expr::proto_grammar
+ , typename Grammar::proto_grammar
+ >
+ {};
 
- /// INTERNAL ONLY
- ///
- template<typename Expr, typename Grammar>
- struct matches<Expr &, Grammar>
- : detail::matches_<
- typename Expr::proto_base_expr
- , typename Grammar::proto_base_expr
- >
- {};
- }
+ /// INTERNAL ONLY
+ ///
+ template<typename Expr, typename Grammar>
+ struct matches<Expr &, Grammar>
+ : detail::matches_<
+ typename Expr::proto_grammar
+ , typename Grammar::proto_grammar
+ >
+ {};
 
- namespace wildcardns_
+ /// \brief A wildcard grammar element that matches any expression,
+ /// and a transform that returns the current expression unchanged.
+ ///
+ /// The wildcard type, \c _, is a grammar element such that
+ /// <tt>matches\<E,_\>::::value</tt> is \c true for any expression
+ /// type \c E.
+ ///
+ /// The wildcard can also be used as a stand-in for a template
+ /// argument when matching terminals. For instance, the following
+ /// is a grammar that will match any <tt>std::complex\<\></tt>
+ /// terminal:
+ ///
+ /// \code
+ /// BOOST_MPL_ASSERT((
+ /// matches<
+ /// terminal<std::complex<double> >::type
+ /// , terminal<std::complex< _ > >
+ /// >
+ /// ));
+ /// \endcode
+ ///
+ /// When used as a transform, \c _ returns the current expression
+ /// unchanged. For instance, in the following, \c _ is used with
+ /// the \c fold\<\> transform to fold the children of a node:
+ ///
+ /// \code
+ /// struct CountChildren
+ /// : or_<
+ /// // Terminals have no children
+ /// when<terminal<_>, mpl::int_<0>()>
+ /// // Use fold<> to count the children of non-terminals
+ /// , otherwise<
+ /// fold<
+ /// _ // <-- fold the current expression
+ /// , mpl::int_<0>()
+ /// , mpl::plus<_state, mpl::int_<1> >()
+ /// >
+ /// >
+ /// >
+ /// {};
+ /// \endcode
+ struct _ : transform<_>
         {
+ typedef _ proto_grammar;
 
- /// \brief A wildcard grammar element that matches any expression,
- /// and a transform that returns the current expression unchanged.
- ///
- /// The wildcard type, \c _, is a grammar element such that
- /// <tt>matches\<E,_\>::::value</tt> is \c true for any expression
- /// type \c E.
- ///
- /// The wildcard can also be used as a stand-in for a template
- /// argument when matching terminals. For instance, the following
- /// is a grammar that will match any <tt>std::complex\<\></tt>
- /// terminal:
- ///
- /// \code
- /// BOOST_MPL_ASSERT((
- /// matches<
- /// terminal<std::complex<double> >::type
- /// , terminal<std::complex< _ > >
- /// >
- /// ));
- /// \endcode
- ///
- /// When used as a transform, \c _ returns the current expression
- /// unchanged. For instance, in the following, \c _ is used with
- /// the \c fold\<\> transform to fold the children of a node:
- ///
- /// \code
- /// struct CountChildren
- /// : or_<
- /// // Terminals have no children
- /// when<terminal<_>, mpl::int_<0>()>
- /// // Use fold<> to count the children of non-terminals
- /// , otherwise<
- /// fold<
- /// _ // <-- fold the current expression
- /// , mpl::int_<0>()
- /// , mpl::plus<_state, mpl::int_<1> >()
- /// >
- /// >
- /// >
- /// {};
- /// \endcode
- struct _ : transform<_>
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
             {
- typedef _ proto_base_expr;
+ typedef Expr result_type;
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ /// \param expr An expression
+ /// \return \c e
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
                 {
- typedef Expr result_type;
-
- /// \param expr An expression
- /// \return \c e
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
+ return e;
+ }
             };
- }
+ };
 
         namespace detail
         {
@@ -598,289 +599,286 @@
             {};
         }
 
- namespace control
+ /// \brief Inverts the set of expressions matched by a grammar. When
+ /// used as a transform, \c not_\<\> returns the current expression
+ /// unchanged.
+ ///
+ /// If an expression type \c E does not match a grammar \c G, then
+ /// \c E \e does match <tt>not_\<G\></tt>. For example,
+ /// <tt>not_\<terminal\<_\> \></tt> will match any non-terminal.
+ template<typename Grammar>
+ struct not_ : transform<not_<Grammar> >
         {
- /// \brief Inverts the set of expressions matched by a grammar. When
- /// used as a transform, \c not_\<\> returns the current expression
- /// unchanged.
- ///
- /// If an expression type \c E does not match a grammar \c G, then
- /// \c E \e does match <tt>not_\<G\></tt>. For example,
- /// <tt>not_\<terminal\<_\> \></tt> will match any non-terminal.
- template<typename Grammar>
- struct not_ : transform<not_<Grammar> >
- {
- typedef not_ proto_base_expr;
+ typedef not_ proto_grammar;
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
- /// \param e An expression
- /// \pre <tt>matches\<Expr,not_\>::::value</tt> is \c true.
- /// \return \c e
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
- };
-
- /// \brief Used to select one grammar or another based on the result
- /// of a compile-time Boolean. When used as a transform, \c if_\<\>
- /// selects between two transforms based on a compile-time Boolean.
- ///
- /// When <tt>if_\<If,Then,Else\></tt> is used as a grammar, \c If
- /// must be a Proto transform and \c Then and \c Else must be grammars.
- /// An expression type \c E matches <tt>if_\<If,Then,Else\></tt> if
- /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::::type::value</tt>
- /// is \c true and \c E matches \c U; or, if
- /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::::type::value</tt>
- /// is \c false and \c E matches \c V.
- ///
- /// The template parameter \c Then defaults to \c _
- /// and \c Else defaults to \c not\<_\>, so an expression type \c E
- /// will match <tt>if_\<If\></tt> if and only if
- /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::::type::value</tt>
- /// is \c true.
- ///
- /// \code
- /// // A grammar that only matches integral terminals,
- /// // using is_integral<> from Boost.Type_traits.
- /// struct IsIntegral
- /// : and_<
- /// terminal<_>
- /// , if_< is_integral<_value>() >
- /// >
- /// {};
- /// \endcode
- ///
- /// When <tt>if_\<If,Then,Else\></tt> is used as a transform, \c If,
- /// \c Then and \c Else must be Proto transforms. When applying
- /// the transform to an expression \c E, state \c S and data \c V,
- /// if <tt>boost::result_of\<when\<_,If\>(E,S,V)\>::::type::value</tt>
- /// is \c true then the \c Then transform is applied; otherwise
- /// the \c Else transform is applied.
- ///
- /// \code
- /// // Match a terminal. If the terminal is integral, return
- /// // mpl::true_; otherwise, return mpl::false_.
- /// struct IsIntegral2
- /// : when<
- /// terminal<_>
- /// , if_<
- /// is_integral<_value>()
- /// , mpl::true_()
- /// , mpl::false_()
- /// >
- /// >
- /// {};
- /// \endcode
- template<
- typename If
- , typename Then // = _
- , typename Else // = not_<_>
- >
- struct if_ : transform<if_<If, Then, Else> >
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
             {
- typedef if_ proto_base_expr;
+ typedef Expr result_type;
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
+ /// \param e An expression
+ /// \pre <tt>matches\<Expr,not_\>::::value</tt> is \c true.
+ /// \return \c e
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
                 {
- typedef
- typename when<_, If>::template impl<Expr, State, Data>::result_type
- condition;
-
- typedef
- typename mpl::if_c<
- remove_reference<condition>::type::value
- , when<_, Then>
- , when<_, Else>
- >::type
- which;
-
- typedef typename which::template impl<Expr, State, Data>::result_type result_type;
-
- /// \param e An expression
- /// \param s The current state
- /// \param d A data of arbitrary type
- /// \return <tt>which::impl<Expr, State, Data>()(e, s, d)</tt>
- result_type operator ()(
- typename impl::expr_param e
- , typename impl::state_param s
- , typename impl::data_param d
- ) const
- {
- return typename which::template impl<Expr, State, Data>()(e, s, d);
- }
- };
+ return e;
+ }
             };
+ };
+
+ /// \brief Used to select one grammar or another based on the result
+ /// of a compile-time Boolean. When used as a transform, \c if_\<\>
+ /// selects between two transforms based on a compile-time Boolean.
+ ///
+ /// When <tt>if_\<If,Then,Else\></tt> is used as a grammar, \c If
+ /// must be a Proto transform and \c Then and \c Else must be grammars.
+ /// An expression type \c E matches <tt>if_\<If,Then,Else\></tt> if
+ /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::::type::value</tt>
+ /// is \c true and \c E matches \c U; or, if
+ /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::::type::value</tt>
+ /// is \c false and \c E matches \c V.
+ ///
+ /// The template parameter \c Then defaults to \c _
+ /// and \c Else defaults to \c not\<_\>, so an expression type \c E
+ /// will match <tt>if_\<If\></tt> if and only if
+ /// <tt>boost::result_of\<when\<_,If\>(E,int,int)\>::::type::value</tt>
+ /// is \c true.
+ ///
+ /// \code
+ /// // A grammar that only matches integral terminals,
+ /// // using is_integral<> from Boost.Type_traits.
+ /// struct IsIntegral
+ /// : and_<
+ /// terminal<_>
+ /// , if_< is_integral<_value>() >
+ /// >
+ /// {};
+ /// \endcode
+ ///
+ /// When <tt>if_\<If,Then,Else\></tt> is used as a transform, \c If,
+ /// \c Then and \c Else must be Proto transforms. When applying
+ /// the transform to an expression \c E, state \c S and data \c V,
+ /// if <tt>boost::result_of\<when\<_,If\>(E,S,V)\>::::type::value</tt>
+ /// is \c true then the \c Then transform is applied; otherwise
+ /// the \c Else transform is applied.
+ ///
+ /// \code
+ /// // Match a terminal. If the terminal is integral, return
+ /// // mpl::true_; otherwise, return mpl::false_.
+ /// struct IsIntegral2
+ /// : when<
+ /// terminal<_>
+ /// , if_<
+ /// is_integral<_value>()
+ /// , mpl::true_()
+ /// , mpl::false_()
+ /// >
+ /// >
+ /// {};
+ /// \endcode
+ template<
+ typename If
+ , typename Then // = _
+ , typename Else // = not_<_>
+ >
+ struct if_ : transform<if_<If, Then, Else> >
+ {
+ typedef if_ proto_grammar;
 
- /// \brief For matching one of a set of alternate grammars. Alternates
- /// tried in order to avoid ambiguity. When used as a transform, \c or_\<\>
- /// applies the transform associated with the first grammar that matches
- /// the expression.
- ///
- /// An expression type \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
- /// matches any \c Bx for \c x in <tt>[0,n)</tt>.
- ///
- /// When applying <tt>or_\<B0,B1,...Bn\></tt> as a transform with an
- /// expression \c e of type \c E, state \c s and data \c d, it is
- /// equivalent to <tt>Bx()(e, s, d)</tt>, where \c x is the lowest
- /// number such that <tt>matches\<E,Bx\>::::value</tt> is \c true.
- template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
- struct or_ : transform<or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
             {
- typedef or_ proto_base_expr;
+ typedef
+ typename when<_, If>::template impl<Expr, State, Data>::result_type
+ condition;
+
+ typedef
+ typename mpl::if_c<
+ remove_reference<condition>::type::value
+ , when<_, Then>
+ , when<_, Else>
+ >::type
+ which;
+
+ typedef typename which::template impl<Expr, State, Data>::result_type result_type;
 
                 /// \param e An expression
                 /// \param s The current state
                 /// \param d A data of arbitrary type
- /// \pre <tt>matches\<Expr,or_\>::::value</tt> is \c true.
- /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is the
- /// sub-grammar that matched <tt>Expr</tt>.
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::matches_<typename Expr::proto_base_expr, or_>
- ::which::template impl<Expr, State, Data>
- {};
-
- template<typename Expr, typename State, typename Data>
- struct impl<Expr &, State, Data>
- : detail::matches_<typename Expr::proto_base_expr, or_>
- ::which::template impl<Expr &, State, Data>
- {};
+ /// \return <tt>which::impl<Expr, State, Data>()(e, s, d)</tt>
+ result_type operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param s
+ , typename impl::data_param d
+ ) const
+ {
+ return typename which::template impl<Expr, State, Data>()(e, s, d);
+ }
             };
+ };
 
- /// \brief For matching all of a set of grammars. When used as a
- /// transform, \c and_\<\> applies the transforms associated with
- /// the each grammar in the set, and returns the result of the last.
- ///
- /// An expression type \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
- /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
- ///
- /// When applying <tt>and_\<B0,B1,...Bn\></tt> as a transform with an
- /// expression \c e, state \c s and data \c d, it is
- /// equivalent to <tt>(B0()(e, s, d),B1()(e, s, d),...Bn()(e, s, d))</tt>.
- template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
- struct and_ : transform<and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
- {
- typedef and_ proto_base_expr;
+ /// \brief For matching one of a set of alternate grammars. Alternates
+ /// tried in order to avoid ambiguity. When used as a transform, \c or_\<\>
+ /// applies the transform associated with the first grammar that matches
+ /// the expression.
+ ///
+ /// An expression type \c E matches <tt>or_\<B0,B1,...Bn\></tt> if \c E
+ /// matches any \c Bx for \c x in <tt>[0,n)</tt>.
+ ///
+ /// When applying <tt>or_\<B0,B1,...Bn\></tt> as a transform with an
+ /// expression \c e of type \c E, state \c s and data \c d, it is
+ /// equivalent to <tt>Bx()(e, s, d)</tt>, where \c x is the lowest
+ /// number such that <tt>matches\<E,Bx\>::::value</tt> is \c true.
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct or_ : transform<or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ {
+ typedef or_ proto_grammar;
 
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::_and_impl<and_, Expr, State, Data>
- {};
- };
+ /// \param e An expression
+ /// \param s The current state
+ /// \param d A data of arbitrary type
+ /// \pre <tt>matches\<Expr,or_\>::::value</tt> is \c true.
+ /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is the
+ /// sub-grammar that matched <tt>Expr</tt>.
 
- /// \brief For matching one of a set of alternate grammars, which
- /// are looked up based on an expression's tag type. When used as a
- /// transform, \c switch_\<\> applies the transform associated with
- /// the grammar that matches the expression.
- ///
- /// \note \c switch_\<\> is functionally identical to \c or_\<\> but
- /// is often more efficient. It does a fast, O(1) lookup based on an
- /// expression's tag type to find a sub-grammar that may potentially
- /// match the expression.
- ///
- /// An expression type \c E matches <tt>switch_\<C\></tt> if \c E
- /// matches <tt>C::case_\<E::proto_tag\></tt>.
- ///
- /// When applying <tt>switch_\<C\></tt> as a transform with an
- /// expression \c e of type \c E, state \c s and data \c d, it is
- /// equivalent to <tt>C::case_\<E::proto_tag\>()(e, s, d)</tt>.
- template<typename Cases>
- struct switch_ : transform<switch_<Cases> >
- {
- typedef switch_ proto_base_expr;
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::matches_<typename Expr::proto_grammar, or_>
+ ::which::template impl<Expr, State, Data>
+ {};
 
- /// \param e An expression
- /// \param s The current state
- /// \param d A data of arbitrary type
- /// \pre <tt>matches\<Expr,switch_\>::::value</tt> is \c true.
- /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is
- /// <tt>Cases::case_<typename Expr::proto_tag></tt>
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : Cases::template case_<typename Expr::proto_tag>::template impl<Expr, State, Data>
- {};
-
- template<typename Expr, typename State, typename Data>
- struct impl<Expr &, State, Data>
- : Cases::template case_<typename Expr::proto_tag>::template impl<Expr &, State, Data>
- {};
- };
+ template<typename Expr, typename State, typename Data>
+ struct impl<Expr &, State, Data>
+ : detail::matches_<typename Expr::proto_grammar, or_>
+ ::which::template impl<Expr &, State, Data>
+ {};
+ };
+
+ /// \brief For matching all of a set of grammars. When used as a
+ /// transform, \c and_\<\> applies the transforms associated with
+ /// the each grammar in the set, and returns the result of the last.
+ ///
+ /// An expression type \c E matches <tt>and_\<B0,B1,...Bn\></tt> if \c E
+ /// matches all \c Bx for \c x in <tt>[0,n)</tt>.
+ ///
+ /// When applying <tt>and_\<B0,B1,...Bn\></tt> as a transform with an
+ /// expression \c e, state \c s and data \c d, it is
+ /// equivalent to <tt>(B0()(e, s, d),B1()(e, s, d),...Bn()(e, s, d))</tt>.
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct and_ : transform<and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ {
+ typedef and_ proto_grammar;
 
- /// \brief For forcing exact matches of terminal types.
- ///
- /// By default, matching terminals ignores references and
- /// cv-qualifiers. For instance, a terminal expression of
- /// type <tt>terminal\<int const &\>::::type</tt> will match
- /// the grammar <tt>terminal\<int\></tt>. If that is not
- /// desired, you can force an exact match with
- /// <tt>terminal\<exact\<int\> \></tt>. This will only
- /// match integer terminals where the terminal is held by
- /// value.
- template<typename T>
- struct exact
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::_and_impl<and_, Expr, State, Data>
             {};
+ };
 
- /// \brief For matching terminals that are convertible to
- /// a type.
- ///
- /// Use \c convertible_to\<\> to match a terminal that is
- /// convertible to some type. For example, the grammar
- /// <tt>terminal\<convertible_to\<int\> \></tt> will match
- /// any terminal whose argument is convertible to an integer.
- ///
- /// \note The trait \c is_convertible\<\> from Boost.Type_traits
- /// is used to determinal convertibility.
- template<typename T>
- struct convertible_to
+ /// \brief For matching one of a set of alternate grammars, which
+ /// are looked up based on an expression's tag type. When used as a
+ /// transform, \c switch_\<\> applies the transform associated with
+ /// the grammar that matches the expression.
+ ///
+ /// \note \c switch_\<\> is functionally identical to \c or_\<\> but
+ /// is often more efficient. It does a fast, O(1) lookup based on an
+ /// expression's tag type to find a sub-grammar that may potentially
+ /// match the expression.
+ ///
+ /// An expression type \c E matches <tt>switch_\<C\></tt> if \c E
+ /// matches <tt>C::case_\<E::proto_tag\></tt>.
+ ///
+ /// When applying <tt>switch_\<C\></tt> as a transform with an
+ /// expression \c e of type \c E, state \c s and data \c d, it is
+ /// equivalent to <tt>C::case_\<E::proto_tag\>()(e, s, d)</tt>.
+ template<typename Cases>
+ struct switch_ : transform<switch_<Cases> >
+ {
+ typedef switch_ proto_grammar;
+
+ /// \param e An expression
+ /// \param s The current state
+ /// \param d A data of arbitrary type
+ /// \pre <tt>matches\<Expr,switch_\>::::value</tt> is \c true.
+ /// \return <tt>which()(e, s, d)</tt>, where <tt>which</tt> is
+ /// <tt>Cases::case_<typename Expr::proto_tag></tt>
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : Cases::template case_<typename Expr::proto_tag>::template impl<Expr, State, Data>
             {};
 
- /// \brief For matching a Grammar to a variable number of
- /// sub-expressions.
- ///
- /// An expression type <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
- /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
- /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
- /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
- /// for each \c x in <tt>[0,m)</tt>.
- ///
- /// For example:
- ///
- /// \code
- /// // Match any function call expression, irregardless
- /// // of the number of function arguments:
- /// struct Function
- /// : function< vararg<_> >
- /// {};
- /// \endcode
- ///
- /// When used as a transform, <tt>vararg\<G\></tt> applies
- /// <tt>G</tt>'s transform.
- template<typename Grammar>
- struct vararg
- : Grammar
- {
- /// INTERNAL ONLY
- typedef void proto_is_vararg_;
- };
- }
+ template<typename Expr, typename State, typename Data>
+ struct impl<Expr &, State, Data>
+ : Cases::template case_<typename Expr::proto_tag>::template impl<Expr &, State, Data>
+ {};
+ };
+
+ /// \brief For forcing exact matches of terminal types.
+ ///
+ /// By default, matching terminals ignores references and
+ /// cv-qualifiers. For instance, a terminal expression of
+ /// type <tt>terminal\<int const &\>::::type</tt> will match
+ /// the grammar <tt>terminal\<int\></tt>. If that is not
+ /// desired, you can force an exact match with
+ /// <tt>terminal\<exact\<int\> \></tt>. This will only
+ /// match integer terminals where the terminal is held by
+ /// value.
+ template<typename T>
+ struct exact
+ {};
+
+ /// \brief For matching terminals that are convertible to
+ /// a type.
+ ///
+ /// Use \c convertible_to\<\> to match a terminal that is
+ /// convertible to some type. For example, the grammar
+ /// <tt>terminal\<convertible_to\<int\> \></tt> will match
+ /// any terminal whose argument is convertible to an integer.
+ ///
+ /// \note The trait \c is_convertible\<\> from Boost.Type_traits
+ /// is used to determinal convertibility.
+ template<typename T>
+ struct convertible_to
+ {};
+
+ /// \brief For matching a Grammar to a variable number of
+ /// sub-expressions.
+ ///
+ /// An expression type <tt>expr\<AT, listN\<A0,...An,U0,...Um\> \></tt>
+ /// matches a grammar <tt>expr\<BT, listM\<B0,...Bn,vararg\<V\> \> \></tt>
+ /// if \c BT is \c _ or \c AT, and if \c Ax matches \c Bx
+ /// for each \c x in <tt>[0,n)</tt> and if \c Ux matches \c V
+ /// for each \c x in <tt>[0,m)</tt>.
+ ///
+ /// For example:
+ ///
+ /// \code
+ /// // Match any function call expression, irregardless
+ /// // of the number of function arguments:
+ /// struct Function
+ /// : function< vararg<_> >
+ /// {};
+ /// \endcode
+ ///
+ /// When used as a transform, <tt>vararg\<G\></tt> applies
+ /// <tt>G</tt>'s transform.
+ template<typename Grammar>
+ struct vararg
+ : Grammar
+ {
+ /// INTERNAL ONLY
+ typedef void proto_is_vararg_;
+ };
 
         /// INTERNAL ONLY
         ///
@@ -981,13 +979,13 @@
             template<bool B, typename Expr, BOOST_PP_ENUM_PARAMS(N, typename G)>
             struct BOOST_PP_CAT(or_, N)
             #if 2 == N
- : mpl::bool_<matches_<Expr, typename G1::proto_base_expr>::value>
+ : mpl::bool_<matches_<Expr, typename G1::proto_grammar>::value>
             {
                 typedef G1 which;
             };
             #else
               : BOOST_PP_CAT(or_, BOOST_PP_DEC(N))<
- matches_<Expr, typename G1::proto_base_expr>::value
+ matches_<Expr, typename G1::proto_grammar>::value
                   , Expr, BOOST_PP_ENUM_SHIFTED_PARAMS(N, G)
>
             {};
@@ -1004,8 +1002,8 @@
             template<typename Expr, BOOST_PP_ENUM_PARAMS(N, typename G)>
             struct matches_<Expr, proto::or_<BOOST_PP_ENUM_PARAMS(N, G)> >
               : BOOST_PP_CAT(or_, N)<
- matches_<typename Expr::proto_base_expr, typename G0::proto_base_expr>::value,
- typename Expr::proto_base_expr, BOOST_PP_ENUM_PARAMS(N, G)
+ matches_<Expr, typename G0::proto_grammar>::value,
+ Expr, BOOST_PP_ENUM_PARAMS(N, G)
>
             {};
 
@@ -1029,7 +1027,7 @@
             struct vararg_matches_impl<Args, Back, N, To>
               : and_2<
                     matches_<
- typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_base_expr
+ typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
                                           , Back
>::value
                   , vararg_matches_impl<Args, Back, N + 1, To>
@@ -1039,7 +1037,7 @@
             template<typename Args, typename Back>
             struct vararg_matches_impl<Args, Back, N, N>
               : matches_<
- typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_base_expr
+ typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_grammar
                                   , Back
>
             {};
@@ -1061,7 +1059,7 @@
             {};
 
             template<typename Tag, typename Args1, typename Args2>
- struct matches_< proto::expr<Tag, Args1, N>, proto::expr<Tag, Args2, N> >
+ struct matches_< proto::basic_expr<Tag, Args1, N>, proto::basic_expr<Tag, Args2, N> >
               : BOOST_PP_CAT(and_, N)<
                     BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
                     BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)
@@ -1069,7 +1067,7 @@
             {};
 
             template<typename Tag, typename Args1, typename Args2>
- struct matches_< proto::expr<Tag, Args1, N>, proto::expr<proto::_, Args2, N> >
+ struct matches_< proto::basic_expr<Tag, Args1, N>, proto::basic_expr<proto::_, Args2, N> >
               : BOOST_PP_CAT(and_, N)<
                     BOOST_PROTO_MATCHES_N_FUN(~, 0, ~)::value,
                     BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_MATCHES_N_FUN, ~)

Modified: trunk/boost/proto/operators.hpp
==============================================================================
--- trunk/boost/proto/operators.hpp (original)
+++ trunk/boost/proto/operators.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -15,7 +15,6 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/proto/proto_fwd.hpp>
 #include <boost/proto/tags.hpp>
-#include <boost/proto/expr.hpp>
 #include <boost/proto/domain.hpp>
 #include <boost/proto/matches.hpp>
 #include <boost/proto/generate.hpp>
@@ -43,7 +42,10 @@
 
         template<typename Domain, typename Trait, typename Tag, typename Arg>
         struct enable_unary<Domain, proto::_, Trait, Tag, Arg>
- : boost::lazy_enable_if_c<Trait::value, result_of::make_expr<Tag, Domain, Arg &> >
+ : boost::lazy_enable_if_c<
+ Trait::value
+ , result_of::make_expr<Tag, Domain, Arg &>
+ >
         {};
 
         template<typename Trait, typename Tag, typename Arg>
@@ -62,8 +64,8 @@
           : boost::lazy_enable_if_c<
                 boost::mpl::and_<
                     Trait
- , lazy_matches<proto::result_of::as_child<Left>, Grammar>
- , lazy_matches<proto::result_of::as_child<Right>, Grammar>
+ , lazy_matches<result_of::as_child<Left>, Grammar>
+ , lazy_matches<result_of::as_child<Right>, Grammar>
                   , lazy_matches<result_of::make_expr<Tag, Domain, Left &, Right &>, Grammar>
>::value
               , result_of::make_expr<Tag, Domain, Left &, Right &>
@@ -72,7 +74,10 @@
 
         template<typename Domain, typename Trait, typename Tag, typename Left, typename Right>
         struct enable_binary<Domain, proto::_, Trait, Tag, Left, Right>
- : boost::lazy_enable_if_c<Trait::value, result_of::make_expr<Tag, Domain, Left &, Right &> >
+ : boost::lazy_enable_if_c<
+ Trait::value
+ , result_of::make_expr<Tag, Domain, Left &, Right &>
+ >
         {};
 
         template<typename Trait, typename Tag, typename Left, typename Right>
@@ -103,7 +108,7 @@
>::type const \
     operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg &>()(arg); \
+ return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg &>()(arg); \
     } \
                                                                                                     \
     template<typename Arg> \
@@ -116,7 +121,7 @@
>::type const \
     operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg const &>()(arg); \
+ return boost::proto::detail::make_expr_<TAG, DOMAIN, Arg const &>()(arg); \
     } \
     /**/
 
@@ -132,8 +137,7 @@
>::type const \
     operator OP(Left &left, Right &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
- impl<Left &, Right &>()(left, right); \
+ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left &, Right &>()(left, right); \
     } \
                                                                                                     \
     template<typename Left, typename Right> \
@@ -147,8 +151,7 @@
>::type const \
     operator OP(Left &left, Right const &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
- impl<Left &, Right const &>()(left, right); \
+ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left &, Right const &>()(left, right); \
     } \
                                                                                                     \
     template<typename Left, typename Right> \
@@ -162,8 +165,7 @@
>::type const \
     operator OP(Left const &left, Right &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
- impl<Left const &, Right &>()(left, right); \
+ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right &>()(left, right); \
     } \
                                                                                                     \
     template<typename Left, typename Right> \
@@ -177,8 +179,7 @@
>::type const \
     operator OP(Left const &left, Right const &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
- impl<Left const &, Right const &>()(left, right); \
+ return boost::proto::detail::make_expr_<TAG, DOMAIN, Left const &, Right const &>()(left, right);\
     } \
     /**/
 
@@ -241,10 +242,22 @@
 
         // if_else, for the non-overloadable ternary conditional operator ?:
         template<typename A0, typename A1, typename A2>
- typename result_of::make_expr<tag::if_else_, deduce_domain, A0 const &, A1 const &, A2 const &>::type const
+ typename result_of::make_expr<
+ tag::if_else_
+ , deduce_domain
+ , A0 const &
+ , A1 const &
+ , A2 const &
+ >::type const
         if_else(A0 const &a0, A1 const &a1, A2 const &a2)
         {
- return functional::make_expr<tag::if_else_>::impl<A0 const &, A1 const &, A2 const &>()(a0, a1, a2);
+ return proto::detail::make_expr_<
+ tag::if_else_
+ , deduce_domain
+ , A0 const &
+ , A1 const &
+ , A2 const &
+ >()(a0, a1, a2);
         }
     }
 

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -92,6 +92,7 @@
 
         struct dont_care;
         struct undefined; // leave this undefined
+ struct not_a_valid_type;
 
         struct private_type_
         {
@@ -243,61 +244,40 @@
     }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////
- namespace wildcardns_
- {
- struct _;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////
-
- using wildcardns_::_;
+ struct _;
 
     ////////////////////////////////////////////////////////////////////////////////////////////////
- namespace generatorns_
- {
- struct default_generator;
+ struct default_generator;
 
- template<template<typename> class Extends>
- struct generator;
+ template<template<typename> class Extends>
+ struct generator;
 
- template<template<typename> class Extends>
- struct pod_generator;
+ template<template<typename> class Extends>
+ struct pod_generator;
 
- struct by_value_generator;
+ struct by_value_generator;
 
- template<typename First, typename Second>
- struct compose_generators;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////
-
- using generatorns_::default_generator;
- using generatorns_::generator;
- using generatorns_::pod_generator;
- using generatorns_::by_value_generator;
- using generatorns_::compose_generators;
+ template<typename First, typename Second>
+ struct compose_generators;
 
     ////////////////////////////////////////////////////////////////////////////////////////////////
- namespace domainns_
- {
- template<
- typename Generator = default_generator
- , typename Grammar = proto::_
- , typename Super = detail::not_a_domain
- >
- struct domain;
-
- struct default_domain;
+ template<
+ typename Generator = default_generator
+ , typename Grammar = proto::_
+ , typename Super = detail::not_a_domain
+ >
+ struct domain;
 
- struct deduce_domain;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////
+ struct default_domain;
 
- using domainns_::domain;
- using domainns_::default_domain;
- using domainns_::deduce_domain;
+ struct deduce_domain;
 
     ////////////////////////////////////////////////////////////////////////////////////////////////
     namespace exprns_
     {
+ template<typename Tag, typename Args, long Arity>
+ struct basic_expr;
+
         template<typename Tag, typename Args, long Arity = Args::arity>
         struct expr;
 
@@ -317,47 +297,35 @@
     ////////////////////////////////////////////////////////////////////////////////////////////////
 
     using exprns_::expr;
+ using exprns_::basic_expr;
     using exprns_::extends;
     using exprns_::is_proto_expr;
 
- namespace control
- {
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
- struct or_;
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
+ struct or_;
 
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
- struct and_;
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
+ struct and_;
 
- template<typename Grammar>
- struct not_;
+ template<typename Grammar>
+ struct not_;
 
- template<typename Condition, typename Then = _, typename Else = not_<_> >
- struct if_;
+ template<typename Condition, typename Then = _, typename Else = not_<_> >
+ struct if_;
 
- template<typename Cases>
- struct switch_;
+ template<typename Cases>
+ struct switch_;
 
- template<typename T>
- struct exact;
-
- template<typename T>
- struct convertible_to;
+ template<typename T>
+ struct exact;
 
- template<typename Grammar>
- struct vararg;
+ template<typename T>
+ struct convertible_to;
 
- int const N = INT_MAX;
- }
+ template<typename Grammar>
+ struct vararg;
 
- using control::if_;
- using control::or_;
- using control::and_;
- using control::not_;
- using control::switch_;
- using control::exact;
- using control::convertible_to;
- using control::vararg;
- using control::N;
+ int const N = INT_MAX;
 
     namespace context
     {
@@ -448,100 +416,89 @@
         template<typename Tag, typename DomainOrSequence, typename SequenceOrVoid = void, typename Void = void>
         struct unpack_expr;
 
- template<typename T, typename Void = void>
- struct is_expr;
-
- template<typename T, typename Void = void>
- struct is_domain;
+ }
 
- template<typename Expr>
- struct tag_of;
+ template<typename T, typename Void = void>
+ struct is_expr;
 
- template<typename Expr>
- struct arity_of;
+ template<typename T, typename Void = void>
+ struct is_domain;
 
- template<typename T, typename Void = void>
- struct domain_of;
+ template<typename Expr>
+ struct tag_of;
 
- template<typename Expr, typename Grammar>
- struct matches;
- }
+ template<typename Expr>
+ struct arity_of;
 
- using result_of::is_expr;
- using result_of::is_domain;
- using result_of::tag_of;
- using result_of::arity_of;
- using result_of::domain_of;
- using result_of::matches;
+ template<typename T, typename Void = void>
+ struct domain_of;
 
- namespace op
- {
- // Generic expression metafunctions and
- // grammar elements
- template<typename Tag, typename Arg>
- struct unary_expr;
-
- template<typename Tag, typename Left, typename Right>
- struct binary_expr;
-
- template<typename Tag, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
- struct nary_expr;
-
- // Specific expression metafunctions and
- // grammar elements, for convenience
- template<typename T> struct terminal;
- template<typename T> struct unary_plus;
- template<typename T> struct negate;
- template<typename T> struct dereference;
- template<typename T> struct complement;
- template<typename T> struct address_of;
- template<typename T> struct logical_not;
- template<typename T> struct pre_inc;
- template<typename T> struct pre_dec;
- template<typename T> struct post_inc;
- template<typename T> struct post_dec;
-
- template<typename T, typename U> struct shift_left;
- template<typename T, typename U> struct shift_right;
- template<typename T, typename U> struct multiplies;
- template<typename T, typename U> struct divides;
- template<typename T, typename U> struct modulus;
- template<typename T, typename U> struct plus;
- template<typename T, typename U> struct minus;
- template<typename T, typename U> struct less;
- template<typename T, typename U> struct greater;
- template<typename T, typename U> struct less_equal;
- template<typename T, typename U> struct greater_equal;
- template<typename T, typename U> struct equal_to;
- template<typename T, typename U> struct not_equal_to;
- template<typename T, typename U> struct logical_or;
- template<typename T, typename U> struct logical_and;
- template<typename T, typename U> struct bitwise_and;
- template<typename T, typename U> struct bitwise_or;
- template<typename T, typename U> struct bitwise_xor;
- template<typename T, typename U> struct comma;
- template<typename T, typename U> struct mem_ptr;
-
- template<typename T, typename U> struct assign;
- template<typename T, typename U> struct shift_left_assign;
- template<typename T, typename U> struct shift_right_assign;
- template<typename T, typename U> struct multiplies_assign;
- template<typename T, typename U> struct divides_assign;
- template<typename T, typename U> struct modulus_assign;
- template<typename T, typename U> struct plus_assign;
- template<typename T, typename U> struct minus_assign;
- template<typename T, typename U> struct bitwise_and_assign;
- template<typename T, typename U> struct bitwise_or_assign;
- template<typename T, typename U> struct bitwise_xor_assign;
- template<typename T, typename U> struct subscript;
- template<typename T, typename U> struct member;
- template<typename T, typename U, typename V> struct if_else_;
+ template<typename Expr, typename Grammar>
+ struct matches;
 
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
- struct function;
- }
+ // Generic expression metafunctions and
+ // grammar elements
+ template<typename Tag, typename Arg>
+ struct unary_expr;
+
+ template<typename Tag, typename Left, typename Right>
+ struct binary_expr;
+
+ template<typename Tag, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
+ struct nary_expr;
+
+ // Specific expression metafunctions and
+ // grammar elements, for convenience
+ template<typename T> struct terminal;
+ template<typename T> struct unary_plus;
+ template<typename T> struct negate;
+ template<typename T> struct dereference;
+ template<typename T> struct complement;
+ template<typename T> struct address_of;
+ template<typename T> struct logical_not;
+ template<typename T> struct pre_inc;
+ template<typename T> struct pre_dec;
+ template<typename T> struct post_inc;
+ template<typename T> struct post_dec;
+
+ template<typename T, typename U> struct shift_left;
+ template<typename T, typename U> struct shift_right;
+ template<typename T, typename U> struct multiplies;
+ template<typename T, typename U> struct divides;
+ template<typename T, typename U> struct modulus;
+ template<typename T, typename U> struct plus;
+ template<typename T, typename U> struct minus;
+ template<typename T, typename U> struct less;
+ template<typename T, typename U> struct greater;
+ template<typename T, typename U> struct less_equal;
+ template<typename T, typename U> struct greater_equal;
+ template<typename T, typename U> struct equal_to;
+ template<typename T, typename U> struct not_equal_to;
+ template<typename T, typename U> struct logical_or;
+ template<typename T, typename U> struct logical_and;
+ template<typename T, typename U> struct bitwise_and;
+ template<typename T, typename U> struct bitwise_or;
+ template<typename T, typename U> struct bitwise_xor;
+ template<typename T, typename U> struct comma;
+ template<typename T, typename U> struct mem_ptr;
+
+ template<typename T, typename U> struct assign;
+ template<typename T, typename U> struct shift_left_assign;
+ template<typename T, typename U> struct shift_right_assign;
+ template<typename T, typename U> struct multiplies_assign;
+ template<typename T, typename U> struct divides_assign;
+ template<typename T, typename U> struct modulus_assign;
+ template<typename T, typename U> struct plus_assign;
+ template<typename T, typename U> struct minus_assign;
+ template<typename T, typename U> struct bitwise_and_assign;
+ template<typename T, typename U> struct bitwise_or_assign;
+ template<typename T, typename U> struct bitwise_xor_assign;
+ template<typename T, typename U> struct subscript;
+ template<typename T, typename U> struct member;
+ template<typename T, typename U, typename V> struct if_else_;
 
- using namespace op;
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
+ struct function;
 
     namespace functional
     {
@@ -725,7 +682,8 @@
     template<typename Sequence, typename State, typename Fun>
     struct reverse_fold;
 
- // BUGBUG can we replace fold_tree with fold<flatten(_), state, fun> ?
+ // Q: can we replace fold_tree with fold<flatten(_), state, fun> ?
+ // A: once segmented Fusion works well.
     template<typename Sequence, typename State, typename Fun>
     struct fold_tree;
 

Modified: trunk/boost/proto/proto_typeof.hpp
==============================================================================
--- trunk/boost/proto/proto_typeof.hpp (original)
+++ trunk/boost/proto/proto_typeof.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -65,12 +65,13 @@
 
 BOOST_TYPEOF_REGISTER_TYPE(boost::proto::exprns_::is_proto_expr)
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::exprns_::expr, (typename)(typename)(long))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::exprns_::basic_expr, (typename)(typename)(long))
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::utility::literal, (typename)(typename))
 
 BOOST_TYPEOF_REGISTER_TYPE(boost::proto::detail::not_a_generator)
 BOOST_TYPEOF_REGISTER_TYPE(boost::proto::detail::not_a_grammar)
 BOOST_TYPEOF_REGISTER_TYPE(boost::proto::detail::not_a_domain)
-BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::domainns_::domain, 3)
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::domain, 3)
 
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::argsns_::term, 1)
 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::proto::argsns_::list1, 1)

Modified: trunk/boost/proto/traits.hpp
==============================================================================
--- trunk/boost/proto/traits.hpp (original)
+++ trunk/boost/proto/traits.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -162,67 +162,67 @@
           : mpl::true_
         {};
 
- namespace result_of
- {
- /// \brief A Boolean metafunction that indicates whether a given
- /// type \c T is a Proto expression type.
- ///
- /// If \c T has a nested type \c proto_is_expr_ that is a typedef
- /// for \c void, <tt>is_expr\<T\>::::value</tt> is \c true. (Note, this
- /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
- /// from <tt>proto::extends\<\></tt> or that uses the
- /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
- /// <tt>is_expr\<T\>::::value</tt> is \c false.
- template<typename T, typename Void /* = void*/>
- struct is_expr
- : mpl::false_
- {};
+ /// \brief A Boolean metafunction that indicates whether a given
+ /// type \c T is a Proto expression type.
+ ///
+ /// If \c T has a nested type \c proto_is_expr_ that is a typedef
+ /// for \c void, <tt>is_expr\<T\>::::value</tt> is \c true. (Note, this
+ /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
+ /// from <tt>proto::extends\<\></tt> or that uses the
+ /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
+ /// <tt>is_expr\<T\>::::value</tt> is \c false.
+ template<typename T, typename Void /* = void*/>
+ struct is_expr
+ : mpl::false_
+ {};
 
- /// \brief A Boolean metafunction that indicates whether a given
- /// type \c T is a Proto expression type.
- ///
- /// If \c T has a nested type \c proto_is_expr_ that is a typedef
- /// for \c void, <tt>is_expr\<T\>::::value</tt> is \c true. (Note, this
- /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
- /// from <tt>proto::extends\<\></tt> or that uses the
- /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
- /// <tt>is_expr\<T\>::::value</tt> is \c false.
- template<typename T>
- struct is_expr<T, typename T::proto_is_expr_>
- : mpl::true_
- {};
+ /// \brief A Boolean metafunction that indicates whether a given
+ /// type \c T is a Proto expression type.
+ ///
+ /// If \c T has a nested type \c proto_is_expr_ that is a typedef
+ /// for \c void, <tt>is_expr\<T\>::::value</tt> is \c true. (Note, this
+ /// is the case for <tt>proto::expr\<\></tt>, any type that is derived
+ /// from <tt>proto::extends\<\></tt> or that uses the
+ /// <tt>BOOST_PROTO_BASIC_EXTENDS()</tt> macro.) Otherwise,
+ /// <tt>is_expr\<T\>::::value</tt> is \c false.
+ template<typename T>
+ struct is_expr<T, typename T::proto_is_expr_>
+ : mpl::true_
+ {};
             
- template<typename T>
- struct is_expr<T &, void>
- : is_expr<T>
- {};
+ template<typename T>
+ struct is_expr<T &, void>
+ : is_expr<T>
+ {};
 
- /// \brief A metafunction that returns the tag type of a
- /// Proto expression.
- template<typename Expr>
- struct tag_of
- {
- typedef typename Expr::proto_tag type;
- };
+ /// \brief A metafunction that returns the tag type of a
+ /// Proto expression.
+ template<typename Expr>
+ struct tag_of
+ {
+ typedef typename Expr::proto_tag type;
+ };
 
- template<typename Expr>
- struct tag_of<Expr &>
- {
- typedef typename Expr::proto_tag type;
- };
+ template<typename Expr>
+ struct tag_of<Expr &>
+ {
+ typedef typename Expr::proto_tag type;
+ };
 
- /// \brief A metafunction that returns the arity of a
- /// Proto expression.
- template<typename Expr>
- struct arity_of
- : Expr::proto_arity
- {};
+ /// \brief A metafunction that returns the arity of a
+ /// Proto expression.
+ template<typename Expr>
+ struct arity_of
+ : Expr::proto_arity
+ {};
 
- template<typename Expr>
- struct arity_of<Expr &>
- : Expr::proto_arity
- {};
+ template<typename Expr>
+ struct arity_of<Expr &>
+ : Expr::proto_arity
+ {};
 
+ namespace result_of
+ {
             /// \brief A metafunction that computes the return type of the \c as_expr()
             /// function.
             ///
@@ -528,258 +528,254 @@
 
         } // namespace result_of
 
- namespace op
+ /// \brief A metafunction for generating terminal expression types,
+ /// a grammar element for matching terminal expressions, and a
+ /// PrimitiveTransform that returns the current expression unchanged.
+ template<typename T>
+ struct terminal
+ : proto::transform<terminal<T>, int>
         {
- /// \brief A metafunction for generating terminal expression types,
- /// a grammar element for matching terminal expressions, and a
- /// PrimitiveTransform that returns the current expression unchanged.
- template<typename T>
- struct terminal
- : proto::transform<terminal<T>, int>
- {
- typedef proto::expr<proto::tag::terminal, term<T>, 0> type;
- typedef type proto_base_expr;
+ typedef proto::expr<proto::tag::terminal, term<T>, 0> type;
+ typedef proto::basic_expr<proto::tag::terminal, term<T>, 0> proto_grammar;
 
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
- /// \param e The current expression
- /// \pre <tt>matches\<Expr, terminal\<T\> \>::::value</tt> is \c true.
- /// \return \c e
- /// \throw nothrow
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator ()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
-
- /// INTERNAL ONLY
- typedef proto::tag::terminal proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- };
-
- /// \brief A metafunction for generating ternary conditional expression types,
- /// a grammar element for matching ternary conditional expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- template<typename T, typename U, typename V>
- struct if_else_
- : proto::transform<if_else_<T, U, V>, int>
- {
- typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type;
- typedef type proto_base_expr;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<if_else_, Expr, State, Data>
- {};
-
- /// INTERNAL ONLY
- typedef proto::tag::if_else_ proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- /// INTERNAL ONLY
- typedef U proto_child1;
- /// INTERNAL ONLY
- typedef V proto_child2;
- };
-
- /// \brief A metafunction for generating nullary expression types with a
- /// specified tag type,
- /// a grammar element for matching nullary expressions, and a
- /// PrimitiveTransform that returns the current expression unchanged.
- ///
- /// Use <tt>nullary_expr\<_, _\></tt> as a grammar element to match any
- /// nullary expression.
- template<typename Tag, typename T>
- struct nullary_expr
- : proto::transform<nullary_expr<Tag, T>, int>
- {
- typedef proto::expr<Tag, term<T>, 0> type;
- typedef type proto_base_expr;
-
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef Expr result_type;
-
- /// \param e The current expression
- /// \pre <tt>matches\<Expr, nullary_expr\<Tag, T\> \>::::value</tt> is \c true.
- /// \return \c e
- /// \throw nothrow
- #ifdef BOOST_PROTO_STRICT_RESULT_OF
- result_type
- #else
- typename impl::expr_param
- #endif
- operator ()(
- typename impl::expr_param e
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return e;
- }
- };
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
 
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
+ /// \param e The current expression
+ /// \pre <tt>matches\<Expr, terminal\<T\> \>::::value</tt> is \c true.
+ /// \return \c e
+ /// \throw nothrow
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ return e;
+ }
             };
 
- /// \brief A metafunction for generating unary expression types with a
- /// specified tag type,
- /// a grammar element for matching unary expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- ///
- /// Use <tt>unary_expr\<_, _\></tt> as a grammar element to match any
- /// unary expression.
- template<typename Tag, typename T>
- struct unary_expr
- : proto::transform<unary_expr<Tag, T>, int>
- {
- typedef proto::expr<Tag, list1<T>, 1> type;
- typedef type proto_base_expr;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<unary_expr, Expr, State, Data>
- {};
+ /// INTERNAL ONLY
+ typedef proto::tag::terminal proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ };
+
+ /// \brief A metafunction for generating ternary conditional expression types,
+ /// a grammar element for matching ternary conditional expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ template<typename T, typename U, typename V>
+ struct if_else_
+ : proto::transform<if_else_<T, U, V>, int>
+ {
+ typedef proto::expr<proto::tag::if_else_, list3<T, U, V>, 3> type;
+ typedef proto::basic_expr<proto::tag::if_else_, list3<T, U, V>, 3> proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<if_else_, Expr, State, Data>
+ {};
 
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
+ /// INTERNAL ONLY
+ typedef proto::tag::if_else_ proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ /// INTERNAL ONLY
+ typedef U proto_child1;
+ /// INTERNAL ONLY
+ typedef V proto_child2;
+ };
+
+ /// \brief A metafunction for generating nullary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching nullary expressions, and a
+ /// PrimitiveTransform that returns the current expression unchanged.
+ ///
+ /// Use <tt>nullary_expr\<_, _\></tt> as a grammar element to match any
+ /// nullary expression.
+ template<typename Tag, typename T>
+ struct nullary_expr
+ : proto::transform<nullary_expr<Tag, T>, int>
+ {
+ typedef proto::expr<Tag, term<T>, 0> type;
+ typedef proto::basic_expr<Tag, term<T>, 0> proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl : transform_impl<Expr, State, Data>
+ {
+ typedef Expr result_type;
+
+ /// \param e The current expression
+ /// \pre <tt>matches\<Expr, nullary_expr\<Tag, T\> \>::::value</tt> is \c true.
+ /// \return \c e
+ /// \throw nothrow
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
+ result_type
+ #else
+ typename impl::expr_param
+ #endif
+ operator ()(
+ typename impl::expr_param e
+ , typename impl::state_param
+ , typename impl::data_param
+ ) const
+ {
+ return e;
+ }
             };
 
- /// \brief A metafunction for generating binary expression types with a
- /// specified tag type,
- /// a grammar element for matching binary expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- ///
- /// Use <tt>binary_expr\<_, _, _\></tt> as a grammar element to match any
- /// binary expression.
- template<typename Tag, typename T, typename U>
- struct binary_expr
- : proto::transform<binary_expr<Tag, T, U>, int>
- {
- typedef proto::expr<Tag, list2<T, U>, 2> type;
- typedef type proto_base_expr;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<binary_expr, Expr, State, Data>
- {};
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ };
+
+ /// \brief A metafunction for generating unary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching unary expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ ///
+ /// Use <tt>unary_expr\<_, _\></tt> as a grammar element to match any
+ /// unary expression.
+ template<typename Tag, typename T>
+ struct unary_expr
+ : proto::transform<unary_expr<Tag, T>, int>
+ {
+ typedef proto::expr<Tag, list1<T>, 1> type;
+ typedef proto::basic_expr<Tag, list1<T>, 1> proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<unary_expr, Expr, State, Data>
+ {};
 
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- /// INTERNAL ONLY
- typedef T proto_child0;
- /// INTERNAL ONLY
- typedef U proto_child1;
- };
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ };
+
+ /// \brief A metafunction for generating binary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching binary expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ ///
+ /// Use <tt>binary_expr\<_, _, _\></tt> as a grammar element to match any
+ /// binary expression.
+ template<typename Tag, typename T, typename U>
+ struct binary_expr
+ : proto::transform<binary_expr<Tag, T, U>, int>
+ {
+ typedef proto::expr<Tag, list2<T, U>, 2> type;
+ typedef proto::basic_expr<Tag, list2<T, U>, 2> proto_grammar;
+
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<binary_expr, Expr, State, Data>
+ {};
 
- #define BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(Op) \
- template<typename T> \
- struct Op \
- : proto::transform<Op<T>, int> \
- { \
- typedef proto::expr<proto::tag::Op, list1<T>, 1> type; \
- typedef type proto_base_expr; \
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ /// INTERNAL ONLY
+ typedef U proto_child1;
+ };
+
+ #define BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(Op) \
+ template<typename T> \
+ struct Op \
+ : proto::transform<Op<T>, int> \
+ { \
+ typedef proto::expr<proto::tag::Op, list1<T>, 1> type; \
+ typedef proto::basic_expr<proto::tag::Op, list1<T>, 1> proto_grammar; \
                                                                                                     \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : detail::pass_through_impl<Op, Expr, State, Data> \
- {}; \
+ template<typename Expr, typename State, typename Data> \
+ struct impl \
+ : detail::pass_through_impl<Op, Expr, State, Data> \
+ {}; \
                                                                                                     \
- typedef proto::tag::Op proto_tag; \
- typedef T proto_child0; \
- }; \
- /**/
-
- #define BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(Op) \
- template<typename T, typename U> \
- struct Op \
- : proto::transform<Op<T, U>, int> \
- { \
- typedef proto::expr<proto::tag::Op, list2<T, U>, 2> type; \
- typedef type proto_base_expr; \
+ typedef proto::tag::Op proto_tag; \
+ typedef T proto_child0; \
+ }; \
+ /**/
+
+ #define BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(Op) \
+ template<typename T, typename U> \
+ struct Op \
+ : proto::transform<Op<T, U>, int> \
+ { \
+ typedef proto::expr<proto::tag::Op, list2<T, U>, 2> type; \
+ typedef proto::basic_expr<proto::tag::Op, list2<T, U>, 2> proto_grammar; \
                                                                                                     \
- template<typename Expr, typename State, typename Data> \
- struct impl \
- : detail::pass_through_impl<Op, Expr, State, Data> \
- {}; \
+ template<typename Expr, typename State, typename Data> \
+ struct impl \
+ : detail::pass_through_impl<Op, Expr, State, Data> \
+ {}; \
                                                                                                     \
- typedef proto::tag::Op proto_tag; \
- typedef T proto_child0; \
- typedef U proto_child1; \
- }; \
- /**/
-
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(unary_plus)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(negate)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(dereference)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(complement)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(address_of)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(logical_not)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_inc)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_dec)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_inc)
- BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_dec)
-
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less_equal)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater_equal)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(equal_to)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(not_equal_to)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_or)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_and)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(comma)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(mem_ptr)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor_assign)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(subscript)
- BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(member)
+ typedef proto::tag::Op proto_tag; \
+ typedef T proto_child0; \
+ typedef U proto_child1; \
+ }; \
+ /**/
 
- #undef BOOST_PROTO_DEFINE_UNARY_METAFUNCTION
- #undef BOOST_PROTO_DEFINE_BINARY_METAFUNCTION
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(unary_plus)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(negate)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(dereference)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(complement)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(address_of)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(logical_not)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_inc)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(pre_dec)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_inc)
+ BOOST_PROTO_DEFINE_UNARY_METAFUNCTION(post_dec)
+
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(less_equal)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(greater_equal)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(equal_to)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(not_equal_to)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_or)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(logical_and)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(comma)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(mem_ptr)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_left_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(shift_right_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(multiplies_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(divides_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(modulus_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(plus_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(minus_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_or_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_and_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(bitwise_xor_assign)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(subscript)
+ BOOST_PROTO_DEFINE_BINARY_METAFUNCTION(member)
 
- } // namespace op
+ #undef BOOST_PROTO_DEFINE_UNARY_METAFUNCTION
+ #undef BOOST_PROTO_DEFINE_BINARY_METAFUNCTION
 
     #define BOOST_PROTO_CHILD(Z, N, DATA) \
         /** INTERNAL ONLY */ \
@@ -806,10 +802,13 @@
 
                 template<typename This, typename T>
                 struct result<This(T)>
- {
- typedef typename remove_reference<T>::type unref_type;
- typedef typename result_of::as_expr<unref_type, Domain>::type type;
- };
+ : result_of::as_expr<T, Domain>
+ {};
+
+ template<typename This, typename T>
+ struct result<This(T &)>
+ : result_of::as_expr<T, Domain>
+ {};
 
                 /// \brief Wrap an object in a Proto terminal if it isn't a
                 /// Proto expression already.
@@ -860,10 +859,13 @@
 
                 template<typename This, typename T>
                 struct result<This(T)>
- {
- typedef typename remove_reference<T>::type unref_type;
- typedef typename result_of::as_child<unref_type, Domain>::type type;
- };
+ : result_of::as_child<T, Domain>
+ {};
+
+ template<typename This, typename T>
+ struct result<This(T &)>
+ : result_of::as_child<T, Domain>
+ {};
 
                 /// \brief Wrap an object in a Proto terminal if it isn't a
                 /// Proto expression already.
@@ -1384,93 +1386,89 @@
 
     #define N BOOST_PP_ITERATION()
     #if N > 0
- namespace op
- {
- /// \brief A metafunction for generating function-call expression types,
- /// a grammar element for matching function-call expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- template<BOOST_PP_ENUM_PARAMS(N, typename A)>
- struct function
- #if N != BOOST_PROTO_MAX_ARITY
- <
- BOOST_PP_ENUM_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- #endif
- : proto::transform<
- function<
- BOOST_PP_ENUM_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- , int
+ /// \brief A metafunction for generating function-call expression types,
+ /// a grammar element for matching function-call expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ template<BOOST_PP_ENUM_PARAMS(N, typename A)>
+ struct function
+ #if N != BOOST_PROTO_MAX_ARITY
+ <
+ BOOST_PP_ENUM_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
+ >
+ #endif
+ : proto::transform<
+ function<
+ BOOST_PP_ENUM_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
- {
- typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
- typedef type proto_base_expr;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<function, Expr, State, Data>
- {};
+ , int
+ >
+ {
+ typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
+ typedef proto::basic_expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
 
- /// INTERNAL ONLY
- typedef proto::tag::function proto_tag;
- BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
- BOOST_PP_REPEAT_FROM_TO(
- N
- , BOOST_PROTO_MAX_ARITY
- , BOOST_PROTO_CHILD
- , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
- )
- };
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<function, Expr, State, Data>
+ {};
 
- /// \brief A metafunction for generating n-ary expression types with a
- /// specified tag type,
- /// a grammar element for matching n-ary expressions, and a
- /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
- /// transform.
- ///
- /// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
- /// n-ary expression; that is, any non-terminal.
- template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct nary_expr
- #if N != BOOST_PROTO_MAX_ARITY
- <
- Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- #endif
- : proto::transform<
- nary_expr<
- Tag
- BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
- BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
- >
- , int
+ /// INTERNAL ONLY
+ typedef proto::tag::function proto_tag;
+ BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
+ BOOST_PP_REPEAT_FROM_TO(
+ N
+ , BOOST_PROTO_MAX_ARITY
+ , BOOST_PROTO_CHILD
+ , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
+ )
+ };
+
+ /// \brief A metafunction for generating n-ary expression types with a
+ /// specified tag type,
+ /// a grammar element for matching n-ary expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
+ ///
+ /// Use <tt>nary_expr\<_, vararg\<_\> \></tt> as a grammar element to match any
+ /// n-ary expression; that is, any non-terminal.
+ template<typename Tag BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
+ struct nary_expr
+ #if N != BOOST_PROTO_MAX_ARITY
+ <
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
+ >
+ #endif
+ : proto::transform<
+ nary_expr<
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT)
>
- {
- typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
- typedef type proto_base_expr;
-
- template<typename Expr, typename State, typename Data>
- struct impl
- : detail::pass_through_impl<nary_expr, Expr, State, Data>
- {};
+ , int
+ >
+ {
+ typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> type;
+ typedef proto::basic_expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)>, N> proto_grammar;
 
- /// INTERNAL ONLY
- typedef Tag proto_tag;
- BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
- BOOST_PP_REPEAT_FROM_TO(
- N
- , BOOST_PROTO_MAX_ARITY
- , BOOST_PROTO_CHILD
- , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
- )
- };
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : detail::pass_through_impl<nary_expr, Expr, State, Data>
+ {};
 
- } // namespace op
+ /// INTERNAL ONLY
+ typedef Tag proto_tag;
+ BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD, A)
+ BOOST_PP_REPEAT_FROM_TO(
+ N
+ , BOOST_PROTO_MAX_ARITY
+ , BOOST_PROTO_CHILD
+ , detail::if_vararg<BOOST_PP_CAT(A, BOOST_PP_DEC(N))> BOOST_PP_INTERCEPT
+ )
+ };
 
         namespace detail
         {

Modified: trunk/boost/proto/transform/when.hpp
==============================================================================
--- trunk/boost/proto/transform/when.hpp (original)
+++ trunk/boost/proto/transform/when.hpp 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -55,7 +55,7 @@
         struct when
           : PrimitiveTransform
         {
- typedef typename Grammar::proto_base_expr proto_base_expr;
+ typedef typename Grammar::proto_grammar proto_grammar;
         };
 
         /// \brief A specialization that treats function pointer Transforms as
@@ -138,7 +138,7 @@
         struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
           : transform<when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))> >
         {
- typedef typename Grammar::proto_base_expr proto_base_expr;
+ typedef typename Grammar::proto_grammar proto_grammar;
 
             // Note: do not evaluate is_callable<R> in this scope.
             // R may be an incomplete type at this point.

Modified: trunk/libs/proto/doc/reference/concepts/Domain.xml
==============================================================================
--- trunk/libs/proto/doc/reference/concepts/Domain.xml (original)
+++ trunk/libs/proto/doc/reference/concepts/Domain.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -63,6 +63,19 @@
     </description>
   </associated-type>
 
+ <associated-type name="proto_super_domain">
+ <get-member-type name="proto_super_domain">
+ <type name="Domain"/>
+ </get-member-type>
+ <description>
+ <simpara>
+ The Domain that is a super-domain of this domain, if
+ any such domain exists. If not, it is some unspecified
+ type.
+ </simpara>
+ </description>
+ </associated-type>
+
   <associated-type name="result_type">
     <get-member-type name="type">
       <apply-template name="boost::result_of">

Modified: trunk/libs/proto/doc/reference/concepts/Expr.xml
==============================================================================
--- trunk/libs/proto/doc/reference/concepts/Expr.xml (original)
+++ trunk/libs/proto/doc/reference/concepts/Expr.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -72,6 +72,22 @@
     </description>
   </associated-type>
 
+ <associated-type name="proto_grammar">
+ <get-member-type name="proto_grammar">
+ <type name="Expr"/>
+ </get-member-type>
+ <description>
+ <simpara>
+ A typedef for an instantiation of
+ <classname alt="boost::proto::basic_expr">
+ <code>proto::basic_expr&lt;&gt;</code>
+ </classname>
+ that is equivalent to Expr. Expression types are equivalent if they have the
+ same <code>proto_tag</code>, <code>proto_args</code>, and <code>proto_arity</code>.
+ </simpara>
+ </description>
+ </associated-type>
+
   <associated-type name="proto_base_expr">
     <get-member-type name="proto_base_expr">
       <type name="Expr"/>

Modified: trunk/libs/proto/doc/reference/expr.xml
==============================================================================
--- trunk/libs/proto/doc/reference/expr.xml (original)
+++ trunk/libs/proto/doc/reference/expr.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -3,6 +3,20 @@
   <namespace name="boost">
     <namespace name="proto">
 
+ <!-- boost::proto::basic_expr -->
+
+ <struct name="basic_expr">
+ <template>
+ <template-type-parameter name="Tag"/>
+ <template-type-parameter name="Args"/>
+ <template-nontype-parameter name="Arity">
+ <type>long</type>
+ </template-nontype-parameter>
+ </template>
+
+ <purpose>Simplified representation of a node in an expression tree.</purpose>
+ </struct>
+
       <!-- boost::proto::expr -->
 
       <struct name="expr">
@@ -71,6 +85,10 @@
           <type><classname>proto::default_domain</classname></type>
         </typedef>
 
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; Tag, Args, Arity &gt;</type>
+ </typedef>
+
         <typedef name="proto_base_expr">
           <type>expr</type>
         </typedef>

Modified: trunk/libs/proto/doc/reference/extends.xml
==============================================================================
--- trunk/libs/proto/doc/reference/extends.xml (original)
+++ trunk/libs/proto/doc/reference/extends.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -136,6 +136,9 @@
         <typedef name="proto_arity">
           <type>typename proto_base_expr::proto_arity</type>
         </typedef>
+ <typedef name="proto_grammar">
+ <type>typename proto_base_expr::proto_grammar</type>
+ </typedef>
         <typedef name="proto_childN">
           <purpose>For each <replaceable>N</replaceable> in <replaceable>[0,max(1,proto_arity_c))</replaceable></purpose>
           <type>typename proto_base_expr::proto_child<replaceable>N</replaceable></type>

Modified: trunk/libs/proto/doc/reference/matches.xml
==============================================================================
--- trunk/libs/proto/doc/reference/matches.xml (original)
+++ trunk/libs/proto/doc/reference/matches.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -82,7 +82,7 @@
             </method>
           </method-group>
         </struct>
- <typedef name="proto_base_expr">
+ <typedef name="proto_grammar">
           <type>_</type>
         </typedef>
       </struct>
@@ -144,7 +144,7 @@
             </method>
           </method-group>
         </struct>
- <typedef name="proto_base_expr">
+ <typedef name="proto_grammar">
           <type>not_</type>
         </typedef>
       </struct>
@@ -262,7 +262,7 @@
             </method>
           </method-group>
         </struct>
- <typedef name="proto_base_expr">
+ <typedef name="proto_grammar">
           <type>if_</type>
         </typedef>
       </struct>
@@ -345,7 +345,7 @@
             </method>
           </method-group>
         </struct>
- <typedef name="proto_base_expr">
+ <typedef name="proto_grammar">
           <type>or_</type>
         </typedef>
       </struct>
@@ -418,7 +418,7 @@
             </method>
           </method-group>
         </struct>
- <typedef name="proto_base_expr">
+ <typedef name="proto_grammar">
           <type>and_</type>
         </typedef>
       </struct>
@@ -457,7 +457,7 @@
           <inherit><type>
     Cases::template case_&lt;typename Expr::tag_type&gt;::template impl&lt;Expr, State, Data&gt;</type></inherit>
         </struct>
- <typedef name="proto_base_expr">
+ <typedef name="proto_grammar">
           <type>switch_</type>
         </typedef>
       </struct>
@@ -541,8 +541,8 @@
           <para>
             <computeroutput>proto::matches&lt;Expr, Grammar&gt;</computeroutput> inherits from
             <computeroutput>mpl::true_</computeroutput> if
- <computeroutput>Expr::proto_base_expr</computeroutput> matches
- <computeroutput>Grammar::proto_base_expr</computeroutput>, and from
+ <computeroutput>Expr::proto_grammar</computeroutput> matches
+ <computeroutput>Grammar::proto_grammar</computeroutput>, and from
             <computeroutput>mpl::false_</computeroutput> otherwise.
           </para>
           <para>

Modified: trunk/libs/proto/doc/reference/traits.xml
==============================================================================
--- trunk/libs/proto/doc/reference/traits.xml (original)
+++ trunk/libs/proto/doc/reference/traits.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -595,8 +595,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::terminal</classname>, <classname>proto::term</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::terminal</classname>, <classname>proto::term</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -626,8 +626,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::if_else_</classname>, <classname alt="proto::listN">proto::list3</classname>&lt; T, U, V &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::if_else_</classname>, <classname alt="proto::listN">proto::list3</classname>&lt; T, U, V &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -654,8 +654,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::unary_plus</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::unary_plus</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -682,8 +682,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::negate</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::negate</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -710,8 +710,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::dereference</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::dereference</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -738,8 +738,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::complement</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::complement</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -766,8 +766,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::address_of</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::address_of</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -794,8 +794,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::logical_not</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::logical_not</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -822,8 +822,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::pre_inc</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::pre_inc</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -850,8 +850,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::pre_dec</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::pre_dec</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -878,8 +878,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::post_inc</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::post_inc</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -906,8 +906,10 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::post_dec</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type>
+ <classname>proto::basic_expr</classname>&lt; <classname>proto::tag::post_dec</classname>, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;
+ </type>
         </typedef>
       </struct>
 
@@ -935,8 +937,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::shift_left</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::shift_left</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -964,8 +966,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::shift_right</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::shift_right</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -993,8 +995,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::multiplies</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::multiplies</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -1022,8 +1024,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::divides</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::divides</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1051,8 +1053,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::modulus</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::modulus</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1080,8 +1082,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::plus</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::plus</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1109,8 +1111,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::minus</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::minus</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1138,8 +1140,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::less</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::less</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1167,8 +1169,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::greater</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::greater</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1196,8 +1198,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::less_equal</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::less_equal</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1225,8 +1227,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::greater_equal</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::greater_equal</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1254,8 +1256,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::equal_to</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::equal_to</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1283,8 +1285,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::not_equal_to</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::not_equal_to</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1312,8 +1314,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::logical_or</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::logical_or</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1341,8 +1343,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::logical_and</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::logical_and</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1370,8 +1372,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::bitwise_and</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::bitwise_and</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1399,8 +1401,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::bitwise_or</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::bitwise_or</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1428,8 +1430,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::bitwise_xor</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::bitwise_xor</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1457,8 +1459,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::comma</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::comma</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1481,8 +1483,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::mem_ptr</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::mem_ptr</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1510,8 +1512,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1539,8 +1541,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::shift_left_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::shift_left_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1568,8 +1570,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::shift_right_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::shift_right_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1597,8 +1599,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::multiplies_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::multiplies_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1626,8 +1628,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::divides_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::divides_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1655,8 +1657,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::modulus_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::modulus_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1684,8 +1686,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::plus_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::plus_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1713,8 +1715,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::minus_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::minus_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1742,8 +1744,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::bitwise_and_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::bitwise_and_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1771,8 +1773,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::bitwise_or_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::bitwise_or_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1800,8 +1802,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::bitwise_xor_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::bitwise_xor_assign</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1829,8 +1831,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::subscript</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::subscript</classname>, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -1858,8 +1860,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; <classname>proto::tag::function</classname>, <classname alt="proto::listN">proto::list<replaceable>N</replaceable></classname>&lt; A... &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; <classname>proto::tag::function</classname>, <classname alt="proto::listN">proto::list<replaceable>N</replaceable></classname>&lt; A... &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -1922,8 +1924,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; Tag, <classname>proto::term</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; Tag, <classname>proto::term</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -1958,8 +1960,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; Tag, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; Tag, <classname alt="proto::listN">proto::list1</classname>&lt; T &gt; &gt;</type>
         </typedef>
       </struct>
       
@@ -1994,8 +1996,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; Tag, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; Tag, <classname alt="proto::listN">proto::list2</classname>&lt; T, U &gt; &gt;</type>
         </typedef>
       </struct>
 
@@ -2030,8 +2032,8 @@
         <typedef name="type">
           <type><classname>proto::expr</classname>&lt; Tag, <classname alt="proto::listN">proto::list<replaceable>N</replaceable></classname>&lt; A... &gt; &gt;</type>
         </typedef>
- <typedef name="proto_base_expr">
- <type>type</type>
+ <typedef name="proto_grammar">
+ <type><classname>proto::basic_expr</classname>&lt; Tag, <classname alt="proto::listN">proto::list<replaceable>N</replaceable></classname>&lt; A... &gt; &gt;</type>
         </typedef>
       </struct>
 

Modified: trunk/libs/proto/doc/reference/transform/when.xml
==============================================================================
--- trunk/libs/proto/doc/reference/transform/when.xml (original)
+++ trunk/libs/proto/doc/reference/transform/when.xml 2010-06-08 01:07:00 EDT (Tue, 08 Jun 2010)
@@ -55,8 +55,8 @@
           </itemizedlist>
         </description>
         <inherit><type>PrimitiveTransform</type></inherit>
- <typedef name="proto_base_expr">
- <type>typename Grammar::proto_base_expr</type>
+ <typedef name="proto_grammar">
+ <type>typename Grammar::proto_grammar</type>
         </typedef>
       </struct>
 
@@ -184,8 +184,8 @@
             </method>
           </method-group>
         </struct>
- <typedef name="proto_base_expr">
- <type>typename Grammar::proto_base_expr</type>
+ <typedef name="proto_grammar">
+ <type>typename Grammar::proto_grammar</type>
         </typedef>
       </struct-specialization>
       


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