W3C home > Mailing lists > Public > www-style@w3.org > October 1995

Re: CSS draft 4.0 [Level 2 YACC Spec]

From: Bert Bos <Bert.Bos@sophia.inria.fr>
Date: Mon, 23 Oct 1995 13:16:46 +0100
Message-Id: <199510231216.NAA27548@www42.inria.fr>
To: Glenn Adams <glenn@stonehand.com>
Cc: www-style@w3.org
Glenn Adams writes:
 > While I'm on the subject of LEX/YACC specs, I don't know if anyone has
 > tried it, but the level 2 YACC spec in the 4.0 draft is in serious need
 > of repair.  Besides a variety of typos, the following productions
 > produce a variety of problems:
 > 
 > 1. imports: imports IMPORT url
 > 
 > This rule prevents any rule from applying.  Change to:
 > 
 >    imports: imports IMPORT url | /* empty */;

OK

 > 2. term: length | STRING | HEXCOLOR | NUMBER | IDENT | attref | propref |
 >          ENVVAR | '(' value ')';
 > 
 > Here propref conflicts with IDENT.  Change to:
 > 
 >    term: length | STRING | HEXCOLOR | NUMBER | IDENT | attref |
 >          ENVVAR | '(' value ')';

OK. (Actually, we need another terminal in there, PERCENTAGE, because
we decided to treat a percentage as a type of its own, instead of as a
number.)

 > 3. op: '+' | '-' | '*' | '/' | INTERPOLATEHI | INTERPOLATELO | /* empty */;
 > 
 > Produces 2 shift/reduce conflicts. Change to:
 > 
 >    op: '+' | '-' | '*' | '/' | INTERPOLATEHI | INTERPOLATELO;

As you already noted in your other message, this conflict is
unavoidable, since we want the absence of an operator to mean
concatenation (or rather, list construction). Just put "%expect 2" at
the top of the yacc/bison file. Yacc wil shift rather than reduce,
which is what you want in this case.

Like with the (f)lex specification, we have a correct, tested grammar,
but it failed to make it into the 4th draft. We'll include it as soon
as possible.

We changed some of the names of the nonterminals as well, to bring
them more into line with the terminology used elsewhere in the draft.


Bert
Received on Monday, 23 October 1995 08:21:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:42 GMT