Re: CSS3 Syntax

On Thu, Jun 24, 2010 at 7:15 AM, Michael <newsletters@codefisher.org> wrote:
> Hi,
>
> I am working on a project where I need to be able to parse CSS3, and I am
> using bison (a yacc like parser).  This is made kind of easy because the
> spec defines it almost in the right format (you just have to expand the
> short hand).  What makes it hard it the fact it is scattered all over the
> place.  So for example most of it is define at
> http://www.w3.org/TR/css3-syntax/#grammar0
> Then you have other little bits scatted around at places like
> * http://www.w3.org/TR/css3-mediaqueries/#syntax
> * http://dev.w3.org/csswg/css3-page/#syntax-page-selector
> * http://www.w3.org/TR/css3-selectors/#grammar
>
> It is possible to find a place where it is all listed on a single page?  If
> there is, I can't find it.

No, there isn't.  As different specs define new grammars, they specify
the new bits in themselves.

As well, note that in many places the grammar is only an
approximation, and the prose describes more complete restrictions.
This is often done if expressing something in terms of the grammar
would be overly verbose and thus hard to read and understand.

~TJ

Received on Thursday, 24 June 2010 17:18:27 UTC