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