group_match_bug.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*=============================================================================
  2. Copyright (c) 2004 Joao Abecasis
  3. http://spirit.sourceforge.net/
  4. Use, modification and distribution is subject to the Boost Software
  5. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. =============================================================================*/
  8. #include <boost/spirit/include/classic_core.hpp>
  9. #include <boost/spirit/include/classic_closure.hpp>
  10. #include <boost/spirit/include/classic_ast.hpp>
  11. #include <boost/spirit/include/classic_parse_tree.hpp>
  12. using namespace BOOST_SPIRIT_CLASSIC_NS;
  13. struct test_closure : public closure<test_closure, int>
  14. {
  15. member1 value;
  16. };
  17. struct test_grammar : public grammar<test_grammar>
  18. {
  19. template <typename ScannerT>
  20. struct definition
  21. {
  22. definition(const test_grammar&)
  23. {
  24. }
  25. rule<ScannerT, test_closure::context_t> const & start() const
  26. {
  27. return first;
  28. }
  29. rule<ScannerT, test_closure::context_t> first;
  30. };
  31. };
  32. int main()
  33. {
  34. parse("abcd", test_grammar());
  35. pt_parse("abcd", test_grammar());
  36. ast_parse("abcd", test_grammar());
  37. }