Skip to content

Commit

Permalink
Remove grammar duplication (#62)
Browse files Browse the repository at this point in the history
Summary:
It seems that there is an unnecessary grammar duplication that this pull request removes.

Pull Request resolved: #62

Test Plan:
test.sh
cov.sh

Reviewed By: Strafos

Differential Revision: D29685105

Pulled By: ricomariani

fbshipit-source-id: 8e90c1aa2a08cb869b02da7961936a361e35d9b6
  • Loading branch information
mingodad authored and facebook-github-bot committed Jul 15, 2021
1 parent 9185fc8 commit 3610bed
Show file tree
Hide file tree
Showing 18 changed files with 628 additions and 536 deletions.
75 changes: 32 additions & 43 deletions CQL_Guide/generated/guide.html
Expand Up @@ -6516,7 +6516,7 @@ <h2 id="appendix-2-cql-grammar">Appendix 2: CQL Grammar</h2>
-- LICENSE file in the root directory of this source tree.
-->
<p>What follows is taken from a grammar snapshot with the tree building rules removed. It should give a fair sense of the syntax of CQL (but not semantic validation).</p>
<p>Snapshot as of Wed Jul 14 14:22:34 PDT 2021</p>
<p>Snapshot as of Wed Jul 14 17:40:21 PDT 2021</p>
<h3 id="operators-and-literals">Operators and Literals</h3>
<p>These are in order of priority lowest to highest</p>
<pre><code>UNION_ALL UNION INTERSECT EXCEPT
Expand Down Expand Up @@ -7055,6 +7055,11 @@ <h3 id="rules">Rules</h3>
| &#39;(&#39; select_stmt &quot;IF&quot; &quot;NOTHING&quot; &quot;OR&quot; &quot;NULL&quot; expr &#39;)&#39;
| &#39;(&#39; select_stmt &quot;IF&quot; &quot;NOTHING&quot; &quot;THROW&quot;&#39;)&#39;
| &quot;EXISTS&quot; &#39;(&#39; select_stmt &#39;)&#39;
| &quot;CASE&quot; expr case_list &quot;END&quot;
| &quot;CASE&quot; expr case_list &quot;ELSE&quot; expr &quot;END&quot;
| &quot;CASE&quot; case_list &quot;END&quot;
| &quot;CASE&quot; case_list &quot;ELSE&quot; expr &quot;END&quot;
| &quot;CAST&quot; &#39;(&#39; expr &quot;AS&quot; data_type_any &#39;)&#39;
;

math_expr:
Expand All @@ -7069,53 +7074,37 @@ <h3 id="rules">Rules</h3>
| math_expr &#39;/&#39; math_expr
| math_expr &#39;%&#39; math_expr
| &#39;-&#39; math_expr
| &#39;~&#39; math_expr
| &quot;NOT&quot; math_expr
| math_expr &#39;=&#39; math_expr
| math_expr &quot;==&quot; math_expr
| math_expr &#39;&lt;&#39; math_expr
| math_expr &#39;&gt;&#39; math_expr
| math_expr &quot;&lt;&gt;&quot; math_expr
| math_expr &quot;!=&quot; math_expr
| math_expr &quot;&gt;=&quot; math_expr
| math_expr &quot;&lt;=&quot; math_expr
| math_expr &quot;NOT&quot; &quot;IN&quot; &#39;(&#39; expr_list &#39;)&#39;
| math_expr &quot;NOT&quot; &quot;IN&quot; &#39;(&#39; select_stmt &#39;)&#39;
| math_expr &quot;IN&quot; &#39;(&#39; expr_list &#39;)&#39;
| math_expr &quot;IN&quot; &#39;(&#39; select_stmt &#39;)&#39;
| math_expr &quot;LIKE&quot; math_expr
| math_expr &quot;NOT LIKE&quot; math_expr
| math_expr &quot;MATCH&quot; math_expr
| math_expr &quot;REGEXP&quot; math_expr
| math_expr &quot;GLOB&quot; math_expr
| math_expr &quot;NOT&quot; &quot;BETWEEN&quot; math_expr &quot;AND&quot; math_expr
| math_expr &quot;BETWEEN&quot; math_expr &quot;AND&quot; math_expr
| math_expr &quot;IS NOT&quot; math_expr
| math_expr &quot;IS&quot; math_expr
| math_expr &quot;||&quot; math_expr
;

expr:
basic_expr
| expr &#39;&amp;&#39; expr
| expr &#39;|&#39; expr
| expr &quot;&lt;&lt;&quot; expr
| expr &quot;&gt;&gt;&quot; expr
| expr &#39;+&#39; expr
| expr &#39;-&#39; expr
| expr &#39;*&#39; expr
| expr &#39;/&#39; expr
| expr &#39;%&#39; expr
| &#39;-&#39; expr
| &quot;NOT&quot; expr
| &#39;~&#39; expr
| expr &quot;COLLATE&quot; name
math_expr
| expr &quot;AND&quot; expr
| expr &quot;OR&quot; expr
| expr &#39;=&#39; expr
| expr &quot;==&quot; expr
| expr &#39;&lt;&#39; expr
| expr &#39;&gt;&#39; expr
| expr &quot;&lt;&gt;&quot; expr
| expr &quot;!=&quot; expr
| expr &quot;&gt;=&quot; expr
| expr &quot;&lt;=&quot; expr
| expr &quot;NOT&quot; &quot;IN&quot; &#39;(&#39; expr_list &#39;)&#39;
| expr &quot;NOT&quot; &quot;IN&quot; &#39;(&#39; select_stmt &#39;)&#39;
| expr &quot;IN&quot; &#39;(&#39; expr_list &#39;)&#39;
| expr &quot;IN&quot; &#39;(&#39; select_stmt &#39;)&#39;
| expr &quot;LIKE&quot; expr
| expr &quot;NOT LIKE&quot; expr
| expr &quot;MATCH&quot; expr
| expr &quot;REGEXP&quot; expr
| expr &quot;GLOB&quot; expr
| expr &quot;NOT&quot; &quot;BETWEEN&quot; math_expr &quot;AND&quot; math_expr
| expr &quot;BETWEEN&quot; math_expr &quot;AND&quot; math_expr
| expr &quot;IS NOT&quot; expr
| expr &quot;IS&quot; expr
| expr &quot;||&quot; expr
| &quot;CASE&quot; expr case_list &quot;END&quot;
| &quot;CASE&quot; expr case_list &quot;ELSE&quot; expr &quot;END&quot;
| &quot;CASE&quot; case_list &quot;END&quot;
| &quot;CASE&quot; case_list &quot;ELSE&quot; expr &quot;END&quot;
| &quot;CAST&quot; &#39;(&#39; expr &quot;AS&quot; data_type_any &#39;)&#39;
| expr &quot;COLLATE&quot; name
;

case_list:
Expand Down Expand Up @@ -9784,7 +9773,7 @@ <h3 id="cql0408-encode-context-column-can-be-only-specified-once">CQL0408: encod
</table>
<p>– This source code is licensed under the MIT license found in the – LICENSE file in the root directory of this source tree. –&gt;</p>
<p>What follows is taken from the JSON validation grammar with the tree building rules removed.</p>
<p>Snapshot as of Wed Jul 14 14:22:35 PDT 2021</p>
<p>Snapshot as of Wed Jul 14 17:40:22 PDT 2021</p>
<h3 id="rules-1">Rules</h3>
<pre><code>

Expand Down
75 changes: 32 additions & 43 deletions CQL_Guide/generated/guide.md
Expand Up @@ -8387,7 +8387,7 @@ These are the various outputs the compiler can produce.
What follows is taken from a grammar snapshot with the tree building rules removed.
It should give a fair sense of the syntax of CQL (but not semantic validation).

Snapshot as of Wed Jul 14 14:22:34 PDT 2021
Snapshot as of Wed Jul 14 17:40:21 PDT 2021

### Operators and Literals

Expand Down Expand Up @@ -8938,6 +8938,11 @@ basic_expr:
| '(' select_stmt "IF" "NOTHING" "OR" "NULL" expr ')'
| '(' select_stmt "IF" "NOTHING" "THROW"')'
| "EXISTS" '(' select_stmt ')'
| "CASE" expr case_list "END"
| "CASE" expr case_list "ELSE" expr "END"
| "CASE" case_list "END"
| "CASE" case_list "ELSE" expr "END"
| "CAST" '(' expr "AS" data_type_any ')'
;

math_expr:
Expand All @@ -8952,53 +8957,37 @@ math_expr:
| math_expr '/' math_expr
| math_expr '%' math_expr
| '-' math_expr
| '~' math_expr
| "NOT" math_expr
| math_expr '=' math_expr
| math_expr "==" math_expr
| math_expr '<' math_expr
| math_expr '>' math_expr
| math_expr "<>" math_expr
| math_expr "!=" math_expr
| math_expr ">=" math_expr
| math_expr "<=" math_expr
| math_expr "NOT" "IN" '(' expr_list ')'
| math_expr "NOT" "IN" '(' select_stmt ')'
| math_expr "IN" '(' expr_list ')'
| math_expr "IN" '(' select_stmt ')'
| math_expr "LIKE" math_expr
| math_expr "NOT LIKE" math_expr
| math_expr "MATCH" math_expr
| math_expr "REGEXP" math_expr
| math_expr "GLOB" math_expr
| math_expr "NOT" "BETWEEN" math_expr "AND" math_expr
| math_expr "BETWEEN" math_expr "AND" math_expr
| math_expr "IS NOT" math_expr
| math_expr "IS" math_expr
| math_expr "||" math_expr
;

expr:
basic_expr
| expr '&' expr
| expr '|' expr
| expr "<<" expr
| expr ">>" expr
| expr '+' expr
| expr '-' expr
| expr '*' expr
| expr '/' expr
| expr '%' expr
| '-' expr
| "NOT" expr
| '~' expr
| expr "COLLATE" name
math_expr
| expr "AND" expr
| expr "OR" expr
| expr '=' expr
| expr "==" expr
| expr '<' expr
| expr '>' expr
| expr "<>" expr
| expr "!=" expr
| expr ">=" expr
| expr "<=" expr
| expr "NOT" "IN" '(' expr_list ')'
| expr "NOT" "IN" '(' select_stmt ')'
| expr "IN" '(' expr_list ')'
| expr "IN" '(' select_stmt ')'
| expr "LIKE" expr
| expr "NOT LIKE" expr
| expr "MATCH" expr
| expr "REGEXP" expr
| expr "GLOB" expr
| expr "NOT" "BETWEEN" math_expr "AND" math_expr
| expr "BETWEEN" math_expr "AND" math_expr
| expr "IS NOT" expr
| expr "IS" expr
| expr "||" expr
| "CASE" expr case_list "END"
| "CASE" expr case_list "ELSE" expr "END"
| "CASE" case_list "END"
| "CASE" case_list "ELSE" expr "END"
| "CAST" '(' expr "AS" data_type_any ')'
| expr "COLLATE" name
;

case_list:
Expand Down Expand Up @@ -13380,7 +13369,7 @@ CQL 0410 : unused, this was added to prevent merge conflicts at the end on liter

What follows is taken from the JSON validation grammar with the tree building rules removed.

Snapshot as of Wed Jul 14 14:22:35 PDT 2021
Snapshot as of Wed Jul 14 17:40:22 PDT 2021

### Rules

Expand Down
73 changes: 31 additions & 42 deletions CQL_Guide/x2.md
Expand Up @@ -13,7 +13,7 @@ sidebar_label: "Appendix 2: CQL Grammar"
What follows is taken from a grammar snapshot with the tree building rules removed.
It should give a fair sense of the syntax of CQL (but not semantic validation).

Snapshot as of Wed Jul 14 14:22:34 PDT 2021
Snapshot as of Wed Jul 14 17:40:21 PDT 2021

### Operators and Literals

Expand Down Expand Up @@ -564,6 +564,11 @@ basic_expr:
| '(' select_stmt "IF" "NOTHING" "OR" "NULL" expr ')'
| '(' select_stmt "IF" "NOTHING" "THROW"')'
| "EXISTS" '(' select_stmt ')'
| "CASE" expr case_list "END"
| "CASE" expr case_list "ELSE" expr "END"
| "CASE" case_list "END"
| "CASE" case_list "ELSE" expr "END"
| "CAST" '(' expr "AS" data_type_any ')'
;
math_expr:
Expand All @@ -578,53 +583,37 @@ math_expr:
| math_expr '/' math_expr
| math_expr '%' math_expr
| '-' math_expr
| '~' math_expr
| "NOT" math_expr
| math_expr '=' math_expr
| math_expr "==" math_expr
| math_expr '<' math_expr
| math_expr '>' math_expr
| math_expr "<>" math_expr
| math_expr "!=" math_expr
| math_expr ">=" math_expr
| math_expr "<=" math_expr
| math_expr "NOT" "IN" '(' expr_list ')'
| math_expr "NOT" "IN" '(' select_stmt ')'
| math_expr "IN" '(' expr_list ')'
| math_expr "IN" '(' select_stmt ')'
| math_expr "LIKE" math_expr
| math_expr "NOT LIKE" math_expr
| math_expr "MATCH" math_expr
| math_expr "REGEXP" math_expr
| math_expr "GLOB" math_expr
| math_expr "NOT" "BETWEEN" math_expr "AND" math_expr
| math_expr "BETWEEN" math_expr "AND" math_expr
| math_expr "IS NOT" math_expr
| math_expr "IS" math_expr
| math_expr "||" math_expr
;
expr:
basic_expr
| expr '&' expr
| expr '|' expr
| expr "<<" expr
| expr ">>" expr
| expr '+' expr
| expr '-' expr
| expr '*' expr
| expr '/' expr
| expr '%' expr
| '-' expr
| "NOT" expr
| '~' expr
| expr "COLLATE" name
math_expr
| expr "AND" expr
| expr "OR" expr
| expr '=' expr
| expr "==" expr
| expr '<' expr
| expr '>' expr
| expr "<>" expr
| expr "!=" expr
| expr ">=" expr
| expr "<=" expr
| expr "NOT" "IN" '(' expr_list ')'
| expr "NOT" "IN" '(' select_stmt ')'
| expr "IN" '(' expr_list ')'
| expr "IN" '(' select_stmt ')'
| expr "LIKE" expr
| expr "NOT LIKE" expr
| expr "MATCH" expr
| expr "REGEXP" expr
| expr "GLOB" expr
| expr "NOT" "BETWEEN" math_expr "AND" math_expr
| expr "BETWEEN" math_expr "AND" math_expr
| expr "IS NOT" expr
| expr "IS" expr
| expr "||" expr
| "CASE" expr case_list "END"
| "CASE" expr case_list "ELSE" expr "END"
| "CASE" case_list "END"
| "CASE" case_list "ELSE" expr "END"
| "CAST" '(' expr "AS" data_type_any ')'
| expr "COLLATE" name
;
case_list:
Expand Down
2 changes: 1 addition & 1 deletion CQL_Guide/x5.md
Expand Up @@ -12,7 +12,7 @@ sidebar_label: "Appendix 5: JSON Schema Grammar"

What follows is taken from the JSON validation grammar with the tree building rules removed.

Snapshot as of Wed Jul 14 14:22:35 PDT 2021
Snapshot as of Wed Jul 14 17:40:22 PDT 2021

### Rules

Expand Down

0 comments on commit 3610bed

Please sign in to comment.