Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59658 - sandbox/msm/boost/msm/front/euml
From: christophe.j.henry_at_[hidden]
Date: 2010-02-12 08:22:08


Author: chenry
Date: 2010-02-12 08:22:07 EST (Fri, 12 Feb 2010)
New Revision: 59658
URL: http://svn.boost.org/trac/boost/changeset/59658

Log:
added support for internal_transition_table in eUML
Text files modified:
   sandbox/msm/boost/msm/front/euml/stt_grammar.hpp | 39 +++++++++++++++++++++++++++++++++++++--
   1 files changed, 37 insertions(+), 2 deletions(-)

Modified: sandbox/msm/boost/msm/front/euml/stt_grammar.hpp
==============================================================================
--- sandbox/msm/boost/msm/front/euml/stt_grammar.hpp (original)
+++ sandbox/msm/boost/msm/front/euml/stt_grammar.hpp 2010-02-12 08:22:07 EST (Fri, 12 Feb 2010)
@@ -40,7 +40,12 @@
     typedef Row<typename TEMP_ROW::Source,typename TEMP_ROW::Evt,typename TEMP_ROW::Target,
                 typename TEMP_ROW::Action,typename TEMP_ROW::Guard> type;
 };
-
+template <class TEMP_ROW>
+struct convert_to_internal_row
+{
+ typedef Internal<typename TEMP_ROW::Evt,
+ typename TEMP_ROW::Action,typename TEMP_ROW::Guard> type;
+};
 // row grammar
 struct BuildNextStates
    : proto::or_<
@@ -202,7 +207,6 @@
>
 {};
 
-
 template <class Expr>
 typename ::boost::mpl::eval_if<
     typename proto::matches<Expr,BuildStt>::type,
@@ -213,6 +217,37 @@
     return typename boost::result_of<BuildStt(Expr)>::type();
 }
 
+// internal stt grammar
+struct BuildInternalRow
+ : proto::when<
+ BuildEvent,
+ convert_to_internal_row<
+ fusion_left_right<TempRow<none,none,none>,BuildEvent(proto::_)> >()
+ >
+{};
+struct BuildInternalStt
+ : proto::or_<
+ proto::when<
+ proto::comma<BuildInternalStt,BuildInternalStt>,
+ boost::mpl::push_back<BuildInternalStt(proto::_left),BuildInternalRow(proto::_right)>()
+ >,
+ proto::when <
+ BuildInternalRow,
+ make_vector_one_row<BuildInternalRow(proto::_)>()
+ >
+ >
+{};
+
+template <class Expr>
+typename ::boost::mpl::eval_if<
+ typename proto::matches<Expr,BuildInternalStt>::type,
+ boost::result_of<BuildInternalStt(Expr)>,
+ make_invalid_type>::type
+build_internal_stt(Expr const& expr)
+{
+ return typename boost::result_of<BuildInternalStt(Expr)>::type();
+}
+
 
 }}}}
 #endif //BOOST_MSM_FRONT_EUML_STT_GRAMMAR_H


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