~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to contrib/extraction/g_extraction.ml4

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(************************************************************************)
 
2
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
 
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
 
4
(*   \VV/  **************************************************************)
 
5
(*    //   *      This file is distributed under the terms of the       *)
 
6
(*         *       GNU Lesser General Public License Version 2.1        *)
 
7
(************************************************************************)
 
8
 
 
9
(*i camlp4deps: "parsing/grammar.cma" i*)
 
10
 
 
11
(* ML names *)
 
12
 
 
13
open Vernacexpr
 
14
open Pcoq
 
15
open Genarg
 
16
open Pp
 
17
 
 
18
let pr_mlname _ _ _ s = spc () ++ qs s
 
19
 
 
20
ARGUMENT EXTEND mlname
 
21
  TYPED AS string
 
22
  PRINTED BY pr_mlname
 
23
| [ preident(id) ] -> [ id ]
 
24
| [ string(s) ] -> [ s ]
 
25
END
 
26
 
 
27
open Table
 
28
open Extract_env
 
29
 
 
30
let pr_language = function
 
31
  | Ocaml -> str "Ocaml" 
 
32
  | Haskell -> str "Haskell"
 
33
  | Scheme -> str "Scheme"
 
34
 
 
35
VERNAC ARGUMENT EXTEND language
 
36
PRINTED BY pr_language
 
37
| [ "Ocaml" ] -> [ Ocaml ]
 
38
| [ "Haskell" ] -> [ Haskell ]
 
39
| [ "Scheme" ] -> [ Scheme ]
 
40
END
 
41
 
 
42
(* Extraction commands *)
 
43
 
 
44
VERNAC COMMAND EXTEND Extraction
 
45
(* Extraction in the Coq toplevel *)
 
46
| [ "Extraction" global(x) ] -> [ simple_extraction x ]
 
47
| [ "Recursive" "Extraction" ne_global_list(l) ] -> [ full_extraction None l ]
 
48
 
 
49
(* Monolithic extraction to a file *)
 
50
| [ "Extraction" string(f) ne_global_list(l) ] 
 
51
  -> [ full_extraction (Some f) l ]
 
52
END
 
53
 
 
54
(* Modular extraction (one Coq library = one ML module) *)
 
55
VERNAC COMMAND EXTEND ExtractionLibrary
 
56
| [ "Extraction" "Library" ident(m) ]
 
57
  -> [ extraction_library false m ]
 
58
END
 
59
 
 
60
VERNAC COMMAND EXTEND RecursiveExtractionLibrary
 
61
| [ "Recursive" "Extraction" "Library" ident(m) ]
 
62
  -> [ extraction_library true m ]
 
63
END
 
64
 
 
65
(* Target Language *)
 
66
VERNAC COMMAND EXTEND ExtractionLanguage
 
67
| [ "Extraction" "Language" language(l) ] 
 
68
  -> [ extraction_language l ]
 
69
END
 
70
 
 
71
VERNAC COMMAND EXTEND ExtractionInline
 
72
(* Custom inlining directives *)
 
73
| [ "Extraction" "Inline" ne_global_list(l) ] 
 
74
  -> [ extraction_inline true l ]
 
75
END
 
76
 
 
77
VERNAC COMMAND EXTEND ExtractionNoInline
 
78
| [ "Extraction" "NoInline" ne_global_list(l) ] 
 
79
  -> [ extraction_inline false l ]
 
80
END
 
81
 
 
82
VERNAC COMMAND EXTEND PrintExtractionInline
 
83
| [ "Print" "Extraction" "Inline" ]
 
84
  -> [ print_extraction_inline () ]
 
85
END
 
86
 
 
87
VERNAC COMMAND EXTEND ResetExtractionInline
 
88
| [ "Reset" "Extraction" "Inline" ]
 
89
  -> [ reset_extraction_inline () ]
 
90
END
 
91
 
 
92
VERNAC COMMAND EXTEND ExtractionBlacklist
 
93
(* Force Extraction to not use some filenames *)
 
94
| [ "Extraction" "Blacklist" ne_ident_list(l) ]
 
95
  -> [ extraction_blacklist l ]
 
96
END
 
97
 
 
98
VERNAC COMMAND EXTEND PrintExtractionBlacklist
 
99
| [ "Print" "Extraction" "Blacklist" ]
 
100
  -> [ print_extraction_blacklist () ]
 
101
END
 
102
 
 
103
VERNAC COMMAND EXTEND ResetExtractionBlacklist
 
104
| [ "Reset" "Extraction" "Blacklist" ]
 
105
  -> [ reset_extraction_blacklist () ]
 
106
END
 
107
 
 
108
 
 
109
(* Overriding of a Coq object by an ML one *)
 
110
VERNAC COMMAND EXTEND ExtractionConstant
 
111
| [ "Extract" "Constant" global(x) string_list(idl) "=>" mlname(y) ]
 
112
  -> [ extract_constant_inline false x idl y ]
 
113
END
 
114
 
 
115
VERNAC COMMAND EXTEND ExtractionInlinedConstant
 
116
| [ "Extract" "Inlined" "Constant" global(x) "=>" mlname(y) ]
 
117
  -> [ extract_constant_inline true x [] y ]
 
118
END
 
119
 
 
120
VERNAC COMMAND EXTEND ExtractionInductive
 
121
| [ "Extract" "Inductive" global(x) "=>" mlname(id) "[" mlname_list(idl) "]" ]
 
122
  -> [ extract_inductive x (id,idl) ]
 
123
END