1 | #include <boost/spirit/include/qi.hpp>
|
---|
2 | #include <boost/spirit/include/phoenix.hpp>
|
---|
3 | #include <boost/fusion/container.hpp>
|
---|
4 | #include <boost/fusion/include/container.hpp>
|
---|
5 |
|
---|
6 | struct SomeState
|
---|
7 | {
|
---|
8 | };
|
---|
9 |
|
---|
10 | namespace qi = boost::spirit::qi;
|
---|
11 |
|
---|
12 | /*
|
---|
13 | * Prototype of the grammar where the error is appearing
|
---|
14 | */
|
---|
15 | template <typename Iterator>
|
---|
16 | struct CommandsGrammar: boost::spirit::qi::grammar<Iterator, SomeState(SomeState)>
|
---|
17 | {
|
---|
18 | CommandsGrammar()
|
---|
19 | : CommandsGrammar::base_type(commands)
|
---|
20 | {
|
---|
21 | commands =
|
---|
22 | (
|
---|
23 | "subcommand1"
|
---|
24 | | ( "subcommand2" > qi::uint_)
|
---|
25 | | ( qi::uint_ > qi::uint_ > qi::uint_ > qi::uint_ )
|
---|
26 | )[qi::_val = qi::_r1];
|
---|
27 | }
|
---|
28 |
|
---|
29 | qi::rule<Iterator, SomeState(SomeState)> commands;
|
---|
30 | };
|
---|
31 |
|
---|
32 | /* Explicit instantiation of the template to show that the problem
|
---|
33 | * occurs just in the grammar itself */
|
---|
34 | template CommandsGrammar<std::string::iterator>::CommandsGrammar();
|
---|
35 |
|
---|
36 | int main()
|
---|
37 | {
|
---|
38 |
|
---|
39 | }
|
---|