W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2008

[Bug 5727] [XQuery] Syntax ambiguities with leading "/"

From: <bugzilla@wiggum.w3.org>
Date: Wed, 03 Sep 2008 10:07:32 +0000
To: public-qt-comments@w3.org
Message-Id: <E1KapGu-0002Gr-4E@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5727





--- Comment #12 from John Snelson <john.snelson@oracle.com>  2008-09-03 10:07:31 ---
I agree with Michael Dyck's changes. I'll repost the proposed text here for
convenience:

<new>
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 RelativePathExpr. In
some cases, the next token after the slash is insufficient to allow a parser to
distinguish these two possibilities: the "*" token and keywords like
"union" could be either an operator or a NameTest, and the "<" token
could be either an operator or the start of a DirectConstructor.
For example, without lookahead the first part of the expression "/ * 5" is
easily taken to be a complete expression, "/ *", which has a very different
interpretation (the child nodes of "/").

Therefore to reduce the need for lookahead, if the token immediately following
a slash can form the start of a RelativePathExpr, then the slash must be the
beginning of a PathExpr, not the entirety of it.

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.
</new>


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 3 September 2008 10:08:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 September 2008 10:08:07 GMT