I'm converting a Boost Spirit Lex program to the static lexer model. The lexer has a semantic action, therefore the dynamic lexer is of type actor_lexer
:
#ifndef USE_STATIC_SI_LEXER
typedef lex::lexertl::actor_lexer<token_type> lexer_type;
#else
typedef lex::lexertl::static_lexer<
token_type,
lex::lexertl::static_::lexer_si
> lexer_type;
#endif
Now when compiling with the static lexer, I get the error
boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp(230):
error C2039: 'add_action' : is not a member of 'boost::spirit::unused_type'
which is exactly what is expected when one uses a semantic action but forgets to change lexer
into actor_lexer
. I did use the actor_lexer
type in the generator program, which seems to work as far as I can tell.
Is there something else I'm missing? Or is it currently impossible to use semantic actions in a static lexer?
There is a static_actor_lexer
template for use in this case, as seen in this example.
lex::lexertl::static_actor_lexer<
token_type, lex::lexertl::static_::lexer_wcl
>