Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56597 - in trunk/boost/spirit/home: karma/auxiliary qi/auxiliary qi/nonterminal qi/nonterminal/detail support
From: hartmut.kaiser_at_[hidden]
Date: 2009-10-05 12:17:57


Author: hkaiser
Date: 2009-10-05 12:17:56 EDT (Mon, 05 Oct 2009)
New Revision: 56597
URL: http://svn.boost.org/trac/boost/changeset/56597

Log:
Spirit: cosmetic changes, comment fixes, etc.
Text files modified:
   trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp | 2 +-
   trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp | 2 +-
   trunk/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp | 24 ------------------------
   trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 4 ++--
   trunk/boost/spirit/home/support/attributes.hpp | 19 +++++++++++--------
   5 files changed, 15 insertions(+), 36 deletions(-)

Modified: trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp (original)
+++ trunk/boost/spirit/home/karma/auxiliary/attr_cast.hpp 2009-10-05 12:17:56 EDT (Mon, 05 Oct 2009)
@@ -102,7 +102,7 @@
         bool generate(OutputIterator& sink, Context& ctx, Delimiter const& d
           , Attribute const& attr) const
         {
- typedef typename traits::result_of::transform<
+ typedef traits::transform_attribute<
                 Attribute const, transformed_attribute_type> transform;
 
             return compile<karma::domain>(subject).generate(

Modified: trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp (original)
+++ trunk/boost/spirit/home/qi/auxiliary/attr_cast.hpp 2009-10-05 12:17:56 EDT (Mon, 05 Oct 2009)
@@ -113,7 +113,7 @@
 
             // do down-stream transformation, provides attribute for embedded
             // parser
- typedef typename traits::result_of::transform<
+ typedef traits::transform_attribute<
                 exposed_attribute_type, transformed_attribute_type> transform;
 
             typename transform::type attr_ = transform::pre(attr);

Modified: trunk/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp 2009-10-05 12:17:56 EDT (Mon, 05 Oct 2009)
@@ -21,7 +21,6 @@
     template <typename Parser, typename Auto>
     struct parser_binder
     {
-
         parser_binder(Parser const& p)
           : p(p) {}
 
@@ -38,29 +37,6 @@
         bool call(Iterator& first, Iterator const& last
           , Context& context, Skipper const& skipper, mpl::false_) const
         {
-// typedef typename traits::attribute_of<Parser>::type
-// subject_attribute_type;
-// typedef typename Context::attributes_type context_attributes_type;
-// typedef typename fusion::result_of::at_c<
-// context_attributes_type, 0>::type attribute_type;
-//
-// // do down-stream transformation, provides attribute for embedded
-// // parser
-// typename traits::result_of::pre_transform<
-// subject_attribute_type, attribute_type>::type
-// attr_ = traits::pre_transform<subject_attribute_type>(
-// fusion::at_c<0>(context.attributes));
-//
-// // If DeducedAuto is true (no semantic action), we pass the rule's
-// // attribute on to the component.
-// if (!p.parse(first, last, context, skipper, attr_))
-// return false;
-//
-// // do up-stream transformation, this mainly integrates the results
-// // back into the original attribute value, if appropriate
-// traits::post_transform<subject_attribute_type>(attr_
-// , fusion::at_c<0>(context.attributes));
-
             // If DeducedAuto is true (no semantic action), we pass the rule's
             // attribute on to the component.
             return p.parse(first, last, context, skipper

Modified: trunk/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/rule.hpp 2009-10-05 12:17:56 EDT (Mon, 05 Oct 2009)
@@ -218,7 +218,7 @@
 
                 // do down-stream transformation, provides attribute for
                 // rhs parser
- typedef typename traits::result_of::transform<
+ typedef traits::transform_attribute<
                     typename make_attribute::type, attr_type> transform;
 
                 typename transform::type attr_ =
@@ -258,7 +258,7 @@
 
                 // do down-stream transformation, provides attribute for
                 // rhs parser
- typedef typename traits::result_of::transform<
+ typedef traits::transform_attribute<
                     typename make_attribute::type, attr_type> transform;
 
                 typename transform::type attr_ =

Modified: trunk/boost/spirit/home/support/attributes.hpp
==============================================================================
--- trunk/boost/spirit/home/support/attributes.hpp (original)
+++ trunk/boost/spirit/home/support/attributes.hpp 2009-10-05 12:17:56 EDT (Mon, 05 Oct 2009)
@@ -314,10 +314,11 @@
     // the user is able specify specific transformation rules for any attribute
     // type.
     //
- // The default attribute transformation where the exposed attribute type is
- // different from the required transformed attribute type relies on the
- // convertibility exposed type --> transformed type, which is needed to
- // successfully execute the pre transform step.
+ // The default attribute transformation (where the exposed attribute type is
+ // different from the required transformed attribute type) relies on the
+ // convertibility 'exposed type' --> 'transformed type', which has to exist
+ // in order to successfully execute the pre transform step.
+ ///////////////////////////////////////////////////////////////////////////
     template <typename Exposed, typename Transformed, typename Enable/* = void*/>
     struct transform_attribute
     {
@@ -326,7 +327,7 @@
         static Transformed pre(Exposed& val) { return Transformed(val); }
         static Transformed pre(Exposed const& val) { return Transformed(val); }
 
- // By default post transform only if types are convertible,
+ // By default do post transformation only if types are convertible,
         // otherwise we assume no post transform is required (i.e. the user
         // utilizes nview et.al.).
         static void post(Exposed&, Transformed const&, mpl::false_)
@@ -412,28 +413,30 @@
       : transform_attribute<unused_type, unused_type>
     {};
 
+ ///////////////////////////////////////////////////////////////////////////
     namespace result_of
     {
         template <typename Exposed, typename Transformed>
- struct transform
+ struct pre_transform
           : traits::transform_attribute<Exposed, Transformed>
         {};
     }
 
     template <typename Transformed, typename Exposed>
- typename traits::result_of::transform<Exposed, Transformed>::type
+ typename traits::result_of::pre_transform<Exposed, Transformed>::type
     pre_transform(Exposed& attr)
     {
         return transform_attribute<Exposed, Transformed>::pre(attr);
     }
 
     template <typename Transformed, typename Exposed>
- typename traits::result_of::transform<Exposed const, Transformed>::type
+ typename traits::result_of::pre_transform<Exposed const, Transformed>::type
     pre_transform(Exposed const& attr)
     {
         return transform_attribute<Exposed const, Transformed>::pre(attr);
     }
 
+ ///////////////////////////////////////////////////////////////////////////
     template <typename Exposed, typename Transformed>
     void post_transform(Exposed& dest, Transformed const& attr)
     {


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