Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69193 - in trunk/boost/spirit/home: karma karma/nonterminal qi qi/nonterminal
From: joel_at_[hidden]
Date: 2011-02-22 19:39:53


Author: djowel
Date: 2011-02-22 19:39:39 EST (Tue, 22 Feb 2011)
New Revision: 69193
URL: http://svn.boost.org/trac/boost/changeset/69193

Log:
tweaks for qi and karma: option to have no predefined terminals

Text files modified:
   trunk/boost/spirit/home/karma/domain.hpp | 21 +++++++++++++-
   trunk/boost/spirit/home/karma/nonterminal/rule.hpp | 57 +++++++++++++++++++++++++--------------
   trunk/boost/spirit/home/qi/domain.hpp | 27 +++++++++---------
   trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 1
   4 files changed, 70 insertions(+), 36 deletions(-)

Modified: trunk/boost/spirit/home/karma/domain.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/domain.hpp (original)
+++ trunk/boost/spirit/home/karma/domain.hpp 2011-02-22 19:39:39 EST (Tue, 22 Feb 2011)
@@ -1,7 +1,7 @@
 // Copyright (c) 2001-2011 Hartmut Kaiser
 // Copyright (c) 2001-2011 Joel de Guzman
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
 #if !defined(BOOST_SPIRIT_KARMA_DOMAIN_FEB_20_2007_0943AM)
@@ -38,6 +38,21 @@
         BOOST_PP_REPEAT(SPIRIT_ARGUMENTS_LIMIT, SPIRIT_USING_ARGUMENT, _)
         BOOST_PP_REPEAT(SPIRIT_ATTRIBUTES_LIMIT, SPIRIT_USING_ATTRIBUTE, _)
 
+ using spirit::_pass_type;
+ using spirit::_val_type;
+ using spirit::_a_type;
+ using spirit::_b_type;
+ using spirit::_c_type;
+ using spirit::_d_type;
+ using spirit::_e_type;
+ using spirit::_f_type;
+ using spirit::_g_type;
+ using spirit::_h_type;
+ using spirit::_i_type;
+ using spirit::_j_type;
+
+#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
+
         using spirit::_pass;
         using spirit::_val;
         using spirit::_a;
@@ -50,6 +65,8 @@
         using spirit::_h;
         using spirit::_i;
         using spirit::_j;
+
+#endif
     }
 
 }}}

Modified: trunk/boost/spirit/home/karma/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/karma/nonterminal/rule.hpp 2011-02-22 19:39:39 EST (Tue, 22 Feb 2011)
@@ -1,7 +1,7 @@
 // Copyright (c) 2001-2011 Joel de Guzman
 // Copyright (c) 2001-2011 Hartmut Kaiser
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+//
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
 #if !defined(BOOST_SPIRIT_KARMA_RULE_MAR_05_2007_0455PM)
