W3C home > Mailing lists > Public > www-ql@w3.org > April to June 2002

Re: ambiguity in XQuery grammar

From: Michael Dyck <michaeldyck@shaw.ca>
Date: Wed, 05 Jun 2002 21:11:12 -0700
To: "Kay, Michael" <Michael.Kay@softwareag.com>
Cc: Damien Fisher <damien@sodatech.com>, www-ql@w3.org
Message-id: <3CFEE0E0.4EDE13B3@shaw.ca>

Damien Fisher wrote:
> There appears to be an ambiguity in the current draft specification's
> grammar, which I was hoping someone could resolve for me.
> Consider:
>     1 instance of xs:integer+ +1
> Is this equivalent to:
>     (1 instance of xs:integer+) +1
> or:
>     (1 instance of xs:integer) + (+1)
> ?

Michael Kay replied:
> It is indeed an ambiguity, and I've been concerned about it too, ...

I don't think it is an ambiguity.

According to A.3 Precedence Order, InstanceofExpr is at precedence level 6
and AdditiveExpr is at level 8. Now, while the exact grammatical meaning of
the precedence table has never been given, my interpretation is that an
AdditiveExpr cannot have an InstanceofExpr as either of its operands. So
both of the suggested parsings are illegal, and in fact, the example query
has no legal parse.

-Michael Dyck
Received on Thursday, 6 June 2002 00:14:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:42 UTC