Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71746 - in trunk/boost/msm: . back front front/euml
From: christophe.j.henry_at_[hidden]
Date: 2011-05-05 15:23:56


Author: chenry
Date: 2011-05-05 15:23:55 EDT (Thu, 05 May 2011)
New Revision: 71746
URL: http://svn.boost.org/trac/boost/changeset/71746

Log:
fixed 2nd part of bug with euml and state construction (see post: [msm] EUML and State construction)
Text files modified:
   trunk/boost/msm/back/fold_to_list.hpp | 12 ++++++++++--
   trunk/boost/msm/common.hpp | 2 ++
   trunk/boost/msm/front/euml/common.hpp | 2 +-
   trunk/boost/msm/front/functor_row.hpp | 1 -
   trunk/boost/msm/msm_grammar.hpp | 1 +
   5 files changed, 14 insertions(+), 4 deletions(-)

Modified: trunk/boost/msm/back/fold_to_list.hpp
==============================================================================
--- trunk/boost/msm/back/fold_to_list.hpp (original)
+++ trunk/boost/msm/back/fold_to_list.hpp 2011-05-05 15:23:55 EDT (Thu, 05 May 2011)
@@ -43,11 +43,19 @@
>
         // Put all other terminals at the head of the
         // list that we're building in the "state" parameter
+ // first states for the eUML states
       , ::boost::proto::when<
- ::boost::proto::terminal< ::boost::proto::_>
+ ::boost::proto::terminal< state_tag >
+ , boost::fusion::cons< ::boost::proto::_, ::boost::proto::_state>(
+ ::boost::proto::_, ::boost::proto::_state
+ )
+ >
+ // then states from other front-ends
+ , ::boost::proto::when<
+ ::boost::proto::terminal< proto::_ >
             , boost::fusion::cons< ::boost::proto::_value, ::boost::proto::_state>(
                 ::boost::proto::_value, ::boost::proto::_state
- )
+ )
>
         // For left-shift operations, first fold the right
         // child to a list using the current state. Use

Modified: trunk/boost/msm/common.hpp
==============================================================================
--- trunk/boost/msm/common.hpp (original)
+++ trunk/boost/msm/common.hpp 2011-05-05 15:23:55 EDT (Thu, 05 May 2011)
@@ -19,6 +19,8 @@
 template <class T>
 struct wrap{};
 
+// tag to use in grammars where states are seen (init_<<, states_<<...)
+struct state_tag{};
 
 } } // boost::msm
 #endif //BOOST_MSM_COMMON_H

Modified: trunk/boost/msm/front/euml/common.hpp
==============================================================================
--- trunk/boost/msm/front/euml/common.hpp (original)
+++ trunk/boost/msm/front/euml/common.hpp 2011-05-05 15:23:55 EDT (Thu, 05 May 2011)
@@ -228,7 +228,7 @@
     };
 };
 template <class STATE>
-struct euml_state: proto::extends<typename proto::terminal<state_tag>::type, STATE, state_domain>
+struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, state_domain>
 {
     typedef state_tag euml_tag_type;
     using proto::extends<typename proto::terminal<state_tag>::type, STATE, state_domain>::operator=;

Modified: trunk/boost/msm/front/functor_row.hpp
==============================================================================
--- trunk/boost/msm/front/functor_row.hpp (original)
+++ trunk/boost/msm/front/functor_row.hpp 2011-05-05 15:23:55 EDT (Thu, 05 May 2011)
@@ -256,7 +256,6 @@
         // no action, no guard
         typedef sm__i_row_tag row_type_tag;
     };
- struct state_tag{};
     struct event_tag{};
     struct action_tag{};
     struct state_action_tag{};

Modified: trunk/boost/msm/msm_grammar.hpp
==============================================================================
--- trunk/boost/msm/msm_grammar.hpp (original)
+++ trunk/boost/msm/msm_grammar.hpp 2011-05-05 15:23:55 EDT (Thu, 05 May 2011)
@@ -11,6 +11,7 @@
 #ifndef BOOST_MSM_GRAMMAR_H
 #define BOOST_MSM_GRAMMAR_H
 
+#include <boost/msm/common.hpp>
 
 
 namespace boost { namespace msm


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