[Bug 1390] [XQuery] suggested alternate wording for A.2 and some A.1.1

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





------- Additional Comments From jmdyck@ibiblio.org  2005-05-11 23:44 -------
As pointed out by Michael Kay over at Bug 1368, there *is* an ambiguity
involving leading-lone-slash, which is a more compelling argument than the
merely "troublesome" case that the spec (and then I) used.  So please slot
this replacement into A.3 (3) above:

    (3)
    [grammar-note: leading-lone-slash]
    Consider the two abbreviated syntax trees:

               Expr                             Expr
                |                                |
             PathExpr                   MultiplicativeExpr
                |                                |
         +------+-----+                  +-------+-------+
         |            |                  |       |       |
        "/"   RelativePathExpr       UnionExpr  "*"  UnionExpr
         |            |                  |       |       |
         |     +------+-----+         PathExpr   |    PathExpr
         |     |      |     |            |       |       |
         |  StepExpr "/" StepExpr       "/"      |   +---+-----+
         |     |      |     |            |       |   |         |
         |  NameTest  |  NameTest        |       |  "/" RelativePathExpr
         |     |      |     |            |       |   |         |
         |  Wildcard  |   QName          |       |   |     StepExpr
         |     |      |     |            |       |   |         |
         /     *      /    foo           /       *   /        foo

    This illustrates another ambiguity in the EBNF. Similarly with:

               Expr                               Expr
                |                                  |
             PathExpr                          UnionExpr
                |                                  |
         +------+-----+                  +---------+---------+
         |            |                  |         |         |
        "/"   RelativePathExpr       IntExExpr  "union"  IntExExpr
         |            |                  |         |         |
         |     +------+-----+         PathExpr     |      PathExpr
         |     |      |     |            |         |         |
         |  StepExpr "/" StepExpr       "/"        |     +---+-----+
         |     |      |     |            |         |     |         |
         |  NameTest  |  NameTest        |         |    "/" RelativePathExpr
         |     |      |     |            |         |     |         |
         |   QName    |   QName          |         |     |     StepExpr
         |     |      |     |            |         |     |         |
         /   union    /    foo           /       union   /        foo

    In each pair, the ambiguity is resolved by disallowing the tree on the
    right.  Specifically, [etc as before]

Received on Wednesday, 11 May 2005 23:44:38 UTC