Change grammar: only one bind in let and no EAnn for typed syntax

This commit is contained in:
Martin Fredin 2023-02-18 12:57:23 +01:00
parent 7cedc2e28c
commit a3e57dde7b
7 changed files with 172 additions and 228 deletions

View file

@ -1,24 +1,20 @@
Program. Program ::= [Bind];
EId. Exp3 ::= Ident;
EInt. Exp3 ::= Integer;
ELet. Exp3 ::= "let" [Bind] "in" Exp;
EApp. Exp2 ::= Exp2 Exp3;
EAdd. Exp1 ::= Exp1 "+" Exp2;
EAbs. Exp ::= "\\" Ident ":" Type "." Exp;
EAnn. Exp3 ::= "(" Exp ":" Type ")";
EId. Exp3 ::= Ident;
EInt. Exp3 ::= Integer;
EAnn. Exp3 ::= "(" Exp ":" Type ")";
ELet. Exp3 ::= "let" Bind "in" Exp;
EApp. Exp2 ::= Exp2 Exp3;
EAdd. Exp1 ::= Exp1 "+" Exp2;
EAbs. Exp ::= "\\" Ident ":" Type "." Exp;
ECase. Exp ::= "case" Exp "of" "{" [CaseMatch] "}";
--
CaseMatch. CaseMatch ::= Case "=>" Exp ;
separator CaseMatch ",";
--terminator CaseMatch ".";
CInt. Case ::= Integer ;
Bind. Bind ::= Ident ":" Type ";"
Ident [Ident] "=" Exp ;
Ident [Ident] "=" Exp;
separator Bind ";";
separator Ident "";
@ -31,4 +27,4 @@ TFun. Type ::= Type1 "->" Type ;
coercions Type 1 ;
comment "--";
comment "{-" "-}";
comment "{-" "-}";