[Ur] Grammar inconsistencies

Adam Chlipala adamc at impredicative.com
Sat Nov 5 09:41:06 EDT 2011


Ron de Bruijn wrote:
> I made some examples showing some apparent inconsistencies between the 
> documented SQL grammar and the implemented SQL grammar.

Only the second of these prompts a manual tweak, as I see it.

> (* now, pick rule Q -> q -> P -> p,+  , this doesn't work. *)
>
> val notok:transaction (option {T : {A : a, B : b}}) = oneOrNoRows 
> (SELECT t.{{c}},  FROM t)

Section 4.1 of the manual lays out some possibly non-standard 
conventions for interpreting grammar rules.  In particular "e,+" stands 
for a sequence of "e"s separated by commas, not a nonempty sequence of 
"e," units.

> (* let's take another derivation:
> Q -> q -> P -> p -> E AS f
>                .....      .....
>               ..              ....
>             ...                  ..
>            ..                     ...
>          t.{{c}}                    Whatever
>
>
> => t.{{c}} AS MyColumnName is a valid derivation

Good catch.  Fixed by changing the first production of "E".



More information about the Ur mailing list