BNF 语法存储库?

发布于 2024-07-09 12:41:17 字数 104 浏览 9 评论 0原文

在哪里可以找到流行语言的巴科斯范式或 BNF 语法? 每当我进行搜索时,我都不会出现太多,但我认为它们一定会在某个地方发布。 我最感兴趣的是 Objective-C 和 MySQL 的一个。

Is there a place I can find Backus–Naur Form or BNF grammars for popular languages? Whenever I do a search I don't turn up much, but I figure they must be published somewhere. I'm most interested in seeing one for Objective-C and maybe MySQL.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

假装爱人 2024-07-16 12:41:17

FWIW,MySQL语法文件(mysql-server/sql/sql_yacc.y)是开源的,可以在launchpad.net上浏览(尽管它有点慢,当我尝试拉起时出现错误)具体文件)。

另外,整个 MySQL Server 源代码的快照可以从 dev.mysql.com< 下载/a>.

FWIW, the MySQL grammar file (mysql-server/sql/sql_yacc.y) is open source and browseable at launchpad.net (though it's a bit slow and I got an error when I tried to pull up the specific file).

Also, a snapshot of the whole MySQL Server source is downloadable from dev.mysql.com.

壹場煙雨 2024-07-16 12:41:17

IIRC、BNF 语法与 yacc/bison 想要的输入非常不同,这确实很烦人:) 如果您打算将这些文件提供给解析器生成器,您可能需要查找适当格式的文件。 我记得曾经看到过 Java、JavaScript 和 C++ 的此类文件。 可能分别是 Eclipse、Firefox 和 GCC 的一部分,但我不太记得了。 我假设您可以通过查找使用该语言的开源项目来找到几乎任何解析器输入文件。

IIRC, BNF grammars are just different enough from what yacc/bison want as input to be really annoying :) If you intend to feed these files into a parser generator, you may want to look for files in the appropriate format. I recall seeing such files for Java, JavaScript and C++ at one point. Probably as part of Eclipse, Firefox and GCC, respectively, but I can't remember for sure. I would assume you can find pretty much any parser input file by finding an open source project that uses that language.

奶气 2024-07-16 12:41:17

我也搜索了这个并收集了这个存储库

http://slps.github.io/zoo/

I also searched this and i collected this repository

http://slps.github.io/zoo/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文