Last change
on this file since 33 was
29,
checked in by landauf, 16 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
1.0 KB
|
Rev | Line | |
---|
[29] | 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/core.hpp> |
---|
| 12 | |
---|
| 13 | using namespace boost::spirit; |
---|
| 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 | |
---|
Note: See
TracBrowser
for help on using the repository browser.