[Jsonpath] Re: Is the grammar in RFC9535 designed for PEG (Parsing Expression Grammar)

Carsten Bormann <cabo@tzi.org> Sun, 22 February 2026 17:17 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: jsonpath@mail2.ietf.org
Delivered-To: jsonpath@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 31549BBBCDC7 for <jsonpath@mail2.ietf.org>; Sun, 22 Feb 2026 09:17:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -3.998
X-Spam-Level:
X-Spam-Status: No, score=-3.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=neutral reason="invalid (public key: not available)" header.d=tzi.org
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mLgLC3R28Nx5 for <jsonpath@mail2.ietf.org>; Sun, 22 Feb 2026 09:17:47 -0800 (PST)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [134.102.50.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 4AA3ABBBCDC1 for <jsonpath@ietf.org>; Sun, 22 Feb 2026 09:17:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tzi.org; s=2019; t=1771780659; bh=FD+TCjA2oQwVRu4qdS0IHBwrWJhfWVt5HHLk4ccYI7s=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=I0IUafm78+uYi/YUejYddT1nj3w1xA+HWCG2CvgSfKlctKXuZyhRN0FZ0DIcb5jco z7Zgm2VZ+ettGoXgrLsdQ5hO5z+84nJNALdL+fh9bx0tZYbP4UOGxled+5+uEX9kmA vL92vMgEsjcNHF6zUHQ5DrtuPsgQJbrG9XOaAPAPB8rIpPbzHA/gueI1xYVo2gpy0p h0cRbOQaWKLP0/MO0lQ/V9teaiECIP+eEKMwWkHqZCMB9Jn36gdG57zOQA8OakiAbI KgqgkYpvfceAmg2ZDLlgLhBtZllWWuY0x01W+s0X9z7xo7OVMYXCccso3IGZyT6F4S iL2VqANhqNxtg==
Received: from clients-pool1-0250.vpn.uni-bremen.de (clients-pool1-0250.vpn.uni-bremen.de [134.102.107.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4fJrJy5tHQzDCbR; Sun, 22 Feb 2026 18:17:38 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CAN+GtW3maUL=RcTJXWjRAa_MRkK9Ncek3yaERk=roZ2aucRBHA@mail.gmail.com>
Date: Sun, 22 Feb 2026 18:17:38 +0100
X-Mao-Original-Outgoing-Id: 793473457.682248-523b832cf0b4d651af6f1fbbd0b47702
Content-Transfer-Encoding: quoted-printable
Message-Id: <F4D543A3-3AF2-4468-A912-9365EC35447E@tzi.org>
References: <CAN+GtW3maUL=RcTJXWjRAa_MRkK9Ncek3yaERk=roZ2aucRBHA@mail.gmail.com>
To: Alan Painter <alan.painter@gmail.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
X-FromAuthMilter: ok
Message-ID-Hash: LRKK665WXECTE3VTWBE76TBGS5WMY57J
X-Message-ID-Hash: LRKK665WXECTE3VTWBE76TBGS5WMY57J
X-MailFrom: cabo@tzi.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: jsonpath@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Jsonpath] Re: Is the grammar in RFC9535 designed for PEG (Parsing Expression Grammar)
List-Id: Discussion of JSONPath syntax <jsonpath.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jsonpath/ogJWSy_12YYZmVRUNNdPlS3IJXk>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jsonpath>
List-Help: <mailto:jsonpath-request@ietf.org?subject=help>
List-Owner: <mailto:jsonpath-owner@ietf.org>
List-Post: <mailto:jsonpath@ietf.org>
List-Subscribe: <mailto:jsonpath-join@ietf.org>
List-Unsubscribe: <mailto:jsonpath-leave@ietf.org>

On 2026-02-22, at 17:39, Alan Painter <alan.painter@gmail.com> wrote:
> 
> I haven't been able to find a confirmation of this affirmation, that the rules were designed for PEG as opposed to, say, CFG (Context-free Grammar) parsers. 

The ABNF was indeed designed to be useful in a PEG context.
(It also is useful in a CFG context, but might require resolving conflicts to obtain a deterministic parse tree.)

See

https://github.com/cabo/jpt/blob/main/lib/parser/jptgrammar.abnftt

for an example of code derived from the ABNF (the abnftt tool extracts the annotations and generates the semantics for a PEG parser from those together with the PEG grammar from the ABNF; it also spits out unannotated ABNF for use in/comparison with the ABNF in the specification).

> Any pointers to a confirmation of this?

I’m sure that also was discussed on the mailing list; see

<https://mailarchive.ietf.org/arch/msg/jsonpath/h2AX9gb74ZLlPofF3DGP4YrEPL4>

for an early specimen.

But I can imagine there is no consensus document that states this as an objective; the first sentence of the Notes in the errata is just a statement of fact from someone who was there.

Grüße, Carsten