Skip to content
Browse files

More FLWOR grammar

  • Loading branch information...
1 parent 5107995 commit 56a3d0ede88c83130780ea9b2225e6d169923a6a @bacek committed Dec 8, 2008
Showing with 8 additions and 9 deletions.
  1. +8 −9 XQuery/Parser/Grammar.pm
View
17 XQuery/Parser/Grammar.pm
@@ -86,31 +86,30 @@ grammar XQueryGrammar {
#rule FLWORExpr { [ <ForClause> | <LetClause> ]+ <WhereClause>? <OrderByClause>? 'return' <ExprSingle> };
rule FLWORExpr {
- [ <ForClause> | <LetClause> ]+ <commit>
+ [ <ForClause> | <LetClause> ]+
+ <WhereClause>?
<OrderByClause>?
'return' <ExprSingle>
};
##[34] ForClause ::= "for" "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle ("," "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle)*
rule ForClause {
- 'for' '$' <VarName> 'in' <ExprSingle>
+ 'for' '$' <VarName> <TypeDeclaration>? <PositionalVar>? 'in' <ExprSingle>
+ [ ',' '$' <VarName> <TypeDeclaration>? <PositionalVar>? 'in' <ExprSingle> ]*
};
- #'for' '$' <VarName> <TypeDeclaration>? <PositionalVar>? 'in' <ExprSingle>
- #[ ',' '$' <VarName> <TypeDeclaration>? <PositionalVar>? 'in' <ExprSingle> ]*
rule PositionalVar { 'at' '$' <VarName> };
##[36] LetClause ::= "let" "$" VarName TypeDeclaration? ":=" ExprSingle ("," "$" VarName TypeDeclaration? ":=" ExprSingle)*
rule LetClause {
- 'let' '$' <VarName> ':=' <ExprSingle>
+ 'let' '$' <VarName> <TypeDeclaration>? ':=' <ExprSingle>
+ [',' '$' <VarName> <TypeDeclaration>? ':=' <ExprSingle>]*
};
- #'let' '$' <VarName> <TypeDeclaration>? ':=' <ExprSingle>
- #[',' '$' <VarName> <TypeDeclaration>? ':=' <ExprSingle>]*
rule WhereClause { 'where' <ExprSingle> };
- rule OrderByClause { 'order' 'by' <OrderSpecList> };
- #rule OrderByClause { [ [ 'order' 'by' ] | ['stable' 'order' 'by' ] ] <OrderSpecList> };
+ #rule OrderByClause { 'order' 'by' <OrderSpecList> };
+ rule OrderByClause { [ [ 'order' 'by' ] | ['stable' 'order' 'by' ] ] <OrderSpecList> };
rule OrderSpecList { <OrderSpec> [ ',' <OrderSpec> ]* };

0 comments on commit 56a3d0e

Please sign in to comment.
Something went wrong with that request. Please try again.