Re: We need a EBNF spec

> > Some technical reports like http://www.w3.org/TR/xpath20/#id-grammar
> > also modify certain aspects of EBNF and/or include certain parts of 
the
> > original EBNF "specification"

Note that the differences are pretty minor at this point:

    *  All named symbols have a name that begins with an uppercase letter.
 
    *  It adds a notation for referring to productions in external specs.

    *  Comments or extra-grammatical constraints on grammar productions 
are between '/*' and '*/' symbols.
          o A 'xgc:' prefix is an extra-grammatical constraint, the 
details of which are explained in A.1.2 Extra-grammatical Constraints
          o A 'ws:' prefix explains the whitespace rules for the 
production, the details of which are explained in A.2.4 Whitespace Rules
          o A 'gn:' prefix means a 'Grammar Note', and is meant as a 
clarification for parsing rules, and is explained in A.1.3 Grammar Notes. 
These notes are not normative.

Somewhat relevant to this discussion, the grammar in the XPath/XQuery 
specs is defined in 
http://www.w3.org/XML/Group/xsl-query-specs/grammar/xpath-grammar.xml, and 
semi-modeled in 
http://www.w3.org/XML/Group/xsl-query-specs/grammar/grammar.dtd.  This 
format was originally invented by James Clark, though I have 
evolved/corrupted it over time.  It is used to define multiple subsets and 
supersets of the language (xpath 2.0, XQuery, XQuery-fulltext, 
XQuery-update, XQuery-Formal-Semantics).  This file goes through an XSLT 
preprocess with the spec documents to form the <prod> productions.  We 
also process xpath-grammar.xml through XSLT transforms to produce a 
functional JavaCC parser (
http://www.w3.org/XML/Group/xsl-query-specs/grammar/parser/applets/xquery-updateApplet.html
, for instance).

This process is likely too heavy handed for the needs of many specs, but 
it's worth keeping in mind I think.  I'm not quite sure if and how the 
grammar.dtd format might intersect with the work that Dan and Tim have 
done, but I would be interested in discussions.

In any case, +1 to making some sort of specification for W3C EBNF, just to 
make it easier for future spec writers.

-scott

Received on Wednesday, 22 February 2006 18:01:28 UTC