Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66946 - trunk/boost/spirit/home/lex/lexer/lexertl
From: hartmut.kaiser_at_[hidden]
Date: 2010-12-01 09:34:46


Author: hkaiser
Date: 2010-12-01 09:34:43 EST (Wed, 01 Dec 2010)
New Revision: 66946
URL: http://svn.boost.org/trac/boost/changeset/66946

Log:
Spirit: fixing warnings and a clang compilation issue
Text files modified:
   trunk/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp | 13 ++++++-------
   trunk/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp | 13 ++++++-------
   trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp | 16 +++-------------
   3 files changed, 15 insertions(+), 27 deletions(-)

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/functor_data.hpp 2010-12-01 09:34:43 EST (Wed, 01 Dec 2010)
@@ -25,12 +25,12 @@
         ///////////////////////////////////////////////////////////////////////
         template <typename Iterator, typename HasActors, typename HasState
           , typename TokenValue>
- struct data; // no default specialization
+ class data; // no default specialization
 
         ///////////////////////////////////////////////////////////////////////
         // neither supports state, nor actors
         template <typename Iterator, typename TokenValue>
- struct data<Iterator, mpl::false_, mpl::false_, TokenValue>
+ class data<Iterator, mpl::false_, mpl::false_, TokenValue>
         {
         protected:
             typedef typename
@@ -196,8 +196,8 @@
         ///////////////////////////////////////////////////////////////////////
         // doesn't support lexer semantic actions, but supports state
         template <typename Iterator, typename TokenValue>
- struct data<Iterator, mpl::false_, mpl::true_, TokenValue>
- : data<Iterator, mpl::false_, mpl::false_, TokenValue>
+ class data<Iterator, mpl::false_, mpl::true_, TokenValue>
+ : public data<Iterator, mpl::false_, mpl::false_, TokenValue>
         {
         protected:
             typedef data<Iterator, mpl::false_, mpl::false_, TokenValue> base_type;
@@ -269,8 +269,8 @@
         ///////////////////////////////////////////////////////////////////////
         // does support lexer semantic actions, may support state
         template <typename Iterator, typename HasState, typename TokenValue>
- struct data<Iterator, mpl::true_, HasState, TokenValue>
- : data<Iterator, mpl::false_, HasState, TokenValue>
+ class data<Iterator, mpl::true_, HasState, TokenValue>
+ : public data<Iterator, mpl::false_, HasState, TokenValue>
         {
         public:
             typedef semantic_actions<Iterator, HasState, data>
@@ -402,7 +402,6 @@
             data& operator= (data const&);
         };
     }
-
 }}}}
 
 #endif

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/static_functor_data.hpp 2010-12-01 09:34:43 EST (Wed, 01 Dec 2010)
@@ -39,12 +39,12 @@
         ///////////////////////////////////////////////////////////////////////
         template <typename Iterator, typename HasActors, typename HasState
           , typename TokenValue>
- struct static_data; // no default specialization
+ class static_data; // no default specialization
 
         ///////////////////////////////////////////////////////////////////////
         // doesn't support no state and no actors
         template <typename Iterator, typename TokenValue>
- struct static_data<Iterator, mpl::false_, mpl::false_, TokenValue>
+ class static_data<Iterator, mpl::false_, mpl::false_, TokenValue>
         {
         protected:
             typedef typename
@@ -214,8 +214,8 @@
         ///////////////////////////////////////////////////////////////////////
         // doesn't support no actors, but does support states
         template <typename Iterator, typename TokenValue>
- struct static_data<Iterator, mpl::false_, mpl::true_, TokenValue>
- : static_data<Iterator, mpl::false_, mpl::false_, TokenValue>
+ class static_data<Iterator, mpl::false_, mpl::true_, TokenValue>
+ : public static_data<Iterator, mpl::false_, mpl::false_, TokenValue>
         {
         protected:
             typedef static_data<Iterator, mpl::false_, mpl::false_, TokenValue> base_type;
@@ -289,8 +289,8 @@
         ///////////////////////////////////////////////////////////////////////
         // does support actors, but may have no state
         template <typename Iterator, typename HasState, typename TokenValue>
- struct static_data<Iterator, mpl::true_, HasState, TokenValue>
- : static_data<Iterator, mpl::false_, HasState, TokenValue>
+ class static_data<Iterator, mpl::true_, HasState, TokenValue>
+ : public static_data<Iterator, mpl::false_, HasState, TokenValue>
         {
         public:
             typedef semantic_actions<Iterator, HasState, static_data>
@@ -422,7 +422,6 @@
             static_data& operator= (static_data const&);
         };
     }
-
 }}}}
 
 #endif

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/token.hpp 2010-12-01 09:34:43 EST (Wed, 01 Dec 2010)
@@ -139,8 +139,8 @@
 #if defined(BOOST_SPIRIT_DEBUG)
         token(id_type id, std::size_t, Iterator const& first
               , Iterator const& last)
- : id_(id)
- , matched_(first, last)
+ : matched_(first, last)
+ , id_(id)
         {}
 #else
         token(id_type id, std::size_t, Iterator const&, Iterator const&)
@@ -181,16 +181,6 @@
         std::pair<Iterator, Iterator> matched_;
 #endif
 
-// works only starting MSVC V8
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
- private:
- struct dummy { void true_() {} };
- typedef void (dummy::*safe_bool)();
-
- public:
- operator safe_bool() const { return is_valid() ? &dummy::true_ : 0; }
-#endif
-
     protected:
         id_type id_; // token id, 0 if nothing has been matched
     };
@@ -202,7 +192,7 @@
     operator<< (std::basic_ostream<Char, Traits>& os
       , token<Iterator, AttributeTypes, HasState, Idtype> const& t)
     {
- if (t) {
+ if (t.is_valid()) {
             Iterator end = t.matched_.second;
             for (Iterator it = t.matched_.first; it != end; ++it)
                 os << *it;


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