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 7257 - LL parsing issues with outer for
Summary: LL parsing issues with outer for
Status: CLOSED DUPLICATE of bug 6927
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQueryX 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-10 21:57 UTC by Nikolay Ognyanov
Modified: 2013-11-19 00:15 UTC (History)
0 users

See Also:


Attachments

Description Nikolay Ognyanov 2009-08-10 21:57:29 UTC
Please consider the following 2 expressions:

for $a in outer for $b in c return d
for $a in outer for $b in c return d return e

Both are syntactically correct. In the first 'outer' is relative path and in the second it is part of "outer for" clause. To distinguish between the 2 a parser needs to look across c which is generally ExprSingle and hence - recursive. This is of course a problem for LL parsers.

Feasibility of LL parsing is not necessarily a requirement for XQuery 1.1 grammar but it is certainly a nice feature, so I wonder whether you would you consider the possibility of changing the syntax. Two options that I would suggest are:

ForClause ::=  ("for" | "outer"    ) "$" VarName TypeDeclaration? PositionalVar? 
                "in" ExprSingle ("," "$" VarName TypeDeclaration? PositionalVar? 

ForClause ::=  ("for" | "outer-for") "$" VarName TypeDeclaration? PositionalVar? 
                "in" ExprSingle ("," "$" VarName TypeDeclaration? PositionalVar? 

Thank you
Regards
Nikolay
Comment 1 Nikolay Ognyanov 2009-08-10 22:18:01 UTC
P.S. Sorry, this has already been reported.

*** This bug has been marked as a duplicate of bug 6927 ***
Comment 2 Jim Melton 2013-11-19 00:15:15 UTC
This bug was resolved as a duplicate of bug 6927 over four years ago.  I am therefore marking it CLOSED.