adapted new tree to fuck with samuel

This commit is contained in:
sebastianselander 2023-03-24 16:10:25 +01:00
parent 50bea83a18
commit 38680a4dcb
2 changed files with 59 additions and 26 deletions

View file

@ -45,30 +45,31 @@ Data. Data ::= "data" Type "where" "{" [Constructor] "}" ;
EAnn. Exp5 ::= "(" Exp ":" Type ")" ;
EVar. Exp4 ::= LIdent ;
ECons. Exp4 ::= UIdent ;
EInj. Exp4 ::= UIdent ;
ELit. Exp4 ::= Lit ;
EApp. Exp3 ::= Exp3 Exp4 ;
EAdd. Exp1 ::= Exp1 "+" Exp2 ;
ELet. Exp ::= "let" Bind "in" Exp ;
EAbs. Exp ::= "\\" LIdent "." Exp ;
ECase. Exp ::= "case" Exp "of" "{" [Inj] "}";
ECase. Exp ::= "case" Exp "of" "{" [Branch] "}";
-------------------------------------------------------------------------------
-- * LITERALS
-------------------------------------------------------------------------------
LInt. Lit ::= Integer ;
LInt. Lit ::= Integer ;
LChar. Lit ::= Char ;
-------------------------------------------------------------------------------
-- * CASE
-------------------------------------------------------------------------------
Inj. Inj ::= Init "=>" Exp ;
Branch. Branch ::= Pattern "=>" Exp ;
InitLit. Init ::= Lit ;
InitConstructor. Init ::= UIdent [LIdent] ;
InitCatch. Init ::= "_" ;
PVar. Pattern ::= LIdent ;
PLit. Pattern ::= Lit ;
PInj. Pattern ::= UIdent [Pattern] ;
PCatch. Pattern ::= "_" ;
-------------------------------------------------------------------------------
-- * AUX
@ -77,7 +78,8 @@ InitCatch. Init ::= "_" ;
separator Def ";" ;
separator nonempty Constructor "" ;
separator Type " " ;
separator nonempty Inj ";" ;
separator Pattern " " ;
separator Branch "," ;
separator Ident " ";
separator LIdent " ";
separator TVar " " ;