I hate grammers
This commit is contained in:
parent
96787c4aad
commit
60f620c00e
2
bin/dune
2
bin/dune
|
@ -1,4 +1,4 @@
|
||||||
(executable
|
(executable
|
||||||
(public_name implicitt)
|
(public_name implicitt)
|
||||||
(name main)
|
(name main)
|
||||||
(libraries implicitt))
|
(libraries Core Raw Parse))
|
||||||
|
|
4
lib/Parse/PostProcess.ml
Normal file
4
lib/Parse/PostProcess.ml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
open Raw
|
||||||
|
|
||||||
|
module A = AbsImplicitt
|
||||||
|
module R = RawSyntax
|
|
@ -1,10 +1,12 @@
|
||||||
(library
|
(library
|
||||||
(name Parse)
|
(name Parse)
|
||||||
|
(libraries Raw)
|
||||||
(flags (:standard -w -27 -w -39 -w -33)))
|
(flags (:standard -w -27 -w -39 -w -33)))
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(alias bnfc)
|
|
||||||
(deps "implicitt.cf")
|
(deps "implicitt.cf")
|
||||||
(targets AbsImplicitt.ml BNFC_Util.ml LexImplicitt.mll ParImplicitt.mly PrintImplicitt.ml ShowImplicitt.ml SkelImplicitt.ml TestImplicitt.ml)
|
(targets AbsImplicitt.ml BNFC_Util.ml LexImplicitt.mll ParImplicitt.mly PrintImplicitt.ml ShowImplicitt.ml SkelImplicitt.ml TestImplicitt.ml)
|
||||||
(action (run bnfc --ocaml %{deps})))
|
(action (run bnfc --ocaml %{deps})))
|
||||||
|
|
||||||
(ocamllex LexImplicitt)
|
(ocamllex LexImplicitt)
|
||||||
(ocamlyacc ParImplicitt)
|
(ocamlyacc ParImplicitt)
|
||||||
|
|
|
@ -13,48 +13,50 @@ NImp. Name ::= "{" Id "}";
|
||||||
NExp. Name ::= Id;
|
NExp. Name ::= Id;
|
||||||
separator nonempty Name "" ;
|
separator nonempty Name "" ;
|
||||||
|
|
||||||
-- Term 2
|
-- Term 3
|
||||||
TVar. Term2 ::= Id;
|
TType. Term3 ::= "Type";
|
||||||
|
|
||||||
TType. Term2 ::= "Type";
|
TT0. Term3 ::= "𝟘";
|
||||||
|
TInd0. Term3 ::= "𝟘-elim";
|
||||||
|
|
||||||
TT0. Term2 ::= "𝟘";
|
TT1. Term3 ::= "𝟙";
|
||||||
|
TT1tr. Term3 ::= "★";
|
||||||
|
|
||||||
TT1. Term2 ::= "𝟙";
|
TBool. Term3 ::= "𝟚";
|
||||||
TT1tr. Term2 ::= "★";
|
TTrue. Term3 ::= "true";
|
||||||
|
TFalse. Term3 ::= "false";
|
||||||
|
TIndB. Term3 ::= "𝟚-elim";
|
||||||
|
|
||||||
TBool. Term2 ::= "𝟚";
|
TNat. Term3 ::= "ℕ";
|
||||||
TTrue. Term2 ::= "true";
|
TZero. Term3 ::= "0";
|
||||||
TFalse. Term2 ::= "false";
|
TSuc. Term3 ::= "suc";
|
||||||
|
TIndN. Term3 ::= "ℕ-elim";
|
||||||
|
|
||||||
TNat. Term2 ::= "ℕ";
|
TFst. Term3 ::= "pr₁";
|
||||||
TZero. Term2 ::= "0";
|
TSnd. Term3 ::= "pr₂";
|
||||||
|
|
||||||
TLam. Term2 ::= "λ" [Name] "." Term;
|
TLam. Term3 ::= "λ" [Name] "." Term;
|
||||||
|
|
||||||
|
TVar. Term3 ::= Id;
|
||||||
|
|
||||||
|
-- Term2
|
||||||
|
|
||||||
|
TAppEx. Term2 ::= Term2 Term3;
|
||||||
|
TAppIm. Term2 ::= Term2 "{" Term "}";
|
||||||
|
|
||||||
-- Term1
|
-- Term1
|
||||||
TInd0. Term1 ::= "𝟘-elim" Term2 Term2;
|
TPiAr. Term1 ::= Term2 "→" Term1;
|
||||||
|
TSgCr. Term1 ::= Term2 "×" Term1;
|
||||||
TIndB. Term1 ::= "𝟚-elim" Term2 Term2 Term2 Term2;
|
|
||||||
|
|
||||||
TSuc. Term1 ::= "suc" Term2;
|
|
||||||
TIndN. Term1 ::= "ℕ-elim" Term2 Term2 Term2 Term2;
|
|
||||||
|
|
||||||
TFst. Term1 ::= "pr₁" Term2;
|
|
||||||
TSnd. Term1 ::= "pr₂" Term2;
|
|
||||||
|
|
||||||
TApp. Term1 ::= Term1 Term2;
|
|
||||||
|
|
||||||
-- Term0
|
-- Term0
|
||||||
TLet. Term ::= "let" Id ":" Term ":=" Term "in" Term ;
|
TLet. Term ::= "let" Id ":" Term ":=" Term "in" Term ;
|
||||||
|
|
||||||
TPiAr. Term ::= Term "→" Term;
|
|
||||||
TPiEx. Term ::= "(" Id ":" Term ")" "→" Term;
|
TPiEx. Term ::= "(" Id ":" Term ")" "→" Term;
|
||||||
TPiIm. Term ::= "{" Id ":" Term "}" "→" Term;
|
TPiIm. Term ::= "{" Id ":" Term "}" "→" Term;
|
||||||
|
|
||||||
TSgCr. Term ::= Term "×" Term;
|
|
||||||
TSg. Term ::= "(" Id ":" Term ")" "×" Term;
|
TSg. Term ::= "(" Id ":" Term ")" "×" Term;
|
||||||
TPair. Term ::= "⟨" Term "," Term "⟩";
|
TPair. Term ::= "⟨" Term "," Term "⟩";
|
||||||
|
|
||||||
|
THole. Term ::= "?";
|
||||||
|
|
||||||
coercions Term 2;
|
coercions Term 3;
|
||||||
|
|
0
lib/Raw/RawSyntax.ml
Normal file
0
lib/Raw/RawSyntax.ml
Normal file
2
lib/Raw/dune
Normal file
2
lib/Raw/dune
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
(library
|
||||||
|
(name Raw))
|
Loading…
Reference in New Issue
Block a user