2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00
Files
spirit/test/lex/regression_matlib_generate.cpp
2021-08-28 23:43:28 +03:00

34 lines
975 B
C++

// Copyright (c) 2001-2011 Hartmut Kaiser
// Copyright (c) 2009 Carl Barron
//
// 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 <boost/spirit/include/lex_generate_static_lexertl.hpp>
#include <boost/spirit/include/lex_lexertl.hpp>
#include <boost/core/lightweight_test.hpp>
#include <fstream>
#include <vector>
#include "matlib.h"
int main(int argc, char* argv[])
{
std::vector<std::vector<double> > results;
typedef std::string::iterator iter;
typedef boost::spirit::lex::lexertl::actor_lexer<
boost::spirit::lex::lexertl::token<iter>
> lexer_type;
typedef matlib_tokens<lexer_type> matlib_type;
matlib_type matrix(results);
std::ofstream out(argc < 2 ? "matlib_static.h" : argv[1]);
BOOST_TEST(boost::spirit::lex::lexertl::generate_static_dfa(matrix, out, "matlib"));
return boost::report_errors();
}