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

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 UTC