]> git.proxmox.com Git - ceph.git/blame - 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
CommitLineData
7c673cae
FG
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
13using namespace BOOST_SPIRIT_CLASSIC_NS;
14using namespace std;
15
16int g_count = 0;
17
18struct g : public grammar<g>
19{
20 template <typename ScannerT>
21 struct definition
22 {
11fdf7f2 23 definition(g const& /*self*/)
7c673cae
FG
24 {
25 g_count++;
26 }
27
28 rule<ScannerT> r;
29 rule<ScannerT> const& start() const { return r; }
30 };
31};
32
33void
34grammar_tests()
35{
36 g my_g;
37 parse("", my_g);
38}
39
40int
41main()
42{
43 grammar_tests();
44 grammar_tests();
45 grammar_tests();
46 BOOST_TEST(g_count == 3);
47
48 return boost::report_errors();
49}
50