
Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: xmlware/xquery/rosendal/extracted
Source used for this grammar: Peter Rosendal, XQuery 1.1, XQuery.ecore, 2005/06/13 [Atlantic]
XQueryProgram, Expression, ExecutableExpression, Node, FLWOR, FunctionCall, FunctionDeclaration, ElementNode, AttributeNode, TextNode, ReturnXPath, XPath, BooleanExp, For, Let, Where, OrderBy, Return, Boolean, Integer, String), 0 root (—), 2 top (Boolean, Integer), 0 bottom (—).[expressions] 2, [parentNode], [returnEx], [xQueryProgram], [functionDeclaration], [name] 3, [for] 2, [let] 2, [where] 2, [orderBy], [return], [parameters], [expression] 4, [nodes] 2, [value] 2, [functionCall], [var] 2, [flwor] 5.XQueryProgram ::=
[expressions]::ExecutableExpressionExpression ::= ExecutableExpression
Expression ::= Node
Expression ::= ReturnXPath
Expression ::= [parentNode]::ElementNode [returnEx]::Return
ExecutableExpression ::= FLWOR
ExecutableExpression ::= FunctionCall
ExecutableExpression ::= FunctionDeclaration
ExecutableExpression ::= [xQueryProgram]::XQueryProgram [functionDeclaration]::FunctionDeclaration
Node ::= ElementNode
Node ::= AttributeNode
Node ::= [name]::String
FLWOR ::= [for]::For [let]::Let [where]::Where [orderBy]::OrderBy [return]::Return
FunctionCall ::=
[name]::String [parameters]::XPathFunctionDeclaration ::=
[name]::String [expression]::ExecutableExpressionElementNode ::= TextNode
ElementNode ::=
[nodes]::ExpressionAttributeNode ::= [value]::String
TextNode ::=
[nodes]::ExpressionReturnXPath ::= XPath
ReturnXPath ::= [value]::String
XPath ::= BooleanExp
XPath ::= [functionCall]::FunctionCall [for]::For [let]::Let
BooleanExp ::= [where]::Where
For ::= [var]::String [flwor]::FLWOR [expression]::XPath
Let ::= [var]::String [flwor]::FLWOR [expression]::XPath
Where ::= [flwor]::FLWOR [expression]::BooleanExp
OrderBy ::= [flwor]::FLWOR
Return ::=
[flwor]::FLWOR [expressions]::ExpressionBoolean ::= "true" "false"
Integer ::= integer
String ::= string