- From: Michael Rys <mrys@microsoft.com>
- Date: Mon, 16 Feb 2004 23:19:01 -0800
- To: <public-qt-comments@w3.org>
Appendix A.1 EBNF
Technical
It looks like that we cannot parse an expression of the form:
"1" cast as xs:integer = "1.0" cast as xs:integer.
Which is semantically the same as xs:integer("1") = xs:integer("1.0").
Based on the precedence table, I would assume that cast as binds
stronger than =, and from a composability point of view, I would also
expect to be able to write the above. However, when following the
grammar, it looks like the grammar pops out without consuming the =.
Here is the parse process:
"1" is consumed by
Expr->SingleExpr->OrExpr->AndExpr->InstanceOfExpr->TreatExpr->CastableEx
pr->CastExpr->ComparisonExpr->RangeExpr->AdditiveExpr->MiltiplicativeExp
r->UnaryExpr->UnionExpr->IntersectExpr->ValueExpr->PathExpr->RelativePat
hExpr->StepExpr->FilterStep->PrimaryExpr->Literal->StringLiteral
Which then pops back to CastExpr that consumes "cast as xs:integer"
Then we pop back to the top and realize that we have left overs and
raise a parse error.
This is also a problem for the related treat as, castable as etc.
Received on Tuesday, 17 February 2004 02:19:10 UTC