X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Delivered-To: barryleiba.mailing.lists@gmail.com
Received: by 10.59.3.41 with SMTP id bt9csp168713ved;
        Thu, 3 Jan 2013 02:09:39 -0800 (PST)
X-Received: by 10.66.84.195 with SMTP id b3mr144860697paz.30.1357207778395;
        Thu, 03 Jan 2013 02:09:38 -0800 (PST)
Return-Path: <abnf-discuss-bounces@ietf.org>
Received: from mail.ietf.org (mail.ietf.org. [2001:1890:126c::1:1e])
        by mx.google.com with ESMTP id pu7si15503458pbc.37.2013.01.03.02.09.37;
        Thu, 03 Jan 2013 02:09:38 -0800 (PST)
Received-SPF: pass (google.com: domain of abnf-discuss-bounces@ietf.org designates 2001:1890:126c::1:1e as permitted sender) client-ip=2001:1890:126c::1:1e;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of abnf-discuss-bounces@ietf.org designates 2001:1890:126c::1:1e as permitted sender) smtp.mail=abnf-discuss-bounces@ietf.org; dkim=pass (test mode) header.i=@ietf.org
Received: from ietfa.amsl.com (localhost [127.0.0.1])
	by ietfa.amsl.com (Postfix) with ESMTP id 1803A21F8B2F;
	Thu,  3 Jan 2013 02:09:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1;
	t=1357207777; bh=jmbdjoffVl7oxoEdH0TviFN4nMZYleDpLEtHrpfrxi4=;
	h=Date:From:To:In-Reply-To:Message-ID:References:MIME-Version:Cc:
	 Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:
	 List-Subscribe:Content-Type:Content-Transfer-Encoding:Sender;
	b=Bqgb8plTgBpuUNrUHB6uL6+tServqc1x7JcZCRxV5EmRMPo3D+kghHnrAI8KPvHib
	 tn9Hd6wcBRCrcx5u2pvIQLmIXFURhRwFvgqwmGt3+jZoGKxo3B5dtg925OAelI5v9z
	 PYMAMuVO+uz2vwSSdlX/PdeyuJDC9rUHsr93egWw=
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 38D6321F8AC3
	for <abnf-discuss@ietfa.amsl.com>; Thu,  3 Jan 2013 02:09:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6
X-Spam-Level: 
X-Spam-Status: No, score=-6 tagged_above=-999 required=5 tests=[AWL=0.599,
	BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([64.170.98.30])
	by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id nx7qOuVRHb9j for <abnf-discuss@ietfa.amsl.com>;
	Thu,  3 Jan 2013 02:09:35 -0800 (PST)
Received: from ppsw-41.csi.cam.ac.uk (ppsw-41.csi.cam.ac.uk [131.111.8.141])
	by ietfa.amsl.com (Postfix) with ESMTP id 3A0A621F8ABD
	for <abnf-discuss@ietf.org>; Thu,  3 Jan 2013 02:09:34 -0800 (PST)
X-Cam-AntiVirus: no malware found
X-Cam-SpamDetails: not scanned
X-Cam-ScannerInfo: http://www.ucs.cam.ac.uk/email/scanner/
Received: from hermes-1.csi.cam.ac.uk ([131.111.8.51]:36073)
	by ppsw-41.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25)
	with esmtpa (EXTERNAL:fanf2) id 1Tqhjw-0000hX-Sd (Exim 4.72)
	(return-path <fanf2@hermes.cam.ac.uk>); Thu, 03 Jan 2013 10:09:32 +0000
Received: from fanf2 by hermes-1.csi.cam.ac.uk (hermes.cam.ac.uk)
	with local id 1Tqhjw-0003fB-Rf (Exim 4.72)
	(return-path <fanf2@hermes.cam.ac.uk>); Thu, 03 Jan 2013 10:09:32 +0000
Date: Thu, 3 Jan 2013 10:09:32 +0000
From: Tony Finch <dot@dotat.at>
X-X-Sender: fanf2@hermes-1.csi.cam.ac.uk
To: Paul Kyzivat <pkyzivat@alum.mit.edu>
In-Reply-To: <50E4A900.1070408@alum.mit.edu>
Message-ID: <alpine.LSU.2.00.1301030943590.15409@hermes-1.csi.cam.ac.uk>
References: <50E4A900.1070408@alum.mit.edu>
User-Agent: Alpine 2.00 (LSU 1167 2008-08-23)
MIME-Version: 1.0
Cc: "abnf-discuss@ietf.org" <abnf-discuss@ietf.org>
Subject: Re: [abnf-discuss] How to indent ABNF figures in draft?
X-BeenThere: abnf-discuss@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: abnf-discuss-bounces@ietf.org
Errors-To: abnf-discuss-bounces@ietf.org

Paul Kyzivat <pkyzivat@alum.mit.edu> wrote:
>
> The ABNF syntax requires rules to start at the beginning of a line with no
> preceding whitespace.

Well, sort of. That's what the grammar says but there is an informal
permission to indent in RFC 5234 section 2.2:

   For visual ease, rule definitions are left aligned.  When a rule
   requires multiple lines, the continuation lines are indented.  The
   left alignment and indentation are relative to the first lines of the
   ABNF rules and need not match the left margin of the document.

This would ideally be part of the ABNF grammar.

Apart from comments, I don't think there is any need for ABNF to be
sensitive to newlines or indentation, though a parser would need two
tokens of lookahead to tell the difference between the end of a rule
(rulename defined-as) and a continued rule (rulename anything-else).

I suggest the following, which still requires rules to start on new lines
but removes sensitivity to horizontal white space.

         rulelist       =  1*( *c-wsp rule ) *c-wsp

         rule           =  rulename defined-as elements c-nl

         c-wsp          =  WSP / c-nl

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Forties, Cromarty: East, veering southeast, 4 or 5, occasionally 6 at first.
Rough, becoming slight or moderate. Showers, rain at first. Moderate or good,
occasionally poor at first.
_______________________________________________
abnf-discuss mailing list
abnf-discuss@ietf.org
https://www.ietf.org/mailman/listinfo/abnf-discuss

