Java 语言规范第三版勘误表
我广泛使用 JLS 作为学习和教学资源,但我注意到其中存在一些错误。
有一些简单的拼写错误(例如 JLS 5.1.4 “转换”),但也有一些我认为非常严重的错误。
例如,JLS 18.1 Java 编程语言语法 应该是Java语言语法的权威参考,但它包含了一条从未被使用过的产生式规则! (例如MoreStatementExpressions
)。这肯定是给定语法其他部分存在更严重错误的迹象,对吧?
那么第三版有勘误表吗?会有吗?我们是否应该将发现的错误发送给 Sun/Oracle?会有第四版吗?
I use JLS extensively both as a learning and teaching resource, but I've noticed that there are some errors in it.
There's the simple typos (e.g. JLS 5.1.4 "convesions"), but there's also some that I consider quite serious errors.
For example, JLS 18.1 The Grammar of the Java Programming Language is supposed to be the authoritative reference for the grammar of the Java language, but it contains a production rule that never gets used! (e.g. MoreStatementExpressions
). Surely this is a sign of more serious errors in other parts of the given grammar, right?
So is there an errata for the 3rd edition? Will there ever be? Should we send errors we've found to Sun/Oracle? Will there ever be a 4th edition?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我能找到的最好的是 "JSR 901 的维护审查 (Java (tm) Java SE 7 语言规范”。
然而,OP所关心的问题并不严重......
对此我会说“错误”。未使用的作品只不过是印刷/编辑错误。它与Java语法的含义没有区别。
FWIW:Oracle 的 JLS 主页 没有提及 JSR 901 修订工作(其中有显然已经完成了!)并且提供 JLS 反馈的链接已损坏。
The best I can find is the "Maintenance Review of JSR 901 (Java(tm) Language Specification) for Java SE 7".
However, the problems that the OP is concerned about are hardly serious ...
I'd say "Wrong" on this. An unused production is little more than a typographical / editing error. It makes no difference to the meaning of the Java grammar.
FWIW: Oracle's main JLS page has no mention of the JSR 901 revision effort (which has apparently finished!) and that the link for providing feedback on the JLS is broken.
我也被 JLS 第 18 章的语法问题所困扰,并且
JLS 中其他地方的问题。尽管很多 Java 程序员可能不知道
受到它们的影响,当你构建一个
编译器或程序分析工具。
JLS 的许多问题已在最新版本中得到修复
JLS(“JLS,Java SE 版本”或非正式的“JLS 第 4 版”)。
特别是第18章(Java语法)已经完全
进行了修订和重组。
您可以在 Java SE 规范下载页面 (直接链接到 JLS
PDF)。
2012 年 2 月 18 日更新:
如 https://blogs.oracle.com/abuckley/en_US/entry/jls7_and_jvms7_online< 中所述/a>,Java 语言的 Java SE 7 版本
规范和 JVM 规范现已提供:
PDF 和 HTML 格式的 http://docs.oracle.com/javase/specs/ 。
I have also been burned by problems with the grammar in JLS chapter 18, and
by problems elsewhere in the JLS. Although many Java programmers may not
be affected by them, these are not trivial problems when you are building a
compiler or program analysis tool.
Many of the problems with the JLS have been fixed in the latest version of
the JLS ("JLS, Java SE edition" or, informally, "JLS 4th edition").
In particular, chapter 18 (the Java grammar) has been completely
revised and reorganized.
You can find the latest JLS at the Java SE Specifications download page (direct link to JLS
PDF).
UPDATE Feb 18, 2012:
As described at https://blogs.oracle.com/abuckley/en_US/entry/jls7_and_jvms7_online, the Java SE 7 Editions of the Java Language
Specification and the JVM Specification are now available at
http://docs.oracle.com/javase/specs/ in both PDF and HTML form.