m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/schmim.bnfc
diff options
context:
space:
mode:
Diffstat (limited to 'schmim.bnfc')
-rw-r--r--schmim.bnfc51
1 files changed, 51 insertions, 0 deletions
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 ";";