Re: Grammatical ambiguity in namespaces draft

"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 :-) 

</Daniel>

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