Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63729 - in trunk/libs/spirit/example: karma lex qi qi/calc6 qi/calc7 qi/mini_c
From: joel_at_[hidden]
Date: 2010-07-07 22:49:11


Author: djowel
Date: 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
New Revision: 63729
URL: http://svn.boost.org/trac/boost/changeset/63729

Log:
Examples bug fixes and code tweaks to make g++ 4.2 happy.
Text files modified:
   trunk/libs/spirit/example/karma/Jamfile | 6 +++++-
   trunk/libs/spirit/example/lex/Jamfile | 8 +++++++-
   trunk/libs/spirit/example/qi/Jamfile | 4 +++-
   trunk/libs/spirit/example/qi/adapt_template_struct.cpp | 2 +-
   trunk/libs/spirit/example/qi/calc6/calc6c.hpp | 9 ++++++---
   trunk/libs/spirit/example/qi/calc7/calc7c.hpp | 7 +++++--
   trunk/libs/spirit/example/qi/mini_c/mini_cc.hpp | 4 ++--
   trunk/libs/spirit/example/qi/parse_date.cpp | 2 +-
   8 files changed, 30 insertions(+), 12 deletions(-)

Modified: trunk/libs/spirit/example/karma/Jamfile
==============================================================================
--- trunk/libs/spirit/example/karma/Jamfile (original)
+++ trunk/libs/spirit/example/karma/Jamfile 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -6,7 +6,11 @@
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 #==============================================================================
 project spirit-karma-example
- : requirements <toolset>gcc:<c++-template-depth>300 : :
+ : requirements
+ <toolset>gcc:<c++-template-depth>300
+ <toolset>darwin:<cxxflags>-ftemplate-depth-300
+ :
+ :
     ;
 
 exe actions_example : actions.cpp ;

Modified: trunk/libs/spirit/example/lex/Jamfile
==============================================================================
--- trunk/libs/spirit/example/lex/Jamfile (original)
+++ trunk/libs/spirit/example/lex/Jamfile 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -5,8 +5,14 @@
 # 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-lexer-example
+ : requirements
+ <toolset>gcc:<c++-template-depth>300
+ <toolset>darwin:<cxxflags>-ftemplate-depth-300
+ :
+ :
+ ;
 
-project spirit-lexer-example ;
 
 exe example1 : example1.cpp ;
 exe example2 : example2.cpp ;

Modified: trunk/libs/spirit/example/qi/Jamfile
==============================================================================
--- trunk/libs/spirit/example/qi/Jamfile (original)
+++ trunk/libs/spirit/example/qi/Jamfile 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -5,7 +5,9 @@
 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 #==============================================================================
 project spirit-qi-example
- : requirements <toolset>gcc:<c++-template-depth>300
+ : requirements
+ <toolset>gcc:<c++-template-depth>300
+ <toolset>darwin:<cxxflags>-ftemplate-depth-300
     :
     :
     ;

Modified: trunk/libs/spirit/example/qi/adapt_template_struct.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/adapt_template_struct.cpp (original)
+++ trunk/libs/spirit/example/qi/adapt_template_struct.cpp 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -39,7 +39,7 @@
 namespace boost { namespace spirit { namespace traits
 {
     template <typename A, typename B>
- struct transform_attribute<client::data<A, B>, fusion::vector<A&, B&> >
+ struct transform_attribute<client::data<A, B>, fusion::vector<A&, B&>, qi::domain>
     {
         typedef fusion::vector<A&, B&> type;
 

Modified: trunk/libs/spirit/example/qi/calc6/calc6c.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc6/calc6c.hpp (original)
+++ trunk/libs/spirit/example/qi/calc6/calc6c.hpp 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -38,13 +38,16 @@
         lexeme
         [
                 vars [_val = _1]
- >> !(alnum | '_') // make sure we have whole words
+ >> !(alnum | '_') // make sure we have whole words
         ]
         ;
 
     var_decl =
- "var"
- > !var_ref // make sure the variable isn't redeclared
+ lexeme[
+ "var"
+ >> !(alnum | '_') // make sure we have whole words
+ ]
+ > !var_ref // make sure the variable isn't redeclared
> identifier [add_var(_1, ref(nvars))]
> (';' | '=' > assignment_rhs(ref(nvars)-1))
         ;

Modified: trunk/libs/spirit/example/qi/calc7/calc7c.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/calc7/calc7c.hpp (original)
+++ trunk/libs/spirit/example/qi/calc7/calc7c.hpp 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -43,8 +43,11 @@
         ;
 
     var_decl =
- "var"
- > !var_ref // make sure the variable isn't redeclared
+ lexeme[
+ "var"
+ >> !(alnum | '_') // make sure we have whole words
+ ]
+ > !var_ref // make sure the variable isn't redeclared
> identifier [add_var(_1, ref(nvars))]
> (';' | '=' > assignment_rhs(ref(nvars)-1))
         ;

Modified: trunk/libs/spirit/example/qi/mini_c/mini_cc.hpp
==============================================================================
--- trunk/libs/spirit/example/qi/mini_c/mini_cc.hpp (original)
+++ trunk/libs/spirit/example/qi/mini_c/mini_cc.hpp 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -31,7 +31,7 @@
         lexeme
         [
                 vars [_val = _1]
- >> !(alnum | '_') // make sure we have whole words
+ >> !(alnum | '_') // make sure we have whole words
         ]
         ;
 
@@ -40,7 +40,7 @@
                 "int"
>> !(alnum | '_') // make sure we have whole words
             ]
- > !var_ref // make sure the variable isn't redeclared
+ > !var_ref // make sure the variable isn't redeclared
> identifier [add_var(_1)]
> (';' | '=' > assignment_rhs(ref(nvars)-1))
         ;

Modified: trunk/libs/spirit/example/qi/parse_date.cpp
==============================================================================
--- trunk/libs/spirit/example/qi/parse_date.cpp (original)
+++ trunk/libs/spirit/example/qi/parse_date.cpp 2010-07-07 22:49:09 EDT (Wed, 07 Jul 2010)
@@ -28,7 +28,7 @@
     // a fusion sequence consisting out of three integers as its attribute.
     template<>
     struct transform_attribute<
- boost::gregorian::date, fusion::vector<int, int, int> >
+ boost::gregorian::date, fusion::vector<int, int, int>, qi::domain>
     {
         typedef fusion::vector<int, int, int> date_parts;
 


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