1 // Copyright (c) 2001-2011 Hartmut Kaiser
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 // This small utility program generates the 2 static lexers, the static table
7 // driven and the static switch based lexer.
12 #include "lexer_def.hpp"
13 #include <boost/spirit/include/lex_generate_static_lexertl.hpp>
17 typedef std::string::const_iterator base_iterator_type
;
18 typedef client::lexer::conjure_tokens
<base_iterator_type
> lexer_type
;
22 // first generate the static switch based lexer
23 std::ofstream
out_static("conjure_static_switch_lexer.hpp");
25 bool result
= boost::spirit::lex::lexertl::generate_static_switch(
26 lexer
, out_static
, "conjure_static_switch");
28 std::cerr
<< "Failed to generate static switch based lexer\n";
32 // now generate the static table based lexer
33 std::ofstream
out("conjure_static_lexer.hpp");
34 result
= boost::spirit::lex::lexertl::generate_static(
35 lexer
, out
, "conjure_static");
37 std::cerr
<< "Failed to generate static table based lexer\n";