]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/test/grammar_multi_instance_tst.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / spirit / classic / test / grammar_multi_instance_tst.cpp
1 /*=============================================================================
2 Copyright (c) 2004 Joel de Guzman
3 http://spirit.sourceforge.net/
4
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 #include <iostream>
10 #include <boost/detail/lightweight_test.hpp>
11 #include <boost/spirit/include/classic_core.hpp>
12
13 using namespace BOOST_SPIRIT_CLASSIC_NS;
14 using namespace std;
15
16 int g_count = 0;
17
18 struct g : public grammar<g>
19 {
20 template <typename ScannerT>
21 struct definition
22 {
23 definition(g const& /*self*/)
24 {
25 g_count++;
26 }
27
28 rule<ScannerT> r;
29 rule<ScannerT> const& start() const { return r; }
30 };
31 };
32
33 void
34 grammar_tests()
35 {
36 g my_g;
37 parse("", my_g);
38 }
39
40 int
41 main()
42 {
43 grammar_tests();
44 grammar_tests();
45 grammar_tests();
46 BOOST_TEST(g_count == 3);
47
48 return boost::report_errors();
49 }
50