Re: Bug in grammar for paths

Paths of the form that I presented do exist and are actually common.  I
wasn't around when the grammar was originally written, so I don't know the
reason why it was written the way it was.

Even if it is not expressed unambiguously in the grammar, this behaviour is
explicitly described in the two paragraphs following the grammar.

Paul


On 30 April 2017 at 04:44, Jirka Kosek <jirka@kosek.cz> wrote:

> On 29.4.2017 18:29, Paul LeBeau wrote:
> > No it is correct. Sometimes it is possible to distinguish two coordinates
> > without the separator.  For example
> >
> > 1.0-42.0
>
> And is it really intention of the spec to allow such "weird" expressions?
>
> > In those situations, the comma and whitespace are not required.
> Obviously,
> > if the second number was positive, you would need a comma and/or
> whitespace.
>
> Making separator optional means that provided grammar is ambiguous and
> many parser generators will simply choke on it. (And this is why I have
> noticed this issue.)
>
> If things like 1.0-42.0 are really meant to be valid then grammar could
> explicitly allow for this by something like:
>
> coordinate_pair::= coordinate
>                    (comma_wsp unsigned-coordinate | signed-coordinate)
>
> coordinate::= sign? number
> signed-coordinate::= sign number
> unsigned-coordinate::= number
>
>
>                                                 Jirka
>
>
> --
> ------------------------------------------------------------------
>   Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
> ------------------------------------------------------------------
>      Professional XML and Web consulting and training services
> DocBook/DITA customization, custom XSLT/XSL-FO document processing
> ------------------------------------------------------------------
>  OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
> ------------------------------------------------------------------
>     Bringing you XML Prague conference    http://xmlprague.cz
> ------------------------------------------------------------------
>
>

Received on Saturday, 29 April 2017 16:58:34 UTC