Re: [abnf-discuss] ABNF/RFC7405/ Update: EBNF syntactic exception

Carsten Bormann <cabo@tzi.org> Sun, 10 July 2022 01:06 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: abnf-discuss@ietfa.amsl.com
Delivered-To: abnf-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2056EC15A733 for <abnf-discuss@ietfa.amsl.com>; Sat, 9 Jul 2022 18:06:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level:
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7BQZqKbw5xcH for <abnf-discuss@ietfa.amsl.com>; Sat, 9 Jul 2022 18:06:27 -0700 (PDT)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [134.102.50.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A4AE7C15A731 for <abnf-discuss@ietf.org>; Sat, 9 Jul 2022 18:06:26 -0700 (PDT)
Received: from smtpclient.apple (p5089ad4f.dip0.t-ipconnect.de [80.137.173.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4LgTNw0kVxzDCbG; Sun, 10 Jul 2022 03:06:24 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <20220710005652.5B4A04532DCC@ary.qy>
Date: Sun, 10 Jul 2022 03:06:23 +0200
Cc: abnf-discuss@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <D4CD5CBA-AB51-4490-A630-54DD27BD37F1@tzi.org>
References: <20220710005652.5B4A04532DCC@ary.qy>
To: "John R. Levine" <johnl@taugh.com>
X-Mailer: Apple Mail (2.3696.100.31)
Archived-At: <https://mailarchive.ietf.org/arch/msg/abnf-discuss/HVGbiEoLYlAXCd9kQDO4ATtpGXc>
Subject: Re: [abnf-discuss] ABNF/RFC7405/ Update: EBNF syntactic exception
X-BeenThere: abnf-discuss@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "General discussion about tools, activities and capabilities involving the ABNF meta-language" <abnf-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/abnf-discuss>, <mailto:abnf-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/abnf-discuss/>
List-Post: <mailto:abnf-discuss@ietf.org>
List-Help: <mailto:abnf-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/abnf-discuss>, <mailto:abnf-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 10 Jul 2022 01:06:32 -0000

On 10. Jul 2022, at 02:56, John Levine <johnl@taugh.com> wrote:
> 
>> This grammar is ambiguous.
> 
> That's not a problem. Lots of our ABNF is ambiguous. There are well-known ways to parse
> ambiguous CFGs, such as the GLR parser in GNU bison.

There is indeed no problem with recognizing ambiguous grammars, as long as they fall into a subclass of grammars that your parser generator of the day can process.
However, if different parses assign different semantics to the parse, it is not that useful that the sentence has been properly recognized as being part of the grammar.

In the proposed grammar, what does 

a \ b c \ d

mean?

(PEG has no problem here, because of prioritized choice.)

Grüße, Carsten