1 From 7fafc03c599d9286ef7e1470dae94838c8e8806d Mon Sep 17 00:00:00 2001
2 From: Daniel de-Rauglaudre <deraugla@sysadm-OptiPlex-9020-AIO.(none)>
3 Date: Tue, 12 May 2015 18:37:59 +0200
4 Subject: [PATCH] updated for ocaml version 4.02.2
8 ocaml_src/lib/versdep/4.02.2.ml | 661 ++++++++++++++++++++++++
9 ocaml_stuff/4.02.2/parsing/.depend | 4 +
10 ocaml_stuff/4.02.2/parsing/.gitignore | 1 +
11 ocaml_stuff/4.02.2/parsing/Makefile | 19 +
12 ocaml_stuff/4.02.2/parsing/asttypes.mli | 49 ++
13 ocaml_stuff/4.02.2/parsing/location.mli | 135 +++++
14 ocaml_stuff/4.02.2/parsing/longident.mli | 22 +
15 ocaml_stuff/4.02.2/parsing/parsetree.mli | 829 +++++++++++++++++++++++++++++++
16 ocaml_stuff/4.02.2/utils/.depend | 2 +
17 ocaml_stuff/4.02.2/utils/.gitignore | 1 +
18 ocaml_stuff/4.02.2/utils/Makefile | 27 +
19 ocaml_stuff/4.02.2/utils/pconfig.ml | 4 +
20 ocaml_stuff/4.02.2/utils/pconfig.mli | 4 +
21 ocaml_stuff/4.02.2/utils/warnings.mli | 86 ++++
22 15 files changed, 1846 insertions(+)
23 create mode 100644 ocaml_src/lib/versdep/4.02.2.ml
24 create mode 100644 ocaml_stuff/4.02.2/parsing/.depend
25 create mode 100644 ocaml_stuff/4.02.2/parsing/.gitignore
26 create mode 100644 ocaml_stuff/4.02.2/parsing/Makefile
27 create mode 100644 ocaml_stuff/4.02.2/parsing/asttypes.mli
28 create mode 100644 ocaml_stuff/4.02.2/parsing/location.mli
29 create mode 100644 ocaml_stuff/4.02.2/parsing/longident.mli
30 create mode 100644 ocaml_stuff/4.02.2/parsing/parsetree.mli
31 create mode 100644 ocaml_stuff/4.02.2/utils/.depend
32 create mode 100644 ocaml_stuff/4.02.2/utils/.gitignore
33 create mode 100644 ocaml_stuff/4.02.2/utils/Makefile
34 create mode 100644 ocaml_stuff/4.02.2/utils/pconfig.ml
35 create mode 100644 ocaml_stuff/4.02.2/utils/pconfig.mli
36 create mode 100644 ocaml_stuff/4.02.2/utils/warnings.mli
38 #diff --git a/CHANGES b/CHANGES
39 #index ba9243e..db34fd3 100644
43 # Camlp5 Version 6.13:
44 # --------------------
46 #+* [12 May 15] Upgraded for ocaml version 4.02.2
48 # Camlp5 Version 6.12:
49 # --------------------
51 diff --git a/ocaml_src/lib/versdep/4.02.2.ml b/ocaml_src/lib/versdep/4.02.2.ml
53 index 0000000..cbe5f5b
55 +++ b/ocaml_src/lib/versdep/4.02.2.ml
57 +(* camlp5r pa_macro.cmo *)
59 +(* Copyright (c) INRIA 2007-2014 *)
65 +type ('a, 'b) choice =
70 +let sys_ocaml_version = Sys.ocaml_version;;
72 +let ocaml_location (fname, lnum, bolp, lnuml, bolpl, bp, ep) =
73 + let loc_at n lnum bolp =
74 + {Lexing.pos_fname = if lnum = -1 then "" else fname;
75 + Lexing.pos_lnum = lnum; Lexing.pos_bol = bolp; Lexing.pos_cnum = n}
77 + {Location.loc_start = loc_at bp lnum bolp;
78 + Location.loc_end = loc_at ep lnuml bolpl;
79 + Location.loc_ghost = bp = 0 && ep = 0}
84 + {Lexing.pos_fname = "_none_"; Lexing.pos_lnum = 1; Lexing.pos_bol = 0;
85 + Lexing.pos_cnum = -1}
87 + {Location.loc_start = loc; Location.loc_end = loc;
88 + Location.loc_ghost = true}
91 +let mkloc loc txt = {Location.txt = txt; Location.loc = loc};;
92 +let mknoloc txt = mkloc loc_none txt;;
94 +let ocaml_id_or_li_of_string_list loc sl =
98 + i :: il -> loop (fun s -> Ldot (f i, s)) il
101 + loop (fun s -> Lident s)
103 + match List.rev sl with
105 + | s :: sl -> Some (mkli s (List.rev sl))
108 +let list_map_check f l =
109 + let rec loop rev_l =
112 + begin match f x with
113 + Some s -> loop (s :: rev_l) l
116 + | [] -> Some (List.rev rev_l)
121 +let ocaml_value_description vn t p =
122 + {pval_type = t; pval_prim = p; pval_loc = t.ptyp_loc;
123 + pval_name = mkloc t.ptyp_loc vn; pval_attributes = []}
126 +let ocaml_class_type_field loc ctfd =
127 + {pctf_desc = ctfd; pctf_loc = loc; pctf_attributes = []}
130 +let ocaml_class_field loc cfd =
131 + {pcf_desc = cfd; pcf_loc = loc; pcf_attributes = []}
134 +let ocaml_mktyp loc x =
135 + {ptyp_desc = x; ptyp_loc = loc; ptyp_attributes = []}
137 +let ocaml_mkpat loc x =
138 + {ppat_desc = x; ppat_loc = loc; ppat_attributes = []}
140 +let ocaml_mkexp loc x =
141 + {pexp_desc = x; pexp_loc = loc; pexp_attributes = []}
143 +let ocaml_mkmty loc x =
144 + {pmty_desc = x; pmty_loc = loc; pmty_attributes = []}
146 +let ocaml_mkmod loc x =
147 + {pmod_desc = x; pmod_loc = loc; pmod_attributes = []}
149 +let ocaml_mkfield loc (lab, x) fl = (lab, x) :: fl;;
150 +let ocaml_mkfield_var loc = [];;
152 +let variance_of_bool_bool =
154 + false, true -> Contravariant
155 + | true, false -> Covariant
159 +let ocaml_type_declaration tn params cl tk pf tm loc variance =
160 + match list_map_check (fun s_opt -> s_opt) params with
163 + if List.length params <> List.length variance then
164 + failwith "internal error: ocaml_type_declaration"
169 + ocaml_mktyp loc (Ptyp_var os), variance_of_bool_bool va)
173 + {ptype_params = params; ptype_cstrs = cl; ptype_kind = tk;
174 + ptype_private = pf; ptype_manifest = tm; ptype_loc = loc;
175 + ptype_name = mkloc loc tn; ptype_attributes = []}
176 + | None -> Left "no '_' type param in this ocaml version"
179 +let ocaml_class_type =
180 + Some (fun d loc -> {pcty_desc = d; pcty_loc = loc; pcty_attributes = []})
183 +let ocaml_class_expr =
184 + Some (fun d loc -> {pcl_desc = d; pcl_loc = loc; pcl_attributes = []})
187 +let ocaml_class_structure p cil = {pcstr_self = p; pcstr_fields = cil};;
189 +let ocaml_pmty_ident loc li = Pmty_ident (mkloc loc li);;
191 +let ocaml_pmty_functor sloc s mt1 mt2 =
192 + Pmty_functor (mkloc sloc s, Some mt1, mt2)
195 +let ocaml_pmty_typeof = Some (fun me -> Pmty_typeof me);;
197 +let ocaml_pmty_with mt lcl =
198 + let lcl = List.map snd lcl in Pmty_with (mt, lcl)
201 +let ocaml_ptype_abstract = Ptype_abstract;;
203 +let ocaml_ptype_record ltl priv =
206 + (fun (s, mf, ct, loc) ->
207 + {pld_name = mkloc loc s; pld_mutable = mf; pld_type = ct;
208 + pld_loc = loc; pld_attributes = []})
212 +let ocaml_ptype_variant ctl priv =
216 + (fun (c, tl, rto, loc) ->
217 + if rto <> None then raise Exit
219 + {pcd_name = mkloc loc c; pcd_args = tl; pcd_res = None;
220 + pcd_loc = loc; pcd_attributes = []})
223 + Some (Ptype_variant ctl)
227 +let ocaml_ptyp_arrow lab t1 t2 = Ptyp_arrow (lab, t1, t2);;
229 +let ocaml_ptyp_class li tl ll = Ptyp_class (mknoloc li, tl);;
231 +let ocaml_ptyp_constr loc li tl = Ptyp_constr (mkloc loc li, tl);;
233 +let ocaml_ptyp_object ml =
234 + let ml = List.map (fun (s, t) -> s, [], t) ml in Ptyp_object (ml, Closed)
237 +let ocaml_ptyp_package = Some (fun pt -> Ptyp_package pt);;
239 +let ocaml_ptyp_poly =
244 + | _ -> Ptyp_poly (cl, t))
247 +let ocaml_ptyp_variant catl clos sl_opt =
251 + Left (c, a, tl) -> Rtag (c, [], a, tl)
252 + | Right t -> Rinherit t)
255 + let clos = if clos then Closed else Open in
256 + Some (Ptyp_variant (catl, clos, sl_opt))
259 +let ocaml_package_type li ltl =
260 + mknoloc li, List.map (fun (li, t) -> mkloc t.ptyp_loc li, t) ltl
263 +let ocaml_const_string s = Const_string (s, None);;
265 +let ocaml_const_int32 = Some (fun s -> Const_int32 (Int32.of_string s));;
267 +let ocaml_const_int64 = Some (fun s -> Const_int64 (Int64.of_string s));;
269 +let ocaml_const_nativeint =
270 + Some (fun s -> Const_nativeint (Nativeint.of_string s))
273 +let ocaml_pexp_apply f lel = Pexp_apply (f, lel);;
275 +let ocaml_pexp_assertfalse fname loc =
277 + (ocaml_mkexp loc (Pexp_construct (mkloc loc (Lident "false"), None)))
280 +let ocaml_pexp_assert fname loc e = Pexp_assert e;;
282 +let ocaml_pexp_constraint e ot1 ot2 =
284 + Some t2 -> Pexp_coerce (e, ot1, t2)
287 + Some t1 -> Pexp_constraint (e, t1)
288 + | None -> failwith "internal error: ocaml_pexp_constraint"
291 +let ocaml_pexp_construct loc li po chk_arity =
292 + Pexp_construct (mkloc loc li, po)
295 +let ocaml_pexp_construct_args =
297 + Pexp_construct (li, po) -> Some (li.txt, li.loc, po, 0)
301 +let mkexp_ocaml_pexp_construct_arity loc li_loc li al =
302 + let a = ocaml_mkexp loc (Pexp_tuple al) in
303 + {pexp_desc = ocaml_pexp_construct li_loc li (Some a) true; pexp_loc = loc;
304 + pexp_attributes = [mkloc loc "ocaml.explicit_arity", PStr []]}
307 +let ocaml_pexp_field loc e li = Pexp_field (e, mkloc loc li);;
309 +let ocaml_pexp_for i e1 e2 df e =
310 + Pexp_for (ocaml_mkpat loc_none (Ppat_var (mknoloc i)), e1, e2, df, e)
313 +let ocaml_case (p, wo, loc, e) = {pc_lhs = p; pc_guard = wo; pc_rhs = e};;
315 +let ocaml_pexp_function lab eo pel =
317 + [{pc_lhs = p; pc_guard = None; pc_rhs = e}] -> Pexp_fun (lab, eo, p, e)
319 + if lab = "" && eo = None then Pexp_function pel
320 + else failwith "internal error: bad ast in ocaml_pexp_function"
323 +let ocaml_pexp_lazy = Some (fun e -> Pexp_lazy e);;
325 +let ocaml_pexp_ident li = Pexp_ident (mknoloc li);;
327 +let ocaml_pexp_letmodule =
328 + Some (fun i me e -> Pexp_letmodule (mknoloc i, me, e))
331 +let ocaml_pexp_new loc li = Pexp_new (mkloc loc li);;
333 +let ocaml_pexp_newtype = Some (fun s e -> Pexp_newtype (s, e));;
335 +let ocaml_pexp_object = Some (fun cs -> Pexp_object cs);;
337 +let ocaml_pexp_open = Some (fun li e -> Pexp_open (Fresh, mknoloc li, e));;
339 +let ocaml_pexp_override sel =
340 + let sel = List.map (fun (s, e) -> mknoloc s, e) sel in Pexp_override sel
343 +let ocaml_pexp_pack : ('a -> 'b -> 'c, 'd) choice option =
344 + Some (Right ((fun me -> Pexp_pack me), (fun pt -> Ptyp_package pt)))
347 +let ocaml_pexp_poly = Some (fun e t -> Pexp_poly (e, t));;
349 +let ocaml_pexp_record lel eo =
350 + let lel = List.map (fun (li, loc, e) -> mkloc loc li, e) lel in
351 + Pexp_record (lel, eo)
354 +let ocaml_pexp_setinstvar s e = Pexp_setinstvar (mknoloc s, e);;
356 +let ocaml_pexp_variant =
357 + let pexp_variant_pat =
359 + Pexp_variant (lab, eo) -> Some (lab, eo)
362 + let pexp_variant (lab, eo) = Pexp_variant (lab, eo) in
363 + Some (pexp_variant_pat, pexp_variant)
366 +let ocaml_value_binding loc p e =
367 + {pvb_pat = p; pvb_expr = e; pvb_loc = loc; pvb_attributes = []}
370 +let ocaml_ppat_alias p i iloc = Ppat_alias (p, mkloc iloc i);;
372 +let ocaml_ppat_array = Some (fun pl -> Ppat_array pl);;
374 +let ocaml_ppat_construct loc li po chk_arity =
375 + Ppat_construct (mkloc loc li, po)
378 +let ocaml_ppat_construct_args =
380 + Ppat_construct (li, po) -> Some (li.txt, li.loc, po, 0)
384 +let mkpat_ocaml_ppat_construct_arity loc li_loc li al =
385 + let a = ocaml_mkpat loc (Ppat_tuple al) in
386 + {ppat_desc = ocaml_ppat_construct li_loc li (Some a) true; ppat_loc = loc;
387 + ppat_attributes = [mkloc loc "ocaml.explicit_arity", PStr []]}
390 +let ocaml_ppat_lazy = Some (fun p -> Ppat_lazy p);;
392 +let ocaml_ppat_record lpl is_closed =
393 + let lpl = List.map (fun (li, loc, p) -> mkloc loc li, p) lpl in
394 + Ppat_record (lpl, (if is_closed then Closed else Open))
397 +let ocaml_ppat_type = Some (fun loc li -> Ppat_type (mkloc loc li));;
399 +let ocaml_ppat_unpack =
400 + Some ((fun loc s -> Ppat_unpack (mkloc loc s)), (fun pt -> Ptyp_package pt))
403 +let ocaml_ppat_var loc s = Ppat_var (mkloc loc s);;
405 +let ocaml_ppat_variant =
406 + let ppat_variant_pat =
408 + Ppat_variant (lab, po) -> Some (lab, po)
411 + let ppat_variant (lab, po) = Ppat_variant (lab, po) in
412 + Some (ppat_variant_pat, ppat_variant)
415 +let ocaml_psig_class_type = Some (fun ctl -> Psig_class_type ctl);;
417 +let ocaml_psig_exception loc s ed =
419 + {pext_name = mkloc loc s; pext_kind = Pext_decl (ed, None);
420 + pext_loc = loc; pext_attributes = []}
423 +let ocaml_psig_include loc mt =
424 + Psig_include {pincl_mod = mt; pincl_loc = loc; pincl_attributes = []}
427 +let ocaml_psig_module loc s mt =
429 + {pmd_name = mkloc loc s; pmd_type = mt; pmd_attributes = [];
433 +let ocaml_psig_modtype loc s mto =
435 + {pmtd_name = mkloc loc s; pmtd_type = mto; pmtd_attributes = [];
441 +let ocaml_psig_open loc li =
443 + {popen_lid = mknoloc li; popen_override = Fresh; popen_loc = loc;
444 + popen_attributes = []}
447 +let ocaml_psig_recmodule =
452 + {pmd_name = mknoloc s; pmd_type = mt; pmd_attributes = [];
453 + pmd_loc = loc_none})
461 +let ocaml_psig_type stl =
462 + let stl = List.map (fun (s, t) -> t) stl in Psig_type stl
465 +let ocaml_psig_value s vd = Psig_value vd;;
467 +let ocaml_pstr_class_type = Some (fun ctl -> Pstr_class_type ctl);;
469 +let ocaml_pstr_eval e = Pstr_eval (e, []);;
471 +let ocaml_pstr_exception loc s ed =
473 + {pext_name = mkloc loc s; pext_kind = Pext_decl (ed, None);
474 + pext_loc = loc; pext_attributes = []}
477 +let ocaml_pstr_exn_rebind =
481 + {pext_name = mkloc loc s; pext_kind = Pext_rebind (mkloc loc li);
482 + pext_loc = loc; pext_attributes = []})
485 +let ocaml_pstr_include =
488 + Pstr_include {pincl_mod = me; pincl_loc = loc; pincl_attributes = []})
491 +let ocaml_pstr_modtype loc s mt =
493 + {pmtd_name = mkloc loc s; pmtd_type = Some mt; pmtd_attributes = [];
499 +let ocaml_pstr_module loc s me =
501 + {pmb_name = mkloc loc s; pmb_expr = me; pmb_attributes = [];
507 +let ocaml_pstr_open loc li =
509 + {popen_lid = mknoloc li; popen_override = Fresh; popen_loc = loc;
510 + popen_attributes = []}
513 +let ocaml_pstr_primitive s vd = Pstr_primitive vd;;
515 +let ocaml_pstr_recmodule =
519 + (fun (s, mt, me) ->
520 + {pmb_name = mknoloc s; pmb_expr = me; pmb_attributes = [];
521 + pmb_loc = loc_none})
527 +let ocaml_pstr_type stl =
528 + let stl = List.map (fun (s, t) -> t) stl in Pstr_type stl
531 +let ocaml_class_infos =
533 + (fun virt (sl, sloc) name expr loc variance ->
535 + if List.length sl <> List.length variance then
536 + failwith "internal error: ocaml_class_infos"
541 + ocaml_mktyp loc (Ptyp_var os), variance_of_bool_bool va)
544 + {pci_virt = virt; pci_params = params; pci_name = mkloc loc name;
545 + pci_expr = expr; pci_loc = loc; pci_attributes = []})
548 +let ocaml_pmod_ident li = Pmod_ident (mknoloc li);;
550 +let ocaml_pmod_functor s mt me = Pmod_functor (mknoloc s, Some mt, me);;
552 +let ocaml_pmod_unpack : ('a -> 'b -> 'c, 'd) choice option =
553 + Some (Right ((fun e -> Pmod_unpack e), (fun pt -> Ptyp_package pt)))
556 +let ocaml_pcf_cstr = Some (fun (t1, t2, loc) -> Pcf_constraint (t1, t2));;
558 +let ocaml_pcf_inher ce pb = Pcf_inherit (Fresh, ce, pb);;
560 +let ocaml_pcf_init = Some (fun e -> Pcf_initializer e);;
562 +let ocaml_pcf_meth (s, pf, ovf, e, loc) =
563 + let pf = if pf then Private else Public in
564 + let ovf = if ovf then Override else Fresh in
565 + Pcf_method (mkloc loc s, pf, Cfk_concrete (ovf, e))
568 +let ocaml_pcf_val (s, mf, ovf, e, loc) =
569 + let mf = if mf then Mutable else Immutable in
570 + let ovf = if ovf then Override else Fresh in
571 + Pcf_val (mkloc loc s, mf, Cfk_concrete (ovf, e))
574 +let ocaml_pcf_valvirt =
575 + let ocaml_pcf (s, mf, t, loc) =
576 + let mf = if mf then Mutable else Immutable in
577 + Pcf_val (mkloc loc s, mf, Cfk_virtual t)
582 +let ocaml_pcf_virt (s, pf, t, loc) =
583 + Pcf_val (mkloc loc s, Immutable, Cfk_virtual t)
586 +let ocaml_pcl_apply = Some (fun ce lel -> Pcl_apply (ce, lel));;
588 +let ocaml_pcl_constr = Some (fun li ctl -> Pcl_constr (mknoloc li, ctl));;
590 +let ocaml_pcl_constraint = Some (fun ce ct -> Pcl_constraint (ce, ct));;
592 +let ocaml_pcl_fun = Some (fun lab ceo p ce -> Pcl_fun (lab, ceo, p, ce));;
594 +let ocaml_pcl_let = Some (fun rf pel ce -> Pcl_let (rf, pel, ce));;
596 +let ocaml_pcl_structure = Some (fun cs -> Pcl_structure cs);;
598 +let ocaml_pctf_cstr = Some (fun (t1, t2, loc) -> Pctf_constraint (t1, t2));;
600 +let ocaml_pctf_inher ct = Pctf_inherit ct;;
602 +let ocaml_pctf_meth (s, pf, t, loc) = Pctf_method (s, pf, Concrete, t);;
604 +let ocaml_pctf_val (s, mf, t, loc) = Pctf_val (s, mf, Concrete, t);;
606 +let ocaml_pctf_virt (s, pf, t, loc) = Pctf_val (s, Immutable, Virtual, t);;
608 +let ocaml_pcty_constr = Some (fun li ltl -> Pcty_constr (mknoloc li, ltl));;
610 +let ocaml_pcty_fun = Some (fun lab t ct -> Pcty_arrow (lab, t, ct));;
612 +let ocaml_pcty_signature =
614 + let cs = {pcsig_self = t; pcsig_fields = ctfl} in Pcty_signature cs
619 +let ocaml_pdir_bool = Some (fun b -> Pdir_bool b);;
621 +let ocaml_pwith_modsubst =
622 + Some (fun loc me -> Pwith_modsubst (mkloc loc "", mkloc loc me))
625 +let ocaml_pwith_type loc (i, td) = Pwith_type (mkloc loc i, td);;
627 +let ocaml_pwith_module loc me =
628 + Pwith_module (mkloc loc (Lident ""), mkloc loc me)
631 +let ocaml_pwith_typesubst = Some (fun td -> Pwith_typesubst td);;
633 +let module_prefix_can_be_in_first_record_label_only = true;;
635 +let split_or_patterns_with_bindings = false;;
637 +let has_records_with_with = true;;
641 +let jocaml_pstr_def : (_ -> _) option = None;;
643 +let jocaml_pexp_def : (_ -> _ -> _) option = None;;
645 +let jocaml_pexp_par : (_ -> _ -> _) option = None;;
647 +let jocaml_pexp_reply : (_ -> _ -> _ -> _) option = None;;
649 +let jocaml_pexp_spawn : (_ -> _) option = None;;
653 + Arg.Rest r -> Some r
657 +let arg_set_string =
659 + Arg.Set_string r -> Some r
665 + Arg.Set_int r -> Some r
671 + Arg.Set_float r -> Some r
677 + Arg.Symbol (s, f) -> Some (s, f)
683 + Arg.Tuple t -> Some t
689 + Arg.Bool f -> Some f
693 +let char_escaped = Char.escaped;;
695 +let hashtbl_mem = Hashtbl.mem;;
697 +let list_rev_append = List.rev_append;;
699 +let list_rev_map = List.rev_map;;
701 +let list_sort = List.sort;;
703 +let pervasives_set_binary_mode_out = Pervasives.set_binary_mode_out;;
705 +let printf_ksprintf = Printf.ksprintf;;
707 +let string_contains = String.contains;;
709 +let string_copy = Bytes.copy;;
711 +let string_create = Bytes.create;;
713 +let string_unsafe_set = Bytes.unsafe_set;;
715 +let string_set = Bytes.set;;
717 +let array_create = Array.make;;
718 diff --git a/ocaml_stuff/4.02.2/parsing/.depend b/ocaml_stuff/4.02.2/parsing/.depend
720 index 0000000..c589fb6
722 +++ b/ocaml_stuff/4.02.2/parsing/.depend
724 +asttypes.cmi : location.cmi
725 +location.cmi : ../utils/warnings.cmi
727 +parsetree.cmi : longident.cmi location.cmi asttypes.cmi
728 diff --git a/ocaml_stuff/4.02.2/parsing/.gitignore b/ocaml_stuff/4.02.2/parsing/.gitignore
730 index 0000000..8e6c39c
732 +++ b/ocaml_stuff/4.02.2/parsing/.gitignore
735 diff --git a/ocaml_stuff/4.02.2/parsing/Makefile b/ocaml_stuff/4.02.2/parsing/Makefile
737 index 0000000..6d08a19
739 +++ b/ocaml_stuff/4.02.2/parsing/Makefile
743 +FILES=asttypes.cmi location.cmi longident.cmi parsetree.cmi
752 + ocamldep $(INCL) *.ml* | sed -e 's/ *$$//' > .depend
754 +.SUFFIXES: .mli .cmi
757 + $(OCAMLN)c $(INCL) -c $<
760 diff --git a/ocaml_stuff/4.02.2/parsing/asttypes.mli b/ocaml_stuff/4.02.2/parsing/asttypes.mli
762 index 0000000..b212a2b
764 +++ b/ocaml_stuff/4.02.2/parsing/asttypes.mli
766 +(***********************************************************************)
770 +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
772 +(* Copyright 1996 Institut National de Recherche en Informatique et *)
773 +(* en Automatique. All rights reserved. This file is distributed *)
774 +(* under the terms of the Q Public License version 1.0. *)
776 +(***********************************************************************)
778 +(* Auxiliary a.s.t. types used by parsetree and typedtree. *)
782 + | Const_char of char
783 + | Const_string of string * string option
784 + | Const_float of string
785 + | Const_int32 of int32
786 + | Const_int64 of int64
787 + | Const_nativeint of nativeint
789 +type rec_flag = Nonrecursive | Recursive
791 +type direction_flag = Upto | Downto
793 +type private_flag = Private | Public
795 +type mutable_flag = Immutable | Mutable
797 +type virtual_flag = Virtual | Concrete
799 +type override_flag = Override | Fresh
801 +type closed_flag = Closed | Open
805 +type 'a loc = 'a Location.loc = {
815 diff --git a/ocaml_stuff/4.02.2/parsing/location.mli b/ocaml_stuff/4.02.2/parsing/location.mli
817 index 0000000..77b754f
819 +++ b/ocaml_stuff/4.02.2/parsing/location.mli
821 +(***********************************************************************)
825 +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
827 +(* Copyright 1996 Institut National de Recherche en Informatique et *)
828 +(* en Automatique. All rights reserved. This file is distributed *)
829 +(* under the terms of the Q Public License version 1.0. *)
831 +(***********************************************************************)
833 +(* Source code locations (ranges of positions), used in parsetree. *)
838 + loc_start: Lexing.position;
839 + loc_end: Lexing.position;
843 +(* Note on the use of Lexing.position in this module.
844 + If [pos_fname = ""], then use [!input_name] instead.
845 + If [pos_lnum = -1], then [pos_bol = 0]. Use [pos_cnum] and
846 + re-parse the file to get the line and character numbers.
847 + Else all fields are correct.
851 +(** An arbitrary value of type [t]; describes an empty ghost range. *)
853 +val in_file : string -> t
854 +(** Return an empty ghost range located in a given file. *)
856 +val init : Lexing.lexbuf -> string -> unit
857 +(** Set the file name and line number of the [lexbuf] to be the start
858 + of the named file. *)
860 +val curr : Lexing.lexbuf -> t
861 +(** Get the location of the current token from the [lexbuf]. *)
863 +val symbol_rloc: unit -> t
864 +val symbol_gloc: unit -> t
866 +(** [rhs_loc n] returns the location of the symbol at position [n], starting
867 + at 1, in the current parser rule. *)
868 +val rhs_loc: int -> t
870 +val input_name: string ref
871 +val input_lexbuf: Lexing.lexbuf option ref
873 +val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
874 +val print_loc: formatter -> t -> unit
875 +val print_error: formatter -> t -> unit
876 +val print_error_cur_file: formatter -> unit
877 +val print_warning: t -> formatter -> Warnings.t -> unit
878 +val formatter_for_warnings : formatter ref
879 +val prerr_warning: t -> Warnings.t -> unit
880 +val echo_eof: unit -> unit
881 +val reset: unit -> unit
883 +val warning_printer : (t -> formatter -> Warnings.t -> unit) ref
884 +(** Hook for intercepting warnings. *)
886 +val default_warning_printer : t -> formatter -> Warnings.t -> unit
887 +(** Original warning printer for use in hooks. *)
889 +val highlight_locations: formatter -> t list -> bool
896 +val mknoloc : 'a -> 'a loc
897 +val mkloc : 'a -> t -> 'a loc
899 +val print: formatter -> t -> unit
900 +val print_filename: formatter -> string -> unit
902 +val absolute_path: string -> string
904 +val show_filename: string -> string
905 + (** In -absname mode, return the absolute path for this filename.
906 + Otherwise, returns the filename unchanged. *)
909 +val absname: bool ref
912 +(* Support for located errors *)
919 + if_highlight: string; (* alternative message if locations are highlighted *)
922 +exception Error of error
924 +val error: ?loc:t -> ?sub:error list -> ?if_highlight:string -> string -> error
926 +val errorf: ?loc:t -> ?sub:error list -> ?if_highlight:string
927 + -> ('a, unit, string, error) format4 -> 'a
929 +val raise_errorf: ?loc:t -> ?sub:error list -> ?if_highlight:string
930 + -> ('a, unit, string, 'b) format4 -> 'a
932 +val error_of_printer: t -> (formatter -> 'a -> unit) -> 'a -> error
934 +val error_of_printer_file: (formatter -> 'a -> unit) -> 'a -> error
936 +val error_of_exn: exn -> error option
938 +val register_error_of_exn: (exn -> error option) -> unit
939 + (* Each compiler module which defines a custom type of exception
940 + which can surface as a user-visible error should register
941 + a "printer" for this exception using [register_error_of_exn].
942 + The result of the printer is an [error] value containing
943 + a location, a message, and optionally sub-messages (each of them
944 + being located as well). *)
946 +val report_error: formatter -> error -> unit
948 +val error_reporter : (formatter -> error -> unit) ref
949 +(** Hook for intercepting error reports. *)
951 +val default_error_reporter : formatter -> error -> unit
952 +(** Original error reporter for use in hooks. *)
954 +val report_exception: formatter -> exn -> unit
955 + (* Reraise the exception if it is unknown. *)
956 diff --git a/ocaml_stuff/4.02.2/parsing/longident.mli b/ocaml_stuff/4.02.2/parsing/longident.mli
958 index 0000000..9e79585
960 +++ b/ocaml_stuff/4.02.2/parsing/longident.mli
962 +(***********************************************************************)
966 +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
968 +(* Copyright 1996 Institut National de Recherche en Informatique et *)
969 +(* en Automatique. All rights reserved. This file is distributed *)
970 +(* under the terms of the Q Public License version 1.0. *)
972 +(***********************************************************************)
974 +(* Long identifiers, used in parsetree. *)
978 + | Ldot of t * string
981 +val flatten: t -> string list
982 +val last: t -> string
983 +val parse: string -> t
984 diff --git a/ocaml_stuff/4.02.2/parsing/parsetree.mli b/ocaml_stuff/4.02.2/parsing/parsetree.mli
986 index 0000000..295e3ea
988 +++ b/ocaml_stuff/4.02.2/parsing/parsetree.mli
990 +(***********************************************************************)
994 +(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
996 +(* Copyright 1996 Institut National de Recherche en Informatique et *)
997 +(* en Automatique. All rights reserved. This file is distributed *)
998 +(* under the terms of the Q Public License version 1.0. *)
1000 +(***********************************************************************)
1002 +(** Abstract syntax tree produced by parsing *)
1006 +(** {2 Extension points} *)
1008 +type attribute = string loc * payload
1012 + Metadata containers passed around within the AST.
1013 + The compiler ignores unknown attributes.
1016 +and extension = string loc * payload
1020 + Sub-language placeholder -- rejected by the typechecker.
1023 +and attributes = attribute list
1026 + | PStr of structure
1027 + | PTyp of core_type (* : T *)
1028 + | PPat of pattern * expression option (* ? P or ? P when E *)
1030 +(** {2 Core language} *)
1032 +(* Type expressions *)
1036 + ptyp_desc: core_type_desc;
1037 + ptyp_loc: Location.t;
1038 + ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
1041 +and core_type_desc =
1044 + | Ptyp_var of string
1046 + | Ptyp_arrow of label * core_type * core_type
1047 + (* T1 -> T2 (label = "")
1048 + ~l:T1 -> T2 (label = "l")
1049 + ?l:T1 -> T2 (label = "?l")
1051 + | Ptyp_tuple of core_type list
1056 + | Ptyp_constr of Longident.t loc * core_type list
1059 + (T1, ..., Tn) tconstr
1061 + | Ptyp_object of (string * attributes * core_type) list * closed_flag
1062 + (* < l1:T1; ...; ln:Tn > (flag = Closed)
1063 + < l1:T1; ...; ln:Tn; .. > (flag = Open)
1065 + | Ptyp_class of Longident.t loc * core_type list
1068 + (T1, ..., Tn) #tconstr
1070 + | Ptyp_alias of core_type * string
1072 + | Ptyp_variant of row_field list * closed_flag * label list option
1073 + (* [ `A|`B ] (flag = Closed; labels = None)
1074 + [> `A|`B ] (flag = Open; labels = None)
1075 + [< `A|`B ] (flag = Closed; labels = Some [])
1076 + [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
1078 + | Ptyp_poly of string list * core_type
1081 + Can only appear in the following context:
1083 + - As the core_type of a Ppat_constraint node corresponding
1084 + to a constraint on a let-binding: let x : 'a1 ... 'an. T
1087 + - Under Cfk_virtual for methods (not values).
1089 + - As the core_type of a Pctf_method node.
1091 + - As the core_type of a Pexp_poly node.
1093 + - As the pld_type field of a label_declaration.
1095 + - As a core_type of a Ptyp_object node.
1098 + | Ptyp_package of package_type
1100 + | Ptyp_extension of extension
1103 +and package_type = Longident.t loc * (Longident.t loc * core_type) list
1106 + (module S with type t1 = T1 and ... and tn = Tn)
1110 + | Rtag of label * attributes * bool * core_type list
1111 + (* [`A] ( true, [] )
1112 + [`A of T] ( false, [T] )
1113 + [`A of T1 & .. & Tn] ( false, [T1;...Tn] )
1114 + [`A of & T1 & .. & Tn] ( true, [T1;...Tn] )
1116 + - The 2nd field is true if the tag contains a
1117 + constant (empty) constructor.
1118 + - '&' occurs when several types are used for the same constructor
1119 + (see 4.2 in the manual)
1121 + - TODO: switch to a record representation, and keep location
1123 + | Rinherit of core_type
1130 + ppat_desc: pattern_desc;
1131 + ppat_loc: Location.t;
1132 + ppat_attributes: attributes; (* ... [@id1] [@id2] *)
1138 + | Ppat_var of string loc
1140 + | Ppat_alias of pattern * string loc
1142 + | Ppat_constant of constant
1143 + (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
1144 + | Ppat_interval of constant * constant
1147 + Other forms of interval are recognized by the parser
1148 + but rejected by the type-checker. *)
1149 + | Ppat_tuple of pattern list
1154 + | Ppat_construct of Longident.t loc * pattern option
1157 + C (P1, ..., Pn) Some (Ppat_tuple [P1; ...; Pn])
1159 + | Ppat_variant of label * pattern option
1163 + | Ppat_record of (Longident.t loc * pattern) list * closed_flag
1164 + (* { l1=P1; ...; ln=Pn } (flag = Closed)
1165 + { l1=P1; ...; ln=Pn; _} (flag = Open)
1169 + | Ppat_array of pattern list
1170 + (* [| P1; ...; Pn |] *)
1171 + | Ppat_or of pattern * pattern
1173 + | Ppat_constraint of pattern * core_type
1175 + | Ppat_type of Longident.t loc
1177 + | Ppat_lazy of pattern
1179 + | Ppat_unpack of string loc
1181 + Note: (module P : S) is represented as
1182 + Ppat_constraint(Ppat_unpack, Ptyp_package)
1184 + | Ppat_exception of pattern
1186 + | Ppat_extension of extension
1189 +(* Value expressions *)
1193 + pexp_desc: expression_desc;
1194 + pexp_loc: Location.t;
1195 + pexp_attributes: attributes; (* ... [@id1] [@id2] *)
1198 +and expression_desc =
1199 + | Pexp_ident of Longident.t loc
1203 + | Pexp_constant of constant
1204 + (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
1205 + | Pexp_let of rec_flag * value_binding list * expression
1206 + (* let P1 = E1 and ... and Pn = EN in E (flag = Nonrecursive)
1207 + let rec P1 = E1 and ... and Pn = EN in E (flag = Recursive)
1209 + | Pexp_function of case list
1210 + (* function P1 -> E1 | ... | Pn -> En *)
1211 + | Pexp_fun of label * expression option * pattern * expression
1212 + (* fun P -> E1 (lab = "", None)
1213 + fun ~l:P -> E1 (lab = "l", None)
1214 + fun ?l:P -> E1 (lab = "?l", None)
1215 + fun ?l:(P = E0) -> E1 (lab = "?l", Some E0)
1218 + - If E0 is provided, lab must start with '?'.
1219 + - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
1220 + - "let f P = E" is represented using Pexp_fun.
1222 + | Pexp_apply of expression * (label * expression) list
1223 + (* E0 ~l1:E1 ... ~ln:En
1224 + li can be empty (non labeled argument) or start with '?'
1225 + (optional argument).
1229 + | Pexp_match of expression * case list
1230 + (* match E0 with P1 -> E1 | ... | Pn -> En *)
1231 + | Pexp_try of expression * case list
1232 + (* try E0 with P1 -> E1 | ... | Pn -> En *)
1233 + | Pexp_tuple of expression list
1238 + | Pexp_construct of Longident.t loc * expression option
1241 + C (E1, ..., En) Some (Pexp_tuple[E1;...;En])
1243 + | Pexp_variant of label * expression option
1247 + | Pexp_record of (Longident.t loc * expression) list * expression option
1248 + (* { l1=P1; ...; ln=Pn } (None)
1249 + { E0 with l1=P1; ...; ln=Pn } (Some E0)
1253 + | Pexp_field of expression * Longident.t loc
1255 + | Pexp_setfield of expression * Longident.t loc * expression
1257 + | Pexp_array of expression list
1258 + (* [| E1; ...; En |] *)
1259 + | Pexp_ifthenelse of expression * expression * expression option
1260 + (* if E1 then E2 else E3 *)
1261 + | Pexp_sequence of expression * expression
1263 + | Pexp_while of expression * expression
1264 + (* while E1 do E2 done *)
1266 + pattern * expression * expression * direction_flag * expression
1267 + (* for i = E1 to E2 do E3 done (flag = Upto)
1268 + for i = E1 downto E2 do E3 done (flag = Downto)
1270 + | Pexp_constraint of expression * core_type
1272 + | Pexp_coerce of expression * core_type option * core_type
1273 + (* (E :> T) (None, T)
1274 + (E : T0 :> T) (Some T0, T)
1276 + | Pexp_send of expression * string
1278 + | Pexp_new of Longident.t loc
1280 + | Pexp_setinstvar of string loc * expression
1282 + | Pexp_override of (string loc * expression) list
1283 + (* {< x1 = E1; ...; Xn = En >} *)
1284 + | Pexp_letmodule of string loc * module_expr * expression
1285 + (* let module M = ME in E *)
1286 + | Pexp_assert of expression
1288 + Note: "assert false" is treated in a special way by the
1290 + | Pexp_lazy of expression
1292 + | Pexp_poly of expression * core_type option
1293 + (* Used for method bodies.
1295 + Can only be used as the expression under Cfk_concrete
1296 + for methods (not values). *)
1297 + | Pexp_object of class_structure
1298 + (* object ... end *)
1299 + | Pexp_newtype of string * expression
1300 + (* fun (type t) -> E *)
1301 + | Pexp_pack of module_expr
1304 + (module ME : S) is represented as
1305 + Pexp_constraint(Pexp_pack, Ptyp_package S) *)
1306 + | Pexp_open of override_flag * Longident.t loc * expression
1307 + (* let open M in E
1310 + | Pexp_extension of extension
1313 +and case = (* (P -> E) or (P when E0 -> E) *)
1316 + pc_guard: expression option;
1317 + pc_rhs: expression;
1320 +(* Value descriptions *)
1322 +and value_description =
1324 + pval_name: string loc;
1325 + pval_type: core_type;
1326 + pval_prim: string list;
1327 + pval_attributes: attributes; (* ... [@@id1] [@@id2] *)
1328 + pval_loc: Location.t;
1332 + val x: T (prim = [])
1333 + external x: T = "s1" ... "sn" (prim = ["s1";..."sn"])
1335 + Note: when used under Pstr_primitive, prim cannot be empty
1338 +(* Type declarations *)
1340 +and type_declaration =
1342 + ptype_name: string loc;
1343 + ptype_params: (core_type * variance) list;
1344 + (* ('a1,...'an) t; None represents _*)
1345 + ptype_cstrs: (core_type * core_type * Location.t) list;
1346 + (* ... constraint T1=T1' ... constraint Tn=Tn' *)
1347 + ptype_kind: type_kind;
1348 + ptype_private: private_flag; (* = private ... *)
1349 + ptype_manifest: core_type option; (* = T *)
1350 + ptype_attributes: attributes; (* ... [@@id1] [@@id2] *)
1351 + ptype_loc: Location.t;
1355 + type t (abstract, no manifest)
1356 + type t = T0 (abstract, manifest=T0)
1357 + type t = C of T | ... (variant, no manifest)
1358 + type t = T0 = C of T | ... (variant, manifest=T0)
1359 + type t = {l: T; ...} (record, no manifest)
1360 + type t = T0 = {l : T; ...} (record, manifest=T0)
1361 + type t = .. (open, no manifest)
1366 + | Ptype_variant of constructor_declaration list
1367 + (* Invariant: non-empty list *)
1368 + | Ptype_record of label_declaration list
1369 + (* Invariant: non-empty list *)
1372 +and label_declaration =
1374 + pld_name: string loc;
1375 + pld_mutable: mutable_flag;
1376 + pld_type: core_type;
1377 + pld_loc: Location.t;
1378 + pld_attributes: attributes; (* l [@id1] [@id2] : T *)
1381 +(* { ...; l: T; ... } (mutable=Immutable)
1382 + { ...; mutable l: T; ... } (mutable=Mutable)
1384 + Note: T can be a Ptyp_poly.
1387 +and constructor_declaration =
1389 + pcd_name: string loc;
1390 + pcd_args: core_type list;
1391 + pcd_res: core_type option;
1392 + pcd_loc: Location.t;
1393 + pcd_attributes: attributes; (* C [@id1] [@id2] of ... *)
1396 + | C of T1 * ... * Tn (res = None)
1397 + | C: T0 (args = [], res = Some T0)
1398 + | C: T1 * ... * Tn -> T0 (res = Some T0)
1401 +and type_extension =
1403 + ptyext_path: Longident.t loc;
1404 + ptyext_params: (core_type * variance) list;
1405 + ptyext_constructors: extension_constructor list;
1406 + ptyext_private: private_flag;
1407 + ptyext_attributes: attributes; (* ... [@@id1] [@@id2] *)
1413 +and extension_constructor =
1415 + pext_name: string loc;
1416 + pext_kind : extension_constructor_kind;
1417 + pext_loc : Location.t;
1418 + pext_attributes: attributes; (* C [@id1] [@id2] of ... *)
1421 +and extension_constructor_kind =
1422 + Pext_decl of core_type list * core_type option
1424 + | C of T1 * ... * Tn ([T1; ...; Tn], None)
1425 + | C: T0 ([], Some T0)
1426 + | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
1428 + | Pext_rebind of Longident.t loc
1433 +(** {2 Class language} *)
1435 +(* Type expressions for the class language *)
1439 + pcty_desc: class_type_desc;
1440 + pcty_loc: Location.t;
1441 + pcty_attributes: attributes; (* ... [@id1] [@id2] *)
1444 +and class_type_desc =
1445 + | Pcty_constr of Longident.t loc * core_type list
1447 + ['a1, ..., 'an] c *)
1448 + | Pcty_signature of class_signature
1449 + (* object ... end *)
1450 + | Pcty_arrow of label * core_type * class_type
1451 + (* T -> CT (label = "")
1452 + ~l:T -> CT (label = "l")
1453 + ?l:T -> CT (label = "?l")
1455 + | Pcty_extension of extension
1458 +and class_signature =
1460 + pcsig_self: core_type;
1461 + pcsig_fields: class_type_field list;
1463 +(* object('selfpat) ... end
1464 + object ... end (self = Ptyp_any)
1467 +and class_type_field =
1469 + pctf_desc: class_type_field_desc;
1470 + pctf_loc: Location.t;
1471 + pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
1474 +and class_type_field_desc =
1475 + | Pctf_inherit of class_type
1477 + | Pctf_val of (string * mutable_flag * virtual_flag * core_type)
1479 + | Pctf_method of (string * private_flag * virtual_flag * core_type)
1482 + Note: T can be a Ptyp_poly.
1484 + | Pctf_constraint of (core_type * core_type)
1485 + (* constraint T1 = T2 *)
1486 + | Pctf_attribute of attribute
1488 + | Pctf_extension of extension
1491 +and 'a class_infos =
1493 + pci_virt: virtual_flag;
1494 + pci_params: (core_type * variance) list;
1495 + pci_name: string loc;
1497 + pci_loc: Location.t;
1498 + pci_attributes: attributes; (* ... [@@id1] [@@id2] *)
1501 + class ['a1,...,'an] c = ...
1502 + class virtual c = ...
1504 + Also used for "class type" declaration.
1507 +and class_description = class_type class_infos
1509 +and class_type_declaration = class_type class_infos
1511 +(* Value expressions for the class language *)
1515 + pcl_desc: class_expr_desc;
1516 + pcl_loc: Location.t;
1517 + pcl_attributes: attributes; (* ... [@id1] [@id2] *)
1520 +and class_expr_desc =
1521 + | Pcl_constr of Longident.t loc * core_type list
1523 + ['a1, ..., 'an] c *)
1524 + | Pcl_structure of class_structure
1525 + (* object ... end *)
1526 + | Pcl_fun of label * expression option * pattern * class_expr
1527 + (* fun P -> CE (lab = "", None)
1528 + fun ~l:P -> CE (lab = "l", None)
1529 + fun ?l:P -> CE (lab = "?l", None)
1530 + fun ?l:(P = E0) -> CE (lab = "?l", Some E0)
1532 + | Pcl_apply of class_expr * (label * expression) list
1533 + (* CE ~l1:E1 ... ~ln:En
1534 + li can be empty (non labeled argument) or start with '?'
1535 + (optional argument).
1539 + | Pcl_let of rec_flag * value_binding list * class_expr
1540 + (* let P1 = E1 and ... and Pn = EN in CE (flag = Nonrecursive)
1541 + let rec P1 = E1 and ... and Pn = EN in CE (flag = Recursive)
1543 + | Pcl_constraint of class_expr * class_type
1545 + | Pcl_extension of extension
1548 +and class_structure =
1550 + pcstr_self: pattern;
1551 + pcstr_fields: class_field list;
1553 +(* object(selfpat) ... end
1554 + object ... end (self = Ppat_any)
1559 + pcf_desc: class_field_desc;
1560 + pcf_loc: Location.t;
1561 + pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
1564 +and class_field_desc =
1565 + | Pcf_inherit of override_flag * class_expr * string option
1571 + | Pcf_val of (string loc * mutable_flag * class_field_kind)
1575 + | Pcf_method of (string loc * private_flag * class_field_kind)
1576 + (* method x = E (E can be a Pexp_poly)
1577 + method virtual x: T (T can be a Ptyp_poly)
1579 + | Pcf_constraint of (core_type * core_type)
1580 + (* constraint T1 = T2 *)
1581 + | Pcf_initializer of expression
1582 + (* initializer E *)
1583 + | Pcf_attribute of attribute
1585 + | Pcf_extension of extension
1588 +and class_field_kind =
1589 + | Cfk_virtual of core_type
1590 + | Cfk_concrete of override_flag * expression
1592 +and class_declaration = class_expr class_infos
1594 +(** {2 Module language} *)
1596 +(* Type expressions for the module language *)
1600 + pmty_desc: module_type_desc;
1601 + pmty_loc: Location.t;
1602 + pmty_attributes: attributes; (* ... [@id1] [@id2] *)
1605 +and module_type_desc =
1606 + | Pmty_ident of Longident.t loc
1608 + | Pmty_signature of signature
1610 + | Pmty_functor of string loc * module_type option * module_type
1611 + (* functor(X : MT1) -> MT2 *)
1612 + | Pmty_with of module_type * with_constraint list
1614 + | Pmty_typeof of module_expr
1615 + (* module type of ME *)
1616 + | Pmty_extension of extension
1618 + | Pmty_alias of Longident.t loc
1621 +and signature = signature_item list
1623 +and signature_item =
1625 + psig_desc: signature_item_desc;
1626 + psig_loc: Location.t;
1629 +and signature_item_desc =
1630 + | Psig_value of value_description
1633 + external x: T = "s1" ... "sn"
1635 + | Psig_type of type_declaration list
1636 + (* type t1 = ... and ... and tn = ... *)
1637 + | Psig_typext of type_extension
1638 + (* type t1 += ... *)
1639 + | Psig_exception of extension_constructor
1640 + (* exception C of T *)
1641 + | Psig_module of module_declaration
1642 + (* module X : MT *)
1643 + | Psig_recmodule of module_declaration list
1644 + (* module rec X1 : MT1 and ... and Xn : MTn *)
1645 + | Psig_modtype of module_type_declaration
1646 + (* module type S = MT
1648 + | Psig_open of open_description
1650 + | Psig_include of include_description
1652 + | Psig_class of class_description list
1653 + (* class c1 : ... and ... and cn : ... *)
1654 + | Psig_class_type of class_type_declaration list
1655 + (* class type ct1 = ... and ... and ctn = ... *)
1656 + | Psig_attribute of attribute
1658 + | Psig_extension of extension * attributes
1661 +and module_declaration =
1663 + pmd_name: string loc;
1664 + pmd_type: module_type;
1665 + pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
1666 + pmd_loc: Location.t;
1670 +and module_type_declaration =
1672 + pmtd_name: string loc;
1673 + pmtd_type: module_type option;
1674 + pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
1675 + pmtd_loc: Location.t;
1678 + S (abstract module type declaration, pmtd_type = None)
1681 +and open_description =
1683 + popen_lid: Longident.t loc;
1684 + popen_override: override_flag;
1685 + popen_loc: Location.t;
1686 + popen_attributes: attributes;
1688 +(* open! X - popen_override = Override (silences the 'used identifier
1689 + shadowing' warning)
1690 + open X - popen_override = Fresh
1693 +and 'a include_infos =
1696 + pincl_loc: Location.t;
1697 + pincl_attributes: attributes;
1700 +and include_description = module_type include_infos
1703 +and include_declaration = module_expr include_infos
1706 +and with_constraint =
1707 + | Pwith_type of Longident.t loc * type_declaration
1708 + (* with type X.t = ...
1710 + Note: the last component of the longident must match
1711 + the name of the type_declaration. *)
1712 + | Pwith_module of Longident.t loc * Longident.t loc
1713 + (* with module X.Y = Z *)
1714 + | Pwith_typesubst of type_declaration
1715 + (* with type t := ... *)
1716 + | Pwith_modsubst of string loc * Longident.t loc
1717 + (* with module X := Z *)
1719 +(* Value expressions for the module language *)
1723 + pmod_desc: module_expr_desc;
1724 + pmod_loc: Location.t;
1725 + pmod_attributes: attributes; (* ... [@id1] [@id2] *)
1728 +and module_expr_desc =
1729 + | Pmod_ident of Longident.t loc
1731 + | Pmod_structure of structure
1732 + (* struct ... end *)
1733 + | Pmod_functor of string loc * module_type option * module_expr
1734 + (* functor(X : MT1) -> ME *)
1735 + | Pmod_apply of module_expr * module_expr
1737 + | Pmod_constraint of module_expr * module_type
1739 + | Pmod_unpack of expression
1741 + | Pmod_extension of extension
1744 +and structure = structure_item list
1746 +and structure_item =
1748 + pstr_desc: structure_item_desc;
1749 + pstr_loc: Location.t;
1752 +and structure_item_desc =
1753 + | Pstr_eval of expression * attributes
1755 + | Pstr_value of rec_flag * value_binding list
1756 + (* let P1 = E1 and ... and Pn = EN (flag = Nonrecursive)
1757 + let rec P1 = E1 and ... and Pn = EN (flag = Recursive)
1759 + | Pstr_primitive of value_description
1760 + (* external x: T = "s1" ... "sn" *)
1761 + | Pstr_type of type_declaration list
1762 + (* type t1 = ... and ... and tn = ... *)
1763 + | Pstr_typext of type_extension
1764 + (* type t1 += ... *)
1765 + | Pstr_exception of extension_constructor
1766 + (* exception C of T
1767 + exception C = M.X *)
1768 + | Pstr_module of module_binding
1769 + (* module X = ME *)
1770 + | Pstr_recmodule of module_binding list
1771 + (* module rec X1 = ME1 and ... and Xn = MEn *)
1772 + | Pstr_modtype of module_type_declaration
1773 + (* module type S = MT *)
1774 + | Pstr_open of open_description
1776 + | Pstr_class of class_declaration list
1777 + (* class c1 = ... and ... and cn = ... *)
1778 + | Pstr_class_type of class_type_declaration list
1779 + (* class type ct1 = ... and ... and ctn = ... *)
1780 + | Pstr_include of include_declaration
1782 + | Pstr_attribute of attribute
1784 + | Pstr_extension of extension * attributes
1787 +and value_binding =
1790 + pvb_expr: expression;
1791 + pvb_attributes: attributes;
1792 + pvb_loc: Location.t;
1795 +and module_binding =
1797 + pmb_name: string loc;
1798 + pmb_expr: module_expr;
1799 + pmb_attributes: attributes;
1800 + pmb_loc: Location.t;
1804 +(** {2 Toplevel} *)
1806 +(* Toplevel phrases *)
1808 +type toplevel_phrase =
1809 + | Ptop_def of structure
1810 + | Ptop_dir of string * directive_argument
1811 + (* #use, #load ... *)
1813 +and directive_argument =
1815 + | Pdir_string of string
1817 + | Pdir_ident of Longident.t
1818 + | Pdir_bool of bool
1819 diff --git a/ocaml_stuff/4.02.2/utils/.depend b/ocaml_stuff/4.02.2/utils/.depend
1820 new file mode 100644
1821 index 0000000..b261ffe
1823 +++ b/ocaml_stuff/4.02.2/utils/.depend
1825 +pconfig.cmo: pconfig.cmi
1826 +pconfig.cmx: pconfig.cmi
1827 diff --git a/ocaml_stuff/4.02.2/utils/.gitignore b/ocaml_stuff/4.02.2/utils/.gitignore
1828 new file mode 100644
1829 index 0000000..23e90de
1831 +++ b/ocaml_stuff/4.02.2/utils/.gitignore
1834 diff --git a/ocaml_stuff/4.02.2/utils/Makefile b/ocaml_stuff/4.02.2/utils/Makefile
1835 new file mode 100644
1836 index 0000000..f4ea281
1838 +++ b/ocaml_stuff/4.02.2/utils/Makefile
1842 +FILES=warnings.cmi pconfig.cmo
1850 + rm -f *.cm[oix] *.o
1853 + ocamldep $(INCL) *.ml* | sed -e 's/ *$$//' > .depend
1855 +.SUFFIXES: .mli .cmi .ml .cmo .cmx
1858 + $(OCAMLN)c $(INCL) -c $<
1861 + $(OCAMLN)c $(INCL) -c $<
1864 + $(OCAMLN)opt $(INCL) -c $<
1867 diff --git a/ocaml_stuff/4.02.2/utils/pconfig.ml b/ocaml_stuff/4.02.2/utils/pconfig.ml
1868 new file mode 100644
1869 index 0000000..e35511d
1871 +++ b/ocaml_stuff/4.02.2/utils/pconfig.ml
1873 +let ocaml_version = "4.02.2"
1874 +let ocaml_name = "ocaml"
1875 +let ast_impl_magic_number = "Caml1999M016"
1876 +let ast_intf_magic_number = "Caml1999N015"
1877 diff --git a/ocaml_stuff/4.02.2/utils/pconfig.mli b/ocaml_stuff/4.02.2/utils/pconfig.mli
1878 new file mode 100644
1879 index 0000000..f6382d3
1881 +++ b/ocaml_stuff/4.02.2/utils/pconfig.mli
1883 +val ocaml_version : string
1884 +val ocaml_name : string
1885 +val ast_impl_magic_number : string
1886 +val ast_intf_magic_number : string
1887 diff --git a/ocaml_stuff/4.02.2/utils/warnings.mli b/ocaml_stuff/4.02.2/utils/warnings.mli
1888 new file mode 100644
1889 index 0000000..ffd943f
1891 +++ b/ocaml_stuff/4.02.2/utils/warnings.mli
1893 +(***********************************************************************)
1897 +(* Pierre Weis && Damien Doligez, INRIA Rocquencourt *)
1899 +(* Copyright 1998 Institut National de Recherche en Informatique et *)
1900 +(* en Automatique. All rights reserved. This file is distributed *)
1901 +(* under the terms of the Q Public License version 1.0. *)
1903 +(***********************************************************************)
1908 + | Comment_start (* 1 *)
1909 + | Comment_not_end (* 2 *)
1910 + | Deprecated of string (* 3 *)
1911 + | Fragile_match of string (* 4 *)
1912 + | Partial_application (* 5 *)
1913 + | Labels_omitted (* 6 *)
1914 + | Method_override of string list (* 7 *)
1915 + | Partial_match of string (* 8 *)
1916 + | Non_closed_record_pattern of string (* 9 *)
1917 + | Statement_type (* 10 *)
1918 + | Unused_match (* 11 *)
1919 + | Unused_pat (* 12 *)
1920 + | Instance_variable_override of string list (* 13 *)
1921 + | Illegal_backslash (* 14 *)
1922 + | Implicit_public_methods of string list (* 15 *)
1923 + | Unerasable_optional_argument (* 16 *)
1924 + | Undeclared_virtual_method of string (* 17 *)
1925 + | Not_principal of string (* 18 *)
1926 + | Without_principality of string (* 19 *)
1927 + | Unused_argument (* 20 *)
1928 + | Nonreturning_statement (* 21 *)
1929 + | Preprocessor of string (* 22 *)
1930 + | Useless_record_with (* 23 *)
1931 + | Bad_module_name of string (* 24 *)
1932 + | All_clauses_guarded (* 25 *)
1933 + | Unused_var of string (* 26 *)
1934 + | Unused_var_strict of string (* 27 *)
1935 + | Wildcard_arg_to_constant_constr (* 28 *)
1936 + | Eol_in_string (* 29 *)
1937 + | Duplicate_definitions of string * string * string * string (* 30 *)
1938 + | Multiple_definition of string * string * string (* 31 *)
1939 + | Unused_value_declaration of string (* 32 *)
1940 + | Unused_open of string (* 33 *)
1941 + | Unused_type_declaration of string (* 34 *)
1942 + | Unused_for_index of string (* 35 *)
1943 + | Unused_ancestor of string (* 36 *)
1944 + | Unused_constructor of string * bool * bool (* 37 *)
1945 + | Unused_extension of string * bool * bool (* 38 *)
1946 + | Unused_rec_flag (* 39 *)
1947 + | Name_out_of_scope of string * string list * bool (* 40 *)
1948 + | Ambiguous_name of string list * string list * bool (* 41 *)
1949 + | Disambiguated_name of string (* 42 *)
1950 + | Nonoptional_label of string (* 43 *)
1951 + | Open_shadow_identifier of string * string (* 44 *)
1952 + | Open_shadow_label_constructor of string * string (* 45 *)
1953 + | Bad_env_variable of string * string (* 46 *)
1954 + | Attribute_payload of string * string (* 47 *)
1955 + | Eliminated_optional_arguments of string list (* 48 *)
1956 + | No_cmi_file of string (* 49 *)
1957 + | Bad_docstring of bool (* 50 *)
1960 +val parse_options : bool -> string -> unit;;
1962 +val is_active : t -> bool;;
1963 +val is_error : t -> bool;;
1965 +val defaults_w : string;;
1966 +val defaults_warn_error : string;;
1968 +val print : formatter -> t -> unit;;
1970 +exception Errors of int;;
1972 +val check_fatal : unit -> unit;;
1974 +val help_warnings: unit -> unit
1977 +val backup: unit -> state
1978 +val restore: state -> unit