Subject: [apps-discuss] ABNF errata

From: Peter Saint-Andre <[email-masked]>
Date: Fri, 02 Mar 2012 10:35:37 -0700

Folks, two related errata (#2968 and #3076) have been reported against
the ABNF spec (RFC 5234):

http://www.rfc-editor.org/errata_search.php?rfc=5234

Because there is no dedicated list for ABNF, and because application
protocols are the main users of ABNF, I thought it would be appropriate
to post about this on the apps-discuss list.

The reporter of these errata, Daniel van Vugt (cc'd), has made available
some code for testing these errata:

http://sourceforge.net/projects/dapar/

Thank you for your consideration.

Peter

-------- Original Message --------
Subject: [Technical Errata Reported] RFC5234 (2968)
Date: Mon, 12 Sep 2011 02:05:21 -0700 (PDT)
From: RFC Errata System <[email-masked]>
To: [email-masked], [email-masked], [email-masked]
CC: [email-masked], [email-masked]

The following errata report has been submitted for RFC5234,
"Augmented BNF for Syntax Specifications: ABNF".

--------------------------------------
You may review the report below and at:
http://www.rfc-editor.org/errata_search.php?rfc=5234&eid=2968

--------------------------------------
Type: Technical
Reported by: Daniel van Vugt <[email-masked]>

Section: 4

Original Text
-------------
elements       =  alternation *c-wsp

Corrected Text
--------------
elements       =  alternation *WSP

Notes
-----
The grammar in section 4 of RFC 5234 is ambiguous. This was discovered
by my own parsing code when trying to parse the ABNF grammar with
itself. The ambiguity can be seen in a simplified form using the
following 10 characters of input:

Input:   X  =  Y \r \n     ;  Z \r \n
Offset:  0  1  2  3  4  5  6  7  8  9

My parser finds these two (ambiguous) solutions...

SOLUTION 1:

rulelist @ 0 len 10
    rule @ 0 len 10
        rulename @ 0 len 1  "X"
            ALPHA @ 0 len 1
        star_c_wsp @ 1 len 0
        defined_as @ 1 len 1
            star_c_wsp @ 2 len 0
        elements @ 2 len 4
            alternation @ 2 len 1
                concatenation @ 2 len 1
                    repetition @ 2 len 1
                        element @ 2 len 1
                            rulename @ 2 len 1  "Y"
                                ALPHA @ 2 len 1
            star_c_wsp @ 3 len 3
                c_wsp @ 3 len 3
                    c_nl @ 3 len 2
                        CRLF @ 3 len 2
                            CR @ 3 len 1
                            LF @ 4 len 1
                    WSP @ 5 len 1
                        SP @ 5 len 1
        c_nl @ 6 len 4
            comment @ 6 len 4  ";Z
"
                WSP_or_VCHAR @ 7 len 1
                    VCHAR @ 7 len 1
                CRLF @ 8 len 2
                    CR @ 8 len 1
                    LF @ 9 len 1

SOLUTION 2:

rulelist @ 0 len 10
    rule @ 0 len 5
        rulename @ 0 len 1  "X"
            ALPHA @ 0 len 1
        star_c_wsp @ 1 len 0
        defined_as @ 1 len 1
            star_c_wsp @ 2 len 0
        elements @ 2 len 1
            alternation @ 2 len 1
                concatenation @ 2 len 1
                    repetition @ 2 len 1
                        element @ 2 len 1
                            rulename @ 2 len 1  "Y"
                                ALPHA @ 2 len 1
            star_c_wsp @ 3 len 0
        c_nl @ 3 len 2
            CRLF @ 3 len 2
                CR @ 3 len 1
                LF @ 4 len 1
    star_c_wsp @ 5 len 1
        c_wsp @ 5 len 1
            WSP @ 5 len 1
                SP @ 5 len 1
    c_nl @ 6 len 4
        comment @ 6 len 4  ";Z
"
            WSP_or_VCHAR @ 7 len 1
                VCHAR @ 7 len 1
            CRLF @ 8 len 2
                CR @ 8 len 1
                LF @ 9 len 1

The solution to this ambiguity is to change:
    elements       =  alternation *c-wsp
to:
    elements       =  alternation *WSP

Instructions:
-------------
This errata is currently posted as "Reported". If necessary, please
use "Reply All" to discuss whether it should be verified or
rejected. When a decision is reached, the verifying party (IESG)
can log in to change the status and edit the report, if necessary.

--------------------------------------
RFC5234 (draft-crocker-rfc4234bis-01)
--------------------------------------
Title               : Augmented BNF for Syntax Specifications: ABNF
Publication Date    : January 2008
Author(s)           : D. Crocker, Ed., P. Overell
Category            : STANDARD
Source              : IETF - NON WORKING GROUP
Area                : N/A
Stream              : IETF
Verifying Party     : IESG