Subject: [tap] ABNF alternations and order

From: Michael G Schwern <[email-masked]>
Date: Wed, 21 Jan 2009 18:22:33 -0800

figure it needs something like this:

Body            = *(Comment / TAP-Line / Ignored)
Ignored         = *(%x01-%xFF) EOL

The problem is this:  Are alternatives to be evaluated in order?  If not, then
its possible for a parser to simply consider every line be "Ignored".  In
fact, a clever parser might go for that because it's the interpretation which
involves the least rules. [1]

RFC 5234 doesn't appear to say anything about the order of evaluation of
alternatives.  I suppose we can just specify it, but I'm trying to make the
TAP grammar as complete as possible with as few outside rules as can be managed.

[1] He says, not knowing a damn thing about how BNF parsers are designed.

-- 
Don't try the paranormal until you know what's normal.
    -- "Lords and Ladies" by Terry Prachett

_______________________________________________
tap mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/tap

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Thu, 22 Jan 2009 03:54:56 +0100

>I'm trying to figure out how to specify "ignored" lines in the TAP grammar.  I
>The problem is this:  Are alternatives to be evaluated in order?

ABNF does not specify how to resolve conflicts in an ambiguous grammar,
what you can do is make it non-ambiguous as I suggested earlier, by e.g.

  Extension = <string without any EOL and not matching ...> EOL

If Comment and TAP-Line are regular, you can of course compute Extension
but it would likely be rather complex and not too useful. I think giving
such a prose description is better than the ultra-liberal Ignored rule
you have above and specifying some other conflict resultion algorithm.
-- 
Björn Höhrmann · mailto:[email-masked] · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
_______________________________________________
tap mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/tap