churf/Grammar.cf
2023-02-06 15:44:54 +01:00

27 lines
No EOL
595 B
CFEngine3

Program. Program ::= [Def] ;
DExp. Def ::= Ident ":" Type
Ident [Ident] "=" Exp ";" ;
separator Def "";
separator Ident "";
separator Type "->";
EId. Exp3 ::= Ident ;
EInt. Exp3 ::= Integer ;
EApp. Exp2 ::= Exp2 Exp3 ;
EAdd. Exp1 ::= Exp1 "+" Exp2 ;
ESub. Exp1 ::= Exp1 "-" Exp2 ;
EMul. Exp2 ::= Exp2 "*" Exp3 ;
EDiv. Exp2 ::= Exp2 "/" Exp3 ;
EMod. Exp2 ::= Exp2 "%" Exp3 ;
EAbs. Exp ::= "\\" Ident ":" Type "." Exp ;
coercions Exp 3 ;
TInt. Type1 ::= "Int" ;
TPol. Type1 ::= Ident ;
TFun. Type ::= Type "->" Type1;
coercions Type 1 ;
comment "--" ;
comment "{-" "-}" ;