aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Init/DatatypesSyntax.v
diff options
context:
space:
mode:
authorGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>1999-12-13 09:03:27 +0000
committerGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>1999-12-13 09:03:27 +0000
commit2b62054dcccae08fdb5b61145e4b84d746e6faf1 (patch)
treeab7a36991d7c48022f5815b46f97ea656230bd06 /theories/Init/DatatypesSyntax.v
parent6f9511d66cbca602302d7854b5699e02eb1b026a (diff)
fichiers prelude Coq
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@243 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Init/DatatypesSyntax.v')
-rw-r--r--theories/Init/DatatypesSyntax.v38
1 files changed, 38 insertions, 0 deletions
diff --git a/theories/Init/DatatypesSyntax.v b/theories/Init/DatatypesSyntax.v
new file mode 100644
index 000000000..2841c2150
--- /dev/null
+++ b/theories/Init/DatatypesSyntax.v
@@ -0,0 +1,38 @@
+
+(* $Id$ *)
+
+Require Export Datatypes.
+
+(* Parsing of things in Datatypes.v *)
+
+Grammar command command1 :=
+ pair_expl [ "<" lcommand($l1) "," lcommand($c2) ">" "(" lcommand($c3) ","
+ lcommand($c4) ")" ] -> [<<(pair $l1 $c2 $c3 $c4)>>]
+| fst_expl [ "<" lcommand($l1) "," lcommand($c2) ">" "Fst" "("
+ lcommand($l) ")" ] -> [<<(fst $l1 $c2 $l)>>]
+| snd_expl [ "<" lcommand($l1) "," lcommand($c2) ">" "Snd" "("
+ lcommand($l) ")" ] -> [<<(snd $l1 $c2 $l)>>]
+
+with command0 :=
+ pair [ "(" lcommand($lc1) "," lcommand($lc2) ")" ] ->
+ [<<(pair ? ? $lc1 $lc2)>>]
+
+with command3 :=
+ prod [ command2($c1) "*" command3($c2) ] -> [<<(prod $c1 $c2)>>].
+
+(* Pretty-printing of things in Datatypes.v *)
+
+Syntax constr
+ level 4:
+ sum [<<(sum $t1 $t2)>>] -> [ [<hov 0> $t1:E [0 1] "+" $t2:L ] ]
+ ;
+
+ level 3:
+ product [<<(prod $t1 $t2)>>] -> [ [<hov 0> $t1:L [0 1] "*" $t2:E ] ]
+ ;
+
+ level 1:
+ pair
+ [<<(pair $_ $_ $t3 $t4)>>] -> [ [<hov 0> "(" $t3:E ","[0 1] $t4:E ")" ] ]
+ | fst_imp [<<(fst $_ $_ $t2)>>] -> [ [<hov 0> "(Fst " $t2:E ")"] ]
+ | snd_imp [<<(snd $_ $_ $t2)>>] -> [ [<hov 0> "(Snd " $t2:E ")"] ].