Re: Problem with RGB value syntax

On Mon, 22 Apr 1996 15:36:37 +0200, you wrote:

>Wolfgang Rieger writes:
> > There is a problem with the proposed syntax for RGB and RRGGBB values.
> > Because both id-selector and RGB values are prefixed with '#', it is
> > not possible to use Lex in a straightforward way to implement the
> > lexical analyzer.
>This is clearly a problem with lex, not with CSS. The selector appears
>on the lhs and the rgb vales appear on the rhs; there is no ambiguity
>in the syntax.
>Altering CSS to work around deficiencies of a particular code
>generation tool does not seem desirable or necessary.
>Put it this way - how would you
>react to further change requests to ease programming for (say) visual
>basic, perl, awk, snobol ... the CSS syntax introduces no ambiguity
>for the use of # to mean ID on the lhs and as an rgb color prefix (as
>widely used by browsers) on the rhs.
To compare lex/flex with visual basic is an insult to this honorable
unix tool.

I do not have problems writing a scanner without usng lex, but there
is still another point. Lex and YACC or code generators for a simple
class of grammars. If a language can be specified using Lex/YACC this
is in my eyes an indication of a simple, clear and consistent design.

If this is not possible, there should be a good reason for it.

Of course, if you are using flex, then your scanner may be aware of
context. But the reader of the style sheet has to be aware of context,
too. We all do too easily forget, that when ssanning through large
amounts of code we are more like lex than like flex (i.e. loooking for
simple patterns and not for context).

Maybe a minor point, though.


Wolfgang Rieger

Buero fuer Software-Entwicklung           Email: rieger@bse.de
                                          WWW  : http://www.bse.de/
Rosenheimer Str. 214                      Phone: +49 89 497738	
81669 Munich, Germany                     Fax  : +49 89 497738