【问题标题】:An alternative to flex and bison duo?flex 和 bison duo 的替代品?
【发布时间】:2020-07-03 00:56:55
【问题描述】:

是否有任何替代 flex 和 bison (lex/yacc) 组合的方法?还有其他可以在 BNF 中指定语言语法的工具吗?

【问题讨论】:

    标签: compiler-construction


    【解决方案1】:

    几个选项:

    Antlr:http://www.antlr.org/

    如果你使用 C++,Boost::Spirit:http://www.boost.org/doc/libs/1_41_0/libs/spirit/doc/html/index.html

    【讨论】:

    • 我真的很喜欢 Boost::Spirit 解决这个问题的方法。我什至不必离开 Visual Studio :)
    【解决方案2】:

    ANTLR

    【讨论】:

      【解决方案3】:

      二合一,无依赖,可从 c 或 c++ 使用,可重入。我喜欢: https://www.piumarta.com/software/peg/ 只需阅读即可理解整个事情: https://www.piumarta.com/software/peg/peg.1.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-10-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-09-11
        • 1970-01-01
        相关资源
        最近更新 更多