@@ -48,6 +48,21 @@
 {
     BOOST_PP_REPEAT(SPIRIT_ATTRIBUTES_LIMIT, SPIRIT_USING_ATTRIBUTE, _)
 
+ using spirit::_pass_type;
+ using spirit::_val_type;
+ using spirit::_a_type;
+ using spirit::_b_type;
+ using spirit::_c_type;
+ using spirit::_d_type;
+ using spirit::_e_type;
+ using spirit::_f_type;
+ using spirit::_g_type;
+ using spirit::_h_type;
+ using spirit::_i_type;
+ using spirit::_j_type;
+
+#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
+
     using spirit::_pass;
     using spirit::_val;
     using spirit::_a;
@@ -61,6 +76,8 @@
     using spirit::_i;
     using spirit::_j;
 
+#endif
+
     using spirit::info;
     using spirit::locals;
 
@@ -86,7 +103,7 @@
         typedef mpl::vector<T1, T2, T3, T4> template_params;
 
         // the output iterator is always wrapped by karma
- typedef detail::output_iterator<OutputIterator, properties>
+ typedef detail::output_iterator<OutputIterator, properties>
             output_iterator;
 
         // locals_type is a sequence of types to be used as local variables
@@ -115,7 +132,7 @@
             spirit::detail::attr_from_sig<sig_type>::type
         attr_type;
         typedef typename add_reference<
- typename add_const<attr_type>::type>::type
+ typename add_const<attr_type>::type>::type
         attr_reference_type;
 
         // parameter_types is a sequence of types passed as parameters to the rule
@@ -176,7 +193,7 @@
         {
             // The following assertion fires when you try to initialize a rule
             // from an uninitialized one. Did you mean to refer to the right
- // hand side rule instead of assigning from it? In this case you
+ // hand side rule instead of assigning from it? In this case you
             // should write lhs = rhs.alias();
             BOOST_ASSERT(rhs.f && "Did you mean rhs.alias() instead of rhs?");
 
@@ -232,7 +249,7 @@
         }
 #else
         // both friend functions have to be defined out of class as VC7.1
- // will complain otherwise
+ // will complain otherwise
         template <typename OutputIterator_, typename T1_, typename T2_
           , typename T3_, typename T4_, typename Expr>
         friend rule<OutputIterator_, T1_, T2_, T3_, T4_>& operator%=(
@@ -257,14 +274,14 @@
         {
             if (f)
             {
- // Create an attribute if none is supplied.
- typedef traits::make_attribute<attr_type, Attribute>
+ // Create an attribute if none is supplied.
+ typedef traits::make_attribute<attr_type, Attribute>
                     make_attribute;
                 typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain>
+ typename make_attribute::type, attr_type, domain>
                 transform;
 
- typename transform::type attr_ =
+ typename transform::type attr_ =
                     traits::pre_transform<domain, attr_type>(
                         make_attribute::call(attr));
 
@@ -273,9 +290,9 @@
                 // attributes, without passing values for them.
                 context_type context(attr_);
 
- // If you are seeing a compilation error here stating that the
+ // If you are seeing a compilation error here stating that the
                 // third parameter can't be converted to a karma::reference
- // then you are probably trying to use a rule or a grammar with
+ // then you are probably trying to use a rule or a grammar with
                 // an incompatible delimiter type.
                 if (f(sink, context, delim))
                 {
@@ -297,14 +314,14 @@
         {
             if (f)
             {
- // Create an attribute if none is supplied.
- typedef traits::make_attribute<attr_type, Attribute>
+ // Create an attribute if none is supplied.
+ typedef traits::make_attribute<attr_type, Attribute>
                     make_attribute;
                 typedef traits::transform_attribute<
- typename make_attribute::type, attr_type, domain>
+ typename make_attribute::type, attr_type, domain>
                 transform;
 
- typename transform::type attr_ =
+ typename transform::type attr_ =
                     traits::pre_transform<domain, attr_type>(
                         make_attribute::call(attr));
 
@@ -313,9 +330,9 @@
                 // attributes, passing values of incompatible types for them.
                 context_type context(attr_, params, caller_context);
 
- // If you are seeing a compilation error here stating that the
+ // If you are seeing a compilation error here stating that the
                 // third parameter can't be converted to a karma::reference
- // then you are probably trying to use a rule or a grammar with
+ // then you are probably trying to use a rule or a grammar with
                 // an incompatible delimiter type.
                 if (f(sink, context, delim))
                 {
@@ -366,7 +383,7 @@
         // the expression (expr) is not a valid spirit karma expression.
         BOOST_SPIRIT_ASSERT_MATCH(karma::domain, Expr);
 
- typedef typename
+ typedef typename
             rule<OutputIterator_, T1_, T2_, T3_, T4_>::encoding_modifier_type
         encoding_modifier_type;
 
@@ -405,7 +422,7 @@
     struct handles_container<
             karma::rule<IteratorA, T1, T2, T3, T4>, Attribute, Context
           , IteratorB>
- : detail::nonterminal_handles_container<
+ : detail::nonterminal_handles_container<
             typename attribute_of<
                 karma::rule<IteratorA, T1, T2, T3, T4>
               , Context, IteratorB

Modified: trunk/boost/spirit/home/qi/domain.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/domain.hpp (original)
+++ trunk/boost/spirit/home/qi/domain.hpp 2011-02-22 19:39:39 EST (Tue, 22 Feb 2011)
@@ -31,27 +31,26 @@
     using spirit::compile;
     using spirit::info;
 
- using spirit::_pass_type;
- using spirit::_val_type;
- using spirit::_a_type;
- using spirit::_b_type;
- using spirit::_c_type;
- using spirit::_d_type;
- using spirit::_e_type;
- using spirit::_f_type;
- using spirit::_g_type;
- using spirit::_h_type;
- using spirit::_i_type;
- using spirit::_j_type;
-
     // You can bring these in with the using directive
     // without worrying about bringing in too much.
-
     namespace labels
     {
         BOOST_PP_REPEAT(SPIRIT_ARGUMENTS_LIMIT, SPIRIT_USING_ARGUMENT, _)
         BOOST_PP_REPEAT(SPIRIT_ATTRIBUTES_LIMIT, SPIRIT_USING_ATTRIBUTE, _)
 
+ using spirit::_pass_type;
+ using spirit::_val_type;
+ using spirit::_a_type;
+ using spirit::_b_type;
+ using spirit::_c_type;
+ using spirit::_d_type;
+ using spirit::_e_type;
+ using spirit::_f_type;
+ using spirit::_g_type;
+ using spirit::_h_type;
+ using spirit::_i_type;
+ using spirit::_j_type;
+
 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
 
         using spirit::_pass;

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 2011-02-22 19:39:39 EST (Tue, 22 Feb 2011)
@@ -74,6 +74,7 @@
     using spirit::_h;
     using spirit::_i;
     using spirit::_j;
+
 #endif
 
     using spirit::info;


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