Re: [CSS2.1] Parsing Selectors with Brackets

Anne van Kesteren wrote:

>> The tokenizer actually may remain the same, does it not (at least for a  
>> new CSS unit)?
>
>http://www.w3.org/TR/CSS21/grammar.html#scanner contains things like:
>
>   {num}{C}{M} {return LENGTH;}
>   {num}{M}{M} {return LENGTH;}
>
>which I think means that adding new units does require changes.

This is an appendix, and as has been found out in the past doesn't
describe things accurately (meaning: any implementation assuming that
using that grammar will yield a CSS conforming parser will fail to
implement a correct CSS parser). In that light, it is just usable as a
coarse description of what the actual CSS parsing rules would roughly
look like when expressed in a grammar-like notation.

The only interesting part for implementors of general-purpose CSS tools
is the tokenization described in <http://www.w3.org/TR/CSS21/
syndata.html#tokenization>, where we have the DIMENSION token and it is
defined to be {num}{ident}. Introducing a new dimension therefore does
not require any change to the tokenizer, as Christof correctly stated.

-kris

-- 
Please don't CC list answers to my own email address.
I actually read the lists I post to.

Received on Thursday, 27 December 2007 12:26:21 UTC