Subject: [Tools-discuss] [ABNF] Legal or not legal to have literal numbers?

From: Stephane Bortzmeyer <[email-masked]>
Date: Fri, 10 Nov 2006 10:15:10 +0100

The attached grammar, extracted from
draft-greifenberg-mmusic-img-urn-02, is accepted by half of the ABNF
checking tools and refused by the other half.

The controversial issue is:

MM             = ( 0 DIGIT )
                   ^
                   Literal number

I believe it is not authorized by RFC 4234. Among the programs:

* Jutta Degener's abnfgen accepts it,
* Bill Fenner's ABNF Parser refuses it,
* my Eustathius program refuses it,
* ABNF Validator accepts it.

_______________________________________________
Tools-discuss mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/tools-discuss

---

From: Stephane Bortzmeyer <[email-masked]>
Date: Fri, 10 Nov 2006 10:26:06 +0100

On Fri, Nov 10, 2006 at 10:15:10AM +0100,
 Stephane Bortzmeyer <[email-masked]> wrote 
 a message of 21 lines which said:

> The attached grammar,

Really attached, now :-) along with what I regard as a "fixed"
version.
_______________________________________________
Tools-discuss mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/tools-discuss

---

From: Frank Ellermann <[email-masked]>
Date: Fri, 10 Nov 2006 11:37:52 +0100

Stephane Bortzmeyer wrote:
 
> Really attached, now :-) along with what I regard as a 
> "fixed" version.

> Part 1.2   Name: img-urn.abnf
>            Type: Plain Text (text/plain)

The author apparently wanted ( "0" DIGIT ) instead of
( 0 DIGIT ), so far it's clear: 

> Part 1.3   Name: img-urn-fixed.abnf
>            Type: Plain Text (text/plain)

Another question is if a legal ( 0DIGIT ) could be also
written as ( 0 DIGIT ).  In RFC 3986 they have 0<pchar>
for an empty path.  Bill's parser says "error", it does
not like a 0 in an nRule (4234 3.7).

With 1DIGIT or 1<pchar> or similar it's fine.  If I add
a space as in ( 1 DIGIT ) the parser says again "error".

The "ABNF in ABNF" section 4 offers no <c-wsp> in its

|         repetition     =  [repeat] element

Just in case, there's no trailing <c-wsp> in <repeat>
and no leading <c-wsp> in <element>.  A <repeat> 0 is
okay, maybe Bill could reduce the error to a warning.

In your list of ABNF validators posted before:

|* Jutta Degener's abnfgen accepts it,
|* Bill Fenner's ABNF Parser refuses it,
|* my Eustathius program refuses it,
|* ABNF Validator accepts it.

What is the "ABNF Validator" if it's not Bill's tool ?
And what's "abnfgen" ?

Frank

---

From: Stephane Bortzmeyer <[email-masked]>
Date: Fri, 10 Nov 2006 11:45:11 +0100

On Fri, Nov 10, 2006 at 11:37:52AM +0100,
 Frank Ellermann <[email-masked]> wrote 
 a message of 42 lines which said:

> written as ( 0 DIGIT ).

IMHO, no, for the reason you explained (no c-wsp, and it would be
meaningless, anyway).

> What is the "ABNF Validator" if it's not Bill's tool ?

http://www.apps.ietf.org/abnf.html

> And what's "abnfgen" ?

http://www.quut.com/abnfgen/

---

From: Frank Ellermann <[email-masked]>
Date: Fri, 10 Nov 2006 15:45:25 +0100

> http://www.apps.ietf.org/abnf.html

ACK, a validator written in C, not my favourite language
for string manipulations... ;-)  It could be interesting
to see a bison / yacc variant, too.  

The tools page says that the C validator has some issues,
and for RFC 4646 Scott told us to use Bill's validator:
<http://article.gmane.org/gmane.ietf.ltru/78/match=abnf>

> http://www.quut.com/abnfgen/

Thanks, I haven't tested that yet.  Apparently it's not
yet listed on the "all-tools" page.  But it's listed on
the "verif-tools" page, so maybe some cron-job to update
"all-tools" automatically died (?)

I've started a collection of the various _online_ tools
for draft authors:  <http://purl.net/xyzzy/ietftool.htm>

Frank

---

From: "Bill Fenner" <[email-masked]>
Date: Wed, 15 Nov 2006 21:46:04 -0800

> http://www.apps.ietf.org/abnf.html

I like this one a lot, because it accepts the following as valid ABNF:

===   ===
=*=   =*=
===   ===
    /
   /
  /o=o

l========l

(view with fixed-width font to get the full effect)

  Bill

---

From: "Bill Fenner" <[email-masked]>
Date: Wed, 15 Nov 2006 21:48:42 -0800

On 11/10/06, Frank Ellermann <[email-masked]> wrote:
> ... maybe Bill could reduce the error to a warning.

The only message I can manage to come up with is

1:6: fyi: absolute repeat count of zero means this element may not occur at all

The "fyi" is intended to indicate that it's not an error, or even a warning.

Perhaps the CGI script's output is the problem, since it says "Errors
during parsing:" when it is really "Output during parsing".

  Bill

---

From: "Jutta Degener" <[email-masked]>
Date: Sat, 11 Nov 2006 04:29:24 -0500 (EST)

[Stephane Bortzmeyer]
> I believe it is not authorized by RFC 4234. Among the programs:

I agree -- my abnfgen up to version 0.8 gets it wrong.
To be fixed, just not tonight.

(Abnfgen doesn't enforce the restriction against white space in
repetition specifications -- I hadn't noticed it until now!)

Thanks for letting me know about this!

Jutta

---

From: Frank Ellermann <[email-masked]>
Date: Fri, 17 Nov 2006 23:28:32 +0100

Yes, I misinterpreted the output, or you modified it already:
 
> Perhaps the CGI script's output is the problem, since it
> says "Errors during parsing:" when it is really "Output
> during parsing".

Whatever it was, it's clear now, an info about the 0DIGIT.

Frank