1 // Copyright 2008 Christophe Henry
2 // henry UNDERSCORE christophe AT hotmail DOT com
3 // This is an extended version of the state machine available in the boost::mpl library
4 // Distributed under the same license as the original.
5 // Copyright for the original version:
6 // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
7 // under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_MSM_FRONT_EUML_GUARD_GRAMMAR_H
12 #define BOOST_MSM_FRONT_EUML_GUARD_GRAMMAR_H
14 #include <boost/msm/front/euml/common.hpp>
15 #include <boost/msm/front/euml/operator.hpp>
16 #include <boost/msm/front/euml/state_grammar.hpp>
18 namespace boost { namespace msm { namespace front { namespace euml
23 struct BuildGuardsCases
25 // The primary template matches nothing:
26 template<typename Tag>
28 : proto::not_<proto::_>
32 struct BuildGuardsCases::case_<proto::tag::logical_or>
34 proto::logical_or<BuildGuards,BuildGuards >,
35 Or_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
39 struct BuildGuardsCases::case_<proto::tag::logical_and>
41 proto::logical_and<BuildGuards,BuildGuards >,
42 And_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
46 struct BuildGuardsCases::case_<proto::tag::logical_not>
48 proto::logical_not<BuildGuards >,
49 Not_<BuildGuards(proto::_child)>()
53 struct BuildGuardsCases::case_<proto::tag::less>
55 proto::less<BuildGuards, BuildGuards >,
56 Less_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
60 struct BuildGuardsCases::case_<proto::tag::less_equal>
62 proto::less_equal<BuildGuards, BuildGuards >,
63 LessEqual_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
67 struct BuildGuardsCases::case_<proto::tag::greater>
69 proto::greater<BuildGuards, BuildGuards >,
70 Greater_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
74 struct BuildGuardsCases::case_<proto::tag::greater_equal>
76 proto::greater_equal<BuildGuards, BuildGuards >,
77 GreaterEqual_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
81 struct BuildGuardsCases::case_<proto::tag::equal_to>
83 proto::equal_to<BuildGuards, BuildGuards >,
84 EqualTo_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
88 struct BuildGuardsCases::case_<proto::tag::not_equal_to>
90 proto::not_equal_to<BuildGuards, BuildGuards >,
91 NotEqualTo_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
95 struct BuildGuardsCases::case_<proto::tag::pre_inc>
97 proto::pre_inc<BuildGuards >,
98 Pre_inc_<BuildGuards(proto::_child)>()
102 struct BuildGuardsCases::case_<proto::tag::dereference>
104 proto::dereference<BuildGuards >,
105 Deref_<BuildGuards(proto::_child)>()
109 struct BuildGuardsCases::case_<proto::tag::pre_dec>
111 proto::pre_dec<BuildGuards >,
112 Pre_dec_<BuildGuards(proto::_child)>()
116 struct BuildGuardsCases::case_<proto::tag::post_inc>
118 proto::post_inc<BuildGuards >,
119 Post_inc_<BuildGuards(proto::_child)>()
123 struct BuildGuardsCases::case_<proto::tag::post_dec>
125 proto::post_dec<BuildGuards >,
126 Post_dec_<BuildGuards(proto::_child)>()
130 struct BuildGuardsCases::case_<proto::tag::plus>
132 proto::plus<BuildGuards,BuildGuards >,
133 Plus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
137 struct BuildGuardsCases::case_<proto::tag::minus>
139 proto::minus<BuildGuards,BuildGuards >,
140 Minus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
144 struct BuildGuardsCases::case_<proto::tag::multiplies>
146 proto::multiplies<BuildGuards,BuildGuards >,
147 Multiplies_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
151 struct BuildGuardsCases::case_<proto::tag::divides>
153 proto::divides<BuildGuards,BuildGuards >,
154 Divides_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
158 struct BuildGuardsCases::case_<proto::tag::modulus>
160 proto::modulus<BuildGuards,BuildGuards >,
161 Modulus_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
165 struct BuildGuardsCases::case_<proto::tag::bitwise_and>
167 proto::bitwise_and<BuildGuards,BuildGuards >,
168 Bitwise_And_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
172 struct BuildGuardsCases::case_<proto::tag::bitwise_or>
174 proto::bitwise_or<BuildGuards,BuildGuards >,
175 Bitwise_Or_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
179 struct BuildGuardsCases::case_<proto::tag::subscript>
181 proto::subscript<BuildGuards,BuildGuards >,
182 Subscript_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
186 struct BuildGuardsCases::case_<proto::tag::plus_assign>
188 proto::plus_assign<BuildGuards,BuildGuards >,
189 Plus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
193 struct BuildGuardsCases::case_<proto::tag::minus_assign>
195 proto::minus_assign<BuildGuards,BuildGuards >,
196 Minus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
200 struct BuildGuardsCases::case_<proto::tag::multiplies_assign>
202 proto::multiplies_assign<BuildGuards,BuildGuards >,
203 Multiplies_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
207 struct BuildGuardsCases::case_<proto::tag::divides_assign>
209 proto::divides_assign<BuildGuards,BuildGuards >,
210 Divides_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
214 struct BuildGuardsCases::case_<proto::tag::modulus_assign>
216 proto::modulus_assign<BuildGuards,BuildGuards >,
217 Modulus_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
221 struct BuildGuardsCases::case_<proto::tag::shift_left_assign>
223 proto::shift_left_assign<BuildGuards,BuildGuards >,
224 ShiftLeft_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
228 struct BuildGuardsCases::case_<proto::tag::shift_right_assign>
230 proto::shift_right_assign<BuildGuards,BuildGuards >,
231 ShiftRight_Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
235 struct BuildGuardsCases::case_<proto::tag::shift_left>
237 proto::shift_left<BuildGuards,BuildGuards >,
238 ShiftLeft_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
242 struct BuildGuardsCases::case_<proto::tag::shift_right>
244 proto::shift_right<BuildGuards,BuildGuards >,
245 ShiftRight_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
249 struct BuildGuardsCases::case_<proto::tag::assign>
251 proto::assign<BuildGuards,BuildGuards >,
252 Assign_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
256 struct BuildGuardsCases::case_<proto::tag::bitwise_xor>
258 proto::bitwise_xor<BuildGuards,BuildGuards >,
259 Bitwise_Xor_<BuildGuards(proto::_left),BuildGuards(proto::_right)>()
263 struct BuildGuardsCases::case_<proto::tag::negate>
265 proto::negate<BuildGuards >,
266 Unary_Minus_<BuildGuards(proto::_child)>()
271 struct BuildGuardsCases::case_<proto::tag::function>
274 proto::function<proto::terminal<if_tag>,BuildGuards,BuildGuards,BuildGuards >,
275 If_Else_<BuildGuards(proto::_child_c<1>),
276 BuildGuards(proto::_child_c<2>),
277 BuildGuards(proto::_child_c<3>) >()
280 proto::function<proto::terminal<proto::_> >,
281 get_fct<proto::_child_c<0> >()
284 proto::function<proto::terminal<proto::_>,BuildActions >,
285 get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>) >()
288 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions >,
289 get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>) >()
292 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions >,
293 get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>)
294 ,BuildActions(proto::_child_c<2>),BuildActions(proto::_child_c<3>) >()
297 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions >,
298 get_fct<proto::_child_c<0>
299 ,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
300 ,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>) >()
303 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
304 get_fct<proto::_child_c<0>
305 ,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
306 ,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>),BuildActions(proto::_child_c<5>) >()
310 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
311 get_fct<proto::_child_c<0>
312 ,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
313 ,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>)
314 ,BuildActions(proto::_child_c<5>),BuildActions(proto::_child_c<6>) >()
321 struct BuildGuardsCases::case_<proto::tag::terminal>
324 proto::terminal<action_tag>,
325 get_action_name<proto::_ >()
328 proto::terminal<state_tag>,
329 get_state_name<proto::_>()
332 proto::terminal<flag_tag>,
336 proto::terminal<event_tag>,
340 proto::terminal<fsm_artefact_tag>,
344 proto::terminal<proto::_>,
351 : proto::switch_<BuildGuardsCases>
356 #endif //BOOST_MSM_FRONT_EUML_GUARD_GRAMMAR_H