• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/detail/lightweight_test.hpp>
8 #include <boost/spirit/include/lex_lexertl.hpp>
9 #include <boost/spirit/include/lex_generate_static_lexertl.hpp>
10 
11 #include <fstream>
12 #include <vector>
13 
14 #include "matlib.h"
15 
main(int argc,char * argv[])16 int main(int argc, char* argv[])
17 {
18     std::vector<std::vector<double> > results;
19 
20     typedef std::string::iterator iter;
21     typedef boost::spirit::lex::lexertl::actor_lexer<
22         boost::spirit::lex::lexertl::token<iter>
23     > lexer_type;
24 
25     typedef matlib_tokens<lexer_type> matlib_type;
26     matlib_type matrix(results);
27 
28     std::ofstream out(argc < 2 ? "matlib_static.h" : argv[1]);
29     BOOST_TEST(boost::spirit::lex::lexertl::generate_static_dfa(matrix, out, "matlib"));
30     return boost::report_errors();
31 }
32 
33