xquery / xquerydoc

xquerydoc - generate XQuery API documentation from your source code comments
https://github.com/xquery/xquerydoc
Other
38 stars 11 forks source link

Feature request: support eXist's for...group by #22

Closed EfraimFeinstein closed 11 years ago

EfraimFeinstein commented 12 years ago

eXist uses a non-standard (or, more accurately, pre-standard) XQuery 3.0 for...group by construct, which is currently not supported by the xquerydoc grammar.

Currently, xquerydoc will not parse an XQuery file containing this construct.

The grammar is defined at http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/src/org/exist/xquery/parser/XQuery.g?revision=16626&view=markup (written in ANTLR)

with the following modification to FLOWR:

694 flworExpr throws XPathException
695 :
696         ( forClause | letClause )+ ( "where" expr )? ( groupByClause )? ( orderByClause )?  "return"^ exprSingle 
697         ;

and the new group constructs defined as:

757 groupByClause throws XPathException 
758 : 
759     "group"! toGroupVarRef "as"! groupVarBinding "by"! groupSpecList 
760     { #groupByClause= #([GROUP_BY, "group by"], #groupByClause); } 
761     ; 
762  
763 toGroupVarRef throws XPathException 
764 { String toGroupVarName = null; } 
765 : 
766     DOLLAR! toGroupVarName=v:qName 
767     {  
768         #toGroupVarRef= #[VARIABLE_REF, toGroupVarName]; 
769         #toGroupVarRef.copyLexInfo(#v); 
770     } 
771     ; 
772  
773 groupVarBinding throws XPathException 
774 { String groupVarName; } 
775 : 
776     DOLLAR! groupVarName=qName! 
777     { #groupVarBinding= #(#[VARIABLE_BINDING, groupVarName], #groupVarBinding); } 
778     ; 
779      
780 groupSpecList throws XPathException 
781 : 
782     groupSpec ( COMMA! groupSpec )* 
783     ; 
784  
785 groupSpec throws XPathException:  
786     exprSingle "as"! (groupKeyVarBinding)! 
787     ; 
788  
789 groupKeyVarBinding throws XPathException 
790 { String groupKeyVarName; } 
791 : 
792     DOLLAR! groupKeyVarName=qName! 
793     { #groupKeyVarBinding= #(#[VARIABLE_BINDING, groupKeyVarName], #groupKeyVarBinding); } 
794     ; 
795         
garyvidal commented 12 years ago

Thanks, Will work on issue over next week. I am planning to upgrade the antlr to 3.0

xquery commented 12 years ago

John ... whats your thoughts on this ?

xquery commented 12 years ago

also any chance of us supporting 0.9 minimally ?

jpcs commented 11 years ago

Is this still an issue. It looks like eXist supports XQuery 3.0 grouping now, not their own extension.

EfraimFeinstein commented 11 years ago

No, eXist's XQuery 3.0 support made it moot.