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

Re: [css2.1] Every nonterminal should have a formal grammar specification

From: Bert Bos <bert@w3.org>
Date: Wed, 22 Apr 2009 16:20:03 +0200
To: W3C Emailing list for WWW Style <www-style@w3.org>
Message-Id: <200904221620.04039.bert@w3.org>
On Tuesday 21 April 2009, Zack Weinberg wrote:
> My earlier message about <family-name> raises this issue but I
> thought it might deserve its own thread.  CSS (both 2.1 and the
> various level-3 modules) has a chronic tendency to define
> property-value nonterminals only in prose, not with a formal syntax. 
> That prose tends to be ambiguous, or at least to assume things that
> are never stated.
> I request that the WG audit the existing specs, all of them, and add
> formal syntax definitions for *every* nonterminal; and going forward,
> that new proposals be required to provide these definitions.

I don't think we should impose any rules on ourselves about how to write 
specs. A formulation in a formal language rather than English may give 
the impression of precision, but as it is nobody's native language, 
it's quite likely to be misunderstood. Or to be written incorrectly: 
it's not the author's native language either.

But we should certainly consider different ways to write the same text 
and each time make conscious decisions for one style or another.

I remember that Björn Hörhrmann asked for machine-readable grammar 
definitions in the past, i.e., sufficient mark-up to distinguish the 
various languages in the spec: English, HTML, XML, CSS, and grammar 
notation. Fantasai and I have been thinking about ways to present 
formal but readable syntax rules in the "Backgrounds and borders" 
module and the next draft is likely to contain an effort to that 
effect. All non-terminals that are new in this module are defined by 
grammar productions (identified as such with a class attribute).

I'm not quite satisfied yet, because there are subtle differences 
between the grammar notations in various places. In particular, they 
can have either ":" or "=" at the start, and either ";" or nothing at 
the end. (But maybe that's OK.)

I'm also not sure yet how to properly refer to non-terminals across 
modules, or whether that is needed.

Anybody care to write a recursive checker that tests if all property 
values are fully defined?

(You can see the editor's draft here: 
http://dev.w3.org/csswg/css3-background/ Warning: this is a draft of a 
draft, the only requirement on it is that it is valid HTML, for the 
rest it may contain nonsense, and probably does...)

> [I don't care whether the grammar is L-anything.  I only care that it
> be fully, formally, specified.]
> zw

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 22 April 2009 14:20:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:35 UTC