41 lines
935 B
CFEngine3
41 lines
935 B
CFEngine3
|
layout toplevel ;
|
|||
|
layout "let" ;
|
|||
|
layout stop "in" ;
|
|||
|
|
|||
|
entrypoints [Def], Exp ;
|
|||
|
|
|||
|
token Id ((letter|digit|["[]_"])+) ;
|
|||
|
|
|||
|
comment "--" ;
|
|||
|
comment "{-" "-}" ;
|
|||
|
|
|||
|
Assign. Assign ::= Id ":=" Exp ;
|
|||
|
separator nonempty Assign ";" ;
|
|||
|
|
|||
|
BD. BE ::= Id
|
|||
|
BD. BI ::= "{" Id "}"
|
|||
|
separator nonempty BD "" ;
|
|||
|
|
|||
|
ExpPiE. Exp ::= "Π" "(" Id ":" Exp ")" Exp
|
|||
|
ExpPiI. Exp ::= "Π" "{" Id ":" Exp "}" Exp
|
|||
|
ExpSig. Exp ::= "Σ" "(" Id ":" Exp ")" Exp
|
|||
|
ExpLet. Exp ::= "let" "{" [Assign] "}" "in" Exp
|
|||
|
ExpLam. Exp ::= "λ" [BD] "." Exp
|
|||
|
ExpVar. Exp ::= Id
|
|||
|
ExpT0. Exp ::= "⊥"
|
|||
|
ExpT1. Exp ::= "⊤"
|
|||
|
ExpT1tr. Exp ::= "⋆"
|
|||
|
ExpTNat. Exp ::= "ℕ"
|
|||
|
ExpTZero. Exp ::= "0"
|
|||
|
ExpTSuc. Exp ::= "S"
|
|||
|
ExpTBool. Exp ::= "𝔹"
|
|||
|
ExpTTrue. Exp ::= "T"
|
|||
|
ExpTFalse. Exp ::= "F"
|
|||
|
ExpTPair. Exp ::= "⟨" Exp , Exp "⟩"
|
|||
|
ExpTFst. Exp ::= "pr₁"
|
|||
|
ExpTSnd. Exp ::= "pr₂"
|
|||
|
ExpApp. Exp ::= Exp Exp
|
|||
|
|
|||
|
VarDef. Def ::= "def" Id ":" Exp ":=" Exp
|
|||
|
|
|||
|
seperator Def ";"
|