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

* 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