Added some missing math operators
This commit is contained in:
parent
026949ae7e
commit
66fb77c84e
25 changed files with 728 additions and 427 deletions
11
Grammar.cf
11
Grammar.cf
|
|
@ -2,14 +2,17 @@
|
|||
|
||||
Program. Program ::= "main" "=" Exp ;
|
||||
|
||||
EId. Exp3 ::= Ident ;
|
||||
EInt. Exp3 ::= Integer ;
|
||||
EAbs. Exp ::= "\\" Ident "->" Exp ;
|
||||
EApp. Exp2 ::= Exp2 Exp3 ;
|
||||
EAdd. Exp1 ::= Exp1 "+" Exp2 ;
|
||||
ESub. Exp1 ::= Exp1 "-" Exp2 ;
|
||||
EAbs. Exp ::= "\\" Ident "->" Exp ;
|
||||
EMul. Exp2 ::= Exp2 "*" Exp3 ;
|
||||
EDiv. Exp2 ::= Exp2 "/" Exp3 ;
|
||||
EMod. Exp2 ::= Exp2 "%" Exp3 ;
|
||||
EId. Exp4 ::= Ident ;
|
||||
EInt. Exp4 ::= Integer ;
|
||||
|
||||
coercions Exp 3 ;
|
||||
coercions Exp 4 ;
|
||||
|
||||
comment "--" ;
|
||||
comment "{-" "-}" ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue