1 | // Copyright (c) 2013 Andreas Pokorny |
---|---|
2 | // |
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) |
5 | |
6 | #include <boost/spirit/include/lex_lexertl.hpp> |
7 | |
8 | #include <boost/core/lightweight_test.hpp> |
9 | #include <boost/phoenix/core.hpp> |
10 | #include <boost/phoenix/operator.hpp> |
11 | |
12 | #include <fstream> |
13 | |
14 | using namespace std; |
15 | using namespace boost::spirit; |
16 | |
17 | template <typename BaseLexer> |
18 | struct test_lexer : boost::spirit::lex::lexer<BaseLexer> |
19 | { |
20 | test_lexer() |
21 | { |
22 | this->self = lex::string("just something") |
23 | [ |
24 | lex::_end = lex::less(v: boost::phoenix::val(t: 1)) |
25 | ] |
26 | ; |
27 | } |
28 | }; |
29 | |
30 | int main() |
31 | { |
32 | typedef lex::lexertl::token<char const*> token_type; |
33 | typedef lex::lexertl::actor_lexer<token_type> lexer_type; |
34 | |
35 | test_lexer<lexer_type> lexer; |
36 | |
37 | return boost::report_errors(); |
38 | } |
39 |