]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/lex/regression_static_wide_6253.cpp
1 // Copyright (c) 2001-2011 Hartmut Kaiser
2 // Copyright (c) 2011 Ryan Molden
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)
7 #include <boost/detail/lightweight_test.hpp>
8 #include <boost/config/warning_disable.hpp>
10 #include <boost/spirit/include/lex_lexertl.hpp>
11 #include <boost/spirit/include/lex_generate_static_lexertl.hpp>
12 #include <boost/spirit/include/lex_static_lexertl.hpp>
17 using namespace boost::spirit
;
19 template <typename BaseLexer
>
20 struct my_lexer
: boost::spirit::lex::lexer
<BaseLexer
>
24 token
= L
"Yay winning!";
28 lex::token_def
<lex::unused_type
, wchar_t> token
;
33 typedef lex::lexertl::token
<wchar_t const*> token_type
;
34 typedef lex::lexertl::lexer
<token_type
> lexer_type
;
36 my_lexer
<lexer_type
> lexer
;
38 basic_ofstream
<wchar_t> output_dfa("test_dfa.hpp");
39 BOOST_TEST(lex::lexertl::generate_static_dfa(lexer
, output_dfa
, L
"test_dfa"));
41 basic_ofstream
<wchar_t> output_switch("test_switch.hpp");
42 BOOST_TEST(lex::lexertl::generate_static_switch(lexer
, output_switch
, L
"test_switch"));
43 return boost::report_errors();