// Copyright (c) 2001-2011 Hartmut Kaiser // Copyright (c) 2011 Ryan Molden // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include using namespace std; using namespace boost::spirit; template struct my_lexer : boost::spirit::lex::lexer { my_lexer() { token = L"Yay winning!"; this->self = token; } lex::token_def token; }; int main() { typedef lex::lexertl::token token_type; typedef lex::lexertl::lexer lexer_type; my_lexer lexer; basic_ofstream output_dfa("test_dfa.hpp"); BOOST_TEST(lex::lexertl::generate_static_dfa(lexer, output_dfa, L"test_dfa")); basic_ofstream output_switch("test_switch.hpp"); BOOST_TEST(lex::lexertl::generate_static_switch(lexer, output_switch, L"test_switch")); return boost::report_errors(); }