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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 21 Feb 2014 12:15:46 -0800
Message-ID: <CAAWBYDDhr0-kO7B61nXsbkwOUAHob0eMW0V_6ZpzOWr_rGLs8w@mail.gmail.com>
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: "bugzilla@jessica.w3.org" <bugzilla@jessica.w3.org>, www-svg <www-svg@w3.org>
On Fri, Feb 21, 2014 at 12:03 PM, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
> * bugzilla@jessica.w3.org wrote:
>>https://www.w3.org/Bugs/Public/show_bug.cgi?id=24769
>
>>http://www.w3.org/TR/SVG2/single-page.html#paths-PathDataBNF
>>
>>There is no description in the text on how this BNF is to be used. For example,
>>are the rules for the BNF alternatives to be parsed as 'first match wins'?
>>
>>If so, then the following rules won't produce good results, as the may match
>>part of a floating point number as an integer before matching the
>>floating-point-constant rule:
>>
>>nonnegative-number:
>>    integer-constant
>>    | floating-point-constant
>>number:
>>    sign? integer-constant
>>    | sign? floating-point-constant
>
> An `integer-constant` is a `digit-sequence` while a `floating-point-
> constant` is either a `fractional-constant` followed by an optional
> exponent, or a `digit-sequence` followed by a mandatory exponent. A
> `fractional-constant` must include `.`, so either a `.` or an expo-
> nent's `e` resolve the choice, and it does not seem like either is
> a prefix to a following rule. Could you give an example string that
> has more than one parse tree?
>
> Certainly `integer-constant` is prefix of `floating-point-constant`
> but there isn't an obvious advantage to putting it last, automated
> tools that prefer some order can re-arrange them as they see fit,
> and to a human reader less to more complex ordering might actually
> be the better.

The issue is that the order isn't defined *at all* currently; the spec
doesn't even have an *internal* ordering that it defines and follows.

~TJ
Received on Friday, 21 February 2014 20:16:33 UTC

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