]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/lex/regression_matlib_generate.cpp
00c2612fecefd6023e9babaabb7d894d3ccd1bff
[ceph.git] / ceph / src / boost / libs / spirit / test / lex / regression_matlib_generate.cpp
1 // Copyright (c) 2001-2011 Hartmut Kaiser
2 // Copyright (c) 2009 Carl Barron
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
7 #include <boost/spirit/include/lex_generate_static_lexertl.hpp>
8
9 #include <boost/spirit/include/lex_lexertl.hpp>
10
11 #include <boost/core/lightweight_test.hpp>
12 #include <fstream>
13 #include <vector>
14
15 #include "matlib.h"
16
17 int main(int argc, char* argv[])
18 {
19 std::vector<std::vector<double> > results;
20
21 typedef std::string::iterator iter;
22 typedef boost::spirit::lex::lexertl::actor_lexer<
23 boost::spirit::lex::lexertl::token<iter>
24 > lexer_type;
25
26 typedef matlib_tokens<lexer_type> matlib_type;
27 matlib_type matrix(results);
28
29 std::ofstream out(argc < 2 ? "matlib_static.h" : argv[1]);
30 BOOST_TEST(boost::spirit::lex::lexertl::generate_static_dfa(matrix, out, "matlib"));
31 return boost::report_errors();
32 }
33