EDIT: I extended the example to show the problem when I want to use it according to a different rule: http://liveworkspace.org/code/22lxL7 $ 17
I am trying to improve the performance of my Boost Spirit parser, and I saw that with C ++ 11 you could use these automatic rules:
auto comment = "/*" >> *(char_ - "*/") >> "*/";
(or with BOOST_AUTO or BOOST_SPIRIT_AUTO).
I have an ad declaration like:
qi::rule<lexer::Iterator, ast::SimpleType()> simple_type;
and is defined as follows:
simple_type %= const_ >> lexer.identifier;
If I declare it with auto, it compiles, but it cannot be used as an AST in other rules.
Is it possible to define rules that create an AST with automatic rules? I'm also interested in other ways to speed up the creation of AST in Boost Spirit.
source share