1 /*============================================================================= 2 Copyright (c) 2004 Joao Abecasis 3 Copyright (c) 2004 Joel de Guzman 4 http://spirit.sourceforge.net/ 5 6 Use, modification and distribution is subject to the Boost Software 7 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 http://www.boost.org/LICENSE_1_0.txt) 9 =============================================================================*/ 10 #include <boost/spirit/include/classic_core.hpp> 11 #include <boost/spirit/include/classic_dynamic.hpp> 12 #include <boost/spirit/include/phoenix1.hpp> 13 #include <boost/detail/lightweight_test.hpp> 14 #include <iostream> 15 #include <string> 16 17 using namespace BOOST_SPIRIT_CLASSIC_NS; 18 using namespace phoenix; 19 main()20int main() 21 { 22 using std::cout; 23 using std::endl; 24 using std::string; 25 26 bool f = false; 27 28 rule<> start = 29 while_p(~eps_p(anychar_p[var(f) = true])) 30 [ 31 anychar_p 32 ]; 33 34 parse("This goes to prove my point.", start); 35 BOOST_TEST(f == false); 36 return boost::report_errors(); 37 } 38 39 40