【发布时间】:2020-07-03 00:56:55
【问题描述】:
是否有任何替代 flex 和 bison (lex/yacc) 组合的方法?还有其他可以在 BNF 中指定语言语法的工具吗?
【问题讨论】:
是否有任何替代 flex 和 bison (lex/yacc) 组合的方法?还有其他可以在 BNF 中指定语言语法的工具吗?
【问题讨论】:
几个选项:
Antlr:http://www.antlr.org/
如果你使用 C++,Boost::Spirit:http://www.boost.org/doc/libs/1_41_0/libs/spirit/doc/html/index.html
【讨论】:
【讨论】:
二合一,无依赖,可从 c 或 c++ 使用,可重入。我喜欢: https://www.piumarta.com/software/peg/ 只需阅读即可理解整个事情: https://www.piumarta.com/software/peg/peg.1.html
【讨论】: