W3C home > Mailing lists > Public > www-style@w3.org > February 2013

[css3-page] LL(k) grammar for @page (was: Error in grammar of section 3.4.1)

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Mon, 11 Feb 2013 17:20:00 -0800
Message-ID: <511998C0.1040105@kozea.fr>
To: Werner Donné <werner.donne@pincette.biz>
CC: "www-style@w3.org" <www-style@w3.org>
Le 23/04/2012 08: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.

Fixed. The grammar in the ED is now as follows:


page :
      PAGE_SYM S* [ page_selector S* [ ',' page_selector S* ]* ]?
      '{' S* page_body '}' S*
      ;

page_body :  /* Can be empty */
      declaration? [ ';' S* page_body ]? |
      page_margin_box page_body
      ;


Thanks to Tab Atkins and David Baron for their grammar-fu.


Alternatively, css3-syntax defines this in terms of a state machine. I’d 
like to change css3-page to refer to that, eventually.

http://dev.w3.org/csswg/css3-syntax/


Cheers,
-- 
Simon Sapin
Received on Tuesday, 12 February 2013 01:20:32 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT