W3C home > Mailing lists > Public > public-qt-comments@w3.org > October 2005

[Bug 2405] QueryBody for MainModule can be very difficult to parse

From: <bugzilla@wiggum.w3.org>
Date: Fri, 21 Oct 2005 14:51:15 +0000
To: public-qt-comments@w3.org
Cc:
Message-Id: <E1ESyEl-0006pO-Sf@wiggum.w3.org>

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

           Summary: QueryBody for MainModule can be very difficult to parse
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: henryluo@vibrasoft.net
         QAContact: public-qt-comments@w3.org


Current XQuery grammar for main module is
MainModule ::= Prolog QueryBody
which allows an expr to follow the prolog.
However because the XQuery grammar for expr is complicated, it can be very
difficult for the parser to determine when it has reach the last prolog declaration.

E.g. 
declare namespace namespace = "http://example.com"; 
declare union <union>for gibberish {
   for $for in for return <for>***div div</for>
}</union>, 
if(if) then then else else- +-++-**-* instance 
of element(*)* * * **---++div- div -div

Is it better to wrap the QueryBody in a special main() function, and make the
main() function the entry point of execution?
i.e. MainModule ::= Prolog "function main()" "{" QueryBody "}"
Received on Friday, 21 October 2005 14:51:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:09 UTC