Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-04-16 18:50:49


Author: hkaiser
Date: 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
New Revision: 44475
URL: http://svn.boost.org/trac/boost/changeset/44475

Log:
Spirit V2: started to address regression test failures
Text files modified:
   trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp | 20 ++++++++++----------
   trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp | 12 +++++++-----
   trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp | 3 +++
   trunk/boost/spirit/home/qi/parse.hpp | 6 +++---
   trunk/boost/spirit/home/support/iterators/detail/split_functor_input_policy.hpp | 2 +-
   trunk/libs/spirit/doc/what_s_new.qbk | 35 +++++++++++++++++++++++++++++++++++
   trunk/libs/spirit/example/karma/Jamfile | 5 +++--
   trunk/libs/spirit/example/karma/basic_facilities.cpp | 7 -------
   trunk/libs/spirit/example/karma/quick_start1.cpp | 2 +-
   trunk/libs/spirit/example/lex/Jamfile | 25 +++++++++++++------------
   trunk/libs/spirit/example/lex/static_lexer/Jamfile | 2 +-
   trunk/libs/spirit/test/lex/test.hpp | 5 ++++-
   trunk/libs/spirit/test/qi/real.cpp | 4 ++--
   trunk/libs/spirit/test/support/hold_any.cpp | 2 +-
   14 files changed, 84 insertions(+), 46 deletions(-)

Modified: trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp (original)
+++ trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -530,9 +530,9 @@
         ///////////////////////////////////////////////////////////////////////
         // This is the workhorse behind the real generator
         ///////////////////////////////////////////////////////////////////////
- template <typename OutputIterator, typename T>
+ template <typename OutputIterator, typename U>
         static bool
