/Src/Dependencies/Boost/boost/msm/msm_grammar.hpp

http://hadesmem.googlecode.com/ · C++ Header · 46 lines · 25 code · 9 blank · 12 comment · 0 complexity · 7625e57e7d5a53c22ffa5842470e1f4b MD5 · raw file

  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)
  10. #ifndef BOOST_MSM_GRAMMAR_H
  11. #define BOOST_MSM_GRAMMAR_H
  12. #include <boost/msm/common.hpp>
  13. namespace boost { namespace msm
  14. {
  15. // base grammar for all of msm's proto-based grammars
  16. struct basic_grammar : proto::_
  17. {};
  18. // Forward-declare an expression wrapper
  19. template<typename Expr>
  20. struct msm_terminal;
  21. struct msm_domain
  22. : proto::domain< proto::generator<msm_terminal>, basic_grammar >
  23. {};
  24. template<typename Expr>
  25. struct msm_terminal
  26. : proto::extends<Expr, msm_terminal<Expr>, msm_domain>
  27. {
  28. typedef
  29. proto::extends<Expr, msm_terminal<Expr>, msm_domain>
  30. base_type;
  31. // Needs a constructor
  32. msm_terminal(Expr const &e = Expr())
  33. : base_type(e)
  34. {}
  35. };
  36. } } // boost::msm
  37. #endif //BOOST_MSM_GRAMMAR_H