blob: 360879c66a40d87804501001dc434ef18ad1805f [file] [log] [blame]
<!--
! Copyright 2009-2013 by The Regents of the University of California
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! you may obtain a copy of the License from
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
!-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>BNF for AQL.jj</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>BNF for AQL.jj</H1>
<H2 ALIGN=CENTER>TOKENS</H2>
<TABLE>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;CARET: "^"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;DATASET: "dataset"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;LEFTPAREN: "("&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;RIGHTPAREN: ")"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;INTEGER_LITERAL: (&lt;DIGIT&gt;)+&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;NULL: "null"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TRUE: "true"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;FALSE: "false"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;#DIGIT: ["0"-"9"]&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;DOUBLE_LITERAL: &lt;INTEGER&gt; | &lt;INTEGER&gt; ("." &lt;INTEGER&gt;)? | "." &lt;INTEGER&gt;&gt;
| &lt;FLOAT_LITERAL: &lt;INTEGER&gt; ("f" | "F") | &lt;INTEGER&gt; ("." &lt;INTEGER&gt; ("f" | "F"))? | "." &lt;INTEGER&gt; ("f" | "F")&gt;
| &lt;INTEGER: (&lt;DIGIT&gt;)+&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;#LETTER: ["A"-"Z","a"-"z"]&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;SPECIALCHARS: ["$","_","-"]&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;STRING_LITERAL: "\"" (&lt;EscapeQuot&gt; | ~["\""])* "\"" | "\'" (&lt;EscapeApos&gt; | ~["\'"])* "\'"&gt;
| &lt;#EscapeQuot: "\\\""&gt;
| &lt;#EscapeApos: "\\\'"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;IDENTIFIER: (&lt;LETTER&gt;)+ (&lt;LETTER&gt; | &lt;DIGIT&gt; | &lt;SPECIALCHARS&gt;)*&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;VARIABLE: "$" &lt;IDENTIFIER&gt;&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; SKIP : {
" "
| "\t"
| "\r"
| "\n"
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; SKIP : {
&lt;"//" (~["\n"])* "\n"&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; SKIP : {
&lt;"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")?&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;DEFAULT&gt; SKIP : {
"/*" : INSIDE_COMMENT
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;INSIDE_COMMENT&gt; SPECIAL : {
&lt;"+" (" ")* (~["*"])*&gt;
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;INSIDE_COMMENT&gt; SKIP : {
"/*" : {
}
</PRE>
</TD>
</TR>
<!-- Token -->
<TR>
<TD>
<PRE>
&lt;INSIDE_COMMENT&gt; SKIP : {
"*/" : {
| &lt;~[]&gt;
}
</PRE>
</TD>
</TR>
</TABLE>
<H2 ALIGN=CENTER>NON-TERMINALS</H2>
<TABLE>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod1">Statement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( ( ( "use" | "declare" "function" | "create" ( "type" | "nodegroup" | "external" &lt;DATASET&gt; | &lt;DATASET&gt; | "index" | "dataverse" ) | "load" | "enlist" | "drop" ( &lt;DATASET&gt; | "index" | "nodegroup" | "type" | "dataverse" ) | "write" | "set" | "insert" | "delete" | "update" )* ( <A HREF="#prod2">Query</A> )? ) &lt;EOF&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod3">InsertStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"into" &lt;DATASET&gt; &lt;IDENTIFIER&gt; &lt;LEFTPAREN&gt; <A HREF="#prod2">Query</A> &lt;RIGHTPAREN&gt; ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod4">DeleteStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod5">Variable</A> "from" &lt;DATASET&gt; &lt;IDENTIFIER&gt; ( "where" <A HREF="#prod6">Expression</A> )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod7">UpdateStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod5">Variable</A> "in" <A HREF="#prod6">Expression</A> "where" <A HREF="#prod6">Expression</A> &lt;LEFTPAREN&gt; ( <A HREF="#prod8">UpdateClause</A> ( "," <A HREF="#prod8">UpdateClause</A> )* ) &lt;RIGHTPAREN&gt; ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod8">UpdateClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"set" <A HREF="#prod6">Expression</A> ":=" <A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"insert" <A HREF="#prod3">InsertStatement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"delete" <A HREF="#prod4">DeleteStatement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"update" <A HREF="#prod7">UpdateStatement</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>|</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"if" &lt;LEFTPAREN&gt; <A HREF="#prod6">Expression</A> &lt;RIGHTPAREN&gt; "then" <A HREF="#prod8">UpdateClause</A> ( "else" <A HREF="#prod8">UpdateClause</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod9">SetStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; &lt;STRING_LITERAL&gt; ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod10">WriteStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "output" "to" &lt;IDENTIFIER&gt; ":" &lt;STRING_LITERAL&gt; ( "using" &lt;STRING_LITERAL&gt; )? ) | ( "into" &lt;DATASET&gt; &lt;IDENTIFIER&gt; &lt;LEFTPAREN&gt; <A HREF="#prod2">Query</A> &lt;RIGHTPAREN&gt; ) ) ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod11">CreateIndexStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if not exists" )? "on" &lt;IDENTIFIER&gt; &lt;LEFTPAREN&gt; ( &lt;IDENTIFIER&gt; ) ( "," &lt;IDENTIFIER&gt; )* &lt;RIGHTPAREN&gt; ( "type" ( "btree" | "keyword" | "qgram" | "rtree" ) ";" | ";" )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod12">DataverseDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"dataverse" &lt;IDENTIFIER&gt; ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod13">DropStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if exists" )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod14">IndexDropStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; "." &lt;IDENTIFIER&gt; ( "if exists" )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod15">NodeGroupDropStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if exists" )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod16">TypeDropStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if exists" )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod17">DataverseDropStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if exists" )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod18">CreateDataverseStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if not exists" )? ( "with format" &lt;STRING_LITERAL&gt; )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod19">LoadStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;DATASET&gt; &lt;IDENTIFIER&gt; "from" ( &lt;IDENTIFIER&gt; ":" &lt;STRING_LITERAL&gt; ) ( "," &lt;IDENTIFIER&gt; ":" &lt;STRING_LITERAL&gt; )* ( "delimited" "by" &lt;STRING_LITERAL&gt; )? ( "pre-sorted" )? ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod20">EnlistStatement</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;DATASET&gt; &lt;IDENTIFIER&gt; ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod21">DatasetDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if not exists" )? ( &lt;LEFTPAREN&gt; &lt;IDENTIFIER&gt; &lt;RIGHTPAREN&gt; )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod22">InternalDatasetDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"partitioned" "by" "key" &lt;IDENTIFIER&gt; ( "," &lt;IDENTIFIER&gt; )* "on" &lt;IDENTIFIER&gt; ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod23">ExternalDatasetDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( "hdfs" ( &lt;STRING_LITERAL&gt; ) | "splits" ( &lt;IDENTIFIER&gt; ":" &lt;STRING_LITERAL&gt; ) ( "," &lt;IDENTIFIER&gt; ":" &lt;STRING_LITERAL&gt; )* ) "using" ( &lt;STRING_LITERAL&gt; &lt;LEFTPAREN&gt; ( ( &lt;LEFTPAREN&gt; ( &lt;STRING_LITERAL&gt; ":" &lt;STRING_LITERAL&gt; ) &lt;RIGHTPAREN&gt; ) ( "," &lt;LEFTPAREN&gt; ( &lt;STRING_LITERAL&gt; ":" &lt;STRING_LITERAL&gt; ) &lt;RIGHTPAREN&gt; )* )? &lt;RIGHTPAREN&gt; ) ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod24">NodegroupDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if not exists" )? "on" &lt;IDENTIFIER&gt; ( "," &lt;IDENTIFIER&gt; )* ";"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod25">TypeDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ( "if not exists" )? "as" ( <A HREF="#prod26">TypeExpr</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod26">TypeExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod27">RecordTypeDef</A> | <A HREF="#prod28">TypeReference</A> | <A HREF="#prod29">OrderedListTypeDef</A> | <A HREF="#prod30">UnorderedListTypeDef</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod27">RecordTypeDef</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( "closed" | "open" )? "{" ( <A HREF="#prod31">RecordField</A> ( "," <A HREF="#prod31">RecordField</A> )* )? "}"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod31">RecordField</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; ":" ( <A HREF="#prod26">TypeExpr</A> ) ( "?" )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod28">TypeReference</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod29">OrderedListTypeDef</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"[" ( <A HREF="#prod26">TypeExpr</A> ) "]"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod30">UnorderedListTypeDef</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"&lt;" ( <A HREF="#prod26">TypeExpr</A> ) "&gt;"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod32">FunctionDeclaration</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;IDENTIFIER&gt; &lt;LEFTPAREN&gt; ( &lt;VARIABLE&gt; ( "," &lt;VARIABLE&gt; )* )? &lt;RIGHTPAREN&gt; "{" <A HREF="#prod6">Expression</A> "}"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod2">Query</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod6">Expression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod33">OperatorExpr</A> | <A HREF="#prod34">IfThenElse</A> | <A HREF="#prod35">FLWOGR</A> | <A HREF="#prod36">QuantifiedExpression</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod33">OperatorExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod37">AndExpr</A> ( "or" <A HREF="#prod37">AndExpr</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod37">AndExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod38">RelExpr</A> ( "and" <A HREF="#prod38">RelExpr</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod38">RelExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod39">AddExpr</A> ( ( "&lt;" | "&gt;" | "&lt;=" | "&gt;=" | "=" | "!=" | "~=" ) <A HREF="#prod39">AddExpr</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod39">AddExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod40">MultExpr</A> ( ( "+" | "-" ) <A HREF="#prod40">MultExpr</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod40">MultExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod41">UnionExpr</A> ( ( "*" | "/" | "%" | &lt;CARET&gt; | "idiv" ) <A HREF="#prod41">UnionExpr</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod41">UnionExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod42">UnaryExpr</A> ( "union" ( <A HREF="#prod42">UnaryExpr</A> ) )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod42">UnaryExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "+" | "-" ) )? <A HREF="#prod43">ValueExpr</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod43">ValueExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod44">FieldOrIndexAccessor</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod44">FieldOrIndexAccessor</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod45">PrimaryExpr</A> ) ( ( <A HREF="#prod46">Field</A> ) | ( <A HREF="#prod47">Index</A> ) )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod46">Field</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"." &lt;IDENTIFIER&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod47">Index</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"[" ( <A HREF="#prod6">Expression</A> | "?" ) "]"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod45">PrimaryExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod48">Literal</A> | <A HREF="#prod49">FunctionCallExpr</A> | <A HREF="#prod50">VariableRef</A> | <A HREF="#prod51">ListConstructor</A> | <A HREF="#prod52">RecordConstructor</A> | <A HREF="#prod53">ParenthesizedExpression</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod48">Literal</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;STRING_LITERAL&gt; | &lt;INTEGER_LITERAL&gt; | &lt;FLOAT_LITERAL&gt; | &lt;DOUBLE_LITERAL&gt; | &lt;NULL&gt; | &lt;TRUE&gt; | &lt;FALSE&gt; )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod50">VariableRef</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;VARIABLE&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod5">Variable</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;VARIABLE&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod51">ListConstructor</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod54">OrderedListConstructor</A> | <A HREF="#prod55">UnorderedListConstructor</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod54">OrderedListConstructor</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"[" ( <A HREF="#prod6">Expression</A> ( "," <A HREF="#prod6">Expression</A> )* )? "]"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod55">UnorderedListConstructor</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"&lt;" ( <A HREF="#prod6">Expression</A> ( "," <A HREF="#prod6">Expression</A> )* )? "&gt;"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod52">RecordConstructor</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"{" ( <A HREF="#prod56">FieldBinding</A> ( "," <A HREF="#prod56">FieldBinding</A> )* )? "}"</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod56">FieldBinding</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE><A HREF="#prod6">Expression</A> ":" <A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod49">FunctionCallExpr</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( &lt;IDENTIFIER&gt; | &lt;DATASET&gt; ) &lt;LEFTPAREN&gt; ( <A HREF="#prod6">Expression</A> ( "," <A HREF="#prod6">Expression</A> )* )? &lt;RIGHTPAREN&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod53">ParenthesizedExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>&lt;LEFTPAREN&gt; <A HREF="#prod6">Expression</A> &lt;RIGHTPAREN&gt;</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod34">IfThenElse</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"if" &lt;LEFTPAREN&gt; <A HREF="#prod6">Expression</A> &lt;RIGHTPAREN&gt; "then" <A HREF="#prod6">Expression</A> "else" <A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod35">FLWOGR</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod57">ForClause</A> | <A HREF="#prod58">LetClause</A> ) ( <A HREF="#prod59">Clause</A> )* "return" <A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod59">Clause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( <A HREF="#prod57">ForClause</A> | <A HREF="#prod58">LetClause</A> | <A HREF="#prod60">WhereClause</A> | <A HREF="#prod61">OrderbyClause</A> | <A HREF="#prod62">GroupClause</A> | <A HREF="#prod63">LimitClause</A> | <A HREF="#prod64">DistinctClause</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod57">ForClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"for" <A HREF="#prod5">Variable</A> ( "at" <A HREF="#prod5">Variable</A> )? "in" ( <A HREF="#prod6">Expression</A> )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod58">LetClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"let" <A HREF="#prod5">Variable</A> ":=" <A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod60">WhereClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"where" <A HREF="#prod6">Expression</A></TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod61">OrderbyClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( "order" "by" <A HREF="#prod6">Expression</A> ( ( "asc" ) | ( "desc" ) )? ( "," <A HREF="#prod6">Expression</A> ( ( "asc" ) | ( "desc" ) )? )* )</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod62">GroupClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"group" "by" ( <A HREF="#prod5">Variable</A> ":=" )? <A HREF="#prod6">Expression</A> ( "," ( <A HREF="#prod5">Variable</A> ":=" )? <A HREF="#prod6">Expression</A> )* ( "decor" <A HREF="#prod5">Variable</A> ":=" <A HREF="#prod6">Expression</A> ( "," "decor" <A HREF="#prod5">Variable</A> ":=" <A HREF="#prod6">Expression</A> )* )? "with" <A HREF="#prod50">VariableRef</A> ( "," <A HREF="#prod50">VariableRef</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod63">LimitClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"limit" <A HREF="#prod6">Expression</A> ( "offset" <A HREF="#prod6">Expression</A> )?</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod64">DistinctClause</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>"distinct" "by" <A HREF="#prod6">Expression</A> ( "," <A HREF="#prod6">Expression</A> )*</TD>
</TR>
<TR>
<TD ALIGN=RIGHT VALIGN=BASELINE><A NAME="prod36">QuantifiedExpression</A></TD>
<TD ALIGN=CENTER VALIGN=BASELINE>::=</TD>
<TD ALIGN=LEFT VALIGN=BASELINE>( ( "some" ) | ( "every" ) ) <A HREF="#prod5">Variable</A> "in" <A HREF="#prod6">Expression</A> ( "," <A HREF="#prod5">Variable</A> "in" <A HREF="#prod6">Expression</A> )* "satisfies" <A HREF="#prod6">Expression</A></TD>
</TR>
</TABLE>
</BODY>
</HTML>