<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>8882</bug_id>
          
          <creation_ts>2010-02-04 20:37:31 +0000</creation_ts>
          <short_desc>XQuery scripting extension  grammar is not LL(k)</short_desc>
          <delta_ts>2010-04-12 10:58:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Scripting Extensions 3.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolay Ognyanov">nikolay.ognyanov</reporter>
          <assigned_to name="John Snelson">john.snelson</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>31470</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2010-02-04 20:37:31 +0000</bug_when>
    <thetext>Top level expression grammar of XQuery scripting extension is :

Expr       ::= ApplyExpr | ConcatExpr
ApplyExpr  ::= (ConcatExpr &quot;;&quot;)+
ConcatExpr ::= ExprSingle (&quot;,&quot; ExprSingle)*

To distinguish between ApplyExpr and ConcatExpr alternatives in the rule for Expr an LL parser would need to look beyond a list of ExprSingle to see whether terminating &quot;;&quot; follows it. This can obviously not be done with fixed amount of lookahead. 

An LL(k) grammar for the same language is e.g. this :

Expr       ::= ExprSingle ((&apos;,&apos; | &apos;;&apos;) ExprSingle)* &apos;;&apos;?

It does not match well semantics of the language, so possibly the choice to sacrifice LL(k) was conscious. If this is the case though then the fact probably deserves some comments in the specification since generally XQuery related grammars are LL(1) (with the exception of some explicitly defined extra-grammatical constraints).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31475</commentid>
    <comment_count>1</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2010-02-05 11:07:27 +0000</bug_when>
    <thetext>Hi Nikolay,

Thanks for your comments. The XQuery WG has already addressed this issue in an internal draft of the XQuery Scripting Extensions, so the next version will contain this decision.

John</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31483</commentid>
    <comment_count>2</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2010-02-05 19:24:26 +0000</bug_when>
    <thetext>Hi John,

Thank you for the information. I will be looking forward to the next draft. Any projections as to when it may come out?

Regards
Nikolay
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31550</commentid>
    <comment_count>3</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2010-02-05 23:30:15 +0000</bug_when>
    <thetext>Soon, I hope.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31676</commentid>
    <comment_count>4</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2010-02-09 18:13:02 +0000</bug_when>
    <thetext>On the XQuery Working Group teleconference today, the working group confirmed comment #1 was correct, and that this grammar problem has already been fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>