1 /*============================================================================= 2 Copyright (c) 2004 Joao Abecasis 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 10 #include <boost/spirit/include/classic_primitives.hpp> 11 #include <boost/spirit/include/classic_rule.hpp> 12 13 #include <string> 14 main()15int main() 16 { 17 using BOOST_SPIRIT_CLASSIC_NS::rule; 18 using BOOST_SPIRIT_CLASSIC_NS::str_p; 19 using BOOST_SPIRIT_CLASSIC_NS::ch_p; 20 21 using std::string; 22 23 string str = "abcd"; 24 25 rule<> strings = str_p("abcd"); 26 strings = str_p('a'); 27 strings = str_p(str.begin(), str.end()); 28 29 rule<> chars = ch_p('a'); 30 chars = ch_p("b"); 31 } 32 33