Implement basic interpreted language
This commit is contained in:
parent
d28aa9fc5d
commit
64ee4dc432
12 changed files with 559 additions and 1 deletions
15
Grammar.cf
Normal file
15
Grammar.cf
Normal 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 "{-" "-}" ;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue