Re: [CSS2.1] Parsing Selectors with Brackets

Christian Roth wrote:
> 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.

I think the definition

{num}{ident}		{return DIMENSION;}

would be used for unknown dimension tokens (like "rem") but as Christian 
said it is more theoretical.


The question remains if a tokenizer change (if one would find an example 
where it really would be needed) would be desirable at all. Does this 
very open idea not introduce too many problems?

Actually, is http://www.w3.org/TR/css3-syntax/ still worked on? I 
understood this WD as a definitive definition of the CSS syntax which 
would be very helpful to have an actual base to build on.

Christof

Received on Thursday, 27 December 2007 12:57:30 UTC