W3C home > Mailing lists > Public > www-svg@w3.org > February 2014

Re: [Bug 24769] New: SVG Path BNF is ambigious

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Tue, 25 Feb 2014 14:10:03 +0100
To: Joe Gregorio <jcgregorio@google.com>
Cc: "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>, www-svg@w3.org
Message-ID: <qm3pg9pg65hk9rjjobefmauhhsjqp04ov8@hive.bjoern.hoehrmann.de>
* Joe Gregorio wrote:
>In this case I think the best solution is to rearrange the grammar
>slightly as suggested, as it makes it valid for both PEG and CFG.
>The alternative would be to add a sentence to the spec that the BNF
>is a CFG and not to be used in a PEG.

Formal grammars in W3C specifications use any number of features that
are incompatible with particular parser generators, some use left re-
cursion, others right recursion, some are ambiguous, some require the
use of unsupported ambiguity resolution methods, some use unsupported
operators like set difference, some might require infinite look-ahead
and some require evaluating alternatives other than the first. That's
life, and readers should not assume context-free grammars in them are
restricted in some form unless there is a claim to it. We can't put a
message box "This is not a PEG. This is not a DCFG. This grammar does
use left recursion..." next to each and every grammar, and a general
reminder would likely be missed by people who run into such problems.

It would be possible to modify the grammar as you suggest, but there
might be similar issues in other rules, and the same issue exists in
other grammars in the specification, and odds are, if they are all
found and corrected, one of the grammars might be modified for a new
feature and the issue re-surfaces (which is then worse because people
did have a reason to assume the SVG specification grammars are in a
certain form). Some readers also prefer putting simpler rules first,
integer before floating-point-number. It might be best to do nothing.
Björn Höhrmann · mailto:bjoern@hoehrmann.de · 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/ 
Received on Tuesday, 25 February 2014 13:10:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:35 UTC