Re: Bug in grammar for paths

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:45:09 UTC