From bdc72de514f63440a634d011faedfbeef770ed1f Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sun, 13 May 2018 19:51:07 +0200 Subject: Initial commit --- schmim.bnfc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 schmim.bnfc (limited to 'schmim.bnfc') diff --git a/schmim.bnfc b/schmim.bnfc new file mode 100644 index 0000000..6fe294a --- /dev/null +++ b/schmim.bnfc @@ -0,0 +1,51 @@ +ENum. Exp ::= Integer; +EVar. Exp ::= Ident; +EAbs. Exp ::= "(" "lambda" Ident ":" Type Exp ")"; +EApp. Exp ::= "("Exp [Exp]")"; +ETr. Exp ::= "true"; +EFl. Exp ::= "false"; +EAdd. Exp ::= "(" "+" Exp Exp")"; +ESub. Exp ::= "(" "-" Exp Exp")"; +EMul. Exp ::= "(" "*" Exp Exp")"; +EDiv. Exp ::= "(" "/" Exp Exp")"; +EEq. Exp ::= "(" "=" Exp Exp")"; +ELeq. Exp ::= "(" "<=" Exp Exp")"; +EGeq. Exp ::= "(" ">=" Exp Exp")"; +ELess. Exp ::= "(" "<" Exp Exp")"; +EGrt. Exp ::= "(" ">" Exp Exp")"; +EAnd. Exp ::= "(" "and" Exp Exp")"; +EOr. Exp ::= "(" "or" Exp Exp")"; +ENot. Exp ::= "(" "not" Exp")"; +EIfte. Exp ::= "(" "if" Exp Exp Exp")"; +ELet. Exp ::= "(" "let" "("Ident [Param]")" Exp Exp")"; +ELetrec. Exp ::= "(" "letrec" "("Ident ":" Type [Param]")" Exp Exp")"; +EVrnt. Exp ::= "<" Ident Exp ">" ":" Type; +EMtch. Exp ::= "(" "match" Exp [Matching]")"; +ETpl. Exp ::= "{" [Exp] "}"; +EProj. Exp ::= Exp "." Integer; +ENil. Exp ::= "nil" ":" Type; +EIsnil. Exp ::= "(" "isnil" Exp")"; +ECons. Exp ::= "(" "cons" Exp Exp")"; +EHead. Exp ::= "(" "head" Exp")"; +ETail. Exp ::= "(" "tail" Exp")"; +EFix. Exp ::= "(" "fix" Exp")"; +separator Exp ""; + +Param. Param ::= Ident ":" Type; +separator Param ""; +Matching. Matching ::= "(<" Ident Ident ">" Exp ")"; +separator Matching ""; + +_. Type ::= "(" Type ")"; +TBool. Type ::= "Bool"; +TInt. Type ::= "Int"; +TFun. Type ::= Type "->" Type; +TVrnt. Type ::= "<" [Labeled] ">"; +TTpl. Type ::= "{" [Type] "}"; +TList. Type ::= "[" Type "]"; +separator Type ""; + +Labeled. Labeled ::= Ident ":" Type; +separator Labeled ""; + +comment ";"; -- cgit v1.2.3