W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css3-page] Error in grammar of section 3.4.1

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Mon, 23 Apr 2012 20:39:19 +0200
Message-ID: <4F95A1D7.9000500@kozea.fr>
To: Werner Donné <werner.donne@pincette.biz>
CC: www-style@w3.org
Le 23/04/2012 17:41, Werner Donné a écrit :
> I have one more remark about the production you propose. It is, of
> course, correct, but it isn't LL, because there is a choice conflict
> between the two groups. It is also not easy to transform into an
> LL(k) production, because the required number of look-ahead tokens is
> infinite. I don't know if LL is a requirement, but it would rule out
> a top-down parser if it isn't. Flute, for example, is implemented
> with JavaCC, which expects an LL(k) grammar.

Indeed.


I tried and failed to make it LL(k), starting with the following ideas:

"""
Another way to look at it is a list of margin rules separated by an 
optional list of ';'-separated declarations.

Also, make each declarations optional so that '{;' ';;' and ';}' are 
allowed.
"""

I got a dozen different grammar, but each either was still not LL(k) or 
did not match some input that it should have.

I did not have a formal process for the transformation so I don’t know 
if it *can* be made LL(k).

Alternatively, we could define the syntax in terms of a state machine 
rather that a grammar, as Tab is doing in css3-syntax. (This is 
apparently a better fit for the precise rules of error handling.)

Regards,
-- 
Simon Sapin
Received on Monday, 23 April 2012 18:39:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT