work on BNFC dune integration

This commit is contained in:
Rachel Lambda Samuelsson 2023-01-25 22:20:13 +01:00
parent 00667c11af
commit 60890cbdd9
2 changed files with 32 additions and 31 deletions

View File

@ -1,2 +1,10 @@
(ocamllex "LexImplicitt")
(ocamlyacc "ParImplicitt")
(env
(dev
(flags (:standard -warn-error -A))))
(library (library
(name Raw)) (name Raw)
(modules "AbsImplicitt" "BNFC_Util" "LexImplicitt" "ParImplicitt"))

View File

@ -1,7 +1,3 @@
layout toplevel ;
layout "let" ;
layout stop "in" ;
entrypoints [Def], Exp ; entrypoints [Def], Exp ;
token Id ((letter|digit|["[]_"])+) ; token Id ((letter|digit|["[]_"])+) ;
@ -9,33 +5,30 @@ token Id ((letter|digit|["[]_"])+) ;
comment "--" ; comment "--" ;
comment "{-" "-}" ; comment "{-" "-}" ;
Assign. Assign ::= Id ":=" Exp ; BE. BD ::= Id;
separator nonempty Assign ";" ; BI. BD ::= "{" Id "}";
BD. BE ::= Id
BD. BI ::= "{" Id "}"
separator nonempty BD "" ; separator nonempty BD "" ;
ExpPiE. Exp ::= "Π" "(" Id ":" Exp ")" Exp ExpPiE. Exp ::= "Π" "(" Id ":" Exp ")" Exp;
ExpPiI. Exp ::= "Π" "{" Id ":" Exp "}" Exp ExpPiI. Exp ::= "Π" "{" Id ":" Exp "}" Exp;
ExpSig. Exp ::= "Σ" "(" Id ":" Exp ")" Exp ExpSig. Exp ::= "Σ" "(" Id ":" Exp ")" Exp;
ExpLet. Exp ::= "let" "{" [Assign] "}" "in" Exp ExpLet. Exp ::= "let" Id ":" Exp ":=" Exp "in" Exp;
ExpLam. Exp ::= "λ" [BD] "." Exp ExpLam. Exp ::= "λ" [BD] "." Exp;
ExpVar. Exp ::= Id ExpApp. Exp1 ::= Exp1 Exp2;
ExpT0. Exp ::= "" ExpVar. Exp2 ::= Id;
ExpT1. Exp ::= "" ExpT0. Exp2 ::= "";
ExpT1tr. Exp ::= "" ExpT1. Exp2 ::= "";
ExpTNat. Exp ::= "" ExpT1tr. Exp2 ::= "";
ExpTZero. Exp ::= "0" ExpTNat. Exp2 ::= "";
ExpTSuc. Exp ::= "S" ExpTZero. Exp2 ::= "0";
ExpTBool. Exp ::= "𝔹" ExpTSuc. Exp2 ::= "S";
ExpTTrue. Exp ::= "T" ExpTBool. Exp2 ::= "𝔹";
ExpTFalse. Exp ::= "F" ExpTTrue. Exp2 ::= "T";
ExpTPair. Exp ::= "" Exp , Exp "" ExpTFalse. Exp2 ::= "F";
ExpTFst. Exp ::= "pr" ExpTPair. Exp2 ::= "" Exp "," Exp "";
ExpTSnd. Exp ::= "pr" ExpTFst. Exp2 ::= "pr";
ExpApp. Exp ::= Exp Exp ExpTSnd. Exp2 ::= "pr";
VarDef. Def ::= "def" Id ":" Exp ":=" Exp VarDef. Def ::= "def" Id ":" Exp ":=" Exp;
seperator Def ";" separator Def ";" ;