From bokfe at inf.elte.hu Sat May 1 17:04:06 2021 From: bokfe at inf.elte.hu (Bokros Ferenc) Date: Sat, 01 May 2021 17:04:06 -0000 Subject: =?iso-8859-2?Q?Typo_in_JLS_16,_=A717.2.4?= Message-ID: Dear Sirs, I'm afraid there is a typo in JLS 16, ?17.2.4 [Interactions of Waits, Notification, and Interruption]. This section contains two bullet-lists. There is an end-of-sentence point missing after the *first list's* last item's last word ("return from wait by throwing an InterruptedException>>>.<<<''). The typo is present in both the HTML (https://docs.oracle.com/javase/specs/jls/se16/html/jls-17.html#jls-17.2.4) and the PDF (https://docs.oracle.com/javase/specs/jls/se16/jls16.pdf) versions. (There _was_ a similar typo in this section's *second list's* last item, which was seemingly corrected with version upgrade from JLS 11 to JLS 12.) Sincerely, Ferenc BOKROS From ken.domino at gmail.com Sat May 1 12:16:25 2021 From: ken.domino at gmail.com (Ken Domino) Date: Sat, 01 May 2021 12:16:25 -0000 Subject: Question regarding JavaLetter and JavaLetterOrDigit in the JLS Message-ID: Folks, I have been updating the Antlr grammars for Java in https://github.com/antlr/grammars-v4/tree/master/java. In one of the grammars, semantic predicates are used to evaluate ?Character.isJavaIdentifierStart(int)? and ?Character.isJavaIdentifierPart(int)? for the input, as per Section 3.8 of the Java Language Spec: ?A "Java letter" is a character for which the method Character.isJavaIdentifierStart(int) returns true. A "Java letter-or-digit" is a character for which the method Character.isJavaIdentifierPart(int) returns true.? However, I can for a fixed version of the Spec evaluate the two functions for all code points, and then define a rule for Java Letter and Java Digit that is not an operational definition, e.g.: fragment JavaLetter : [\p{Lu}] | [\p{Ll}] | [\p{Lt}] | [\p{Lm}] | [\p{Lo}] | [\p{Nl}] | [\p{Pc}] | [\p{Sc}] ; fragment JavaLetterOrDigit : [\p{Lu}] | [\p{Ll}] | [\p{Lt}] | [\p{Lm}] | [\p{Lo}] | [\p{Mn}] | [\p{Mc}] | [\p{Nd}] | [\p{Nl}] | [\p{Cf}] | [\p{Pc}] | [\p{Sc}] | [\u{00000000}-\u{00000008}] | [\u{0000000E}-\u{0000001B}] | [\u{0000007F}-\u{0000009F}] ; Why does the Spec use an operation definition for JavaLetter and JavaLetterOrDigit rather than to pick a Unicode standard and define the symbols as set of code points and general categories? Ken