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

Re: Grammatical ambiguity in namespaces draft

From: Daniel Glazman <daniel.glazman@libertysurf.fr>
Date: Sun, 09 Apr 2000 19:06:15 +0200
Message-ID: <38F0B887.44982E62@libertysurf.fr>
To: "Peter S. Linss" <peter@linss.com>
CC: "L. David Baron" <dbaron@fas.harvard.edu>, www-style@w3.org
"Peter S. Linss" a écrit :

> Actually a similar issue also exists in element selector parsing with
> namespaces. Once you have parsed the first token, you don't know if it is an
> element selector or a namespace prefix until you look at the next token (ie.
> is a '|' following?). CSS1 & CSS2 generally don't require this kind of
> look-ahead (although it does help some implementations in some places).
> ...
> Yes and no. It requires a one token look ahead during parsing which is
> something new and is also something that has been historically avoided (I
> believe to make it easier to use generated parsers to parse CSS). However,
> the reality is that no major CSS parser implementation actually uses a
> generated parser, so this functionality is trivial to add. The working group
> has discussed this issue, and when I last heard about it, it was decided to
> accept the parsing issue because it allowed a more logical "human readable"
> namespace syntax (and it looks more like namespaces in XML). 
> ...

CSS 1 and 2 were LL(1) (see spec). Adding namespaces turns it into a "LL(1)
most of the time, and locally LL(2)".

Implementing namespaces in CSSize (my STTS implem in Java) took me very
little time, thanks to JavaCC which enables to modify the look-ahead in
two seconds :-) 

Received on Sunday, 9 April 2000 13:07:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:53 UTC