Ticket #6253: BoostRepro.cpp

File BoostRepro.cpp, 874 bytes (added by Ryan Molden <ryanmolden@…>, 11 years ago)

Repro of bug as attachment (the ticket system did some weird formatting to it for unknown reasons)

Line 
1#include <fstream>
2#include <boost/config/warning_disable.hpp>
3#include <boost/spirit/include/lex_lexertl.hpp>
4#include <boost/spirit/include/lex_generate_static_lexertl.hpp>
5#include <boost/spirit/include/lex_static_lexertl.hpp>
6
7using namespace std;
8using namespace boost::spirit;
9
10template <typename BaseLexer>
11struct MyLexer : boost::spirit::lex::lexer<BaseLexer>
12{
13 MyLexer()
14 {
15 token = L"Yay winning!";
16 this->self = token;
17 }
18
19
20 lex::token_def<lex::unused_type, wchar_t> token;
21};
22
23int main(int argc, char* argv[])
24{
25 typedef lex::lexertl::token<const wchar_t*> token_type;
26 typedef lex::lexertl::lexer<token_type> lexer_type;
27
28 MyLexer<lexer_type> lexer;
29
30 ofstream outputStream("test.hpp");
31
32 return lex::lexertl::generate_static_dfa(lexer, outputStream, "test") ? 0 : -1;
33}