Implement basic interpreted language

This commit is contained in:
Martin Fredin 2023-01-20 14:12:04 +01:00
parent d28aa9fc5d
commit 64ee4dc432
12 changed files with 559 additions and 1 deletions

15
Grammar.cf Normal file
View file

@ -0,0 +1,15 @@
Program. Program ::= "main" "=" Exp ;
EId. Exp3 ::= Ident ;
EInt. Exp3 ::= Integer ;
EApp. Exp2 ::= Exp2 Exp3 ;
EAdd. Exp1 ::= Exp1 "+" Exp2 ;
EAbs. Exp ::= "\\" Ident "->" Exp ;
coercions Exp 3 ;
comment "--" ;
comment "{-" "-}" ;