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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 23 Apr 2012 14:46:13 -0700
Message-ID: <CAAWBYDDBLe1Wb7=8HK1f9NkVP62qPQSJ4WDrAwLY6T95szXDqg@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: Werner Donné <werner.donne@pincette.biz>, www-style@w3.org
On Mon, Apr 23, 2012 at 11:39 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> 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.)

Best of all is to stop defining almost anything in terms of low-level
tokens - the tokenizer itself handles those.  Instead, we should just
introduce a few more higher-level tokens that can be used to define
at-rules in a similar fashion to properties.

For example, @page could be defined as:

@page <page-selector>? { [ <margin-rule> | <declaration> ]* }
<page-selector> is compound selector with type selector and/or page
pseudo-class (:first, :left, :right), type selector can be anything
but "auto".
<declaration> matches the declaration production in the current CSS2.1
grammar, but capped with a ';' token at the end.
<margin-rule> = @<foo> { <declaration>* } where <foo> is "left", "right", etc.

I expect to define a bunch of these useful tokens in Syntax, and
redefine all the current at-rules in terms of this higher-level
grammar.

~TJ
Received on Monday, 23 April 2012 21:47:02 GMT

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