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 3
|
||||||
|
TType. Term3 ::= "Type";
|
||||||
|
|
||||||
|
TT0. Term3 ::= "𝟘";
|
||||||
|
TInd0. Term3 ::= "𝟘-elim";
|
||||||
|
|
||||||
|
TT1. Term3 ::= "𝟙";
|
||||||
|
TT1tr. Term3 ::= "★";
|
||||||
|
|
||||||
|
TBool. Term3 ::= "𝟚";
|
||||||
|
TTrue. Term3 ::= "true";
|
||||||
|
TFalse. Term3 ::= "false";
|
||||||
|
TIndB. Term3 ::= "𝟚-elim";
|
||||||
|
|
||||||
|
TNat. Term3 ::= "ℕ";
|
||||||
|
TZero. Term3 ::= "0";
|
||||||
|
TSuc. Term3 ::= "suc";
|
||||||
|
TIndN. Term3 ::= "ℕ-elim";
|
||||||
|
|
||||||
|
TFst. Term3 ::= "pr₁";
|
||||||
|
TSnd. Term3 ::= "pr₂";
|
||||||
|
|
||||||
|
TLam. Term3 ::= "λ" [Name] "." Term;
|
||||||
|
|
||||||
|
TVar. Term3 ::= Id;
|
||||||
|
|
||||||
-- Term2
|
-- Term2
|
||||||
TVar. Term2 ::= Id;
|
|
||||||
|
|
||||||
TType. Term2 ::= "Type";
|
TAppEx. Term2 ::= Term2 Term3;
|
||||||
|
TAppIm. Term2 ::= Term2 "{" Term "}";
|
||||||
TT0. Term2 ::= "𝟘";
|
|
||||||
|
|
||||||
TT1. Term2 ::= "𝟙";
|
|
||||||
TT1tr. Term2 ::= "★";
|
|
||||||
|
|
||||||
TBool. Term2 ::= "𝟚";
|
|
||||||
TTrue. Term2 ::= "true";
|
|
||||||
TFalse. Term2 ::= "false";
|
|
||||||
|
|
||||||
TNat. Term2 ::= "ℕ";
|
|
||||||
TZero. Term2 ::= "0";
|
|
||||||
|
|
||||||
TLam. Term2 ::= "λ" [Name] "." 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