Re: [Json] Seeking more input on draft-ietf-json-text-sequence

Nico Williams <nico@cryptonector.com> Wed, 21 May 2014 01:17 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C732A1A03F6 for <json@ietfa.amsl.com>; Tue, 20 May 2014 18:17:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.356
X-Spam-Level:
X-Spam-Status: No, score=0.356 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IyLIk8qpgdmt for <json@ietfa.amsl.com>; Tue, 20 May 2014 18:17:14 -0700 (PDT)
Received: from homiemail-a109.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id B723A1A03F5 for <json@ietf.org>; Tue, 20 May 2014 18:17:14 -0700 (PDT)
Received: from homiemail-a109.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a109.g.dreamhost.com (Postfix) with ESMTP id 04F522007DA13 for <json@ietf.org>; Tue, 20 May 2014 18:17:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=O0que/xNNuHUl3iTxDW1 b7E6JWM=; b=Z//0pmYIX8QlOCHuwrntDUI1MXSZznfMhHSbaeyWl8AGjEG2J+tj jNuzcvqDwk+6L3y4rqhy2lrAb/7FODOSayytjsRRfPEn2HL9Y8zbd614deBytliu yYstCFIEt1kPu4Op7KVgZHTn+7OZD+MufbOila5s0Oaf8t3QDAWc+yk=
Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a109.g.dreamhost.com (Postfix) with ESMTPSA id AD0FE2007DA09 for <json@ietf.org>; Tue, 20 May 2014 18:17:13 -0700 (PDT)
Received: by mail-wg0-f43.google.com with SMTP id l18so1283478wgh.2 for <json@ietf.org>; Tue, 20 May 2014 18:17:12 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.180.212.77 with SMTP id ni13mr7248250wic.5.1400635032421; Tue, 20 May 2014 18:17:12 -0700 (PDT)
Received: by 10.216.29.200 with HTTP; Tue, 20 May 2014 18:17:12 -0700 (PDT)
In-Reply-To: <537875D8.1080807@drees.name>
References: <20140509173159.28855.94523.idtracker@ietfa.amsl.com> <A89181FF-2FAB-4C17-86AC-685D09AD0CA4@vpnc.org> <537875D8.1080807@drees.name>
Date: Tue, 20 May 2014 20:17:12 -0500
Message-ID: <CAK3OfOhp9NexrHcDq-SmBsV+LxTbmM3w--L9vf2AeC6sYRr5zg@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: "stefan@drees.name" <stefan@drees.name>
Content-Type: text/plain; charset=UTF-8
Archived-At: http://mailarchive.ietf.org/arch/msg/json/cfcA1h6dj9vVHuyjLG0CaGW8HDE
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Seeking more input on draft-ietf-json-text-sequence
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 21 May 2014 01:17:16 -0000

On Sun, May 18, 2014 at 3:56 AM, Stefan Drees <stefan@drees.name> wrote:
> I like to understand grammars also bottom up - which might qualify as a
> lexer's perspective - overlapping rules like the one for ws1 and ws2 in the
> suggested grammar do not really make things clearer for me. Additionally the
> reader will benefit from the expressed clear assumption, how these
> ws(''|1|2) relate to each other.

I'm open to rewriting it but... there are many ways to do it and I
don't really want to bikeshed the grammar -- it's enough to make sure
it's correct.

> So, I suggest to change (as found in draft-02):
> [...]

My counter:

  JSON-sequence = *ws-nl *(JSON-text *ws-no-nl %x0A *ws-nl)
  ws-no-nl = %x20 / %x09 / %x0D
  ws-nl = ws-no-nl / %x0A
  JSON-text = <given by RFC7159>

or, since I agree with you about giving %xXX names:

  JSON-sequence = *ws-LF *(JSON-text *ws-no-LF %x0A *ws-LF)
  ascii-SP = %x20
  ascii-HT = %x09
  ascii-CR = %x0D
  ascii-LF = %x0A
  ws-no-LF = ascii-SP / ascii-HT / ascii-CR
  ws-LF = ws-no-LF /  ascii-LF ; same as ws in RFC7159
  JSON-text = <given by RFC7159>

Or we could use pre-defined rules from RFC5234:

  ; SP HTAB CR LF are defined in RFC5234
  JSON-sequence = *ws-LF *(JSON-text *ws-no-LF %x0A *ws-LF)
  ws-no-LF = SP HTAB CR
  ws-LF = ws-no-LF /  LF ; same as ws in RFC7159
  JSON-text = <given by RFC7159>

But maybe we should use ws from RFC7159, or maybe we shouldn't given
single characters names but instead name them in comments like RFC7159
does:

  JSON-sequence = *ws-LF *(JSON-text *ws-no-LF %x0A *ws-LF)
  ws-no-nl = SP HTAB CR
  ws-LF = ws ; ws is defined in RFC7159
  JSON-text = <given by RFC7159>

There's a lot of variations.  I see you refer to a styleguide -- is there one?

> What do the others think?

It's just a grammar :)

Nico
--