W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2005

[Bug 1378] [XQuery] some editorial comments on A.1.1 grammar-note: leading-lone-slash

From: <bugzilla@wiggum.w3.org>
Date: Thu, 07 Jul 2005 01:31:53 +0000
To: public-qt-comments@w3.org
Message-Id: <E1DqLF3-0007Yf-71@wiggum.w3.org>


------- Additional Comments From cmsmcq@w3.org  2005-07-07 01:31 -------
For what it's worth, I agree that this note should probably be
reworded.  On the other hand, I have some isuses with the 
rewording proposed in Bug 1390.

Working partly from the current text, partly from this comment,
and partly from the proposal in bug 1390, I produce this sketch,
for what it's worth:

   A single slash may appear either as a complete path expression
   or as the first part of a path expression in which it is
   followed by a RelativePathExpression, which can take the form
   of a NameTest ("*" or a QName).  In contexts where operators
   like "*", "union", etc., can occur, parsers may have
   difficulty distinguishing operators from NameTests.  For
   example, without lookahead the first part of the expression "/
   * 5", for example is easily taken to be a complete expression,
   "/ *", which has a very different interpretation (the child
   nodes of "/").

   [Optionally display the two parse trees from bug 1390 here.]

   To reduce the need for lookahead, therefore, if the token
   immediately following a slash is "*" or a keyword, then the
   slash must be the beginning, but not the entirety, of a
   PathExpression (and the following token must be a NameTest,
   not an operator).

   A single slash may be used as the left-hand argument of an
   operator by parenthesizing it: "(/) * 5".  The expression "5 *
   /", on the other hand, is legal without parentheses.

This is longer and clumsier than I'd like, and could use a
cold-eyed revision by a merciless editor.  But I offer it
as a possible improvement.
Received on Thursday, 7 July 2005 01:31:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:25 UTC