Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一个简单的 C 语言词法分析器/解析器或基于 Flex/Bison 的子集?
我找到了一些 C 的开源解析器(TCC、LCC、...),但它们都不是基于野牛的。
YACC(Bison 的前身)有一个C11 语法,它应该可以与 Bison 一起使用(可能需要进行一些调整)。
GCC 很久以前是基于 Bison 的。GCC 3.4 源代码包含一个具有 C 语法的文件。
这是使用 bison/flex 的 C 子集的编译器实现。