- call_n (OutputIterator& sink, T n, RealPolicies const& p)
+ call_n (OutputIterator& sink, U n, RealPolicies const& p)
         {
         // prepare sign and get output format
             bool sign_val = false;
@@ -549,21 +549,21 @@
             // allow for ADL to find the correct overloads for log10 et.al.
             using namespace std;
             
- T dim = 0;
+ U dim = 0;
             if (0 == (p.fixed & flags) && !detail::is_zero(n))
             {
                 dim = log10(n);
                 if (dim > 0)
- n /= pow(T(10.0), (int)detail::round_to_long::call(dim));
+ n /= pow(U(10.0), (int)detail::round_to_long::call(dim));
                 else if (n < 1.)
- n *= pow(T(10.0), (int)detail::round_to_long::call(-dim));
+ n *= pow(U(10.0), (int)detail::round_to_long::call(-dim));
             }
             
         // prepare numbers (sign, integer and fraction part)
             unsigned precision = p.precision(n);
- T integer_part;
- T precexp = std::pow(10.0, (int)precision);
- T fractional_part = modf(n, &integer_part);
+ U integer_part;
+ U precexp = std::pow(10.0, (int)precision);
+ U fractional_part = modf(n, &integer_part);
             
             fractional_part = floor(fractional_part * precexp + 0.5);
             if (fractional_part >= precexp)
@@ -574,8 +574,8 @@
 
         // if trailing zeros are to be omitted, normalize the precision and
         // fractional part
- T long_int_part = floor(integer_part);
- T long_frac_part = floor(fractional_part);
+ U long_int_part = floor(integer_part);
+ U long_frac_part = floor(fractional_part);
             if (!p.trailing_zeros)
             {
                 if (0 != long_frac_part) {

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_lexer.hpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -13,13 +13,13 @@
 #include <iosfwd>
 
 #include <boost/spirit/home/support/safe_bool.hpp>
+#include <boost/spirit/home/support/detail/lexer/generator.hpp>
+#include <boost/spirit/home/support/detail/lexer/rules.hpp>
+#include <boost/spirit/home/support/detail/lexer/consts.hpp>
 #include <boost/spirit/home/lex/lexer/lexer_fwd.hpp>
 #include <boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp>
 #include <boost/spirit/home/lex/lexer/lexertl/lexertl_functor.hpp>
 #include <boost/spirit/home/lex/lexer/lexertl/lexertl_iterator.hpp>
-#include <boost/spirit/home/support/detail/lexer/generator.hpp>
-#include <boost/spirit/home/support/detail/lexer/rules.hpp>
-#include <boost/spirit/home/support/detail/lexer/consts.hpp>
 #if defined(BOOST_SPIRIT_LEXERTL_DEBUG)
 #include <boost/spirit/home/support/detail/lexer/debug.hpp>
 #endif
@@ -199,6 +199,9 @@
         // tokens.
         iterator_type begin(Iterator& first, Iterator const& last) const
         {
+ if (!init_dfa())
+ return iterator_type();
+
             struct iterator_data_type {
                 boost::lexer::state_machine const& state_machine_;
                 boost::lexer::basic_rules<char_type> const& rules_;
@@ -206,8 +209,7 @@
             };
 
             iterator_data_type iterator_data = { state_machine, rules, actions };
- return init_dfa() ? iterator_type(iterator_data, first, last)
- : iterator_type();
+ return iterator_type(iterator_data, first, last);
         }
         
         // Return the end iterator usable to stop iterating over the generated

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/lexertl_token.hpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -12,6 +12,9 @@
 
 #include <boost/spirit/home/qi/detail/assign_to.hpp>
 #include <boost/spirit/home/support/placeholders.hpp>
+#include <boost/spirit/home/support/detail/lexer/generator.hpp>
+#include <boost/spirit/home/support/detail/lexer/rules.hpp>
+#include <boost/spirit/home/support/detail/lexer/consts.hpp>
 #include <boost/fusion/include/vector.hpp>
 #include <boost/fusion/include/at.hpp>
 #include <boost/fusion/include/value_at.hpp>

Modified: trunk/boost/spirit/home/qi/parse.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/parse.hpp (original)
+++ trunk/boost/spirit/home/qi/parse.hpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -95,9 +95,9 @@
         typedef spirit::traits::skipper_is_compatible<Expr, Skipper>
             skipper_is_compatible;
             
-// BOOST_MPL_ASSERT_MSG(
-// skipper_is_compatible::value,
-// skipper_is_not_compatible_with_parser, (Iterator, Expr, Skipper));
+ BOOST_MPL_ASSERT_MSG(
+ skipper_is_compatible::value,
+ skipper_is_not_compatible_with_parser, (Iterator, Expr, Skipper));
         
         typedef typename result_of::as_component<qi::domain, Expr>::type component;
         typedef typename component::director director;

Modified: trunk/boost/spirit/home/support/iterators/detail/split_functor_input_policy.hpp
==============================================================================
--- trunk/boost/spirit/home/support/iterators/detail/split_functor_input_policy.hpp (original)
+++ trunk/boost/spirit/home/support/iterators/detail/split_functor_input_policy.hpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -139,7 +139,7 @@
                 // passing the current token instance as a parameter helps
                 // generating better code if compared to assigning the
                 // result of the functor to this instance
- return ftor.get_next(mp, t);
+ return mp.ftor.get_next(mp, t);
             }
 
             // test, whether we reached the end of the underlying stream

Modified: trunk/libs/spirit/doc/what_s_new.qbk
==============================================================================
--- trunk/libs/spirit/doc/what_s_new.qbk (original)
+++ trunk/libs/spirit/doc/what_s_new.qbk 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -7,4 +7,39 @@
 ===============================================================================/]
 
 [section What's New]
+
+[heading Spirit Classic]
+
+The Spirit V1.8.x code base has been integrated with Spirit V2. It is now called
+*Spirit Classic*. Even if the directory structure has changed (the Spirit Classic
+headers are now moved to the '$BOOST_ROOT/boost/spirit/home/classic' directory),
+we created forwarding headers allowing to compile existing applications without
+any change. These forwarding headers are deprecated, though, which will result
+in corresponding warnings generated for each of the headers. The forwarding
+headers are expected to be removed in the future.
+
+The recommended way of using Spirit Classic now is to include header files from
+the directory '$BOOST_ROOT/boost/spirit/include'. All files of Spirit Classic
+in this directory have a 'classic_' prefixed to their name. For example the
+include
+
+ #include <boost/spirit/core/core.hpp>
+
+now should be written as:
+
+ #include <boost/spirit/include/classic_core.hpp>
+
+To avoid namespace conflicts with the new Spirit V2 library we moved Spirit Classic
+into the namespace `boost::spirit::classic`. All references to the former
+namespace `boost::spirit` need to be adjusted as soon as the header names are
+corrected as described above. As an alternative you can define the preprocessor
+constant `BOOST_SPIRIT_USE_OLD_NAMESPACE`, which will force the Spirit Classic
+code to be in the namespace `boost::spirit` as before. This is not recommended,
+though, as it maz result in naming clashs
+
+The change of the namespace will be automatically deactivated whenever the
+deprecated include files are being used. This ensures full backwards
+compatibility for existing applications.
+
+
 [endsect]

Modified: trunk/libs/spirit/example/karma/Jamfile
==============================================================================
--- trunk/libs/spirit/example/karma/Jamfile (original)
+++ trunk/libs/spirit/example/karma/Jamfile 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -1,12 +1,13 @@
 #==============================================================================
-# Copyright (c) 2001-2007 Joel de Guzman
-# Copyright (c) 2001-2007 Hartmut Kaiser
+# Copyright (c) 2001-2008 Joel de Guzman
+# Copyright (c) 2001-2008 Hartmut Kaiser
 #
 # 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)
 #==============================================================================
 project spirit-karma-example ;
 
+exe quick_start1 : quick_start1.cpp ;
 exe basic_facilities : basic_facilities.cpp ;
 exe functor_facilities : functor_facilities.cpp ;
 

Modified: trunk/libs/spirit/example/karma/basic_facilities.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/basic_facilities.cpp (original)
+++ trunk/libs/spirit/example/karma/basic_facilities.cpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -166,13 +166,6 @@
     std::cout << "std::vector<boost::date>" << std::endl;
     output_container(std::cout, dates);
     
- ///////////////////////////////////////////////////////////////////////////
- // fusion tuples
- // this will work in the future
-// boost::fusion::vector<int, char, double> fv(42, 'a', 45.8);
-//
-// std::cout << "boost::fusion::vector<int, char, double>" << std::endl;
-// output_container(std::cout, fv);
     return 0;
 }
 

Modified: trunk/libs/spirit/example/karma/quick_start1.cpp
==============================================================================
--- trunk/libs/spirit/example/karma/quick_start1.cpp (original)
+++ trunk/libs/spirit/example/karma/quick_start1.cpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -37,7 +37,7 @@
         ) << std::endl << std::endl;
 
     // output the container as a space separated sequence
