Added grammar for case matching.
This commit is contained in:
parent
a4c12ede79
commit
18e0a92fe0
1 changed files with 4 additions and 2 deletions
|
|
@ -7,11 +7,13 @@ ELet. Exp3 ::= "let" Bind "in" Exp;
|
|||
EApp. Exp2 ::= Exp2 Exp3;
|
||||
EAdd. Exp1 ::= Exp1 "+" Exp2;
|
||||
EAbs. Exp ::= "\\" Ident ":" Type "." Exp;
|
||||
ECase. Exp ::= "case" Exp "of" "{" [CaseMatch] "}";
|
||||
ECase. Exp ::= "case" Exp "of" "{" [CaseMatch] "}" ":" Type;
|
||||
CaseMatch. CaseMatch ::= Case "=>" Exp ;
|
||||
separator CaseMatch ",";
|
||||
|
||||
CInt. Case ::= Integer ;
|
||||
|
||||
CInt. Case ::= Integer ;
|
||||
CatchAll. Case ::= "_" ;
|
||||
|
||||
Bind. Bind ::= Ident ":" Type ";"
|
||||
Ident [Ident] "=" Exp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue