regression_container_attribute.cpp 743 B

1234567891011121314151617181920212223
  1. // Copyright (c) 2001-2011 Hartmut Kaiser
  2. // Copyright (c) 2011 Joerg Becker
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. // compile test only
  7. #include <boost/spirit/include/qi.hpp>
  8. #include <string>
  9. int main()
  10. {
  11. namespace qi = boost::spirit::qi;
  12. qi::rule < std::string::const_iterator, std::string() > const t =
  13. "s" >> qi::attr( std::string() );
  14. boost::spirit::qi::symbols< char, std::string > keywords;
  15. keywords.add( "keyword", std::string( "keyword" ) );
  16. qi::rule < std::string::const_iterator, std::string() > const u =
  17. qi::lexeme[keywords >> !( qi::alnum | '_' )] >> qi::attr( std::string() );
  18. }