将升压actor_lexer转换为静态:错误,好像"actor_"未使用

Converting a Boost actor_lexer to static: Error as if "actor_" not used

本文关键字:actor 错误 好像 未使用 lexer 转换 静态      更新时间:2023-10-16

>我正在将Boost Spirit Lex程序转换为静态词法分析器模型。词法分析器具有语义操作,因此动态词法分析器的类型为 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

现在使用静态词法分析器编译时,我收到错误

boost/spirit/home/lex/lexer/lexertl/static_lexer.hpp(230): 
error C2039: 'add_action' : is not a member of 'boost::spirit::unused_type'

当一个人使用语义操作但忘记将lexer更改为actor_lexer时,这正是所期望的。我确实在生成器程序中使用了actor_lexer类型,据我所知,它似乎有效。

我还缺少什么吗?还是目前无法在静态词法分析器中使用语义操作?

在这种情况下,有一个static_actor_lexer模板,如本例所示。

lex::lexertl::static_actor_lexer<
    token_type, lex::lexertl::static_::lexer_wcl
>