- std::cout << "...as space delited list" << std::endl;
+ std::cout << "...as space delimited list" << std::endl;
     std::cout <<
         karma::format_delimited(
             *int_, // format description

Modified: trunk/libs/spirit/example/lex/Jamfile
==============================================================================
--- trunk/libs/spirit/example/lex/Jamfile (original)
+++ trunk/libs/spirit/example/lex/Jamfile 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -1,5 +1,5 @@
 #==============================================================================
-# Copyright (c) 2001-2007 Joel de Guzman
+# Copyright (c) 2001-2008 Joel de Guzman
 # Copyright (c) 2001-2008 Hartmut Kaiser
 #
 # Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -8,15 +8,16 @@
 
 project spirit-lexer-example ;
 
-exe example1 : example1.cpp ;
-exe example2 : example2.cpp ;
-exe example3 : example3.cpp ;
-exe example4 : example4.cpp ;
-exe example5 : example5.cpp ;
-exe example6 : example6.cpp ;
-exe print_numbers : print_numbers.cpp ;
-exe word_count : word_count.cpp ;
-exe word_count_functor : word_count_functor.cpp ;
-exe word_count_lexer : word_count_lexer.cpp ;
-exe strip_comments : strip_comments.cpp ;
+exe example1 : example1.cpp ;
+exe example2 : example2.cpp ;
+exe example3 : example3.cpp ;
+exe example4 : example4.cpp ;
+exe example5 : example5.cpp ;
+exe example6 : example6.cpp ;
+exe print_numbers : print_numbers.cpp ;
+exe word_count : word_count.cpp ;
+exe word_count_functor : word_count_functor.cpp ;
+exe word_count_lexer : word_count_lexer.cpp ;
+exe strip_comments : strip_comments.cpp ;
+exe strip_comments_lexer : strip_comments_lexer.cpp ;
 

Modified: trunk/libs/spirit/example/lex/static_lexer/Jamfile
==============================================================================
--- trunk/libs/spirit/example/lex/static_lexer/Jamfile (original)
+++ trunk/libs/spirit/example/lex/static_lexer/Jamfile 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -8,6 +8,6 @@
 
 project spirit-static-lexer-example ;
 
-exe generate_tables : generate_tables.cpp ;
+exe word_count_generate : word_count_generate.cpp ;
 exe word_count_static : word_count_static.cpp ;
 

Modified: trunk/libs/spirit/test/lex/test.hpp
==============================================================================
--- trunk/libs/spirit/test/lex/test.hpp (original)
+++ trunk/libs/spirit/test/lex/test.hpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -6,6 +6,9 @@
 #if !defined(BOOST_SPIRIT_LEX_TEST_MAR_23_2007_0721PM)
 #define BOOST_SPIRIT_LEX_TEST_MAR_23_2007_0721PM
 
+#include <boost/variant.hpp>
+#include <boost/range/iterator_range.hpp>
+
 namespace spirit_test
 {
     ///////////////////////////////////////////////////////////////////////////
@@ -39,7 +42,7 @@
     inline boost::iterator_range<Iterator> const&
     get_iterpair(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& v)
     {
- return get<boost::iterator_range<Iterator> >(v);
+ return boost::get<boost::iterator_range<Iterator> >(v);
     }
     
     ///////////////////////////////////////////////////////////////////////////

Modified: trunk/libs/spirit/test/qi/real.cpp
==============================================================================
--- trunk/libs/spirit/test/qi/real.cpp (original)
+++ trunk/libs/spirit/test/qi/real.cpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -12,8 +12,8 @@
 #include <boost/spirit/include/qi_char.hpp>
 #include <boost/spirit/include/qi_numeric.hpp>
 #include <boost/spirit/include/qi_operator.hpp>
-#include <boost/spirit/support/detail/math/fpclassify.hpp>
-#include <boost/spirit/support/detail/math/signbit.hpp>
+#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
+#include <boost/spirit/home/support/detail/math/signbit.hpp>
 
 #include "test.hpp"
 using namespace spirit_test;

Modified: trunk/libs/spirit/test/support/hold_any.cpp
==============================================================================
--- trunk/libs/spirit/test/support/hold_any.cpp (original)
+++ trunk/libs/spirit/test/support/hold_any.cpp 2008-04-16 18:50:47 EDT (Wed, 16 Apr 2008)
@@ -15,7 +15,7 @@
 #include <string>
 
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/spirit/support/detail/hold_any.hpp>
+#include <boost/spirit/home/support/detail/hold_any.hpp>
 
 using namespace std;
 using namespace boost::spirit;


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