This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1668 - [FS] technical: 4.8.1 FLWOR expressions: non-parameterized normalization
Summary: [FS] technical: 4.8.1 FLWOR expressions: non-parameterized normalization
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-16 23:52 UTC by Michael Dyck
Modified: 2007-02-25 23:15 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-07-16 23:52:42 UTC
4.8.1 FLWOR expressions

Norm
[[ FLWORClause ]]_FLWOR(Expr)

I don't understand why you're using a parameterized []-form. I can see how
you might need it if you were normalizing the 4.8 syntax, but since you're
assuming an easier syntax, the parameter shouldn't be necessary.

If we define
    FLWORExpr_or_return ::= FLWORExpr | "return" Expr
(find a better name if you like) then we can express the assumed EBNF as:
    FLWORExpr ::= (ForClause | LetClause | WhereClause | OrderByClause)
                  FLWORExpr_or_return
Then you can:
(a) drop Norm / rule (2|3)

(b) recast rule (4|5|6) (and 4.8.4 / Norm / rule 1) as non-parameterized
    rules:

    rule 4:
        [[ <one many-variable ForClause> FLWORExpr_or_return ]]_Expr
        ==
        <many single-var Forclauses> return [[ FLWORExpr_or_return ]]_Expr

    rule 5:
        (very similar)

    rule 6:
        [[ where Expr FLWORExpr_or_return ]]_Expr
        ==
        if ( [[ Expr ]]_Expr ) then [[ FLWORExpr_or_return ]]_Expr else ()

    4.8.4 / Norm / rule 1:
        [[ stable? order by OrderSpecList FLWORExpr_or_return ]]_Expr
        ==
        [[ OrderSpecList ]]_OrderSpecList return [[ FLWORExpr_or_return ]]_Expr

(c) provide a "base case" rule:
        [[ return Expr ]]_Expr
        ==
        [[ Expr ]]_Expr
Comment 1 Jerome Simeon 2005-07-21 18:33:02 UTC
This proposed change looks editorial to me. It looks like a valuable
simplification to the existing rules.
- Jerome
Comment 2 Jerome Simeon 2005-07-22 22:59:49 UTC
The WGs have decided to reclassify that comment as editorial. The specific
solution is left to the discretion of the editors, considering the solution
proposed by the commenter.

- Jerome Simeon
On behalf of the XML Query and XSL WGs
Comment 3 Jerome Simeon 2006-04-18 15:03:17 UTC
Fixed as suggested. This is a great simplification for that part of the spec.
- Jerome
Comment 4 Michael Dyck 2006-10-03 20:05:42 UTC
The 2006-06 CR has a few errors relative to my suggestion:

In Norm / rule (1|2), *above* the '==',
    [[ FormalReturnClause ]]_Expr
should be just
    FormalReturnClause

In Norm / rule 1, below the '==', after
    [[ Exprn ]]_Expr
insert "return".

In Norm / rule 2, below the '==', in
    return Expr [[ FormalReturnClause ]]_Expr
delete the first 'Expr'.

Also:

You replaced my suggested symbol name 'FLWORExpr_or_return' with 'FormalReturnClause', which I don't think is an improvement. It would be a good name for the
    "return" Expr
phrase (if that needed a name), so isn't that great for the more general
    FormalFLWORExpr | ("return" Expr)
How about 'FormalInnerFLWORExpr' or 'FormalFLWORExprInner'?


In [66 (Formal)] and throughout 4.8.*, each 'Expr' should really be an 'ExprSingle' (not including 'Expr' in []_Expr subscripts).
Comment 5 Jerome Simeon 2007-01-16 17:57:42 UTC
Corrected the errors, but left the grammar and non-terminals
unchanged.

- Jerome