Module of module types for OrderedType,ComparableType,Printable,Serializable,Discrete...
[ocaml.git] / camlp4 / boot / Camlp4.ml
blobad3b81c35c34d5ccb88dca22243cf772b1cde921
1 module Debug :
2 sig
3 (****************************************************************************)
4 (* *)
5 (* Objective Caml *)
6 (* *)
7 (* INRIA Rocquencourt *)
8 (* *)
9 (* Copyright 2006 Institut National de Recherche en Informatique et *)
10 (* en Automatique. All rights reserved. This file is distributed under *)
11 (* the terms of the GNU Library General Public License, with the special *)
12 (* exception on linking described in LICENSE at the top of the Objective *)
13 (* Caml source tree. *)
14 (* *)
15 (****************************************************************************)
16 (* Authors:
17 * - Daniel de Rauglaudre: initial version
18 * - Nicolas Pouillard: refactoring
20 (* camlp4r *)
21 type section = string
23 val mode : section -> bool
25 val printf : section -> ('a, Format.formatter, unit) format -> 'a
27 end =
28 struct
29 (****************************************************************************)
30 (* *)
31 (* Objective Caml *)
32 (* *)
33 (* INRIA Rocquencourt *)
34 (* *)
35 (* Copyright 2006 Institut National de Recherche en Informatique et *)
36 (* en Automatique. All rights reserved. This file is distributed under *)
37 (* the terms of the GNU Library General Public License, with the special *)
38 (* exception on linking described in LICENSE at the top of the Objective *)
39 (* Caml source tree. *)
40 (* *)
41 (****************************************************************************)
42 (* Authors:
43 * - Daniel de Rauglaudre: initial version
44 * - Nicolas Pouillard: refactoring
46 (* camlp4r *)
47 open Format
49 module Debug = struct let mode _ = false
50 end
52 type section = string
54 let out_channel =
55 try
56 let f = Sys.getenv "CAMLP4_DEBUG_FILE"
58 open_out_gen [ Open_wronly; Open_creat; Open_append; Open_text ]
59 0o666 f
60 with | Not_found -> stderr
62 module StringSet = Set.Make(String)
64 let mode =
65 try
66 let str = Sys.getenv "CAMLP4_DEBUG" in
67 let rec loop acc i =
68 try
69 let pos = String.index_from str i ':'
71 loop (StringSet.add (String.sub str i (pos - i)) acc) (pos + 1)
72 with
73 | Not_found ->
74 StringSet.add (String.sub str i ((String.length str) - i)) acc in
75 let sections = loop StringSet.empty 0
77 if StringSet.mem "*" sections
78 then (fun _ -> true)
79 else (fun x -> StringSet.mem x sections)
80 with | Not_found -> (fun _ -> false)
82 let formatter =
83 let header = "camlp4-debug: " in
84 let normal s =
85 let rec self from accu =
86 try
87 let i = String.index_from s from '\n'
88 in self (i + 1) ((String.sub s from ((i - from) + 1)) :: accu)
89 with
90 | Not_found ->
91 (String.sub s from ((String.length s) - from)) :: accu
92 in String.concat header (List.rev (self 0 [])) in
93 let after_new_line str = header ^ (normal str) in
94 let f = ref after_new_line in
95 let output str chr =
96 (output_string out_channel (!f str);
97 output_char out_channel chr;
98 f := if chr = '\n' then after_new_line else normal)
100 make_formatter
101 (fun buf pos len ->
102 let p = pred len in output (String.sub buf pos p) buf.[pos + p])
103 (fun () -> flush out_channel)
105 let printf section fmt = fprintf formatter ("%s: " ^^ fmt) section
109 module Options :
111 (****************************************************************************)
112 (* *)
113 (* Objective Caml *)
114 (* *)
115 (* INRIA Rocquencourt *)
116 (* *)
117 (* Copyright 2006 Institut National de Recherche en Informatique et *)
118 (* en Automatique. All rights reserved. This file is distributed under *)
119 (* the terms of the GNU Library General Public License, with the special *)
120 (* exception on linking described in LICENSE at the top of the Objective *)
121 (* Caml source tree. *)
122 (* *)
123 (****************************************************************************)
124 (* Authors:
125 * - Daniel de Rauglaudre: initial version
126 * - Nicolas Pouillard: refactoring
128 type spec_list = (string * Arg.spec * string) list
130 val init : spec_list -> unit
132 val add : string -> Arg.spec -> string -> unit
134 (** Add an option to the command line options. *)
135 val print_usage_list : spec_list -> unit
137 val ext_spec_list : unit -> spec_list
139 val parse : (string -> unit) -> string array -> string list
141 end =
142 struct
143 (****************************************************************************)
144 (* *)
145 (* Objective Caml *)
146 (* *)
147 (* INRIA Rocquencourt *)
148 (* *)
149 (* Copyright 2006 Institut National de Recherche en Informatique et *)
150 (* en Automatique. All rights reserved. This file is distributed under *)
151 (* the terms of the GNU Library General Public License, with the special *)
152 (* exception on linking described in LICENSE at the top of the Objective *)
153 (* Caml source tree. *)
154 (* *)
155 (****************************************************************************)
156 (* Authors:
157 * - Daniel de Rauglaudre: initial version
158 * - Nicolas Pouillard: refactoring
160 type spec_list = (string * Arg.spec * string) list
162 open Format
164 let rec action_arg s sl =
165 function
166 | Arg.Unit f -> if s = "" then (f (); Some sl) else None
167 | Arg.Bool f ->
168 if s = ""
169 then
170 (match sl with
171 | s :: sl ->
172 (try (f (bool_of_string s); Some sl)
173 with | Invalid_argument "bool_of_string" -> None)
174 | [] -> None)
175 else
176 (try (f (bool_of_string s); Some sl)
177 with | Invalid_argument "bool_of_string" -> None)
178 | Arg.Set r -> if s = "" then (r := true; Some sl) else None
179 | Arg.Clear r -> if s = "" then (r := false; Some sl) else None
180 | Arg.Rest f -> (List.iter f (s :: sl); Some [])
181 | Arg.String f ->
182 if s = ""
183 then (match sl with | s :: sl -> (f s; Some sl) | [] -> None)
184 else (f s; Some sl)
185 | Arg.Set_string r ->
186 if s = ""
187 then (match sl with | s :: sl -> (r := s; Some sl) | [] -> None)
188 else (r := s; Some sl)
189 | Arg.Int f ->
190 if s = ""
191 then
192 (match sl with
193 | s :: sl ->
194 (try (f (int_of_string s); Some sl)
195 with | Failure "int_of_string" -> None)
196 | [] -> None)
197 else
198 (try (f (int_of_string s); Some sl)
199 with | Failure "int_of_string" -> None)
200 | Arg.Set_int r ->
201 if s = ""
202 then
203 (match sl with
204 | s :: sl ->
205 (try (r := int_of_string s; Some sl)
206 with | Failure "int_of_string" -> None)
207 | [] -> None)
208 else
209 (try (r := int_of_string s; Some sl)
210 with | Failure "int_of_string" -> None)
211 | Arg.Float f ->
212 if s = ""
213 then
214 (match sl with
215 | s :: sl -> (f (float_of_string s); Some sl)
216 | [] -> None)
217 else (f (float_of_string s); Some sl)
218 | Arg.Set_float r ->
219 if s = ""
220 then
221 (match sl with
222 | s :: sl -> (r := float_of_string s; Some sl)
223 | [] -> None)
224 else (r := float_of_string s; Some sl)
225 | Arg.Tuple specs ->
226 let rec action_args s sl =
227 (function
228 | [] -> Some sl
229 | spec :: spec_list ->
230 (match action_arg s sl spec with
231 | None -> action_args "" [] spec_list
232 | Some (s :: sl) -> action_args s sl spec_list
233 | Some sl -> action_args "" sl spec_list))
234 in action_args s sl specs
235 | Arg.Symbol (syms, f) ->
236 (match if s = "" then sl else s :: sl with
237 | s :: sl when List.mem s syms -> (f s; Some sl)
238 | _ -> None)
240 let common_start s1 s2 =
241 let rec loop i =
242 if (i == (String.length s1)) || (i == (String.length s2))
243 then i
244 else if s1.[i] == s2.[i] then loop (i + 1) else i
245 in loop 0
247 let parse_arg fold s sl =
248 fold
249 (fun (name, action, _) acu ->
250 let i = common_start s name
252 if i == (String.length name)
253 then
254 (try
255 action_arg (String.sub s i ((String.length s) - i)) sl
256 action
257 with | Arg.Bad _ -> acu)
258 else acu)
259 None
261 let rec parse_aux fold anon_fun =
262 function
263 | [] -> []
264 | s :: sl ->
265 if ((String.length s) > 1) && (s.[0] = '-')
266 then
267 (match parse_arg fold s sl with
268 | Some sl -> parse_aux fold anon_fun sl
269 | None -> s :: (parse_aux fold anon_fun sl))
270 else ((anon_fun s : unit); parse_aux fold anon_fun sl)
272 let align_doc key s =
273 let s =
274 let rec loop i =
275 if i = (String.length s)
276 then ""
277 else
278 if s.[i] = ' '
279 then loop (i + 1)
280 else String.sub s i ((String.length s) - i)
281 in loop 0 in
282 let (p, s) =
283 if (String.length s) > 0
284 then
285 if s.[0] = '<'
286 then
287 (let rec loop i =
288 if i = (String.length s)
289 then ("", s)
290 else
291 if s.[i] <> '>'
292 then loop (i + 1)
293 else
294 (let p = String.sub s 0 (i + 1) in
295 let rec loop i =
296 if i >= (String.length s)
297 then (p, "")
298 else
299 if s.[i] = ' '
300 then loop (i + 1)
301 else (p, (String.sub s i ((String.length s) - i)))
302 in loop (i + 1))
303 in loop 0)
304 else ("", s)
305 else ("", "") in
306 let tab =
307 String.make (max 1 ((16 - (String.length key)) - (String.length p)))
309 in p ^ (tab ^ s)
311 let make_symlist l =
312 match l with
313 | [] -> "<none>"
314 | h :: t ->
315 (List.fold_left (fun x y -> x ^ ("|" ^ y)) ("{" ^ h) t) ^ "}"
317 let print_usage_list l =
318 List.iter
319 (fun (key, spec, doc) ->
320 match spec with
321 | Arg.Symbol (symbs, _) ->
322 let s = make_symlist symbs in
323 let synt = key ^ (" " ^ s)
324 in eprintf " %s %s\n" synt (align_doc synt doc)
325 | _ -> eprintf " %s %s\n" key (align_doc key doc))
328 let remaining_args argv =
329 let rec loop l i =
330 if i == (Array.length argv) then l else loop (argv.(i) :: l) (i + 1)
331 in List.rev (loop [] (!Arg.current + 1))
333 let init_spec_list = ref []
335 let ext_spec_list = ref []
337 let init spec_list = init_spec_list := spec_list
339 let add name spec descr =
340 ext_spec_list := (name, spec, descr) :: !ext_spec_list
342 let fold f init =
343 let spec_list = !init_spec_list @ !ext_spec_list in
344 let specs = Sort.list (fun (k1, _, _) (k2, _, _) -> k1 >= k2) spec_list
345 in List.fold_right f specs init
347 let parse anon_fun argv =
348 let remaining_args = remaining_args argv
349 in parse_aux fold anon_fun remaining_args
351 let ext_spec_list () = !ext_spec_list
355 module Sig =
356 struct
357 (* camlp4r *)
358 (****************************************************************************)
359 (* *)
360 (* Objective Caml *)
361 (* *)
362 (* INRIA Rocquencourt *)
363 (* *)
364 (* Copyright 2006 Institut National de Recherche en Informatique et *)
365 (* en Automatique. All rights reserved. This file is distributed under *)
366 (* the terms of the GNU Library General Public License, with the special *)
367 (* exception on linking described in LICENSE at the top of the Objective *)
368 (* Caml source tree. *)
369 (* *)
370 (****************************************************************************)
371 (* Authors:
372 * - Daniel de Rauglaudre: initial version
373 * - Nicolas Pouillard: refactoring
375 (** Camlp4 signature repository *)
376 (** {6 Basic signatures} *)
377 (** Signature with just a type. *)
378 module type Type = sig type t
381 (** Signature for errors modules, an Error modules can be registred with
382 the {!ErrorHandler.Register} functor in order to be well printed. *)
383 module type Error =
385 type t
387 exception E of t
389 val to_string : t -> string
391 val print : Format.formatter -> t -> unit
395 (** A signature for extensions identifiers. *)
396 module type Id =
398 (** The name of the extension, typically the module name. *)
399 val name : string
401 (** The version of the extension, typically $Id$ with a versionning system. *)
402 val version : string
406 (** A signature for warnings abstract from locations. *)
407 module Warning (Loc : Type) =
408 struct
409 module type S =
411 type warning = Loc.t -> string -> unit
413 val default_warning : warning
415 val current_warning : warning ref
417 val print_warning : warning
423 (** {6 Advanced signatures} *)
424 (** A signature for locations. *)
425 module type Loc =
427 type t
429 (** Return a start location for the given file name.
430 This location starts at the begining of the file. *)
431 val mk : string -> t
433 (** The [ghost] location can be used when no location
434 information is available. *)
435 val ghost : t
437 (** {6 Conversion functions} *)
438 (** Return a location where both positions are set the given position. *)
439 val of_lexing_position : Lexing.position -> t
441 (** Return an OCaml location. *)
442 val to_ocaml_location : t -> Camlp4_import.Location.t
444 (** Return a location from an OCaml location. *)
445 val of_ocaml_location : Camlp4_import.Location.t -> t
447 (** Return a location from ocamllex buffer. *)
448 val of_lexbuf : Lexing.lexbuf -> t
450 (** Return a location from [(file_name, start_line, start_bol, start_off,
451 stop_line, stop_bol, stop_off, ghost)]. *)
452 val of_tuple :
453 (string * int * int * int * int * int * int * bool) -> t
455 (** Return [(file_name, start_line, start_bol, start_off,
456 stop_line, stop_bol, stop_off, ghost)]. *)
457 val to_tuple :
458 t -> (string * int * int * int * int * int * int * bool)
460 (** [merge loc1 loc2] Return a location that starts at [loc1] and end at [loc2]. *)
461 val merge : t -> t -> t
463 (** The stop pos becomes equal to the start pos. *)
464 val join : t -> t
466 (** [move selector n loc]
467 Return the location where positions are moved.
468 Affected positions are chosen with [selector].
469 Returned positions have their character offset plus [n]. *)
470 val move : [ | `start | `stop | `both ] -> int -> t -> t
472 (** [shift n loc] Return the location where the new start position is the old
473 stop position, and where the new stop position character offset is the
474 old one plus [n]. *)
475 val shift : int -> t -> t
477 (** [move_line n loc] Return the location with the old line count plus [n].
478 The "begin of line" of both positions become the current offset. *)
479 val move_line : int -> t -> t
481 (** {6 Accessors} *)
482 (** Return the file name *)
483 val file_name : t -> string
485 (** Return the line number of the begining of this location. *)
486 val start_line : t -> int
488 (** Return the line number of the ending of this location. *)
489 val stop_line : t -> int
491 (** Returns the number of characters from the begining of the file
492 to the begining of the line of location's begining. *)
493 val start_bol : t -> int
495 (** Returns the number of characters from the begining of the file
496 to the begining of the line of location's ending. *)
497 val stop_bol : t -> int
499 (** Returns the number of characters from the begining of the file
500 of the begining of this location. *)
501 val start_off : t -> int
503 (** Return the number of characters from the begining of the file
504 of the ending of this location. *)
505 val stop_off : t -> int
507 (** Return the start position as a Lexing.position. *)
508 val start_pos : t -> Lexing.position
510 (** Return the stop position as a Lexing.position. *)
511 val stop_pos : t -> Lexing.position
513 (** Generally, return true if this location does not come
514 from an input stream. *)
515 val is_ghost : t -> bool
517 (** Return the associated ghost location. *)
518 val ghostify : t -> t
520 (** Return the location with the give file name *)
521 val set_file_name : string -> t -> t
523 (** [strictly_before loc1 loc2] True if the stop position of [loc1] is
524 strictly_before the start position of [loc2]. *)
525 val strictly_before : t -> t -> bool
527 (** Return the location with an absolute file name. *)
528 val make_absolute : t -> t
530 (** Print the location into the formatter in a format suitable for error
531 reporting. *)
532 val print : Format.formatter -> t -> unit
534 (** Print the location in a short format useful for debugging. *)
535 val dump : Format.formatter -> t -> unit
537 (** Same as {!print} but return a string instead of printting it. *)
538 val to_string : t -> string
540 (** [Exc_located loc e] is an encapsulation of the exception [e] with
541 the input location [loc]. To be used in quotation expanders
542 and in grammars to specify some input location for an error.
543 Do not raise this exception directly: rather use the following
544 function [Loc.raise]. *)
545 exception Exc_located of t * exn
547 (** [raise loc e], if [e] is already an [Exc_located] exception,
548 re-raise it, else raise the exception [Exc_located loc e]. *)
549 val raise : t -> exn -> 'a
551 (** The name of the location variable used in grammars and in
552 the predefined quotations for OCaml syntax trees. Default: [_loc]. *)
553 val name : string ref
557 (** Abstract syntax tree minimal signature.
558 Types of this signature are abstract.
559 See the {!Camlp4Ast} signature for a concrete definition. *)
560 module type Ast =
562 (** {6 Syntactic categories as abstract types} *)
563 type loc
565 type meta_bool
567 type 'a meta_option
569 type 'a meta_list
571 type ctyp
573 type patt
575 type expr
577 type module_type
579 type sig_item
581 type with_constr
583 type module_expr
585 type str_item
587 type class_type
589 type class_sig_item
591 type class_expr
593 type class_str_item
595 type match_case
597 type ident
599 type binding
601 type rec_binding
603 type module_binding
605 (** {6 Location accessors} *)
606 val loc_of_ctyp : ctyp -> loc
608 val loc_of_patt : patt -> loc
610 val loc_of_expr : expr -> loc
612 val loc_of_module_type : module_type -> loc
614 val loc_of_module_expr : module_expr -> loc
616 val loc_of_sig_item : sig_item -> loc
618 val loc_of_str_item : str_item -> loc
620 val loc_of_class_type : class_type -> loc
622 val loc_of_class_sig_item : class_sig_item -> loc
624 val loc_of_class_expr : class_expr -> loc
626 val loc_of_class_str_item : class_str_item -> loc
628 val loc_of_with_constr : with_constr -> loc
630 val loc_of_binding : binding -> loc
632 val loc_of_rec_binding : rec_binding -> loc
634 val loc_of_module_binding : module_binding -> loc
636 val loc_of_match_case : match_case -> loc
638 val loc_of_ident : ident -> loc
640 (** {6 Traversals} *)
641 (** This class is the base class for map traversal on the Ast.
642 To make a custom traversal class one just extend it like that:
644 This example swap pairs expression contents:
645 open Camlp4.PreCast;
646 [class swap = object
647 inherit Ast.map as super;
648 method expr e =
649 match super#expr e with
650 \[ <:expr\@_loc< ($e1$, $e2$) >> -> <:expr< ($e2$, $e1$) >>
651 | e -> e \];
652 end;
653 value _loc = Loc.ghost;
654 value map = (new swap)#expr;
655 assert (map <:expr< fun x -> (x, 42) >> = <:expr< fun x -> (42, x) >>);]
657 class map :
658 object ('self_type)
659 method string : string -> string
661 method list :
662 'a 'b. ('self_type -> 'a -> 'b) -> 'a list -> 'b list
664 method meta_bool : meta_bool -> meta_bool
666 method meta_option :
667 'a 'b.
668 ('self_type -> 'a -> 'b) -> 'a meta_option -> 'b meta_option
670 method meta_list :
671 'a 'b. ('self_type -> 'a -> 'b) -> 'a meta_list -> 'b meta_list
673 method loc : loc -> loc
675 method expr : expr -> expr
677 method patt : patt -> patt
679 method ctyp : ctyp -> ctyp
681 method str_item : str_item -> str_item
683 method sig_item : sig_item -> sig_item
685 method module_expr : module_expr -> module_expr
687 method module_type : module_type -> module_type
689 method class_expr : class_expr -> class_expr
691 method class_type : class_type -> class_type
693 method class_sig_item : class_sig_item -> class_sig_item
695 method class_str_item : class_str_item -> class_str_item
697 method with_constr : with_constr -> with_constr
699 method binding : binding -> binding
701 method rec_binding : rec_binding -> rec_binding
703 method module_binding : module_binding -> module_binding
705 method match_case : match_case -> match_case
707 method ident : ident -> ident
709 method unknown : 'a. 'a -> 'a
713 (** Fold style traversal *)
714 class fold :
715 object ('self_type)
716 method string : string -> 'self_type
718 method list :
719 'a. ('self_type -> 'a -> 'self_type) -> 'a list -> 'self_type
721 method meta_bool : meta_bool -> 'self_type
723 method meta_option :
725 ('self_type -> 'a -> 'self_type) ->
726 'a meta_option -> 'self_type
728 method meta_list :
730 ('self_type -> 'a -> 'self_type) ->
731 'a meta_list -> 'self_type
733 method loc : loc -> 'self_type
735 method expr : expr -> 'self_type
737 method patt : patt -> 'self_type
739 method ctyp : ctyp -> 'self_type
741 method str_item : str_item -> 'self_type
743 method sig_item : sig_item -> 'self_type
745 method module_expr : module_expr -> 'self_type
747 method module_type : module_type -> 'self_type
749 method class_expr : class_expr -> 'self_type
751 method class_type : class_type -> 'self_type
753 method class_sig_item : class_sig_item -> 'self_type
755 method class_str_item : class_str_item -> 'self_type
757 method with_constr : with_constr -> 'self_type
759 method binding : binding -> 'self_type
761 method rec_binding : rec_binding -> 'self_type
763 method module_binding : module_binding -> 'self_type
765 method match_case : match_case -> 'self_type
767 method ident : ident -> 'self_type
769 method unknown : 'a. 'a -> 'self_type
775 (** Signature for OCaml syntax trees. *)
777 This signature is an extension of {!Ast}
778 It provides:
779 - Types for all kinds of structure.
780 - Map: A base class for map traversals.
781 - Map classes and functions for common kinds.
783 == Core language ==
784 ctyp :: Representaion of types
785 patt :: The type of patterns
786 expr :: The type of expressions
787 match_case :: The type of cases for match/function/try constructions
788 ident :: The type of identifiers (including path like Foo(X).Bar.y)
789 binding :: The type of let bindings
790 rec_binding :: The type of record definitions
792 == Modules ==
793 module_type :: The type of module types
794 sig_item :: The type of signature items
795 str_item :: The type of structure items
796 module_expr :: The type of module expressions
797 module_binding :: The type of recursive module definitions
798 with_constr :: The type of `with' constraints
800 == Classes ==
801 class_type :: The type of class types
802 class_sig_item :: The type of class signature items
803 class_expr :: The type of class expressions
804 class_str_item :: The type of class structure items
806 module type Camlp4Ast =
808 (** The inner module for locations *)
809 module Loc : Loc
811 type (* i . i *)
812 (* i i *)
813 (* foo *)
814 (* Bar *)
815 (* $s$ *)
816 (* t as t *)
817 (* list 'a as 'a *)
818 (* _ *)
819 (* t t *)
820 (* list 'a *)
821 (* t -> t *)
822 (* int -> string *)
823 (* #i *)
824 (* #point *)
825 (* ~s:t *)
826 (* i *)
827 (* Lazy.t *)
828 (* t == t *)
829 (* type t = [ A | B ] == Foo.t *)
830 (* type t 'a 'b 'c = t constraint t = t constraint t = t *)
831 (* < (t)? (..)? > *)
832 (* < move : int -> 'a .. > as 'a *)
833 (* ?s:t *)
834 (* ! t . t *)
835 (* ! 'a . list 'a -> 'a *)
836 (* 's *)
837 (* +'s *)
838 (* -'s *)
839 (* `s *)
840 (* { t } *)
841 (* { foo : int ; bar : mutable string } *)
842 (* t : t *)
843 (* t; t *)
844 (* t, t *)
845 (* [ t ] *)
846 (* [ A of int and string | B ] *)
847 (* t of t *)
848 (* A of int *)
849 (* t and t *)
850 (* t | t *)
851 (* private t *)
852 (* mutable t *)
853 (* ( t ) *)
854 (* (int * string) *)
855 (* t * t *)
856 (* [ = t ] *)
857 (* [ > t ] *)
858 (* [ < t ] *)
859 (* [ < t > t ] *)
860 (* t & t *)
861 (* t of & t *)
862 (* $s$ *)
863 (* i *)
864 (* p as p *)
865 (* (Node x y as n) *)
866 (* $s$ *)
867 (* _ *)
868 (* p p *)
869 (* fun x y -> *)
870 (* [| p |] *)
871 (* p, p *)
872 (* p; p *)
873 (* c *)
874 (* 'x' *)
875 (* ~s or ~s:(p) *)
876 (* ?s or ?s:(p) *)
877 (* ?s:(p = e) or ?(p = e) *)
878 (* p | p *)
879 (* p .. p *)
880 (* { p } *)
881 (* i = p *)
882 (* s *)
883 (* ( p ) *)
884 (* (p : t) *)
885 (* #i *)
886 (* `s *)
887 (* i *)
888 (* e.e *)
889 (* $s$ *)
890 (* e e *)
891 (* e.(e) *)
892 (* [| e |] *)
893 (* e; e *)
894 (* assert False *)
895 (* assert e *)
896 (* e := e *)
897 (* 'c' *)
898 (* (e : t) or (e : t :> t) *)
899 (* 3.14 *)
900 (* for s = e to/downto e do { e } *)
901 (* fun [ mc ] *)
902 (* if e then e else e *)
903 (* 42 *)
904 (* ~s or ~s:e *)
905 (* lazy e *)
906 (* let b in e or let rec b in e *)
907 (* let module s = me in e *)
908 (* match e with [ mc ] *)
909 (* new i *)
910 (* object ((p))? (cst)? end *)
911 (* ?s or ?s:e *)
912 (* {< rb >} *)
913 (* { rb } or { (e) with rb } *)
914 (* do { e } *)
915 (* e#s *)
916 (* e.[e] *)
917 (* s *)
918 (* "foo" *)
919 (* try e with [ mc ] *)
920 (* (e) *)
921 (* e, e *)
922 (* (e : t) *)
923 (* `s *)
924 (* while e do { e } *)
925 (* i *)
926 (* A.B.C *)
927 (* functor (s : mt) -> mt *)
928 (* 's *)
929 (* sig sg end *)
930 (* mt with wc *)
931 (* $s$ *)
932 (* class cict *)
933 (* class type cict *)
934 (* sg ; sg *)
935 (* # s or # s e *)
936 (* exception t *)
937 (* external s : t = s ... s *)
938 (* include mt *)
939 (* module s : mt *)
940 (* module rec mb *)
941 (* module type s = mt *)
942 (* open i *)
943 (* type t *)
944 (* value s : t *)
945 (* $s$ *)
946 (* type t = t *)
947 (* module i = i *)
948 (* wc and wc *)
949 (* $s$ *)
950 (* bi and bi *)
951 (* let a = 42 and c = 43 *)
952 (* p = e *)
953 (* let patt = expr *)
954 (* $s$ *)
955 (* rb ; rb *)
956 (* i = e *)
957 (* $s$ *)
958 (* mb and mb *)
959 (* module rec (s : mt) = me and (s : mt) = me *)
960 (* s : mt = me *)
961 (* s : mt *)
962 (* $s$ *)
963 (* a | a *)
964 (* p (when e)? -> e *)
965 (* $s$ *)
966 (* i *)
967 (* me me *)
968 (* functor (s : mt) -> me *)
969 (* struct st end *)
970 (* (me : mt) *)
971 (* $s$ *)
972 (* class cice *)
973 (* class type cict *)
974 (* st ; st *)
975 (* # s or # s e *)
976 (* exception t or exception t = i *)
977 (*FIXME*)
978 (* e *)
979 (* external s : t = s ... s *)
980 (* include me *)
981 (* module s = me *)
982 (* module rec mb *)
983 (* module type s = mt *)
984 (* open i *)
985 (* type t *)
986 (* value (rec)? bi *)
987 (* $s$ *)
988 (* (virtual)? i ([ t ])? *)
989 (* [t] -> ct *)
990 (* object ((t))? (csg)? end *)
991 (* ct and ct *)
992 (* ct : ct *)
993 (* ct = ct *)
994 (* $s$ *)
995 (* type t = t *)
996 (* csg ; csg *)
997 (* inherit ct *)
998 (* method s : t or method private s : t *)
999 (* value (virtual)? (mutable)? s : t *)
1000 (* method virtual (mutable)? s : t *)
1001 (* $s$ *)
1002 (* ce e *)
1003 (* (virtual)? i ([ t ])? *)
1004 (* fun p -> ce *)
1005 (* let (rec)? bi in ce *)
1006 (* object ((p))? (cst)? end *)
1007 (* ce : ct *)
1008 (* ce and ce *)
1009 (* ce = ce *)
1010 (* $s$ *)
1011 loc =
1012 Loc.
1014 and meta_bool =
1015 | BTrue | BFalse | BAnt of string
1016 and 'a meta_option =
1017 | ONone | OSome of 'a | OAnt of string
1018 and 'a meta_list =
1019 | LNil | LCons of 'a * 'a meta_list | LAnt of string
1020 and ident =
1021 | IdAcc of loc * ident * ident
1022 | IdApp of loc * ident * ident
1023 | IdLid of loc * string
1024 | IdUid of loc * string
1025 | IdAnt of loc * string
1026 and ctyp =
1027 | TyNil of loc
1028 | TyAli of loc * ctyp * ctyp
1029 | TyAny of loc
1030 | TyApp of loc * ctyp * ctyp
1031 | TyArr of loc * ctyp * ctyp
1032 | TyCls of loc * ident
1033 | TyLab of loc * string * ctyp
1034 | TyId of loc * ident
1035 | TyMan of loc * ctyp * ctyp
1036 | TyDcl of loc * string * ctyp list * ctyp * (ctyp * ctyp) list
1037 | TyObj of loc * ctyp * meta_bool
1038 | TyOlb of loc * string * ctyp
1039 | TyPol of loc * ctyp * ctyp
1040 | TyQuo of loc * string
1041 | TyQuP of loc * string
1042 | TyQuM of loc * string
1043 | TyVrn of loc * string
1044 | TyRec of loc * ctyp
1045 | TyCol of loc * ctyp * ctyp
1046 | TySem of loc * ctyp * ctyp
1047 | TyCom of loc * ctyp * ctyp
1048 | TySum of loc * ctyp
1049 | TyOf of loc * ctyp * ctyp
1050 | TyAnd of loc * ctyp * ctyp
1051 | TyOr of loc * ctyp * ctyp
1052 | TyPrv of loc * ctyp
1053 | TyMut of loc * ctyp
1054 | TyTup of loc * ctyp
1055 | TySta of loc * ctyp * ctyp
1056 | TyVrnEq of loc * ctyp
1057 | TyVrnSup of loc * ctyp
1058 | TyVrnInf of loc * ctyp
1059 | TyVrnInfSup of loc * ctyp * ctyp
1060 | TyAmp of loc * ctyp * ctyp
1061 | TyOfAmp of loc * ctyp * ctyp
1062 | TyAnt of loc * string
1063 and patt =
1064 | PaNil of loc
1065 | PaId of loc * ident
1066 | PaAli of loc * patt * patt
1067 | PaAnt of loc * string
1068 | PaAny of loc
1069 | PaApp of loc * patt * patt
1070 | PaArr of loc * patt
1071 | PaCom of loc * patt * patt
1072 | PaSem of loc * patt * patt
1073 | PaChr of loc * string
1074 | PaInt of loc * string
1075 | PaInt32 of loc * string
1076 | PaInt64 of loc * string
1077 | PaNativeInt of loc * string
1078 | PaFlo of loc * string
1079 | PaLab of loc * string * patt
1080 | PaOlb of loc * string * patt
1081 | PaOlbi of loc * string * patt * expr
1082 | PaOrp of loc * patt * patt
1083 | PaRng of loc * patt * patt
1084 | PaRec of loc * patt
1085 | PaEq of loc * ident * patt
1086 | PaStr of loc * string
1087 | PaTup of loc * patt
1088 | PaTyc of loc * patt * ctyp
1089 | PaTyp of loc * ident
1090 | PaVrn of loc * string
1091 and expr =
1092 | ExNil of loc
1093 | ExId of loc * ident
1094 | ExAcc of loc * expr * expr
1095 | ExAnt of loc * string
1096 | ExApp of loc * expr * expr
1097 | ExAre of loc * expr * expr
1098 | ExArr of loc * expr
1099 | ExSem of loc * expr * expr
1100 | ExAsf of loc
1101 | ExAsr of loc * expr
1102 | ExAss of loc * expr * expr
1103 | ExChr of loc * string
1104 | ExCoe of loc * expr * ctyp * ctyp
1105 | ExFlo of loc * string
1106 | ExFor of loc * string * expr * expr * meta_bool * expr
1107 | ExFun of loc * match_case
1108 | ExIfe of loc * expr * expr * expr
1109 | ExInt of loc * string
1110 | ExInt32 of loc * string
1111 | ExInt64 of loc * string
1112 | ExNativeInt of loc * string
1113 | ExLab of loc * string * expr
1114 | ExLaz of loc * expr
1115 | ExLet of loc * meta_bool * binding * expr
1116 | ExLmd of loc * string * module_expr * expr
1117 | ExMat of loc * expr * match_case
1118 | ExNew of loc * ident
1119 | ExObj of loc * patt * class_str_item
1120 | ExOlb of loc * string * expr
1121 | ExOvr of loc * rec_binding
1122 | ExRec of loc * rec_binding * expr
1123 | ExSeq of loc * expr
1124 | ExSnd of loc * expr * string
1125 | ExSte of loc * expr * expr
1126 | ExStr of loc * string
1127 | ExTry of loc * expr * match_case
1128 | ExTup of loc * expr
1129 | ExCom of loc * expr * expr
1130 | ExTyc of loc * expr * ctyp
1131 | ExVrn of loc * string
1132 | ExWhi of loc * expr * expr
1133 and module_type =
1134 | MtNil of loc
1135 | MtId of loc * ident
1136 | MtFun of loc * string * module_type * module_type
1137 | MtQuo of loc * string
1138 | MtSig of loc * sig_item
1139 | MtWit of loc * module_type * with_constr
1140 | MtAnt of loc * string
1141 and sig_item =
1142 | SgNil of loc
1143 | SgCls of loc * class_type
1144 | SgClt of loc * class_type
1145 | SgSem of loc * sig_item * sig_item
1146 | SgDir of loc * string * expr
1147 | SgExc of loc * ctyp
1148 | SgExt of loc * string * ctyp * string meta_list
1149 | SgInc of loc * module_type
1150 | SgMod of loc * string * module_type
1151 | SgRecMod of loc * module_binding
1152 | SgMty of loc * string * module_type
1153 | SgOpn of loc * ident
1154 | SgTyp of loc * ctyp
1155 | SgVal of loc * string * ctyp
1156 | SgAnt of loc * string
1157 and with_constr =
1158 | WcNil of loc
1159 | WcTyp of loc * ctyp * ctyp
1160 | WcMod of loc * ident * ident
1161 | WcAnd of loc * with_constr * with_constr
1162 | WcAnt of loc * string
1163 and binding =
1164 | BiNil of loc
1165 | BiAnd of loc * binding * binding
1166 | BiEq of loc * patt * expr
1167 | BiAnt of loc * string
1168 and rec_binding =
1169 | RbNil of loc
1170 | RbSem of loc * rec_binding * rec_binding
1171 | RbEq of loc * ident * expr
1172 | RbAnt of loc * string
1173 and module_binding =
1174 | MbNil of loc
1175 | MbAnd of loc * module_binding * module_binding
1176 | MbColEq of loc * string * module_type * module_expr
1177 | MbCol of loc * string * module_type
1178 | MbAnt of loc * string
1179 and match_case =
1180 | McNil of loc
1181 | McOr of loc * match_case * match_case
1182 | McArr of loc * patt * expr * expr
1183 | McAnt of loc * string
1184 and module_expr =
1185 | MeNil of loc
1186 | MeId of loc * ident
1187 | MeApp of loc * module_expr * module_expr
1188 | MeFun of loc * string * module_type * module_expr
1189 | MeStr of loc * str_item
1190 | MeTyc of loc * module_expr * module_type
1191 | MeAnt of loc * string
1192 and str_item =
1193 | StNil of loc
1194 | StCls of loc * class_expr
1195 | StClt of loc * class_type
1196 | StSem of loc * str_item * str_item
1197 | StDir of loc * string * expr
1198 | StExc of loc * ctyp * ident meta_option
1199 | StExp of loc * expr
1200 | StExt of loc * string * ctyp * string meta_list
1201 | StInc of loc * module_expr
1202 | StMod of loc * string * module_expr
1203 | StRecMod of loc * module_binding
1204 | StMty of loc * string * module_type
1205 | StOpn of loc * ident
1206 | StTyp of loc * ctyp
1207 | StVal of loc * meta_bool * binding
1208 | StAnt of loc * string
1209 and class_type =
1210 | CtNil of loc
1211 | CtCon of loc * meta_bool * ident * ctyp
1212 | CtFun of loc * ctyp * class_type
1213 | CtSig of loc * ctyp * class_sig_item
1214 | CtAnd of loc * class_type * class_type
1215 | CtCol of loc * class_type * class_type
1216 | CtEq of loc * class_type * class_type
1217 | CtAnt of loc * string
1218 and class_sig_item =
1219 | CgNil of loc
1220 | CgCtr of loc * ctyp * ctyp
1221 | CgSem of loc * class_sig_item * class_sig_item
1222 | CgInh of loc * class_type
1223 | CgMth of loc * string * meta_bool * ctyp
1224 | CgVal of loc * string * meta_bool * meta_bool * ctyp
1225 | CgVir of loc * string * meta_bool * ctyp
1226 | CgAnt of loc * string
1227 and class_expr =
1228 | CeNil of loc
1229 | CeApp of loc * class_expr * expr
1230 | CeCon of loc * meta_bool * ident * ctyp
1231 | CeFun of loc * patt * class_expr
1232 | CeLet of loc * meta_bool * binding * class_expr
1233 | CeStr of loc * patt * class_str_item
1234 | CeTyc of loc * class_expr * class_type
1235 | CeAnd of loc * class_expr * class_expr
1236 | CeEq of loc * class_expr * class_expr
1237 | CeAnt of loc * string
1238 and class_str_item =
1239 | CrNil of loc
1240 | (* cst ; cst *)
1241 CrSem of loc * class_str_item * class_str_item
1242 | (* type t = t *)
1243 CrCtr of loc * ctyp * ctyp
1244 | (* inherit ce or inherit ce as s *)
1245 CrInh of loc * class_expr * string
1246 | (* initializer e *)
1247 CrIni of loc * expr
1248 | (* method (private)? s : t = e or method (private)? s = e *)
1249 CrMth of loc * string * meta_bool * expr * ctyp
1250 | (* value (mutable)? s = e *)
1251 CrVal of loc * string * meta_bool * expr
1252 | (* method virtual (private)? s : t *)
1253 CrVir of loc * string * meta_bool * ctyp
1254 | (* value virtual (private)? s : t *)
1255 CrVvr of loc * string * meta_bool * ctyp
1256 | CrAnt of loc * string
1258 val loc_of_ctyp : ctyp -> loc
1260 val loc_of_patt : patt -> loc
1262 val loc_of_expr : expr -> loc
1264 val loc_of_module_type : module_type -> loc
1266 val loc_of_module_expr : module_expr -> loc
1268 val loc_of_sig_item : sig_item -> loc
1270 val loc_of_str_item : str_item -> loc
1272 val loc_of_class_type : class_type -> loc
1274 val loc_of_class_sig_item : class_sig_item -> loc
1276 val loc_of_class_expr : class_expr -> loc
1278 val loc_of_class_str_item : class_str_item -> loc
1280 val loc_of_with_constr : with_constr -> loc
1282 val loc_of_binding : binding -> loc
1284 val loc_of_rec_binding : rec_binding -> loc
1286 val loc_of_module_binding : module_binding -> loc
1288 val loc_of_match_case : match_case -> loc
1290 val loc_of_ident : ident -> loc
1292 module Meta :
1294 module type META_LOC =
1296 val meta_loc_patt : loc -> loc -> patt
1298 val meta_loc_expr : loc -> loc -> expr
1302 module MetaLoc :
1304 val meta_loc_patt : loc -> loc -> patt
1306 val meta_loc_expr : loc -> loc -> expr
1310 module MetaGhostLoc :
1312 val meta_loc_patt : loc -> 'a -> patt
1314 val meta_loc_expr : loc -> 'a -> expr
1318 module MetaLocVar :
1320 val meta_loc_patt : loc -> 'a -> patt
1322 val meta_loc_expr : loc -> 'a -> expr
1326 module Make (MetaLoc : META_LOC) :
1328 module Expr :
1330 val meta_string : loc -> string -> expr
1332 val meta_int : loc -> string -> expr
1334 val meta_float : loc -> string -> expr
1336 val meta_char : loc -> string -> expr
1338 val meta_bool : loc -> bool -> expr
1340 val meta_list :
1341 (loc -> 'a -> expr) -> loc -> 'a list -> expr
1343 val meta_binding : loc -> binding -> expr
1345 val meta_rec_binding : loc -> rec_binding -> expr
1347 val meta_class_expr : loc -> class_expr -> expr
1349 val meta_class_sig_item : loc -> class_sig_item -> expr
1351 val meta_class_str_item : loc -> class_str_item -> expr
1353 val meta_class_type : loc -> class_type -> expr
1355 val meta_ctyp : loc -> ctyp -> expr
1357 val meta_expr : loc -> expr -> expr
1359 val meta_ident : loc -> ident -> expr
1361 val meta_match_case : loc -> match_case -> expr
1363 val meta_module_binding : loc -> module_binding -> expr
1365 val meta_module_expr : loc -> module_expr -> expr
1367 val meta_module_type : loc -> module_type -> expr
1369 val meta_patt : loc -> patt -> expr
1371 val meta_sig_item : loc -> sig_item -> expr
1373 val meta_str_item : loc -> str_item -> expr
1375 val meta_with_constr : loc -> with_constr -> expr
1379 module Patt :
1381 val meta_string : loc -> string -> patt
1383 val meta_int : loc -> string -> patt
1385 val meta_float : loc -> string -> patt
1387 val meta_char : loc -> string -> patt
1389 val meta_bool : loc -> bool -> patt
1391 val meta_list :
1392 (loc -> 'a -> patt) -> loc -> 'a list -> patt
1394 val meta_binding : loc -> binding -> patt
1396 val meta_rec_binding : loc -> rec_binding -> patt
1398 val meta_class_expr : loc -> class_expr -> patt
1400 val meta_class_sig_item : loc -> class_sig_item -> patt
1402 val meta_class_str_item : loc -> class_str_item -> patt
1404 val meta_class_type : loc -> class_type -> patt
1406 val meta_ctyp : loc -> ctyp -> patt
1408 val meta_expr : loc -> expr -> patt
1410 val meta_ident : loc -> ident -> patt
1412 val meta_match_case : loc -> match_case -> patt
1414 val meta_module_binding : loc -> module_binding -> patt
1416 val meta_module_expr : loc -> module_expr -> patt
1418 val meta_module_type : loc -> module_type -> patt
1420 val meta_patt : loc -> patt -> patt
1422 val meta_sig_item : loc -> sig_item -> patt
1424 val meta_str_item : loc -> str_item -> patt
1426 val meta_with_constr : loc -> with_constr -> patt
1434 class map :
1435 object ('self_type)
1436 method string : string -> string
1438 method list :
1439 'a 'b. ('self_type -> 'a -> 'b) -> 'a list -> 'b list
1441 method meta_bool : meta_bool -> meta_bool
1443 method meta_option :
1444 'a 'b.
1445 ('self_type -> 'a -> 'b) -> 'a meta_option -> 'b meta_option
1447 method meta_list :
1448 'a 'b. ('self_type -> 'a -> 'b) -> 'a meta_list -> 'b meta_list
1450 method loc : loc -> loc
1452 method expr : expr -> expr
1454 method patt : patt -> patt
1456 method ctyp : ctyp -> ctyp
1458 method str_item : str_item -> str_item
1460 method sig_item : sig_item -> sig_item
1462 method module_expr : module_expr -> module_expr
1464 method module_type : module_type -> module_type
1466 method class_expr : class_expr -> class_expr
1468 method class_type : class_type -> class_type
1470 method class_sig_item : class_sig_item -> class_sig_item
1472 method class_str_item : class_str_item -> class_str_item
1474 method with_constr : with_constr -> with_constr
1476 method binding : binding -> binding
1478 method rec_binding : rec_binding -> rec_binding
1480 method module_binding : module_binding -> module_binding
1482 method match_case : match_case -> match_case
1484 method ident : ident -> ident
1486 method unknown : 'a. 'a -> 'a
1490 class fold :
1491 object ('self_type)
1492 method string : string -> 'self_type
1494 method list :
1495 'a. ('self_type -> 'a -> 'self_type) -> 'a list -> 'self_type
1497 method meta_bool : meta_bool -> 'self_type
1499 method meta_option :
1501 ('self_type -> 'a -> 'self_type) ->
1502 'a meta_option -> 'self_type
1504 method meta_list :
1506 ('self_type -> 'a -> 'self_type) ->
1507 'a meta_list -> 'self_type
1509 method loc : loc -> 'self_type
1511 method expr : expr -> 'self_type
1513 method patt : patt -> 'self_type
1515 method ctyp : ctyp -> 'self_type
1517 method str_item : str_item -> 'self_type
1519 method sig_item : sig_item -> 'self_type
1521 method module_expr : module_expr -> 'self_type
1523 method module_type : module_type -> 'self_type
1525 method class_expr : class_expr -> 'self_type
1527 method class_type : class_type -> 'self_type
1529 method class_sig_item : class_sig_item -> 'self_type
1531 method class_str_item : class_str_item -> 'self_type
1533 method with_constr : with_constr -> 'self_type
1535 method binding : binding -> 'self_type
1537 method rec_binding : rec_binding -> 'self_type
1539 method module_binding : module_binding -> 'self_type
1541 method match_case : match_case -> 'self_type
1543 method ident : ident -> 'self_type
1545 method unknown : 'a. 'a -> 'self_type
1549 val map_expr : (expr -> expr) -> map
1551 val map_patt : (patt -> patt) -> map
1553 val map_ctyp : (ctyp -> ctyp) -> map
1555 val map_str_item : (str_item -> str_item) -> map
1557 val map_sig_item : (sig_item -> sig_item) -> map
1559 val map_loc : (loc -> loc) -> map
1561 val ident_of_expr : expr -> ident
1563 val ident_of_patt : patt -> ident
1565 val ident_of_ctyp : ctyp -> ident
1567 val biAnd_of_list : binding list -> binding
1569 val rbSem_of_list : rec_binding list -> rec_binding
1571 val paSem_of_list : patt list -> patt
1573 val paCom_of_list : patt list -> patt
1575 val tyOr_of_list : ctyp list -> ctyp
1577 val tyAnd_of_list : ctyp list -> ctyp
1579 val tyAmp_of_list : ctyp list -> ctyp
1581 val tySem_of_list : ctyp list -> ctyp
1583 val tyCom_of_list : ctyp list -> ctyp
1585 val tySta_of_list : ctyp list -> ctyp
1587 val stSem_of_list : str_item list -> str_item
1589 val sgSem_of_list : sig_item list -> sig_item
1591 val crSem_of_list : class_str_item list -> class_str_item
1593 val cgSem_of_list : class_sig_item list -> class_sig_item
1595 val ctAnd_of_list : class_type list -> class_type
1597 val ceAnd_of_list : class_expr list -> class_expr
1599 val wcAnd_of_list : with_constr list -> with_constr
1601 val meApp_of_list : module_expr list -> module_expr
1603 val mbAnd_of_list : module_binding list -> module_binding
1605 val mcOr_of_list : match_case list -> match_case
1607 val idAcc_of_list : ident list -> ident
1609 val idApp_of_list : ident list -> ident
1611 val exSem_of_list : expr list -> expr
1613 val exCom_of_list : expr list -> expr
1615 val list_of_ctyp : ctyp -> ctyp list -> ctyp list
1617 val list_of_binding : binding -> binding list -> binding list
1619 val list_of_rec_binding :
1620 rec_binding -> rec_binding list -> rec_binding list
1622 val list_of_with_constr :
1623 with_constr -> with_constr list -> with_constr list
1625 val list_of_patt : patt -> patt list -> patt list
1627 val list_of_expr : expr -> expr list -> expr list
1629 val list_of_str_item : str_item -> str_item list -> str_item list
1631 val list_of_sig_item : sig_item -> sig_item list -> sig_item list
1633 val list_of_class_sig_item :
1634 class_sig_item -> class_sig_item list -> class_sig_item list
1636 val list_of_class_str_item :
1637 class_str_item -> class_str_item list -> class_str_item list
1639 val list_of_class_type :
1640 class_type -> class_type list -> class_type list
1642 val list_of_class_expr :
1643 class_expr -> class_expr list -> class_expr list
1645 val list_of_module_expr :
1646 module_expr -> module_expr list -> module_expr list
1648 val list_of_module_binding :
1649 module_binding -> module_binding list -> module_binding list
1651 val list_of_match_case :
1652 match_case -> match_case list -> match_case list
1654 val list_of_ident : ident -> ident list -> ident list
1656 val safe_string_escaped : string -> string
1658 val is_irrefut_patt : patt -> bool
1660 val is_constructor : ident -> bool
1662 val is_patt_constructor : patt -> bool
1664 val is_expr_constructor : expr -> bool
1666 val ty_of_stl : (Loc.t * string * (ctyp list)) -> ctyp
1668 val ty_of_sbt : (Loc.t * string * bool * ctyp) -> ctyp
1670 val bi_of_pe : (patt * expr) -> binding
1672 val pel_of_binding : binding -> (patt * expr) list
1674 val binding_of_pel : (patt * expr) list -> binding
1676 val sum_type_of_list : (Loc.t * string * (ctyp list)) list -> ctyp
1678 val record_type_of_list : (Loc.t * string * bool * ctyp) list -> ctyp
1682 module Camlp4AstToAst (M : Camlp4Ast) : Ast with type loc = M.loc
1683 and type meta_bool = M.meta_bool
1684 and type 'a meta_option = 'a M.meta_option
1685 and type 'a meta_list = 'a M.meta_list and type ctyp = M.ctyp
1686 and type patt = M.patt and type expr = M.expr
1687 and type module_type = M.module_type and type sig_item = M.sig_item
1688 and type with_constr = M.with_constr
1689 and type module_expr = M.module_expr and type str_item = M.str_item
1690 and type class_type = M.class_type
1691 and type class_sig_item = M.class_sig_item
1692 and type class_expr = M.class_expr
1693 and type class_str_item = M.class_str_item and type binding = M.binding
1694 and type rec_binding = M.rec_binding
1695 and type module_binding = M.module_binding
1696 and type match_case = M.match_case and type ident = M.ident = M
1698 module MakeCamlp4Ast (Loc : Type) =
1699 struct
1700 type loc =
1701 Loc.
1703 and meta_bool =
1704 | BTrue | BFalse | BAnt of string
1705 and 'a meta_option =
1706 | ONone | OSome of 'a | OAnt of string
1707 and 'a meta_list =
1708 | LNil | LCons of 'a * 'a meta_list | LAnt of string
1709 and ident =
1710 | IdAcc of loc * ident * ident
1711 | IdApp of loc * ident * ident
1712 | IdLid of loc * string
1713 | IdUid of loc * string
1714 | IdAnt of loc * string
1715 and ctyp =
1716 | TyNil of loc
1717 | TyAli of loc * ctyp * ctyp
1718 | TyAny of loc
1719 | TyApp of loc * ctyp * ctyp
1720 | TyArr of loc * ctyp * ctyp
1721 | TyCls of loc * ident
1722 | TyLab of loc * string * ctyp
1723 | TyId of loc * ident
1724 | TyMan of loc * ctyp * ctyp
1725 | TyDcl of loc * string * ctyp list * ctyp * (ctyp * ctyp) list
1726 | TyObj of loc * ctyp * meta_bool
1727 | TyOlb of loc * string * ctyp
1728 | TyPol of loc * ctyp * ctyp
1729 | TyQuo of loc * string
1730 | TyQuP of loc * string
1731 | TyQuM of loc * string
1732 | TyVrn of loc * string
1733 | TyRec of loc * ctyp
1734 | TyCol of loc * ctyp * ctyp
1735 | TySem of loc * ctyp * ctyp
1736 | TyCom of loc * ctyp * ctyp
1737 | TySum of loc * ctyp
1738 | TyOf of loc * ctyp * ctyp
1739 | TyAnd of loc * ctyp * ctyp
1740 | TyOr of loc * ctyp * ctyp
1741 | TyPrv of loc * ctyp
1742 | TyMut of loc * ctyp
1743 | TyTup of loc * ctyp
1744 | TySta of loc * ctyp * ctyp
1745 | TyVrnEq of loc * ctyp
1746 | TyVrnSup of loc * ctyp
1747 | TyVrnInf of loc * ctyp
1748 | TyVrnInfSup of loc * ctyp * ctyp
1749 | TyAmp of loc * ctyp * ctyp
1750 | TyOfAmp of loc * ctyp * ctyp
1751 | TyAnt of loc * string
1752 and patt =
1753 | PaNil of loc
1754 | PaId of loc * ident
1755 | PaAli of loc * patt * patt
1756 | PaAnt of loc * string
1757 | PaAny of loc
1758 | PaApp of loc * patt * patt
1759 | PaArr of loc * patt
1760 | PaCom of loc * patt * patt
1761 | PaSem of loc * patt * patt
1762 | PaChr of loc * string
1763 | PaInt of loc * string
1764 | PaInt32 of loc * string
1765 | PaInt64 of loc * string
1766 | PaNativeInt of loc * string
1767 | PaFlo of loc * string
1768 | PaLab of loc * string * patt
1769 | PaOlb of loc * string * patt
1770 | PaOlbi of loc * string * patt * expr
1771 | PaOrp of loc * patt * patt
1772 | PaRng of loc * patt * patt
1773 | PaRec of loc * patt
1774 | PaEq of loc * ident * patt
1775 | PaStr of loc * string
1776 | PaTup of loc * patt
1777 | PaTyc of loc * patt * ctyp
1778 | PaTyp of loc * ident
1779 | PaVrn of loc * string
1780 and expr =
1781 | ExNil of loc
1782 | ExId of loc * ident
1783 | ExAcc of loc * expr * expr
1784 | ExAnt of loc * string
1785 | ExApp of loc * expr * expr
1786 | ExAre of loc * expr * expr
1787 | ExArr of loc * expr
1788 | ExSem of loc * expr * expr
1789 | ExAsf of loc
1790 | ExAsr of loc * expr
1791 | ExAss of loc * expr * expr
1792 | ExChr of loc * string
1793 | ExCoe of loc * expr * ctyp * ctyp
1794 | ExFlo of loc * string
1795 | ExFor of loc * string * expr * expr * meta_bool * expr
1796 | ExFun of loc * match_case
1797 | ExIfe of loc * expr * expr * expr
1798 | ExInt of loc * string
1799 | ExInt32 of loc * string
1800 | ExInt64 of loc * string
1801 | ExNativeInt of loc * string
1802 | ExLab of loc * string * expr
1803 | ExLaz of loc * expr
1804 | ExLet of loc * meta_bool * binding * expr
1805 | ExLmd of loc * string * module_expr * expr
1806 | ExMat of loc * expr * match_case
1807 | ExNew of loc * ident
1808 | ExObj of loc * patt * class_str_item
1809 | ExOlb of loc * string * expr
1810 | ExOvr of loc * rec_binding
1811 | ExRec of loc * rec_binding * expr
1812 | ExSeq of loc * expr
1813 | ExSnd of loc * expr * string
1814 | ExSte of loc * expr * expr
1815 | ExStr of loc * string
1816 | ExTry of loc * expr * match_case
1817 | ExTup of loc * expr
1818 | ExCom of loc * expr * expr
1819 | ExTyc of loc * expr * ctyp
1820 | ExVrn of loc * string
1821 | ExWhi of loc * expr * expr
1822 and module_type =
1823 | MtNil of loc
1824 | MtId of loc * ident
1825 | MtFun of loc * string * module_type * module_type
1826 | MtQuo of loc * string
1827 | MtSig of loc * sig_item
1828 | MtWit of loc * module_type * with_constr
1829 | MtAnt of loc * string
1830 and sig_item =
1831 | SgNil of loc
1832 | SgCls of loc * class_type
1833 | SgClt of loc * class_type
1834 | SgSem of loc * sig_item * sig_item
1835 | SgDir of loc * string * expr
1836 | SgExc of loc * ctyp
1837 | SgExt of loc * string * ctyp * string meta_list
1838 | SgInc of loc * module_type
1839 | SgMod of loc * string * module_type
1840 | SgRecMod of loc * module_binding
1841 | SgMty of loc * string * module_type
1842 | SgOpn of loc * ident
1843 | SgTyp of loc * ctyp
1844 | SgVal of loc * string * ctyp
1845 | SgAnt of loc * string
1846 and with_constr =
1847 | WcNil of loc
1848 | WcTyp of loc * ctyp * ctyp
1849 | WcMod of loc * ident * ident
1850 | WcAnd of loc * with_constr * with_constr
1851 | WcAnt of loc * string
1852 and binding =
1853 | BiNil of loc
1854 | BiAnd of loc * binding * binding
1855 | BiEq of loc * patt * expr
1856 | BiAnt of loc * string
1857 and rec_binding =
1858 | RbNil of loc
1859 | RbSem of loc * rec_binding * rec_binding
1860 | RbEq of loc * ident * expr
1861 | RbAnt of loc * string
1862 and module_binding =
1863 | MbNil of loc
1864 | MbAnd of loc * module_binding * module_binding
1865 | MbColEq of loc * string * module_type * module_expr
1866 | MbCol of loc * string * module_type
1867 | MbAnt of loc * string
1868 and match_case =
1869 | McNil of loc
1870 | McOr of loc * match_case * match_case
1871 | McArr of loc * patt * expr * expr
1872 | McAnt of loc * string
1873 and module_expr =
1874 | MeNil of loc
1875 | MeId of loc * ident
1876 | MeApp of loc * module_expr * module_expr
1877 | MeFun of loc * string * module_type * module_expr
1878 | MeStr of loc * str_item
1879 | MeTyc of loc * module_expr * module_type
1880 | MeAnt of loc * string
1881 and str_item =
1882 | StNil of loc
1883 | StCls of loc * class_expr
1884 | StClt of loc * class_type
1885 | StSem of loc * str_item * str_item
1886 | StDir of loc * string * expr
1887 | StExc of loc * ctyp * ident meta_option
1888 | StExp of loc * expr
1889 | StExt of loc * string * ctyp * string meta_list
1890 | StInc of loc * module_expr
1891 | StMod of loc * string * module_expr
1892 | StRecMod of loc * module_binding
1893 | StMty of loc * string * module_type
1894 | StOpn of loc * ident
1895 | StTyp of loc * ctyp
1896 | StVal of loc * meta_bool * binding
1897 | StAnt of loc * string
1898 and class_type =
1899 | CtNil of loc
1900 | CtCon of loc * meta_bool * ident * ctyp
1901 | CtFun of loc * ctyp * class_type
1902 | CtSig of loc * ctyp * class_sig_item
1903 | CtAnd of loc * class_type * class_type
1904 | CtCol of loc * class_type * class_type
1905 | CtEq of loc * class_type * class_type
1906 | CtAnt of loc * string
1907 and class_sig_item =
1908 | CgNil of loc
1909 | CgCtr of loc * ctyp * ctyp
1910 | CgSem of loc * class_sig_item * class_sig_item
1911 | CgInh of loc * class_type
1912 | CgMth of loc * string * meta_bool * ctyp
1913 | CgVal of loc * string * meta_bool * meta_bool * ctyp
1914 | CgVir of loc * string * meta_bool * ctyp
1915 | CgAnt of loc * string
1916 and class_expr =
1917 | CeNil of loc
1918 | CeApp of loc * class_expr * expr
1919 | CeCon of loc * meta_bool * ident * ctyp
1920 | CeFun of loc * patt * class_expr
1921 | CeLet of loc * meta_bool * binding * class_expr
1922 | CeStr of loc * patt * class_str_item
1923 | CeTyc of loc * class_expr * class_type
1924 | CeAnd of loc * class_expr * class_expr
1925 | CeEq of loc * class_expr * class_expr
1926 | CeAnt of loc * string
1927 and class_str_item =
1928 | CrNil of loc
1929 | CrSem of loc * class_str_item * class_str_item
1930 | CrCtr of loc * ctyp * ctyp
1931 | CrInh of loc * class_expr * string
1932 | CrIni of loc * expr
1933 | CrMth of loc * string * meta_bool * expr * ctyp
1934 | CrVal of loc * string * meta_bool * expr
1935 | CrVir of loc * string * meta_bool * ctyp
1936 | CrVvr of loc * string * meta_bool * ctyp
1937 | CrAnt of loc * string
1941 type ('a, 'loc) stream_filter =
1942 ('a * 'loc) Stream.t -> ('a * 'loc) Stream.t
1944 module type AstFilters =
1946 module Ast : Camlp4Ast
1948 type 'a filter = 'a -> 'a
1950 val register_sig_item_filter : Ast.sig_item filter -> unit
1952 val register_str_item_filter : Ast.str_item filter -> unit
1954 val fold_interf_filters :
1955 ('a -> Ast.sig_item filter -> 'a) -> 'a -> 'a
1957 val fold_implem_filters :
1958 ('a -> Ast.str_item filter -> 'a) -> 'a -> 'a
1962 module type DynAst =
1964 module Ast : Ast
1966 type 'a tag
1968 val ctyp_tag : Ast.ctyp tag
1970 val patt_tag : Ast.patt tag
1972 val expr_tag : Ast.expr tag
1974 val module_type_tag : Ast.module_type tag
1976 val sig_item_tag : Ast.sig_item tag
1978 val with_constr_tag : Ast.with_constr tag
1980 val module_expr_tag : Ast.module_expr tag
1982 val str_item_tag : Ast.str_item tag
1984 val class_type_tag : Ast.class_type tag
1986 val class_sig_item_tag : Ast.class_sig_item tag
1988 val class_expr_tag : Ast.class_expr tag
1990 val class_str_item_tag : Ast.class_str_item tag
1992 val match_case_tag : Ast.match_case tag
1994 val ident_tag : Ast.ident tag
1996 val binding_tag : Ast.binding tag
1998 val rec_binding_tag : Ast.rec_binding tag
2000 val module_binding_tag : Ast.module_binding tag
2002 val string_of_tag : 'a tag -> string
2004 module Pack (X : sig type 'a t
2005 end) :
2007 type pack
2009 val pack : 'a tag -> 'a X.t -> pack
2011 val unpack : 'a tag -> pack -> 'a X.t
2013 val print_tag : Format.formatter -> pack -> unit
2019 type quotation =
2020 { q_name : string; q_loc : string; q_shift : int; q_contents : string
2023 module type Quotation =
2025 module Ast : Ast
2027 module DynAst : DynAst with module Ast = Ast
2029 open Ast
2031 type 'a expand_fun = loc -> string option -> string -> 'a
2033 val add : string -> 'a DynAst.tag -> 'a expand_fun -> unit
2035 val find : string -> 'a DynAst.tag -> 'a expand_fun
2037 val default : string ref
2039 val parse_quotation_result :
2040 (loc -> string -> 'a) -> loc -> quotation -> string -> string -> 'a
2042 val translate : (string -> string) ref
2044 val expand : loc -> quotation -> 'a DynAst.tag -> 'a
2046 val dump_file : (string option) ref
2048 module Error : Error
2052 module type Token =
2054 module Loc : Loc
2056 type t
2058 val to_string : t -> string
2060 val print : Format.formatter -> t -> unit
2062 val match_keyword : string -> t -> bool
2064 val extract_string : t -> string
2066 module Filter :
2068 type token_filter = (t, Loc.t) stream_filter
2070 type t
2072 val mk : (string -> bool) -> t
2074 val define_filter : t -> (token_filter -> token_filter) -> unit
2076 val filter : t -> token_filter
2078 val keyword_added : t -> string -> bool -> unit
2080 val keyword_removed : t -> string -> unit
2084 module Error : Error
2088 type camlp4_token =
2089 | KEYWORD of string
2090 | SYMBOL of string
2091 | LIDENT of string
2092 | UIDENT of string
2093 | ESCAPED_IDENT of string
2094 | INT of int * string
2095 | INT32 of int32 * string
2096 | INT64 of int64 * string
2097 | NATIVEINT of nativeint * string
2098 | FLOAT of float * string
2099 | CHAR of char * string
2100 | STRING of string * string
2101 | LABEL of string
2102 | OPTLABEL of string
2103 | QUOTATION of quotation
2104 | ANTIQUOT of string * string
2105 | COMMENT of string
2106 | BLANKS of string
2107 | NEWLINE
2108 | LINE_DIRECTIVE of int * string option
2109 | EOI
2111 module type Camlp4Token = Token with type t = camlp4_token
2113 module type DynLoader =
2115 type t
2117 exception Error of string * string
2119 val mk : ?ocaml_stdlib: bool -> ?camlp4_stdlib: bool -> unit -> t
2121 val fold_load_path : t -> (string -> 'a -> 'a) -> 'a -> 'a
2123 val load : t -> string -> unit
2125 val include_dir : t -> string -> unit
2127 val find_in_path : t -> string -> string
2131 module Grammar =
2132 struct
2133 module type Action =
2135 type t
2137 val mk : 'a -> t
2139 val get : t -> 'a
2141 val getf : t -> 'a -> 'b
2143 val getf2 : t -> 'a -> 'b -> 'c
2147 type assoc = | NonA | RightA | LeftA
2149 type position =
2150 | First
2151 | Last
2152 | Before of string
2153 | After of string
2154 | Level of string
2156 module type Structure =
2158 module Loc : Loc
2160 module Action : Action
2162 module Token : Token with module Loc = Loc
2164 type gram
2166 type internal_entry
2168 type tree
2170 type token_pattern = ((Token.t -> bool) * string)
2172 type symbol =
2173 | Smeta of string * symbol list * Action.t
2174 | Snterm of internal_entry
2175 | Snterml of internal_entry * string
2176 | Slist0 of symbol
2177 | Slist0sep of symbol * symbol
2178 | Slist1 of symbol
2179 | Slist1sep of symbol * symbol
2180 | Sopt of symbol
2181 | Sself
2182 | Snext
2183 | Stoken of token_pattern
2184 | Skeyword of string
2185 | Stree of tree
2187 type production_rule = ((symbol list) * Action.t)
2189 type single_extend_statment =
2190 ((string option) * (assoc option) * (production_rule list))
2192 type extend_statment =
2193 ((position option) * (single_extend_statment list))
2195 type delete_statment = symbol list
2197 type ('a, 'b, 'c) fold =
2198 internal_entry ->
2199 symbol list -> ('a Stream.t -> 'b) -> 'a Stream.t -> 'c
2201 type ('a, 'b, 'c) foldsep =
2202 internal_entry ->
2203 symbol list ->
2204 ('a Stream.t -> 'b) ->
2205 ('a Stream.t -> unit) -> 'a Stream.t -> 'c
2209 module type Dynamic =
2211 include Structure
2213 val mk : unit -> gram
2215 module Entry :
2217 type 'a t
2219 val mk : gram -> string -> 'a t
2221 val of_parser :
2222 gram ->
2223 string -> ((Token.t * Loc.t) Stream.t -> 'a) -> 'a t
2225 val setup_parser :
2226 'a t -> ((Token.t * Loc.t) Stream.t -> 'a) -> unit
2228 val name : 'a t -> string
2230 val print : Format.formatter -> 'a t -> unit
2232 val dump : Format.formatter -> 'a t -> unit
2234 val obj : 'a t -> internal_entry
2236 val clear : 'a t -> unit
2240 val get_filter : gram -> Token.Filter.t
2242 type 'a not_filtered
2244 val extend : 'a Entry.t -> extend_statment -> unit
2246 val delete_rule : 'a Entry.t -> delete_statment -> unit
2248 val srules :
2249 'a Entry.t -> ((symbol list) * Action.t) list -> symbol
2251 val sfold0 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
2253 val sfold1 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
2255 val sfold0sep : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) foldsep
2257 val lex :
2258 gram ->
2259 Loc.t ->
2260 char Stream.t -> ((Token.t * Loc.t) Stream.t) not_filtered
2262 val lex_string :
2263 gram ->
2264 Loc.t -> string -> ((Token.t * Loc.t) Stream.t) not_filtered
2266 val filter :
2267 gram ->
2268 ((Token.t * Loc.t) Stream.t) not_filtered ->
2269 (Token.t * Loc.t) Stream.t
2271 val parse : 'a Entry.t -> Loc.t -> char Stream.t -> 'a
2273 val parse_string : 'a Entry.t -> Loc.t -> string -> 'a
2275 val parse_tokens_before_filter :
2276 'a Entry.t -> ((Token.t * Loc.t) Stream.t) not_filtered -> 'a
2278 val parse_tokens_after_filter :
2279 'a Entry.t -> (Token.t * Loc.t) Stream.t -> 'a
2283 module type Static =
2285 include Structure
2287 module Entry :
2289 type 'a t
2291 val mk : string -> 'a t
2293 val of_parser :
2294 string -> ((Token.t * Loc.t) Stream.t -> 'a) -> 'a t
2296 val setup_parser :
2297 'a t -> ((Token.t * Loc.t) Stream.t -> 'a) -> unit
2299 val name : 'a t -> string
2301 val print : Format.formatter -> 'a t -> unit
2303 val dump : Format.formatter -> 'a t -> unit
2305 val obj : 'a t -> internal_entry
2307 val clear : 'a t -> unit
2311 val get_filter : unit -> Token.Filter.t
2313 type 'a not_filtered
2315 val extend : 'a Entry.t -> extend_statment -> unit
2317 val delete_rule : 'a Entry.t -> delete_statment -> unit
2319 val srules :
2320 'a Entry.t -> ((symbol list) * Action.t) list -> symbol
2322 val sfold0 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
2324 val sfold1 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
2326 val sfold0sep : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) foldsep
2328 val lex :
2329 Loc.t ->
2330 char Stream.t -> ((Token.t * Loc.t) Stream.t) not_filtered
2332 val lex_string :
2333 Loc.t -> string -> ((Token.t * Loc.t) Stream.t) not_filtered
2335 val filter :
2336 ((Token.t * Loc.t) Stream.t) not_filtered ->
2337 (Token.t * Loc.t) Stream.t
2339 val parse : 'a Entry.t -> Loc.t -> char Stream.t -> 'a
2341 val parse_string : 'a Entry.t -> Loc.t -> string -> 'a
2343 val parse_tokens_before_filter :
2344 'a Entry.t -> ((Token.t * Loc.t) Stream.t) not_filtered -> 'a
2346 val parse_tokens_after_filter :
2347 'a Entry.t -> (Token.t * Loc.t) Stream.t -> 'a
2353 module type Lexer =
2355 module Loc : Loc
2357 module Token : Token with module Loc = Loc
2359 module Error : Error
2361 val mk : unit -> Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t
2365 module Parser (Ast : Ast) =
2366 struct
2367 module type SIMPLE =
2369 val parse_expr : Ast.loc -> string -> Ast.expr
2371 val parse_patt : Ast.loc -> string -> Ast.patt
2375 module type S =
2377 val parse_implem :
2378 ?directive_handler: (Ast.str_item -> Ast.str_item option) ->
2379 Ast.loc -> char Stream.t -> Ast.str_item
2381 val parse_interf :
2382 ?directive_handler: (Ast.sig_item -> Ast.sig_item option) ->
2383 Ast.loc -> char Stream.t -> Ast.sig_item
2389 module Printer (Ast : Ast) =
2390 struct
2391 module type S =
2393 val print_interf :
2394 ?input_file: string ->
2395 ?output_file: string -> Ast.sig_item -> unit
2397 val print_implem :
2398 ?input_file: string ->
2399 ?output_file: string -> Ast.str_item -> unit
2405 module type Syntax =
2407 module Loc : Loc
2409 module Ast : Ast with type loc = Loc.t
2411 module Token : Token with module Loc = Loc
2413 module Gram : Grammar.Static with module Loc = Loc
2414 and module Token = Token
2416 module Quotation : Quotation with module Ast = Ast
2418 module AntiquotSyntax : Parser(Ast).SIMPLE
2420 include Warning(Loc).S
2422 include Parser(Ast).S
2424 include Printer(Ast).S
2428 module type Camlp4Syntax =
2430 module Loc : Loc
2432 module Ast : Camlp4Ast with module Loc = Loc
2434 module Token : Camlp4Token with module Loc = Loc
2436 module Gram : Grammar.Static with module Loc = Loc
2437 and module Token = Token
2439 module Quotation : Quotation with module Ast = Camlp4AstToAst(Ast)
2441 module AntiquotSyntax : Parser(Ast).SIMPLE
2443 include Warning(Loc).S
2445 include Parser(Ast).S
2447 include Printer(Ast).S
2449 val interf : ((Ast.sig_item list) * (Loc.t option)) Gram.Entry.t
2451 val implem : ((Ast.str_item list) * (Loc.t option)) Gram.Entry.t
2453 val top_phrase : (Ast.str_item option) Gram.Entry.t
2455 val use_file : ((Ast.str_item list) * (Loc.t option)) Gram.Entry.t
2457 val a_CHAR : string Gram.Entry.t
2459 val a_FLOAT : string Gram.Entry.t
2461 val a_INT : string Gram.Entry.t
2463 val a_INT32 : string Gram.Entry.t
2465 val a_INT64 : string Gram.Entry.t
2467 val a_LABEL : string Gram.Entry.t
2469 val a_LIDENT : string Gram.Entry.t
2471 val a_NATIVEINT : string Gram.Entry.t
2473 val a_OPTLABEL : string Gram.Entry.t
2475 val a_STRING : string Gram.Entry.t
2477 val a_UIDENT : string Gram.Entry.t
2479 val a_ident : string Gram.Entry.t
2481 val amp_ctyp : Ast.ctyp Gram.Entry.t
2483 val and_ctyp : Ast.ctyp Gram.Entry.t
2485 val match_case : Ast.match_case Gram.Entry.t
2487 val match_case0 : Ast.match_case Gram.Entry.t
2489 val match_case_quot : Ast.match_case Gram.Entry.t
2491 val binding : Ast.binding Gram.Entry.t
2493 val binding_quot : Ast.binding Gram.Entry.t
2495 val rec_binding_quot : Ast.rec_binding Gram.Entry.t
2497 val class_declaration : Ast.class_expr Gram.Entry.t
2499 val class_description : Ast.class_type Gram.Entry.t
2501 val class_expr : Ast.class_expr Gram.Entry.t
2503 val class_expr_quot : Ast.class_expr Gram.Entry.t
2505 val class_fun_binding : Ast.class_expr Gram.Entry.t
2507 val class_fun_def : Ast.class_expr Gram.Entry.t
2509 val class_info_for_class_expr : Ast.class_expr Gram.Entry.t
2511 val class_info_for_class_type : Ast.class_type Gram.Entry.t
2513 val class_longident : Ast.ident Gram.Entry.t
2515 val class_longident_and_param : Ast.class_expr Gram.Entry.t
2517 val class_name_and_param : (string * Ast.ctyp) Gram.Entry.t
2519 val class_sig_item : Ast.class_sig_item Gram.Entry.t
2521 val class_sig_item_quot : Ast.class_sig_item Gram.Entry.t
2523 val class_signature : Ast.class_sig_item Gram.Entry.t
2525 val class_str_item : Ast.class_str_item Gram.Entry.t
2527 val class_str_item_quot : Ast.class_str_item Gram.Entry.t
2529 val class_structure : Ast.class_str_item Gram.Entry.t
2531 val class_type : Ast.class_type Gram.Entry.t
2533 val class_type_declaration : Ast.class_type Gram.Entry.t
2535 val class_type_longident : Ast.ident Gram.Entry.t
2537 val class_type_longident_and_param : Ast.class_type Gram.Entry.t
2539 val class_type_plus : Ast.class_type Gram.Entry.t
2541 val class_type_quot : Ast.class_type Gram.Entry.t
2543 val comma_ctyp : Ast.ctyp Gram.Entry.t
2545 val comma_expr : Ast.expr Gram.Entry.t
2547 val comma_ipatt : Ast.patt Gram.Entry.t
2549 val comma_patt : Ast.patt Gram.Entry.t
2551 val comma_type_parameter : Ast.ctyp Gram.Entry.t
2553 val constrain : (Ast.ctyp * Ast.ctyp) Gram.Entry.t
2555 val constructor_arg_list : Ast.ctyp Gram.Entry.t
2557 val constructor_declaration : Ast.ctyp Gram.Entry.t
2559 val constructor_declarations : Ast.ctyp Gram.Entry.t
2561 val ctyp : Ast.ctyp Gram.Entry.t
2563 val ctyp_quot : Ast.ctyp Gram.Entry.t
2565 val cvalue_binding : Ast.expr Gram.Entry.t
2567 val direction_flag : Ast.meta_bool Gram.Entry.t
2569 val dummy : unit Gram.Entry.t
2571 val eq_expr : (string -> Ast.patt -> Ast.patt) Gram.Entry.t
2573 val expr : Ast.expr Gram.Entry.t
2575 val expr_eoi : Ast.expr Gram.Entry.t
2577 val expr_quot : Ast.expr Gram.Entry.t
2579 val field_expr : Ast.rec_binding Gram.Entry.t
2581 val fun_binding : Ast.expr Gram.Entry.t
2583 val fun_def : Ast.expr Gram.Entry.t
2585 val ident : Ast.ident Gram.Entry.t
2587 val ident_quot : Ast.ident Gram.Entry.t
2589 val ipatt : Ast.patt Gram.Entry.t
2591 val ipatt_tcon : Ast.patt Gram.Entry.t
2593 val label : string Gram.Entry.t
2595 val label_declaration : Ast.ctyp Gram.Entry.t
2597 val label_expr : Ast.rec_binding Gram.Entry.t
2599 val label_ipatt : Ast.patt Gram.Entry.t
2601 val label_longident : Ast.ident Gram.Entry.t
2603 val label_patt : Ast.patt Gram.Entry.t
2605 val labeled_ipatt : Ast.patt Gram.Entry.t
2607 val let_binding : Ast.binding Gram.Entry.t
2609 val meth_list : Ast.ctyp Gram.Entry.t
2611 val module_binding : Ast.module_binding Gram.Entry.t
2613 val module_binding0 : Ast.module_expr Gram.Entry.t
2615 val module_binding_quot : Ast.module_binding Gram.Entry.t
2617 val module_declaration : Ast.module_type Gram.Entry.t
2619 val module_expr : Ast.module_expr Gram.Entry.t
2621 val module_expr_quot : Ast.module_expr Gram.Entry.t
2623 val module_longident : Ast.ident Gram.Entry.t
2625 val module_longident_with_app : Ast.ident Gram.Entry.t
2627 val module_rec_declaration : Ast.module_binding Gram.Entry.t
2629 val module_type : Ast.module_type Gram.Entry.t
2631 val module_type_quot : Ast.module_type Gram.Entry.t
2633 val more_ctyp : Ast.ctyp Gram.Entry.t
2635 val name_tags : Ast.ctyp Gram.Entry.t
2637 val opt_as_lident : string Gram.Entry.t
2639 val opt_class_self_patt : Ast.patt Gram.Entry.t
2641 val opt_class_self_type : Ast.ctyp Gram.Entry.t
2643 val opt_comma_ctyp : Ast.ctyp Gram.Entry.t
2645 val opt_dot_dot : Ast.meta_bool Gram.Entry.t
2647 val opt_eq_ctyp : Ast.ctyp Gram.Entry.t
2649 val opt_expr : Ast.expr Gram.Entry.t
2651 val opt_meth_list : Ast.ctyp Gram.Entry.t
2653 val opt_mutable : Ast.meta_bool Gram.Entry.t
2655 val opt_polyt : Ast.ctyp Gram.Entry.t
2657 val opt_private : Ast.meta_bool Gram.Entry.t
2659 val opt_rec : Ast.meta_bool Gram.Entry.t
2661 val opt_virtual : Ast.meta_bool Gram.Entry.t
2663 val opt_when_expr : Ast.expr Gram.Entry.t
2665 val patt : Ast.patt Gram.Entry.t
2667 val patt_as_patt_opt : Ast.patt Gram.Entry.t
2669 val patt_eoi : Ast.patt Gram.Entry.t
2671 val patt_quot : Ast.patt Gram.Entry.t
2673 val patt_tcon : Ast.patt Gram.Entry.t
2675 val phrase : Ast.str_item Gram.Entry.t
2677 val poly_type : Ast.ctyp Gram.Entry.t
2679 val row_field : Ast.ctyp Gram.Entry.t
2681 val sem_expr : Ast.expr Gram.Entry.t
2683 val sem_expr_for_list : (Ast.expr -> Ast.expr) Gram.Entry.t
2685 val sem_patt : Ast.patt Gram.Entry.t
2687 val sem_patt_for_list : (Ast.patt -> Ast.patt) Gram.Entry.t
2689 val semi : unit Gram.Entry.t
2691 val sequence : Ast.expr Gram.Entry.t
2693 val do_sequence : Ast.expr Gram.Entry.t
2695 val sig_item : Ast.sig_item Gram.Entry.t
2697 val sig_item_quot : Ast.sig_item Gram.Entry.t
2699 val sig_items : Ast.sig_item Gram.Entry.t
2701 val star_ctyp : Ast.ctyp Gram.Entry.t
2703 val str_item : Ast.str_item Gram.Entry.t
2705 val str_item_quot : Ast.str_item Gram.Entry.t
2707 val str_items : Ast.str_item Gram.Entry.t
2709 val type_constraint : unit Gram.Entry.t
2711 val type_declaration : Ast.ctyp Gram.Entry.t
2713 val type_ident_and_parameters :
2714 (string * (Ast.ctyp list)) Gram.Entry.t
2716 val type_kind : Ast.ctyp Gram.Entry.t
2718 val type_longident : Ast.ident Gram.Entry.t
2720 val type_longident_and_parameters : Ast.ctyp Gram.Entry.t
2722 val type_parameter : Ast.ctyp Gram.Entry.t
2724 val type_parameters : (Ast.ctyp -> Ast.ctyp) Gram.Entry.t
2726 val typevars : Ast.ctyp Gram.Entry.t
2728 val val_longident : Ast.ident Gram.Entry.t
2730 val value_let : unit Gram.Entry.t
2732 val value_val : unit Gram.Entry.t
2734 val with_constr : Ast.with_constr Gram.Entry.t
2736 val with_constr_quot : Ast.with_constr Gram.Entry.t
2738 val prefixop : Ast.expr Gram.Entry.t
2740 val infixop0 : Ast.expr Gram.Entry.t
2742 val infixop1 : Ast.expr Gram.Entry.t
2744 val infixop2 : Ast.expr Gram.Entry.t
2746 val infixop3 : Ast.expr Gram.Entry.t
2748 val infixop4 : Ast.expr Gram.Entry.t
2752 module type SyntaxExtension =
2753 functor (Syn : Syntax) -> Syntax with module Loc = Syn.Loc
2754 and module Ast = Syn.Ast and module Token = Syn.Token
2755 and module Gram = Syn.Gram and module Quotation = Syn.Quotation
2759 module ErrorHandler :
2761 val print : Format.formatter -> exn -> unit
2763 val try_print : Format.formatter -> exn -> unit
2765 val to_string : exn -> string
2767 val try_to_string : exn -> string
2769 val register : (Format.formatter -> exn -> unit) -> unit
2771 module Register (Error : Sig.Error) : sig end
2773 module ObjTools :
2775 val print : Format.formatter -> Obj.t -> unit
2777 val print_desc : Format.formatter -> Obj.t -> unit
2779 val to_string : Obj.t -> string
2781 val desc : Obj.t -> string
2785 end =
2786 struct
2787 open Format
2789 module ObjTools =
2790 struct
2791 let desc obj =
2792 if Obj.is_block obj
2793 then "tag = " ^ (string_of_int (Obj.tag obj))
2794 else "int_val = " ^ (string_of_int (Obj.obj obj))
2796 let rec to_string r =
2797 if Obj.is_int r
2798 then
2799 (let i : int = Obj.magic r
2800 in (string_of_int i) ^ (" | CstTag" ^ (string_of_int (i + 1))))
2801 else
2802 (let rec get_fields acc =
2803 function
2804 | 0 -> acc
2805 | n -> let n = n - 1 in get_fields ((Obj.field r n) :: acc) n in
2806 let rec is_list r =
2807 if Obj.is_int r
2808 then r = (Obj.repr 0)
2809 else
2810 (let s = Obj.size r
2811 and t = Obj.tag r
2812 in (t = 0) && ((s = 2) && (is_list (Obj.field r 1)))) in
2813 let rec get_list r =
2814 if Obj.is_int r
2815 then []
2816 else
2817 (let h = Obj.field r 0
2818 and t = get_list (Obj.field r 1)
2819 in h :: t) in
2820 let opaque name = "<" ^ (name ^ ">") in
2821 let s = Obj.size r
2822 and t = Obj.tag r
2824 match t with
2825 | _ when is_list r ->
2826 let fields = get_list r
2828 "[" ^
2829 ((String.concat "; " (List.map to_string fields)) ^
2830 "]")
2831 | 0 ->
2832 let fields = get_fields [] s
2834 "(" ^
2835 ((String.concat ", " (List.map to_string fields)) ^
2836 ")")
2837 | x when x = Obj.lazy_tag -> opaque "lazy"
2838 | x when x = Obj.closure_tag -> opaque "closure"
2839 | x when x = Obj.object_tag ->
2840 let fields = get_fields [] s in
2841 let (_class, id, slots) =
2842 (match fields with
2843 | h :: h' :: t -> (h, h', t)
2844 | _ -> assert false)
2846 "Object #" ^
2847 ((to_string id) ^
2848 (" (" ^
2849 ((String.concat ", " (List.map to_string slots))
2850 ^ ")")))
2851 | x when x = Obj.infix_tag -> opaque "infix"
2852 | x when x = Obj.forward_tag -> opaque "forward"
2853 | x when x < Obj.no_scan_tag ->
2854 let fields = get_fields [] s
2856 "Tag" ^
2857 ((string_of_int t) ^
2858 (" (" ^
2859 ((String.concat ", " (List.map to_string fields))
2860 ^ ")")))
2861 | x when x = Obj.string_tag ->
2862 "\"" ^ ((String.escaped (Obj.magic r : string)) ^ "\"")
2863 | x when x = Obj.double_tag ->
2864 string_of_float (Obj.magic r : float)
2865 | x when x = Obj.abstract_tag -> opaque "abstract"
2866 | x when x = Obj.custom_tag -> opaque "custom"
2867 | x when x = Obj.final_tag -> opaque "final"
2868 | _ ->
2869 failwith
2870 ("ObjTools.to_string: unknown tag (" ^
2871 ((string_of_int t) ^ ")")))
2873 let print ppf x = fprintf ppf "%s" (to_string x)
2875 let print_desc ppf x = fprintf ppf "%s" (desc x)
2879 let default_handler ppf x =
2880 let x = Obj.repr x
2882 (fprintf ppf "Camlp4: Uncaught exception: %s"
2883 (Obj.obj (Obj.field (Obj.field x 0) 0) : string);
2884 if (Obj.size x) > 1
2885 then
2886 (pp_print_string ppf " (";
2887 for i = 1 to (Obj.size x) - 1 do
2888 if i > 1 then pp_print_string ppf ", " else ();
2889 ObjTools.print ppf (Obj.field x i)
2890 done;
2891 pp_print_char ppf ')')
2892 else ();
2893 fprintf ppf "@.")
2895 let handler =
2896 ref (fun ppf default_handler exn -> default_handler ppf exn)
2898 let register f =
2899 let current_handler = !handler
2901 handler :=
2902 fun ppf default_handler exn ->
2903 try f ppf exn
2904 with | exn -> current_handler ppf default_handler exn
2906 module Register (Error : Sig.Error) =
2907 struct
2908 let _ =
2909 let current_handler = !handler
2911 handler :=
2912 fun ppf default_handler ->
2913 function
2914 | Error.E x -> Error.print ppf x
2915 | x -> current_handler ppf default_handler x
2919 let gen_print ppf default_handler =
2920 function
2921 | Out_of_memory -> fprintf ppf "Out of memory"
2922 | Assert_failure ((file, line, char)) ->
2923 fprintf ppf "Assertion failed, file %S, line %d, char %d" file line
2924 char
2925 | Match_failure ((file, line, char)) ->
2926 fprintf ppf "Pattern matching failed, file %S, line %d, char %d"
2927 file line char
2928 | Failure str -> fprintf ppf "Failure: %S" str
2929 | Invalid_argument str -> fprintf ppf "Invalid argument: %S" str
2930 | Sys_error str -> fprintf ppf "I/O error: %S" str
2931 | Stream.Failure -> fprintf ppf "Parse failure"
2932 | Stream.Error str -> fprintf ppf "Parse error: %s" str
2933 | x -> !handler ppf default_handler x
2935 let print ppf = gen_print ppf default_handler
2937 let try_print ppf = gen_print ppf (fun _ -> raise)
2939 let to_string exn =
2940 let buf = Buffer.create 128 in
2941 let () = bprintf buf "%a" print exn in Buffer.contents buf
2943 let try_to_string exn =
2944 let buf = Buffer.create 128 in
2945 let () = bprintf buf "%a" try_print exn in Buffer.contents buf
2949 module Struct =
2950 struct
2951 module Loc : sig include Sig.Loc
2952 end =
2953 struct
2954 open Format
2956 type pos = { line : int; bol : int; off : int }
2958 type t =
2959 { file_name : string; start : pos; stop : pos; ghost : bool
2962 let dump_sel f x =
2963 let s =
2964 match x with
2965 | `start -> "`start"
2966 | `stop -> "`stop"
2967 | `both -> "`both"
2968 | _ -> "<not-printable>"
2969 in pp_print_string f s
2971 let dump_pos f x =
2972 fprintf f "@[<hov 2>{ line = %d ;@ bol = %d ;@ off = %d } : pos@]"
2973 x.line x.bol x.off
2975 let dump_long f x =
2976 fprintf f
2977 "@[<hov 2>{ file_name = %s ;@ start = %a (%d-%d);@ stop = %a (%d);@ ghost = %b@ } : Loc.t@]"
2978 x.file_name dump_pos x.start (x.start.off - x.start.bol)
2979 (x.stop.off - x.start.bol) dump_pos x.stop
2980 (x.stop.off - x.stop.bol) x.ghost
2982 let dump f x =
2983 fprintf f "[%S: %d:%d-%d %d:%d%t]" x.file_name x.start.line
2984 (x.start.off - x.start.bol) (x.stop.off - x.start.bol)
2985 x.stop.line (x.stop.off - x.stop.bol)
2986 (fun o -> if x.ghost then fprintf o " (ghost)" else ())
2988 let start_pos = { line = 1; bol = 0; off = 0; }
2990 let ghost =
2992 file_name = "ghost-location";
2993 start = start_pos;
2994 stop = start_pos;
2995 ghost = true;
2998 let mk file_name =
3000 file_name = file_name;
3001 start = start_pos;
3002 stop = start_pos;
3003 ghost = false;
3006 let of_tuple (file_name, start_line, start_bol, start_off, stop_line,
3007 stop_bol, stop_off, ghost)
3010 file_name = file_name;
3011 start = { line = start_line; bol = start_bol; off = start_off; };
3012 stop = { line = stop_line; bol = stop_bol; off = stop_off; };
3013 ghost = ghost;
3016 let to_tuple {
3017 file_name = file_name;
3018 start =
3020 line = start_line;
3021 bol = start_bol;
3022 off = start_off
3024 stop =
3025 { line = stop_line; bol = stop_bol; off = stop_off };
3026 ghost = ghost
3028 (file_name, start_line, start_bol, start_off, stop_line, stop_bol,
3029 stop_off, ghost)
3031 let pos_of_lexing_position p =
3032 let pos =
3034 line = p.Lexing.pos_lnum;
3035 bol = p.Lexing.pos_bol;
3036 off = p.Lexing.pos_cnum;
3038 in pos
3040 let pos_to_lexing_position p file_name =
3042 Lexing.pos_fname = file_name;
3043 pos_lnum = p.line;
3044 pos_bol = p.bol;
3045 pos_cnum = p.off;
3048 let better_file_name a b =
3049 match (a, b) with
3050 | ("", "") -> a
3051 | ("", x) -> x
3052 | (x, "") -> x
3053 | ("-", x) -> x
3054 | (x, "-") -> x
3055 | (x, _) -> x
3057 let of_lexbuf lb =
3058 let start = Lexing.lexeme_start_p lb
3059 and stop = Lexing.lexeme_end_p lb in
3060 let loc =
3062 file_name =
3063 better_file_name start.Lexing.pos_fname stop.Lexing.pos_fname;
3064 start = pos_of_lexing_position start;
3065 stop = pos_of_lexing_position stop;
3066 ghost = false;
3068 in loc
3070 let of_lexing_position pos =
3071 let loc =
3073 file_name = pos.Lexing.pos_fname;
3074 start = pos_of_lexing_position pos;
3075 stop = pos_of_lexing_position pos;
3076 ghost = false;
3078 in loc
3080 let to_ocaml_location x =
3082 Camlp4_import.Location.loc_start =
3083 pos_to_lexing_position x.start x.file_name;
3084 loc_end = pos_to_lexing_position x.stop x.file_name;
3085 loc_ghost = x.ghost;
3088 let of_ocaml_location {
3089 Camlp4_import.Location.loc_start = a;
3090 loc_end = b;
3091 loc_ghost = g
3093 let res =
3095 file_name =
3096 better_file_name a.Lexing.pos_fname b.Lexing.pos_fname;
3097 start = pos_of_lexing_position a;
3098 stop = pos_of_lexing_position b;
3099 ghost = g;
3101 in res
3103 let start_pos x = pos_to_lexing_position x.start x.file_name
3105 let stop_pos x = pos_to_lexing_position x.stop x.file_name
3107 let merge a b =
3108 if a == b
3109 then a
3110 else
3111 (let r =
3112 match ((a.ghost), (b.ghost)) with
3113 | (false, false) -> { (a) with stop = b.stop; }
3114 | (true, true) -> { (a) with stop = b.stop; }
3115 | (true, _) -> { (a) with stop = b.stop; }
3116 | (_, true) -> { (b) with start = a.start; }
3117 in r)
3119 let join x = { (x) with stop = x.start; }
3121 let map f start_stop_both x =
3122 match start_stop_both with
3123 | `start -> { (x) with start = f x.start; }
3124 | `stop -> { (x) with stop = f x.stop; }
3125 | `both -> { (x) with start = f x.start; stop = f x.stop; }
3127 let move_pos chars x = { (x) with off = x.off + chars; }
3129 let move s chars x = map (move_pos chars) s x
3131 let move_line lines x =
3132 let move_line_pos x =
3133 { (x) with line = x.line + lines; bol = x.off; }
3134 in map move_line_pos `both x
3136 let shift width x =
3137 { (x) with start = x.stop; stop = move_pos width x.stop; }
3139 let file_name x = x.file_name
3141 let start_line x = x.start.line
3143 let stop_line x = x.stop.line
3145 let start_bol x = x.start.bol
3147 let stop_bol x = x.stop.bol
3149 let start_off x = x.start.off
3151 let stop_off x = x.stop.off
3153 let is_ghost x = x.ghost
3155 let set_file_name s x = { (x) with file_name = s; }
3157 let ghostify x = { (x) with ghost = true; }
3159 let make_absolute x =
3160 let pwd = Sys.getcwd ()
3162 if Filename.is_relative x.file_name
3163 then { (x) with file_name = Filename.concat pwd x.file_name; }
3164 else x
3166 let strictly_before x y =
3167 let b = (x.stop.off < y.start.off) && (x.file_name = y.file_name)
3168 in b
3170 let to_string x =
3171 let (a, b) = ((x.start), (x.stop)) in
3172 let res =
3173 sprintf "File \"%s\", line %d, characters %d-%d" x.file_name
3174 a.line (a.off - a.bol) (b.off - a.bol)
3176 if x.start.line <> x.stop.line
3177 then
3178 sprintf "%s (end at line %d, character %d)" res x.stop.line
3179 (b.off - b.bol)
3180 else res
3182 let print out x = pp_print_string out (to_string x)
3184 let check x msg =
3186 ((start_line x) > (stop_line x)) ||
3187 (((start_bol x) > (stop_bol x)) ||
3188 (((start_off x) > (stop_off x)) ||
3189 (((start_line x) < 0) ||
3190 (((stop_line x) < 0) ||
3191 (((start_bol x) < 0) ||
3192 (((stop_bol x) < 0) ||
3193 (((start_off x) < 0) || ((stop_off x) < 0))))))))
3194 then
3195 (eprintf "*** Warning: (%s) strange positions ***\n%a@\n" msg
3196 print x;
3197 false)
3198 else true
3200 exception Exc_located of t * exn
3202 let _ =
3203 ErrorHandler.register
3204 (fun ppf ->
3205 function
3206 | Exc_located (loc, exn) ->
3207 fprintf ppf "%a:@\n%a" print loc ErrorHandler.print exn
3208 | exn -> raise exn)
3210 let name = ref "_loc"
3212 let raise loc exc =
3213 match exc with
3214 | Exc_located (_, _) -> raise exc
3215 | _ -> raise (Exc_located (loc, exc))
3219 module Token :
3221 module Make (Loc : Sig.Loc) : Sig.Camlp4Token with module Loc = Loc
3223 module Eval :
3225 val char : string -> char
3227 val string : ?strict: unit -> string -> string
3231 end =
3232 struct
3233 open Format
3235 module Make (Loc : Sig.Loc) : Sig.Camlp4Token with module Loc = Loc =
3236 struct
3237 module Loc = Loc
3239 open Sig
3241 type t = camlp4_token
3243 type token = t
3245 let to_string =
3246 function
3247 | KEYWORD s -> sprintf "KEYWORD %S" s
3248 | SYMBOL s -> sprintf "SYMBOL %S" s
3249 | LIDENT s -> sprintf "LIDENT %S" s
3250 | UIDENT s -> sprintf "UIDENT %S" s
3251 | INT (_, s) -> sprintf "INT %s" s
3252 | INT32 (_, s) -> sprintf "INT32 %sd" s
3253 | INT64 (_, s) -> sprintf "INT64 %sd" s
3254 | NATIVEINT (_, s) -> sprintf "NATIVEINT %sd" s
3255 | FLOAT (_, s) -> sprintf "FLOAT %s" s
3256 | CHAR (_, s) -> sprintf "CHAR '%s'" s
3257 | STRING (_, s) -> sprintf "STRING \"%s\"" s
3258 | LABEL s -> sprintf "LABEL %S" s
3259 | OPTLABEL s -> sprintf "OPTLABEL %S" s
3260 | ANTIQUOT (n, s) -> sprintf "ANTIQUOT %s: %S" n s
3261 | QUOTATION x ->
3262 sprintf
3263 "QUOTATION { q_name=%S; q_loc=%S; q_shift=%d; q_contents=%S }"
3264 x.q_name x.q_loc x.q_shift x.q_contents
3265 | COMMENT s -> sprintf "COMMENT %S" s
3266 | BLANKS s -> sprintf "BLANKS %S" s
3267 | NEWLINE -> sprintf "NEWLINE"
3268 | EOI -> sprintf "EOI"
3269 | ESCAPED_IDENT s -> sprintf "ESCAPED_IDENT %S" s
3270 | LINE_DIRECTIVE (i, None) -> sprintf "LINE_DIRECTIVE %d" i
3271 | LINE_DIRECTIVE (i, (Some s)) ->
3272 sprintf "LINE_DIRECTIVE %d %S" i s
3274 let print ppf x = pp_print_string ppf (to_string x)
3276 let match_keyword kwd =
3277 function | KEYWORD kwd' when kwd = kwd' -> true | _ -> false
3279 let extract_string =
3280 function
3281 | KEYWORD s | SYMBOL s | LIDENT s | UIDENT s | INT (_, s) |
3282 INT32 (_, s) | INT64 (_, s) | NATIVEINT (_, s) |
3283 FLOAT (_, s) | CHAR (_, s) | STRING (_, s) | LABEL s |
3284 OPTLABEL s | COMMENT s | BLANKS s | ESCAPED_IDENT s -> s
3285 | tok ->
3286 invalid_arg
3287 ("Cannot extract a string from this token: " ^
3288 (to_string tok))
3290 module Error =
3291 struct
3292 type t =
3293 | Illegal_token of string
3294 | Keyword_as_label of string
3295 | Illegal_token_pattern of string * string
3296 | Illegal_constructor of string
3298 exception E of t
3300 let print ppf =
3301 function
3302 | Illegal_token s -> fprintf ppf "Illegal token (%s)" s
3303 | Keyword_as_label kwd ->
3304 fprintf ppf
3305 "`%s' is a keyword, it cannot be used as label name"
3307 | Illegal_token_pattern (p_con, p_prm) ->
3308 fprintf ppf "Illegal token pattern: %s %S" p_con p_prm
3309 | Illegal_constructor con ->
3310 fprintf ppf "Illegal constructor %S" con
3312 let to_string x =
3313 let b = Buffer.create 50 in
3314 let () = bprintf b "%a" print x in Buffer.contents b
3318 let _ = let module M = ErrorHandler.Register(Error) in ()
3320 module Filter =
3321 struct
3322 type token_filter = (t, Loc.t) stream_filter
3324 type t =
3325 { is_kwd : string -> bool; mutable filter : token_filter
3328 let err error loc =
3329 raise (Loc.Exc_located (loc, Error.E error))
3331 let keyword_conversion tok is_kwd =
3332 match tok with
3333 | SYMBOL s | LIDENT s | UIDENT s when is_kwd s -> KEYWORD s
3334 | ESCAPED_IDENT s -> LIDENT s
3335 | _ -> tok
3337 let check_keyword_as_label tok loc is_kwd =
3338 let s =
3339 match tok with | LABEL s -> s | OPTLABEL s -> s | _ -> ""
3341 if (s <> "") && (is_kwd s)
3342 then err (Error.Keyword_as_label s) loc
3343 else ()
3345 let check_unknown_keywords tok loc =
3346 match tok with
3347 | SYMBOL s -> err (Error.Illegal_token s) loc
3348 | _ -> ()
3350 let error_no_respect_rules p_con p_prm =
3351 raise
3352 (Error.E (Error.Illegal_token_pattern (p_con, p_prm)))
3354 let check_keyword _ = true
3356 let error_on_unknown_keywords = ref false
3358 let rec ignore_layout (__strm : _ Stream.t) =
3359 match Stream.peek __strm with
3360 | Some
3361 (((COMMENT _ | BLANKS _ | NEWLINE |
3362 LINE_DIRECTIVE (_, _)),
3364 -> (Stream.junk __strm; ignore_layout __strm)
3365 | Some x ->
3366 (Stream.junk __strm;
3367 let s = __strm
3369 Stream.icons x
3370 (Stream.slazy (fun _ -> ignore_layout s)))
3371 | _ -> Stream.sempty
3373 let mk is_kwd = { is_kwd = is_kwd; filter = ignore_layout; }
3375 let filter x =
3376 let f tok loc =
3377 let tok = keyword_conversion tok x.is_kwd
3379 (check_keyword_as_label tok loc x.is_kwd;
3380 if !error_on_unknown_keywords
3381 then check_unknown_keywords tok loc
3382 else ();
3383 (tok, loc)) in
3384 let rec filter (__strm : _ Stream.t) =
3385 match Stream.peek __strm with
3386 | Some ((tok, loc)) ->
3387 (Stream.junk __strm;
3388 let s = __strm
3390 Stream.lcons (fun _ -> f tok loc)
3391 (Stream.slazy (fun _ -> filter s)))
3392 | _ -> Stream.sempty in
3393 let rec tracer (__strm : _ Stream.t) =
3394 match Stream.peek __strm with
3395 | Some (((_tok, _loc) as x)) ->
3396 (Stream.junk __strm;
3397 let xs = __strm
3399 Stream.icons x (Stream.slazy (fun _ -> tracer xs)))
3400 | _ -> Stream.sempty
3401 in fun strm -> tracer (x.filter (filter strm))
3403 let define_filter x f = x.filter <- f x.filter
3405 let keyword_added _ _ _ = ()
3407 let keyword_removed _ _ = ()
3413 module Eval =
3414 struct
3415 let valch x = (Char.code x) - (Char.code '0')
3417 let valch_hex x =
3418 let d = Char.code x
3420 if d >= 97
3421 then d - 87
3422 else if d >= 65 then d - 55 else d - 48
3424 let rec skip_indent (__strm : _ Stream.t) =
3425 match Stream.peek __strm with
3426 | Some (' ' | '\t') -> (Stream.junk __strm; skip_indent __strm)
3427 | _ -> ()
3429 let skip_opt_linefeed (__strm : _ Stream.t) =
3430 match Stream.peek __strm with
3431 | Some '\010' -> (Stream.junk __strm; ())
3432 | _ -> ()
3434 let chr c =
3435 if (c < 0) || (c > 255)
3436 then failwith "invalid char token"
3437 else Char.chr c
3439 let rec backslash (__strm : _ Stream.t) =
3440 match Stream.peek __strm with
3441 | Some '\010' -> (Stream.junk __strm; '\010')
3442 | Some '\013' -> (Stream.junk __strm; '\013')
3443 | Some 'n' -> (Stream.junk __strm; '\n')
3444 | Some 'r' -> (Stream.junk __strm; '\r')
3445 | Some 't' -> (Stream.junk __strm; '\t')
3446 | Some 'b' -> (Stream.junk __strm; '\b')
3447 | Some '\\' -> (Stream.junk __strm; '\\')
3448 | Some '"' -> (Stream.junk __strm; '"')
3449 | Some '\'' -> (Stream.junk __strm; '\'')
3450 | Some ' ' -> (Stream.junk __strm; ' ')
3451 | Some (('0' .. '9' as c1)) ->
3452 (Stream.junk __strm;
3453 (match Stream.peek __strm with
3454 | Some (('0' .. '9' as c2)) ->
3455 (Stream.junk __strm;
3456 (match Stream.peek __strm with
3457 | Some (('0' .. '9' as c3)) ->
3458 (Stream.junk __strm;
3460 (((100 * (valch c1)) + (10 * (valch c2))) +
3461 (valch c3)))
3462 | _ -> raise (Stream.Error "")))
3463 | _ -> raise (Stream.Error "")))
3464 | Some 'x' ->
3465 (Stream.junk __strm;
3466 (match Stream.peek __strm with
3467 | Some (('0' .. '9' | 'a' .. 'f' | 'A' .. 'F' as c1)) ->
3468 (Stream.junk __strm;
3469 (match Stream.peek __strm with
3470 | Some
3471 (('0' .. '9' | 'a' .. 'f' | 'A' .. 'F' as c2))
3473 (Stream.junk __strm;
3474 chr ((16 * (valch_hex c1)) + (valch_hex c2)))
3475 | _ -> raise (Stream.Error "")))
3476 | _ -> raise (Stream.Error "")))
3477 | _ -> raise Stream.Failure
3479 let rec backslash_in_string strict store (__strm : _ Stream.t) =
3480 match Stream.peek __strm with
3481 | Some '\010' -> (Stream.junk __strm; skip_indent __strm)
3482 | Some '\013' ->
3483 (Stream.junk __strm;
3484 let s = __strm in (skip_opt_linefeed s; skip_indent s))
3485 | _ ->
3486 (match try Some (backslash __strm)
3487 with | Stream.Failure -> None
3488 with
3489 | Some x -> store x
3490 | _ ->
3491 (match Stream.peek __strm with
3492 | Some c when not strict ->
3493 (Stream.junk __strm; store '\\'; store c)
3494 | _ -> failwith "invalid string token"))
3496 let char s =
3497 if (String.length s) = 1
3498 then s.[0]
3499 else
3500 if (String.length s) = 0
3501 then failwith "invalid char token"
3502 else
3503 (let (__strm : _ Stream.t) = Stream.of_string s
3505 match Stream.peek __strm with
3506 | Some '\\' ->
3507 (Stream.junk __strm;
3508 (try backslash __strm
3509 with | Stream.Failure -> raise (Stream.Error "")))
3510 | _ -> failwith "invalid char token")
3512 let string ?strict s =
3513 let buf = Buffer.create 23 in
3514 let store = Buffer.add_char buf in
3515 let rec parse (__strm : _ Stream.t) =
3516 match Stream.peek __strm with
3517 | Some '\\' ->
3518 (Stream.junk __strm;
3519 let _ =
3520 (try backslash_in_string (strict <> None) store __strm
3521 with | Stream.Failure -> raise (Stream.Error ""))
3522 in parse __strm)
3523 | Some c ->
3524 (Stream.junk __strm;
3525 let s = __strm in (store c; parse s))
3526 | _ -> Buffer.contents buf
3527 in parse (Stream.of_string s)
3533 module Lexer =
3534 struct
3535 module TokenEval = Token.Eval
3537 module Make (Token : Sig.Camlp4Token) =
3538 struct
3539 module Loc = Token.Loc
3541 module Token = Token
3543 open Lexing
3545 open Sig
3547 module Error =
3548 struct
3549 type t =
3550 | Illegal_character of char
3551 | Illegal_escape of string
3552 | Unterminated_comment
3553 | Unterminated_string
3554 | Unterminated_quotation
3555 | Unterminated_antiquot
3556 | Unterminated_string_in_comment
3557 | Comment_start
3558 | Comment_not_end
3559 | Literal_overflow of string
3561 exception E of t
3563 open Format
3565 let print ppf =
3566 function
3567 | Illegal_character c ->
3568 fprintf ppf "Illegal character (%s)" (Char.escaped c)
3569 | Illegal_escape s ->
3570 fprintf ppf
3571 "Illegal backslash escape in string or character (%s)"
3573 | Unterminated_comment ->
3574 fprintf ppf "Comment not terminated"
3575 | Unterminated_string ->
3576 fprintf ppf "String literal not terminated"
3577 | Unterminated_string_in_comment ->
3578 fprintf ppf
3579 "This comment contains an unterminated string literal"
3580 | Unterminated_quotation ->
3581 fprintf ppf "Quotation not terminated"
3582 | Unterminated_antiquot ->
3583 fprintf ppf "Antiquotation not terminated"
3584 | Literal_overflow ty ->
3585 fprintf ppf
3586 "Integer literal exceeds the range of representable integers of type %s"
3588 | Comment_start ->
3589 fprintf ppf "this is the start of a comment"
3590 | Comment_not_end ->
3591 fprintf ppf "this is not the end of a comment"
3593 let to_string x =
3594 let b = Buffer.create 50 in
3595 let () = bprintf b "%a" print x in Buffer.contents b
3599 let _ = let module M = ErrorHandler.Register(Error) in ()
3601 open Error
3603 type context =
3604 { loc : Loc.t; in_comment : bool; quotations : bool;
3605 antiquots : bool; lexbuf : lexbuf; buffer : Buffer.t
3608 let default_context lb =
3610 loc = Loc.ghost;
3611 in_comment = false;
3612 quotations = true;
3613 antiquots = false;
3614 lexbuf = lb;
3615 buffer = Buffer.create 256;
3618 let store c = Buffer.add_string c.buffer (Lexing.lexeme c.lexbuf)
3620 let istore_char c i =
3621 Buffer.add_char c.buffer (Lexing.lexeme_char c.lexbuf i)
3623 let buff_contents c =
3624 let contents = Buffer.contents c.buffer
3625 in (Buffer.reset c.buffer; contents)
3627 let loc c = Loc.merge c.loc (Loc.of_lexbuf c.lexbuf)
3629 let quotations c = c.quotations
3631 let antiquots c = c.antiquots
3633 let is_in_comment c = c.in_comment
3635 let in_comment c = { (c) with in_comment = true; }
3637 let set_start_p c = c.lexbuf.lex_start_p <- Loc.start_pos c.loc
3639 let move_start_p shift c =
3640 let p = c.lexbuf.lex_start_p
3642 c.lexbuf.lex_start_p <-
3643 { (p) with pos_cnum = p.pos_cnum + shift; }
3645 let update_loc c = { (c) with loc = Loc.of_lexbuf c.lexbuf; }
3647 let with_curr_loc f c = f (update_loc c) c.lexbuf
3649 let parse_nested f c =
3650 (with_curr_loc f c; set_start_p c; buff_contents c)
3652 let shift n c = { (c) with loc = Loc.move `both n c.loc; }
3654 let store_parse f c = (store c; f c c.lexbuf)
3656 let parse f c = f c c.lexbuf
3658 let mk_quotation quotation c name loc shift =
3659 let s = parse_nested quotation (update_loc c) in
3660 let contents = String.sub s 0 ((String.length s) - 2)
3662 QUOTATION
3664 q_name = name;
3665 q_loc = loc;
3666 q_shift = shift;
3667 q_contents = contents;
3670 let update_loc c file line absolute chars =
3671 let lexbuf = c.lexbuf in
3672 let pos = lexbuf.lex_curr_p in
3673 let new_file =
3674 match file with | None -> pos.pos_fname | Some s -> s
3676 lexbuf.lex_curr_p <-
3678 (pos)
3679 with
3680 pos_fname = new_file;
3681 pos_lnum = if absolute then line else pos.pos_lnum + line;
3682 pos_bol = pos.pos_cnum - chars;
3685 let err error loc = raise (Loc.Exc_located (loc, Error.E error))
3687 let warn error loc =
3688 Format.eprintf "Warning: %a: %a@." Loc.print loc Error.print
3689 error
3691 let __ocaml_lex_tables =
3693 Lexing.lex_base =
3694 "\000\000\223\255\224\255\224\000\226\255\253\000\035\001\072\001\
3695 \109\001\146\001\091\000\183\001\068\000\190\001\218\001\227\255\
3696 \122\000\002\002\071\002\110\002\176\000\244\255\129\002\162\002\
3697 \235\002\187\003\154\004\246\004\124\000\001\000\255\255\198\005\
3698 \253\255\150\006\252\255\245\255\246\255\247\255\253\000\224\000\
3699 \086\000\091\000\054\003\006\004\029\002\237\001\182\004\109\000\
3700 \118\007\091\000\253\000\093\000\243\255\242\255\241\255\106\005\
3701 \077\003\108\000\087\003\017\006\151\007\218\007\001\008\068\008\
3702 \107\008\107\000\239\255\126\008\075\001\210\008\249\008\060\009\
3703 \232\255\231\255\230\255\099\009\166\009\205\009\016\010\055\010\
3704 \249\001\228\255\229\255\238\255\090\010\127\010\164\010\201\010\
3705 \238\010\019\011\056\011\091\011\128\011\165\011\202\011\239\011\
3706 \020\012\057\012\094\012\011\007\136\005\004\000\233\255\008\000\
3707 \054\001\245\002\009\000\005\000\233\255\131\012\138\012\175\012\
3708 \212\012\249\012\000\013\037\013\068\013\096\013\133\013\138\013\
3709 \205\013\242\013\023\014\085\014\006\000\148\002\251\255\047\015\
3710 \123\000\109\000\125\000\254\255\111\015\046\016\254\016\206\017\
3711 \174\018\129\000\017\001\130\000\141\000\249\255\248\255\237\006\
3712 \109\003\143\000\035\004\145\000\160\014\149\000\086\004\007\000\
3713 \201\018\250\255\121\016\154\004\091\001\057\001\171\004\073\017\
3714 \240\018\051\019\018\020\048\020\015\021\238\021\015\022\079\022\
3715 \031\023\254\255\164\001\010\000\128\000\079\001\095\023\030\024\
3716 \238\024\190\025\154\026\201\000\116\027\077\028\028\001\029\029\
3717 \206\001\080\001\013\000\093\029\028\030\236\030\188\031";
3718 Lexing.lex_backtrk =
3719 "\255\255\255\255\255\255\030\000\255\255\028\000\030\000\030\000\
3720 \030\000\030\000\028\000\028\000\028\000\028\000\028\000\255\255\
3721 \028\000\030\000\030\000\028\000\028\000\255\255\006\000\006\000\
3722 \005\000\004\000\030\000\030\000\001\000\000\000\255\255\255\255\
3723 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\007\000\
3724 \255\255\255\255\255\255\006\000\006\000\006\000\007\000\255\255\
3725 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\014\000\
3726 \014\000\014\000\255\255\255\255\255\255\255\255\255\255\028\000\
3727 \028\000\015\000\255\255\028\000\255\255\255\255\028\000\255\255\
3728 \255\255\255\255\255\255\028\000\028\000\255\255\255\255\255\255\
3729 \255\255\255\255\255\255\255\255\255\255\030\000\021\000\020\000\
3730 \018\000\030\000\018\000\018\000\018\000\018\000\028\000\018\000\
3731 \255\255\019\000\030\000\255\255\255\255\022\000\255\255\255\255\
3732 \255\255\255\255\255\255\022\000\255\255\255\255\255\255\255\255\
3733 \028\000\255\255\028\000\255\255\028\000\028\000\028\000\028\000\
3734 \030\000\030\000\030\000\255\255\013\000\014\000\255\255\003\000\
3735 \014\000\014\000\014\000\255\255\255\255\255\255\255\255\255\255\
3736 \255\255\255\255\255\255\255\255\005\000\255\255\255\255\255\255\
3737 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\006\000\
3738 \008\000\255\255\005\000\005\000\001\000\001\000\255\255\255\255\
3739 \000\000\001\000\001\000\255\255\002\000\002\000\255\255\255\255\
3740 \255\255\255\255\255\255\003\000\004\000\004\000\255\255\255\255\
3741 \255\255\255\255\255\255\002\000\002\000\002\000\255\255\255\255\
3742 \255\255\004\000\002\000\255\255\255\255\255\255\255\255";
3743 Lexing.lex_default =
3744 "\001\000\000\000\000\000\255\255\000\000\255\255\255\255\255\255\
3745 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\
3746 \255\255\255\255\255\255\255\255\049\000\000\000\255\255\255\255\
3747 \255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\
3748 \000\000\255\255\000\000\000\000\000\000\000\000\255\255\255\255\
3749 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
3750 \054\000\255\255\255\255\255\255\000\000\000\000\000\000\255\255\
3751 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
3752 \255\255\255\255\000\000\255\255\255\255\255\255\255\255\255\255\
3753 \000\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
3754 \255\255\000\000\000\000\000\000\255\255\255\255\255\255\255\255\
3755 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
3756 \255\255\255\255\255\255\103\000\255\255\255\255\000\000\103\000\
3757 \104\000\103\000\106\000\255\255\000\000\255\255\255\255\255\255\
3758 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
3759 \255\255\255\255\255\255\054\000\255\255\137\000\000\000\255\255\
3760 \255\255\255\255\255\255\000\000\255\255\255\255\255\255\255\255\
3761 \255\255\255\255\255\255\255\255\255\255\000\000\000\000\255\255\
3762 \255\255\255\255\255\255\255\255\255\255\255\255\037\000\255\255\
3763 \153\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
3764 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
3765 \255\255\000\000\126\000\255\255\255\255\255\255\255\255\255\255\
3766 \255\255\255\255\032\000\255\255\255\255\255\255\255\255\255\255\
3767 \126\000\255\255\255\255\255\255\255\255\255\255\255\255";
3768 Lexing.lex_trans =
3769 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3770 \000\000\028\000\030\000\030\000\028\000\029\000\102\000\108\000\
3771 \053\000\141\000\102\000\108\000\034\000\101\000\107\000\032\000\
3772 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3773 \028\000\003\000\021\000\016\000\004\000\009\000\009\000\020\000\
3774 \019\000\005\000\018\000\003\000\015\000\003\000\014\000\009\000\
3775 \023\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
3776 \022\000\022\000\013\000\012\000\017\000\006\000\007\000\026\000\
3777 \009\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3778 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3779 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3780 \024\000\024\000\024\000\011\000\003\000\005\000\009\000\025\000\
3781 \015\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3782 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3783 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3784 \025\000\025\000\025\000\010\000\008\000\005\000\027\000\015\000\
3785 \117\000\117\000\053\000\100\000\052\000\028\000\045\000\045\000\
3786 \028\000\115\000\117\000\044\000\044\000\044\000\044\000\044\000\
3787 \044\000\044\000\044\000\053\000\066\000\118\000\131\000\116\000\
3788 \115\000\115\000\100\000\117\000\028\000\046\000\046\000\046\000\
3789 \046\000\046\000\046\000\046\000\046\000\046\000\046\000\030\000\
3790 \037\000\142\000\099\000\099\000\099\000\099\000\099\000\099\000\
3791 \099\000\099\000\099\000\099\000\141\000\133\000\036\000\032\000\
3792 \035\000\117\000\051\000\132\000\021\000\050\000\131\000\000\000\
3793 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3794 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3795 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\118\000\
3796 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\025\000\
3797 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3798 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3799 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\182\000\
3800 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3801 \002\000\003\000\000\000\131\000\003\000\003\000\003\000\051\000\
3802 \255\255\255\255\003\000\003\000\048\000\003\000\003\000\003\000\
3803 \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
3804 \039\000\039\000\003\000\139\000\003\000\003\000\003\000\003\000\
3805 \003\000\000\000\096\000\096\000\052\000\038\000\084\000\000\000\
3806 \047\000\000\000\047\000\084\000\096\000\046\000\046\000\046\000\
3807 \046\000\046\000\046\000\046\000\046\000\046\000\046\000\084\000\
3808 \142\000\084\000\084\000\084\000\003\000\096\000\003\000\039\000\
3809 \102\000\000\000\157\000\101\000\003\000\038\000\000\000\003\000\
3810 \009\000\009\000\182\000\000\000\084\000\003\000\003\000\000\000\
3811 \003\000\006\000\009\000\000\000\068\000\000\000\131\000\068\000\
3812 \106\000\157\000\084\000\096\000\003\000\085\000\003\000\006\000\
3813 \006\000\006\000\003\000\009\000\157\000\157\000\000\000\000\000\
3814 \000\000\003\000\000\000\068\000\003\000\121\000\121\000\000\000\
3815 \000\000\084\000\003\000\003\000\074\000\003\000\007\000\121\000\
3816 \000\000\084\000\084\000\157\000\000\000\000\000\000\000\003\000\
3817 \084\000\009\000\120\000\000\000\007\000\007\000\007\000\003\000\
3818 \121\000\175\000\188\000\030\000\034\000\000\000\003\000\174\000\
3819 \187\000\003\000\009\000\009\000\000\000\000\000\005\000\003\000\
3820 \003\000\000\000\003\000\006\000\009\000\000\000\000\000\085\000\
3821 \084\000\003\000\000\000\000\000\003\000\005\000\121\000\085\000\
3822 \000\000\006\000\006\000\006\000\003\000\009\000\034\000\000\000\
3823 \255\255\171\000\000\000\003\000\000\000\000\000\003\000\009\000\
3824 \009\000\000\000\000\000\094\000\003\000\003\000\000\000\003\000\
3825 \009\000\009\000\000\000\000\000\120\000\005\000\003\000\000\000\
3826 \000\000\003\000\005\000\009\000\098\000\000\000\009\000\009\000\
3827 \009\000\003\000\009\000\000\000\000\000\000\000\000\000\000\000\
3828 \032\000\000\000\000\000\186\000\117\000\117\000\000\000\000\000\
3829 \173\000\000\000\172\000\111\000\111\000\115\000\117\000\005\000\
3830 \000\000\085\000\005\000\003\000\109\000\111\000\003\000\094\000\
3831 \009\000\116\000\030\000\116\000\115\000\115\000\000\000\117\000\
3832 \114\000\000\000\109\000\112\000\112\000\000\000\111\000\111\000\
3833 \111\000\000\000\080\000\084\000\000\000\080\000\000\000\000\000\
3834 \112\000\111\000\185\000\000\000\000\000\000\000\098\000\094\000\
3835 \003\000\000\000\000\000\000\000\110\000\117\000\109\000\109\000\
3836 \109\000\080\000\111\000\005\000\111\000\045\000\045\000\000\000\
3837 \000\000\000\000\081\000\003\000\000\000\000\000\003\000\009\000\
3838 \009\000\000\000\000\000\084\000\003\000\003\000\000\000\003\000\
3839 \006\000\009\000\000\000\116\000\000\000\000\000\255\255\084\000\
3840 \111\000\036\000\110\000\005\000\086\000\000\000\088\000\006\000\
3841 \006\000\003\000\087\000\000\000\000\000\000\000\000\000\000\000\
3842 \000\000\000\000\000\000\000\000\045\000\044\000\044\000\044\000\
3843 \044\000\044\000\044\000\044\000\044\000\000\000\110\000\084\000\
3844 \000\000\037\000\000\000\035\000\000\000\000\000\003\000\084\000\
3845 \009\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3846 \003\000\036\000\000\000\003\000\003\000\003\000\000\000\000\000\
3847 \083\000\003\000\003\000\000\000\003\000\003\000\003\000\060\000\
3848 \000\000\000\000\060\000\000\000\044\000\000\000\085\000\084\000\
3849 \003\000\003\000\000\000\003\000\003\000\003\000\003\000\003\000\
3850 \000\000\037\000\000\000\035\000\000\000\000\000\060\000\061\000\
3851 \000\000\000\000\061\000\064\000\064\000\000\000\000\000\000\000\
3852 \065\000\061\000\000\000\061\000\062\000\064\000\139\000\000\000\
3853 \000\000\138\000\000\000\003\000\032\000\003\000\000\000\000\000\
3854 \063\000\000\000\062\000\062\000\062\000\061\000\064\000\039\000\
3855 \000\000\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
3856 \022\000\022\000\022\000\140\000\000\000\000\000\000\000\000\000\
3857 \000\000\000\000\000\000\003\000\000\000\003\000\038\000\000\000\
3858 \000\000\000\000\061\000\000\000\064\000\036\000\131\000\000\000\
3859 \039\000\000\000\022\000\022\000\022\000\022\000\022\000\022\000\
3860 \022\000\022\000\022\000\022\000\000\000\000\000\000\000\000\000\
3861 \022\000\000\000\000\000\000\000\040\000\000\000\038\000\038\000\
3862 \000\000\000\000\063\000\000\000\061\000\037\000\036\000\035\000\
3863 \136\000\041\000\000\000\000\000\000\000\000\000\000\000\000\000\
3864 \000\000\000\000\042\000\000\000\000\000\000\000\105\000\102\000\
3865 \000\000\022\000\101\000\000\000\040\000\000\000\000\000\038\000\
3866 \000\000\000\000\000\000\000\000\000\000\000\000\037\000\000\000\
3867 \035\000\041\000\024\000\000\000\000\000\105\000\000\000\104\000\
3868 \000\000\000\000\042\000\024\000\024\000\024\000\024\000\024\000\
3869 \024\000\024\000\024\000\024\000\024\000\000\000\000\000\000\000\
3870 \000\000\000\000\000\000\000\000\024\000\024\000\024\000\024\000\
3871 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3872 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3873 \024\000\024\000\024\000\024\000\024\000\024\000\000\000\000\000\
3874 \000\000\000\000\024\000\000\000\024\000\024\000\024\000\024\000\
3875 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3876 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3877 \024\000\024\000\024\000\024\000\024\000\024\000\043\000\043\000\
3878 \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\
3879 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\043\000\
3880 \043\000\043\000\043\000\043\000\043\000\058\000\058\000\058\000\
3881 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\049\000\
3882 \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
3883 \049\000\000\000\000\000\000\000\255\255\000\000\000\000\043\000\
3884 \043\000\043\000\043\000\043\000\043\000\146\000\146\000\146\000\
3885 \146\000\146\000\146\000\146\000\146\000\146\000\146\000\000\000\
3886 \000\000\000\000\000\000\024\000\024\000\024\000\024\000\024\000\
3887 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3888 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3889 \024\000\024\000\000\000\024\000\024\000\024\000\024\000\024\000\
3890 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3891 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3892 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
3893 \024\000\024\000\025\000\024\000\024\000\024\000\024\000\024\000\
3894 \024\000\024\000\024\000\025\000\025\000\025\000\025\000\025\000\
3895 \025\000\025\000\025\000\025\000\025\000\255\255\000\000\000\000\
3896 \000\000\000\000\000\000\000\000\025\000\025\000\025\000\025\000\
3897 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3898 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3899 \025\000\025\000\025\000\025\000\025\000\025\000\000\000\000\000\
3900 \000\000\000\000\025\000\000\000\025\000\025\000\025\000\025\000\
3901 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3902 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3903 \025\000\025\000\025\000\025\000\025\000\025\000\043\000\043\000\
3904 \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\
3905 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\043\000\
3906 \043\000\043\000\043\000\043\000\043\000\000\000\000\000\000\000\
3907 \000\000\000\000\036\000\147\000\147\000\147\000\147\000\147\000\
3908 \147\000\147\000\147\000\147\000\147\000\000\000\000\000\000\000\
3909 \141\000\000\000\000\000\151\000\000\000\043\000\000\000\043\000\
3910 \043\000\043\000\043\000\043\000\043\000\000\000\000\000\000\000\
3911 \000\000\000\000\037\000\000\000\035\000\000\000\000\000\000\000\
3912 \030\000\000\000\000\000\025\000\025\000\025\000\025\000\025\000\
3913 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3914 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3915 \025\000\025\000\000\000\025\000\025\000\025\000\025\000\025\000\
3916 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3917 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3918 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
3919 \025\000\025\000\152\000\025\000\025\000\025\000\025\000\025\000\
3920 \025\000\025\000\025\000\003\000\000\000\000\000\003\000\003\000\
3921 \003\000\000\000\000\000\000\000\003\000\003\000\000\000\003\000\
3922 \003\000\003\000\158\000\158\000\158\000\158\000\158\000\158\000\
3923 \158\000\158\000\158\000\158\000\003\000\000\000\003\000\003\000\
3924 \003\000\003\000\003\000\034\000\034\000\034\000\034\000\034\000\
3925 \034\000\034\000\034\000\034\000\034\000\000\000\046\000\046\000\
3926 \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
3927 \000\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\
3928 \003\000\033\000\000\000\033\000\033\000\033\000\033\000\033\000\
3929 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3930 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3931 \033\000\033\000\033\000\033\000\033\000\046\000\003\000\003\000\
3932 \003\000\000\000\003\000\003\000\003\000\000\000\000\000\000\000\
3933 \003\000\003\000\000\000\003\000\003\000\003\000\000\000\000\000\
3934 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3935 \003\000\000\000\003\000\003\000\003\000\003\000\003\000\000\000\
3936 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3937 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3938 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3939 \000\000\000\000\003\000\000\000\003\000\031\000\142\000\031\000\
3940 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3941 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3942 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3943 \031\000\000\000\003\000\000\000\003\000\000\000\000\000\000\000\
3944 \000\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3945 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3946 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3947 \033\000\100\000\033\000\033\000\033\000\033\000\033\000\033\000\
3948 \033\000\033\000\059\000\059\000\059\000\059\000\059\000\059\000\
3949 \059\000\059\000\059\000\059\000\000\000\000\000\000\000\000\000\
3950 \100\000\000\000\000\000\059\000\059\000\059\000\059\000\059\000\
3951 \059\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3952 \099\000\099\000\099\000\099\000\099\000\099\000\099\000\099\000\
3953 \099\000\099\000\000\000\000\000\000\000\000\000\000\000\000\000\
3954 \000\000\000\000\000\000\059\000\059\000\059\000\059\000\059\000\
3955 \059\000\000\000\000\000\000\000\000\000\031\000\031\000\031\000\
3956 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3957 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3958 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3959 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3960 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3961 \032\000\000\000\000\000\000\000\000\000\000\000\000\000\031\000\
3962 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3963 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3964 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3965 \031\000\000\000\000\000\000\000\000\000\031\000\000\000\031\000\
3966 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3967 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3968 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3969 \031\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
3970 \049\000\049\000\049\000\000\000\000\000\000\000\000\000\000\000\
3971 \000\000\000\000\049\000\049\000\049\000\049\000\049\000\049\000\
3972 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3973 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3974 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3975 \000\000\000\000\049\000\049\000\049\000\049\000\049\000\049\000\
3976 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
3977 \000\000\000\000\000\000\000\000\000\000\000\000\031\000\031\000\
3978 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3979 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3980 \031\000\031\000\031\000\031\000\031\000\000\000\031\000\031\000\
3981 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3982 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3983 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
3984 \031\000\031\000\031\000\031\000\031\000\033\000\031\000\031\000\
3985 \031\000\031\000\031\000\031\000\031\000\031\000\033\000\033\000\
3986 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3987 \034\000\000\000\000\000\000\000\000\000\000\000\000\000\033\000\
3988 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3989 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3990 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3991 \033\000\000\000\000\000\000\000\000\000\033\000\000\000\033\000\
3992 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3993 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3994 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
3995 \033\000\000\000\000\000\000\000\105\000\102\000\000\000\000\000\
3996 \101\000\000\000\000\000\000\000\000\000\148\000\148\000\148\000\
3997 \148\000\148\000\148\000\148\000\148\000\148\000\148\000\000\000\
3998 \000\000\000\000\000\000\105\000\000\000\104\000\148\000\148\000\
3999 \148\000\148\000\148\000\148\000\000\000\000\000\000\000\000\000\
4000 \000\000\000\000\000\000\099\000\099\000\099\000\099\000\099\000\
4001 \099\000\099\000\099\000\099\000\099\000\000\000\000\000\000\000\
4002 \000\000\000\000\000\000\000\000\000\000\000\000\148\000\148\000\
4003 \148\000\148\000\148\000\148\000\000\000\000\000\033\000\033\000\
4004 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
4005 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
4006 \033\000\033\000\033\000\033\000\033\000\000\000\033\000\033\000\
4007 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
4008 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
4009 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
4010 \033\000\033\000\033\000\033\000\033\000\000\000\033\000\033\000\
4011 \033\000\033\000\033\000\033\000\033\000\033\000\057\000\000\000\
4012 \057\000\000\000\000\000\000\000\000\000\057\000\000\000\000\000\
4013 \060\000\000\000\000\000\060\000\000\000\000\000\056\000\056\000\
4014 \056\000\056\000\056\000\056\000\056\000\056\000\056\000\056\000\
4015 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\060\000\
4016 \078\000\000\000\000\000\078\000\078\000\078\000\000\000\000\000\
4017 \000\000\079\000\078\000\000\000\078\000\078\000\078\000\000\000\
4018 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4019 \000\000\078\000\057\000\078\000\078\000\078\000\078\000\078\000\
4020 \057\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4021 \000\000\000\000\000\000\068\000\057\000\000\000\068\000\000\000\
4022 \057\000\000\000\057\000\000\000\000\000\000\000\055\000\000\000\
4023 \000\000\000\000\000\000\078\000\000\000\078\000\000\000\000\000\
4024 \000\000\000\000\068\000\069\000\000\000\000\000\069\000\069\000\
4025 \069\000\000\000\000\000\072\000\071\000\069\000\000\000\069\000\
4026 \069\000\069\000\068\000\255\255\000\000\068\000\000\000\000\000\
4027 \000\000\000\000\000\000\078\000\069\000\078\000\069\000\069\000\
4028 \069\000\069\000\069\000\000\000\000\000\000\000\000\000\000\000\
4029 \000\000\068\000\069\000\000\000\000\000\069\000\070\000\070\000\
4030 \000\000\000\000\072\000\071\000\069\000\000\000\069\000\077\000\
4031 \070\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
4032 \069\000\000\000\000\000\077\000\000\000\077\000\077\000\077\000\
4033 \069\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\
4034 \000\000\000\000\000\000\000\000\000\000\068\000\000\000\000\000\
4035 \068\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
4036 \069\000\000\000\000\000\000\000\000\000\069\000\000\000\070\000\
4037 \000\000\000\000\000\000\000\000\068\000\069\000\000\000\000\000\
4038 \069\000\076\000\076\000\000\000\000\000\072\000\071\000\069\000\
4039 \000\000\069\000\075\000\076\000\068\000\000\000\255\255\068\000\
4040 \000\000\000\000\000\000\000\000\000\000\077\000\075\000\069\000\
4041 \075\000\075\000\075\000\069\000\076\000\000\000\000\000\000\000\
4042 \000\000\000\000\000\000\068\000\069\000\000\000\000\000\069\000\
4043 \070\000\070\000\000\000\067\000\072\000\071\000\069\000\000\000\
4044 \069\000\070\000\070\000\000\000\000\000\000\000\000\000\000\000\
4045 \069\000\000\000\076\000\067\000\067\000\070\000\067\000\070\000\
4046 \070\000\070\000\069\000\070\000\067\000\067\000\000\000\000\000\
4047 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4048 \067\000\000\000\067\000\067\000\067\000\000\000\067\000\000\000\
4049 \075\000\000\000\069\000\000\000\000\000\000\000\067\000\069\000\
4050 \000\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\
4051 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4052 \000\000\067\000\000\000\068\000\067\000\000\000\068\000\000\000\
4053 \000\000\000\000\000\000\000\000\000\000\000\000\067\000\070\000\
4054 \000\000\069\000\000\000\000\000\000\000\000\000\000\000\000\000\
4055 \000\000\000\000\068\000\069\000\000\000\000\000\069\000\069\000\
4056 \069\000\067\000\067\000\073\000\071\000\069\000\000\000\069\000\
4057 \069\000\069\000\068\000\000\000\000\000\068\000\000\000\000\000\
4058 \000\000\000\000\000\000\000\000\069\000\000\000\069\000\069\000\
4059 \069\000\069\000\069\000\000\000\000\000\000\000\000\000\000\000\
4060 \000\000\068\000\069\000\000\000\000\000\069\000\070\000\070\000\
4061 \000\000\067\000\073\000\071\000\069\000\000\000\069\000\070\000\
4062 \070\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
4063 \069\000\000\000\000\000\070\000\000\000\070\000\070\000\070\000\
4064 \069\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\
4065 \000\000\000\000\000\000\000\000\000\000\068\000\000\000\000\000\
4066 \068\000\000\000\000\000\000\000\000\000\000\000\069\000\000\000\
4067 \069\000\000\000\000\000\000\000\067\000\069\000\000\000\070\000\
4068 \000\000\000\000\000\000\000\000\068\000\069\000\000\000\000\000\
4069 \069\000\069\000\069\000\000\000\000\000\000\000\071\000\069\000\
4070 \000\000\069\000\069\000\069\000\068\000\000\000\000\000\068\000\
4071 \000\000\000\000\000\000\000\000\067\000\070\000\069\000\069\000\
4072 \069\000\069\000\069\000\069\000\069\000\000\000\000\000\000\000\
4073 \000\000\000\000\000\000\068\000\069\000\000\000\000\000\069\000\
4074 \076\000\076\000\000\000\000\000\073\000\071\000\069\000\000\000\
4075 \069\000\075\000\076\000\000\000\000\000\000\000\000\000\000\000\
4076 \069\000\000\000\069\000\000\000\000\000\075\000\000\000\075\000\
4077 \075\000\075\000\069\000\076\000\000\000\000\000\000\000\000\000\
4078 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\068\000\
4079 \000\000\000\000\068\000\000\000\000\000\000\000\000\000\000\000\
4080 \069\000\000\000\069\000\000\000\000\000\000\000\000\000\069\000\
4081 \000\000\076\000\000\000\000\000\000\000\000\000\068\000\069\000\
4082 \000\000\000\000\069\000\076\000\076\000\000\000\067\000\073\000\
4083 \071\000\069\000\000\000\069\000\076\000\076\000\068\000\000\000\
4084 \000\000\068\000\000\000\000\000\000\000\000\000\000\000\075\000\
4085 \076\000\069\000\076\000\076\000\076\000\069\000\076\000\000\000\
4086 \000\000\000\000\000\000\000\000\000\000\068\000\069\000\000\000\
4087 \000\000\069\000\070\000\070\000\000\000\000\000\073\000\071\000\
4088 \069\000\000\000\069\000\077\000\070\000\000\000\000\000\000\000\
4089 \000\000\067\000\069\000\000\000\076\000\000\000\000\000\077\000\
4090 \000\000\077\000\077\000\077\000\069\000\070\000\000\000\000\000\
4091 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4092 \000\000\080\000\000\000\000\000\080\000\000\000\000\000\000\000\
4093 \000\000\067\000\076\000\000\000\069\000\000\000\000\000\000\000\
4094 \000\000\069\000\000\000\070\000\000\000\000\000\000\000\000\000\
4095 \080\000\078\000\000\000\000\000\078\000\078\000\078\000\000\000\
4096 \000\000\082\000\079\000\078\000\000\000\078\000\078\000\078\000\
4097 \080\000\000\000\000\000\080\000\000\000\000\000\000\000\000\000\
4098 \000\000\077\000\078\000\069\000\078\000\078\000\078\000\078\000\
4099 \078\000\000\000\000\000\000\000\000\000\000\000\000\000\080\000\
4100 \078\000\000\000\000\000\078\000\078\000\078\000\000\000\000\000\
4101 \000\000\079\000\078\000\000\000\078\000\078\000\078\000\000\000\
4102 \000\000\000\000\000\000\000\000\078\000\000\000\078\000\000\000\
4103 \000\000\078\000\000\000\078\000\078\000\078\000\078\000\078\000\
4104 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\096\000\
4105 \096\000\000\000\000\000\084\000\000\000\000\000\000\000\000\000\
4106 \084\000\096\000\000\000\000\000\078\000\000\000\078\000\000\000\
4107 \000\000\000\000\000\000\078\000\084\000\078\000\084\000\084\000\
4108 \084\000\000\000\096\000\000\000\000\000\000\000\000\000\000\000\
4109 \003\000\000\000\000\000\003\000\009\000\009\000\000\000\000\000\
4110 \005\000\003\000\003\000\000\000\003\000\006\000\009\000\000\000\
4111 \000\000\000\000\000\000\078\000\000\000\078\000\000\000\084\000\
4112 \096\000\085\000\000\000\006\000\006\000\006\000\003\000\009\000\
4113 \000\000\000\000\000\000\000\000\000\000\003\000\000\000\000\000\
4114 \003\000\009\000\009\000\000\000\000\000\005\000\003\000\003\000\
4115 \000\000\003\000\006\000\009\000\000\000\000\000\084\000\084\000\
4116 \000\000\000\000\000\000\003\000\084\000\009\000\085\000\000\000\
4117 \006\000\006\000\006\000\003\000\009\000\000\000\000\000\000\000\
4118 \000\000\000\000\003\000\000\000\000\000\003\000\009\000\009\000\
4119 \000\000\000\000\094\000\003\000\003\000\000\000\003\000\009\000\
4120 \009\000\000\000\000\000\085\000\005\000\003\000\000\000\000\000\
4121 \003\000\084\000\009\000\098\000\000\000\009\000\009\000\009\000\
4122 \003\000\009\000\000\000\000\000\000\000\000\000\000\000\090\000\
4123 \000\000\000\000\003\000\093\000\093\000\000\000\000\000\084\000\
4124 \090\000\090\000\000\000\090\000\091\000\093\000\000\000\000\000\
4125 \085\000\005\000\003\000\000\000\000\000\003\000\094\000\009\000\
4126 \092\000\000\000\006\000\091\000\089\000\090\000\093\000\000\000\
4127 \000\000\000\000\000\000\000\000\003\000\000\000\000\000\003\000\
4128 \009\000\009\000\000\000\000\000\084\000\003\000\003\000\000\000\
4129 \003\000\006\000\009\000\000\000\000\000\098\000\094\000\003\000\
4130 \000\000\000\000\090\000\084\000\093\000\085\000\000\000\006\000\
4131 \006\000\097\000\003\000\009\000\000\000\000\000\000\000\000\000\
4132 \000\000\090\000\000\000\000\000\003\000\090\000\090\000\000\000\
4133 \000\000\000\000\090\000\090\000\000\000\090\000\090\000\090\000\
4134 \000\000\000\000\092\000\084\000\090\000\000\000\000\000\003\000\
4135 \084\000\009\000\090\000\000\000\003\000\090\000\003\000\090\000\
4136 \090\000\000\000\000\000\000\000\090\000\000\000\000\000\003\000\
4137 \093\000\093\000\000\000\000\000\084\000\090\000\090\000\000\000\
4138 \090\000\091\000\093\000\000\000\000\000\000\000\000\000\085\000\
4139 \084\000\003\000\000\000\000\000\090\000\092\000\090\000\006\000\
4140 \091\000\006\000\090\000\093\000\000\000\000\000\000\000\000\000\
4141 \000\000\090\000\000\000\000\000\003\000\093\000\093\000\000\000\
4142 \000\000\005\000\090\000\090\000\000\000\090\000\091\000\093\000\
4143 \000\000\000\000\000\000\000\000\090\000\000\000\090\000\090\000\
4144 \084\000\093\000\092\000\000\000\006\000\091\000\006\000\090\000\
4145 \093\000\000\000\000\000\000\000\000\000\000\000\090\000\000\000\
4146 \000\000\003\000\093\000\093\000\000\000\000\000\094\000\090\000\
4147 \090\000\000\000\090\000\093\000\093\000\000\000\000\000\092\000\
4148 \084\000\090\000\000\000\000\000\090\000\084\000\093\000\095\000\
4149 \000\000\009\000\093\000\009\000\090\000\093\000\000\000\000\000\
4150 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\096\000\
4151 \096\000\000\000\000\000\094\000\000\000\000\000\000\000\000\000\
4152 \096\000\096\000\000\000\000\000\092\000\005\000\090\000\000\000\
4153 \000\000\090\000\094\000\093\000\096\000\000\000\096\000\096\000\
4154 \096\000\000\000\096\000\000\000\000\000\000\000\000\000\000\000\
4155 \090\000\000\000\000\000\003\000\093\000\093\000\000\000\000\000\
4156 \094\000\090\000\090\000\000\000\090\000\093\000\093\000\000\000\
4157 \000\000\095\000\094\000\090\000\000\000\000\000\000\000\094\000\
4158 \096\000\095\000\000\000\009\000\093\000\009\000\090\000\093\000\
4159 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4160 \000\000\096\000\096\000\000\000\000\000\094\000\000\000\000\000\
4161 \000\000\000\000\096\000\096\000\000\000\000\000\096\000\094\000\
4162 \000\000\000\000\000\000\090\000\094\000\093\000\096\000\000\000\
4163 \096\000\096\000\096\000\000\000\096\000\000\000\000\000\000\000\
4164 \000\000\000\000\003\000\000\000\000\000\003\000\009\000\009\000\
4165 \000\000\000\000\084\000\003\000\003\000\000\000\003\000\006\000\
4166 \009\000\000\000\000\000\095\000\094\000\090\000\000\000\000\000\
4167 \000\000\094\000\096\000\085\000\000\000\006\000\006\000\006\000\
4168 \003\000\009\000\000\000\000\000\000\000\000\000\000\000\003\000\
4169 \000\000\000\000\003\000\009\000\009\000\000\000\000\000\094\000\
4170 \003\000\003\000\000\000\003\000\009\000\009\000\000\000\000\000\
4171 \096\000\094\000\000\000\000\000\000\000\003\000\084\000\009\000\
4172 \098\000\000\000\009\000\009\000\009\000\003\000\009\000\000\000\
4173 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4174 \111\000\111\000\000\000\000\000\084\000\000\000\000\000\111\000\
4175 \111\000\109\000\111\000\005\000\000\000\085\000\084\000\003\000\
4176 \109\000\111\000\003\000\094\000\009\000\110\000\000\000\109\000\
4177 \109\000\109\000\000\000\111\000\110\000\000\000\109\000\109\000\
4178 \109\000\000\000\111\000\000\000\000\000\000\000\000\000\000\000\
4179 \000\000\000\000\000\000\000\000\111\000\111\000\000\000\000\000\
4180 \094\000\000\000\098\000\094\000\003\000\111\000\111\000\000\000\
4181 \084\000\111\000\000\000\000\000\000\000\000\000\000\000\084\000\
4182 \111\000\113\000\000\000\111\000\111\000\111\000\000\000\111\000\
4183 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4184 \000\000\111\000\111\000\000\000\000\000\084\000\000\000\110\000\
4185 \084\000\000\000\109\000\111\000\000\000\000\000\110\000\005\000\
4186 \000\000\000\000\000\000\000\000\094\000\111\000\110\000\000\000\
4187 \109\000\109\000\109\000\000\000\111\000\000\000\000\000\000\000\
4188 \000\000\000\000\000\000\000\000\000\000\000\000\111\000\111\000\
4189 \000\000\000\000\094\000\000\000\000\000\111\000\111\000\111\000\
4190 \111\000\005\000\000\000\113\000\094\000\000\000\109\000\111\000\
4191 \000\000\084\000\111\000\113\000\000\000\111\000\111\000\111\000\
4192 \000\000\111\000\110\000\000\000\109\000\109\000\109\000\000\000\
4193 \111\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4194 \000\000\000\000\117\000\117\000\000\000\000\000\000\000\000\000\
4195 \110\000\084\000\000\000\115\000\117\000\000\000\094\000\111\000\
4196 \000\000\000\000\000\000\000\000\000\000\084\000\111\000\115\000\
4197 \000\000\116\000\115\000\115\000\000\000\117\000\000\000\000\000\
4198 \000\000\117\000\117\000\000\000\000\000\000\000\000\000\000\000\
4199 \000\000\000\000\115\000\117\000\000\000\113\000\094\000\000\000\
4200 \000\000\000\000\000\000\000\000\110\000\005\000\115\000\000\000\
4201 \116\000\115\000\115\000\117\000\117\000\117\000\117\000\000\000\
4202 \067\000\000\000\000\000\000\000\000\000\000\000\117\000\117\000\
4203 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4204 \000\000\000\000\117\000\000\000\117\000\117\000\117\000\000\000\
4205 \117\000\115\000\117\000\000\000\000\000\000\000\000\000\000\000\
4206 \000\000\000\000\119\000\119\000\000\000\000\000\000\000\119\000\
4207 \119\000\000\000\067\000\118\000\119\000\000\000\000\000\000\000\
4208 \119\000\119\000\000\000\067\000\000\000\000\000\117\000\118\000\
4209 \115\000\118\000\118\000\118\000\119\000\119\000\119\000\119\000\
4210 \119\000\000\000\119\000\000\000\000\000\000\000\000\000\000\000\
4211 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4212 \000\000\000\000\000\000\067\000\117\000\000\000\000\000\000\000\
4213 \000\000\000\000\000\000\119\000\000\000\067\000\000\000\000\000\
4214 \119\000\000\000\000\000\000\000\000\000\000\000\003\000\000\000\
4215 \000\000\003\000\121\000\121\000\000\000\000\000\005\000\003\000\
4216 \003\000\000\000\003\000\007\000\121\000\000\000\000\000\000\000\
4217 \000\000\118\000\000\000\000\000\000\000\067\000\119\000\120\000\
4218 \000\000\007\000\007\000\007\000\003\000\121\000\000\000\000\000\
4219 \000\000\000\000\000\000\003\000\000\000\000\000\003\000\121\000\
4220 \121\000\000\000\000\000\094\000\003\000\003\000\000\000\003\000\
4221 \121\000\121\000\000\000\000\000\000\000\000\000\000\000\000\000\
4222 \000\000\003\000\005\000\121\000\122\000\000\000\121\000\121\000\
4223 \121\000\003\000\121\000\000\000\000\000\000\000\000\000\000\000\
4224 \003\000\000\000\000\000\003\000\121\000\121\000\000\000\000\000\
4225 \094\000\003\000\003\000\000\000\003\000\121\000\121\000\000\000\
4226 \000\000\120\000\005\000\003\000\000\000\000\000\003\000\094\000\
4227 \121\000\122\000\000\000\121\000\121\000\121\000\003\000\121\000\
4228 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\053\000\
4229 \000\000\000\000\124\000\000\000\000\000\000\000\000\000\000\000\
4230 \000\000\000\000\000\000\000\000\000\000\000\000\122\000\094\000\
4231 \003\000\000\000\000\000\003\000\094\000\121\000\000\000\126\000\
4232 \000\000\000\000\000\000\000\000\125\000\130\000\000\000\129\000\
4233 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4234 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4235 \000\000\128\000\000\000\122\000\094\000\003\000\127\000\127\000\
4236 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4237 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4238 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4239 \000\000\000\000\000\000\000\000\127\000\000\000\127\000\127\000\
4240 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4241 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4242 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4243 \149\000\149\000\149\000\149\000\149\000\149\000\149\000\149\000\
4244 \149\000\149\000\000\000\000\000\000\000\000\000\000\000\000\000\
4245 \000\000\149\000\149\000\149\000\149\000\149\000\149\000\000\000\
4246 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4247 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4248 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4249 \000\000\149\000\149\000\149\000\149\000\149\000\149\000\000\000\
4250 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4251 \000\000\000\000\000\000\000\000\000\000\127\000\127\000\127\000\
4252 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4253 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4254 \127\000\127\000\127\000\127\000\000\000\127\000\127\000\127\000\
4255 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4256 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4257 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4258 \127\000\127\000\127\000\127\000\000\000\127\000\127\000\127\000\
4259 \127\000\127\000\127\000\127\000\127\000\052\000\127\000\000\000\
4260 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\000\
4261 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4262 \127\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4263 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4264 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4265 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4266 \127\000\127\000\000\000\000\000\000\000\000\000\127\000\000\000\
4267 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4268 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4269 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4270 \127\000\127\000\000\000\000\000\000\000\000\000\000\000\000\000\
4271 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4272 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4273 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4274 \135\000\135\000\000\000\000\000\000\000\000\000\135\000\000\000\
4275 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4276 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4277 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4278 \135\000\135\000\000\000\000\000\000\000\000\000\000\000\127\000\
4279 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4280 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4281 \127\000\127\000\127\000\127\000\127\000\127\000\000\000\127\000\
4282 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4283 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4284 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
4285 \127\000\127\000\127\000\127\000\127\000\127\000\000\000\127\000\
4286 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\135\000\
4287 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4288 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4289 \135\000\135\000\135\000\135\000\135\000\135\000\000\000\135\000\
4290 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4291 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4292 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4293 \135\000\135\000\135\000\135\000\135\000\135\000\000\000\135\000\
4294 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\134\000\
4295 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4296 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4297 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4298 \134\000\000\000\000\000\000\000\000\000\134\000\000\000\134\000\
4299 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4300 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4301 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4302 \134\000\159\000\159\000\159\000\159\000\159\000\159\000\159\000\
4303 \159\000\159\000\159\000\000\000\000\000\000\000\000\000\000\000\
4304 \000\000\000\000\159\000\159\000\159\000\159\000\159\000\159\000\
4305 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4306 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4307 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4308 \000\000\000\000\159\000\159\000\159\000\159\000\159\000\159\000\
4309 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4310 \000\000\000\000\000\000\000\000\000\000\000\000\134\000\134\000\
4311 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4312 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4313 \134\000\134\000\134\000\134\000\134\000\000\000\134\000\134\000\
4314 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4315 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4316 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4317 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4318 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4319 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4320 \000\000\000\000\032\000\000\000\000\000\000\000\132\000\134\000\
4321 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4322 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4323 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4324 \134\000\000\000\000\000\000\000\000\000\134\000\000\000\134\000\
4325 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4326 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4327 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4328 \134\000\126\000\126\000\126\000\126\000\126\000\126\000\126\000\
4329 \126\000\126\000\126\000\000\000\000\000\000\000\000\000\000\000\
4330 \000\000\000\000\126\000\126\000\126\000\126\000\126\000\126\000\
4331 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4332 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4333 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4334 \000\000\000\000\126\000\126\000\126\000\126\000\126\000\126\000\
4335 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4336 \000\000\000\000\000\000\000\000\000\000\000\000\134\000\134\000\
4337 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4338 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4339 \134\000\134\000\134\000\134\000\134\000\000\000\134\000\134\000\
4340 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4341 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4342 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
4343 \134\000\134\000\134\000\134\000\134\000\135\000\134\000\134\000\
4344 \134\000\134\000\134\000\134\000\134\000\134\000\135\000\135\000\
4345 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4346 \000\000\000\000\032\000\000\000\000\000\000\000\000\000\135\000\
4347 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4348 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4349 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4350 \135\000\000\000\000\000\000\000\000\000\135\000\000\000\135\000\
4351 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4352 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4353 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4354 \135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4355 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4356 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4357 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4358 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4359 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4360 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4361 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4362 \000\000\000\000\000\000\000\000\000\000\000\000\135\000\135\000\
4363 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4364 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4365 \135\000\135\000\135\000\135\000\135\000\000\000\135\000\135\000\
4366 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4367 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4368 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
4369 \135\000\135\000\135\000\135\000\135\000\000\000\135\000\135\000\
4370 \135\000\135\000\135\000\135\000\135\000\135\000\145\000\000\000\
4371 \145\000\000\000\000\000\157\000\000\000\145\000\156\000\000\000\
4372 \000\000\000\000\000\000\000\000\000\000\000\000\144\000\144\000\
4373 \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
4374 \000\000\032\000\000\000\032\000\000\000\000\000\000\000\000\000\
4375 \032\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4376 \000\000\155\000\155\000\155\000\155\000\155\000\155\000\155\000\
4377 \155\000\155\000\155\000\000\000\000\000\000\000\000\000\000\000\
4378 \000\000\000\000\145\000\000\000\000\000\000\000\000\000\000\000\
4379 \145\000\160\000\000\000\000\000\160\000\160\000\160\000\000\000\
4380 \000\000\000\000\160\000\160\000\145\000\160\000\160\000\160\000\
4381 \145\000\000\000\145\000\000\000\000\000\032\000\143\000\000\000\
4382 \000\000\000\000\160\000\032\000\160\000\160\000\160\000\160\000\
4383 \160\000\000\000\000\000\000\000\000\000\000\000\000\000\032\000\
4384 \000\000\000\000\000\000\032\000\000\000\032\000\000\000\000\000\
4385 \000\000\154\000\000\000\000\000\000\000\000\000\000\000\000\000\
4386 \000\000\000\000\000\000\000\000\160\000\000\000\160\000\000\000\
4387 \000\000\000\000\000\000\000\000\162\000\000\000\000\000\162\000\
4388 \162\000\162\000\000\000\000\000\000\000\162\000\162\000\000\000\
4389 \162\000\162\000\162\000\000\000\000\000\000\000\000\000\000\000\
4390 \000\000\000\000\000\000\000\000\160\000\162\000\160\000\162\000\
4391 \162\000\162\000\162\000\162\000\163\000\163\000\163\000\163\000\
4392 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4393 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4394 \163\000\163\000\163\000\163\000\163\000\163\000\000\000\162\000\
4395 \000\000\162\000\163\000\000\000\163\000\163\000\163\000\163\000\
4396 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4397 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4398 \163\000\163\000\163\000\163\000\163\000\163\000\000\000\162\000\
4399 \000\000\162\000\000\000\000\000\000\000\000\000\000\000\000\000\
4400 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4401 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4402 \000\000\255\255\000\000\000\000\000\000\000\000\000\000\000\000\
4403 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4404 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4405 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4406 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4407 \000\000\000\000\000\000\163\000\163\000\163\000\163\000\163\000\
4408 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4409 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4410 \163\000\163\000\000\000\163\000\163\000\163\000\163\000\163\000\
4411 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4412 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4413 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4414 \163\000\163\000\000\000\163\000\163\000\163\000\163\000\163\000\
4415 \163\000\163\000\163\000\162\000\000\000\000\000\162\000\162\000\
4416 \162\000\000\000\000\000\000\000\162\000\162\000\000\000\162\000\
4417 \162\000\162\000\000\000\000\000\000\000\000\000\000\000\000\000\
4418 \000\000\000\000\000\000\000\000\162\000\000\000\162\000\162\000\
4419 \162\000\162\000\162\000\000\000\000\000\000\000\000\000\163\000\
4420 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4421 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4422 \163\000\163\000\000\000\000\000\030\000\000\000\162\000\000\000\
4423 \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4424 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4425 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4426 \163\000\163\000\163\000\000\000\000\000\000\000\162\000\163\000\
4427 \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4428 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4429 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4430 \163\000\163\000\163\000\000\000\000\000\000\000\000\000\000\000\
4431 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4432 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4433 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4434 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4435 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4436 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4437 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4438 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4439 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4440 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4441 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\000\000\
4442 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4443 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4444 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4445 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\000\000\
4446 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
4447 \165\000\000\000\000\000\165\000\165\000\165\000\000\000\000\000\
4448 \000\000\165\000\165\000\000\000\165\000\165\000\165\000\000\000\
4449 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4450 \000\000\165\000\000\000\165\000\165\000\165\000\165\000\165\000\
4451 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4452 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4453 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4454 \166\000\166\000\000\000\165\000\000\000\165\000\166\000\000\000\
4455 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4456 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4457 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4458 \166\000\166\000\000\000\165\000\000\000\165\000\000\000\000\000\
4459 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4460 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4461 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4462 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4463 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4464 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4465 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4466 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\166\000\
4467 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4468 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4469 \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
4470 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4471 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4472 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4473 \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
4474 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\165\000\
4475 \000\000\000\000\165\000\165\000\165\000\000\000\000\000\000\000\
4476 \165\000\165\000\000\000\165\000\165\000\165\000\000\000\000\000\
4477 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4478 \165\000\000\000\165\000\165\000\165\000\165\000\165\000\000\000\
4479 \000\000\000\000\000\000\000\000\000\000\000\000\166\000\000\000\
4480 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\166\000\
4481 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4482 \166\000\000\000\165\000\030\000\165\000\000\000\000\000\167\000\
4483 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4484 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4485 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4486 \166\000\166\000\165\000\000\000\165\000\000\000\166\000\000\000\
4487 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4488 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4489 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4490 \166\000\166\000\000\000\000\000\000\000\000\000\000\000\000\000\
4491 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4492 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4493 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4494 \168\000\168\000\000\000\000\000\000\000\000\000\168\000\000\000\
4495 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4496 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4497 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4498 \168\000\168\000\000\000\000\000\000\000\000\000\000\000\166\000\
4499 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4500 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4501 \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
4502 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4503 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4504 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
4505 \166\000\166\000\166\000\166\000\166\000\166\000\000\000\166\000\
4506 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\168\000\
4507 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4508 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4509 \168\000\168\000\168\000\168\000\168\000\168\000\000\000\168\000\
4510 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4511 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4512 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4513 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4514 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4515 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4516 \168\000\000\000\000\000\169\000\000\000\000\000\000\000\000\000\
4517 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4518 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4519 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4520 \168\000\168\000\000\000\000\000\000\000\000\000\168\000\000\000\
4521 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4522 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4523 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4524 \168\000\168\000\000\000\000\000\000\000\000\000\000\000\000\000\
4525 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4526 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4527 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4528 \177\000\177\000\000\000\000\000\000\000\000\000\177\000\000\000\
4529 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4530 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4531 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4532 \177\000\177\000\000\000\000\000\000\000\000\000\000\000\168\000\
4533 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4534 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4535 \168\000\168\000\168\000\168\000\168\000\168\000\000\000\168\000\
4536 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4537 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4538 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
4539 \168\000\168\000\168\000\168\000\168\000\168\000\000\000\168\000\
4540 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\177\000\
4541 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4542 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4543 \177\000\177\000\177\000\177\000\177\000\177\000\000\000\177\000\
4544 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4545 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4546 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4547 \177\000\177\000\177\000\177\000\177\000\177\000\000\000\177\000\
4548 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\176\000\
4549 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4550 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4551 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4552 \176\000\000\000\000\000\000\000\000\000\176\000\000\000\176\000\
4553 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4554 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4555 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4556 \176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4557 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4558 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4559 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4560 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4561 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4562 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4563 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4564 \000\000\000\000\000\000\000\000\000\000\000\000\176\000\176\000\
4565 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4566 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4567 \176\000\176\000\176\000\176\000\176\000\000\000\176\000\176\000\
4568 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4569 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4570 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4571 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4572 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4573 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4574 \000\000\000\000\030\000\000\000\000\000\000\000\174\000\176\000\
4575 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4576 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4577 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4578 \176\000\000\000\000\000\000\000\000\000\176\000\000\000\176\000\
4579 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4580 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4581 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4582 \176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4583 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4584 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4585 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4586 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4587 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4588 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4589 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4590 \000\000\000\000\000\000\000\000\000\000\000\000\176\000\176\000\
4591 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4592 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4593 \176\000\176\000\176\000\176\000\176\000\000\000\176\000\176\000\
4594 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4595 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4596 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
4597 \176\000\176\000\176\000\176\000\176\000\177\000\176\000\176\000\
4598 \176\000\176\000\176\000\176\000\176\000\176\000\177\000\177\000\
4599 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4600 \000\000\000\000\030\000\000\000\000\000\000\000\000\000\177\000\
4601 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4602 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4603 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4604 \177\000\000\000\000\000\000\000\000\000\177\000\000\000\177\000\
4605 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4606 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4607 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4608 \177\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4609 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4610 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4611 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4612 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4613 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4614 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4615 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4616 \000\000\000\000\000\000\000\000\000\000\000\000\177\000\177\000\
4617 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4618 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4619 \177\000\177\000\177\000\177\000\177\000\000\000\177\000\177\000\
4620 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4621 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4622 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
4623 \177\000\177\000\177\000\177\000\177\000\000\000\177\000\177\000\
4624 \177\000\177\000\177\000\177\000\177\000\177\000\030\000\000\000\
4625 \000\000\180\000\000\000\000\000\000\000\000\000\000\000\000\000\
4626 \179\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
4627 \180\000\180\000\180\000\180\000\131\000\000\000\000\000\000\000\
4628 \000\000\000\000\000\000\180\000\180\000\180\000\180\000\180\000\
4629 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4630 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4631 \180\000\180\000\180\000\180\000\180\000\000\000\000\000\000\000\
4632 \000\000\180\000\181\000\180\000\180\000\180\000\180\000\180\000\
4633 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4634 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4635 \180\000\180\000\180\000\180\000\180\000\000\000\000\000\000\000\
4636 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4637 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4638 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4639 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4640 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4641 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4642 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4643 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4644 \000\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
4645 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4646 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4647 \180\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
4648 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4649 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4650 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
4651 \180\000\000\000\180\000\180\000\180\000\180\000\180\000\180\000\
4652 \180\000\180\000\255\255\183\000\000\000\000\000\000\000\000\000\
4653 \000\000\000\000\000\000\000\000\183\000\183\000\183\000\183\000\
4654 \183\000\183\000\183\000\183\000\183\000\183\000\131\000\000\000\
4655 \000\000\000\000\000\000\000\000\000\000\183\000\183\000\183\000\
4656 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4657 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4658 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\000\000\
4659 \000\000\000\000\000\000\183\000\000\000\183\000\183\000\183\000\
4660 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4661 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4662 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\000\000\
4663 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4664 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4665 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4666 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4667 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4668 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4669 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4670 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4671 \000\000\000\000\000\000\000\000\183\000\183\000\183\000\183\000\
4672 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4673 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4674 \183\000\183\000\183\000\000\000\183\000\183\000\183\000\183\000\
4675 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4676 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4677 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4678 \183\000\183\000\183\000\000\000\183\000\183\000\183\000\183\000\
4679 \183\000\183\000\183\000\183\000\183\000\000\000\000\000\000\000\
4680 \000\000\000\000\000\000\182\000\000\000\183\000\183\000\183\000\
4681 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\131\000\
4682 \000\000\000\000\000\000\000\000\000\000\000\000\183\000\183\000\
4683 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4684 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4685 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4686 \000\000\000\000\000\000\000\000\183\000\000\000\183\000\183\000\
4687 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4688 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4689 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4690 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4691 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4692 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4693 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4694 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4695 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4696 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4697 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4698 \000\000\000\000\000\000\000\000\000\000\183\000\183\000\183\000\
4699 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4700 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4701 \183\000\183\000\183\000\183\000\000\000\183\000\183\000\183\000\
4702 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4703 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4704 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4705 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4706 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4707 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\131\000\
4708 \000\000\000\000\000\000\000\000\000\000\000\000\183\000\183\000\
4709 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4710 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4711 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4712 \000\000\000\000\000\000\000\000\183\000\000\000\183\000\183\000\
4713 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4714 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4715 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4716 \000\000\000\000\000\000\000\000\000\000\000\000\190\000\190\000\
4717 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4718 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4719 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4720 \000\000\000\000\000\000\000\000\190\000\000\000\190\000\190\000\
4721 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4722 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4723 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4724 \000\000\000\000\000\000\000\000\000\000\183\000\183\000\183\000\
4725 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4726 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4727 \183\000\183\000\183\000\183\000\000\000\183\000\183\000\183\000\
4728 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4729 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4730 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
4731 \183\000\183\000\183\000\183\000\000\000\183\000\183\000\183\000\
4732 \183\000\183\000\183\000\183\000\183\000\190\000\190\000\190\000\
4733 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4734 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4735 \190\000\190\000\190\000\190\000\000\000\190\000\190\000\190\000\
4736 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4737 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4738 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4739 \190\000\190\000\190\000\190\000\000\000\190\000\190\000\190\000\
4740 \190\000\190\000\190\000\190\000\190\000\189\000\189\000\189\000\
4741 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4742 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4743 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
4744 \000\000\000\000\000\000\189\000\000\000\189\000\189\000\189\000\
4745 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4746 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4747 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
4748 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4749 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4750 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4751 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4752 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4753 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4754 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4755 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4756 \000\000\000\000\000\000\000\000\189\000\189\000\189\000\189\000\
4757 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4758 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4759 \189\000\189\000\189\000\000\000\189\000\189\000\189\000\189\000\
4760 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4761 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4762 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4763 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4764 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4765 \189\000\189\000\189\000\189\000\189\000\189\000\000\000\000\000\
4766 \034\000\000\000\000\000\000\000\187\000\189\000\189\000\189\000\
4767 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4768 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4769 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
4770 \000\000\000\000\000\000\189\000\000\000\189\000\189\000\189\000\
4771 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4772 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4773 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\000\000\
4774 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4775 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4776 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4777 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4778 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4779 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4780 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4781 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4782 \000\000\000\000\000\000\000\000\189\000\189\000\189\000\189\000\
4783 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4784 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4785 \189\000\189\000\189\000\000\000\189\000\189\000\189\000\189\000\
4786 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4787 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4788 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
4789 \189\000\189\000\189\000\190\000\189\000\189\000\189\000\189\000\
4790 \189\000\189\000\189\000\189\000\190\000\190\000\190\000\190\000\
4791 \190\000\190\000\190\000\190\000\190\000\190\000\000\000\000\000\
4792 \034\000\000\000\000\000\000\000\000\000\190\000\190\000\190\000\
4793 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4794 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4795 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\000\000\
4796 \000\000\000\000\000\000\190\000\000\000\190\000\190\000\190\000\
4797 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4798 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4799 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\000\000\
4800 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4801 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4802 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4803 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4804 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4805 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4806 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4807 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4808 \000\000\000\000\000\000\000\000\190\000\190\000\190\000\190\000\
4809 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4810 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4811 \190\000\190\000\190\000\000\000\190\000\190\000\190\000\190\000\
4812 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4813 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4814 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
4815 \190\000\190\000\190\000\000\000\190\000\190\000\190\000\190\000\
4816 \190\000\190\000\190\000\190\000\000\000";
4817 Lexing.lex_check =
4818 "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4819 \255\255\000\000\000\000\029\000\000\000\000\000\101\000\107\000\
4820 \124\000\151\000\103\000\106\000\171\000\103\000\106\000\186\000\
4821 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4822 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4823 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4824 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4825 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4826 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4827 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4828 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4829 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4830 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4831 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4832 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4833 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\
4834 \010\000\010\000\049\000\016\000\051\000\028\000\040\000\040\000\
4835 \028\000\010\000\010\000\041\000\041\000\041\000\041\000\041\000\
4836 \041\000\041\000\041\000\057\000\065\000\010\000\129\000\010\000\
4837 \010\000\010\000\016\000\010\000\028\000\047\000\047\000\047\000\
4838 \047\000\047\000\047\000\047\000\047\000\047\000\047\000\130\000\
4839 \137\000\139\000\016\000\016\000\016\000\016\000\016\000\016\000\
4840 \016\000\016\000\016\000\016\000\140\000\128\000\145\000\128\000\
4841 \147\000\010\000\020\000\128\000\149\000\020\000\172\000\255\255\
4842 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4843 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4844 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000\
4845 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4846 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4847 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4848 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\179\000\
4849 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
4850 \000\000\003\000\255\255\179\000\003\000\003\000\003\000\050\000\
4851 \103\000\106\000\003\000\003\000\020\000\003\000\003\000\003\000\
4852 \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
4853 \039\000\039\000\003\000\138\000\003\000\003\000\003\000\003\000\
4854 \003\000\255\255\005\000\005\000\050\000\039\000\005\000\255\255\
4855 \038\000\255\255\038\000\005\000\005\000\038\000\038\000\038\000\
4856 \038\000\038\000\038\000\038\000\038\000\038\000\038\000\005\000\
4857 \138\000\005\000\005\000\005\000\003\000\005\000\003\000\039\000\
4858 \104\000\255\255\157\000\104\000\006\000\039\000\255\255\006\000\
4859 \006\000\006\000\182\000\255\255\006\000\006\000\006\000\255\255\
4860 \006\000\006\000\006\000\255\255\068\000\255\255\182\000\068\000\
4861 \104\000\157\000\005\000\005\000\003\000\006\000\003\000\006\000\
4862 \006\000\006\000\006\000\006\000\156\000\156\000\255\255\255\255\
4863 \255\255\007\000\255\255\068\000\007\000\007\000\007\000\255\255\
4864 \255\255\007\000\007\000\007\000\068\000\007\000\007\000\007\000\
4865 \255\255\005\000\005\000\156\000\255\255\255\255\255\255\006\000\
4866 \006\000\006\000\007\000\255\255\007\000\007\000\007\000\007\000\
4867 \007\000\173\000\185\000\173\000\185\000\255\255\008\000\173\000\
4868 \185\000\008\000\008\000\008\000\255\255\255\255\008\000\008\000\
4869 \008\000\255\255\008\000\008\000\008\000\255\255\255\255\006\000\
4870 \006\000\006\000\255\255\255\255\007\000\007\000\007\000\008\000\
4871 \255\255\008\000\008\000\008\000\008\000\008\000\170\000\255\255\
4872 \020\000\170\000\255\255\009\000\255\255\255\255\009\000\009\000\
4873 \009\000\255\255\255\255\009\000\009\000\009\000\255\255\009\000\
4874 \009\000\009\000\255\255\255\255\007\000\007\000\007\000\255\255\
4875 \255\255\008\000\008\000\008\000\009\000\255\255\009\000\009\000\
4876 \009\000\009\000\009\000\255\255\255\255\255\255\255\255\255\255\
4877 \184\000\255\255\255\255\184\000\011\000\011\000\255\255\255\255\
4878 \170\000\255\255\170\000\013\000\013\000\011\000\011\000\013\000\
4879 \255\255\008\000\008\000\008\000\013\000\013\000\009\000\009\000\
4880 \009\000\011\000\184\000\011\000\011\000\011\000\255\255\011\000\
4881 \013\000\255\255\013\000\013\000\013\000\255\255\013\000\014\000\
4882 \014\000\255\255\080\000\014\000\255\255\080\000\255\255\255\255\
4883 \014\000\014\000\184\000\255\255\255\255\255\255\009\000\009\000\
4884 \009\000\255\255\255\255\255\255\014\000\011\000\014\000\014\000\
4885 \014\000\080\000\014\000\013\000\013\000\045\000\045\000\255\255\
4886 \255\255\255\255\080\000\017\000\255\255\255\255\017\000\017\000\
4887 \017\000\255\255\255\255\017\000\017\000\017\000\255\255\017\000\
4888 \017\000\017\000\255\255\011\000\255\255\255\255\104\000\014\000\
4889 \014\000\045\000\013\000\013\000\017\000\255\255\017\000\017\000\
4890 \017\000\017\000\017\000\255\255\255\255\255\255\255\255\255\255\
4891 \255\255\255\255\255\255\255\255\045\000\044\000\044\000\044\000\
4892 \044\000\044\000\044\000\044\000\044\000\255\255\014\000\014\000\
4893 \255\255\045\000\255\255\045\000\255\255\255\255\017\000\017\000\
4894 \017\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4895 \018\000\044\000\255\255\018\000\018\000\018\000\255\255\255\255\
4896 \018\000\018\000\018\000\255\255\018\000\018\000\018\000\019\000\
4897 \255\255\255\255\019\000\255\255\044\000\255\255\017\000\017\000\
4898 \017\000\018\000\255\255\018\000\018\000\018\000\018\000\018\000\
4899 \255\255\044\000\255\255\044\000\255\255\255\255\019\000\019\000\
4900 \255\255\255\255\019\000\019\000\019\000\255\255\255\255\255\255\
4901 \019\000\019\000\255\255\019\000\019\000\019\000\125\000\255\255\
4902 \255\255\125\000\255\255\018\000\170\000\018\000\255\255\255\255\
4903 \019\000\255\255\019\000\019\000\019\000\019\000\019\000\022\000\
4904 \255\255\022\000\022\000\022\000\022\000\022\000\022\000\022\000\
4905 \022\000\022\000\022\000\125\000\255\255\255\255\255\255\255\255\
4906 \255\255\255\255\255\255\018\000\255\255\018\000\022\000\255\255\
4907 \255\255\255\255\019\000\255\255\019\000\022\000\184\000\255\255\
4908 \023\000\255\255\023\000\023\000\023\000\023\000\023\000\023\000\
4909 \023\000\023\000\023\000\023\000\255\255\255\255\255\255\255\255\
4910 \022\000\255\255\255\255\255\255\023\000\255\255\022\000\023\000\
4911 \255\255\255\255\019\000\255\255\019\000\022\000\023\000\022\000\
4912 \125\000\023\000\255\255\255\255\255\255\255\255\255\255\255\255\
4913 \255\255\255\255\023\000\255\255\255\255\255\255\105\000\105\000\
4914 \255\255\023\000\105\000\255\255\023\000\255\255\255\255\023\000\
4915 \255\255\255\255\255\255\255\255\255\255\255\255\023\000\255\255\
4916 \023\000\023\000\024\000\255\255\255\255\105\000\255\255\105\000\
4917 \255\255\255\255\023\000\024\000\024\000\024\000\024\000\024\000\
4918 \024\000\024\000\024\000\024\000\024\000\255\255\255\255\255\255\
4919 \255\255\255\255\255\255\255\255\024\000\024\000\024\000\024\000\
4920 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4921 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4922 \024\000\024\000\024\000\024\000\024\000\024\000\255\255\255\255\
4923 \255\255\255\255\024\000\255\255\024\000\024\000\024\000\024\000\
4924 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4925 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4926 \024\000\024\000\024\000\024\000\024\000\024\000\042\000\042\000\
4927 \042\000\042\000\042\000\042\000\042\000\042\000\042\000\042\000\
4928 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\042\000\
4929 \042\000\042\000\042\000\042\000\042\000\056\000\056\000\056\000\
4930 \056\000\056\000\056\000\056\000\056\000\056\000\056\000\058\000\
4931 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
4932 \058\000\255\255\255\255\255\255\125\000\255\255\255\255\042\000\
4933 \042\000\042\000\042\000\042\000\042\000\144\000\144\000\144\000\
4934 \144\000\144\000\144\000\144\000\144\000\144\000\144\000\255\255\
4935 \255\255\255\255\255\255\024\000\024\000\024\000\024\000\024\000\
4936 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4937 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4938 \024\000\024\000\255\255\024\000\024\000\024\000\024\000\024\000\
4939 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4940 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4941 \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
4942 \024\000\024\000\025\000\024\000\024\000\024\000\024\000\024\000\
4943 \024\000\024\000\024\000\025\000\025\000\025\000\025\000\025\000\
4944 \025\000\025\000\025\000\025\000\025\000\105\000\255\255\255\255\
4945 \255\255\255\255\255\255\255\255\025\000\025\000\025\000\025\000\
4946 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4947 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4948 \025\000\025\000\025\000\025\000\025\000\025\000\255\255\255\255\
4949 \255\255\255\255\025\000\255\255\025\000\025\000\025\000\025\000\
4950 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4951 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4952 \025\000\025\000\025\000\025\000\025\000\025\000\043\000\043\000\
4953 \043\000\043\000\043\000\043\000\043\000\043\000\043\000\043\000\
4954 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\043\000\
4955 \043\000\043\000\043\000\043\000\043\000\255\255\255\255\255\255\
4956 \255\255\255\255\043\000\146\000\146\000\146\000\146\000\146\000\
4957 \146\000\146\000\146\000\146\000\146\000\255\255\255\255\255\255\
4958 \150\000\255\255\255\255\150\000\255\255\043\000\255\255\043\000\
4959 \043\000\043\000\043\000\043\000\043\000\255\255\255\255\255\255\
4960 \255\255\255\255\043\000\255\255\043\000\255\255\255\255\255\255\
4961 \150\000\255\255\255\255\025\000\025\000\025\000\025\000\025\000\
4962 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4963 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4964 \025\000\025\000\255\255\025\000\025\000\025\000\025\000\025\000\
4965 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4966 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4967 \025\000\025\000\025\000\025\000\025\000\025\000\025\000\025\000\
4968 \025\000\025\000\150\000\025\000\025\000\025\000\025\000\025\000\
4969 \025\000\025\000\025\000\026\000\255\255\255\255\026\000\026\000\
4970 \026\000\255\255\255\255\255\255\026\000\026\000\255\255\026\000\
4971 \026\000\026\000\155\000\155\000\155\000\155\000\155\000\155\000\
4972 \155\000\155\000\155\000\155\000\026\000\255\255\026\000\026\000\
4973 \026\000\026\000\026\000\158\000\158\000\158\000\158\000\158\000\
4974 \158\000\158\000\158\000\158\000\158\000\255\255\046\000\046\000\
4975 \046\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
4976 \255\255\255\255\255\255\255\255\255\255\255\255\026\000\255\255\
4977 \026\000\026\000\255\255\026\000\026\000\026\000\026\000\026\000\
4978 \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
4979 \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
4980 \026\000\026\000\026\000\026\000\026\000\046\000\026\000\027\000\
4981 \026\000\255\255\027\000\027\000\027\000\255\255\255\255\255\255\
4982 \027\000\027\000\255\255\027\000\027\000\027\000\255\255\255\255\
4983 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4984 \027\000\255\255\027\000\027\000\027\000\027\000\027\000\255\255\
4985 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4986 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4987 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
4988 \255\255\255\255\027\000\255\255\027\000\027\000\150\000\027\000\
4989 \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
4990 \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
4991 \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
4992 \027\000\255\255\027\000\255\255\027\000\255\255\255\255\255\255\
4993 \255\255\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
4994 \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
4995 \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
4996 \026\000\100\000\026\000\026\000\026\000\026\000\026\000\026\000\
4997 \026\000\026\000\055\000\055\000\055\000\055\000\055\000\055\000\
4998 \055\000\055\000\055\000\055\000\255\255\255\255\255\255\255\255\
4999 \100\000\255\255\255\255\055\000\055\000\055\000\055\000\055\000\
5000 \055\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5001 \100\000\100\000\100\000\100\000\100\000\100\000\100\000\100\000\
5002 \100\000\100\000\255\255\255\255\255\255\255\255\255\255\255\255\
5003 \255\255\255\255\255\255\055\000\055\000\055\000\055\000\055\000\
5004 \055\000\255\255\255\255\255\255\255\255\027\000\027\000\027\000\
5005 \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
5006 \027\000\027\000\027\000\027\000\027\000\027\000\027\000\027\000\
5007 \027\000\027\000\027\000\027\000\027\000\031\000\027\000\027\000\
5008 \027\000\027\000\027\000\027\000\027\000\027\000\031\000\031\000\
5009 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5010 \031\000\255\255\255\255\255\255\255\255\255\255\255\255\031\000\
5011 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5012 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5013 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5014 \031\000\255\255\255\255\255\255\255\255\031\000\255\255\031\000\
5015 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5016 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5017 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5018 \031\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\
5019 \059\000\059\000\059\000\255\255\255\255\255\255\255\255\255\255\
5020 \255\255\255\255\059\000\059\000\059\000\059\000\059\000\059\000\
5021 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5022 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5023 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5024 \255\255\255\255\059\000\059\000\059\000\059\000\059\000\059\000\
5025 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5026 \255\255\255\255\255\255\255\255\255\255\255\255\031\000\031\000\
5027 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5028 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5029 \031\000\031\000\031\000\031\000\031\000\255\255\031\000\031\000\
5030 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5031 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5032 \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
5033 \031\000\031\000\031\000\031\000\031\000\033\000\031\000\031\000\
5034 \031\000\031\000\031\000\031\000\031\000\031\000\033\000\033\000\
5035 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5036 \033\000\255\255\255\255\255\255\255\255\255\255\255\255\033\000\
5037 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5038 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5039 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5040 \033\000\255\255\255\255\255\255\255\255\033\000\255\255\033\000\
5041 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5042 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5043 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5044 \033\000\255\255\255\255\255\255\099\000\099\000\255\255\255\255\
5045 \099\000\255\255\255\255\255\255\255\255\143\000\143\000\143\000\
5046 \143\000\143\000\143\000\143\000\143\000\143\000\143\000\255\255\
5047 \255\255\255\255\255\255\099\000\255\255\099\000\143\000\143\000\
5048 \143\000\143\000\143\000\143\000\255\255\255\255\255\255\255\255\
5049 \255\255\255\255\255\255\099\000\099\000\099\000\099\000\099\000\
5050 \099\000\099\000\099\000\099\000\099\000\255\255\255\255\255\255\
5051 \255\255\255\255\255\255\255\255\255\255\255\255\143\000\143\000\
5052 \143\000\143\000\143\000\143\000\255\255\255\255\033\000\033\000\
5053 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5054 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5055 \033\000\033\000\033\000\033\000\033\000\255\255\033\000\033\000\
5056 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5057 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5058 \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
5059 \033\000\033\000\033\000\033\000\033\000\255\255\033\000\033\000\
5060 \033\000\033\000\033\000\033\000\033\000\033\000\048\000\255\255\
5061 \048\000\255\255\255\255\255\255\255\255\048\000\255\255\255\255\
5062 \060\000\255\255\255\255\060\000\255\255\255\255\048\000\048\000\
5063 \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
5064 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\060\000\
5065 \060\000\255\255\255\255\060\000\060\000\060\000\255\255\255\255\
5066 \255\255\060\000\060\000\255\255\060\000\060\000\060\000\255\255\
5067 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5068 \255\255\060\000\048\000\060\000\060\000\060\000\060\000\060\000\
5069 \048\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5070 \255\255\255\255\255\255\061\000\048\000\255\255\061\000\255\255\
5071 \048\000\255\255\048\000\255\255\255\255\255\255\048\000\255\255\
5072 \255\255\255\255\255\255\060\000\255\255\060\000\255\255\255\255\
5073 \255\255\255\255\061\000\061\000\255\255\255\255\061\000\061\000\
5074 \061\000\255\255\255\255\061\000\061\000\061\000\255\255\061\000\
5075 \061\000\061\000\062\000\099\000\255\255\062\000\255\255\255\255\
5076 \255\255\255\255\255\255\060\000\061\000\060\000\061\000\061\000\
5077 \061\000\061\000\061\000\255\255\255\255\255\255\255\255\255\255\
5078 \255\255\062\000\062\000\255\255\255\255\062\000\062\000\062\000\
5079 \255\255\255\255\062\000\062\000\062\000\255\255\062\000\062\000\
5080 \062\000\255\255\255\255\255\255\255\255\255\255\061\000\255\255\
5081 \061\000\255\255\255\255\062\000\255\255\062\000\062\000\062\000\
5082 \062\000\062\000\255\255\255\255\255\255\255\255\255\255\255\255\
5083 \255\255\255\255\255\255\255\255\255\255\063\000\255\255\255\255\
5084 \063\000\255\255\255\255\255\255\255\255\255\255\061\000\255\255\
5085 \061\000\255\255\255\255\255\255\255\255\062\000\255\255\062\000\
5086 \255\255\255\255\255\255\255\255\063\000\063\000\255\255\255\255\
5087 \063\000\063\000\063\000\255\255\255\255\063\000\063\000\063\000\
5088 \255\255\063\000\063\000\063\000\064\000\255\255\048\000\064\000\
5089 \255\255\255\255\255\255\255\255\255\255\062\000\063\000\062\000\
5090 \063\000\063\000\063\000\063\000\063\000\255\255\255\255\255\255\
5091 \255\255\255\255\255\255\064\000\064\000\255\255\255\255\064\000\
5092 \064\000\064\000\255\255\064\000\064\000\064\000\064\000\255\255\
5093 \064\000\064\000\064\000\255\255\255\255\255\255\255\255\255\255\
5094 \063\000\255\255\063\000\067\000\067\000\064\000\067\000\064\000\
5095 \064\000\064\000\064\000\064\000\067\000\067\000\255\255\255\255\
5096 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5097 \067\000\255\255\067\000\067\000\067\000\255\255\067\000\255\255\
5098 \063\000\255\255\063\000\255\255\255\255\255\255\064\000\064\000\
5099 \255\255\064\000\255\255\255\255\255\255\255\255\255\255\255\255\
5100 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5101 \255\255\067\000\255\255\069\000\067\000\255\255\069\000\255\255\
5102 \255\255\255\255\255\255\255\255\255\255\255\255\064\000\064\000\
5103 \255\255\064\000\255\255\255\255\255\255\255\255\255\255\255\255\
5104 \255\255\255\255\069\000\069\000\255\255\255\255\069\000\069\000\
5105 \069\000\067\000\067\000\069\000\069\000\069\000\255\255\069\000\
5106 \069\000\069\000\070\000\255\255\255\255\070\000\255\255\255\255\
5107 \255\255\255\255\255\255\255\255\069\000\255\255\069\000\069\000\
5108 \069\000\069\000\069\000\255\255\255\255\255\255\255\255\255\255\
5109 \255\255\070\000\070\000\255\255\255\255\070\000\070\000\070\000\
5110 \255\255\070\000\070\000\070\000\070\000\255\255\070\000\070\000\
5111 \070\000\255\255\255\255\255\255\255\255\255\255\069\000\255\255\
5112 \069\000\255\255\255\255\070\000\255\255\070\000\070\000\070\000\
5113 \070\000\070\000\255\255\255\255\255\255\255\255\255\255\255\255\
5114 \255\255\255\255\255\255\255\255\255\255\071\000\255\255\255\255\
5115 \071\000\255\255\255\255\255\255\255\255\255\255\069\000\255\255\
5116 \069\000\255\255\255\255\255\255\070\000\070\000\255\255\070\000\
5117 \255\255\255\255\255\255\255\255\071\000\071\000\255\255\255\255\
5118 \071\000\071\000\071\000\255\255\255\255\255\255\071\000\071\000\
5119 \255\255\071\000\071\000\071\000\075\000\255\255\255\255\075\000\
5120 \255\255\255\255\255\255\255\255\070\000\070\000\071\000\070\000\
5121 \071\000\071\000\071\000\071\000\071\000\255\255\255\255\255\255\
5122 \255\255\255\255\255\255\075\000\075\000\255\255\255\255\075\000\
5123 \075\000\075\000\255\255\255\255\075\000\075\000\075\000\255\255\
5124 \075\000\075\000\075\000\255\255\255\255\255\255\255\255\255\255\
5125 \071\000\255\255\071\000\255\255\255\255\075\000\255\255\075\000\
5126 \075\000\075\000\075\000\075\000\255\255\255\255\255\255\255\255\
5127 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\076\000\
5128 \255\255\255\255\076\000\255\255\255\255\255\255\255\255\255\255\
5129 \071\000\255\255\071\000\255\255\255\255\255\255\255\255\075\000\
5130 \255\255\075\000\255\255\255\255\255\255\255\255\076\000\076\000\
5131 \255\255\255\255\076\000\076\000\076\000\255\255\076\000\076\000\
5132 \076\000\076\000\255\255\076\000\076\000\076\000\077\000\255\255\
5133 \255\255\077\000\255\255\255\255\255\255\255\255\255\255\075\000\
5134 \076\000\075\000\076\000\076\000\076\000\076\000\076\000\255\255\
5135 \255\255\255\255\255\255\255\255\255\255\077\000\077\000\255\255\
5136 \255\255\077\000\077\000\077\000\255\255\255\255\077\000\077\000\
5137 \077\000\255\255\077\000\077\000\077\000\255\255\255\255\255\255\
5138 \255\255\076\000\076\000\255\255\076\000\255\255\255\255\077\000\
5139 \255\255\077\000\077\000\077\000\077\000\077\000\255\255\255\255\
5140 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5141 \255\255\078\000\255\255\255\255\078\000\255\255\255\255\255\255\
5142 \255\255\076\000\076\000\255\255\076\000\255\255\255\255\255\255\
5143 \255\255\077\000\255\255\077\000\255\255\255\255\255\255\255\255\
5144 \078\000\078\000\255\255\255\255\078\000\078\000\078\000\255\255\
5145 \255\255\078\000\078\000\078\000\255\255\078\000\078\000\078\000\
5146 \079\000\255\255\255\255\079\000\255\255\255\255\255\255\255\255\
5147 \255\255\077\000\078\000\077\000\078\000\078\000\078\000\078\000\
5148 \078\000\255\255\255\255\255\255\255\255\255\255\255\255\079\000\
5149 \079\000\255\255\255\255\079\000\079\000\079\000\255\255\255\255\
5150 \255\255\079\000\079\000\255\255\079\000\079\000\079\000\255\255\
5151 \255\255\255\255\255\255\255\255\078\000\255\255\078\000\255\255\
5152 \255\255\079\000\255\255\079\000\079\000\079\000\079\000\079\000\
5153 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\084\000\
5154 \084\000\255\255\255\255\084\000\255\255\255\255\255\255\255\255\
5155 \084\000\084\000\255\255\255\255\078\000\255\255\078\000\255\255\
5156 \255\255\255\255\255\255\079\000\084\000\079\000\084\000\084\000\
5157 \084\000\255\255\084\000\255\255\255\255\255\255\255\255\255\255\
5158 \085\000\255\255\255\255\085\000\085\000\085\000\255\255\255\255\
5159 \085\000\085\000\085\000\255\255\085\000\085\000\085\000\255\255\
5160 \255\255\255\255\255\255\079\000\255\255\079\000\255\255\084\000\
5161 \084\000\085\000\255\255\085\000\085\000\085\000\085\000\085\000\
5162 \255\255\255\255\255\255\255\255\255\255\086\000\255\255\255\255\
5163 \086\000\086\000\086\000\255\255\255\255\086\000\086\000\086\000\
5164 \255\255\086\000\086\000\086\000\255\255\255\255\084\000\084\000\
5165 \255\255\255\255\255\255\085\000\085\000\085\000\086\000\255\255\
5166 \086\000\086\000\086\000\086\000\086\000\255\255\255\255\255\255\
5167 \255\255\255\255\087\000\255\255\255\255\087\000\087\000\087\000\
5168 \255\255\255\255\087\000\087\000\087\000\255\255\087\000\087\000\
5169 \087\000\255\255\255\255\085\000\085\000\085\000\255\255\255\255\
5170 \086\000\086\000\086\000\087\000\255\255\087\000\087\000\087\000\
5171 \087\000\087\000\255\255\255\255\255\255\255\255\255\255\088\000\
5172 \255\255\255\255\088\000\088\000\088\000\255\255\255\255\088\000\
5173 \088\000\088\000\255\255\088\000\088\000\088\000\255\255\255\255\
5174 \086\000\086\000\086\000\255\255\255\255\087\000\087\000\087\000\
5175 \088\000\255\255\088\000\088\000\088\000\088\000\088\000\255\255\
5176 \255\255\255\255\255\255\255\255\089\000\255\255\255\255\089\000\
5177 \089\000\089\000\255\255\255\255\089\000\089\000\089\000\255\255\
5178 \089\000\089\000\089\000\255\255\255\255\087\000\087\000\087\000\
5179 \255\255\255\255\088\000\088\000\088\000\089\000\255\255\089\000\
5180 \089\000\089\000\089\000\089\000\255\255\255\255\255\255\255\255\
5181 \255\255\090\000\255\255\255\255\090\000\090\000\090\000\255\255\
5182 \255\255\255\255\090\000\090\000\255\255\090\000\090\000\090\000\
5183 \255\255\255\255\088\000\088\000\088\000\255\255\255\255\089\000\
5184 \089\000\089\000\090\000\255\255\090\000\090\000\090\000\090\000\
5185 \090\000\255\255\255\255\255\255\091\000\255\255\255\255\091\000\
5186 \091\000\091\000\255\255\255\255\091\000\091\000\091\000\255\255\
5187 \091\000\091\000\091\000\255\255\255\255\255\255\255\255\089\000\
5188 \089\000\089\000\255\255\255\255\090\000\091\000\090\000\091\000\
5189 \091\000\091\000\091\000\091\000\255\255\255\255\255\255\255\255\
5190 \255\255\092\000\255\255\255\255\092\000\092\000\092\000\255\255\
5191 \255\255\092\000\092\000\092\000\255\255\092\000\092\000\092\000\
5192 \255\255\255\255\255\255\255\255\090\000\255\255\090\000\091\000\
5193 \091\000\091\000\092\000\255\255\092\000\092\000\092\000\092\000\
5194 \092\000\255\255\255\255\255\255\255\255\255\255\093\000\255\255\
5195 \255\255\093\000\093\000\093\000\255\255\255\255\093\000\093\000\
5196 \093\000\255\255\093\000\093\000\093\000\255\255\255\255\091\000\
5197 \091\000\091\000\255\255\255\255\092\000\092\000\092\000\093\000\
5198 \255\255\093\000\093\000\093\000\093\000\093\000\255\255\255\255\
5199 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\094\000\
5200 \094\000\255\255\255\255\094\000\255\255\255\255\255\255\255\255\
5201 \094\000\094\000\255\255\255\255\092\000\092\000\092\000\255\255\
5202 \255\255\093\000\093\000\093\000\094\000\255\255\094\000\094\000\
5203 \094\000\255\255\094\000\255\255\255\255\255\255\255\255\255\255\
5204 \095\000\255\255\255\255\095\000\095\000\095\000\255\255\255\255\
5205 \095\000\095\000\095\000\255\255\095\000\095\000\095\000\255\255\
5206 \255\255\093\000\093\000\093\000\255\255\255\255\255\255\094\000\
5207 \094\000\095\000\255\255\095\000\095\000\095\000\095\000\095\000\
5208 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5209 \255\255\096\000\096\000\255\255\255\255\096\000\255\255\255\255\
5210 \255\255\255\255\096\000\096\000\255\255\255\255\094\000\094\000\
5211 \255\255\255\255\255\255\095\000\095\000\095\000\096\000\255\255\
5212 \096\000\096\000\096\000\255\255\096\000\255\255\255\255\255\255\
5213 \255\255\255\255\097\000\255\255\255\255\097\000\097\000\097\000\
5214 \255\255\255\255\097\000\097\000\097\000\255\255\097\000\097\000\
5215 \097\000\255\255\255\255\095\000\095\000\095\000\255\255\255\255\
5216 \255\255\096\000\096\000\097\000\255\255\097\000\097\000\097\000\
5217 \097\000\097\000\255\255\255\255\255\255\255\255\255\255\098\000\
5218 \255\255\255\255\098\000\098\000\098\000\255\255\255\255\098\000\
5219 \098\000\098\000\255\255\098\000\098\000\098\000\255\255\255\255\
5220 \096\000\096\000\255\255\255\255\255\255\097\000\097\000\097\000\
5221 \098\000\255\255\098\000\098\000\098\000\098\000\098\000\255\255\
5222 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5223 \109\000\109\000\255\255\255\255\109\000\255\255\255\255\110\000\
5224 \110\000\109\000\109\000\110\000\255\255\097\000\097\000\097\000\
5225 \110\000\110\000\098\000\098\000\098\000\109\000\255\255\109\000\
5226 \109\000\109\000\255\255\109\000\110\000\255\255\110\000\110\000\
5227 \110\000\255\255\110\000\255\255\255\255\255\255\255\255\255\255\
5228 \255\255\255\255\255\255\255\255\111\000\111\000\255\255\255\255\
5229 \111\000\255\255\098\000\098\000\098\000\111\000\111\000\255\255\
5230 \109\000\109\000\255\255\255\255\255\255\255\255\255\255\110\000\
5231 \110\000\111\000\255\255\111\000\111\000\111\000\255\255\111\000\
5232 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5233 \255\255\112\000\112\000\255\255\255\255\112\000\255\255\109\000\
5234 \109\000\255\255\112\000\112\000\255\255\255\255\110\000\110\000\
5235 \255\255\255\255\255\255\255\255\111\000\111\000\112\000\255\255\
5236 \112\000\112\000\112\000\255\255\112\000\255\255\255\255\255\255\
5237 \255\255\255\255\255\255\255\255\255\255\255\255\113\000\113\000\
5238 \255\255\255\255\113\000\255\255\255\255\114\000\114\000\113\000\
5239 \113\000\114\000\255\255\111\000\111\000\255\255\114\000\114\000\
5240 \255\255\112\000\112\000\113\000\255\255\113\000\113\000\113\000\
5241 \255\255\113\000\114\000\255\255\114\000\114\000\114\000\255\255\
5242 \114\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5243 \255\255\255\255\115\000\115\000\255\255\255\255\255\255\255\255\
5244 \112\000\112\000\255\255\115\000\115\000\255\255\113\000\113\000\
5245 \255\255\255\255\255\255\255\255\255\255\114\000\114\000\115\000\
5246 \255\255\115\000\115\000\115\000\255\255\115\000\255\255\255\255\
5247 \255\255\116\000\116\000\255\255\255\255\255\255\255\255\255\255\
5248 \255\255\255\255\116\000\116\000\255\255\113\000\113\000\255\255\
5249 \255\255\255\255\255\255\255\255\114\000\114\000\116\000\255\255\
5250 \116\000\116\000\116\000\115\000\116\000\117\000\117\000\255\255\
5251 \117\000\255\255\255\255\255\255\255\255\255\255\117\000\117\000\
5252 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5253 \255\255\255\255\117\000\255\255\117\000\117\000\117\000\255\255\
5254 \117\000\115\000\116\000\255\255\255\255\255\255\255\255\255\255\
5255 \255\255\255\255\118\000\118\000\255\255\255\255\255\255\119\000\
5256 \119\000\255\255\119\000\118\000\118\000\255\255\255\255\255\255\
5257 \119\000\119\000\255\255\117\000\255\255\255\255\117\000\118\000\
5258 \116\000\118\000\118\000\118\000\119\000\118\000\119\000\119\000\
5259 \119\000\255\255\119\000\255\255\255\255\255\255\255\255\255\255\
5260 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5261 \255\255\255\255\255\255\117\000\117\000\255\255\255\255\255\255\
5262 \255\255\255\255\255\255\118\000\255\255\119\000\255\255\255\255\
5263 \119\000\255\255\255\255\255\255\255\255\255\255\120\000\255\255\
5264 \255\255\120\000\120\000\120\000\255\255\255\255\120\000\120\000\
5265 \120\000\255\255\120\000\120\000\120\000\255\255\255\255\255\255\
5266 \255\255\118\000\255\255\255\255\255\255\119\000\119\000\120\000\
5267 \255\255\120\000\120\000\120\000\120\000\120\000\255\255\255\255\
5268 \255\255\255\255\255\255\121\000\255\255\255\255\121\000\121\000\
5269 \121\000\255\255\255\255\121\000\121\000\121\000\255\255\121\000\
5270 \121\000\121\000\255\255\255\255\255\255\255\255\255\255\255\255\
5271 \255\255\120\000\120\000\120\000\121\000\255\255\121\000\121\000\
5272 \121\000\121\000\121\000\255\255\255\255\255\255\255\255\255\255\
5273 \122\000\255\255\255\255\122\000\122\000\122\000\255\255\255\255\
5274 \122\000\122\000\122\000\255\255\122\000\122\000\122\000\255\255\
5275 \255\255\120\000\120\000\120\000\255\255\255\255\121\000\121\000\
5276 \121\000\122\000\255\255\122\000\122\000\122\000\122\000\122\000\
5277 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\123\000\
5278 \255\255\255\255\123\000\255\255\255\255\255\255\255\255\255\255\
5279 \255\255\255\255\255\255\255\255\255\255\255\255\121\000\121\000\
5280 \121\000\255\255\255\255\122\000\122\000\122\000\255\255\123\000\
5281 \255\255\255\255\255\255\255\255\123\000\123\000\255\255\123\000\
5282 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5283 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5284 \255\255\123\000\255\255\122\000\122\000\122\000\123\000\123\000\
5285 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5286 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5287 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5288 \255\255\255\255\255\255\255\255\123\000\255\255\123\000\123\000\
5289 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5290 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5291 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5292 \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
5293 \148\000\148\000\255\255\255\255\255\255\255\255\255\255\255\255\
5294 \255\255\148\000\148\000\148\000\148\000\148\000\148\000\255\255\
5295 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5296 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5297 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5298 \255\255\148\000\148\000\148\000\148\000\148\000\148\000\255\255\
5299 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5300 \255\255\255\255\255\255\255\255\255\255\123\000\123\000\123\000\
5301 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5302 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5303 \123\000\123\000\123\000\123\000\255\255\123\000\123\000\123\000\
5304 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5305 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5306 \123\000\123\000\123\000\123\000\123\000\123\000\123\000\123\000\
5307 \123\000\123\000\123\000\123\000\255\255\123\000\123\000\123\000\
5308 \123\000\123\000\123\000\123\000\123\000\123\000\127\000\255\255\
5309 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\127\000\
5310 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5311 \127\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5312 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5313 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5314 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5315 \127\000\127\000\255\255\255\255\255\255\255\255\127\000\255\255\
5316 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5317 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5318 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5319 \127\000\127\000\255\255\255\255\255\255\255\255\255\255\255\255\
5320 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5321 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5322 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5323 \132\000\132\000\255\255\255\255\255\255\255\255\132\000\255\255\
5324 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5325 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5326 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5327 \132\000\132\000\255\255\255\255\255\255\255\255\255\255\127\000\
5328 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5329 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5330 \127\000\127\000\127\000\127\000\127\000\127\000\255\255\127\000\
5331 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5332 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5333 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\127\000\
5334 \127\000\127\000\127\000\127\000\127\000\127\000\255\255\127\000\
5335 \127\000\127\000\127\000\127\000\127\000\127\000\127\000\132\000\
5336 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5337 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5338 \132\000\132\000\132\000\132\000\132\000\132\000\255\255\132\000\
5339 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5340 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5341 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\132\000\
5342 \132\000\132\000\132\000\132\000\132\000\132\000\255\255\132\000\
5343 \132\000\132\000\132\000\132\000\132\000\132\000\132\000\133\000\
5344 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5345 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5346 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5347 \133\000\255\255\255\255\255\255\255\255\133\000\255\255\133\000\
5348 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5349 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5350 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5351 \133\000\154\000\154\000\154\000\154\000\154\000\154\000\154\000\
5352 \154\000\154\000\154\000\255\255\255\255\255\255\255\255\255\255\
5353 \255\255\255\255\154\000\154\000\154\000\154\000\154\000\154\000\
5354 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5355 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5356 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5357 \255\255\255\255\154\000\154\000\154\000\154\000\154\000\154\000\
5358 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5359 \255\255\255\255\255\255\255\255\255\255\255\255\133\000\133\000\
5360 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5361 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5362 \133\000\133\000\133\000\133\000\133\000\255\255\133\000\133\000\
5363 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5364 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5365 \133\000\133\000\133\000\133\000\133\000\133\000\133\000\133\000\
5366 \133\000\133\000\133\000\133\000\133\000\134\000\133\000\133\000\
5367 \133\000\133\000\133\000\133\000\133\000\133\000\134\000\134\000\
5368 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5369 \255\255\255\255\134\000\255\255\255\255\255\255\134\000\134\000\
5370 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5371 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5372 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5373 \134\000\255\255\255\255\255\255\255\255\134\000\255\255\134\000\
5374 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5375 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5376 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5377 \134\000\159\000\159\000\159\000\159\000\159\000\159\000\159\000\
5378 \159\000\159\000\159\000\255\255\255\255\255\255\255\255\255\255\
5379 \255\255\255\255\159\000\159\000\159\000\159\000\159\000\159\000\
5380 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5381 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5382 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5383 \255\255\255\255\159\000\159\000\159\000\159\000\159\000\159\000\
5384 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5385 \255\255\255\255\255\255\255\255\255\255\255\255\134\000\134\000\
5386 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5387 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5388 \134\000\134\000\134\000\134\000\134\000\255\255\134\000\134\000\
5389 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5390 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5391 \134\000\134\000\134\000\134\000\134\000\134\000\134\000\134\000\
5392 \134\000\134\000\134\000\134\000\134\000\135\000\134\000\134\000\
5393 \134\000\134\000\134\000\134\000\134\000\134\000\135\000\135\000\
5394 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5395 \255\255\255\255\135\000\255\255\255\255\255\255\255\255\135\000\
5396 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5397 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5398 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5399 \135\000\255\255\255\255\255\255\255\255\135\000\255\255\135\000\
5400 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5401 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5402 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5403 \135\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5404 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5405 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5406 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5407 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5408 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5409 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5410 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5411 \255\255\255\255\255\255\255\255\255\255\255\255\135\000\135\000\
5412 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5413 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5414 \135\000\135\000\135\000\135\000\135\000\255\255\135\000\135\000\
5415 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5416 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5417 \135\000\135\000\135\000\135\000\135\000\135\000\135\000\135\000\
5418 \135\000\135\000\135\000\135\000\135\000\255\255\135\000\135\000\
5419 \135\000\135\000\135\000\135\000\135\000\135\000\136\000\255\255\
5420 \136\000\255\255\255\255\152\000\255\255\136\000\152\000\255\255\
5421 \255\255\255\255\255\255\255\255\255\255\255\255\136\000\136\000\
5422 \136\000\136\000\136\000\136\000\136\000\136\000\136\000\136\000\
5423 \255\255\152\000\255\255\152\000\255\255\255\255\255\255\255\255\
5424 \152\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5425 \255\255\152\000\152\000\152\000\152\000\152\000\152\000\152\000\
5426 \152\000\152\000\152\000\255\255\255\255\255\255\255\255\255\255\
5427 \255\255\255\255\136\000\255\255\255\255\255\255\255\255\255\255\
5428 \136\000\160\000\255\255\255\255\160\000\160\000\160\000\255\255\
5429 \255\255\255\255\160\000\160\000\136\000\160\000\160\000\160\000\
5430 \136\000\255\255\136\000\255\255\255\255\152\000\136\000\255\255\
5431 \255\255\255\255\160\000\152\000\160\000\160\000\160\000\160\000\
5432 \160\000\255\255\255\255\255\255\255\255\255\255\255\255\152\000\
5433 \255\255\255\255\255\255\152\000\255\255\152\000\255\255\255\255\
5434 \255\255\152\000\255\255\255\255\255\255\255\255\255\255\255\255\
5435 \255\255\255\255\255\255\255\255\160\000\255\255\160\000\255\255\
5436 \255\255\255\255\255\255\255\255\161\000\255\255\255\255\161\000\
5437 \161\000\161\000\255\255\255\255\255\255\161\000\161\000\255\255\
5438 \161\000\161\000\161\000\255\255\255\255\255\255\255\255\255\255\
5439 \255\255\255\255\255\255\255\255\160\000\161\000\160\000\161\000\
5440 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5441 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5442 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5443 \161\000\161\000\161\000\161\000\161\000\161\000\255\255\161\000\
5444 \255\255\161\000\161\000\255\255\161\000\161\000\161\000\161\000\
5445 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5446 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5447 \161\000\161\000\161\000\161\000\161\000\161\000\255\255\161\000\
5448 \255\255\161\000\255\255\255\255\255\255\255\255\255\255\255\255\
5449 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5450 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5451 \255\255\152\000\255\255\255\255\255\255\255\255\255\255\255\255\
5452 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5453 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5454 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5455 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5456 \255\255\255\255\255\255\161\000\161\000\161\000\161\000\161\000\
5457 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5458 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5459 \161\000\161\000\255\255\161\000\161\000\161\000\161\000\161\000\
5460 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5461 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5462 \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
5463 \161\000\161\000\255\255\161\000\161\000\161\000\161\000\161\000\
5464 \161\000\161\000\161\000\162\000\255\255\255\255\162\000\162\000\
5465 \162\000\255\255\255\255\255\255\162\000\162\000\255\255\162\000\
5466 \162\000\162\000\255\255\255\255\255\255\255\255\255\255\255\255\
5467 \255\255\255\255\255\255\255\255\162\000\255\255\162\000\162\000\
5468 \162\000\162\000\162\000\255\255\255\255\255\255\255\255\163\000\
5469 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5470 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5471 \163\000\163\000\255\255\255\255\163\000\255\255\162\000\255\255\
5472 \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5473 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5474 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5475 \163\000\163\000\163\000\255\255\255\255\255\255\162\000\163\000\
5476 \162\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5477 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5478 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5479 \163\000\163\000\163\000\255\255\255\255\255\255\255\255\255\255\
5480 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5481 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5482 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5483 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5484 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5485 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5486 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5487 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5488 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5489 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5490 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\255\255\
5491 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5492 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5493 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5494 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\255\255\
5495 \163\000\163\000\163\000\163\000\163\000\163\000\163\000\163\000\
5496 \164\000\255\255\255\255\164\000\164\000\164\000\255\255\255\255\
5497 \255\255\164\000\164\000\255\255\164\000\164\000\164\000\255\255\
5498 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5499 \255\255\164\000\255\255\164\000\164\000\164\000\164\000\164\000\
5500 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5501 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5502 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5503 \164\000\164\000\255\255\164\000\255\255\164\000\164\000\255\255\
5504 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5505 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5506 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5507 \164\000\164\000\255\255\164\000\255\255\164\000\255\255\255\255\
5508 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5509 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5510 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5511 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5512 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5513 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5514 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5515 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\164\000\
5516 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5517 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5518 \164\000\164\000\164\000\164\000\164\000\164\000\255\255\164\000\
5519 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5520 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5521 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
5522 \164\000\164\000\164\000\164\000\164\000\164\000\255\255\164\000\
5523 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\165\000\
5524 \255\255\255\255\165\000\165\000\165\000\255\255\255\255\255\255\
5525 \165\000\165\000\255\255\165\000\165\000\165\000\255\255\255\255\
5526 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5527 \165\000\255\255\165\000\165\000\165\000\165\000\165\000\255\255\
5528 \255\255\255\255\255\255\255\255\255\255\255\255\166\000\255\255\
5529 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\166\000\
5530 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5531 \166\000\255\255\165\000\166\000\165\000\255\255\255\255\166\000\
5532 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5533 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5534 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5535 \166\000\166\000\165\000\255\255\165\000\255\255\166\000\255\255\
5536 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5537 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5538 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5539 \166\000\166\000\255\255\255\255\255\255\255\255\255\255\255\255\
5540 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5541 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5542 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5543 \167\000\167\000\255\255\255\255\255\255\255\255\167\000\255\255\
5544 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5545 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5546 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5547 \167\000\167\000\255\255\255\255\255\255\255\255\255\255\166\000\
5548 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5549 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5550 \166\000\166\000\166\000\166\000\166\000\166\000\255\255\166\000\
5551 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5552 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5553 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
5554 \166\000\166\000\166\000\166\000\166\000\166\000\255\255\166\000\
5555 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\167\000\
5556 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5557 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5558 \167\000\167\000\167\000\167\000\167\000\167\000\255\255\167\000\
5559 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5560 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5561 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
5562 \167\000\167\000\167\000\167\000\167\000\167\000\168\000\167\000\
5563 \167\000\167\000\167\000\167\000\167\000\167\000\167\000\168\000\
5564 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5565 \168\000\255\255\255\255\168\000\255\255\255\255\255\255\255\255\
5566 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5567 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5568 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5569 \168\000\168\000\255\255\255\255\255\255\255\255\168\000\255\255\
5570 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5571 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5572 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5573 \168\000\168\000\255\255\255\255\255\255\255\255\255\255\255\255\
5574 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5575 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5576 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5577 \174\000\174\000\255\255\255\255\255\255\255\255\174\000\255\255\
5578 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5579 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5580 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5581 \174\000\174\000\255\255\255\255\255\255\255\255\255\255\168\000\
5582 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5583 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5584 \168\000\168\000\168\000\168\000\168\000\168\000\255\255\168\000\
5585 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5586 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5587 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\168\000\
5588 \168\000\168\000\168\000\168\000\168\000\168\000\255\255\168\000\
5589 \168\000\168\000\168\000\168\000\168\000\168\000\168\000\174\000\
5590 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5591 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5592 \174\000\174\000\174\000\174\000\174\000\174\000\255\255\174\000\
5593 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5594 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5595 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
5596 \174\000\174\000\174\000\174\000\174\000\174\000\255\255\174\000\
5597 \174\000\174\000\174\000\174\000\174\000\174\000\174\000\175\000\
5598 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5599 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5600 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5601 \175\000\255\255\255\255\255\255\255\255\175\000\255\255\175\000\
5602 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5603 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5604 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5605 \175\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5606 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5607 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5608 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5609 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5610 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5611 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5612 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5613 \255\255\255\255\255\255\255\255\255\255\255\255\175\000\175\000\
5614 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5615 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5616 \175\000\175\000\175\000\175\000\175\000\255\255\175\000\175\000\
5617 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5618 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5619 \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
5620 \175\000\175\000\175\000\175\000\175\000\176\000\175\000\175\000\
5621 \175\000\175\000\175\000\175\000\175\000\175\000\176\000\176\000\
5622 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5623 \255\255\255\255\176\000\255\255\255\255\255\255\176\000\176\000\
5624 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5625 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5626 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5627 \176\000\255\255\255\255\255\255\255\255\176\000\255\255\176\000\
5628 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5629 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5630 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5631 \176\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5632 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5633 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5634 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5635 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5636 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5637 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5638 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5639 \255\255\255\255\255\255\255\255\255\255\255\255\176\000\176\000\
5640 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5641 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5642 \176\000\176\000\176\000\176\000\176\000\255\255\176\000\176\000\
5643 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5644 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5645 \176\000\176\000\176\000\176\000\176\000\176\000\176\000\176\000\
5646 \176\000\176\000\176\000\176\000\176\000\177\000\176\000\176\000\
5647 \176\000\176\000\176\000\176\000\176\000\176\000\177\000\177\000\
5648 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5649 \255\255\255\255\177\000\255\255\255\255\255\255\255\255\177\000\
5650 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5651 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5652 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5653 \177\000\255\255\255\255\255\255\255\255\177\000\255\255\177\000\
5654 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5655 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5656 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5657 \177\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5658 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5659 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5660 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5661 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5662 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5663 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5664 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5665 \255\255\255\255\255\255\255\255\255\255\255\255\177\000\177\000\
5666 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5667 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5668 \177\000\177\000\177\000\177\000\177\000\255\255\177\000\177\000\
5669 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5670 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5671 \177\000\177\000\177\000\177\000\177\000\177\000\177\000\177\000\
5672 \177\000\177\000\177\000\177\000\177\000\255\255\177\000\177\000\
5673 \177\000\177\000\177\000\177\000\177\000\177\000\178\000\255\255\
5674 \255\255\178\000\255\255\255\255\255\255\255\255\255\255\255\255\
5675 \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
5676 \178\000\178\000\178\000\178\000\178\000\255\255\255\255\255\255\
5677 \255\255\255\255\255\255\178\000\178\000\178\000\178\000\178\000\
5678 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5679 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5680 \178\000\178\000\178\000\178\000\178\000\255\255\255\255\255\255\
5681 \255\255\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5682 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5683 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5684 \178\000\178\000\178\000\178\000\178\000\255\255\255\255\255\255\
5685 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5686 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5687 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5688 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5689 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5690 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5691 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5692 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5693 \255\255\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
5694 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5695 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5696 \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
5697 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5698 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5699 \178\000\178\000\178\000\178\000\178\000\178\000\178\000\178\000\
5700 \178\000\255\255\178\000\178\000\178\000\178\000\178\000\178\000\
5701 \178\000\178\000\178\000\180\000\255\255\255\255\255\255\255\255\
5702 \255\255\255\255\255\255\255\255\180\000\180\000\180\000\180\000\
5703 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\255\255\
5704 \255\255\255\255\255\255\255\255\255\255\180\000\180\000\180\000\
5705 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5706 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5707 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\255\255\
5708 \255\255\255\255\255\255\180\000\255\255\180\000\180\000\180\000\
5709 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5710 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5711 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\255\255\
5712 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5713 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5714 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5715 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5716 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5717 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5718 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5719 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5720 \255\255\255\255\255\255\255\255\180\000\180\000\180\000\180\000\
5721 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5722 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5723 \180\000\180\000\180\000\255\255\180\000\180\000\180\000\180\000\
5724 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5725 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5726 \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
5727 \180\000\180\000\180\000\255\255\180\000\180\000\180\000\180\000\
5728 \180\000\180\000\180\000\180\000\181\000\255\255\255\255\255\255\
5729 \255\255\255\255\255\255\181\000\255\255\181\000\181\000\181\000\
5730 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5731 \255\255\255\255\255\255\255\255\255\255\255\255\181\000\181\000\
5732 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5733 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5734 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5735 \255\255\255\255\255\255\255\255\181\000\255\255\181\000\181\000\
5736 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5737 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5738 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5739 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5740 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5741 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5742 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5743 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5744 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5745 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5746 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5747 \255\255\255\255\255\255\255\255\255\255\181\000\181\000\181\000\
5748 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5749 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5750 \181\000\181\000\181\000\181\000\255\255\181\000\181\000\181\000\
5751 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5752 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5753 \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
5754 \181\000\181\000\181\000\181\000\183\000\181\000\181\000\181\000\
5755 \181\000\181\000\181\000\181\000\181\000\183\000\183\000\183\000\
5756 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5757 \255\255\255\255\255\255\255\255\255\255\255\255\183\000\183\000\
5758 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5759 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5760 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5761 \255\255\255\255\255\255\255\255\183\000\255\255\183\000\183\000\
5762 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5763 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5764 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5765 \255\255\255\255\255\255\255\255\255\255\255\255\187\000\187\000\
5766 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5767 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5768 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5769 \255\255\255\255\255\255\255\255\187\000\255\255\187\000\187\000\
5770 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5771 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5772 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5773 \255\255\255\255\255\255\255\255\255\255\183\000\183\000\183\000\
5774 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5775 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5776 \183\000\183\000\183\000\183\000\255\255\183\000\183\000\183\000\
5777 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5778 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5779 \183\000\183\000\183\000\183\000\183\000\183\000\183\000\183\000\
5780 \183\000\183\000\183\000\183\000\255\255\183\000\183\000\183\000\
5781 \183\000\183\000\183\000\183\000\183\000\187\000\187\000\187\000\
5782 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5783 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5784 \187\000\187\000\187\000\187\000\255\255\187\000\187\000\187\000\
5785 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5786 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5787 \187\000\187\000\187\000\187\000\187\000\187\000\187\000\187\000\
5788 \187\000\187\000\187\000\187\000\255\255\187\000\187\000\187\000\
5789 \187\000\187\000\187\000\187\000\187\000\188\000\188\000\188\000\
5790 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5791 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5792 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\255\255\
5793 \255\255\255\255\255\255\188\000\255\255\188\000\188\000\188\000\
5794 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5795 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5796 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\255\255\
5797 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5798 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5799 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5800 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5801 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5802 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5803 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5804 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5805 \255\255\255\255\255\255\255\255\188\000\188\000\188\000\188\000\
5806 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5807 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5808 \188\000\188\000\188\000\255\255\188\000\188\000\188\000\188\000\
5809 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5810 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5811 \188\000\188\000\188\000\188\000\188\000\188\000\188\000\188\000\
5812 \188\000\188\000\188\000\189\000\188\000\188\000\188\000\188\000\
5813 \188\000\188\000\188\000\188\000\189\000\189\000\189\000\189\000\
5814 \189\000\189\000\189\000\189\000\189\000\189\000\255\255\255\255\
5815 \189\000\255\255\255\255\255\255\189\000\189\000\189\000\189\000\
5816 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5817 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5818 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\255\255\
5819 \255\255\255\255\255\255\189\000\255\255\189\000\189\000\189\000\
5820 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5821 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5822 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\255\255\
5823 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5824 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5825 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5826 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5827 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5828 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5829 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5830 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5831 \255\255\255\255\255\255\255\255\189\000\189\000\189\000\189\000\
5832 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5833 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5834 \189\000\189\000\189\000\255\255\189\000\189\000\189\000\189\000\
5835 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5836 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5837 \189\000\189\000\189\000\189\000\189\000\189\000\189\000\189\000\
5838 \189\000\189\000\189\000\190\000\189\000\189\000\189\000\189\000\
5839 \189\000\189\000\189\000\189\000\190\000\190\000\190\000\190\000\
5840 \190\000\190\000\190\000\190\000\190\000\190\000\255\255\255\255\
5841 \190\000\255\255\255\255\255\255\255\255\190\000\190\000\190\000\
5842 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5843 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5844 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\255\255\
5845 \255\255\255\255\255\255\190\000\255\255\190\000\190\000\190\000\
5846 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5847 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5848 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\255\255\
5849 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5850 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5851 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5852 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5853 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5854 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5855 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5856 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
5857 \255\255\255\255\255\255\255\255\190\000\190\000\190\000\190\000\
5858 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5859 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5860 \190\000\190\000\190\000\255\255\190\000\190\000\190\000\190\000\
5861 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5862 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5863 \190\000\190\000\190\000\190\000\190\000\190\000\190\000\190\000\
5864 \190\000\190\000\190\000\255\255\190\000\190\000\190\000\190\000\
5865 \190\000\190\000\190\000\190\000\255\255";
5866 Lexing.lex_base_code =
5867 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5868 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5869 \000\000\000\000\000\000\027\000\000\000\000\000\000\000\000\000\
5870 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5871 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5872 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5873 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5874 \000\000\000\000\000\000\000\000\066\000\101\000\136\000\171\000\
5875 \206\000\000\000\000\000\000\000\000\000\241\000\020\001\055\001\
5876 \000\000\000\000\018\000\090\001\125\001\160\001\195\001\230\001\
5877 \000\000\021\000\026\000\000\000\000\000\000\000\000\000\000\000\
5878 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5879 \000\000\000\000\000\000\247\001\040\002\000\000\034\000\000\000\
5880 \000\000\003\000\000\000\000\000\049\000\000\000\000\000\000\000\
5881 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5882 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5883 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5884 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5885 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5886 \001\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\
5887 \000\000\000\000\000\000\000\000\036\002\000\000\244\002\000\000\
5888 \000\000\061\000\000\000\000\000\000\000\000\000\000\000\000\000\
5889 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5890 \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
5891 Lexing.lex_backtrk_code =
5892 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5893 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5894 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5895 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5896 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5897 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5898 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5899 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5900 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5901 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5902 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5903 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5904 \000\000\000\000\000\000\000\000\000\000\034\000\000\000\000\000\
5905 \000\000\000\000\000\000\049\000\000\000\000\000\000\000\000\000\
5906 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5907 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5908 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5909 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5910 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5911 \000\000\000\000\000\000\000\000\061\000\061\000\000\000\000\000\
5912 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5913 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5914 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5915 \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
5916 Lexing.lex_default_code =
5917 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5918 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5919 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5920 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5921 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5922 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5923 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5924 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5925 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5926 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5927 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5928 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5929 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5930 \041\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5931 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5932 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5933 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5934 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5935 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5936 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5937 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5938 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5939 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5940 \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
5941 Lexing.lex_trans_code =
5942 "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5943 \000\000\001\000\000\000\058\000\058\000\000\000\058\000\000\000\
5944 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5945 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5946 \001\000\000\000\000\000\001\000\007\000\044\000\000\000\007\000\
5947 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
5948 \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
5949 \004\000\004\000\000\000\007\000\012\000\000\000\000\000\012\000\
5950 \012\000\012\000\000\000\000\000\000\000\000\000\012\000\000\000\
5951 \012\000\012\000\012\000\007\000\000\000\000\000\007\000\000\000\
5952 \000\000\000\000\000\000\000\000\000\000\012\000\000\000\012\000\
5953 \012\000\012\000\012\000\012\000\000\000\000\000\000\000\000\000\
5954 \000\000\000\000\007\000\015\000\000\000\000\000\015\000\015\000\
5955 \015\000\000\000\000\000\000\000\015\000\015\000\000\000\015\000\
5956 \015\000\015\000\000\000\000\000\000\000\000\000\000\000\012\000\
5957 \000\000\012\000\000\000\000\000\015\000\000\000\015\000\015\000\
5958 \015\000\015\000\015\000\000\000\000\000\000\000\012\000\000\000\
5959 \000\000\012\000\012\000\012\000\000\000\000\000\000\000\012\000\
5960 \012\000\000\000\012\000\012\000\012\000\000\000\000\000\012\000\
5961 \000\000\012\000\000\000\000\000\000\000\000\000\015\000\012\000\
5962 \015\000\012\000\012\000\012\000\012\000\012\000\000\000\000\000\
5963 \000\000\012\000\000\000\000\000\012\000\012\000\012\000\000\000\
5964 \000\000\000\000\012\000\012\000\000\000\012\000\012\000\012\000\
5965 \000\000\000\000\000\000\000\000\000\000\000\000\015\000\000\000\
5966 \015\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
5967 \012\000\000\000\000\000\000\000\012\000\000\000\000\000\012\000\
5968 \012\000\012\000\000\000\000\000\000\000\012\000\012\000\000\000\
5969 \012\000\012\000\012\000\000\000\000\000\000\000\000\000\000\000\
5970 \000\000\012\000\000\000\012\000\012\000\012\000\012\000\012\000\
5971 \012\000\012\000\012\000\012\000\000\000\000\000\000\000\012\000\
5972 \000\000\000\000\012\000\012\000\012\000\000\000\000\000\000\000\
5973 \012\000\012\000\000\000\012\000\012\000\012\000\000\000\000\000\
5974 \000\000\000\000\000\000\000\000\012\000\000\000\012\000\012\000\
5975 \012\000\012\000\012\000\012\000\012\000\012\000\012\000\000\000\
5976 \000\000\000\000\012\000\000\000\000\000\012\000\012\000\012\000\
5977 \000\000\000\000\000\000\012\000\012\000\000\000\012\000\012\000\
5978 \012\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\
5979 \000\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
5980 \012\000\012\000\000\000\000\000\000\000\012\000\000\000\000\000\
5981 \012\000\012\000\012\000\000\000\000\000\000\000\012\000\012\000\
5982 \000\000\012\000\012\000\012\000\000\000\000\000\000\000\000\000\
5983 \000\000\000\000\012\000\000\000\012\000\012\000\012\000\012\000\
5984 \012\000\012\000\012\000\012\000\012\000\000\000\000\000\000\000\
5985 \012\000\000\000\000\000\012\000\012\000\012\000\000\000\000\000\
5986 \000\000\012\000\012\000\000\000\012\000\012\000\012\000\000\000\
5987 \000\000\000\000\000\000\000\000\000\000\012\000\000\000\012\000\
5988 \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
5989 \000\000\000\000\000\000\012\000\000\000\000\000\012\000\012\000\
5990 \012\000\000\000\000\000\000\000\012\000\012\000\000\000\012\000\
5991 \012\000\012\000\000\000\000\000\000\000\000\000\000\000\000\000\
5992 \012\000\000\000\012\000\012\000\012\000\012\000\012\000\012\000\
5993 \012\000\012\000\012\000\000\000\000\000\000\000\012\000\000\000\
5994 \000\000\012\000\012\000\012\000\000\000\000\000\000\000\012\000\
5995 \012\000\000\000\012\000\012\000\012\000\000\000\000\000\000\000\
5996 \000\000\000\000\000\000\012\000\000\000\012\000\012\000\012\000\
5997 \012\000\012\000\012\000\012\000\012\000\012\000\000\000\000\000\
5998 \000\000\012\000\000\000\000\000\012\000\012\000\012\000\000\000\
5999 \000\000\000\000\012\000\012\000\000\000\012\000\012\000\012\000\
6000 \000\000\000\000\000\000\000\000\000\000\000\000\012\000\000\000\
6001 \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
6002 \012\000\000\000\000\000\000\000\015\000\000\000\000\000\015\000\
6003 \015\000\015\000\000\000\000\000\000\000\015\000\015\000\000\000\
6004 \015\000\015\000\015\000\000\000\000\000\000\000\000\000\000\000\
6005 \000\000\012\000\000\000\012\000\012\000\015\000\012\000\015\000\
6006 \015\000\015\000\015\000\015\000\000\000\000\000\000\000\015\000\
6007 \000\000\000\000\015\000\015\000\015\000\000\000\000\000\000\000\
6008 \015\000\015\000\000\000\015\000\015\000\015\000\000\000\000\000\
6009 \000\000\029\000\000\000\000\000\012\000\000\000\012\000\015\000\
6010 \015\000\015\000\015\000\015\000\015\000\015\000\015\000\004\000\
6011 \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
6012 \004\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\
6013 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\015\000\
6014 \000\000\015\000\015\000\000\000\015\000\000\000\000\000\000\000\
6015 \001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6016 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6017 \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
6018 \004\000\004\000\015\000\000\000\015\000\058\000\058\000\058\000\
6019 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6020 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6021 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
6022 \000\000\000\000\000\000\058\000\000\000\058\000\058\000\058\000\
6023 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6024 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6025 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
6026 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6027 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6028 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6029 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6030 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6031 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6032 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6033 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6034 \000\000\000\000\000\000\000\000\058\000\058\000\058\000\058\000\
6035 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6036 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6037 \058\000\058\000\058\000\000\000\058\000\058\000\058\000\058\000\
6038 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6039 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6040 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6041 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6042 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6043 \058\000\058\000\058\000\058\000\058\000\058\000\000\000\000\000\
6044 \000\000\000\000\000\000\000\000\000\000\058\000\058\000\058\000\
6045 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6046 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6047 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
6048 \000\000\000\000\000\000\058\000\000\000\058\000\058\000\058\000\
6049 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6050 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6051 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
6052 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6053 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6054 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6055 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6056 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6057 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6058 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6059 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
6060 \000\000\000\000\000\000\000\000\058\000\058\000\058\000\058\000\
6061 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6062 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6063 \058\000\058\000\058\000\000\000\058\000\058\000\058\000\058\000\
6064 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6065 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6066 \058\000\058\000\058\000\058\000\058\000\058\000\058\000\058\000\
6067 \058\000\058\000\058\000\000\000\058\000\058\000\058\000\058\000\
6068 \058\000\058\000\058\000\058\000\000\000";
6069 Lexing.lex_check_code =
6070 "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6071 \255\255\016\000\104\000\152\000\156\000\104\000\152\000\255\255\
6072 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6073 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6074 \016\000\255\255\104\000\000\000\019\000\105\000\255\255\019\000\
6075 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6076 \016\000\016\000\016\000\016\000\016\000\016\000\016\000\016\000\
6077 \016\000\016\000\255\255\019\000\019\000\255\255\255\255\019\000\
6078 \019\000\019\000\255\255\255\255\255\255\255\255\019\000\255\255\
6079 \019\000\019\000\019\000\060\000\255\255\255\255\060\000\255\255\
6080 \255\255\255\255\255\255\255\255\255\255\019\000\255\255\019\000\
6081 \019\000\019\000\019\000\019\000\255\255\255\255\255\255\255\255\
6082 \255\255\255\255\060\000\060\000\255\255\255\255\060\000\060\000\
6083 \060\000\255\255\255\255\255\255\060\000\060\000\255\255\060\000\
6084 \060\000\060\000\255\255\255\255\255\255\255\255\255\255\019\000\
6085 \255\255\019\000\255\255\255\255\060\000\255\255\060\000\060\000\
6086 \060\000\060\000\060\000\255\255\255\255\255\255\061\000\255\255\
6087 \255\255\061\000\061\000\061\000\255\255\255\255\255\255\061\000\
6088 \061\000\255\255\061\000\061\000\061\000\255\255\255\255\019\000\
6089 \255\255\019\000\255\255\255\255\255\255\255\255\060\000\061\000\
6090 \060\000\061\000\061\000\061\000\061\000\061\000\255\255\255\255\
6091 \255\255\062\000\255\255\255\255\062\000\062\000\062\000\255\255\
6092 \255\255\255\255\062\000\062\000\255\255\062\000\062\000\062\000\
6093 \255\255\255\255\255\255\255\255\255\255\255\255\060\000\255\255\
6094 \060\000\061\000\062\000\061\000\062\000\062\000\062\000\062\000\
6095 \062\000\255\255\255\255\255\255\063\000\255\255\255\255\063\000\
6096 \063\000\063\000\255\255\255\255\255\255\063\000\063\000\255\255\
6097 \063\000\063\000\063\000\255\255\255\255\255\255\255\255\255\255\
6098 \255\255\061\000\255\255\061\000\062\000\063\000\062\000\063\000\
6099 \063\000\063\000\063\000\063\000\255\255\255\255\255\255\064\000\
6100 \255\255\255\255\064\000\064\000\064\000\255\255\255\255\255\255\
6101 \064\000\064\000\255\255\064\000\064\000\064\000\255\255\255\255\
6102 \104\000\255\255\255\255\255\255\062\000\255\255\062\000\063\000\
6103 \064\000\063\000\064\000\064\000\064\000\064\000\064\000\255\255\
6104 \255\255\255\255\069\000\255\255\255\255\069\000\069\000\069\000\
6105 \255\255\255\255\255\255\069\000\069\000\255\255\069\000\069\000\
6106 \069\000\255\255\255\255\255\255\255\255\255\255\255\255\063\000\
6107 \255\255\063\000\064\000\069\000\064\000\069\000\069\000\069\000\
6108 \069\000\069\000\255\255\255\255\255\255\070\000\255\255\255\255\
6109 \070\000\070\000\070\000\255\255\255\255\255\255\070\000\070\000\
6110 \255\255\070\000\070\000\070\000\255\255\255\255\255\255\255\255\
6111 \255\255\255\255\064\000\255\255\064\000\069\000\070\000\069\000\
6112 \070\000\070\000\070\000\070\000\070\000\255\255\255\255\255\255\
6113 \071\000\255\255\255\255\071\000\071\000\071\000\255\255\255\255\
6114 \255\255\071\000\071\000\255\255\071\000\071\000\071\000\255\255\
6115 \255\255\255\255\255\255\255\255\255\255\069\000\255\255\069\000\
6116 \070\000\071\000\070\000\071\000\071\000\071\000\071\000\071\000\
6117 \255\255\255\255\255\255\075\000\255\255\255\255\075\000\075\000\
6118 \075\000\255\255\255\255\255\255\075\000\075\000\255\255\075\000\
6119 \075\000\075\000\255\255\255\255\255\255\255\255\255\255\255\255\
6120 \070\000\255\255\070\000\071\000\075\000\071\000\075\000\075\000\
6121 \075\000\075\000\075\000\255\255\255\255\255\255\076\000\255\255\
6122 \255\255\076\000\076\000\076\000\255\255\255\255\255\255\076\000\
6123 \076\000\255\255\076\000\076\000\076\000\255\255\255\255\255\255\
6124 \255\255\255\255\255\255\071\000\255\255\071\000\075\000\076\000\
6125 \075\000\076\000\076\000\076\000\076\000\076\000\255\255\255\255\
6126 \255\255\077\000\255\255\255\255\077\000\077\000\077\000\255\255\
6127 \255\255\255\255\077\000\077\000\255\255\077\000\077\000\077\000\
6128 \255\255\255\255\255\255\255\255\255\255\255\255\075\000\255\255\
6129 \075\000\076\000\077\000\076\000\077\000\077\000\077\000\077\000\
6130 \077\000\255\255\255\255\255\255\078\000\255\255\255\255\078\000\
6131 \078\000\078\000\255\255\255\255\255\255\078\000\078\000\255\255\
6132 \078\000\078\000\078\000\255\255\255\255\255\255\255\255\255\255\
6133 \255\255\076\000\255\255\076\000\077\000\078\000\077\000\078\000\
6134 \078\000\078\000\078\000\078\000\255\255\255\255\255\255\079\000\
6135 \255\255\255\255\079\000\079\000\079\000\255\255\255\255\255\255\
6136 \079\000\079\000\255\255\079\000\079\000\079\000\255\255\255\255\
6137 \255\255\099\000\255\255\255\255\077\000\255\255\077\000\078\000\
6138 \079\000\078\000\079\000\079\000\079\000\079\000\079\000\099\000\
6139 \099\000\099\000\099\000\099\000\099\000\099\000\099\000\099\000\
6140 \099\000\100\000\255\255\255\255\255\255\255\255\255\255\255\255\
6141 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\078\000\
6142 \255\255\078\000\079\000\255\255\079\000\255\255\255\255\255\255\
6143 \100\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6144 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6145 \100\000\100\000\100\000\100\000\100\000\100\000\100\000\100\000\
6146 \100\000\100\000\079\000\255\255\079\000\164\000\164\000\164\000\
6147 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6148 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6149 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\255\255\
6150 \255\255\255\255\255\255\164\000\255\255\164\000\164\000\164\000\
6151 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6152 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6153 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\255\255\
6154 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6155 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6156 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6157 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6158 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6159 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6160 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6161 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6162 \255\255\255\255\255\255\255\255\164\000\164\000\164\000\164\000\
6163 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6164 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6165 \164\000\164\000\164\000\255\255\164\000\164\000\164\000\164\000\
6166 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6167 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6168 \164\000\164\000\164\000\164\000\164\000\164\000\164\000\164\000\
6169 \164\000\164\000\164\000\166\000\164\000\164\000\164\000\164\000\
6170 \164\000\164\000\164\000\164\000\166\000\166\000\166\000\166\000\
6171 \166\000\166\000\166\000\166\000\166\000\166\000\255\255\255\255\
6172 \255\255\255\255\255\255\255\255\255\255\166\000\166\000\166\000\
6173 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6174 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6175 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\255\255\
6176 \255\255\255\255\255\255\166\000\255\255\166\000\166\000\166\000\
6177 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6178 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6179 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\255\255\
6180 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6181 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6182 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6183 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6184 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6185 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6186 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6187 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
6188 \255\255\255\255\255\255\255\255\166\000\166\000\166\000\166\000\
6189 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6190 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6191 \166\000\166\000\166\000\255\255\166\000\166\000\166\000\166\000\
6192 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6193 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6194 \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
6195 \166\000\166\000\166\000\255\255\166\000\166\000\166\000\166\000\
6196 \166\000\166\000\166\000\166\000\255\255";
6197 Lexing.lex_code =
6198 "\255\004\255\255\009\255\255\006\255\005\255\255\007\255\255\008\
6199 \255\255\000\007\255\000\006\001\008\255\000\005\255\011\255\010\
6200 \255\255\003\255\000\004\001\009\255\011\255\255\010\255\011\255\
6201 \255\000\004\001\009\003\010\002\011\255\001\255\255\000\001\255\
6205 let rec token c lexbuf =
6206 (lexbuf.Lexing.lex_mem <- Array.create 12 (-1);
6207 __ocaml_lex_token_rec c lexbuf 0)
6208 and __ocaml_lex_token_rec c lexbuf __ocaml_lex_state =
6209 match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state
6210 lexbuf
6211 with
6212 | 0 -> (update_loc c None 1 false 0; NEWLINE)
6213 | 1 ->
6214 let x =
6215 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6216 lexbuf.Lexing.lex_curr_pos
6217 in BLANKS x
6218 | 2 ->
6219 let x =
6220 Lexing.sub_lexeme lexbuf
6221 (lexbuf.Lexing.lex_start_pos + 1)
6222 (lexbuf.Lexing.lex_curr_pos + (-1))
6223 in LABEL x
6224 | 3 ->
6225 let x =
6226 Lexing.sub_lexeme lexbuf
6227 (lexbuf.Lexing.lex_start_pos + 1)
6228 (lexbuf.Lexing.lex_curr_pos + (-1))
6229 in OPTLABEL x
6230 | 4 ->
6231 let x =
6232 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6233 lexbuf.Lexing.lex_curr_pos
6234 in LIDENT x
6235 | 5 ->
6236 let x =
6237 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6238 lexbuf.Lexing.lex_curr_pos
6239 in UIDENT x
6240 | 6 ->
6241 let i =
6242 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6243 lexbuf.Lexing.lex_curr_pos
6245 (try INT (int_of_string i, i)
6246 with
6247 | Failure _ ->
6248 err (Literal_overflow "int") (Loc.of_lexbuf lexbuf))
6249 | 7 ->
6250 let f =
6251 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6252 lexbuf.Lexing.lex_curr_pos
6254 (try FLOAT (float_of_string f, f)
6255 with
6256 | Failure _ ->
6257 err (Literal_overflow "float")
6258 (Loc.of_lexbuf lexbuf))
6259 | 8 ->
6260 let i =
6261 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6262 (lexbuf.Lexing.lex_curr_pos + (-1))
6264 (try INT32 (Int32.of_string i, i)
6265 with
6266 | Failure _ ->
6267 err (Literal_overflow "int32")
6268 (Loc.of_lexbuf lexbuf))
6269 | 9 ->
6270 let i =
6271 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6272 (lexbuf.Lexing.lex_curr_pos + (-1))
6274 (try INT64 (Int64.of_string i, i)
6275 with
6276 | Failure _ ->
6277 err (Literal_overflow "int64")
6278 (Loc.of_lexbuf lexbuf))
6279 | 10 ->
6280 let i =
6281 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6282 (lexbuf.Lexing.lex_curr_pos + (-1))
6284 (try NATIVEINT (Nativeint.of_string i, i)
6285 with
6286 | Failure _ ->
6287 err (Literal_overflow "nativeint")
6288 (Loc.of_lexbuf lexbuf))
6289 | 11 ->
6290 (with_curr_loc string c;
6291 let s = buff_contents c in STRING (TokenEval.string s, s))
6292 | 12 ->
6293 let x =
6294 Lexing.sub_lexeme lexbuf
6295 (lexbuf.Lexing.lex_start_pos + 1)
6296 (lexbuf.Lexing.lex_curr_pos + (-1))
6298 (update_loc c None 1 false 1; CHAR (TokenEval.char x, x))
6299 | 13 ->
6300 let x =
6301 Lexing.sub_lexeme lexbuf
6302 (lexbuf.Lexing.lex_start_pos + 1)
6303 (lexbuf.Lexing.lex_curr_pos + (-1))
6304 in CHAR (TokenEval.char x, x)
6305 | 14 ->
6306 let c =
6307 Lexing.sub_lexeme_char lexbuf
6308 (lexbuf.Lexing.lex_start_pos + 2)
6310 err (Illegal_escape (String.make 1 c))
6311 (Loc.of_lexbuf lexbuf)
6312 | 15 ->
6313 (store c; COMMENT (parse_nested comment (in_comment c)))
6314 | 16 ->
6315 (warn Comment_start (Loc.of_lexbuf lexbuf);
6316 parse comment (in_comment c);
6317 COMMENT (buff_contents c))
6318 | 17 ->
6319 (warn Comment_not_end (Loc.of_lexbuf lexbuf);
6320 move_start_p (-1) c;
6321 SYMBOL "*")
6322 | 18 ->
6323 let beginning =
6324 Lexing.sub_lexeme lexbuf
6325 (lexbuf.Lexing.lex_start_pos + 2)
6326 lexbuf.Lexing.lex_curr_pos
6328 if quotations c
6329 then
6330 (move_start_p (- (String.length beginning));
6331 mk_quotation quotation c "" "" 2)
6332 else parse (symbolchar_star ("<<" ^ beginning)) c
6333 | 19 ->
6334 if quotations c
6335 then
6336 QUOTATION
6338 q_name = "";
6339 q_loc = "";
6340 q_shift = 2;
6341 q_contents = "";
6343 else parse (symbolchar_star "<<>>") c
6344 | 20 ->
6345 if quotations c
6346 then with_curr_loc maybe_quotation_at c
6347 else parse (symbolchar_star "<@") c
6348 | 21 ->
6349 if quotations c
6350 then with_curr_loc maybe_quotation_colon c
6351 else parse (symbolchar_star "<:") c
6352 | 22 ->
6353 let num =
6354 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0)
6355 lexbuf.Lexing.lex_mem.(1)
6356 and name =
6357 Lexing.sub_lexeme_opt lexbuf lexbuf.Lexing.lex_mem.(3)
6358 lexbuf.Lexing.lex_mem.(2) in
6359 let inum = int_of_string num
6361 (update_loc c name inum true 0;
6362 LINE_DIRECTIVE (inum, name))
6363 | 23 ->
6364 let op =
6365 Lexing.sub_lexeme_char lexbuf
6366 (lexbuf.Lexing.lex_start_pos + 1)
6367 in ESCAPED_IDENT (String.make 1 op)
6368 | 24 ->
6369 let op =
6370 Lexing.sub_lexeme lexbuf
6371 (lexbuf.Lexing.lex_start_pos + 1)
6372 (lexbuf.Lexing.lex_curr_pos + (-1))
6373 in ESCAPED_IDENT op
6374 | 25 ->
6375 let op =
6376 Lexing.sub_lexeme lexbuf
6377 (lexbuf.Lexing.lex_start_pos + 1)
6378 lexbuf.Lexing.lex_mem.(0)
6379 in ESCAPED_IDENT op
6380 | 26 ->
6381 let op =
6382 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0)
6383 (lexbuf.Lexing.lex_curr_pos + (-1))
6384 in ESCAPED_IDENT op
6385 | 27 ->
6386 let op =
6387 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0)
6388 lexbuf.Lexing.lex_mem.(1)
6389 in ESCAPED_IDENT op
6390 | 28 ->
6391 let x =
6392 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6393 lexbuf.Lexing.lex_curr_pos
6394 in SYMBOL x
6395 | 29 ->
6396 if antiquots c
6397 then with_curr_loc dollar (shift 1 c)
6398 else parse (symbolchar_star "$") c
6399 | 30 ->
6400 let x =
6401 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6402 lexbuf.Lexing.lex_curr_pos
6403 in SYMBOL x
6404 | 31 ->
6405 let pos = lexbuf.lex_curr_p
6407 (lexbuf.lex_curr_p <-
6409 (pos)
6410 with
6411 pos_bol = pos.pos_bol + 1;
6412 pos_cnum = pos.pos_cnum + 1;
6414 EOI)
6415 | 32 ->
6416 let c =
6417 Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos
6418 in err (Illegal_character c) (Loc.of_lexbuf lexbuf)
6419 | __ocaml_lex_state ->
6420 (lexbuf.Lexing.refill_buff lexbuf;
6421 __ocaml_lex_token_rec c lexbuf __ocaml_lex_state)
6422 and comment c lexbuf = __ocaml_lex_comment_rec c lexbuf 123
6423 and __ocaml_lex_comment_rec c lexbuf __ocaml_lex_state =
6424 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
6425 with
6426 | 0 -> (store c; with_curr_loc comment c; parse comment c)
6427 | 1 -> store c
6428 | 2 ->
6429 (store c;
6430 if quotations c then with_curr_loc quotation c else ();
6431 parse comment c)
6432 | 3 -> store_parse comment c
6433 | 4 ->
6434 (store c;
6435 (try with_curr_loc string c
6436 with
6437 | Loc.Exc_located (_, (Error.E Unterminated_string)) ->
6438 err Unterminated_string_in_comment (loc c));
6439 Buffer.add_char c.buffer '"';
6440 parse comment c)
6441 | 5 -> store_parse comment c
6442 | 6 -> store_parse comment c
6443 | 7 -> (update_loc c None 1 false 1; store_parse comment c)
6444 | 8 -> store_parse comment c
6445 | 9 -> store_parse comment c
6446 | 10 -> store_parse comment c
6447 | 11 -> store_parse comment c
6448 | 12 -> err Unterminated_comment (loc c)
6449 | 13 -> (update_loc c None 1 false 0; store_parse comment c)
6450 | 14 -> store_parse comment c
6451 | __ocaml_lex_state ->
6452 (lexbuf.Lexing.refill_buff lexbuf;
6453 __ocaml_lex_comment_rec c lexbuf __ocaml_lex_state)
6454 and string c lexbuf =
6455 (lexbuf.Lexing.lex_mem <- Array.create 2 (-1);
6456 __ocaml_lex_string_rec c lexbuf 150)
6457 and __ocaml_lex_string_rec c lexbuf __ocaml_lex_state =
6458 match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state
6459 lexbuf
6460 with
6461 | 0 -> set_start_p c
6462 | 1 ->
6463 let space =
6464 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0)
6465 lexbuf.Lexing.lex_curr_pos
6467 (update_loc c None 1 false (String.length space);
6468 store_parse string c)
6469 | 2 -> store_parse string c
6470 | 3 -> store_parse string c
6471 | 4 -> store_parse string c
6472 | 5 ->
6473 let x =
6474 Lexing.sub_lexeme_char lexbuf
6475 (lexbuf.Lexing.lex_start_pos + 1)
6477 if is_in_comment c
6478 then store_parse string c
6479 else
6480 (warn (Illegal_escape (String.make 1 x))
6481 (Loc.of_lexbuf lexbuf);
6482 store_parse string c)
6483 | 6 -> (update_loc c None 1 false 0; store_parse string c)
6484 | 7 -> err Unterminated_string (loc c)
6485 | 8 -> store_parse string c
6486 | __ocaml_lex_state ->
6487 (lexbuf.Lexing.refill_buff lexbuf;
6488 __ocaml_lex_string_rec c lexbuf __ocaml_lex_state)
6489 and symbolchar_star beginning c lexbuf =
6490 __ocaml_lex_symbolchar_star_rec beginning c lexbuf 160
6492 __ocaml_lex_symbolchar_star_rec beginning c lexbuf
6493 __ocaml_lex_state =
6494 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
6495 with
6496 | 0 ->
6497 let tok =
6498 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6499 lexbuf.Lexing.lex_curr_pos
6501 (move_start_p (- (String.length beginning)) c;
6502 SYMBOL (beginning ^ tok))
6503 | __ocaml_lex_state ->
6504 (lexbuf.Lexing.refill_buff lexbuf;
6505 __ocaml_lex_symbolchar_star_rec beginning c lexbuf
6506 __ocaml_lex_state)
6507 and maybe_quotation_at c lexbuf =
6508 __ocaml_lex_maybe_quotation_at_rec c lexbuf 161
6510 __ocaml_lex_maybe_quotation_at_rec c lexbuf __ocaml_lex_state =
6511 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
6512 with
6513 | 0 ->
6514 let loc =
6515 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6516 (lexbuf.Lexing.lex_curr_pos + (-1))
6518 mk_quotation quotation c "" loc (1 + (String.length loc))
6519 | 1 ->
6520 let tok =
6521 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6522 lexbuf.Lexing.lex_curr_pos
6523 in SYMBOL ("<@" ^ tok)
6524 | __ocaml_lex_state ->
6525 (lexbuf.Lexing.refill_buff lexbuf;
6526 __ocaml_lex_maybe_quotation_at_rec c lexbuf
6527 __ocaml_lex_state)
6528 and maybe_quotation_colon c lexbuf =
6529 (lexbuf.Lexing.lex_mem <- Array.create 2 (-1);
6530 __ocaml_lex_maybe_quotation_colon_rec c lexbuf 164)
6532 __ocaml_lex_maybe_quotation_colon_rec c lexbuf
6533 __ocaml_lex_state =
6534 match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state
6535 lexbuf
6536 with
6537 | 0 ->
6538 let name =
6539 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6540 (lexbuf.Lexing.lex_curr_pos + (-1))
6542 mk_quotation quotation c name ""
6543 (1 + (String.length name))
6544 | 1 ->
6545 let name =
6546 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6547 lexbuf.Lexing.lex_mem.(0)
6548 and loc =
6549 Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_mem.(0) + 1)
6550 (lexbuf.Lexing.lex_curr_pos + (-1))
6552 mk_quotation quotation c name loc
6553 ((2 + (String.length loc)) + (String.length name))
6554 | 2 ->
6555 let tok =
6556 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6557 lexbuf.Lexing.lex_curr_pos
6558 in SYMBOL ("<:" ^ tok)
6559 | __ocaml_lex_state ->
6560 (lexbuf.Lexing.refill_buff lexbuf;
6561 __ocaml_lex_maybe_quotation_colon_rec c lexbuf
6562 __ocaml_lex_state)
6563 and quotation c lexbuf = __ocaml_lex_quotation_rec c lexbuf 170
6564 and __ocaml_lex_quotation_rec c lexbuf __ocaml_lex_state =
6565 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
6566 with
6567 | 0 -> (store c; with_curr_loc quotation c; parse quotation c)
6568 | 1 -> store c
6569 | 2 -> err Unterminated_quotation (loc c)
6570 | 3 -> (update_loc c None 1 false 0; store_parse quotation c)
6571 | 4 -> store_parse quotation c
6572 | __ocaml_lex_state ->
6573 (lexbuf.Lexing.refill_buff lexbuf;
6574 __ocaml_lex_quotation_rec c lexbuf __ocaml_lex_state)
6575 and dollar c lexbuf = __ocaml_lex_dollar_rec c lexbuf 178
6576 and __ocaml_lex_dollar_rec c lexbuf __ocaml_lex_state =
6577 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
6578 with
6579 | 0 -> (set_start_p c; ANTIQUOT ("", ""))
6580 | 1 ->
6581 let name =
6582 Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos
6583 (lexbuf.Lexing.lex_curr_pos + (-1))
6585 with_curr_loc (antiquot name)
6586 (shift (1 + (String.length name)) c)
6587 | 2 -> store_parse (antiquot "") c
6588 | __ocaml_lex_state ->
6589 (lexbuf.Lexing.refill_buff lexbuf;
6590 __ocaml_lex_dollar_rec c lexbuf __ocaml_lex_state)
6591 and antiquot name c lexbuf =
6592 __ocaml_lex_antiquot_rec name c lexbuf 184
6593 and __ocaml_lex_antiquot_rec name c lexbuf __ocaml_lex_state =
6594 match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf
6595 with
6596 | 0 -> (set_start_p c; ANTIQUOT (name, buff_contents c))
6597 | 1 -> err Unterminated_antiquot (loc c)
6598 | 2 ->
6599 (update_loc c None 1 false 0;
6600 store_parse (antiquot name) c)
6601 | 3 ->
6602 (store c;
6603 with_curr_loc quotation c;
6604 parse (antiquot name) c)
6605 | 4 -> store_parse (antiquot name) c
6606 | __ocaml_lex_state ->
6607 (lexbuf.Lexing.refill_buff lexbuf;
6608 __ocaml_lex_antiquot_rec name c lexbuf __ocaml_lex_state)
6610 let lexing_store s buff max =
6611 let rec self n s =
6612 if n >= max
6613 then n
6614 else
6615 (match Stream.peek s with
6616 | Some x -> (Stream.junk s; buff.[n] <- x; succ n)
6617 | _ -> n)
6618 in self 0 s
6620 let from_context c =
6621 let next _ =
6622 let tok = with_curr_loc token c in
6623 let loc = Loc.of_lexbuf c.lexbuf in Some (tok, loc)
6624 in Stream.from next
6626 let from_lexbuf ?(quotations = true) lb =
6627 let c =
6629 (default_context lb)
6630 with
6631 loc = Loc.of_lexbuf lb;
6632 antiquots = !Camlp4_config.antiquotations;
6633 quotations = quotations;
6635 in from_context c
6637 let setup_loc lb loc =
6638 let start_pos = Loc.start_pos loc
6640 (lb.lex_abs_pos <- start_pos.pos_cnum;
6641 lb.lex_curr_p <- start_pos)
6643 let from_string ?quotations loc str =
6644 let lb = Lexing.from_string str
6645 in (setup_loc lb loc; from_lexbuf ?quotations lb)
6647 let from_stream ?quotations loc strm =
6648 let lb = Lexing.from_function (lexing_store strm)
6649 in (setup_loc lb loc; from_lexbuf ?quotations lb)
6651 let mk () loc strm =
6652 from_stream ~quotations: !Camlp4_config.quotations loc strm
6658 module Camlp4Ast =
6659 struct
6660 module Make (Loc : Sig.Loc) : Sig.Camlp4Ast with module Loc = Loc =
6661 struct
6662 module Loc = Loc
6664 module Ast =
6665 struct
6666 include Sig.MakeCamlp4Ast(Loc)
6668 let safe_string_escaped s =
6670 ((String.length s) > 2) &&
6671 ((s.[0] = '\\') && (s.[1] = '$'))
6672 then s
6673 else String.escaped s
6677 include Ast
6679 external loc_of_ctyp : ctyp -> Loc.t = "%field0"
6681 external loc_of_patt : patt -> Loc.t = "%field0"
6683 external loc_of_expr : expr -> Loc.t = "%field0"
6685 external loc_of_module_type : module_type -> Loc.t = "%field0"
6687 external loc_of_module_expr : module_expr -> Loc.t = "%field0"
6689 external loc_of_sig_item : sig_item -> Loc.t = "%field0"
6691 external loc_of_str_item : str_item -> Loc.t = "%field0"
6693 external loc_of_class_type : class_type -> Loc.t = "%field0"
6695 external loc_of_class_sig_item : class_sig_item -> Loc.t =
6696 "%field0"
6698 external loc_of_class_expr : class_expr -> Loc.t = "%field0"
6700 external loc_of_class_str_item : class_str_item -> Loc.t =
6701 "%field0"
6703 external loc_of_with_constr : with_constr -> Loc.t = "%field0"
6705 external loc_of_binding : binding -> Loc.t = "%field0"
6707 external loc_of_rec_binding : rec_binding -> Loc.t = "%field0"
6709 external loc_of_module_binding : module_binding -> Loc.t =
6710 "%field0"
6712 external loc_of_match_case : match_case -> Loc.t = "%field0"
6714 external loc_of_ident : ident -> Loc.t = "%field0"
6716 let ghost = Loc.ghost
6718 let rec is_module_longident =
6719 function
6720 | Ast.IdAcc (_, _, i) -> is_module_longident i
6721 | Ast.IdApp (_, i1, i2) ->
6722 (is_module_longident i1) && (is_module_longident i2)
6723 | Ast.IdUid (_, _) -> true
6724 | _ -> false
6726 let ident_of_expr =
6727 let error () =
6728 invalid_arg
6729 "ident_of_expr: this expression is not an identifier" in
6730 let rec self =
6731 function
6732 | Ast.ExApp (_loc, e1, e2) ->
6733 Ast.IdApp (_loc, self e1, self e2)
6734 | Ast.ExAcc (_loc, e1, e2) ->
6735 Ast.IdAcc (_loc, self e1, self e2)
6736 | Ast.ExId (_, (Ast.IdLid (_, _))) -> error ()
6737 | Ast.ExId (_, i) ->
6738 if is_module_longident i then i else error ()
6739 | _ -> error ()
6741 function
6742 | Ast.ExId (_, i) -> i
6743 | Ast.ExApp (_, _, _) -> error ()
6744 | t -> self t
6746 let ident_of_ctyp =
6747 let error () =
6748 invalid_arg "ident_of_ctyp: this type is not an identifier" in
6749 let rec self =
6750 function
6751 | Ast.TyApp (_loc, t1, t2) ->
6752 Ast.IdApp (_loc, self t1, self t2)
6753 | Ast.TyId (_, (Ast.IdLid (_, _))) -> error ()
6754 | Ast.TyId (_, i) ->
6755 if is_module_longident i then i else error ()
6756 | _ -> error ()
6757 in function | Ast.TyId (_, i) -> i | t -> self t
6759 let ident_of_patt =
6760 let error () =
6761 invalid_arg
6762 "ident_of_patt: this pattern is not an identifier" in
6763 let rec self =
6764 function
6765 | Ast.PaApp (_loc, p1, p2) ->
6766 Ast.IdApp (_loc, self p1, self p2)
6767 | Ast.PaId (_, (Ast.IdLid (_, _))) -> error ()
6768 | Ast.PaId (_, i) ->
6769 if is_module_longident i then i else error ()
6770 | _ -> error ()
6771 in function | Ast.PaId (_, i) -> i | p -> self p
6773 let rec is_irrefut_patt =
6774 function
6775 | Ast.PaId (_, (Ast.IdLid (_, _))) -> true
6776 | Ast.PaId (_, (Ast.IdUid (_, "()"))) -> true
6777 | Ast.PaAny _ -> true
6778 | Ast.PaAli (_, x, y) ->
6779 (is_irrefut_patt x) && (is_irrefut_patt y)
6780 | Ast.PaRec (_, p) -> is_irrefut_patt p
6781 | Ast.PaEq (_, _, p) -> is_irrefut_patt p
6782 | Ast.PaSem (_, p1, p2) ->
6783 (is_irrefut_patt p1) && (is_irrefut_patt p2)
6784 | Ast.PaCom (_, p1, p2) ->
6785 (is_irrefut_patt p1) && (is_irrefut_patt p2)
6786 | Ast.PaTyc (_, p, _) -> is_irrefut_patt p
6787 | Ast.PaTup (_, pl) -> is_irrefut_patt pl
6788 | Ast.PaOlb (_, _, (Ast.PaNil _)) -> true
6789 | Ast.PaOlb (_, _, p) -> is_irrefut_patt p
6790 | Ast.PaOlbi (_, _, p, _) -> is_irrefut_patt p
6791 | Ast.PaLab (_, _, (Ast.PaNil _)) -> true
6792 | Ast.PaLab (_, _, p) -> is_irrefut_patt p
6793 | _ -> false
6795 let rec is_constructor =
6796 function
6797 | Ast.IdAcc (_, _, i) -> is_constructor i
6798 | Ast.IdUid (_, _) -> true
6799 | Ast.IdLid (_, _) | Ast.IdApp (_, _, _) -> false
6800 | Ast.IdAnt (_, _) -> assert false
6802 let is_patt_constructor =
6803 function
6804 | Ast.PaId (_, i) -> is_constructor i
6805 | Ast.PaVrn (_, _) -> true
6806 | _ -> false
6808 let rec is_expr_constructor =
6809 function
6810 | Ast.ExId (_, i) -> is_constructor i
6811 | Ast.ExAcc (_, e1, e2) ->
6812 (is_expr_constructor e1) && (is_expr_constructor e2)
6813 | Ast.ExVrn (_, _) -> true
6814 | _ -> false
6816 let rec tyOr_of_list =
6817 function
6818 | [] -> Ast.TyNil ghost
6819 | [ t ] -> t
6820 | t :: ts ->
6821 let _loc = loc_of_ctyp t
6822 in Ast.TyOr (_loc, t, tyOr_of_list ts)
6824 let rec tyAnd_of_list =
6825 function
6826 | [] -> Ast.TyNil ghost
6827 | [ t ] -> t
6828 | t :: ts ->
6829 let _loc = loc_of_ctyp t
6830 in Ast.TyAnd (_loc, t, tyAnd_of_list ts)
6832 let rec tySem_of_list =
6833 function
6834 | [] -> Ast.TyNil ghost
6835 | [ t ] -> t
6836 | t :: ts ->
6837 let _loc = loc_of_ctyp t
6838 in Ast.TySem (_loc, t, tySem_of_list ts)
6840 let rec tyCom_of_list =
6841 function
6842 | [] -> Ast.TyNil ghost
6843 | [ t ] -> t
6844 | t :: ts ->
6845 let _loc = loc_of_ctyp t
6846 in Ast.TyCom (_loc, t, tyCom_of_list ts)
6848 let rec tyAmp_of_list =
6849 function
6850 | [] -> Ast.TyNil ghost
6851 | [ t ] -> t
6852 | t :: ts ->
6853 let _loc = loc_of_ctyp t
6854 in Ast.TyAmp (_loc, t, tyAmp_of_list ts)
6856 let rec tySta_of_list =
6857 function
6858 | [] -> Ast.TyNil ghost
6859 | [ t ] -> t
6860 | t :: ts ->
6861 let _loc = loc_of_ctyp t
6862 in Ast.TySta (_loc, t, tySta_of_list ts)
6864 let rec stSem_of_list =
6865 function
6866 | [] -> Ast.StNil ghost
6867 | [ t ] -> t
6868 | t :: ts ->
6869 let _loc = loc_of_str_item t
6870 in Ast.StSem (_loc, t, stSem_of_list ts)
6872 let rec sgSem_of_list =
6873 function
6874 | [] -> Ast.SgNil ghost
6875 | [ t ] -> t
6876 | t :: ts ->
6877 let _loc = loc_of_sig_item t
6878 in Ast.SgSem (_loc, t, sgSem_of_list ts)
6880 let rec biAnd_of_list =
6881 function
6882 | [] -> Ast.BiNil ghost
6883 | [ b ] -> b
6884 | b :: bs ->
6885 let _loc = loc_of_binding b
6886 in Ast.BiAnd (_loc, b, biAnd_of_list bs)
6888 let rec rbSem_of_list =
6889 function
6890 | [] -> Ast.RbNil ghost
6891 | [ b ] -> b
6892 | b :: bs ->
6893 let _loc = loc_of_rec_binding b
6894 in Ast.RbSem (_loc, b, rbSem_of_list bs)
6896 let rec wcAnd_of_list =
6897 function
6898 | [] -> Ast.WcNil ghost
6899 | [ w ] -> w
6900 | w :: ws ->
6901 let _loc = loc_of_with_constr w
6902 in Ast.WcAnd (_loc, w, wcAnd_of_list ws)
6904 let rec idAcc_of_list =
6905 function
6906 | [] -> assert false
6907 | [ i ] -> i
6908 | i :: is ->
6909 let _loc = loc_of_ident i
6910 in Ast.IdAcc (_loc, i, idAcc_of_list is)
6912 let rec idApp_of_list =
6913 function
6914 | [] -> assert false
6915 | [ i ] -> i
6916 | i :: is ->
6917 let _loc = loc_of_ident i
6918 in Ast.IdApp (_loc, i, idApp_of_list is)
6920 let rec mcOr_of_list =
6921 function
6922 | [] -> Ast.McNil ghost
6923 | [ x ] -> x
6924 | x :: xs ->
6925 let _loc = loc_of_match_case x
6926 in Ast.McOr (_loc, x, mcOr_of_list xs)
6928 let rec mbAnd_of_list =
6929 function
6930 | [] -> Ast.MbNil ghost
6931 | [ x ] -> x
6932 | x :: xs ->
6933 let _loc = loc_of_module_binding x
6934 in Ast.MbAnd (_loc, x, mbAnd_of_list xs)
6936 let rec meApp_of_list =
6937 function
6938 | [] -> assert false
6939 | [ x ] -> x
6940 | x :: xs ->
6941 let _loc = loc_of_module_expr x
6942 in Ast.MeApp (_loc, x, meApp_of_list xs)
6944 let rec ceAnd_of_list =
6945 function
6946 | [] -> Ast.CeNil ghost
6947 | [ x ] -> x
6948 | x :: xs ->
6949 let _loc = loc_of_class_expr x
6950 in Ast.CeAnd (_loc, x, ceAnd_of_list xs)
6952 let rec ctAnd_of_list =
6953 function
6954 | [] -> Ast.CtNil ghost
6955 | [ x ] -> x
6956 | x :: xs ->
6957 let _loc = loc_of_class_type x
6958 in Ast.CtAnd (_loc, x, ctAnd_of_list xs)
6960 let rec cgSem_of_list =
6961 function
6962 | [] -> Ast.CgNil ghost
6963 | [ x ] -> x
6964 | x :: xs ->
6965 let _loc = loc_of_class_sig_item x
6966 in Ast.CgSem (_loc, x, cgSem_of_list xs)
6968 let rec crSem_of_list =
6969 function
6970 | [] -> Ast.CrNil ghost
6971 | [ x ] -> x
6972 | x :: xs ->
6973 let _loc = loc_of_class_str_item x
6974 in Ast.CrSem (_loc, x, crSem_of_list xs)
6976 let rec paSem_of_list =
6977 function
6978 | [] -> Ast.PaNil ghost
6979 | [ x ] -> x
6980 | x :: xs ->
6981 let _loc = loc_of_patt x
6982 in Ast.PaSem (_loc, x, paSem_of_list xs)
6984 let rec paCom_of_list =
6985 function
6986 | [] -> Ast.PaNil ghost
6987 | [ x ] -> x
6988 | x :: xs ->
6989 let _loc = loc_of_patt x
6990 in Ast.PaCom (_loc, x, paCom_of_list xs)
6992 let rec exSem_of_list =
6993 function
6994 | [] -> Ast.ExNil ghost
6995 | [ x ] -> x
6996 | x :: xs ->
6997 let _loc = loc_of_expr x
6998 in Ast.ExSem (_loc, x, exSem_of_list xs)
7000 let rec exCom_of_list =
7001 function
7002 | [] -> Ast.ExNil ghost
7003 | [ x ] -> x
7004 | x :: xs ->
7005 let _loc = loc_of_expr x
7006 in Ast.ExCom (_loc, x, exCom_of_list xs)
7008 let ty_of_stl =
7009 function
7010 | (_loc, s, []) -> Ast.TyId (_loc, Ast.IdUid (_loc, s))
7011 | (_loc, s, tl) ->
7012 Ast.TyOf (_loc, Ast.TyId (_loc, Ast.IdUid (_loc, s)),
7013 tyAnd_of_list tl)
7015 let ty_of_sbt =
7016 function
7017 | (_loc, s, true, t) ->
7018 Ast.TyCol (_loc, Ast.TyId (_loc, Ast.IdLid (_loc, s)),
7019 Ast.TyMut (_loc, t))
7020 | (_loc, s, false, t) ->
7021 Ast.TyCol (_loc, Ast.TyId (_loc, Ast.IdLid (_loc, s)), t)
7023 let bi_of_pe (p, e) =
7024 let _loc = loc_of_patt p in Ast.BiEq (_loc, p, e)
7026 let sum_type_of_list l = tyOr_of_list (List.map ty_of_stl l)
7028 let record_type_of_list l = tySem_of_list (List.map ty_of_sbt l)
7030 let binding_of_pel l = biAnd_of_list (List.map bi_of_pe l)
7032 let rec pel_of_binding =
7033 function
7034 | Ast.BiAnd (_, b1, b2) ->
7035 (pel_of_binding b1) @ (pel_of_binding b2)
7036 | Ast.BiEq (_, p, e) -> [ (p, e) ]
7037 | _ -> assert false
7039 let rec list_of_binding x acc =
7040 match x with
7041 | Ast.BiAnd (_, b1, b2) ->
7042 list_of_binding b1 (list_of_binding b2 acc)
7043 | t -> t :: acc
7045 let rec list_of_rec_binding x acc =
7046 match x with
7047 | Ast.RbSem (_, b1, b2) ->
7048 list_of_rec_binding b1 (list_of_rec_binding b2 acc)
7049 | t -> t :: acc
7051 let rec list_of_with_constr x acc =
7052 match x with
7053 | Ast.WcAnd (_, w1, w2) ->
7054 list_of_with_constr w1 (list_of_with_constr w2 acc)
7055 | t -> t :: acc
7057 let rec list_of_ctyp x acc =
7058 match x with
7059 | Ast.TyNil _ -> acc
7060 | Ast.TyAmp (_, x, y) | Ast.TyCom (_, x, y) |
7061 Ast.TySta (_, x, y) | Ast.TySem (_, x, y) |
7062 Ast.TyAnd (_, x, y) | Ast.TyOr (_, x, y) ->
7063 list_of_ctyp x (list_of_ctyp y acc)
7064 | x -> x :: acc
7066 let rec list_of_patt x acc =
7067 match x with
7068 | Ast.PaNil _ -> acc
7069 | Ast.PaCom (_, x, y) | Ast.PaSem (_, x, y) ->
7070 list_of_patt x (list_of_patt y acc)
7071 | x -> x :: acc
7073 let rec list_of_expr x acc =
7074 match x with
7075 | Ast.ExNil _ -> acc
7076 | Ast.ExCom (_, x, y) | Ast.ExSem (_, x, y) ->
7077 list_of_expr x (list_of_expr y acc)
7078 | x -> x :: acc
7080 let rec list_of_str_item x acc =
7081 match x with
7082 | Ast.StNil _ -> acc
7083 | Ast.StSem (_, x, y) ->
7084 list_of_str_item x (list_of_str_item y acc)
7085 | x -> x :: acc
7087 let rec list_of_sig_item x acc =
7088 match x with
7089 | Ast.SgNil _ -> acc
7090 | Ast.SgSem (_, x, y) ->
7091 list_of_sig_item x (list_of_sig_item y acc)
7092 | x -> x :: acc
7094 let rec list_of_class_sig_item x acc =
7095 match x with
7096 | Ast.CgNil _ -> acc
7097 | Ast.CgSem (_, x, y) ->
7098 list_of_class_sig_item x (list_of_class_sig_item y acc)
7099 | x -> x :: acc
7101 let rec list_of_class_str_item x acc =
7102 match x with
7103 | Ast.CrNil _ -> acc
7104 | Ast.CrSem (_, x, y) ->
7105 list_of_class_str_item x (list_of_class_str_item y acc)
7106 | x -> x :: acc
7108 let rec list_of_class_type x acc =
7109 match x with
7110 | Ast.CtAnd (_, x, y) ->
7111 list_of_class_type x (list_of_class_type y acc)
7112 | x -> x :: acc
7114 let rec list_of_class_expr x acc =
7115 match x with
7116 | Ast.CeAnd (_, x, y) ->
7117 list_of_class_expr x (list_of_class_expr y acc)
7118 | x -> x :: acc
7120 let rec list_of_module_expr x acc =
7121 match x with
7122 | Ast.MeApp (_, x, y) ->
7123 list_of_module_expr x (list_of_module_expr y acc)
7124 | x -> x :: acc
7126 let rec list_of_match_case x acc =
7127 match x with
7128 | Ast.McNil _ -> acc
7129 | Ast.McOr (_, x, y) ->
7130 list_of_match_case x (list_of_match_case y acc)
7131 | x -> x :: acc
7133 let rec list_of_ident x acc =
7134 match x with
7135 | Ast.IdAcc (_, x, y) | Ast.IdApp (_, x, y) ->
7136 list_of_ident x (list_of_ident y acc)
7137 | x -> x :: acc
7139 let rec list_of_module_binding x acc =
7140 match x with
7141 | Ast.MbAnd (_, x, y) ->
7142 list_of_module_binding x (list_of_module_binding y acc)
7143 | x -> x :: acc
7145 module Meta =
7146 struct
7147 module type META_LOC =
7149 val meta_loc_patt : Loc.t -> Loc.t -> Ast.patt
7151 val meta_loc_expr : Loc.t -> Loc.t -> Ast.expr
7155 module MetaLoc =
7156 struct
7157 let meta_loc_patt _loc location =
7158 let (a, b, c, d, e, f, g, h) = Loc.to_tuple location
7160 Ast.PaApp (_loc,
7161 Ast.PaId (_loc,
7162 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
7163 Ast.IdLid (_loc, "of_tuple"))),
7164 Ast.PaTup (_loc,
7165 Ast.PaCom (_loc,
7166 Ast.PaStr (_loc, Ast.safe_string_escaped a),
7167 Ast.PaCom (_loc,
7168 Ast.PaCom (_loc,
7169 Ast.PaCom (_loc,
7170 Ast.PaCom (_loc,
7171 Ast.PaCom (_loc,
7172 Ast.PaCom (_loc,
7173 Ast.PaInt (_loc, string_of_int b),
7174 Ast.PaInt (_loc, string_of_int c)),
7175 Ast.PaInt (_loc, string_of_int d)),
7176 Ast.PaInt (_loc, string_of_int e)),
7177 Ast.PaInt (_loc, string_of_int f)),
7178 Ast.PaInt (_loc, string_of_int g)),
7179 if h
7180 then
7181 Ast.PaId (_loc, Ast.IdUid (_loc, "True"))
7182 else
7183 Ast.PaId (_loc, Ast.IdUid (_loc, "False"))))))
7185 let meta_loc_expr _loc location =
7186 let (a, b, c, d, e, f, g, h) = Loc.to_tuple location
7188 Ast.ExApp (_loc,
7189 Ast.ExId (_loc,
7190 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
7191 Ast.IdLid (_loc, "of_tuple"))),
7192 Ast.ExTup (_loc,
7193 Ast.ExCom (_loc,
7194 Ast.ExStr (_loc, Ast.safe_string_escaped a),
7195 Ast.ExCom (_loc,
7196 Ast.ExCom (_loc,
7197 Ast.ExCom (_loc,
7198 Ast.ExCom (_loc,
7199 Ast.ExCom (_loc,
7200 Ast.ExCom (_loc,
7201 Ast.ExInt (_loc, string_of_int b),
7202 Ast.ExInt (_loc, string_of_int c)),
7203 Ast.ExInt (_loc, string_of_int d)),
7204 Ast.ExInt (_loc, string_of_int e)),
7205 Ast.ExInt (_loc, string_of_int f)),
7206 Ast.ExInt (_loc, string_of_int g)),
7207 if h
7208 then
7209 Ast.ExId (_loc, Ast.IdUid (_loc, "True"))
7210 else
7211 Ast.ExId (_loc, Ast.IdUid (_loc, "False"))))))
7215 module MetaGhostLoc =
7216 struct
7217 let meta_loc_patt _loc _ =
7218 Ast.PaId (_loc,
7219 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
7220 Ast.IdLid (_loc, "ghost")))
7222 let meta_loc_expr _loc _ =
7223 Ast.ExId (_loc,
7224 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Loc"),
7225 Ast.IdLid (_loc, "ghost")))
7229 module MetaLocVar =
7230 struct
7231 let meta_loc_patt _loc _ =
7232 Ast.PaId (_loc, Ast.IdLid (_loc, !Loc.name))
7234 let meta_loc_expr _loc _ =
7235 Ast.ExId (_loc, Ast.IdLid (_loc, !Loc.name))
7239 module Make (MetaLoc : META_LOC) =
7240 struct
7241 open MetaLoc
7243 let meta_loc = meta_loc_expr
7245 module Expr =
7246 struct
7247 let meta_string _loc s = Ast.ExStr (_loc, s)
7249 let meta_int _loc s = Ast.ExInt (_loc, s)
7251 let meta_float _loc s = Ast.ExFlo (_loc, s)
7253 let meta_char _loc s = Ast.ExChr (_loc, s)
7255 let meta_bool _loc =
7256 function
7257 | false ->
7258 Ast.ExId (_loc, Ast.IdUid (_loc, "False"))
7259 | true -> Ast.ExId (_loc, Ast.IdUid (_loc, "True"))
7261 let rec meta_list mf_a _loc =
7262 function
7263 | [] -> Ast.ExId (_loc, Ast.IdUid (_loc, "[]"))
7264 | x :: xs ->
7265 Ast.ExApp (_loc,
7266 Ast.ExApp (_loc,
7267 Ast.ExId (_loc, Ast.IdUid (_loc, "::")),
7268 mf_a _loc x),
7269 meta_list mf_a _loc xs)
7271 let rec meta_binding _loc =
7272 function
7273 | Ast.BiAnt (x0, x1) -> Ast.ExAnt (x0, x1)
7274 | Ast.BiEq (x0, x1, x2) ->
7275 Ast.ExApp (_loc,
7276 Ast.ExApp (_loc,
7277 Ast.ExApp (_loc,
7278 Ast.ExId (_loc,
7279 Ast.IdAcc (_loc,
7280 Ast.IdUid (_loc, "Ast"),
7281 Ast.IdUid (_loc, "BiEq"))),
7282 meta_loc _loc x0),
7283 meta_patt _loc x1),
7284 meta_expr _loc x2)
7285 | Ast.BiAnd (x0, x1, x2) ->
7286 Ast.ExApp (_loc,
7287 Ast.ExApp (_loc,
7288 Ast.ExApp (_loc,
7289 Ast.ExId (_loc,
7290 Ast.IdAcc (_loc,
7291 Ast.IdUid (_loc, "Ast"),
7292 Ast.IdUid (_loc, "BiAnd"))),
7293 meta_loc _loc x0),
7294 meta_binding _loc x1),
7295 meta_binding _loc x2)
7296 | Ast.BiNil x0 ->
7297 Ast.ExApp (_loc,
7298 Ast.ExId (_loc,
7299 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7300 Ast.IdUid (_loc, "BiNil"))),
7301 meta_loc _loc x0)
7302 and meta_class_expr _loc =
7303 function
7304 | Ast.CeAnt (x0, x1) -> Ast.ExAnt (x0, x1)
7305 | Ast.CeEq (x0, x1, x2) ->
7306 Ast.ExApp (_loc,
7307 Ast.ExApp (_loc,
7308 Ast.ExApp (_loc,
7309 Ast.ExId (_loc,
7310 Ast.IdAcc (_loc,
7311 Ast.IdUid (_loc, "Ast"),
7312 Ast.IdUid (_loc, "CeEq"))),
7313 meta_loc _loc x0),
7314 meta_class_expr _loc x1),
7315 meta_class_expr _loc x2)
7316 | Ast.CeAnd (x0, x1, x2) ->
7317 Ast.ExApp (_loc,
7318 Ast.ExApp (_loc,
7319 Ast.ExApp (_loc,
7320 Ast.ExId (_loc,
7321 Ast.IdAcc (_loc,
7322 Ast.IdUid (_loc, "Ast"),
7323 Ast.IdUid (_loc, "CeAnd"))),
7324 meta_loc _loc x0),
7325 meta_class_expr _loc x1),
7326 meta_class_expr _loc x2)
7327 | Ast.CeTyc (x0, x1, x2) ->
7328 Ast.ExApp (_loc,
7329 Ast.ExApp (_loc,
7330 Ast.ExApp (_loc,
7331 Ast.ExId (_loc,
7332 Ast.IdAcc (_loc,
7333 Ast.IdUid (_loc, "Ast"),
7334 Ast.IdUid (_loc, "CeTyc"))),
7335 meta_loc _loc x0),
7336 meta_class_expr _loc x1),
7337 meta_class_type _loc x2)
7338 | Ast.CeStr (x0, x1, x2) ->
7339 Ast.ExApp (_loc,
7340 Ast.ExApp (_loc,
7341 Ast.ExApp (_loc,
7342 Ast.ExId (_loc,
7343 Ast.IdAcc (_loc,
7344 Ast.IdUid (_loc, "Ast"),
7345 Ast.IdUid (_loc, "CeStr"))),
7346 meta_loc _loc x0),
7347 meta_patt _loc x1),
7348 meta_class_str_item _loc x2)
7349 | Ast.CeLet (x0, x1, x2, x3) ->
7350 Ast.ExApp (_loc,
7351 Ast.ExApp (_loc,
7352 Ast.ExApp (_loc,
7353 Ast.ExApp (_loc,
7354 Ast.ExId (_loc,
7355 Ast.IdAcc (_loc,
7356 Ast.IdUid (_loc, "Ast"),
7357 Ast.IdUid (_loc, "CeLet"))),
7358 meta_loc _loc x0),
7359 meta_meta_bool _loc x1),
7360 meta_binding _loc x2),
7361 meta_class_expr _loc x3)
7362 | Ast.CeFun (x0, x1, x2) ->
7363 Ast.ExApp (_loc,
7364 Ast.ExApp (_loc,
7365 Ast.ExApp (_loc,
7366 Ast.ExId (_loc,
7367 Ast.IdAcc (_loc,
7368 Ast.IdUid (_loc, "Ast"),
7369 Ast.IdUid (_loc, "CeFun"))),
7370 meta_loc _loc x0),
7371 meta_patt _loc x1),
7372 meta_class_expr _loc x2)
7373 | Ast.CeCon (x0, x1, x2, x3) ->
7374 Ast.ExApp (_loc,
7375 Ast.ExApp (_loc,
7376 Ast.ExApp (_loc,
7377 Ast.ExApp (_loc,
7378 Ast.ExId (_loc,
7379 Ast.IdAcc (_loc,
7380 Ast.IdUid (_loc, "Ast"),
7381 Ast.IdUid (_loc, "CeCon"))),
7382 meta_loc _loc x0),
7383 meta_meta_bool _loc x1),
7384 meta_ident _loc x2),
7385 meta_ctyp _loc x3)
7386 | Ast.CeApp (x0, x1, x2) ->
7387 Ast.ExApp (_loc,
7388 Ast.ExApp (_loc,
7389 Ast.ExApp (_loc,
7390 Ast.ExId (_loc,
7391 Ast.IdAcc (_loc,
7392 Ast.IdUid (_loc, "Ast"),
7393 Ast.IdUid (_loc, "CeApp"))),
7394 meta_loc _loc x0),
7395 meta_class_expr _loc x1),
7396 meta_expr _loc x2)
7397 | Ast.CeNil x0 ->
7398 Ast.ExApp (_loc,
7399 Ast.ExId (_loc,
7400 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7401 Ast.IdUid (_loc, "CeNil"))),
7402 meta_loc _loc x0)
7403 and meta_class_sig_item _loc =
7404 function
7405 | Ast.CgAnt (x0, x1) -> Ast.ExAnt (x0, x1)
7406 | Ast.CgVir (x0, x1, x2, x3) ->
7407 Ast.ExApp (_loc,
7408 Ast.ExApp (_loc,
7409 Ast.ExApp (_loc,
7410 Ast.ExApp (_loc,
7411 Ast.ExId (_loc,
7412 Ast.IdAcc (_loc,
7413 Ast.IdUid (_loc, "Ast"),
7414 Ast.IdUid (_loc, "CgVir"))),
7415 meta_loc _loc x0),
7416 meta_string _loc x1),
7417 meta_meta_bool _loc x2),
7418 meta_ctyp _loc x3)
7419 | Ast.CgVal (x0, x1, x2, x3, x4) ->
7420 Ast.ExApp (_loc,
7421 Ast.ExApp (_loc,
7422 Ast.ExApp (_loc,
7423 Ast.ExApp (_loc,
7424 Ast.ExApp (_loc,
7425 Ast.ExId (_loc,
7426 Ast.IdAcc (_loc,
7427 Ast.IdUid (_loc, "Ast"),
7428 Ast.IdUid (_loc, "CgVal"))),
7429 meta_loc _loc x0),
7430 meta_string _loc x1),
7431 meta_meta_bool _loc x2),
7432 meta_meta_bool _loc x3),
7433 meta_ctyp _loc x4)
7434 | Ast.CgMth (x0, x1, x2, x3) ->
7435 Ast.ExApp (_loc,
7436 Ast.ExApp (_loc,
7437 Ast.ExApp (_loc,
7438 Ast.ExApp (_loc,
7439 Ast.ExId (_loc,
7440 Ast.IdAcc (_loc,
7441 Ast.IdUid (_loc, "Ast"),
7442 Ast.IdUid (_loc, "CgMth"))),
7443 meta_loc _loc x0),
7444 meta_string _loc x1),
7445 meta_meta_bool _loc x2),
7446 meta_ctyp _loc x3)
7447 | Ast.CgInh (x0, x1) ->
7448 Ast.ExApp (_loc,
7449 Ast.ExApp (_loc,
7450 Ast.ExId (_loc,
7451 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7452 Ast.IdUid (_loc, "CgInh"))),
7453 meta_loc _loc x0),
7454 meta_class_type _loc x1)
7455 | Ast.CgSem (x0, x1, x2) ->
7456 Ast.ExApp (_loc,
7457 Ast.ExApp (_loc,
7458 Ast.ExApp (_loc,
7459 Ast.ExId (_loc,
7460 Ast.IdAcc (_loc,
7461 Ast.IdUid (_loc, "Ast"),
7462 Ast.IdUid (_loc, "CgSem"))),
7463 meta_loc _loc x0),
7464 meta_class_sig_item _loc x1),
7465 meta_class_sig_item _loc x2)
7466 | Ast.CgCtr (x0, x1, x2) ->
7467 Ast.ExApp (_loc,
7468 Ast.ExApp (_loc,
7469 Ast.ExApp (_loc,
7470 Ast.ExId (_loc,
7471 Ast.IdAcc (_loc,
7472 Ast.IdUid (_loc, "Ast"),
7473 Ast.IdUid (_loc, "CgCtr"))),
7474 meta_loc _loc x0),
7475 meta_ctyp _loc x1),
7476 meta_ctyp _loc x2)
7477 | Ast.CgNil x0 ->
7478 Ast.ExApp (_loc,
7479 Ast.ExId (_loc,
7480 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7481 Ast.IdUid (_loc, "CgNil"))),
7482 meta_loc _loc x0)
7483 and meta_class_str_item _loc =
7484 function
7485 | Ast.CrAnt (x0, x1) -> Ast.ExAnt (x0, x1)
7486 | Ast.CrVvr (x0, x1, x2, x3) ->
7487 Ast.ExApp (_loc,
7488 Ast.ExApp (_loc,
7489 Ast.ExApp (_loc,
7490 Ast.ExApp (_loc,
7491 Ast.ExId (_loc,
7492 Ast.IdAcc (_loc,
7493 Ast.IdUid (_loc, "Ast"),
7494 Ast.IdUid (_loc, "CrVvr"))),
7495 meta_loc _loc x0),
7496 meta_string _loc x1),
7497 meta_meta_bool _loc x2),
7498 meta_ctyp _loc x3)
7499 | Ast.CrVir (x0, x1, x2, x3) ->
7500 Ast.ExApp (_loc,
7501 Ast.ExApp (_loc,
7502 Ast.ExApp (_loc,
7503 Ast.ExApp (_loc,
7504 Ast.ExId (_loc,
7505 Ast.IdAcc (_loc,
7506 Ast.IdUid (_loc, "Ast"),
7507 Ast.IdUid (_loc, "CrVir"))),
7508 meta_loc _loc x0),
7509 meta_string _loc x1),
7510 meta_meta_bool _loc x2),
7511 meta_ctyp _loc x3)
7512 | Ast.CrVal (x0, x1, x2, x3) ->
7513 Ast.ExApp (_loc,
7514 Ast.ExApp (_loc,
7515 Ast.ExApp (_loc,
7516 Ast.ExApp (_loc,
7517 Ast.ExId (_loc,
7518 Ast.IdAcc (_loc,
7519 Ast.IdUid (_loc, "Ast"),
7520 Ast.IdUid (_loc, "CrVal"))),
7521 meta_loc _loc x0),
7522 meta_string _loc x1),
7523 meta_meta_bool _loc x2),
7524 meta_expr _loc x3)
7525 | Ast.CrMth (x0, x1, x2, x3, x4) ->
7526 Ast.ExApp (_loc,
7527 Ast.ExApp (_loc,
7528 Ast.ExApp (_loc,
7529 Ast.ExApp (_loc,
7530 Ast.ExApp (_loc,
7531 Ast.ExId (_loc,
7532 Ast.IdAcc (_loc,
7533 Ast.IdUid (_loc, "Ast"),
7534 Ast.IdUid (_loc, "CrMth"))),
7535 meta_loc _loc x0),
7536 meta_string _loc x1),
7537 meta_meta_bool _loc x2),
7538 meta_expr _loc x3),
7539 meta_ctyp _loc x4)
7540 | Ast.CrIni (x0, x1) ->
7541 Ast.ExApp (_loc,
7542 Ast.ExApp (_loc,
7543 Ast.ExId (_loc,
7544 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7545 Ast.IdUid (_loc, "CrIni"))),
7546 meta_loc _loc x0),
7547 meta_expr _loc x1)
7548 | Ast.CrInh (x0, x1, x2) ->
7549 Ast.ExApp (_loc,
7550 Ast.ExApp (_loc,
7551 Ast.ExApp (_loc,
7552 Ast.ExId (_loc,
7553 Ast.IdAcc (_loc,
7554 Ast.IdUid (_loc, "Ast"),
7555 Ast.IdUid (_loc, "CrInh"))),
7556 meta_loc _loc x0),
7557 meta_class_expr _loc x1),
7558 meta_string _loc x2)
7559 | Ast.CrCtr (x0, x1, x2) ->
7560 Ast.ExApp (_loc,
7561 Ast.ExApp (_loc,
7562 Ast.ExApp (_loc,
7563 Ast.ExId (_loc,
7564 Ast.IdAcc (_loc,
7565 Ast.IdUid (_loc, "Ast"),
7566 Ast.IdUid (_loc, "CrCtr"))),
7567 meta_loc _loc x0),
7568 meta_ctyp _loc x1),
7569 meta_ctyp _loc x2)
7570 | Ast.CrSem (x0, x1, x2) ->
7571 Ast.ExApp (_loc,
7572 Ast.ExApp (_loc,
7573 Ast.ExApp (_loc,
7574 Ast.ExId (_loc,
7575 Ast.IdAcc (_loc,
7576 Ast.IdUid (_loc, "Ast"),
7577 Ast.IdUid (_loc, "CrSem"))),
7578 meta_loc _loc x0),
7579 meta_class_str_item _loc x1),
7580 meta_class_str_item _loc x2)
7581 | Ast.CrNil x0 ->
7582 Ast.ExApp (_loc,
7583 Ast.ExId (_loc,
7584 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7585 Ast.IdUid (_loc, "CrNil"))),
7586 meta_loc _loc x0)
7587 and meta_class_type _loc =
7588 function
7589 | Ast.CtAnt (x0, x1) -> Ast.ExAnt (x0, x1)
7590 | Ast.CtEq (x0, x1, x2) ->
7591 Ast.ExApp (_loc,
7592 Ast.ExApp (_loc,
7593 Ast.ExApp (_loc,
7594 Ast.ExId (_loc,
7595 Ast.IdAcc (_loc,
7596 Ast.IdUid (_loc, "Ast"),
7597 Ast.IdUid (_loc, "CtEq"))),
7598 meta_loc _loc x0),
7599 meta_class_type _loc x1),
7600 meta_class_type _loc x2)
7601 | Ast.CtCol (x0, x1, x2) ->
7602 Ast.ExApp (_loc,
7603 Ast.ExApp (_loc,
7604 Ast.ExApp (_loc,
7605 Ast.ExId (_loc,
7606 Ast.IdAcc (_loc,
7607 Ast.IdUid (_loc, "Ast"),
7608 Ast.IdUid (_loc, "CtCol"))),
7609 meta_loc _loc x0),
7610 meta_class_type _loc x1),
7611 meta_class_type _loc x2)
7612 | Ast.CtAnd (x0, x1, x2) ->
7613 Ast.ExApp (_loc,
7614 Ast.ExApp (_loc,
7615 Ast.ExApp (_loc,
7616 Ast.ExId (_loc,
7617 Ast.IdAcc (_loc,
7618 Ast.IdUid (_loc, "Ast"),
7619 Ast.IdUid (_loc, "CtAnd"))),
7620 meta_loc _loc x0),
7621 meta_class_type _loc x1),
7622 meta_class_type _loc x2)
7623 | Ast.CtSig (x0, x1, x2) ->
7624 Ast.ExApp (_loc,
7625 Ast.ExApp (_loc,
7626 Ast.ExApp (_loc,
7627 Ast.ExId (_loc,
7628 Ast.IdAcc (_loc,
7629 Ast.IdUid (_loc, "Ast"),
7630 Ast.IdUid (_loc, "CtSig"))),
7631 meta_loc _loc x0),
7632 meta_ctyp _loc x1),
7633 meta_class_sig_item _loc x2)
7634 | Ast.CtFun (x0, x1, x2) ->
7635 Ast.ExApp (_loc,
7636 Ast.ExApp (_loc,
7637 Ast.ExApp (_loc,
7638 Ast.ExId (_loc,
7639 Ast.IdAcc (_loc,
7640 Ast.IdUid (_loc, "Ast"),
7641 Ast.IdUid (_loc, "CtFun"))),
7642 meta_loc _loc x0),
7643 meta_ctyp _loc x1),
7644 meta_class_type _loc x2)
7645 | Ast.CtCon (x0, x1, x2, x3) ->
7646 Ast.ExApp (_loc,
7647 Ast.ExApp (_loc,
7648 Ast.ExApp (_loc,
7649 Ast.ExApp (_loc,
7650 Ast.ExId (_loc,
7651 Ast.IdAcc (_loc,
7652 Ast.IdUid (_loc, "Ast"),
7653 Ast.IdUid (_loc, "CtCon"))),
7654 meta_loc _loc x0),
7655 meta_meta_bool _loc x1),
7656 meta_ident _loc x2),
7657 meta_ctyp _loc x3)
7658 | Ast.CtNil x0 ->
7659 Ast.ExApp (_loc,
7660 Ast.ExId (_loc,
7661 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7662 Ast.IdUid (_loc, "CtNil"))),
7663 meta_loc _loc x0)
7664 and meta_ctyp _loc =
7665 function
7666 | Ast.TyAnt (x0, x1) -> Ast.ExAnt (x0, x1)
7667 | Ast.TyOfAmp (x0, x1, x2) ->
7668 Ast.ExApp (_loc,
7669 Ast.ExApp (_loc,
7670 Ast.ExApp (_loc,
7671 Ast.ExId (_loc,
7672 Ast.IdAcc (_loc,
7673 Ast.IdUid (_loc, "Ast"),
7674 Ast.IdUid (_loc, "TyOfAmp"))),
7675 meta_loc _loc x0),
7676 meta_ctyp _loc x1),
7677 meta_ctyp _loc x2)
7678 | Ast.TyAmp (x0, x1, x2) ->
7679 Ast.ExApp (_loc,
7680 Ast.ExApp (_loc,
7681 Ast.ExApp (_loc,
7682 Ast.ExId (_loc,
7683 Ast.IdAcc (_loc,
7684 Ast.IdUid (_loc, "Ast"),
7685 Ast.IdUid (_loc, "TyAmp"))),
7686 meta_loc _loc x0),
7687 meta_ctyp _loc x1),
7688 meta_ctyp _loc x2)
7689 | Ast.TyVrnInfSup (x0, x1, x2) ->
7690 Ast.ExApp (_loc,
7691 Ast.ExApp (_loc,
7692 Ast.ExApp (_loc,
7693 Ast.ExId (_loc,
7694 Ast.IdAcc (_loc,
7695 Ast.IdUid (_loc, "Ast"),
7696 Ast.IdUid (_loc, "TyVrnInfSup"))),
7697 meta_loc _loc x0),
7698 meta_ctyp _loc x1),
7699 meta_ctyp _loc x2)
7700 | Ast.TyVrnInf (x0, x1) ->
7701 Ast.ExApp (_loc,
7702 Ast.ExApp (_loc,
7703 Ast.ExId (_loc,
7704 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7705 Ast.IdUid (_loc, "TyVrnInf"))),
7706 meta_loc _loc x0),
7707 meta_ctyp _loc x1)
7708 | Ast.TyVrnSup (x0, x1) ->
7709 Ast.ExApp (_loc,
7710 Ast.ExApp (_loc,
7711 Ast.ExId (_loc,
7712 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7713 Ast.IdUid (_loc, "TyVrnSup"))),
7714 meta_loc _loc x0),
7715 meta_ctyp _loc x1)
7716 | Ast.TyVrnEq (x0, x1) ->
7717 Ast.ExApp (_loc,
7718 Ast.ExApp (_loc,
7719 Ast.ExId (_loc,
7720 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7721 Ast.IdUid (_loc, "TyVrnEq"))),
7722 meta_loc _loc x0),
7723 meta_ctyp _loc x1)
7724 | Ast.TySta (x0, x1, x2) ->
7725 Ast.ExApp (_loc,
7726 Ast.ExApp (_loc,
7727 Ast.ExApp (_loc,
7728 Ast.ExId (_loc,
7729 Ast.IdAcc (_loc,
7730 Ast.IdUid (_loc, "Ast"),
7731 Ast.IdUid (_loc, "TySta"))),
7732 meta_loc _loc x0),
7733 meta_ctyp _loc x1),
7734 meta_ctyp _loc x2)
7735 | Ast.TyTup (x0, x1) ->
7736 Ast.ExApp (_loc,
7737 Ast.ExApp (_loc,
7738 Ast.ExId (_loc,
7739 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7740 Ast.IdUid (_loc, "TyTup"))),
7741 meta_loc _loc x0),
7742 meta_ctyp _loc x1)
7743 | Ast.TyMut (x0, x1) ->
7744 Ast.ExApp (_loc,
7745 Ast.ExApp (_loc,
7746 Ast.ExId (_loc,
7747 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7748 Ast.IdUid (_loc, "TyMut"))),
7749 meta_loc _loc x0),
7750 meta_ctyp _loc x1)
7751 | Ast.TyPrv (x0, x1) ->
7752 Ast.ExApp (_loc,
7753 Ast.ExApp (_loc,
7754 Ast.ExId (_loc,
7755 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7756 Ast.IdUid (_loc, "TyPrv"))),
7757 meta_loc _loc x0),
7758 meta_ctyp _loc x1)
7759 | Ast.TyOr (x0, x1, x2) ->
7760 Ast.ExApp (_loc,
7761 Ast.ExApp (_loc,
7762 Ast.ExApp (_loc,
7763 Ast.ExId (_loc,
7764 Ast.IdAcc (_loc,
7765 Ast.IdUid (_loc, "Ast"),
7766 Ast.IdUid (_loc, "TyOr"))),
7767 meta_loc _loc x0),
7768 meta_ctyp _loc x1),
7769 meta_ctyp _loc x2)
7770 | Ast.TyAnd (x0, x1, x2) ->
7771 Ast.ExApp (_loc,
7772 Ast.ExApp (_loc,
7773 Ast.ExApp (_loc,
7774 Ast.ExId (_loc,
7775 Ast.IdAcc (_loc,
7776 Ast.IdUid (_loc, "Ast"),
7777 Ast.IdUid (_loc, "TyAnd"))),
7778 meta_loc _loc x0),
7779 meta_ctyp _loc x1),
7780 meta_ctyp _loc x2)
7781 | Ast.TyOf (x0, x1, x2) ->
7782 Ast.ExApp (_loc,
7783 Ast.ExApp (_loc,
7784 Ast.ExApp (_loc,
7785 Ast.ExId (_loc,
7786 Ast.IdAcc (_loc,
7787 Ast.IdUid (_loc, "Ast"),
7788 Ast.IdUid (_loc, "TyOf"))),
7789 meta_loc _loc x0),
7790 meta_ctyp _loc x1),
7791 meta_ctyp _loc x2)
7792 | Ast.TySum (x0, x1) ->
7793 Ast.ExApp (_loc,
7794 Ast.ExApp (_loc,
7795 Ast.ExId (_loc,
7796 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7797 Ast.IdUid (_loc, "TySum"))),
7798 meta_loc _loc x0),
7799 meta_ctyp _loc x1)
7800 | Ast.TyCom (x0, x1, x2) ->
7801 Ast.ExApp (_loc,
7802 Ast.ExApp (_loc,
7803 Ast.ExApp (_loc,
7804 Ast.ExId (_loc,
7805 Ast.IdAcc (_loc,
7806 Ast.IdUid (_loc, "Ast"),
7807 Ast.IdUid (_loc, "TyCom"))),
7808 meta_loc _loc x0),
7809 meta_ctyp _loc x1),
7810 meta_ctyp _loc x2)
7811 | Ast.TySem (x0, x1, x2) ->
7812 Ast.ExApp (_loc,
7813 Ast.ExApp (_loc,
7814 Ast.ExApp (_loc,
7815 Ast.ExId (_loc,
7816 Ast.IdAcc (_loc,
7817 Ast.IdUid (_loc, "Ast"),
7818 Ast.IdUid (_loc, "TySem"))),
7819 meta_loc _loc x0),
7820 meta_ctyp _loc x1),
7821 meta_ctyp _loc x2)
7822 | Ast.TyCol (x0, x1, x2) ->
7823 Ast.ExApp (_loc,
7824 Ast.ExApp (_loc,
7825 Ast.ExApp (_loc,
7826 Ast.ExId (_loc,
7827 Ast.IdAcc (_loc,
7828 Ast.IdUid (_loc, "Ast"),
7829 Ast.IdUid (_loc, "TyCol"))),
7830 meta_loc _loc x0),
7831 meta_ctyp _loc x1),
7832 meta_ctyp _loc x2)
7833 | Ast.TyRec (x0, x1) ->
7834 Ast.ExApp (_loc,
7835 Ast.ExApp (_loc,
7836 Ast.ExId (_loc,
7837 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7838 Ast.IdUid (_loc, "TyRec"))),
7839 meta_loc _loc x0),
7840 meta_ctyp _loc x1)
7841 | Ast.TyVrn (x0, x1) ->
7842 Ast.ExApp (_loc,
7843 Ast.ExApp (_loc,
7844 Ast.ExId (_loc,
7845 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7846 Ast.IdUid (_loc, "TyVrn"))),
7847 meta_loc _loc x0),
7848 meta_string _loc x1)
7849 | Ast.TyQuM (x0, x1) ->
7850 Ast.ExApp (_loc,
7851 Ast.ExApp (_loc,
7852 Ast.ExId (_loc,
7853 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7854 Ast.IdUid (_loc, "TyQuM"))),
7855 meta_loc _loc x0),
7856 meta_string _loc x1)
7857 | Ast.TyQuP (x0, x1) ->
7858 Ast.ExApp (_loc,
7859 Ast.ExApp (_loc,
7860 Ast.ExId (_loc,
7861 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7862 Ast.IdUid (_loc, "TyQuP"))),
7863 meta_loc _loc x0),
7864 meta_string _loc x1)
7865 | Ast.TyQuo (x0, x1) ->
7866 Ast.ExApp (_loc,
7867 Ast.ExApp (_loc,
7868 Ast.ExId (_loc,
7869 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7870 Ast.IdUid (_loc, "TyQuo"))),
7871 meta_loc _loc x0),
7872 meta_string _loc x1)
7873 | Ast.TyPol (x0, x1, x2) ->
7874 Ast.ExApp (_loc,
7875 Ast.ExApp (_loc,
7876 Ast.ExApp (_loc,
7877 Ast.ExId (_loc,
7878 Ast.IdAcc (_loc,
7879 Ast.IdUid (_loc, "Ast"),
7880 Ast.IdUid (_loc, "TyPol"))),
7881 meta_loc _loc x0),
7882 meta_ctyp _loc x1),
7883 meta_ctyp _loc x2)
7884 | Ast.TyOlb (x0, x1, x2) ->
7885 Ast.ExApp (_loc,
7886 Ast.ExApp (_loc,
7887 Ast.ExApp (_loc,
7888 Ast.ExId (_loc,
7889 Ast.IdAcc (_loc,
7890 Ast.IdUid (_loc, "Ast"),
7891 Ast.IdUid (_loc, "TyOlb"))),
7892 meta_loc _loc x0),
7893 meta_string _loc x1),
7894 meta_ctyp _loc x2)
7895 | Ast.TyObj (x0, x1, x2) ->
7896 Ast.ExApp (_loc,
7897 Ast.ExApp (_loc,
7898 Ast.ExApp (_loc,
7899 Ast.ExId (_loc,
7900 Ast.IdAcc (_loc,
7901 Ast.IdUid (_loc, "Ast"),
7902 Ast.IdUid (_loc, "TyObj"))),
7903 meta_loc _loc x0),
7904 meta_ctyp _loc x1),
7905 meta_meta_bool _loc x2)
7906 | Ast.TyDcl (x0, x1, x2, x3, x4) ->
7907 Ast.ExApp (_loc,
7908 Ast.ExApp (_loc,
7909 Ast.ExApp (_loc,
7910 Ast.ExApp (_loc,
7911 Ast.ExApp (_loc,
7912 Ast.ExId (_loc,
7913 Ast.IdAcc (_loc,
7914 Ast.IdUid (_loc, "Ast"),
7915 Ast.IdUid (_loc, "TyDcl"))),
7916 meta_loc _loc x0),
7917 meta_string _loc x1),
7918 meta_list meta_ctyp _loc x2),
7919 meta_ctyp _loc x3),
7920 meta_list
7921 (fun _loc (x1, x2) ->
7922 Ast.ExTup (_loc,
7923 Ast.ExCom (_loc, meta_ctyp _loc x1,
7924 meta_ctyp _loc x2)))
7925 _loc x4)
7926 | Ast.TyMan (x0, x1, x2) ->
7927 Ast.ExApp (_loc,
7928 Ast.ExApp (_loc,
7929 Ast.ExApp (_loc,
7930 Ast.ExId (_loc,
7931 Ast.IdAcc (_loc,
7932 Ast.IdUid (_loc, "Ast"),
7933 Ast.IdUid (_loc, "TyMan"))),
7934 meta_loc _loc x0),
7935 meta_ctyp _loc x1),
7936 meta_ctyp _loc x2)
7937 | Ast.TyId (x0, x1) ->
7938 Ast.ExApp (_loc,
7939 Ast.ExApp (_loc,
7940 Ast.ExId (_loc,
7941 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7942 Ast.IdUid (_loc, "TyId"))),
7943 meta_loc _loc x0),
7944 meta_ident _loc x1)
7945 | Ast.TyLab (x0, x1, x2) ->
7946 Ast.ExApp (_loc,
7947 Ast.ExApp (_loc,
7948 Ast.ExApp (_loc,
7949 Ast.ExId (_loc,
7950 Ast.IdAcc (_loc,
7951 Ast.IdUid (_loc, "Ast"),
7952 Ast.IdUid (_loc, "TyLab"))),
7953 meta_loc _loc x0),
7954 meta_string _loc x1),
7955 meta_ctyp _loc x2)
7956 | Ast.TyCls (x0, x1) ->
7957 Ast.ExApp (_loc,
7958 Ast.ExApp (_loc,
7959 Ast.ExId (_loc,
7960 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7961 Ast.IdUid (_loc, "TyCls"))),
7962 meta_loc _loc x0),
7963 meta_ident _loc x1)
7964 | Ast.TyArr (x0, x1, x2) ->
7965 Ast.ExApp (_loc,
7966 Ast.ExApp (_loc,
7967 Ast.ExApp (_loc,
7968 Ast.ExId (_loc,
7969 Ast.IdAcc (_loc,
7970 Ast.IdUid (_loc, "Ast"),
7971 Ast.IdUid (_loc, "TyArr"))),
7972 meta_loc _loc x0),
7973 meta_ctyp _loc x1),
7974 meta_ctyp _loc x2)
7975 | Ast.TyApp (x0, x1, x2) ->
7976 Ast.ExApp (_loc,
7977 Ast.ExApp (_loc,
7978 Ast.ExApp (_loc,
7979 Ast.ExId (_loc,
7980 Ast.IdAcc (_loc,
7981 Ast.IdUid (_loc, "Ast"),
7982 Ast.IdUid (_loc, "TyApp"))),
7983 meta_loc _loc x0),
7984 meta_ctyp _loc x1),
7985 meta_ctyp _loc x2)
7986 | Ast.TyAny x0 ->
7987 Ast.ExApp (_loc,
7988 Ast.ExId (_loc,
7989 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
7990 Ast.IdUid (_loc, "TyAny"))),
7991 meta_loc _loc x0)
7992 | Ast.TyAli (x0, x1, x2) ->
7993 Ast.ExApp (_loc,
7994 Ast.ExApp (_loc,
7995 Ast.ExApp (_loc,
7996 Ast.ExId (_loc,
7997 Ast.IdAcc (_loc,
7998 Ast.IdUid (_loc, "Ast"),
7999 Ast.IdUid (_loc, "TyAli"))),
8000 meta_loc _loc x0),
8001 meta_ctyp _loc x1),
8002 meta_ctyp _loc x2)
8003 | Ast.TyNil x0 ->
8004 Ast.ExApp (_loc,
8005 Ast.ExId (_loc,
8006 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8007 Ast.IdUid (_loc, "TyNil"))),
8008 meta_loc _loc x0)
8009 and meta_expr _loc =
8010 function
8011 | Ast.ExWhi (x0, x1, x2) ->
8012 Ast.ExApp (_loc,
8013 Ast.ExApp (_loc,
8014 Ast.ExApp (_loc,
8015 Ast.ExId (_loc,
8016 Ast.IdAcc (_loc,
8017 Ast.IdUid (_loc, "Ast"),
8018 Ast.IdUid (_loc, "ExWhi"))),
8019 meta_loc _loc x0),
8020 meta_expr _loc x1),
8021 meta_expr _loc x2)
8022 | Ast.ExVrn (x0, x1) ->
8023 Ast.ExApp (_loc,
8024 Ast.ExApp (_loc,
8025 Ast.ExId (_loc,
8026 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8027 Ast.IdUid (_loc, "ExVrn"))),
8028 meta_loc _loc x0),
8029 meta_string _loc x1)
8030 | Ast.ExTyc (x0, x1, x2) ->
8031 Ast.ExApp (_loc,
8032 Ast.ExApp (_loc,
8033 Ast.ExApp (_loc,
8034 Ast.ExId (_loc,
8035 Ast.IdAcc (_loc,
8036 Ast.IdUid (_loc, "Ast"),
8037 Ast.IdUid (_loc, "ExTyc"))),
8038 meta_loc _loc x0),
8039 meta_expr _loc x1),
8040 meta_ctyp _loc x2)
8041 | Ast.ExCom (x0, x1, x2) ->
8042 Ast.ExApp (_loc,
8043 Ast.ExApp (_loc,
8044 Ast.ExApp (_loc,
8045 Ast.ExId (_loc,
8046 Ast.IdAcc (_loc,
8047 Ast.IdUid (_loc, "Ast"),
8048 Ast.IdUid (_loc, "ExCom"))),
8049 meta_loc _loc x0),
8050 meta_expr _loc x1),
8051 meta_expr _loc x2)
8052 | Ast.ExTup (x0, x1) ->
8053 Ast.ExApp (_loc,
8054 Ast.ExApp (_loc,
8055 Ast.ExId (_loc,
8056 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8057 Ast.IdUid (_loc, "ExTup"))),
8058 meta_loc _loc x0),
8059 meta_expr _loc x1)
8060 | Ast.ExTry (x0, x1, x2) ->
8061 Ast.ExApp (_loc,
8062 Ast.ExApp (_loc,
8063 Ast.ExApp (_loc,
8064 Ast.ExId (_loc,
8065 Ast.IdAcc (_loc,
8066 Ast.IdUid (_loc, "Ast"),
8067 Ast.IdUid (_loc, "ExTry"))),
8068 meta_loc _loc x0),
8069 meta_expr _loc x1),
8070 meta_match_case _loc x2)
8071 | Ast.ExStr (x0, x1) ->
8072 Ast.ExApp (_loc,
8073 Ast.ExApp (_loc,
8074 Ast.ExId (_loc,
8075 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8076 Ast.IdUid (_loc, "ExStr"))),
8077 meta_loc _loc x0),
8078 meta_string _loc x1)
8079 | Ast.ExSte (x0, x1, x2) ->
8080 Ast.ExApp (_loc,
8081 Ast.ExApp (_loc,
8082 Ast.ExApp (_loc,
8083 Ast.ExId (_loc,
8084 Ast.IdAcc (_loc,
8085 Ast.IdUid (_loc, "Ast"),
8086 Ast.IdUid (_loc, "ExSte"))),
8087 meta_loc _loc x0),
8088 meta_expr _loc x1),
8089 meta_expr _loc x2)
8090 | Ast.ExSnd (x0, x1, x2) ->
8091 Ast.ExApp (_loc,
8092 Ast.ExApp (_loc,
8093 Ast.ExApp (_loc,
8094 Ast.ExId (_loc,
8095 Ast.IdAcc (_loc,
8096 Ast.IdUid (_loc, "Ast"),
8097 Ast.IdUid (_loc, "ExSnd"))),
8098 meta_loc _loc x0),
8099 meta_expr _loc x1),
8100 meta_string _loc x2)
8101 | Ast.ExSeq (x0, x1) ->
8102 Ast.ExApp (_loc,
8103 Ast.ExApp (_loc,
8104 Ast.ExId (_loc,
8105 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8106 Ast.IdUid (_loc, "ExSeq"))),
8107 meta_loc _loc x0),
8108 meta_expr _loc x1)
8109 | Ast.ExRec (x0, x1, x2) ->
8110 Ast.ExApp (_loc,
8111 Ast.ExApp (_loc,
8112 Ast.ExApp (_loc,
8113 Ast.ExId (_loc,
8114 Ast.IdAcc (_loc,
8115 Ast.IdUid (_loc, "Ast"),
8116 Ast.IdUid (_loc, "ExRec"))),
8117 meta_loc _loc x0),
8118 meta_rec_binding _loc x1),
8119 meta_expr _loc x2)
8120 | Ast.ExOvr (x0, x1) ->
8121 Ast.ExApp (_loc,
8122 Ast.ExApp (_loc,
8123 Ast.ExId (_loc,
8124 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8125 Ast.IdUid (_loc, "ExOvr"))),
8126 meta_loc _loc x0),
8127 meta_rec_binding _loc x1)
8128 | Ast.ExOlb (x0, x1, x2) ->
8129 Ast.ExApp (_loc,
8130 Ast.ExApp (_loc,
8131 Ast.ExApp (_loc,
8132 Ast.ExId (_loc,
8133 Ast.IdAcc (_loc,
8134 Ast.IdUid (_loc, "Ast"),
8135 Ast.IdUid (_loc, "ExOlb"))),
8136 meta_loc _loc x0),
8137 meta_string _loc x1),
8138 meta_expr _loc x2)
8139 | Ast.ExObj (x0, x1, x2) ->
8140 Ast.ExApp (_loc,
8141 Ast.ExApp (_loc,
8142 Ast.ExApp (_loc,
8143 Ast.ExId (_loc,
8144 Ast.IdAcc (_loc,
8145 Ast.IdUid (_loc, "Ast"),
8146 Ast.IdUid (_loc, "ExObj"))),
8147 meta_loc _loc x0),
8148 meta_patt _loc x1),
8149 meta_class_str_item _loc x2)
8150 | Ast.ExNew (x0, x1) ->
8151 Ast.ExApp (_loc,
8152 Ast.ExApp (_loc,
8153 Ast.ExId (_loc,
8154 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8155 Ast.IdUid (_loc, "ExNew"))),
8156 meta_loc _loc x0),
8157 meta_ident _loc x1)
8158 | Ast.ExMat (x0, x1, x2) ->
8159 Ast.ExApp (_loc,
8160 Ast.ExApp (_loc,
8161 Ast.ExApp (_loc,
8162 Ast.ExId (_loc,
8163 Ast.IdAcc (_loc,
8164 Ast.IdUid (_loc, "Ast"),
8165 Ast.IdUid (_loc, "ExMat"))),
8166 meta_loc _loc x0),
8167 meta_expr _loc x1),
8168 meta_match_case _loc x2)
8169 | Ast.ExLmd (x0, x1, x2, x3) ->
8170 Ast.ExApp (_loc,
8171 Ast.ExApp (_loc,
8172 Ast.ExApp (_loc,
8173 Ast.ExApp (_loc,
8174 Ast.ExId (_loc,
8175 Ast.IdAcc (_loc,
8176 Ast.IdUid (_loc, "Ast"),
8177 Ast.IdUid (_loc, "ExLmd"))),
8178 meta_loc _loc x0),
8179 meta_string _loc x1),
8180 meta_module_expr _loc x2),
8181 meta_expr _loc x3)
8182 | Ast.ExLet (x0, x1, x2, x3) ->
8183 Ast.ExApp (_loc,
8184 Ast.ExApp (_loc,
8185 Ast.ExApp (_loc,
8186 Ast.ExApp (_loc,
8187 Ast.ExId (_loc,
8188 Ast.IdAcc (_loc,
8189 Ast.IdUid (_loc, "Ast"),
8190 Ast.IdUid (_loc, "ExLet"))),
8191 meta_loc _loc x0),
8192 meta_meta_bool _loc x1),
8193 meta_binding _loc x2),
8194 meta_expr _loc x3)
8195 | Ast.ExLaz (x0, x1) ->
8196 Ast.ExApp (_loc,
8197 Ast.ExApp (_loc,
8198 Ast.ExId (_loc,
8199 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8200 Ast.IdUid (_loc, "ExLaz"))),
8201 meta_loc _loc x0),
8202 meta_expr _loc x1)
8203 | Ast.ExLab (x0, x1, x2) ->
8204 Ast.ExApp (_loc,
8205 Ast.ExApp (_loc,
8206 Ast.ExApp (_loc,
8207 Ast.ExId (_loc,
8208 Ast.IdAcc (_loc,
8209 Ast.IdUid (_loc, "Ast"),
8210 Ast.IdUid (_loc, "ExLab"))),
8211 meta_loc _loc x0),
8212 meta_string _loc x1),
8213 meta_expr _loc x2)
8214 | Ast.ExNativeInt (x0, x1) ->
8215 Ast.ExApp (_loc,
8216 Ast.ExApp (_loc,
8217 Ast.ExId (_loc,
8218 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8219 Ast.IdUid (_loc, "ExNativeInt"))),
8220 meta_loc _loc x0),
8221 meta_string _loc x1)
8222 | Ast.ExInt64 (x0, x1) ->
8223 Ast.ExApp (_loc,
8224 Ast.ExApp (_loc,
8225 Ast.ExId (_loc,
8226 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8227 Ast.IdUid (_loc, "ExInt64"))),
8228 meta_loc _loc x0),
8229 meta_string _loc x1)
8230 | Ast.ExInt32 (x0, x1) ->
8231 Ast.ExApp (_loc,
8232 Ast.ExApp (_loc,
8233 Ast.ExId (_loc,
8234 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8235 Ast.IdUid (_loc, "ExInt32"))),
8236 meta_loc _loc x0),
8237 meta_string _loc x1)
8238 | Ast.ExInt (x0, x1) ->
8239 Ast.ExApp (_loc,
8240 Ast.ExApp (_loc,
8241 Ast.ExId (_loc,
8242 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8243 Ast.IdUid (_loc, "ExInt"))),
8244 meta_loc _loc x0),
8245 meta_string _loc x1)
8246 | Ast.ExIfe (x0, x1, x2, x3) ->
8247 Ast.ExApp (_loc,
8248 Ast.ExApp (_loc,
8249 Ast.ExApp (_loc,
8250 Ast.ExApp (_loc,
8251 Ast.ExId (_loc,
8252 Ast.IdAcc (_loc,
8253 Ast.IdUid (_loc, "Ast"),
8254 Ast.IdUid (_loc, "ExIfe"))),
8255 meta_loc _loc x0),
8256 meta_expr _loc x1),
8257 meta_expr _loc x2),
8258 meta_expr _loc x3)
8259 | Ast.ExFun (x0, x1) ->
8260 Ast.ExApp (_loc,
8261 Ast.ExApp (_loc,
8262 Ast.ExId (_loc,
8263 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8264 Ast.IdUid (_loc, "ExFun"))),
8265 meta_loc _loc x0),
8266 meta_match_case _loc x1)
8267 | Ast.ExFor (x0, x1, x2, x3, x4, x5) ->
8268 Ast.ExApp (_loc,
8269 Ast.ExApp (_loc,
8270 Ast.ExApp (_loc,
8271 Ast.ExApp (_loc,
8272 Ast.ExApp (_loc,
8273 Ast.ExApp (_loc,
8274 Ast.ExId (_loc,
8275 Ast.IdAcc (_loc,
8276 Ast.IdUid (_loc, "Ast"),
8277 Ast.IdUid (_loc, "ExFor"))),
8278 meta_loc _loc x0),
8279 meta_string _loc x1),
8280 meta_expr _loc x2),
8281 meta_expr _loc x3),
8282 meta_meta_bool _loc x4),
8283 meta_expr _loc x5)
8284 | Ast.ExFlo (x0, x1) ->
8285 Ast.ExApp (_loc,
8286 Ast.ExApp (_loc,
8287 Ast.ExId (_loc,
8288 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8289 Ast.IdUid (_loc, "ExFlo"))),
8290 meta_loc _loc x0),
8291 meta_string _loc x1)
8292 | Ast.ExCoe (x0, x1, x2, x3) ->
8293 Ast.ExApp (_loc,
8294 Ast.ExApp (_loc,
8295 Ast.ExApp (_loc,
8296 Ast.ExApp (_loc,
8297 Ast.ExId (_loc,
8298 Ast.IdAcc (_loc,
8299 Ast.IdUid (_loc, "Ast"),
8300 Ast.IdUid (_loc, "ExCoe"))),
8301 meta_loc _loc x0),
8302 meta_expr _loc x1),
8303 meta_ctyp _loc x2),
8304 meta_ctyp _loc x3)
8305 | Ast.ExChr (x0, x1) ->
8306 Ast.ExApp (_loc,
8307 Ast.ExApp (_loc,
8308 Ast.ExId (_loc,
8309 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8310 Ast.IdUid (_loc, "ExChr"))),
8311 meta_loc _loc x0),
8312 meta_string _loc x1)
8313 | Ast.ExAss (x0, x1, x2) ->
8314 Ast.ExApp (_loc,
8315 Ast.ExApp (_loc,
8316 Ast.ExApp (_loc,
8317 Ast.ExId (_loc,
8318 Ast.IdAcc (_loc,
8319 Ast.IdUid (_loc, "Ast"),
8320 Ast.IdUid (_loc, "ExAss"))),
8321 meta_loc _loc x0),
8322 meta_expr _loc x1),
8323 meta_expr _loc x2)
8324 | Ast.ExAsr (x0, x1) ->
8325 Ast.ExApp (_loc,
8326 Ast.ExApp (_loc,
8327 Ast.ExId (_loc,
8328 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8329 Ast.IdUid (_loc, "ExAsr"))),
8330 meta_loc _loc x0),
8331 meta_expr _loc x1)
8332 | Ast.ExAsf x0 ->
8333 Ast.ExApp (_loc,
8334 Ast.ExId (_loc,
8335 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8336 Ast.IdUid (_loc, "ExAsf"))),
8337 meta_loc _loc x0)
8338 | Ast.ExSem (x0, x1, x2) ->
8339 Ast.ExApp (_loc,
8340 Ast.ExApp (_loc,
8341 Ast.ExApp (_loc,
8342 Ast.ExId (_loc,
8343 Ast.IdAcc (_loc,
8344 Ast.IdUid (_loc, "Ast"),
8345 Ast.IdUid (_loc, "ExSem"))),
8346 meta_loc _loc x0),
8347 meta_expr _loc x1),
8348 meta_expr _loc x2)
8349 | Ast.ExArr (x0, x1) ->
8350 Ast.ExApp (_loc,
8351 Ast.ExApp (_loc,
8352 Ast.ExId (_loc,
8353 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8354 Ast.IdUid (_loc, "ExArr"))),
8355 meta_loc _loc x0),
8356 meta_expr _loc x1)
8357 | Ast.ExAre (x0, x1, x2) ->
8358 Ast.ExApp (_loc,
8359 Ast.ExApp (_loc,
8360 Ast.ExApp (_loc,
8361 Ast.ExId (_loc,
8362 Ast.IdAcc (_loc,
8363 Ast.IdUid (_loc, "Ast"),
8364 Ast.IdUid (_loc, "ExAre"))),
8365 meta_loc _loc x0),
8366 meta_expr _loc x1),
8367 meta_expr _loc x2)
8368 | Ast.ExApp (x0, x1, x2) ->
8369 Ast.ExApp (_loc,
8370 Ast.ExApp (_loc,
8371 Ast.ExApp (_loc,
8372 Ast.ExId (_loc,
8373 Ast.IdAcc (_loc,
8374 Ast.IdUid (_loc, "Ast"),
8375 Ast.IdUid (_loc, "ExApp"))),
8376 meta_loc _loc x0),
8377 meta_expr _loc x1),
8378 meta_expr _loc x2)
8379 | Ast.ExAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8380 | Ast.ExAcc (x0, x1, x2) ->
8381 Ast.ExApp (_loc,
8382 Ast.ExApp (_loc,
8383 Ast.ExApp (_loc,
8384 Ast.ExId (_loc,
8385 Ast.IdAcc (_loc,
8386 Ast.IdUid (_loc, "Ast"),
8387 Ast.IdUid (_loc, "ExAcc"))),
8388 meta_loc _loc x0),
8389 meta_expr _loc x1),
8390 meta_expr _loc x2)
8391 | Ast.ExId (x0, x1) ->
8392 Ast.ExApp (_loc,
8393 Ast.ExApp (_loc,
8394 Ast.ExId (_loc,
8395 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8396 Ast.IdUid (_loc, "ExId"))),
8397 meta_loc _loc x0),
8398 meta_ident _loc x1)
8399 | Ast.ExNil x0 ->
8400 Ast.ExApp (_loc,
8401 Ast.ExId (_loc,
8402 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8403 Ast.IdUid (_loc, "ExNil"))),
8404 meta_loc _loc x0)
8405 and meta_ident _loc =
8406 function
8407 | Ast.IdAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8408 | Ast.IdUid (x0, x1) ->
8409 Ast.ExApp (_loc,
8410 Ast.ExApp (_loc,
8411 Ast.ExId (_loc,
8412 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8413 Ast.IdUid (_loc, "IdUid"))),
8414 meta_loc _loc x0),
8415 meta_string _loc x1)
8416 | Ast.IdLid (x0, x1) ->
8417 Ast.ExApp (_loc,
8418 Ast.ExApp (_loc,
8419 Ast.ExId (_loc,
8420 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8421 Ast.IdUid (_loc, "IdLid"))),
8422 meta_loc _loc x0),
8423 meta_string _loc x1)
8424 | Ast.IdApp (x0, x1, x2) ->
8425 Ast.ExApp (_loc,
8426 Ast.ExApp (_loc,
8427 Ast.ExApp (_loc,
8428 Ast.ExId (_loc,
8429 Ast.IdAcc (_loc,
8430 Ast.IdUid (_loc, "Ast"),
8431 Ast.IdUid (_loc, "IdApp"))),
8432 meta_loc _loc x0),
8433 meta_ident _loc x1),
8434 meta_ident _loc x2)
8435 | Ast.IdAcc (x0, x1, x2) ->
8436 Ast.ExApp (_loc,
8437 Ast.ExApp (_loc,
8438 Ast.ExApp (_loc,
8439 Ast.ExId (_loc,
8440 Ast.IdAcc (_loc,
8441 Ast.IdUid (_loc, "Ast"),
8442 Ast.IdUid (_loc, "IdAcc"))),
8443 meta_loc _loc x0),
8444 meta_ident _loc x1),
8445 meta_ident _loc x2)
8446 and meta_match_case _loc =
8447 function
8448 | Ast.McAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8449 | Ast.McArr (x0, x1, x2, x3) ->
8450 Ast.ExApp (_loc,
8451 Ast.ExApp (_loc,
8452 Ast.ExApp (_loc,
8453 Ast.ExApp (_loc,
8454 Ast.ExId (_loc,
8455 Ast.IdAcc (_loc,
8456 Ast.IdUid (_loc, "Ast"),
8457 Ast.IdUid (_loc, "McArr"))),
8458 meta_loc _loc x0),
8459 meta_patt _loc x1),
8460 meta_expr _loc x2),
8461 meta_expr _loc x3)
8462 | Ast.McOr (x0, x1, x2) ->
8463 Ast.ExApp (_loc,
8464 Ast.ExApp (_loc,
8465 Ast.ExApp (_loc,
8466 Ast.ExId (_loc,
8467 Ast.IdAcc (_loc,
8468 Ast.IdUid (_loc, "Ast"),
8469 Ast.IdUid (_loc, "McOr"))),
8470 meta_loc _loc x0),
8471 meta_match_case _loc x1),
8472 meta_match_case _loc x2)
8473 | Ast.McNil x0 ->
8474 Ast.ExApp (_loc,
8475 Ast.ExId (_loc,
8476 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8477 Ast.IdUid (_loc, "McNil"))),
8478 meta_loc _loc x0)
8479 and meta_meta_bool _loc =
8480 function
8481 | Ast.BAnt x0 -> Ast.ExAnt (_loc, x0)
8482 | Ast.BFalse ->
8483 Ast.ExId (_loc,
8484 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8485 Ast.IdUid (_loc, "BFalse")))
8486 | Ast.BTrue ->
8487 Ast.ExId (_loc,
8488 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8489 Ast.IdUid (_loc, "BTrue")))
8490 and meta_meta_list mf_a _loc =
8491 function
8492 | Ast.LAnt x0 -> Ast.ExAnt (_loc, x0)
8493 | Ast.LCons (x0, x1) ->
8494 Ast.ExApp (_loc,
8495 Ast.ExApp (_loc,
8496 Ast.ExId (_loc,
8497 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8498 Ast.IdUid (_loc, "LCons"))),
8499 mf_a _loc x0),
8500 meta_meta_list mf_a _loc x1)
8501 | Ast.LNil ->
8502 Ast.ExId (_loc,
8503 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8504 Ast.IdUid (_loc, "LNil")))
8505 and meta_meta_option mf_a _loc =
8506 function
8507 | Ast.OAnt x0 -> Ast.ExAnt (_loc, x0)
8508 | Ast.OSome x0 ->
8509 Ast.ExApp (_loc,
8510 Ast.ExId (_loc,
8511 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8512 Ast.IdUid (_loc, "OSome"))),
8513 mf_a _loc x0)
8514 | Ast.ONone ->
8515 Ast.ExId (_loc,
8516 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8517 Ast.IdUid (_loc, "ONone")))
8518 and meta_module_binding _loc =
8519 function
8520 | Ast.MbAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8521 | Ast.MbCol (x0, x1, x2) ->
8522 Ast.ExApp (_loc,
8523 Ast.ExApp (_loc,
8524 Ast.ExApp (_loc,
8525 Ast.ExId (_loc,
8526 Ast.IdAcc (_loc,
8527 Ast.IdUid (_loc, "Ast"),
8528 Ast.IdUid (_loc, "MbCol"))),
8529 meta_loc _loc x0),
8530 meta_string _loc x1),
8531 meta_module_type _loc x2)
8532 | Ast.MbColEq (x0, x1, x2, x3) ->
8533 Ast.ExApp (_loc,
8534 Ast.ExApp (_loc,
8535 Ast.ExApp (_loc,
8536 Ast.ExApp (_loc,
8537 Ast.ExId (_loc,
8538 Ast.IdAcc (_loc,
8539 Ast.IdUid (_loc, "Ast"),
8540 Ast.IdUid (_loc, "MbColEq"))),
8541 meta_loc _loc x0),
8542 meta_string _loc x1),
8543 meta_module_type _loc x2),
8544 meta_module_expr _loc x3)
8545 | Ast.MbAnd (x0, x1, x2) ->
8546 Ast.ExApp (_loc,
8547 Ast.ExApp (_loc,
8548 Ast.ExApp (_loc,
8549 Ast.ExId (_loc,
8550 Ast.IdAcc (_loc,
8551 Ast.IdUid (_loc, "Ast"),
8552 Ast.IdUid (_loc, "MbAnd"))),
8553 meta_loc _loc x0),
8554 meta_module_binding _loc x1),
8555 meta_module_binding _loc x2)
8556 | Ast.MbNil x0 ->
8557 Ast.ExApp (_loc,
8558 Ast.ExId (_loc,
8559 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8560 Ast.IdUid (_loc, "MbNil"))),
8561 meta_loc _loc x0)
8562 and meta_module_expr _loc =
8563 function
8564 | Ast.MeAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8565 | Ast.MeTyc (x0, x1, x2) ->
8566 Ast.ExApp (_loc,
8567 Ast.ExApp (_loc,
8568 Ast.ExApp (_loc,
8569 Ast.ExId (_loc,
8570 Ast.IdAcc (_loc,
8571 Ast.IdUid (_loc, "Ast"),
8572 Ast.IdUid (_loc, "MeTyc"))),
8573 meta_loc _loc x0),
8574 meta_module_expr _loc x1),
8575 meta_module_type _loc x2)
8576 | Ast.MeStr (x0, x1) ->
8577 Ast.ExApp (_loc,
8578 Ast.ExApp (_loc,
8579 Ast.ExId (_loc,
8580 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8581 Ast.IdUid (_loc, "MeStr"))),
8582 meta_loc _loc x0),
8583 meta_str_item _loc x1)
8584 | Ast.MeFun (x0, x1, x2, x3) ->
8585 Ast.ExApp (_loc,
8586 Ast.ExApp (_loc,
8587 Ast.ExApp (_loc,
8588 Ast.ExApp (_loc,
8589 Ast.ExId (_loc,
8590 Ast.IdAcc (_loc,
8591 Ast.IdUid (_loc, "Ast"),
8592 Ast.IdUid (_loc, "MeFun"))),
8593 meta_loc _loc x0),
8594 meta_string _loc x1),
8595 meta_module_type _loc x2),
8596 meta_module_expr _loc x3)
8597 | Ast.MeApp (x0, x1, x2) ->
8598 Ast.ExApp (_loc,
8599 Ast.ExApp (_loc,
8600 Ast.ExApp (_loc,
8601 Ast.ExId (_loc,
8602 Ast.IdAcc (_loc,
8603 Ast.IdUid (_loc, "Ast"),
8604 Ast.IdUid (_loc, "MeApp"))),
8605 meta_loc _loc x0),
8606 meta_module_expr _loc x1),
8607 meta_module_expr _loc x2)
8608 | Ast.MeId (x0, x1) ->
8609 Ast.ExApp (_loc,
8610 Ast.ExApp (_loc,
8611 Ast.ExId (_loc,
8612 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8613 Ast.IdUid (_loc, "MeId"))),
8614 meta_loc _loc x0),
8615 meta_ident _loc x1)
8616 | Ast.MeNil x0 ->
8617 Ast.ExApp (_loc,
8618 Ast.ExId (_loc,
8619 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8620 Ast.IdUid (_loc, "MeNil"))),
8621 meta_loc _loc x0)
8622 and meta_module_type _loc =
8623 function
8624 | Ast.MtAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8625 | Ast.MtWit (x0, x1, x2) ->
8626 Ast.ExApp (_loc,
8627 Ast.ExApp (_loc,
8628 Ast.ExApp (_loc,
8629 Ast.ExId (_loc,
8630 Ast.IdAcc (_loc,
8631 Ast.IdUid (_loc, "Ast"),
8632 Ast.IdUid (_loc, "MtWit"))),
8633 meta_loc _loc x0),
8634 meta_module_type _loc x1),
8635 meta_with_constr _loc x2)
8636 | Ast.MtSig (x0, x1) ->
8637 Ast.ExApp (_loc,
8638 Ast.ExApp (_loc,
8639 Ast.ExId (_loc,
8640 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8641 Ast.IdUid (_loc, "MtSig"))),
8642 meta_loc _loc x0),
8643 meta_sig_item _loc x1)
8644 | Ast.MtQuo (x0, x1) ->
8645 Ast.ExApp (_loc,
8646 Ast.ExApp (_loc,
8647 Ast.ExId (_loc,
8648 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8649 Ast.IdUid (_loc, "MtQuo"))),
8650 meta_loc _loc x0),
8651 meta_string _loc x1)
8652 | Ast.MtFun (x0, x1, x2, x3) ->
8653 Ast.ExApp (_loc,
8654 Ast.ExApp (_loc,
8655 Ast.ExApp (_loc,
8656 Ast.ExApp (_loc,
8657 Ast.ExId (_loc,
8658 Ast.IdAcc (_loc,
8659 Ast.IdUid (_loc, "Ast"),
8660 Ast.IdUid (_loc, "MtFun"))),
8661 meta_loc _loc x0),
8662 meta_string _loc x1),
8663 meta_module_type _loc x2),
8664 meta_module_type _loc x3)
8665 | Ast.MtId (x0, x1) ->
8666 Ast.ExApp (_loc,
8667 Ast.ExApp (_loc,
8668 Ast.ExId (_loc,
8669 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8670 Ast.IdUid (_loc, "MtId"))),
8671 meta_loc _loc x0),
8672 meta_ident _loc x1)
8673 | Ast.MtNil x0 ->
8674 Ast.ExApp (_loc,
8675 Ast.ExId (_loc,
8676 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8677 Ast.IdUid (_loc, "MtNil"))),
8678 meta_loc _loc x0)
8679 and meta_patt _loc =
8680 function
8681 | Ast.PaVrn (x0, x1) ->
8682 Ast.ExApp (_loc,
8683 Ast.ExApp (_loc,
8684 Ast.ExId (_loc,
8685 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8686 Ast.IdUid (_loc, "PaVrn"))),
8687 meta_loc _loc x0),
8688 meta_string _loc x1)
8689 | Ast.PaTyp (x0, x1) ->
8690 Ast.ExApp (_loc,
8691 Ast.ExApp (_loc,
8692 Ast.ExId (_loc,
8693 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8694 Ast.IdUid (_loc, "PaTyp"))),
8695 meta_loc _loc x0),
8696 meta_ident _loc x1)
8697 | Ast.PaTyc (x0, x1, x2) ->
8698 Ast.ExApp (_loc,
8699 Ast.ExApp (_loc,
8700 Ast.ExApp (_loc,
8701 Ast.ExId (_loc,
8702 Ast.IdAcc (_loc,
8703 Ast.IdUid (_loc, "Ast"),
8704 Ast.IdUid (_loc, "PaTyc"))),
8705 meta_loc _loc x0),
8706 meta_patt _loc x1),
8707 meta_ctyp _loc x2)
8708 | Ast.PaTup (x0, x1) ->
8709 Ast.ExApp (_loc,
8710 Ast.ExApp (_loc,
8711 Ast.ExId (_loc,
8712 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8713 Ast.IdUid (_loc, "PaTup"))),
8714 meta_loc _loc x0),
8715 meta_patt _loc x1)
8716 | Ast.PaStr (x0, x1) ->
8717 Ast.ExApp (_loc,
8718 Ast.ExApp (_loc,
8719 Ast.ExId (_loc,
8720 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8721 Ast.IdUid (_loc, "PaStr"))),
8722 meta_loc _loc x0),
8723 meta_string _loc x1)
8724 | Ast.PaEq (x0, x1, x2) ->
8725 Ast.ExApp (_loc,
8726 Ast.ExApp (_loc,
8727 Ast.ExApp (_loc,
8728 Ast.ExId (_loc,
8729 Ast.IdAcc (_loc,
8730 Ast.IdUid (_loc, "Ast"),
8731 Ast.IdUid (_loc, "PaEq"))),
8732 meta_loc _loc x0),
8733 meta_ident _loc x1),
8734 meta_patt _loc x2)
8735 | Ast.PaRec (x0, x1) ->
8736 Ast.ExApp (_loc,
8737 Ast.ExApp (_loc,
8738 Ast.ExId (_loc,
8739 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8740 Ast.IdUid (_loc, "PaRec"))),
8741 meta_loc _loc x0),
8742 meta_patt _loc x1)
8743 | Ast.PaRng (x0, x1, x2) ->
8744 Ast.ExApp (_loc,
8745 Ast.ExApp (_loc,
8746 Ast.ExApp (_loc,
8747 Ast.ExId (_loc,
8748 Ast.IdAcc (_loc,
8749 Ast.IdUid (_loc, "Ast"),
8750 Ast.IdUid (_loc, "PaRng"))),
8751 meta_loc _loc x0),
8752 meta_patt _loc x1),
8753 meta_patt _loc x2)
8754 | Ast.PaOrp (x0, x1, x2) ->
8755 Ast.ExApp (_loc,
8756 Ast.ExApp (_loc,
8757 Ast.ExApp (_loc,
8758 Ast.ExId (_loc,
8759 Ast.IdAcc (_loc,
8760 Ast.IdUid (_loc, "Ast"),
8761 Ast.IdUid (_loc, "PaOrp"))),
8762 meta_loc _loc x0),
8763 meta_patt _loc x1),
8764 meta_patt _loc x2)
8765 | Ast.PaOlbi (x0, x1, x2, x3) ->
8766 Ast.ExApp (_loc,
8767 Ast.ExApp (_loc,
8768 Ast.ExApp (_loc,
8769 Ast.ExApp (_loc,
8770 Ast.ExId (_loc,
8771 Ast.IdAcc (_loc,
8772 Ast.IdUid (_loc, "Ast"),
8773 Ast.IdUid (_loc, "PaOlbi"))),
8774 meta_loc _loc x0),
8775 meta_string _loc x1),
8776 meta_patt _loc x2),
8777 meta_expr _loc x3)
8778 | Ast.PaOlb (x0, x1, x2) ->
8779 Ast.ExApp (_loc,
8780 Ast.ExApp (_loc,
8781 Ast.ExApp (_loc,
8782 Ast.ExId (_loc,
8783 Ast.IdAcc (_loc,
8784 Ast.IdUid (_loc, "Ast"),
8785 Ast.IdUid (_loc, "PaOlb"))),
8786 meta_loc _loc x0),
8787 meta_string _loc x1),
8788 meta_patt _loc x2)
8789 | Ast.PaLab (x0, x1, x2) ->
8790 Ast.ExApp (_loc,
8791 Ast.ExApp (_loc,
8792 Ast.ExApp (_loc,
8793 Ast.ExId (_loc,
8794 Ast.IdAcc (_loc,
8795 Ast.IdUid (_loc, "Ast"),
8796 Ast.IdUid (_loc, "PaLab"))),
8797 meta_loc _loc x0),
8798 meta_string _loc x1),
8799 meta_patt _loc x2)
8800 | Ast.PaFlo (x0, x1) ->
8801 Ast.ExApp (_loc,
8802 Ast.ExApp (_loc,
8803 Ast.ExId (_loc,
8804 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8805 Ast.IdUid (_loc, "PaFlo"))),
8806 meta_loc _loc x0),
8807 meta_string _loc x1)
8808 | Ast.PaNativeInt (x0, x1) ->
8809 Ast.ExApp (_loc,
8810 Ast.ExApp (_loc,
8811 Ast.ExId (_loc,
8812 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8813 Ast.IdUid (_loc, "PaNativeInt"))),
8814 meta_loc _loc x0),
8815 meta_string _loc x1)
8816 | Ast.PaInt64 (x0, x1) ->
8817 Ast.ExApp (_loc,
8818 Ast.ExApp (_loc,
8819 Ast.ExId (_loc,
8820 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8821 Ast.IdUid (_loc, "PaInt64"))),
8822 meta_loc _loc x0),
8823 meta_string _loc x1)
8824 | Ast.PaInt32 (x0, x1) ->
8825 Ast.ExApp (_loc,
8826 Ast.ExApp (_loc,
8827 Ast.ExId (_loc,
8828 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8829 Ast.IdUid (_loc, "PaInt32"))),
8830 meta_loc _loc x0),
8831 meta_string _loc x1)
8832 | Ast.PaInt (x0, x1) ->
8833 Ast.ExApp (_loc,
8834 Ast.ExApp (_loc,
8835 Ast.ExId (_loc,
8836 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8837 Ast.IdUid (_loc, "PaInt"))),
8838 meta_loc _loc x0),
8839 meta_string _loc x1)
8840 | Ast.PaChr (x0, x1) ->
8841 Ast.ExApp (_loc,
8842 Ast.ExApp (_loc,
8843 Ast.ExId (_loc,
8844 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8845 Ast.IdUid (_loc, "PaChr"))),
8846 meta_loc _loc x0),
8847 meta_string _loc x1)
8848 | Ast.PaSem (x0, x1, x2) ->
8849 Ast.ExApp (_loc,
8850 Ast.ExApp (_loc,
8851 Ast.ExApp (_loc,
8852 Ast.ExId (_loc,
8853 Ast.IdAcc (_loc,
8854 Ast.IdUid (_loc, "Ast"),
8855 Ast.IdUid (_loc, "PaSem"))),
8856 meta_loc _loc x0),
8857 meta_patt _loc x1),
8858 meta_patt _loc x2)
8859 | Ast.PaCom (x0, x1, x2) ->
8860 Ast.ExApp (_loc,
8861 Ast.ExApp (_loc,
8862 Ast.ExApp (_loc,
8863 Ast.ExId (_loc,
8864 Ast.IdAcc (_loc,
8865 Ast.IdUid (_loc, "Ast"),
8866 Ast.IdUid (_loc, "PaCom"))),
8867 meta_loc _loc x0),
8868 meta_patt _loc x1),
8869 meta_patt _loc x2)
8870 | Ast.PaArr (x0, x1) ->
8871 Ast.ExApp (_loc,
8872 Ast.ExApp (_loc,
8873 Ast.ExId (_loc,
8874 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8875 Ast.IdUid (_loc, "PaArr"))),
8876 meta_loc _loc x0),
8877 meta_patt _loc x1)
8878 | Ast.PaApp (x0, x1, x2) ->
8879 Ast.ExApp (_loc,
8880 Ast.ExApp (_loc,
8881 Ast.ExApp (_loc,
8882 Ast.ExId (_loc,
8883 Ast.IdAcc (_loc,
8884 Ast.IdUid (_loc, "Ast"),
8885 Ast.IdUid (_loc, "PaApp"))),
8886 meta_loc _loc x0),
8887 meta_patt _loc x1),
8888 meta_patt _loc x2)
8889 | Ast.PaAny x0 ->
8890 Ast.ExApp (_loc,
8891 Ast.ExId (_loc,
8892 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8893 Ast.IdUid (_loc, "PaAny"))),
8894 meta_loc _loc x0)
8895 | Ast.PaAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8896 | Ast.PaAli (x0, x1, x2) ->
8897 Ast.ExApp (_loc,
8898 Ast.ExApp (_loc,
8899 Ast.ExApp (_loc,
8900 Ast.ExId (_loc,
8901 Ast.IdAcc (_loc,
8902 Ast.IdUid (_loc, "Ast"),
8903 Ast.IdUid (_loc, "PaAli"))),
8904 meta_loc _loc x0),
8905 meta_patt _loc x1),
8906 meta_patt _loc x2)
8907 | Ast.PaId (x0, x1) ->
8908 Ast.ExApp (_loc,
8909 Ast.ExApp (_loc,
8910 Ast.ExId (_loc,
8911 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8912 Ast.IdUid (_loc, "PaId"))),
8913 meta_loc _loc x0),
8914 meta_ident _loc x1)
8915 | Ast.PaNil x0 ->
8916 Ast.ExApp (_loc,
8917 Ast.ExId (_loc,
8918 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8919 Ast.IdUid (_loc, "PaNil"))),
8920 meta_loc _loc x0)
8921 and meta_rec_binding _loc =
8922 function
8923 | Ast.RbAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8924 | Ast.RbEq (x0, x1, x2) ->
8925 Ast.ExApp (_loc,
8926 Ast.ExApp (_loc,
8927 Ast.ExApp (_loc,
8928 Ast.ExId (_loc,
8929 Ast.IdAcc (_loc,
8930 Ast.IdUid (_loc, "Ast"),
8931 Ast.IdUid (_loc, "RbEq"))),
8932 meta_loc _loc x0),
8933 meta_ident _loc x1),
8934 meta_expr _loc x2)
8935 | Ast.RbSem (x0, x1, x2) ->
8936 Ast.ExApp (_loc,
8937 Ast.ExApp (_loc,
8938 Ast.ExApp (_loc,
8939 Ast.ExId (_loc,
8940 Ast.IdAcc (_loc,
8941 Ast.IdUid (_loc, "Ast"),
8942 Ast.IdUid (_loc, "RbSem"))),
8943 meta_loc _loc x0),
8944 meta_rec_binding _loc x1),
8945 meta_rec_binding _loc x2)
8946 | Ast.RbNil x0 ->
8947 Ast.ExApp (_loc,
8948 Ast.ExId (_loc,
8949 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8950 Ast.IdUid (_loc, "RbNil"))),
8951 meta_loc _loc x0)
8952 and meta_sig_item _loc =
8953 function
8954 | Ast.SgAnt (x0, x1) -> Ast.ExAnt (x0, x1)
8955 | Ast.SgVal (x0, x1, x2) ->
8956 Ast.ExApp (_loc,
8957 Ast.ExApp (_loc,
8958 Ast.ExApp (_loc,
8959 Ast.ExId (_loc,
8960 Ast.IdAcc (_loc,
8961 Ast.IdUid (_loc, "Ast"),
8962 Ast.IdUid (_loc, "SgVal"))),
8963 meta_loc _loc x0),
8964 meta_string _loc x1),
8965 meta_ctyp _loc x2)
8966 | Ast.SgTyp (x0, x1) ->
8967 Ast.ExApp (_loc,
8968 Ast.ExApp (_loc,
8969 Ast.ExId (_loc,
8970 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8971 Ast.IdUid (_loc, "SgTyp"))),
8972 meta_loc _loc x0),
8973 meta_ctyp _loc x1)
8974 | Ast.SgOpn (x0, x1) ->
8975 Ast.ExApp (_loc,
8976 Ast.ExApp (_loc,
8977 Ast.ExId (_loc,
8978 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8979 Ast.IdUid (_loc, "SgOpn"))),
8980 meta_loc _loc x0),
8981 meta_ident _loc x1)
8982 | Ast.SgMty (x0, x1, x2) ->
8983 Ast.ExApp (_loc,
8984 Ast.ExApp (_loc,
8985 Ast.ExApp (_loc,
8986 Ast.ExId (_loc,
8987 Ast.IdAcc (_loc,
8988 Ast.IdUid (_loc, "Ast"),
8989 Ast.IdUid (_loc, "SgMty"))),
8990 meta_loc _loc x0),
8991 meta_string _loc x1),
8992 meta_module_type _loc x2)
8993 | Ast.SgRecMod (x0, x1) ->
8994 Ast.ExApp (_loc,
8995 Ast.ExApp (_loc,
8996 Ast.ExId (_loc,
8997 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
8998 Ast.IdUid (_loc, "SgRecMod"))),
8999 meta_loc _loc x0),
9000 meta_module_binding _loc x1)
9001 | Ast.SgMod (x0, x1, x2) ->
9002 Ast.ExApp (_loc,
9003 Ast.ExApp (_loc,
9004 Ast.ExApp (_loc,
9005 Ast.ExId (_loc,
9006 Ast.IdAcc (_loc,
9007 Ast.IdUid (_loc, "Ast"),
9008 Ast.IdUid (_loc, "SgMod"))),
9009 meta_loc _loc x0),
9010 meta_string _loc x1),
9011 meta_module_type _loc x2)
9012 | Ast.SgInc (x0, x1) ->
9013 Ast.ExApp (_loc,
9014 Ast.ExApp (_loc,
9015 Ast.ExId (_loc,
9016 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9017 Ast.IdUid (_loc, "SgInc"))),
9018 meta_loc _loc x0),
9019 meta_module_type _loc x1)
9020 | Ast.SgExt (x0, x1, x2, x3) ->
9021 Ast.ExApp (_loc,
9022 Ast.ExApp (_loc,
9023 Ast.ExApp (_loc,
9024 Ast.ExApp (_loc,
9025 Ast.ExId (_loc,
9026 Ast.IdAcc (_loc,
9027 Ast.IdUid (_loc, "Ast"),
9028 Ast.IdUid (_loc, "SgExt"))),
9029 meta_loc _loc x0),
9030 meta_string _loc x1),
9031 meta_ctyp _loc x2),
9032 meta_meta_list meta_string _loc x3)
9033 | Ast.SgExc (x0, x1) ->
9034 Ast.ExApp (_loc,
9035 Ast.ExApp (_loc,
9036 Ast.ExId (_loc,
9037 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9038 Ast.IdUid (_loc, "SgExc"))),
9039 meta_loc _loc x0),
9040 meta_ctyp _loc x1)
9041 | Ast.SgDir (x0, x1, x2) ->
9042 Ast.ExApp (_loc,
9043 Ast.ExApp (_loc,
9044 Ast.ExApp (_loc,
9045 Ast.ExId (_loc,
9046 Ast.IdAcc (_loc,
9047 Ast.IdUid (_loc, "Ast"),
9048 Ast.IdUid (_loc, "SgDir"))),
9049 meta_loc _loc x0),
9050 meta_string _loc x1),
9051 meta_expr _loc x2)
9052 | Ast.SgSem (x0, x1, x2) ->
9053 Ast.ExApp (_loc,
9054 Ast.ExApp (_loc,
9055 Ast.ExApp (_loc,
9056 Ast.ExId (_loc,
9057 Ast.IdAcc (_loc,
9058 Ast.IdUid (_loc, "Ast"),
9059 Ast.IdUid (_loc, "SgSem"))),
9060 meta_loc _loc x0),
9061 meta_sig_item _loc x1),
9062 meta_sig_item _loc x2)
9063 | Ast.SgClt (x0, x1) ->
9064 Ast.ExApp (_loc,
9065 Ast.ExApp (_loc,
9066 Ast.ExId (_loc,
9067 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9068 Ast.IdUid (_loc, "SgClt"))),
9069 meta_loc _loc x0),
9070 meta_class_type _loc x1)
9071 | Ast.SgCls (x0, x1) ->
9072 Ast.ExApp (_loc,
9073 Ast.ExApp (_loc,
9074 Ast.ExId (_loc,
9075 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9076 Ast.IdUid (_loc, "SgCls"))),
9077 meta_loc _loc x0),
9078 meta_class_type _loc x1)
9079 | Ast.SgNil x0 ->
9080 Ast.ExApp (_loc,
9081 Ast.ExId (_loc,
9082 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9083 Ast.IdUid (_loc, "SgNil"))),
9084 meta_loc _loc x0)
9085 and meta_str_item _loc =
9086 function
9087 | Ast.StAnt (x0, x1) -> Ast.ExAnt (x0, x1)
9088 | Ast.StVal (x0, x1, x2) ->
9089 Ast.ExApp (_loc,
9090 Ast.ExApp (_loc,
9091 Ast.ExApp (_loc,
9092 Ast.ExId (_loc,
9093 Ast.IdAcc (_loc,
9094 Ast.IdUid (_loc, "Ast"),
9095 Ast.IdUid (_loc, "StVal"))),
9096 meta_loc _loc x0),
9097 meta_meta_bool _loc x1),
9098 meta_binding _loc x2)
9099 | Ast.StTyp (x0, x1) ->
9100 Ast.ExApp (_loc,
9101 Ast.ExApp (_loc,
9102 Ast.ExId (_loc,
9103 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9104 Ast.IdUid (_loc, "StTyp"))),
9105 meta_loc _loc x0),
9106 meta_ctyp _loc x1)
9107 | Ast.StOpn (x0, x1) ->
9108 Ast.ExApp (_loc,
9109 Ast.ExApp (_loc,
9110 Ast.ExId (_loc,
9111 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9112 Ast.IdUid (_loc, "StOpn"))),
9113 meta_loc _loc x0),
9114 meta_ident _loc x1)
9115 | Ast.StMty (x0, x1, x2) ->
9116 Ast.ExApp (_loc,
9117 Ast.ExApp (_loc,
9118 Ast.ExApp (_loc,
9119 Ast.ExId (_loc,
9120 Ast.IdAcc (_loc,
9121 Ast.IdUid (_loc, "Ast"),
9122 Ast.IdUid (_loc, "StMty"))),
9123 meta_loc _loc x0),
9124 meta_string _loc x1),
9125 meta_module_type _loc x2)
9126 | Ast.StRecMod (x0, x1) ->
9127 Ast.ExApp (_loc,
9128 Ast.ExApp (_loc,
9129 Ast.ExId (_loc,
9130 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9131 Ast.IdUid (_loc, "StRecMod"))),
9132 meta_loc _loc x0),
9133 meta_module_binding _loc x1)
9134 | Ast.StMod (x0, x1, x2) ->
9135 Ast.ExApp (_loc,
9136 Ast.ExApp (_loc,
9137 Ast.ExApp (_loc,
9138 Ast.ExId (_loc,
9139 Ast.IdAcc (_loc,
9140 Ast.IdUid (_loc, "Ast"),
9141 Ast.IdUid (_loc, "StMod"))),
9142 meta_loc _loc x0),
9143 meta_string _loc x1),
9144 meta_module_expr _loc x2)
9145 | Ast.StInc (x0, x1) ->
9146 Ast.ExApp (_loc,
9147 Ast.ExApp (_loc,
9148 Ast.ExId (_loc,
9149 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9150 Ast.IdUid (_loc, "StInc"))),
9151 meta_loc _loc x0),
9152 meta_module_expr _loc x1)
9153 | Ast.StExt (x0, x1, x2, x3) ->
9154 Ast.ExApp (_loc,
9155 Ast.ExApp (_loc,
9156 Ast.ExApp (_loc,
9157 Ast.ExApp (_loc,
9158 Ast.ExId (_loc,
9159 Ast.IdAcc (_loc,
9160 Ast.IdUid (_loc, "Ast"),
9161 Ast.IdUid (_loc, "StExt"))),
9162 meta_loc _loc x0),
9163 meta_string _loc x1),
9164 meta_ctyp _loc x2),
9165 meta_meta_list meta_string _loc x3)
9166 | Ast.StExp (x0, x1) ->
9167 Ast.ExApp (_loc,
9168 Ast.ExApp (_loc,
9169 Ast.ExId (_loc,
9170 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9171 Ast.IdUid (_loc, "StExp"))),
9172 meta_loc _loc x0),
9173 meta_expr _loc x1)
9174 | Ast.StExc (x0, x1, x2) ->
9175 Ast.ExApp (_loc,
9176 Ast.ExApp (_loc,
9177 Ast.ExApp (_loc,
9178 Ast.ExId (_loc,
9179 Ast.IdAcc (_loc,
9180 Ast.IdUid (_loc, "Ast"),
9181 Ast.IdUid (_loc, "StExc"))),
9182 meta_loc _loc x0),
9183 meta_ctyp _loc x1),
9184 meta_meta_option meta_ident _loc x2)
9185 | Ast.StDir (x0, x1, x2) ->
9186 Ast.ExApp (_loc,
9187 Ast.ExApp (_loc,
9188 Ast.ExApp (_loc,
9189 Ast.ExId (_loc,
9190 Ast.IdAcc (_loc,
9191 Ast.IdUid (_loc, "Ast"),
9192 Ast.IdUid (_loc, "StDir"))),
9193 meta_loc _loc x0),
9194 meta_string _loc x1),
9195 meta_expr _loc x2)
9196 | Ast.StSem (x0, x1, x2) ->
9197 Ast.ExApp (_loc,
9198 Ast.ExApp (_loc,
9199 Ast.ExApp (_loc,
9200 Ast.ExId (_loc,
9201 Ast.IdAcc (_loc,
9202 Ast.IdUid (_loc, "Ast"),
9203 Ast.IdUid (_loc, "StSem"))),
9204 meta_loc _loc x0),
9205 meta_str_item _loc x1),
9206 meta_str_item _loc x2)
9207 | Ast.StClt (x0, x1) ->
9208 Ast.ExApp (_loc,
9209 Ast.ExApp (_loc,
9210 Ast.ExId (_loc,
9211 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9212 Ast.IdUid (_loc, "StClt"))),
9213 meta_loc _loc x0),
9214 meta_class_type _loc x1)
9215 | Ast.StCls (x0, x1) ->
9216 Ast.ExApp (_loc,
9217 Ast.ExApp (_loc,
9218 Ast.ExId (_loc,
9219 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9220 Ast.IdUid (_loc, "StCls"))),
9221 meta_loc _loc x0),
9222 meta_class_expr _loc x1)
9223 | Ast.StNil x0 ->
9224 Ast.ExApp (_loc,
9225 Ast.ExId (_loc,
9226 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9227 Ast.IdUid (_loc, "StNil"))),
9228 meta_loc _loc x0)
9229 and meta_with_constr _loc =
9230 function
9231 | Ast.WcAnt (x0, x1) -> Ast.ExAnt (x0, x1)
9232 | Ast.WcAnd (x0, x1, x2) ->
9233 Ast.ExApp (_loc,
9234 Ast.ExApp (_loc,
9235 Ast.ExApp (_loc,
9236 Ast.ExId (_loc,
9237 Ast.IdAcc (_loc,
9238 Ast.IdUid (_loc, "Ast"),
9239 Ast.IdUid (_loc, "WcAnd"))),
9240 meta_loc _loc x0),
9241 meta_with_constr _loc x1),
9242 meta_with_constr _loc x2)
9243 | Ast.WcMod (x0, x1, x2) ->
9244 Ast.ExApp (_loc,
9245 Ast.ExApp (_loc,
9246 Ast.ExApp (_loc,
9247 Ast.ExId (_loc,
9248 Ast.IdAcc (_loc,
9249 Ast.IdUid (_loc, "Ast"),
9250 Ast.IdUid (_loc, "WcMod"))),
9251 meta_loc _loc x0),
9252 meta_ident _loc x1),
9253 meta_ident _loc x2)
9254 | Ast.WcTyp (x0, x1, x2) ->
9255 Ast.ExApp (_loc,
9256 Ast.ExApp (_loc,
9257 Ast.ExApp (_loc,
9258 Ast.ExId (_loc,
9259 Ast.IdAcc (_loc,
9260 Ast.IdUid (_loc, "Ast"),
9261 Ast.IdUid (_loc, "WcTyp"))),
9262 meta_loc _loc x0),
9263 meta_ctyp _loc x1),
9264 meta_ctyp _loc x2)
9265 | Ast.WcNil x0 ->
9266 Ast.ExApp (_loc,
9267 Ast.ExId (_loc,
9268 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9269 Ast.IdUid (_loc, "WcNil"))),
9270 meta_loc _loc x0)
9274 let meta_loc = meta_loc_patt
9276 module Patt =
9277 struct
9278 let meta_string _loc s = Ast.PaStr (_loc, s)
9280 let meta_int _loc s = Ast.PaInt (_loc, s)
9282 let meta_float _loc s = Ast.PaFlo (_loc, s)
9284 let meta_char _loc s = Ast.PaChr (_loc, s)
9286 let meta_bool _loc =
9287 function
9288 | false ->
9289 Ast.PaId (_loc, Ast.IdUid (_loc, "False"))
9290 | true -> Ast.PaId (_loc, Ast.IdUid (_loc, "True"))
9292 let rec meta_list mf_a _loc =
9293 function
9294 | [] -> Ast.PaId (_loc, Ast.IdUid (_loc, "[]"))
9295 | x :: xs ->
9296 Ast.PaApp (_loc,
9297 Ast.PaApp (_loc,
9298 Ast.PaId (_loc, Ast.IdUid (_loc, "::")),
9299 mf_a _loc x),
9300 meta_list mf_a _loc xs)
9302 let rec meta_binding _loc =
9303 function
9304 | Ast.BiAnt (x0, x1) -> Ast.PaAnt (x0, x1)
9305 | Ast.BiEq (x0, x1, x2) ->
9306 Ast.PaApp (_loc,
9307 Ast.PaApp (_loc,
9308 Ast.PaApp (_loc,
9309 Ast.PaId (_loc,
9310 Ast.IdAcc (_loc,
9311 Ast.IdUid (_loc, "Ast"),
9312 Ast.IdUid (_loc, "BiEq"))),
9313 meta_loc _loc x0),
9314 meta_patt _loc x1),
9315 meta_expr _loc x2)
9316 | Ast.BiAnd (x0, x1, x2) ->
9317 Ast.PaApp (_loc,
9318 Ast.PaApp (_loc,
9319 Ast.PaApp (_loc,
9320 Ast.PaId (_loc,
9321 Ast.IdAcc (_loc,
9322 Ast.IdUid (_loc, "Ast"),
9323 Ast.IdUid (_loc, "BiAnd"))),
9324 meta_loc _loc x0),
9325 meta_binding _loc x1),
9326 meta_binding _loc x2)
9327 | Ast.BiNil x0 ->
9328 Ast.PaApp (_loc,
9329 Ast.PaId (_loc,
9330 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9331 Ast.IdUid (_loc, "BiNil"))),
9332 meta_loc _loc x0)
9333 and meta_class_expr _loc =
9334 function
9335 | Ast.CeAnt (x0, x1) -> Ast.PaAnt (x0, x1)
9336 | Ast.CeEq (x0, x1, x2) ->
9337 Ast.PaApp (_loc,
9338 Ast.PaApp (_loc,
9339 Ast.PaApp (_loc,
9340 Ast.PaId (_loc,
9341 Ast.IdAcc (_loc,
9342 Ast.IdUid (_loc, "Ast"),
9343 Ast.IdUid (_loc, "CeEq"))),
9344 meta_loc _loc x0),
9345 meta_class_expr _loc x1),
9346 meta_class_expr _loc x2)
9347 | Ast.CeAnd (x0, x1, x2) ->
9348 Ast.PaApp (_loc,
9349 Ast.PaApp (_loc,
9350 Ast.PaApp (_loc,
9351 Ast.PaId (_loc,
9352 Ast.IdAcc (_loc,
9353 Ast.IdUid (_loc, "Ast"),
9354 Ast.IdUid (_loc, "CeAnd"))),
9355 meta_loc _loc x0),
9356 meta_class_expr _loc x1),
9357 meta_class_expr _loc x2)
9358 | Ast.CeTyc (x0, x1, x2) ->
9359 Ast.PaApp (_loc,
9360 Ast.PaApp (_loc,
9361 Ast.PaApp (_loc,
9362 Ast.PaId (_loc,
9363 Ast.IdAcc (_loc,
9364 Ast.IdUid (_loc, "Ast"),
9365 Ast.IdUid (_loc, "CeTyc"))),
9366 meta_loc _loc x0),
9367 meta_class_expr _loc x1),
9368 meta_class_type _loc x2)
9369 | Ast.CeStr (x0, x1, x2) ->
9370 Ast.PaApp (_loc,
9371 Ast.PaApp (_loc,
9372 Ast.PaApp (_loc,
9373 Ast.PaId (_loc,
9374 Ast.IdAcc (_loc,
9375 Ast.IdUid (_loc, "Ast"),
9376 Ast.IdUid (_loc, "CeStr"))),
9377 meta_loc _loc x0),
9378 meta_patt _loc x1),
9379 meta_class_str_item _loc x2)
9380 | Ast.CeLet (x0, x1, x2, x3) ->
9381 Ast.PaApp (_loc,
9382 Ast.PaApp (_loc,
9383 Ast.PaApp (_loc,
9384 Ast.PaApp (_loc,
9385 Ast.PaId (_loc,
9386 Ast.IdAcc (_loc,
9387 Ast.IdUid (_loc, "Ast"),
9388 Ast.IdUid (_loc, "CeLet"))),
9389 meta_loc _loc x0),
9390 meta_meta_bool _loc x1),
9391 meta_binding _loc x2),
9392 meta_class_expr _loc x3)
9393 | Ast.CeFun (x0, x1, x2) ->
9394 Ast.PaApp (_loc,
9395 Ast.PaApp (_loc,
9396 Ast.PaApp (_loc,
9397 Ast.PaId (_loc,
9398 Ast.IdAcc (_loc,
9399 Ast.IdUid (_loc, "Ast"),
9400 Ast.IdUid (_loc, "CeFun"))),
9401 meta_loc _loc x0),
9402 meta_patt _loc x1),
9403 meta_class_expr _loc x2)
9404 | Ast.CeCon (x0, x1, x2, x3) ->
9405 Ast.PaApp (_loc,
9406 Ast.PaApp (_loc,
9407 Ast.PaApp (_loc,
9408 Ast.PaApp (_loc,
9409 Ast.PaId (_loc,
9410 Ast.IdAcc (_loc,
9411 Ast.IdUid (_loc, "Ast"),
9412 Ast.IdUid (_loc, "CeCon"))),
9413 meta_loc _loc x0),
9414 meta_meta_bool _loc x1),
9415 meta_ident _loc x2),
9416 meta_ctyp _loc x3)
9417 | Ast.CeApp (x0, x1, x2) ->
9418 Ast.PaApp (_loc,
9419 Ast.PaApp (_loc,
9420 Ast.PaApp (_loc,
9421 Ast.PaId (_loc,
9422 Ast.IdAcc (_loc,
9423 Ast.IdUid (_loc, "Ast"),
9424 Ast.IdUid (_loc, "CeApp"))),
9425 meta_loc _loc x0),
9426 meta_class_expr _loc x1),
9427 meta_expr _loc x2)
9428 | Ast.CeNil x0 ->
9429 Ast.PaApp (_loc,
9430 Ast.PaId (_loc,
9431 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9432 Ast.IdUid (_loc, "CeNil"))),
9433 meta_loc _loc x0)
9434 and meta_class_sig_item _loc =
9435 function
9436 | Ast.CgAnt (x0, x1) -> Ast.PaAnt (x0, x1)
9437 | Ast.CgVir (x0, x1, x2, x3) ->
9438 Ast.PaApp (_loc,
9439 Ast.PaApp (_loc,
9440 Ast.PaApp (_loc,
9441 Ast.PaApp (_loc,
9442 Ast.PaId (_loc,
9443 Ast.IdAcc (_loc,
9444 Ast.IdUid (_loc, "Ast"),
9445 Ast.IdUid (_loc, "CgVir"))),
9446 meta_loc _loc x0),
9447 meta_string _loc x1),
9448 meta_meta_bool _loc x2),
9449 meta_ctyp _loc x3)
9450 | Ast.CgVal (x0, x1, x2, x3, x4) ->
9451 Ast.PaApp (_loc,
9452 Ast.PaApp (_loc,
9453 Ast.PaApp (_loc,
9454 Ast.PaApp (_loc,
9455 Ast.PaApp (_loc,
9456 Ast.PaId (_loc,
9457 Ast.IdAcc (_loc,
9458 Ast.IdUid (_loc, "Ast"),
9459 Ast.IdUid (_loc, "CgVal"))),
9460 meta_loc _loc x0),
9461 meta_string _loc x1),
9462 meta_meta_bool _loc x2),
9463 meta_meta_bool _loc x3),
9464 meta_ctyp _loc x4)
9465 | Ast.CgMth (x0, x1, x2, x3) ->
9466 Ast.PaApp (_loc,
9467 Ast.PaApp (_loc,
9468 Ast.PaApp (_loc,
9469 Ast.PaApp (_loc,
9470 Ast.PaId (_loc,
9471 Ast.IdAcc (_loc,
9472 Ast.IdUid (_loc, "Ast"),
9473 Ast.IdUid (_loc, "CgMth"))),
9474 meta_loc _loc x0),
9475 meta_string _loc x1),
9476 meta_meta_bool _loc x2),
9477 meta_ctyp _loc x3)
9478 | Ast.CgInh (x0, x1) ->
9479 Ast.PaApp (_loc,
9480 Ast.PaApp (_loc,
9481 Ast.PaId (_loc,
9482 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9483 Ast.IdUid (_loc, "CgInh"))),
9484 meta_loc _loc x0),
9485 meta_class_type _loc x1)
9486 | Ast.CgSem (x0, x1, x2) ->
9487 Ast.PaApp (_loc,
9488 Ast.PaApp (_loc,
9489 Ast.PaApp (_loc,
9490 Ast.PaId (_loc,
9491 Ast.IdAcc (_loc,
9492 Ast.IdUid (_loc, "Ast"),
9493 Ast.IdUid (_loc, "CgSem"))),
9494 meta_loc _loc x0),
9495 meta_class_sig_item _loc x1),
9496 meta_class_sig_item _loc x2)
9497 | Ast.CgCtr (x0, x1, x2) ->
9498 Ast.PaApp (_loc,
9499 Ast.PaApp (_loc,
9500 Ast.PaApp (_loc,
9501 Ast.PaId (_loc,
9502 Ast.IdAcc (_loc,
9503 Ast.IdUid (_loc, "Ast"),
9504 Ast.IdUid (_loc, "CgCtr"))),
9505 meta_loc _loc x0),
9506 meta_ctyp _loc x1),
9507 meta_ctyp _loc x2)
9508 | Ast.CgNil x0 ->
9509 Ast.PaApp (_loc,
9510 Ast.PaId (_loc,
9511 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9512 Ast.IdUid (_loc, "CgNil"))),
9513 meta_loc _loc x0)
9514 and meta_class_str_item _loc =
9515 function
9516 | Ast.CrAnt (x0, x1) -> Ast.PaAnt (x0, x1)
9517 | Ast.CrVvr (x0, x1, x2, x3) ->
9518 Ast.PaApp (_loc,
9519 Ast.PaApp (_loc,
9520 Ast.PaApp (_loc,
9521 Ast.PaApp (_loc,
9522 Ast.PaId (_loc,
9523 Ast.IdAcc (_loc,
9524 Ast.IdUid (_loc, "Ast"),
9525 Ast.IdUid (_loc, "CrVvr"))),
9526 meta_loc _loc x0),
9527 meta_string _loc x1),
9528 meta_meta_bool _loc x2),
9529 meta_ctyp _loc x3)
9530 | Ast.CrVir (x0, x1, x2, x3) ->
9531 Ast.PaApp (_loc,
9532 Ast.PaApp (_loc,
9533 Ast.PaApp (_loc,
9534 Ast.PaApp (_loc,
9535 Ast.PaId (_loc,
9536 Ast.IdAcc (_loc,
9537 Ast.IdUid (_loc, "Ast"),
9538 Ast.IdUid (_loc, "CrVir"))),
9539 meta_loc _loc x0),
9540 meta_string _loc x1),
9541 meta_meta_bool _loc x2),
9542 meta_ctyp _loc x3)
9543 | Ast.CrVal (x0, x1, x2, x3) ->
9544 Ast.PaApp (_loc,
9545 Ast.PaApp (_loc,
9546 Ast.PaApp (_loc,
9547 Ast.PaApp (_loc,
9548 Ast.PaId (_loc,
9549 Ast.IdAcc (_loc,
9550 Ast.IdUid (_loc, "Ast"),
9551 Ast.IdUid (_loc, "CrVal"))),
9552 meta_loc _loc x0),
9553 meta_string _loc x1),
9554 meta_meta_bool _loc x2),
9555 meta_expr _loc x3)
9556 | Ast.CrMth (x0, x1, x2, x3, x4) ->
9557 Ast.PaApp (_loc,
9558 Ast.PaApp (_loc,
9559 Ast.PaApp (_loc,
9560 Ast.PaApp (_loc,
9561 Ast.PaApp (_loc,
9562 Ast.PaId (_loc,
9563 Ast.IdAcc (_loc,
9564 Ast.IdUid (_loc, "Ast"),
9565 Ast.IdUid (_loc, "CrMth"))),
9566 meta_loc _loc x0),
9567 meta_string _loc x1),
9568 meta_meta_bool _loc x2),
9569 meta_expr _loc x3),
9570 meta_ctyp _loc x4)
9571 | Ast.CrIni (x0, x1) ->
9572 Ast.PaApp (_loc,
9573 Ast.PaApp (_loc,
9574 Ast.PaId (_loc,
9575 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9576 Ast.IdUid (_loc, "CrIni"))),
9577 meta_loc _loc x0),
9578 meta_expr _loc x1)
9579 | Ast.CrInh (x0, x1, x2) ->
9580 Ast.PaApp (_loc,
9581 Ast.PaApp (_loc,
9582 Ast.PaApp (_loc,
9583 Ast.PaId (_loc,
9584 Ast.IdAcc (_loc,
9585 Ast.IdUid (_loc, "Ast"),
9586 Ast.IdUid (_loc, "CrInh"))),
9587 meta_loc _loc x0),
9588 meta_class_expr _loc x1),
9589 meta_string _loc x2)
9590 | Ast.CrCtr (x0, x1, x2) ->
9591 Ast.PaApp (_loc,
9592 Ast.PaApp (_loc,
9593 Ast.PaApp (_loc,
9594 Ast.PaId (_loc,
9595 Ast.IdAcc (_loc,
9596 Ast.IdUid (_loc, "Ast"),
9597 Ast.IdUid (_loc, "CrCtr"))),
9598 meta_loc _loc x0),
9599 meta_ctyp _loc x1),
9600 meta_ctyp _loc x2)
9601 | Ast.CrSem (x0, x1, x2) ->
9602 Ast.PaApp (_loc,
9603 Ast.PaApp (_loc,
9604 Ast.PaApp (_loc,
9605 Ast.PaId (_loc,
9606 Ast.IdAcc (_loc,
9607 Ast.IdUid (_loc, "Ast"),
9608 Ast.IdUid (_loc, "CrSem"))),
9609 meta_loc _loc x0),
9610 meta_class_str_item _loc x1),
9611 meta_class_str_item _loc x2)
9612 | Ast.CrNil x0 ->
9613 Ast.PaApp (_loc,
9614 Ast.PaId (_loc,
9615 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9616 Ast.IdUid (_loc, "CrNil"))),
9617 meta_loc _loc x0)
9618 and meta_class_type _loc =
9619 function
9620 | Ast.CtAnt (x0, x1) -> Ast.PaAnt (x0, x1)
9621 | Ast.CtEq (x0, x1, x2) ->
9622 Ast.PaApp (_loc,
9623 Ast.PaApp (_loc,
9624 Ast.PaApp (_loc,
9625 Ast.PaId (_loc,
9626 Ast.IdAcc (_loc,
9627 Ast.IdUid (_loc, "Ast"),
9628 Ast.IdUid (_loc, "CtEq"))),
9629 meta_loc _loc x0),
9630 meta_class_type _loc x1),
9631 meta_class_type _loc x2)
9632 | Ast.CtCol (x0, x1, x2) ->
9633 Ast.PaApp (_loc,
9634 Ast.PaApp (_loc,
9635 Ast.PaApp (_loc,
9636 Ast.PaId (_loc,
9637 Ast.IdAcc (_loc,
9638 Ast.IdUid (_loc, "Ast"),
9639 Ast.IdUid (_loc, "CtCol"))),
9640 meta_loc _loc x0),
9641 meta_class_type _loc x1),
9642 meta_class_type _loc x2)
9643 | Ast.CtAnd (x0, x1, x2) ->
9644 Ast.PaApp (_loc,
9645 Ast.PaApp (_loc,
9646 Ast.PaApp (_loc,
9647 Ast.PaId (_loc,
9648 Ast.IdAcc (_loc,
9649 Ast.IdUid (_loc, "Ast"),
9650 Ast.IdUid (_loc, "CtAnd"))),
9651 meta_loc _loc x0),
9652 meta_class_type _loc x1),
9653 meta_class_type _loc x2)
9654 | Ast.CtSig (x0, x1, x2) ->
9655 Ast.PaApp (_loc,
9656 Ast.PaApp (_loc,
9657 Ast.PaApp (_loc,
9658 Ast.PaId (_loc,
9659 Ast.IdAcc (_loc,
9660 Ast.IdUid (_loc, "Ast"),
9661 Ast.IdUid (_loc, "CtSig"))),
9662 meta_loc _loc x0),
9663 meta_ctyp _loc x1),
9664 meta_class_sig_item _loc x2)
9665 | Ast.CtFun (x0, x1, x2) ->
9666 Ast.PaApp (_loc,
9667 Ast.PaApp (_loc,
9668 Ast.PaApp (_loc,
9669 Ast.PaId (_loc,
9670 Ast.IdAcc (_loc,
9671 Ast.IdUid (_loc, "Ast"),
9672 Ast.IdUid (_loc, "CtFun"))),
9673 meta_loc _loc x0),
9674 meta_ctyp _loc x1),
9675 meta_class_type _loc x2)
9676 | Ast.CtCon (x0, x1, x2, x3) ->
9677 Ast.PaApp (_loc,
9678 Ast.PaApp (_loc,
9679 Ast.PaApp (_loc,
9680 Ast.PaApp (_loc,
9681 Ast.PaId (_loc,
9682 Ast.IdAcc (_loc,
9683 Ast.IdUid (_loc, "Ast"),
9684 Ast.IdUid (_loc, "CtCon"))),
9685 meta_loc _loc x0),
9686 meta_meta_bool _loc x1),
9687 meta_ident _loc x2),
9688 meta_ctyp _loc x3)
9689 | Ast.CtNil x0 ->
9690 Ast.PaApp (_loc,
9691 Ast.PaId (_loc,
9692 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9693 Ast.IdUid (_loc, "CtNil"))),
9694 meta_loc _loc x0)
9695 and meta_ctyp _loc =
9696 function
9697 | Ast.TyAnt (x0, x1) -> Ast.PaAnt (x0, x1)
9698 | Ast.TyOfAmp (x0, x1, x2) ->
9699 Ast.PaApp (_loc,
9700 Ast.PaApp (_loc,
9701 Ast.PaApp (_loc,
9702 Ast.PaId (_loc,
9703 Ast.IdAcc (_loc,
9704 Ast.IdUid (_loc, "Ast"),
9705 Ast.IdUid (_loc, "TyOfAmp"))),
9706 meta_loc _loc x0),
9707 meta_ctyp _loc x1),
9708 meta_ctyp _loc x2)
9709 | Ast.TyAmp (x0, x1, x2) ->
9710 Ast.PaApp (_loc,
9711 Ast.PaApp (_loc,
9712 Ast.PaApp (_loc,
9713 Ast.PaId (_loc,
9714 Ast.IdAcc (_loc,
9715 Ast.IdUid (_loc, "Ast"),
9716 Ast.IdUid (_loc, "TyAmp"))),
9717 meta_loc _loc x0),
9718 meta_ctyp _loc x1),
9719 meta_ctyp _loc x2)
9720 | Ast.TyVrnInfSup (x0, x1, x2) ->
9721 Ast.PaApp (_loc,
9722 Ast.PaApp (_loc,
9723 Ast.PaApp (_loc,
9724 Ast.PaId (_loc,
9725 Ast.IdAcc (_loc,
9726 Ast.IdUid (_loc, "Ast"),
9727 Ast.IdUid (_loc, "TyVrnInfSup"))),
9728 meta_loc _loc x0),
9729 meta_ctyp _loc x1),
9730 meta_ctyp _loc x2)
9731 | Ast.TyVrnInf (x0, x1) ->
9732 Ast.PaApp (_loc,
9733 Ast.PaApp (_loc,
9734 Ast.PaId (_loc,
9735 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9736 Ast.IdUid (_loc, "TyVrnInf"))),
9737 meta_loc _loc x0),
9738 meta_ctyp _loc x1)
9739 | Ast.TyVrnSup (x0, x1) ->
9740 Ast.PaApp (_loc,
9741 Ast.PaApp (_loc,
9742 Ast.PaId (_loc,
9743 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9744 Ast.IdUid (_loc, "TyVrnSup"))),
9745 meta_loc _loc x0),
9746 meta_ctyp _loc x1)
9747 | Ast.TyVrnEq (x0, x1) ->
9748 Ast.PaApp (_loc,
9749 Ast.PaApp (_loc,
9750 Ast.PaId (_loc,
9751 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9752 Ast.IdUid (_loc, "TyVrnEq"))),
9753 meta_loc _loc x0),
9754 meta_ctyp _loc x1)
9755 | Ast.TySta (x0, x1, x2) ->
9756 Ast.PaApp (_loc,
9757 Ast.PaApp (_loc,
9758 Ast.PaApp (_loc,
9759 Ast.PaId (_loc,
9760 Ast.IdAcc (_loc,
9761 Ast.IdUid (_loc, "Ast"),
9762 Ast.IdUid (_loc, "TySta"))),
9763 meta_loc _loc x0),
9764 meta_ctyp _loc x1),
9765 meta_ctyp _loc x2)
9766 | Ast.TyTup (x0, x1) ->
9767 Ast.PaApp (_loc,
9768 Ast.PaApp (_loc,
9769 Ast.PaId (_loc,
9770 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9771 Ast.IdUid (_loc, "TyTup"))),
9772 meta_loc _loc x0),
9773 meta_ctyp _loc x1)
9774 | Ast.TyMut (x0, x1) ->
9775 Ast.PaApp (_loc,
9776 Ast.PaApp (_loc,
9777 Ast.PaId (_loc,
9778 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9779 Ast.IdUid (_loc, "TyMut"))),
9780 meta_loc _loc x0),
9781 meta_ctyp _loc x1)
9782 | Ast.TyPrv (x0, x1) ->
9783 Ast.PaApp (_loc,
9784 Ast.PaApp (_loc,
9785 Ast.PaId (_loc,
9786 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9787 Ast.IdUid (_loc, "TyPrv"))),
9788 meta_loc _loc x0),
9789 meta_ctyp _loc x1)
9790 | Ast.TyOr (x0, x1, x2) ->
9791 Ast.PaApp (_loc,
9792 Ast.PaApp (_loc,
9793 Ast.PaApp (_loc,
9794 Ast.PaId (_loc,
9795 Ast.IdAcc (_loc,
9796 Ast.IdUid (_loc, "Ast"),
9797 Ast.IdUid (_loc, "TyOr"))),
9798 meta_loc _loc x0),
9799 meta_ctyp _loc x1),
9800 meta_ctyp _loc x2)
9801 | Ast.TyAnd (x0, x1, x2) ->
9802 Ast.PaApp (_loc,
9803 Ast.PaApp (_loc,
9804 Ast.PaApp (_loc,
9805 Ast.PaId (_loc,
9806 Ast.IdAcc (_loc,
9807 Ast.IdUid (_loc, "Ast"),
9808 Ast.IdUid (_loc, "TyAnd"))),
9809 meta_loc _loc x0),
9810 meta_ctyp _loc x1),
9811 meta_ctyp _loc x2)
9812 | Ast.TyOf (x0, x1, x2) ->
9813 Ast.PaApp (_loc,
9814 Ast.PaApp (_loc,
9815 Ast.PaApp (_loc,
9816 Ast.PaId (_loc,
9817 Ast.IdAcc (_loc,
9818 Ast.IdUid (_loc, "Ast"),
9819 Ast.IdUid (_loc, "TyOf"))),
9820 meta_loc _loc x0),
9821 meta_ctyp _loc x1),
9822 meta_ctyp _loc x2)
9823 | Ast.TySum (x0, x1) ->
9824 Ast.PaApp (_loc,
9825 Ast.PaApp (_loc,
9826 Ast.PaId (_loc,
9827 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9828 Ast.IdUid (_loc, "TySum"))),
9829 meta_loc _loc x0),
9830 meta_ctyp _loc x1)
9831 | Ast.TyCom (x0, x1, x2) ->
9832 Ast.PaApp (_loc,
9833 Ast.PaApp (_loc,
9834 Ast.PaApp (_loc,
9835 Ast.PaId (_loc,
9836 Ast.IdAcc (_loc,
9837 Ast.IdUid (_loc, "Ast"),
9838 Ast.IdUid (_loc, "TyCom"))),
9839 meta_loc _loc x0),
9840 meta_ctyp _loc x1),
9841 meta_ctyp _loc x2)
9842 | Ast.TySem (x0, x1, x2) ->
9843 Ast.PaApp (_loc,
9844 Ast.PaApp (_loc,
9845 Ast.PaApp (_loc,
9846 Ast.PaId (_loc,
9847 Ast.IdAcc (_loc,
9848 Ast.IdUid (_loc, "Ast"),
9849 Ast.IdUid (_loc, "TySem"))),
9850 meta_loc _loc x0),
9851 meta_ctyp _loc x1),
9852 meta_ctyp _loc x2)
9853 | Ast.TyCol (x0, x1, x2) ->
9854 Ast.PaApp (_loc,
9855 Ast.PaApp (_loc,
9856 Ast.PaApp (_loc,
9857 Ast.PaId (_loc,
9858 Ast.IdAcc (_loc,
9859 Ast.IdUid (_loc, "Ast"),
9860 Ast.IdUid (_loc, "TyCol"))),
9861 meta_loc _loc x0),
9862 meta_ctyp _loc x1),
9863 meta_ctyp _loc x2)
9864 | Ast.TyRec (x0, x1) ->
9865 Ast.PaApp (_loc,
9866 Ast.PaApp (_loc,
9867 Ast.PaId (_loc,
9868 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9869 Ast.IdUid (_loc, "TyRec"))),
9870 meta_loc _loc x0),
9871 meta_ctyp _loc x1)
9872 | Ast.TyVrn (x0, x1) ->
9873 Ast.PaApp (_loc,
9874 Ast.PaApp (_loc,
9875 Ast.PaId (_loc,
9876 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9877 Ast.IdUid (_loc, "TyVrn"))),
9878 meta_loc _loc x0),
9879 meta_string _loc x1)
9880 | Ast.TyQuM (x0, x1) ->
9881 Ast.PaApp (_loc,
9882 Ast.PaApp (_loc,
9883 Ast.PaId (_loc,
9884 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9885 Ast.IdUid (_loc, "TyQuM"))),
9886 meta_loc _loc x0),
9887 meta_string _loc x1)
9888 | Ast.TyQuP (x0, x1) ->
9889 Ast.PaApp (_loc,
9890 Ast.PaApp (_loc,
9891 Ast.PaId (_loc,
9892 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9893 Ast.IdUid (_loc, "TyQuP"))),
9894 meta_loc _loc x0),
9895 meta_string _loc x1)
9896 | Ast.TyQuo (x0, x1) ->
9897 Ast.PaApp (_loc,
9898 Ast.PaApp (_loc,
9899 Ast.PaId (_loc,
9900 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9901 Ast.IdUid (_loc, "TyQuo"))),
9902 meta_loc _loc x0),
9903 meta_string _loc x1)
9904 | Ast.TyPol (x0, x1, x2) ->
9905 Ast.PaApp (_loc,
9906 Ast.PaApp (_loc,
9907 Ast.PaApp (_loc,
9908 Ast.PaId (_loc,
9909 Ast.IdAcc (_loc,
9910 Ast.IdUid (_loc, "Ast"),
9911 Ast.IdUid (_loc, "TyPol"))),
9912 meta_loc _loc x0),
9913 meta_ctyp _loc x1),
9914 meta_ctyp _loc x2)
9915 | Ast.TyOlb (x0, x1, x2) ->
9916 Ast.PaApp (_loc,
9917 Ast.PaApp (_loc,
9918 Ast.PaApp (_loc,
9919 Ast.PaId (_loc,
9920 Ast.IdAcc (_loc,
9921 Ast.IdUid (_loc, "Ast"),
9922 Ast.IdUid (_loc, "TyOlb"))),
9923 meta_loc _loc x0),
9924 meta_string _loc x1),
9925 meta_ctyp _loc x2)
9926 | Ast.TyObj (x0, x1, x2) ->
9927 Ast.PaApp (_loc,
9928 Ast.PaApp (_loc,
9929 Ast.PaApp (_loc,
9930 Ast.PaId (_loc,
9931 Ast.IdAcc (_loc,
9932 Ast.IdUid (_loc, "Ast"),
9933 Ast.IdUid (_loc, "TyObj"))),
9934 meta_loc _loc x0),
9935 meta_ctyp _loc x1),
9936 meta_meta_bool _loc x2)
9937 | Ast.TyDcl (x0, x1, x2, x3, x4) ->
9938 Ast.PaApp (_loc,
9939 Ast.PaApp (_loc,
9940 Ast.PaApp (_loc,
9941 Ast.PaApp (_loc,
9942 Ast.PaApp (_loc,
9943 Ast.PaId (_loc,
9944 Ast.IdAcc (_loc,
9945 Ast.IdUid (_loc, "Ast"),
9946 Ast.IdUid (_loc, "TyDcl"))),
9947 meta_loc _loc x0),
9948 meta_string _loc x1),
9949 meta_list meta_ctyp _loc x2),
9950 meta_ctyp _loc x3),
9951 meta_list
9952 (fun _loc (x1, x2) ->
9953 Ast.PaTup (_loc,
9954 Ast.PaCom (_loc, meta_ctyp _loc x1,
9955 meta_ctyp _loc x2)))
9956 _loc x4)
9957 | Ast.TyMan (x0, x1, x2) ->
9958 Ast.PaApp (_loc,
9959 Ast.PaApp (_loc,
9960 Ast.PaApp (_loc,
9961 Ast.PaId (_loc,
9962 Ast.IdAcc (_loc,
9963 Ast.IdUid (_loc, "Ast"),
9964 Ast.IdUid (_loc, "TyMan"))),
9965 meta_loc _loc x0),
9966 meta_ctyp _loc x1),
9967 meta_ctyp _loc x2)
9968 | Ast.TyId (x0, x1) ->
9969 Ast.PaApp (_loc,
9970 Ast.PaApp (_loc,
9971 Ast.PaId (_loc,
9972 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9973 Ast.IdUid (_loc, "TyId"))),
9974 meta_loc _loc x0),
9975 meta_ident _loc x1)
9976 | Ast.TyLab (x0, x1, x2) ->
9977 Ast.PaApp (_loc,
9978 Ast.PaApp (_loc,
9979 Ast.PaApp (_loc,
9980 Ast.PaId (_loc,
9981 Ast.IdAcc (_loc,
9982 Ast.IdUid (_loc, "Ast"),
9983 Ast.IdUid (_loc, "TyLab"))),
9984 meta_loc _loc x0),
9985 meta_string _loc x1),
9986 meta_ctyp _loc x2)
9987 | Ast.TyCls (x0, x1) ->
9988 Ast.PaApp (_loc,
9989 Ast.PaApp (_loc,
9990 Ast.PaId (_loc,
9991 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
9992 Ast.IdUid (_loc, "TyCls"))),
9993 meta_loc _loc x0),
9994 meta_ident _loc x1)
9995 | Ast.TyArr (x0, x1, x2) ->
9996 Ast.PaApp (_loc,
9997 Ast.PaApp (_loc,
9998 Ast.PaApp (_loc,
9999 Ast.PaId (_loc,
10000 Ast.IdAcc (_loc,
10001 Ast.IdUid (_loc, "Ast"),
10002 Ast.IdUid (_loc, "TyArr"))),
10003 meta_loc _loc x0),
10004 meta_ctyp _loc x1),
10005 meta_ctyp _loc x2)
10006 | Ast.TyApp (x0, x1, x2) ->
10007 Ast.PaApp (_loc,
10008 Ast.PaApp (_loc,
10009 Ast.PaApp (_loc,
10010 Ast.PaId (_loc,
10011 Ast.IdAcc (_loc,
10012 Ast.IdUid (_loc, "Ast"),
10013 Ast.IdUid (_loc, "TyApp"))),
10014 meta_loc _loc x0),
10015 meta_ctyp _loc x1),
10016 meta_ctyp _loc x2)
10017 | Ast.TyAny x0 ->
10018 Ast.PaApp (_loc,
10019 Ast.PaId (_loc,
10020 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10021 Ast.IdUid (_loc, "TyAny"))),
10022 meta_loc _loc x0)
10023 | Ast.TyAli (x0, x1, x2) ->
10024 Ast.PaApp (_loc,
10025 Ast.PaApp (_loc,
10026 Ast.PaApp (_loc,
10027 Ast.PaId (_loc,
10028 Ast.IdAcc (_loc,
10029 Ast.IdUid (_loc, "Ast"),
10030 Ast.IdUid (_loc, "TyAli"))),
10031 meta_loc _loc x0),
10032 meta_ctyp _loc x1),
10033 meta_ctyp _loc x2)
10034 | Ast.TyNil x0 ->
10035 Ast.PaApp (_loc,
10036 Ast.PaId (_loc,
10037 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10038 Ast.IdUid (_loc, "TyNil"))),
10039 meta_loc _loc x0)
10040 and meta_expr _loc =
10041 function
10042 | Ast.ExWhi (x0, x1, x2) ->
10043 Ast.PaApp (_loc,
10044 Ast.PaApp (_loc,
10045 Ast.PaApp (_loc,
10046 Ast.PaId (_loc,
10047 Ast.IdAcc (_loc,
10048 Ast.IdUid (_loc, "Ast"),
10049 Ast.IdUid (_loc, "ExWhi"))),
10050 meta_loc _loc x0),
10051 meta_expr _loc x1),
10052 meta_expr _loc x2)
10053 | Ast.ExVrn (x0, x1) ->
10054 Ast.PaApp (_loc,
10055 Ast.PaApp (_loc,
10056 Ast.PaId (_loc,
10057 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10058 Ast.IdUid (_loc, "ExVrn"))),
10059 meta_loc _loc x0),
10060 meta_string _loc x1)
10061 | Ast.ExTyc (x0, x1, x2) ->
10062 Ast.PaApp (_loc,
10063 Ast.PaApp (_loc,
10064 Ast.PaApp (_loc,
10065 Ast.PaId (_loc,
10066 Ast.IdAcc (_loc,
10067 Ast.IdUid (_loc, "Ast"),
10068 Ast.IdUid (_loc, "ExTyc"))),
10069 meta_loc _loc x0),
10070 meta_expr _loc x1),
10071 meta_ctyp _loc x2)
10072 | Ast.ExCom (x0, x1, x2) ->
10073 Ast.PaApp (_loc,
10074 Ast.PaApp (_loc,
10075 Ast.PaApp (_loc,
10076 Ast.PaId (_loc,
10077 Ast.IdAcc (_loc,
10078 Ast.IdUid (_loc, "Ast"),
10079 Ast.IdUid (_loc, "ExCom"))),
10080 meta_loc _loc x0),
10081 meta_expr _loc x1),
10082 meta_expr _loc x2)
10083 | Ast.ExTup (x0, x1) ->
10084 Ast.PaApp (_loc,
10085 Ast.PaApp (_loc,
10086 Ast.PaId (_loc,
10087 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10088 Ast.IdUid (_loc, "ExTup"))),
10089 meta_loc _loc x0),
10090 meta_expr _loc x1)
10091 | Ast.ExTry (x0, x1, x2) ->
10092 Ast.PaApp (_loc,
10093 Ast.PaApp (_loc,
10094 Ast.PaApp (_loc,
10095 Ast.PaId (_loc,
10096 Ast.IdAcc (_loc,
10097 Ast.IdUid (_loc, "Ast"),
10098 Ast.IdUid (_loc, "ExTry"))),
10099 meta_loc _loc x0),
10100 meta_expr _loc x1),
10101 meta_match_case _loc x2)
10102 | Ast.ExStr (x0, x1) ->
10103 Ast.PaApp (_loc,
10104 Ast.PaApp (_loc,
10105 Ast.PaId (_loc,
10106 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10107 Ast.IdUid (_loc, "ExStr"))),
10108 meta_loc _loc x0),
10109 meta_string _loc x1)
10110 | Ast.ExSte (x0, x1, x2) ->
10111 Ast.PaApp (_loc,
10112 Ast.PaApp (_loc,
10113 Ast.PaApp (_loc,
10114 Ast.PaId (_loc,
10115 Ast.IdAcc (_loc,
10116 Ast.IdUid (_loc, "Ast"),
10117 Ast.IdUid (_loc, "ExSte"))),
10118 meta_loc _loc x0),
10119 meta_expr _loc x1),
10120 meta_expr _loc x2)
10121 | Ast.ExSnd (x0, x1, x2) ->
10122 Ast.PaApp (_loc,
10123 Ast.PaApp (_loc,
10124 Ast.PaApp (_loc,
10125 Ast.PaId (_loc,
10126 Ast.IdAcc (_loc,
10127 Ast.IdUid (_loc, "Ast"),
10128 Ast.IdUid (_loc, "ExSnd"))),
10129 meta_loc _loc x0),
10130 meta_expr _loc x1),
10131 meta_string _loc x2)
10132 | Ast.ExSeq (x0, x1) ->
10133 Ast.PaApp (_loc,
10134 Ast.PaApp (_loc,
10135 Ast.PaId (_loc,
10136 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10137 Ast.IdUid (_loc, "ExSeq"))),
10138 meta_loc _loc x0),
10139 meta_expr _loc x1)
10140 | Ast.ExRec (x0, x1, x2) ->
10141 Ast.PaApp (_loc,
10142 Ast.PaApp (_loc,
10143 Ast.PaApp (_loc,
10144 Ast.PaId (_loc,
10145 Ast.IdAcc (_loc,
10146 Ast.IdUid (_loc, "Ast"),
10147 Ast.IdUid (_loc, "ExRec"))),
10148 meta_loc _loc x0),
10149 meta_rec_binding _loc x1),
10150 meta_expr _loc x2)
10151 | Ast.ExOvr (x0, x1) ->
10152 Ast.PaApp (_loc,
10153 Ast.PaApp (_loc,
10154 Ast.PaId (_loc,
10155 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10156 Ast.IdUid (_loc, "ExOvr"))),
10157 meta_loc _loc x0),
10158 meta_rec_binding _loc x1)
10159 | Ast.ExOlb (x0, x1, x2) ->
10160 Ast.PaApp (_loc,
10161 Ast.PaApp (_loc,
10162 Ast.PaApp (_loc,
10163 Ast.PaId (_loc,
10164 Ast.IdAcc (_loc,
10165 Ast.IdUid (_loc, "Ast"),
10166 Ast.IdUid (_loc, "ExOlb"))),
10167 meta_loc _loc x0),
10168 meta_string _loc x1),
10169 meta_expr _loc x2)
10170 | Ast.ExObj (x0, x1, x2) ->
10171 Ast.PaApp (_loc,
10172 Ast.PaApp (_loc,
10173 Ast.PaApp (_loc,
10174 Ast.PaId (_loc,
10175 Ast.IdAcc (_loc,
10176 Ast.IdUid (_loc, "Ast"),
10177 Ast.IdUid (_loc, "ExObj"))),
10178 meta_loc _loc x0),
10179 meta_patt _loc x1),
10180 meta_class_str_item _loc x2)
10181 | Ast.ExNew (x0, x1) ->
10182 Ast.PaApp (_loc,
10183 Ast.PaApp (_loc,
10184 Ast.PaId (_loc,
10185 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10186 Ast.IdUid (_loc, "ExNew"))),
10187 meta_loc _loc x0),
10188 meta_ident _loc x1)
10189 | Ast.ExMat (x0, x1, x2) ->
10190 Ast.PaApp (_loc,
10191 Ast.PaApp (_loc,
10192 Ast.PaApp (_loc,
10193 Ast.PaId (_loc,
10194 Ast.IdAcc (_loc,
10195 Ast.IdUid (_loc, "Ast"),
10196 Ast.IdUid (_loc, "ExMat"))),
10197 meta_loc _loc x0),
10198 meta_expr _loc x1),
10199 meta_match_case _loc x2)
10200 | Ast.ExLmd (x0, x1, x2, x3) ->
10201 Ast.PaApp (_loc,
10202 Ast.PaApp (_loc,
10203 Ast.PaApp (_loc,
10204 Ast.PaApp (_loc,
10205 Ast.PaId (_loc,
10206 Ast.IdAcc (_loc,
10207 Ast.IdUid (_loc, "Ast"),
10208 Ast.IdUid (_loc, "ExLmd"))),
10209 meta_loc _loc x0),
10210 meta_string _loc x1),
10211 meta_module_expr _loc x2),
10212 meta_expr _loc x3)
10213 | Ast.ExLet (x0, x1, x2, x3) ->
10214 Ast.PaApp (_loc,
10215 Ast.PaApp (_loc,
10216 Ast.PaApp (_loc,
10217 Ast.PaApp (_loc,
10218 Ast.PaId (_loc,
10219 Ast.IdAcc (_loc,
10220 Ast.IdUid (_loc, "Ast"),
10221 Ast.IdUid (_loc, "ExLet"))),
10222 meta_loc _loc x0),
10223 meta_meta_bool _loc x1),
10224 meta_binding _loc x2),
10225 meta_expr _loc x3)
10226 | Ast.ExLaz (x0, x1) ->
10227 Ast.PaApp (_loc,
10228 Ast.PaApp (_loc,
10229 Ast.PaId (_loc,
10230 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10231 Ast.IdUid (_loc, "ExLaz"))),
10232 meta_loc _loc x0),
10233 meta_expr _loc x1)
10234 | Ast.ExLab (x0, x1, x2) ->
10235 Ast.PaApp (_loc,
10236 Ast.PaApp (_loc,
10237 Ast.PaApp (_loc,
10238 Ast.PaId (_loc,
10239 Ast.IdAcc (_loc,
10240 Ast.IdUid (_loc, "Ast"),
10241 Ast.IdUid (_loc, "ExLab"))),
10242 meta_loc _loc x0),
10243 meta_string _loc x1),
10244 meta_expr _loc x2)
10245 | Ast.ExNativeInt (x0, x1) ->
10246 Ast.PaApp (_loc,
10247 Ast.PaApp (_loc,
10248 Ast.PaId (_loc,
10249 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10250 Ast.IdUid (_loc, "ExNativeInt"))),
10251 meta_loc _loc x0),
10252 meta_string _loc x1)
10253 | Ast.ExInt64 (x0, x1) ->
10254 Ast.PaApp (_loc,
10255 Ast.PaApp (_loc,
10256 Ast.PaId (_loc,
10257 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10258 Ast.IdUid (_loc, "ExInt64"))),
10259 meta_loc _loc x0),
10260 meta_string _loc x1)
10261 | Ast.ExInt32 (x0, x1) ->
10262 Ast.PaApp (_loc,
10263 Ast.PaApp (_loc,
10264 Ast.PaId (_loc,
10265 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10266 Ast.IdUid (_loc, "ExInt32"))),
10267 meta_loc _loc x0),
10268 meta_string _loc x1)
10269 | Ast.ExInt (x0, x1) ->
10270 Ast.PaApp (_loc,
10271 Ast.PaApp (_loc,
10272 Ast.PaId (_loc,
10273 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10274 Ast.IdUid (_loc, "ExInt"))),
10275 meta_loc _loc x0),
10276 meta_string _loc x1)
10277 | Ast.ExIfe (x0, x1, x2, x3) ->
10278 Ast.PaApp (_loc,
10279 Ast.PaApp (_loc,
10280 Ast.PaApp (_loc,
10281 Ast.PaApp (_loc,
10282 Ast.PaId (_loc,
10283 Ast.IdAcc (_loc,
10284 Ast.IdUid (_loc, "Ast"),
10285 Ast.IdUid (_loc, "ExIfe"))),
10286 meta_loc _loc x0),
10287 meta_expr _loc x1),
10288 meta_expr _loc x2),
10289 meta_expr _loc x3)
10290 | Ast.ExFun (x0, x1) ->
10291 Ast.PaApp (_loc,
10292 Ast.PaApp (_loc,
10293 Ast.PaId (_loc,
10294 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10295 Ast.IdUid (_loc, "ExFun"))),
10296 meta_loc _loc x0),
10297 meta_match_case _loc x1)
10298 | Ast.ExFor (x0, x1, x2, x3, x4, x5) ->
10299 Ast.PaApp (_loc,
10300 Ast.PaApp (_loc,
10301 Ast.PaApp (_loc,
10302 Ast.PaApp (_loc,
10303 Ast.PaApp (_loc,
10304 Ast.PaApp (_loc,
10305 Ast.PaId (_loc,
10306 Ast.IdAcc (_loc,
10307 Ast.IdUid (_loc, "Ast"),
10308 Ast.IdUid (_loc, "ExFor"))),
10309 meta_loc _loc x0),
10310 meta_string _loc x1),
10311 meta_expr _loc x2),
10312 meta_expr _loc x3),
10313 meta_meta_bool _loc x4),
10314 meta_expr _loc x5)
10315 | Ast.ExFlo (x0, x1) ->
10316 Ast.PaApp (_loc,
10317 Ast.PaApp (_loc,
10318 Ast.PaId (_loc,
10319 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10320 Ast.IdUid (_loc, "ExFlo"))),
10321 meta_loc _loc x0),
10322 meta_string _loc x1)
10323 | Ast.ExCoe (x0, x1, x2, x3) ->
10324 Ast.PaApp (_loc,
10325 Ast.PaApp (_loc,
10326 Ast.PaApp (_loc,
10327 Ast.PaApp (_loc,
10328 Ast.PaId (_loc,
10329 Ast.IdAcc (_loc,
10330 Ast.IdUid (_loc, "Ast"),
10331 Ast.IdUid (_loc, "ExCoe"))),
10332 meta_loc _loc x0),
10333 meta_expr _loc x1),
10334 meta_ctyp _loc x2),
10335 meta_ctyp _loc x3)
10336 | Ast.ExChr (x0, x1) ->
10337 Ast.PaApp (_loc,
10338 Ast.PaApp (_loc,
10339 Ast.PaId (_loc,
10340 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10341 Ast.IdUid (_loc, "ExChr"))),
10342 meta_loc _loc x0),
10343 meta_string _loc x1)
10344 | Ast.ExAss (x0, x1, x2) ->
10345 Ast.PaApp (_loc,
10346 Ast.PaApp (_loc,
10347 Ast.PaApp (_loc,
10348 Ast.PaId (_loc,
10349 Ast.IdAcc (_loc,
10350 Ast.IdUid (_loc, "Ast"),
10351 Ast.IdUid (_loc, "ExAss"))),
10352 meta_loc _loc x0),
10353 meta_expr _loc x1),
10354 meta_expr _loc x2)
10355 | Ast.ExAsr (x0, x1) ->
10356 Ast.PaApp (_loc,
10357 Ast.PaApp (_loc,
10358 Ast.PaId (_loc,
10359 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10360 Ast.IdUid (_loc, "ExAsr"))),
10361 meta_loc _loc x0),
10362 meta_expr _loc x1)
10363 | Ast.ExAsf x0 ->
10364 Ast.PaApp (_loc,
10365 Ast.PaId (_loc,
10366 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10367 Ast.IdUid (_loc, "ExAsf"))),
10368 meta_loc _loc x0)
10369 | Ast.ExSem (x0, x1, x2) ->
10370 Ast.PaApp (_loc,
10371 Ast.PaApp (_loc,
10372 Ast.PaApp (_loc,
10373 Ast.PaId (_loc,
10374 Ast.IdAcc (_loc,
10375 Ast.IdUid (_loc, "Ast"),
10376 Ast.IdUid (_loc, "ExSem"))),
10377 meta_loc _loc x0),
10378 meta_expr _loc x1),
10379 meta_expr _loc x2)
10380 | Ast.ExArr (x0, x1) ->
10381 Ast.PaApp (_loc,
10382 Ast.PaApp (_loc,
10383 Ast.PaId (_loc,
10384 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10385 Ast.IdUid (_loc, "ExArr"))),
10386 meta_loc _loc x0),
10387 meta_expr _loc x1)
10388 | Ast.ExAre (x0, x1, x2) ->
10389 Ast.PaApp (_loc,
10390 Ast.PaApp (_loc,
10391 Ast.PaApp (_loc,
10392 Ast.PaId (_loc,
10393 Ast.IdAcc (_loc,
10394 Ast.IdUid (_loc, "Ast"),
10395 Ast.IdUid (_loc, "ExAre"))),
10396 meta_loc _loc x0),
10397 meta_expr _loc x1),
10398 meta_expr _loc x2)
10399 | Ast.ExApp (x0, x1, x2) ->
10400 Ast.PaApp (_loc,
10401 Ast.PaApp (_loc,
10402 Ast.PaApp (_loc,
10403 Ast.PaId (_loc,
10404 Ast.IdAcc (_loc,
10405 Ast.IdUid (_loc, "Ast"),
10406 Ast.IdUid (_loc, "ExApp"))),
10407 meta_loc _loc x0),
10408 meta_expr _loc x1),
10409 meta_expr _loc x2)
10410 | Ast.ExAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10411 | Ast.ExAcc (x0, x1, x2) ->
10412 Ast.PaApp (_loc,
10413 Ast.PaApp (_loc,
10414 Ast.PaApp (_loc,
10415 Ast.PaId (_loc,
10416 Ast.IdAcc (_loc,
10417 Ast.IdUid (_loc, "Ast"),
10418 Ast.IdUid (_loc, "ExAcc"))),
10419 meta_loc _loc x0),
10420 meta_expr _loc x1),
10421 meta_expr _loc x2)
10422 | Ast.ExId (x0, x1) ->
10423 Ast.PaApp (_loc,
10424 Ast.PaApp (_loc,
10425 Ast.PaId (_loc,
10426 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10427 Ast.IdUid (_loc, "ExId"))),
10428 meta_loc _loc x0),
10429 meta_ident _loc x1)
10430 | Ast.ExNil x0 ->
10431 Ast.PaApp (_loc,
10432 Ast.PaId (_loc,
10433 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10434 Ast.IdUid (_loc, "ExNil"))),
10435 meta_loc _loc x0)
10436 and meta_ident _loc =
10437 function
10438 | Ast.IdAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10439 | Ast.IdUid (x0, x1) ->
10440 Ast.PaApp (_loc,
10441 Ast.PaApp (_loc,
10442 Ast.PaId (_loc,
10443 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10444 Ast.IdUid (_loc, "IdUid"))),
10445 meta_loc _loc x0),
10446 meta_string _loc x1)
10447 | Ast.IdLid (x0, x1) ->
10448 Ast.PaApp (_loc,
10449 Ast.PaApp (_loc,
10450 Ast.PaId (_loc,
10451 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10452 Ast.IdUid (_loc, "IdLid"))),
10453 meta_loc _loc x0),
10454 meta_string _loc x1)
10455 | Ast.IdApp (x0, x1, x2) ->
10456 Ast.PaApp (_loc,
10457 Ast.PaApp (_loc,
10458 Ast.PaApp (_loc,
10459 Ast.PaId (_loc,
10460 Ast.IdAcc (_loc,
10461 Ast.IdUid (_loc, "Ast"),
10462 Ast.IdUid (_loc, "IdApp"))),
10463 meta_loc _loc x0),
10464 meta_ident _loc x1),
10465 meta_ident _loc x2)
10466 | Ast.IdAcc (x0, x1, x2) ->
10467 Ast.PaApp (_loc,
10468 Ast.PaApp (_loc,
10469 Ast.PaApp (_loc,
10470 Ast.PaId (_loc,
10471 Ast.IdAcc (_loc,
10472 Ast.IdUid (_loc, "Ast"),
10473 Ast.IdUid (_loc, "IdAcc"))),
10474 meta_loc _loc x0),
10475 meta_ident _loc x1),
10476 meta_ident _loc x2)
10477 and meta_match_case _loc =
10478 function
10479 | Ast.McAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10480 | Ast.McArr (x0, x1, x2, x3) ->
10481 Ast.PaApp (_loc,
10482 Ast.PaApp (_loc,
10483 Ast.PaApp (_loc,
10484 Ast.PaApp (_loc,
10485 Ast.PaId (_loc,
10486 Ast.IdAcc (_loc,
10487 Ast.IdUid (_loc, "Ast"),
10488 Ast.IdUid (_loc, "McArr"))),
10489 meta_loc _loc x0),
10490 meta_patt _loc x1),
10491 meta_expr _loc x2),
10492 meta_expr _loc x3)
10493 | Ast.McOr (x0, x1, x2) ->
10494 Ast.PaApp (_loc,
10495 Ast.PaApp (_loc,
10496 Ast.PaApp (_loc,
10497 Ast.PaId (_loc,
10498 Ast.IdAcc (_loc,
10499 Ast.IdUid (_loc, "Ast"),
10500 Ast.IdUid (_loc, "McOr"))),
10501 meta_loc _loc x0),
10502 meta_match_case _loc x1),
10503 meta_match_case _loc x2)
10504 | Ast.McNil x0 ->
10505 Ast.PaApp (_loc,
10506 Ast.PaId (_loc,
10507 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10508 Ast.IdUid (_loc, "McNil"))),
10509 meta_loc _loc x0)
10510 and meta_meta_bool _loc =
10511 function
10512 | Ast.BAnt x0 -> Ast.PaAnt (_loc, x0)
10513 | Ast.BFalse ->
10514 Ast.PaId (_loc,
10515 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10516 Ast.IdUid (_loc, "BFalse")))
10517 | Ast.BTrue ->
10518 Ast.PaId (_loc,
10519 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10520 Ast.IdUid (_loc, "BTrue")))
10521 and meta_meta_list mf_a _loc =
10522 function
10523 | Ast.LAnt x0 -> Ast.PaAnt (_loc, x0)
10524 | Ast.LCons (x0, x1) ->
10525 Ast.PaApp (_loc,
10526 Ast.PaApp (_loc,
10527 Ast.PaId (_loc,
10528 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10529 Ast.IdUid (_loc, "LCons"))),
10530 mf_a _loc x0),
10531 meta_meta_list mf_a _loc x1)
10532 | Ast.LNil ->
10533 Ast.PaId (_loc,
10534 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10535 Ast.IdUid (_loc, "LNil")))
10536 and meta_meta_option mf_a _loc =
10537 function
10538 | Ast.OAnt x0 -> Ast.PaAnt (_loc, x0)
10539 | Ast.OSome x0 ->
10540 Ast.PaApp (_loc,
10541 Ast.PaId (_loc,
10542 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10543 Ast.IdUid (_loc, "OSome"))),
10544 mf_a _loc x0)
10545 | Ast.ONone ->
10546 Ast.PaId (_loc,
10547 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10548 Ast.IdUid (_loc, "ONone")))
10549 and meta_module_binding _loc =
10550 function
10551 | Ast.MbAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10552 | Ast.MbCol (x0, x1, x2) ->
10553 Ast.PaApp (_loc,
10554 Ast.PaApp (_loc,
10555 Ast.PaApp (_loc,
10556 Ast.PaId (_loc,
10557 Ast.IdAcc (_loc,
10558 Ast.IdUid (_loc, "Ast"),
10559 Ast.IdUid (_loc, "MbCol"))),
10560 meta_loc _loc x0),
10561 meta_string _loc x1),
10562 meta_module_type _loc x2)
10563 | Ast.MbColEq (x0, x1, x2, x3) ->
10564 Ast.PaApp (_loc,
10565 Ast.PaApp (_loc,
10566 Ast.PaApp (_loc,
10567 Ast.PaApp (_loc,
10568 Ast.PaId (_loc,
10569 Ast.IdAcc (_loc,
10570 Ast.IdUid (_loc, "Ast"),
10571 Ast.IdUid (_loc, "MbColEq"))),
10572 meta_loc _loc x0),
10573 meta_string _loc x1),
10574 meta_module_type _loc x2),
10575 meta_module_expr _loc x3)
10576 | Ast.MbAnd (x0, x1, x2) ->
10577 Ast.PaApp (_loc,
10578 Ast.PaApp (_loc,
10579 Ast.PaApp (_loc,
10580 Ast.PaId (_loc,
10581 Ast.IdAcc (_loc,
10582 Ast.IdUid (_loc, "Ast"),
10583 Ast.IdUid (_loc, "MbAnd"))),
10584 meta_loc _loc x0),
10585 meta_module_binding _loc x1),
10586 meta_module_binding _loc x2)
10587 | Ast.MbNil x0 ->
10588 Ast.PaApp (_loc,
10589 Ast.PaId (_loc,
10590 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10591 Ast.IdUid (_loc, "MbNil"))),
10592 meta_loc _loc x0)
10593 and meta_module_expr _loc =
10594 function
10595 | Ast.MeAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10596 | Ast.MeTyc (x0, x1, x2) ->
10597 Ast.PaApp (_loc,
10598 Ast.PaApp (_loc,
10599 Ast.PaApp (_loc,
10600 Ast.PaId (_loc,
10601 Ast.IdAcc (_loc,
10602 Ast.IdUid (_loc, "Ast"),
10603 Ast.IdUid (_loc, "MeTyc"))),
10604 meta_loc _loc x0),
10605 meta_module_expr _loc x1),
10606 meta_module_type _loc x2)
10607 | Ast.MeStr (x0, x1) ->
10608 Ast.PaApp (_loc,
10609 Ast.PaApp (_loc,
10610 Ast.PaId (_loc,
10611 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10612 Ast.IdUid (_loc, "MeStr"))),
10613 meta_loc _loc x0),
10614 meta_str_item _loc x1)
10615 | Ast.MeFun (x0, x1, x2, x3) ->
10616 Ast.PaApp (_loc,
10617 Ast.PaApp (_loc,
10618 Ast.PaApp (_loc,
10619 Ast.PaApp (_loc,
10620 Ast.PaId (_loc,
10621 Ast.IdAcc (_loc,
10622 Ast.IdUid (_loc, "Ast"),
10623 Ast.IdUid (_loc, "MeFun"))),
10624 meta_loc _loc x0),
10625 meta_string _loc x1),
10626 meta_module_type _loc x2),
10627 meta_module_expr _loc x3)
10628 | Ast.MeApp (x0, x1, x2) ->
10629 Ast.PaApp (_loc,
10630 Ast.PaApp (_loc,
10631 Ast.PaApp (_loc,
10632 Ast.PaId (_loc,
10633 Ast.IdAcc (_loc,
10634 Ast.IdUid (_loc, "Ast"),
10635 Ast.IdUid (_loc, "MeApp"))),
10636 meta_loc _loc x0),
10637 meta_module_expr _loc x1),
10638 meta_module_expr _loc x2)
10639 | Ast.MeId (x0, x1) ->
10640 Ast.PaApp (_loc,
10641 Ast.PaApp (_loc,
10642 Ast.PaId (_loc,
10643 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10644 Ast.IdUid (_loc, "MeId"))),
10645 meta_loc _loc x0),
10646 meta_ident _loc x1)
10647 | Ast.MeNil x0 ->
10648 Ast.PaApp (_loc,
10649 Ast.PaId (_loc,
10650 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10651 Ast.IdUid (_loc, "MeNil"))),
10652 meta_loc _loc x0)
10653 and meta_module_type _loc =
10654 function
10655 | Ast.MtAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10656 | Ast.MtWit (x0, x1, x2) ->
10657 Ast.PaApp (_loc,
10658 Ast.PaApp (_loc,
10659 Ast.PaApp (_loc,
10660 Ast.PaId (_loc,
10661 Ast.IdAcc (_loc,
10662 Ast.IdUid (_loc, "Ast"),
10663 Ast.IdUid (_loc, "MtWit"))),
10664 meta_loc _loc x0),
10665 meta_module_type _loc x1),
10666 meta_with_constr _loc x2)
10667 | Ast.MtSig (x0, x1) ->
10668 Ast.PaApp (_loc,
10669 Ast.PaApp (_loc,
10670 Ast.PaId (_loc,
10671 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10672 Ast.IdUid (_loc, "MtSig"))),
10673 meta_loc _loc x0),
10674 meta_sig_item _loc x1)
10675 | Ast.MtQuo (x0, x1) ->
10676 Ast.PaApp (_loc,
10677 Ast.PaApp (_loc,
10678 Ast.PaId (_loc,
10679 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10680 Ast.IdUid (_loc, "MtQuo"))),
10681 meta_loc _loc x0),
10682 meta_string _loc x1)
10683 | Ast.MtFun (x0, x1, x2, x3) ->
10684 Ast.PaApp (_loc,
10685 Ast.PaApp (_loc,
10686 Ast.PaApp (_loc,
10687 Ast.PaApp (_loc,
10688 Ast.PaId (_loc,
10689 Ast.IdAcc (_loc,
10690 Ast.IdUid (_loc, "Ast"),
10691 Ast.IdUid (_loc, "MtFun"))),
10692 meta_loc _loc x0),
10693 meta_string _loc x1),
10694 meta_module_type _loc x2),
10695 meta_module_type _loc x3)
10696 | Ast.MtId (x0, x1) ->
10697 Ast.PaApp (_loc,
10698 Ast.PaApp (_loc,
10699 Ast.PaId (_loc,
10700 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10701 Ast.IdUid (_loc, "MtId"))),
10702 meta_loc _loc x0),
10703 meta_ident _loc x1)
10704 | Ast.MtNil x0 ->
10705 Ast.PaApp (_loc,
10706 Ast.PaId (_loc,
10707 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10708 Ast.IdUid (_loc, "MtNil"))),
10709 meta_loc _loc x0)
10710 and meta_patt _loc =
10711 function
10712 | Ast.PaVrn (x0, x1) ->
10713 Ast.PaApp (_loc,
10714 Ast.PaApp (_loc,
10715 Ast.PaId (_loc,
10716 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10717 Ast.IdUid (_loc, "PaVrn"))),
10718 meta_loc _loc x0),
10719 meta_string _loc x1)
10720 | Ast.PaTyp (x0, x1) ->
10721 Ast.PaApp (_loc,
10722 Ast.PaApp (_loc,
10723 Ast.PaId (_loc,
10724 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10725 Ast.IdUid (_loc, "PaTyp"))),
10726 meta_loc _loc x0),
10727 meta_ident _loc x1)
10728 | Ast.PaTyc (x0, x1, x2) ->
10729 Ast.PaApp (_loc,
10730 Ast.PaApp (_loc,
10731 Ast.PaApp (_loc,
10732 Ast.PaId (_loc,
10733 Ast.IdAcc (_loc,
10734 Ast.IdUid (_loc, "Ast"),
10735 Ast.IdUid (_loc, "PaTyc"))),
10736 meta_loc _loc x0),
10737 meta_patt _loc x1),
10738 meta_ctyp _loc x2)
10739 | Ast.PaTup (x0, x1) ->
10740 Ast.PaApp (_loc,
10741 Ast.PaApp (_loc,
10742 Ast.PaId (_loc,
10743 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10744 Ast.IdUid (_loc, "PaTup"))),
10745 meta_loc _loc x0),
10746 meta_patt _loc x1)
10747 | Ast.PaStr (x0, x1) ->
10748 Ast.PaApp (_loc,
10749 Ast.PaApp (_loc,
10750 Ast.PaId (_loc,
10751 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10752 Ast.IdUid (_loc, "PaStr"))),
10753 meta_loc _loc x0),
10754 meta_string _loc x1)
10755 | Ast.PaEq (x0, x1, x2) ->
10756 Ast.PaApp (_loc,
10757 Ast.PaApp (_loc,
10758 Ast.PaApp (_loc,
10759 Ast.PaId (_loc,
10760 Ast.IdAcc (_loc,
10761 Ast.IdUid (_loc, "Ast"),
10762 Ast.IdUid (_loc, "PaEq"))),
10763 meta_loc _loc x0),
10764 meta_ident _loc x1),
10765 meta_patt _loc x2)
10766 | Ast.PaRec (x0, x1) ->
10767 Ast.PaApp (_loc,
10768 Ast.PaApp (_loc,
10769 Ast.PaId (_loc,
10770 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10771 Ast.IdUid (_loc, "PaRec"))),
10772 meta_loc _loc x0),
10773 meta_patt _loc x1)
10774 | Ast.PaRng (x0, x1, x2) ->
10775 Ast.PaApp (_loc,
10776 Ast.PaApp (_loc,
10777 Ast.PaApp (_loc,
10778 Ast.PaId (_loc,
10779 Ast.IdAcc (_loc,
10780 Ast.IdUid (_loc, "Ast"),
10781 Ast.IdUid (_loc, "PaRng"))),
10782 meta_loc _loc x0),
10783 meta_patt _loc x1),
10784 meta_patt _loc x2)
10785 | Ast.PaOrp (x0, x1, x2) ->
10786 Ast.PaApp (_loc,
10787 Ast.PaApp (_loc,
10788 Ast.PaApp (_loc,
10789 Ast.PaId (_loc,
10790 Ast.IdAcc (_loc,
10791 Ast.IdUid (_loc, "Ast"),
10792 Ast.IdUid (_loc, "PaOrp"))),
10793 meta_loc _loc x0),
10794 meta_patt _loc x1),
10795 meta_patt _loc x2)
10796 | Ast.PaOlbi (x0, x1, x2, x3) ->
10797 Ast.PaApp (_loc,
10798 Ast.PaApp (_loc,
10799 Ast.PaApp (_loc,
10800 Ast.PaApp (_loc,
10801 Ast.PaId (_loc,
10802 Ast.IdAcc (_loc,
10803 Ast.IdUid (_loc, "Ast"),
10804 Ast.IdUid (_loc, "PaOlbi"))),
10805 meta_loc _loc x0),
10806 meta_string _loc x1),
10807 meta_patt _loc x2),
10808 meta_expr _loc x3)
10809 | Ast.PaOlb (x0, x1, x2) ->
10810 Ast.PaApp (_loc,
10811 Ast.PaApp (_loc,
10812 Ast.PaApp (_loc,
10813 Ast.PaId (_loc,
10814 Ast.IdAcc (_loc,
10815 Ast.IdUid (_loc, "Ast"),
10816 Ast.IdUid (_loc, "PaOlb"))),
10817 meta_loc _loc x0),
10818 meta_string _loc x1),
10819 meta_patt _loc x2)
10820 | Ast.PaLab (x0, x1, x2) ->
10821 Ast.PaApp (_loc,
10822 Ast.PaApp (_loc,
10823 Ast.PaApp (_loc,
10824 Ast.PaId (_loc,
10825 Ast.IdAcc (_loc,
10826 Ast.IdUid (_loc, "Ast"),
10827 Ast.IdUid (_loc, "PaLab"))),
10828 meta_loc _loc x0),
10829 meta_string _loc x1),
10830 meta_patt _loc x2)
10831 | Ast.PaFlo (x0, x1) ->
10832 Ast.PaApp (_loc,
10833 Ast.PaApp (_loc,
10834 Ast.PaId (_loc,
10835 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10836 Ast.IdUid (_loc, "PaFlo"))),
10837 meta_loc _loc x0),
10838 meta_string _loc x1)
10839 | Ast.PaNativeInt (x0, x1) ->
10840 Ast.PaApp (_loc,
10841 Ast.PaApp (_loc,
10842 Ast.PaId (_loc,
10843 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10844 Ast.IdUid (_loc, "PaNativeInt"))),
10845 meta_loc _loc x0),
10846 meta_string _loc x1)
10847 | Ast.PaInt64 (x0, x1) ->
10848 Ast.PaApp (_loc,
10849 Ast.PaApp (_loc,
10850 Ast.PaId (_loc,
10851 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10852 Ast.IdUid (_loc, "PaInt64"))),
10853 meta_loc _loc x0),
10854 meta_string _loc x1)
10855 | Ast.PaInt32 (x0, x1) ->
10856 Ast.PaApp (_loc,
10857 Ast.PaApp (_loc,
10858 Ast.PaId (_loc,
10859 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10860 Ast.IdUid (_loc, "PaInt32"))),
10861 meta_loc _loc x0),
10862 meta_string _loc x1)
10863 | Ast.PaInt (x0, x1) ->
10864 Ast.PaApp (_loc,
10865 Ast.PaApp (_loc,
10866 Ast.PaId (_loc,
10867 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10868 Ast.IdUid (_loc, "PaInt"))),
10869 meta_loc _loc x0),
10870 meta_string _loc x1)
10871 | Ast.PaChr (x0, x1) ->
10872 Ast.PaApp (_loc,
10873 Ast.PaApp (_loc,
10874 Ast.PaId (_loc,
10875 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10876 Ast.IdUid (_loc, "PaChr"))),
10877 meta_loc _loc x0),
10878 meta_string _loc x1)
10879 | Ast.PaSem (x0, x1, x2) ->
10880 Ast.PaApp (_loc,
10881 Ast.PaApp (_loc,
10882 Ast.PaApp (_loc,
10883 Ast.PaId (_loc,
10884 Ast.IdAcc (_loc,
10885 Ast.IdUid (_loc, "Ast"),
10886 Ast.IdUid (_loc, "PaSem"))),
10887 meta_loc _loc x0),
10888 meta_patt _loc x1),
10889 meta_patt _loc x2)
10890 | Ast.PaCom (x0, x1, x2) ->
10891 Ast.PaApp (_loc,
10892 Ast.PaApp (_loc,
10893 Ast.PaApp (_loc,
10894 Ast.PaId (_loc,
10895 Ast.IdAcc (_loc,
10896 Ast.IdUid (_loc, "Ast"),
10897 Ast.IdUid (_loc, "PaCom"))),
10898 meta_loc _loc x0),
10899 meta_patt _loc x1),
10900 meta_patt _loc x2)
10901 | Ast.PaArr (x0, x1) ->
10902 Ast.PaApp (_loc,
10903 Ast.PaApp (_loc,
10904 Ast.PaId (_loc,
10905 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10906 Ast.IdUid (_loc, "PaArr"))),
10907 meta_loc _loc x0),
10908 meta_patt _loc x1)
10909 | Ast.PaApp (x0, x1, x2) ->
10910 Ast.PaApp (_loc,
10911 Ast.PaApp (_loc,
10912 Ast.PaApp (_loc,
10913 Ast.PaId (_loc,
10914 Ast.IdAcc (_loc,
10915 Ast.IdUid (_loc, "Ast"),
10916 Ast.IdUid (_loc, "PaApp"))),
10917 meta_loc _loc x0),
10918 meta_patt _loc x1),
10919 meta_patt _loc x2)
10920 | Ast.PaAny x0 ->
10921 Ast.PaApp (_loc,
10922 Ast.PaId (_loc,
10923 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10924 Ast.IdUid (_loc, "PaAny"))),
10925 meta_loc _loc x0)
10926 | Ast.PaAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10927 | Ast.PaAli (x0, x1, x2) ->
10928 Ast.PaApp (_loc,
10929 Ast.PaApp (_loc,
10930 Ast.PaApp (_loc,
10931 Ast.PaId (_loc,
10932 Ast.IdAcc (_loc,
10933 Ast.IdUid (_loc, "Ast"),
10934 Ast.IdUid (_loc, "PaAli"))),
10935 meta_loc _loc x0),
10936 meta_patt _loc x1),
10937 meta_patt _loc x2)
10938 | Ast.PaId (x0, x1) ->
10939 Ast.PaApp (_loc,
10940 Ast.PaApp (_loc,
10941 Ast.PaId (_loc,
10942 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10943 Ast.IdUid (_loc, "PaId"))),
10944 meta_loc _loc x0),
10945 meta_ident _loc x1)
10946 | Ast.PaNil x0 ->
10947 Ast.PaApp (_loc,
10948 Ast.PaId (_loc,
10949 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10950 Ast.IdUid (_loc, "PaNil"))),
10951 meta_loc _loc x0)
10952 and meta_rec_binding _loc =
10953 function
10954 | Ast.RbAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10955 | Ast.RbEq (x0, x1, x2) ->
10956 Ast.PaApp (_loc,
10957 Ast.PaApp (_loc,
10958 Ast.PaApp (_loc,
10959 Ast.PaId (_loc,
10960 Ast.IdAcc (_loc,
10961 Ast.IdUid (_loc, "Ast"),
10962 Ast.IdUid (_loc, "RbEq"))),
10963 meta_loc _loc x0),
10964 meta_ident _loc x1),
10965 meta_expr _loc x2)
10966 | Ast.RbSem (x0, x1, x2) ->
10967 Ast.PaApp (_loc,
10968 Ast.PaApp (_loc,
10969 Ast.PaApp (_loc,
10970 Ast.PaId (_loc,
10971 Ast.IdAcc (_loc,
10972 Ast.IdUid (_loc, "Ast"),
10973 Ast.IdUid (_loc, "RbSem"))),
10974 meta_loc _loc x0),
10975 meta_rec_binding _loc x1),
10976 meta_rec_binding _loc x2)
10977 | Ast.RbNil x0 ->
10978 Ast.PaApp (_loc,
10979 Ast.PaId (_loc,
10980 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
10981 Ast.IdUid (_loc, "RbNil"))),
10982 meta_loc _loc x0)
10983 and meta_sig_item _loc =
10984 function
10985 | Ast.SgAnt (x0, x1) -> Ast.PaAnt (x0, x1)
10986 | Ast.SgVal (x0, x1, x2) ->
10987 Ast.PaApp (_loc,
10988 Ast.PaApp (_loc,
10989 Ast.PaApp (_loc,
10990 Ast.PaId (_loc,
10991 Ast.IdAcc (_loc,
10992 Ast.IdUid (_loc, "Ast"),
10993 Ast.IdUid (_loc, "SgVal"))),
10994 meta_loc _loc x0),
10995 meta_string _loc x1),
10996 meta_ctyp _loc x2)
10997 | Ast.SgTyp (x0, x1) ->
10998 Ast.PaApp (_loc,
10999 Ast.PaApp (_loc,
11000 Ast.PaId (_loc,
11001 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11002 Ast.IdUid (_loc, "SgTyp"))),
11003 meta_loc _loc x0),
11004 meta_ctyp _loc x1)
11005 | Ast.SgOpn (x0, x1) ->
11006 Ast.PaApp (_loc,
11007 Ast.PaApp (_loc,
11008 Ast.PaId (_loc,
11009 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11010 Ast.IdUid (_loc, "SgOpn"))),
11011 meta_loc _loc x0),
11012 meta_ident _loc x1)
11013 | Ast.SgMty (x0, x1, x2) ->
11014 Ast.PaApp (_loc,
11015 Ast.PaApp (_loc,
11016 Ast.PaApp (_loc,
11017 Ast.PaId (_loc,
11018 Ast.IdAcc (_loc,
11019 Ast.IdUid (_loc, "Ast"),
11020 Ast.IdUid (_loc, "SgMty"))),
11021 meta_loc _loc x0),
11022 meta_string _loc x1),
11023 meta_module_type _loc x2)
11024 | Ast.SgRecMod (x0, x1) ->
11025 Ast.PaApp (_loc,
11026 Ast.PaApp (_loc,
11027 Ast.PaId (_loc,
11028 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11029 Ast.IdUid (_loc, "SgRecMod"))),
11030 meta_loc _loc x0),
11031 meta_module_binding _loc x1)
11032 | Ast.SgMod (x0, x1, x2) ->
11033 Ast.PaApp (_loc,
11034 Ast.PaApp (_loc,
11035 Ast.PaApp (_loc,
11036 Ast.PaId (_loc,
11037 Ast.IdAcc (_loc,
11038 Ast.IdUid (_loc, "Ast"),
11039 Ast.IdUid (_loc, "SgMod"))),
11040 meta_loc _loc x0),
11041 meta_string _loc x1),
11042 meta_module_type _loc x2)
11043 | Ast.SgInc (x0, x1) ->
11044 Ast.PaApp (_loc,
11045 Ast.PaApp (_loc,
11046 Ast.PaId (_loc,
11047 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11048 Ast.IdUid (_loc, "SgInc"))),
11049 meta_loc _loc x0),
11050 meta_module_type _loc x1)
11051 | Ast.SgExt (x0, x1, x2, x3) ->
11052 Ast.PaApp (_loc,
11053 Ast.PaApp (_loc,
11054 Ast.PaApp (_loc,
11055 Ast.PaApp (_loc,
11056 Ast.PaId (_loc,
11057 Ast.IdAcc (_loc,
11058 Ast.IdUid (_loc, "Ast"),
11059 Ast.IdUid (_loc, "SgExt"))),
11060 meta_loc _loc x0),
11061 meta_string _loc x1),
11062 meta_ctyp _loc x2),
11063 meta_meta_list meta_string _loc x3)
11064 | Ast.SgExc (x0, x1) ->
11065 Ast.PaApp (_loc,
11066 Ast.PaApp (_loc,
11067 Ast.PaId (_loc,
11068 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11069 Ast.IdUid (_loc, "SgExc"))),
11070 meta_loc _loc x0),
11071 meta_ctyp _loc x1)
11072 | Ast.SgDir (x0, x1, x2) ->
11073 Ast.PaApp (_loc,
11074 Ast.PaApp (_loc,
11075 Ast.PaApp (_loc,
11076 Ast.PaId (_loc,
11077 Ast.IdAcc (_loc,
11078 Ast.IdUid (_loc, "Ast"),
11079 Ast.IdUid (_loc, "SgDir"))),
11080 meta_loc _loc x0),
11081 meta_string _loc x1),
11082 meta_expr _loc x2)
11083 | Ast.SgSem (x0, x1, x2) ->
11084 Ast.PaApp (_loc,
11085 Ast.PaApp (_loc,
11086 Ast.PaApp (_loc,
11087 Ast.PaId (_loc,
11088 Ast.IdAcc (_loc,
11089 Ast.IdUid (_loc, "Ast"),
11090 Ast.IdUid (_loc, "SgSem"))),
11091 meta_loc _loc x0),
11092 meta_sig_item _loc x1),
11093 meta_sig_item _loc x2)
11094 | Ast.SgClt (x0, x1) ->
11095 Ast.PaApp (_loc,
11096 Ast.PaApp (_loc,
11097 Ast.PaId (_loc,
11098 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11099 Ast.IdUid (_loc, "SgClt"))),
11100 meta_loc _loc x0),
11101 meta_class_type _loc x1)
11102 | Ast.SgCls (x0, x1) ->
11103 Ast.PaApp (_loc,
11104 Ast.PaApp (_loc,
11105 Ast.PaId (_loc,
11106 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11107 Ast.IdUid (_loc, "SgCls"))),
11108 meta_loc _loc x0),
11109 meta_class_type _loc x1)
11110 | Ast.SgNil x0 ->
11111 Ast.PaApp (_loc,
11112 Ast.PaId (_loc,
11113 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11114 Ast.IdUid (_loc, "SgNil"))),
11115 meta_loc _loc x0)
11116 and meta_str_item _loc =
11117 function
11118 | Ast.StAnt (x0, x1) -> Ast.PaAnt (x0, x1)
11119 | Ast.StVal (x0, x1, x2) ->
11120 Ast.PaApp (_loc,
11121 Ast.PaApp (_loc,
11122 Ast.PaApp (_loc,
11123 Ast.PaId (_loc,
11124 Ast.IdAcc (_loc,
11125 Ast.IdUid (_loc, "Ast"),
11126 Ast.IdUid (_loc, "StVal"))),
11127 meta_loc _loc x0),
11128 meta_meta_bool _loc x1),
11129 meta_binding _loc x2)
11130 | Ast.StTyp (x0, x1) ->
11131 Ast.PaApp (_loc,
11132 Ast.PaApp (_loc,
11133 Ast.PaId (_loc,
11134 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11135 Ast.IdUid (_loc, "StTyp"))),
11136 meta_loc _loc x0),
11137 meta_ctyp _loc x1)
11138 | Ast.StOpn (x0, x1) ->
11139 Ast.PaApp (_loc,
11140 Ast.PaApp (_loc,
11141 Ast.PaId (_loc,
11142 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11143 Ast.IdUid (_loc, "StOpn"))),
11144 meta_loc _loc x0),
11145 meta_ident _loc x1)
11146 | Ast.StMty (x0, x1, x2) ->
11147 Ast.PaApp (_loc,
11148 Ast.PaApp (_loc,
11149 Ast.PaApp (_loc,
11150 Ast.PaId (_loc,
11151 Ast.IdAcc (_loc,
11152 Ast.IdUid (_loc, "Ast"),
11153 Ast.IdUid (_loc, "StMty"))),
11154 meta_loc _loc x0),
11155 meta_string _loc x1),
11156 meta_module_type _loc x2)
11157 | Ast.StRecMod (x0, x1) ->
11158 Ast.PaApp (_loc,
11159 Ast.PaApp (_loc,
11160 Ast.PaId (_loc,
11161 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11162 Ast.IdUid (_loc, "StRecMod"))),
11163 meta_loc _loc x0),
11164 meta_module_binding _loc x1)
11165 | Ast.StMod (x0, x1, x2) ->
11166 Ast.PaApp (_loc,
11167 Ast.PaApp (_loc,
11168 Ast.PaApp (_loc,
11169 Ast.PaId (_loc,
11170 Ast.IdAcc (_loc,
11171 Ast.IdUid (_loc, "Ast"),
11172 Ast.IdUid (_loc, "StMod"))),
11173 meta_loc _loc x0),
11174 meta_string _loc x1),
11175 meta_module_expr _loc x2)
11176 | Ast.StInc (x0, x1) ->
11177 Ast.PaApp (_loc,
11178 Ast.PaApp (_loc,
11179 Ast.PaId (_loc,
11180 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11181 Ast.IdUid (_loc, "StInc"))),
11182 meta_loc _loc x0),
11183 meta_module_expr _loc x1)
11184 | Ast.StExt (x0, x1, x2, x3) ->
11185 Ast.PaApp (_loc,
11186 Ast.PaApp (_loc,
11187 Ast.PaApp (_loc,
11188 Ast.PaApp (_loc,
11189 Ast.PaId (_loc,
11190 Ast.IdAcc (_loc,
11191 Ast.IdUid (_loc, "Ast"),
11192 Ast.IdUid (_loc, "StExt"))),
11193 meta_loc _loc x0),
11194 meta_string _loc x1),
11195 meta_ctyp _loc x2),
11196 meta_meta_list meta_string _loc x3)
11197 | Ast.StExp (x0, x1) ->
11198 Ast.PaApp (_loc,
11199 Ast.PaApp (_loc,
11200 Ast.PaId (_loc,
11201 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11202 Ast.IdUid (_loc, "StExp"))),
11203 meta_loc _loc x0),
11204 meta_expr _loc x1)
11205 | Ast.StExc (x0, x1, x2) ->
11206 Ast.PaApp (_loc,
11207 Ast.PaApp (_loc,
11208 Ast.PaApp (_loc,
11209 Ast.PaId (_loc,
11210 Ast.IdAcc (_loc,
11211 Ast.IdUid (_loc, "Ast"),
11212 Ast.IdUid (_loc, "StExc"))),
11213 meta_loc _loc x0),
11214 meta_ctyp _loc x1),
11215 meta_meta_option meta_ident _loc x2)
11216 | Ast.StDir (x0, x1, x2) ->
11217 Ast.PaApp (_loc,
11218 Ast.PaApp (_loc,
11219 Ast.PaApp (_loc,
11220 Ast.PaId (_loc,
11221 Ast.IdAcc (_loc,
11222 Ast.IdUid (_loc, "Ast"),
11223 Ast.IdUid (_loc, "StDir"))),
11224 meta_loc _loc x0),
11225 meta_string _loc x1),
11226 meta_expr _loc x2)
11227 | Ast.StSem (x0, x1, x2) ->
11228 Ast.PaApp (_loc,
11229 Ast.PaApp (_loc,
11230 Ast.PaApp (_loc,
11231 Ast.PaId (_loc,
11232 Ast.IdAcc (_loc,
11233 Ast.IdUid (_loc, "Ast"),
11234 Ast.IdUid (_loc, "StSem"))),
11235 meta_loc _loc x0),
11236 meta_str_item _loc x1),
11237 meta_str_item _loc x2)
11238 | Ast.StClt (x0, x1) ->
11239 Ast.PaApp (_loc,
11240 Ast.PaApp (_loc,
11241 Ast.PaId (_loc,
11242 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11243 Ast.IdUid (_loc, "StClt"))),
11244 meta_loc _loc x0),
11245 meta_class_type _loc x1)
11246 | Ast.StCls (x0, x1) ->
11247 Ast.PaApp (_loc,
11248 Ast.PaApp (_loc,
11249 Ast.PaId (_loc,
11250 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11251 Ast.IdUid (_loc, "StCls"))),
11252 meta_loc _loc x0),
11253 meta_class_expr _loc x1)
11254 | Ast.StNil x0 ->
11255 Ast.PaApp (_loc,
11256 Ast.PaId (_loc,
11257 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11258 Ast.IdUid (_loc, "StNil"))),
11259 meta_loc _loc x0)
11260 and meta_with_constr _loc =
11261 function
11262 | Ast.WcAnt (x0, x1) -> Ast.PaAnt (x0, x1)
11263 | Ast.WcAnd (x0, x1, x2) ->
11264 Ast.PaApp (_loc,
11265 Ast.PaApp (_loc,
11266 Ast.PaApp (_loc,
11267 Ast.PaId (_loc,
11268 Ast.IdAcc (_loc,
11269 Ast.IdUid (_loc, "Ast"),
11270 Ast.IdUid (_loc, "WcAnd"))),
11271 meta_loc _loc x0),
11272 meta_with_constr _loc x1),
11273 meta_with_constr _loc x2)
11274 | Ast.WcMod (x0, x1, x2) ->
11275 Ast.PaApp (_loc,
11276 Ast.PaApp (_loc,
11277 Ast.PaApp (_loc,
11278 Ast.PaId (_loc,
11279 Ast.IdAcc (_loc,
11280 Ast.IdUid (_loc, "Ast"),
11281 Ast.IdUid (_loc, "WcMod"))),
11282 meta_loc _loc x0),
11283 meta_ident _loc x1),
11284 meta_ident _loc x2)
11285 | Ast.WcTyp (x0, x1, x2) ->
11286 Ast.PaApp (_loc,
11287 Ast.PaApp (_loc,
11288 Ast.PaApp (_loc,
11289 Ast.PaId (_loc,
11290 Ast.IdAcc (_loc,
11291 Ast.IdUid (_loc, "Ast"),
11292 Ast.IdUid (_loc, "WcTyp"))),
11293 meta_loc _loc x0),
11294 meta_ctyp _loc x1),
11295 meta_ctyp _loc x2)
11296 | Ast.WcNil x0 ->
11297 Ast.PaApp (_loc,
11298 Ast.PaId (_loc,
11299 Ast.IdAcc (_loc, Ast.IdUid (_loc, "Ast"),
11300 Ast.IdUid (_loc, "WcNil"))),
11301 meta_loc _loc x0)
11309 class map =
11310 object ((o : 'self_type))
11311 method string : string -> string = o#unknown
11313 method list :
11314 'a 'a_out.
11315 ('self_type -> 'a -> 'a_out) -> 'a list -> 'a_out list =
11316 fun _f_a ->
11317 function
11318 | [] -> []
11319 | _x :: _x_i1 ->
11320 let _x = _f_a o _x in
11321 let _x_i1 = o#list _f_a _x_i1 in _x :: _x_i1
11323 method with_constr : with_constr -> with_constr =
11324 function
11325 | WcNil _x -> let _x = o#loc _x in WcNil _x
11326 | WcTyp (_x, _x_i1, _x_i2) ->
11327 let _x = o#loc _x in
11328 let _x_i1 = o#ctyp _x_i1 in
11329 let _x_i2 = o#ctyp _x_i2 in WcTyp (_x, _x_i1, _x_i2)
11330 | WcMod (_x, _x_i1, _x_i2) ->
11331 let _x = o#loc _x in
11332 let _x_i1 = o#ident _x_i1 in
11333 let _x_i2 = o#ident _x_i2 in WcMod (_x, _x_i1, _x_i2)
11334 | WcAnd (_x, _x_i1, _x_i2) ->
11335 let _x = o#loc _x in
11336 let _x_i1 = o#with_constr _x_i1 in
11337 let _x_i2 = o#with_constr _x_i2
11338 in WcAnd (_x, _x_i1, _x_i2)
11339 | WcAnt (_x, _x_i1) ->
11340 let _x = o#loc _x in
11341 let _x_i1 = o#string _x_i1 in WcAnt (_x, _x_i1)
11343 method str_item : str_item -> str_item =
11344 function
11345 | StNil _x -> let _x = o#loc _x in StNil _x
11346 | StCls (_x, _x_i1) ->
11347 let _x = o#loc _x in
11348 let _x_i1 = o#class_expr _x_i1 in StCls (_x, _x_i1)
11349 | StClt (_x, _x_i1) ->
11350 let _x = o#loc _x in
11351 let _x_i1 = o#class_type _x_i1 in StClt (_x, _x_i1)
11352 | StSem (_x, _x_i1, _x_i2) ->
11353 let _x = o#loc _x in
11354 let _x_i1 = o#str_item _x_i1 in
11355 let _x_i2 = o#str_item _x_i2
11356 in StSem (_x, _x_i1, _x_i2)
11357 | StDir (_x, _x_i1, _x_i2) ->
11358 let _x = o#loc _x in
11359 let _x_i1 = o#string _x_i1 in
11360 let _x_i2 = o#expr _x_i2 in StDir (_x, _x_i1, _x_i2)
11361 | StExc (_x, _x_i1, _x_i2) ->
11362 let _x = o#loc _x in
11363 let _x_i1 = o#ctyp _x_i1 in
11364 let _x_i2 = o#meta_option (fun o -> o#ident) _x_i2
11365 in StExc (_x, _x_i1, _x_i2)
11366 | StExp (_x, _x_i1) ->
11367 let _x = o#loc _x in
11368 let _x_i1 = o#expr _x_i1 in StExp (_x, _x_i1)
11369 | StExt (_x, _x_i1, _x_i2, _x_i3) ->
11370 let _x = o#loc _x in
11371 let _x_i1 = o#string _x_i1 in
11372 let _x_i2 = o#ctyp _x_i2 in
11373 let _x_i3 = o#meta_list (fun o -> o#string) _x_i3
11374 in StExt (_x, _x_i1, _x_i2, _x_i3)
11375 | StInc (_x, _x_i1) ->
11376 let _x = o#loc _x in
11377 let _x_i1 = o#module_expr _x_i1 in StInc (_x, _x_i1)
11378 | StMod (_x, _x_i1, _x_i2) ->
11379 let _x = o#loc _x in
11380 let _x_i1 = o#string _x_i1 in
11381 let _x_i2 = o#module_expr _x_i2
11382 in StMod (_x, _x_i1, _x_i2)
11383 | StRecMod (_x, _x_i1) ->
11384 let _x = o#loc _x in
11385 let _x_i1 = o#module_binding _x_i1
11386 in StRecMod (_x, _x_i1)
11387 | StMty (_x, _x_i1, _x_i2) ->
11388 let _x = o#loc _x in
11389 let _x_i1 = o#string _x_i1 in
11390 let _x_i2 = o#module_type _x_i2
11391 in StMty (_x, _x_i1, _x_i2)
11392 | StOpn (_x, _x_i1) ->
11393 let _x = o#loc _x in
11394 let _x_i1 = o#ident _x_i1 in StOpn (_x, _x_i1)
11395 | StTyp (_x, _x_i1) ->
11396 let _x = o#loc _x in
11397 let _x_i1 = o#ctyp _x_i1 in StTyp (_x, _x_i1)
11398 | StVal (_x, _x_i1, _x_i2) ->
11399 let _x = o#loc _x in
11400 let _x_i1 = o#meta_bool _x_i1 in
11401 let _x_i2 = o#binding _x_i2 in StVal (_x, _x_i1, _x_i2)
11402 | StAnt (_x, _x_i1) ->
11403 let _x = o#loc _x in
11404 let _x_i1 = o#string _x_i1 in StAnt (_x, _x_i1)
11406 method sig_item : sig_item -> sig_item =
11407 function
11408 | SgNil _x -> let _x = o#loc _x in SgNil _x
11409 | SgCls (_x, _x_i1) ->
11410 let _x = o#loc _x in
11411 let _x_i1 = o#class_type _x_i1 in SgCls (_x, _x_i1)
11412 | SgClt (_x, _x_i1) ->
11413 let _x = o#loc _x in
11414 let _x_i1 = o#class_type _x_i1 in SgClt (_x, _x_i1)
11415 | SgSem (_x, _x_i1, _x_i2) ->
11416 let _x = o#loc _x in
11417 let _x_i1 = o#sig_item _x_i1 in
11418 let _x_i2 = o#sig_item _x_i2
11419 in SgSem (_x, _x_i1, _x_i2)
11420 | SgDir (_x, _x_i1, _x_i2) ->
11421 let _x = o#loc _x in
11422 let _x_i1 = o#string _x_i1 in
11423 let _x_i2 = o#expr _x_i2 in SgDir (_x, _x_i1, _x_i2)
11424 | SgExc (_x, _x_i1) ->
11425 let _x = o#loc _x in
11426 let _x_i1 = o#ctyp _x_i1 in SgExc (_x, _x_i1)
11427 | SgExt (_x, _x_i1, _x_i2, _x_i3) ->
11428 let _x = o#loc _x in
11429 let _x_i1 = o#string _x_i1 in
11430 let _x_i2 = o#ctyp _x_i2 in
11431 let _x_i3 = o#meta_list (fun o -> o#string) _x_i3
11432 in SgExt (_x, _x_i1, _x_i2, _x_i3)
11433 | SgInc (_x, _x_i1) ->
11434 let _x = o#loc _x in
11435 let _x_i1 = o#module_type _x_i1 in SgInc (_x, _x_i1)
11436 | SgMod (_x, _x_i1, _x_i2) ->
11437 let _x = o#loc _x in
11438 let _x_i1 = o#string _x_i1 in
11439 let _x_i2 = o#module_type _x_i2
11440 in SgMod (_x, _x_i1, _x_i2)
11441 | SgRecMod (_x, _x_i1) ->
11442 let _x = o#loc _x in
11443 let _x_i1 = o#module_binding _x_i1
11444 in SgRecMod (_x, _x_i1)
11445 | SgMty (_x, _x_i1, _x_i2) ->
11446 let _x = o#loc _x in
11447 let _x_i1 = o#string _x_i1 in
11448 let _x_i2 = o#module_type _x_i2
11449 in SgMty (_x, _x_i1, _x_i2)
11450 | SgOpn (_x, _x_i1) ->
11451 let _x = o#loc _x in
11452 let _x_i1 = o#ident _x_i1 in SgOpn (_x, _x_i1)
11453 | SgTyp (_x, _x_i1) ->
11454 let _x = o#loc _x in
11455 let _x_i1 = o#ctyp _x_i1 in SgTyp (_x, _x_i1)
11456 | SgVal (_x, _x_i1, _x_i2) ->
11457 let _x = o#loc _x in
11458 let _x_i1 = o#string _x_i1 in
11459 let _x_i2 = o#ctyp _x_i2 in SgVal (_x, _x_i1, _x_i2)
11460 | SgAnt (_x, _x_i1) ->
11461 let _x = o#loc _x in
11462 let _x_i1 = o#string _x_i1 in SgAnt (_x, _x_i1)
11464 method rec_binding : rec_binding -> rec_binding =
11465 function
11466 | RbNil _x -> let _x = o#loc _x in RbNil _x
11467 | RbSem (_x, _x_i1, _x_i2) ->
11468 let _x = o#loc _x in
11469 let _x_i1 = o#rec_binding _x_i1 in
11470 let _x_i2 = o#rec_binding _x_i2
11471 in RbSem (_x, _x_i1, _x_i2)
11472 | RbEq (_x, _x_i1, _x_i2) ->
11473 let _x = o#loc _x in
11474 let _x_i1 = o#ident _x_i1 in
11475 let _x_i2 = o#expr _x_i2 in RbEq (_x, _x_i1, _x_i2)
11476 | RbAnt (_x, _x_i1) ->
11477 let _x = o#loc _x in
11478 let _x_i1 = o#string _x_i1 in RbAnt (_x, _x_i1)
11480 method patt : patt -> patt =
11481 function
11482 | PaNil _x -> let _x = o#loc _x in PaNil _x
11483 | PaId (_x, _x_i1) ->
11484 let _x = o#loc _x in
11485 let _x_i1 = o#ident _x_i1 in PaId (_x, _x_i1)
11486 | PaAli (_x, _x_i1, _x_i2) ->
11487 let _x = o#loc _x in
11488 let _x_i1 = o#patt _x_i1 in
11489 let _x_i2 = o#patt _x_i2 in PaAli (_x, _x_i1, _x_i2)
11490 | PaAnt (_x, _x_i1) ->
11491 let _x = o#loc _x in
11492 let _x_i1 = o#string _x_i1 in PaAnt (_x, _x_i1)
11493 | PaAny _x -> let _x = o#loc _x in PaAny _x
11494 | PaApp (_x, _x_i1, _x_i2) ->
11495 let _x = o#loc _x in
11496 let _x_i1 = o#patt _x_i1 in
11497 let _x_i2 = o#patt _x_i2 in PaApp (_x, _x_i1, _x_i2)
11498 | PaArr (_x, _x_i1) ->
11499 let _x = o#loc _x in
11500 let _x_i1 = o#patt _x_i1 in PaArr (_x, _x_i1)
11501 | PaCom (_x, _x_i1, _x_i2) ->
11502 let _x = o#loc _x in
11503 let _x_i1 = o#patt _x_i1 in
11504 let _x_i2 = o#patt _x_i2 in PaCom (_x, _x_i1, _x_i2)
11505 | PaSem (_x, _x_i1, _x_i2) ->
11506 let _x = o#loc _x in
11507 let _x_i1 = o#patt _x_i1 in
11508 let _x_i2 = o#patt _x_i2 in PaSem (_x, _x_i1, _x_i2)
11509 | PaChr (_x, _x_i1) ->
11510 let _x = o#loc _x in
11511 let _x_i1 = o#string _x_i1 in PaChr (_x, _x_i1)
11512 | PaInt (_x, _x_i1) ->
11513 let _x = o#loc _x in
11514 let _x_i1 = o#string _x_i1 in PaInt (_x, _x_i1)
11515 | PaInt32 (_x, _x_i1) ->
11516 let _x = o#loc _x in
11517 let _x_i1 = o#string _x_i1 in PaInt32 (_x, _x_i1)
11518 | PaInt64 (_x, _x_i1) ->
11519 let _x = o#loc _x in
11520 let _x_i1 = o#string _x_i1 in PaInt64 (_x, _x_i1)
11521 | PaNativeInt (_x, _x_i1) ->
11522 let _x = o#loc _x in
11523 let _x_i1 = o#string _x_i1 in PaNativeInt (_x, _x_i1)
11524 | PaFlo (_x, _x_i1) ->
11525 let _x = o#loc _x in
11526 let _x_i1 = o#string _x_i1 in PaFlo (_x, _x_i1)
11527 | PaLab (_x, _x_i1, _x_i2) ->
11528 let _x = o#loc _x in
11529 let _x_i1 = o#string _x_i1 in
11530 let _x_i2 = o#patt _x_i2 in PaLab (_x, _x_i1, _x_i2)
11531 | PaOlb (_x, _x_i1, _x_i2) ->
11532 let _x = o#loc _x in
11533 let _x_i1 = o#string _x_i1 in
11534 let _x_i2 = o#patt _x_i2 in PaOlb (_x, _x_i1, _x_i2)
11535 | PaOlbi (_x, _x_i1, _x_i2, _x_i3) ->
11536 let _x = o#loc _x in
11537 let _x_i1 = o#string _x_i1 in
11538 let _x_i2 = o#patt _x_i2 in
11539 let _x_i3 = o#expr _x_i3
11540 in PaOlbi (_x, _x_i1, _x_i2, _x_i3)
11541 | PaOrp (_x, _x_i1, _x_i2) ->
11542 let _x = o#loc _x in
11543 let _x_i1 = o#patt _x_i1 in
11544 let _x_i2 = o#patt _x_i2 in PaOrp (_x, _x_i1, _x_i2)
11545 | PaRng (_x, _x_i1, _x_i2) ->
11546 let _x = o#loc _x in
11547 let _x_i1 = o#patt _x_i1 in
11548 let _x_i2 = o#patt _x_i2 in PaRng (_x, _x_i1, _x_i2)
11549 | PaRec (_x, _x_i1) ->
11550 let _x = o#loc _x in
11551 let _x_i1 = o#patt _x_i1 in PaRec (_x, _x_i1)
11552 | PaEq (_x, _x_i1, _x_i2) ->
11553 let _x = o#loc _x in
11554 let _x_i1 = o#ident _x_i1 in
11555 let _x_i2 = o#patt _x_i2 in PaEq (_x, _x_i1, _x_i2)
11556 | PaStr (_x, _x_i1) ->
11557 let _x = o#loc _x in
11558 let _x_i1 = o#string _x_i1 in PaStr (_x, _x_i1)
11559 | PaTup (_x, _x_i1) ->
11560 let _x = o#loc _x in
11561 let _x_i1 = o#patt _x_i1 in PaTup (_x, _x_i1)
11562 | PaTyc (_x, _x_i1, _x_i2) ->
11563 let _x = o#loc _x in
11564 let _x_i1 = o#patt _x_i1 in
11565 let _x_i2 = o#ctyp _x_i2 in PaTyc (_x, _x_i1, _x_i2)
11566 | PaTyp (_x, _x_i1) ->
11567 let _x = o#loc _x in
11568 let _x_i1 = o#ident _x_i1 in PaTyp (_x, _x_i1)
11569 | PaVrn (_x, _x_i1) ->
11570 let _x = o#loc _x in
11571 let _x_i1 = o#string _x_i1 in PaVrn (_x, _x_i1)
11573 method module_type : module_type -> module_type =
11574 function
11575 | MtNil _x -> let _x = o#loc _x in MtNil _x
11576 | MtId (_x, _x_i1) ->
11577 let _x = o#loc _x in
11578 let _x_i1 = o#ident _x_i1 in MtId (_x, _x_i1)
11579 | MtFun (_x, _x_i1, _x_i2, _x_i3) ->
11580 let _x = o#loc _x in
11581 let _x_i1 = o#string _x_i1 in
11582 let _x_i2 = o#module_type _x_i2 in
11583 let _x_i3 = o#module_type _x_i3
11584 in MtFun (_x, _x_i1, _x_i2, _x_i3)
11585 | MtQuo (_x, _x_i1) ->
11586 let _x = o#loc _x in
11587 let _x_i1 = o#string _x_i1 in MtQuo (_x, _x_i1)
11588 | MtSig (_x, _x_i1) ->
11589 let _x = o#loc _x in
11590 let _x_i1 = o#sig_item _x_i1 in MtSig (_x, _x_i1)
11591 | MtWit (_x, _x_i1, _x_i2) ->
11592 let _x = o#loc _x in
11593 let _x_i1 = o#module_type _x_i1 in
11594 let _x_i2 = o#with_constr _x_i2
11595 in MtWit (_x, _x_i1, _x_i2)
11596 | MtAnt (_x, _x_i1) ->
11597 let _x = o#loc _x in
11598 let _x_i1 = o#string _x_i1 in MtAnt (_x, _x_i1)
11600 method module_expr : module_expr -> module_expr =
11601 function
11602 | MeNil _x -> let _x = o#loc _x in MeNil _x
11603 | MeId (_x, _x_i1) ->
11604 let _x = o#loc _x in
11605 let _x_i1 = o#ident _x_i1 in MeId (_x, _x_i1)
11606 | MeApp (_x, _x_i1, _x_i2) ->
11607 let _x = o#loc _x in
11608 let _x_i1 = o#module_expr _x_i1 in
11609 let _x_i2 = o#module_expr _x_i2
11610 in MeApp (_x, _x_i1, _x_i2)
11611 | MeFun (_x, _x_i1, _x_i2, _x_i3) ->
11612 let _x = o#loc _x in
11613 let _x_i1 = o#string _x_i1 in
11614 let _x_i2 = o#module_type _x_i2 in
11615 let _x_i3 = o#module_expr _x_i3
11616 in MeFun (_x, _x_i1, _x_i2, _x_i3)
11617 | MeStr (_x, _x_i1) ->
11618 let _x = o#loc _x in
11619 let _x_i1 = o#str_item _x_i1 in MeStr (_x, _x_i1)
11620 | MeTyc (_x, _x_i1, _x_i2) ->
11621 let _x = o#loc _x in
11622 let _x_i1 = o#module_expr _x_i1 in
11623 let _x_i2 = o#module_type _x_i2
11624 in MeTyc (_x, _x_i1, _x_i2)
11625 | MeAnt (_x, _x_i1) ->
11626 let _x = o#loc _x in
11627 let _x_i1 = o#string _x_i1 in MeAnt (_x, _x_i1)
11629 method module_binding : module_binding -> module_binding =
11630 function
11631 | MbNil _x -> let _x = o#loc _x in MbNil _x
11632 | MbAnd (_x, _x_i1, _x_i2) ->
11633 let _x = o#loc _x in
11634 let _x_i1 = o#module_binding _x_i1 in
11635 let _x_i2 = o#module_binding _x_i2
11636 in MbAnd (_x, _x_i1, _x_i2)
11637 | MbColEq (_x, _x_i1, _x_i2, _x_i3) ->
11638 let _x = o#loc _x in
11639 let _x_i1 = o#string _x_i1 in
11640 let _x_i2 = o#module_type _x_i2 in
11641 let _x_i3 = o#module_expr _x_i3
11642 in MbColEq (_x, _x_i1, _x_i2, _x_i3)
11643 | MbCol (_x, _x_i1, _x_i2) ->
11644 let _x = o#loc _x in
11645 let _x_i1 = o#string _x_i1 in
11646 let _x_i2 = o#module_type _x_i2
11647 in MbCol (_x, _x_i1, _x_i2)
11648 | MbAnt (_x, _x_i1) ->
11649 let _x = o#loc _x in
11650 let _x_i1 = o#string _x_i1 in MbAnt (_x, _x_i1)
11652 method meta_option :
11653 'a 'a_out.
11654 ('self_type -> 'a -> 'a_out) ->
11655 'a meta_option -> 'a_out meta_option =
11656 fun _f_a ->
11657 function
11658 | ONone -> ONone
11659 | OSome _x -> let _x = _f_a o _x in OSome _x
11660 | OAnt _x -> let _x = o#string _x in OAnt _x
11662 method meta_list :
11663 'a 'a_out.
11664 ('self_type -> 'a -> 'a_out) ->
11665 'a meta_list -> 'a_out meta_list =
11666 fun _f_a ->
11667 function
11668 | LNil -> LNil
11669 | LCons (_x, _x_i1) ->
11670 let _x = _f_a o _x in
11671 let _x_i1 = o#meta_list _f_a _x_i1
11672 in LCons (_x, _x_i1)
11673 | LAnt _x -> let _x = o#string _x in LAnt _x
11675 method meta_bool : meta_bool -> meta_bool =
11676 function
11677 | BTrue -> BTrue
11678 | BFalse -> BFalse
11679 | BAnt _x -> let _x = o#string _x in BAnt _x
11681 method match_case : match_case -> match_case =
11682 function
11683 | McNil _x -> let _x = o#loc _x in McNil _x
11684 | McOr (_x, _x_i1, _x_i2) ->
11685 let _x = o#loc _x in
11686 let _x_i1 = o#match_case _x_i1 in
11687 let _x_i2 = o#match_case _x_i2
11688 in McOr (_x, _x_i1, _x_i2)
11689 | McArr (_x, _x_i1, _x_i2, _x_i3) ->
11690 let _x = o#loc _x in
11691 let _x_i1 = o#patt _x_i1 in
11692 let _x_i2 = o#expr _x_i2 in
11693 let _x_i3 = o#expr _x_i3
11694 in McArr (_x, _x_i1, _x_i2, _x_i3)
11695 | McAnt (_x, _x_i1) ->
11696 let _x = o#loc _x in
11697 let _x_i1 = o#string _x_i1 in McAnt (_x, _x_i1)
11699 method loc : loc -> loc = o#unknown
11701 method ident : ident -> ident =
11702 function
11703 | IdAcc (_x, _x_i1, _x_i2) ->
11704 let _x = o#loc _x in
11705 let _x_i1 = o#ident _x_i1 in
11706 let _x_i2 = o#ident _x_i2 in IdAcc (_x, _x_i1, _x_i2)
11707 | IdApp (_x, _x_i1, _x_i2) ->
11708 let _x = o#loc _x in
11709 let _x_i1 = o#ident _x_i1 in
11710 let _x_i2 = o#ident _x_i2 in IdApp (_x, _x_i1, _x_i2)
11711 | IdLid (_x, _x_i1) ->
11712 let _x = o#loc _x in
11713 let _x_i1 = o#string _x_i1 in IdLid (_x, _x_i1)
11714 | IdUid (_x, _x_i1) ->
11715 let _x = o#loc _x in
11716 let _x_i1 = o#string _x_i1 in IdUid (_x, _x_i1)
11717 | IdAnt (_x, _x_i1) ->
11718 let _x = o#loc _x in
11719 let _x_i1 = o#string _x_i1 in IdAnt (_x, _x_i1)
11721 method expr : expr -> expr =
11722 function
11723 | ExNil _x -> let _x = o#loc _x in ExNil _x
11724 | ExId (_x, _x_i1) ->
11725 let _x = o#loc _x in
11726 let _x_i1 = o#ident _x_i1 in ExId (_x, _x_i1)
11727 | ExAcc (_x, _x_i1, _x_i2) ->
11728 let _x = o#loc _x in
11729 let _x_i1 = o#expr _x_i1 in
11730 let _x_i2 = o#expr _x_i2 in ExAcc (_x, _x_i1, _x_i2)
11731 | ExAnt (_x, _x_i1) ->
11732 let _x = o#loc _x in
11733 let _x_i1 = o#string _x_i1 in ExAnt (_x, _x_i1)
11734 | ExApp (_x, _x_i1, _x_i2) ->
11735 let _x = o#loc _x in
11736 let _x_i1 = o#expr _x_i1 in
11737 let _x_i2 = o#expr _x_i2 in ExApp (_x, _x_i1, _x_i2)
11738 | ExAre (_x, _x_i1, _x_i2) ->
11739 let _x = o#loc _x in
11740 let _x_i1 = o#expr _x_i1 in
11741 let _x_i2 = o#expr _x_i2 in ExAre (_x, _x_i1, _x_i2)
11742 | ExArr (_x, _x_i1) ->
11743 let _x = o#loc _x in
11744 let _x_i1 = o#expr _x_i1 in ExArr (_x, _x_i1)
11745 | ExSem (_x, _x_i1, _x_i2) ->
11746 let _x = o#loc _x in
11747 let _x_i1 = o#expr _x_i1 in
11748 let _x_i2 = o#expr _x_i2 in ExSem (_x, _x_i1, _x_i2)
11749 | ExAsf _x -> let _x = o#loc _x in ExAsf _x
11750 | ExAsr (_x, _x_i1) ->
11751 let _x = o#loc _x in
11752 let _x_i1 = o#expr _x_i1 in ExAsr (_x, _x_i1)
11753 | ExAss (_x, _x_i1, _x_i2) ->
11754 let _x = o#loc _x in
11755 let _x_i1 = o#expr _x_i1 in
11756 let _x_i2 = o#expr _x_i2 in ExAss (_x, _x_i1, _x_i2)
11757 | ExChr (_x, _x_i1) ->
11758 let _x = o#loc _x in
11759 let _x_i1 = o#string _x_i1 in ExChr (_x, _x_i1)
11760 | ExCoe (_x, _x_i1, _x_i2, _x_i3) ->
11761 let _x = o#loc _x in
11762 let _x_i1 = o#expr _x_i1 in
11763 let _x_i2 = o#ctyp _x_i2 in
11764 let _x_i3 = o#ctyp _x_i3
11765 in ExCoe (_x, _x_i1, _x_i2, _x_i3)
11766 | ExFlo (_x, _x_i1) ->
11767 let _x = o#loc _x in
11768 let _x_i1 = o#string _x_i1 in ExFlo (_x, _x_i1)
11769 | ExFor (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5) ->
11770 let _x = o#loc _x in
11771 let _x_i1 = o#string _x_i1 in
11772 let _x_i2 = o#expr _x_i2 in
11773 let _x_i3 = o#expr _x_i3 in
11774 let _x_i4 = o#meta_bool _x_i4 in
11775 let _x_i5 = o#expr _x_i5
11776 in ExFor (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5)
11777 | ExFun (_x, _x_i1) ->
11778 let _x = o#loc _x in
11779 let _x_i1 = o#match_case _x_i1 in ExFun (_x, _x_i1)
11780 | ExIfe (_x, _x_i1, _x_i2, _x_i3) ->
11781 let _x = o#loc _x in
11782 let _x_i1 = o#expr _x_i1 in
11783 let _x_i2 = o#expr _x_i2 in
11784 let _x_i3 = o#expr _x_i3
11785 in ExIfe (_x, _x_i1, _x_i2, _x_i3)
11786 | ExInt (_x, _x_i1) ->
11787 let _x = o#loc _x in
11788 let _x_i1 = o#string _x_i1 in ExInt (_x, _x_i1)
11789 | ExInt32 (_x, _x_i1) ->
11790 let _x = o#loc _x in
11791 let _x_i1 = o#string _x_i1 in ExInt32 (_x, _x_i1)
11792 | ExInt64 (_x, _x_i1) ->
11793 let _x = o#loc _x in
11794 let _x_i1 = o#string _x_i1 in ExInt64 (_x, _x_i1)
11795 | ExNativeInt (_x, _x_i1) ->
11796 let _x = o#loc _x in
11797 let _x_i1 = o#string _x_i1 in ExNativeInt (_x, _x_i1)
11798 | ExLab (_x, _x_i1, _x_i2) ->
11799 let _x = o#loc _x in
11800 let _x_i1 = o#string _x_i1 in
11801 let _x_i2 = o#expr _x_i2 in ExLab (_x, _x_i1, _x_i2)
11802 | ExLaz (_x, _x_i1) ->
11803 let _x = o#loc _x in
11804 let _x_i1 = o#expr _x_i1 in ExLaz (_x, _x_i1)
11805 | ExLet (_x, _x_i1, _x_i2, _x_i3) ->
11806 let _x = o#loc _x in
11807 let _x_i1 = o#meta_bool _x_i1 in
11808 let _x_i2 = o#binding _x_i2 in
11809 let _x_i3 = o#expr _x_i3
11810 in ExLet (_x, _x_i1, _x_i2, _x_i3)
11811 | ExLmd (_x, _x_i1, _x_i2, _x_i3) ->
11812 let _x = o#loc _x in
11813 let _x_i1 = o#string _x_i1 in
11814 let _x_i2 = o#module_expr _x_i2 in
11815 let _x_i3 = o#expr _x_i3
11816 in ExLmd (_x, _x_i1, _x_i2, _x_i3)
11817 | ExMat (_x, _x_i1, _x_i2) ->
11818 let _x = o#loc _x in
11819 let _x_i1 = o#expr _x_i1 in
11820 let _x_i2 = o#match_case _x_i2
11821 in ExMat (_x, _x_i1, _x_i2)
11822 | ExNew (_x, _x_i1) ->
11823 let _x = o#loc _x in
11824 let _x_i1 = o#ident _x_i1 in ExNew (_x, _x_i1)
11825 | ExObj (_x, _x_i1, _x_i2) ->
11826 let _x = o#loc _x in
11827 let _x_i1 = o#patt _x_i1 in
11828 let _x_i2 = o#class_str_item _x_i2
11829 in ExObj (_x, _x_i1, _x_i2)
11830 | ExOlb (_x, _x_i1, _x_i2) ->
11831 let _x = o#loc _x in
11832 let _x_i1 = o#string _x_i1 in
11833 let _x_i2 = o#expr _x_i2 in ExOlb (_x, _x_i1, _x_i2)
11834 | ExOvr (_x, _x_i1) ->
11835 let _x = o#loc _x in
11836 let _x_i1 = o#rec_binding _x_i1 in ExOvr (_x, _x_i1)
11837 | ExRec (_x, _x_i1, _x_i2) ->
11838 let _x = o#loc _x in
11839 let _x_i1 = o#rec_binding _x_i1 in
11840 let _x_i2 = o#expr _x_i2 in ExRec (_x, _x_i1, _x_i2)
11841 | ExSeq (_x, _x_i1) ->
11842 let _x = o#loc _x in
11843 let _x_i1 = o#expr _x_i1 in ExSeq (_x, _x_i1)
11844 | ExSnd (_x, _x_i1, _x_i2) ->
11845 let _x = o#loc _x in
11846 let _x_i1 = o#expr _x_i1 in
11847 let _x_i2 = o#string _x_i2 in ExSnd (_x, _x_i1, _x_i2)
11848 | ExSte (_x, _x_i1, _x_i2) ->
11849 let _x = o#loc _x in
11850 let _x_i1 = o#expr _x_i1 in
11851 let _x_i2 = o#expr _x_i2 in ExSte (_x, _x_i1, _x_i2)
11852 | ExStr (_x, _x_i1) ->
11853 let _x = o#loc _x in
11854 let _x_i1 = o#string _x_i1 in ExStr (_x, _x_i1)
11855 | ExTry (_x, _x_i1, _x_i2) ->
11856 let _x = o#loc _x in
11857 let _x_i1 = o#expr _x_i1 in
11858 let _x_i2 = o#match_case _x_i2
11859 in ExTry (_x, _x_i1, _x_i2)
11860 | ExTup (_x, _x_i1) ->
11861 let _x = o#loc _x in
11862 let _x_i1 = o#expr _x_i1 in ExTup (_x, _x_i1)
11863 | ExCom (_x, _x_i1, _x_i2) ->
11864 let _x = o#loc _x in
11865 let _x_i1 = o#expr _x_i1 in
11866 let _x_i2 = o#expr _x_i2 in ExCom (_x, _x_i1, _x_i2)
11867 | ExTyc (_x, _x_i1, _x_i2) ->
11868 let _x = o#loc _x in
11869 let _x_i1 = o#expr _x_i1 in
11870 let _x_i2 = o#ctyp _x_i2 in ExTyc (_x, _x_i1, _x_i2)
11871 | ExVrn (_x, _x_i1) ->
11872 let _x = o#loc _x in
11873 let _x_i1 = o#string _x_i1 in ExVrn (_x, _x_i1)
11874 | ExWhi (_x, _x_i1, _x_i2) ->
11875 let _x = o#loc _x in
11876 let _x_i1 = o#expr _x_i1 in
11877 let _x_i2 = o#expr _x_i2 in ExWhi (_x, _x_i1, _x_i2)
11879 method ctyp : ctyp -> ctyp =
11880 function
11881 | TyNil _x -> let _x = o#loc _x in TyNil _x
11882 | TyAli (_x, _x_i1, _x_i2) ->
11883 let _x = o#loc _x in
11884 let _x_i1 = o#ctyp _x_i1 in
11885 let _x_i2 = o#ctyp _x_i2 in TyAli (_x, _x_i1, _x_i2)
11886 | TyAny _x -> let _x = o#loc _x in TyAny _x
11887 | TyApp (_x, _x_i1, _x_i2) ->
11888 let _x = o#loc _x in
11889 let _x_i1 = o#ctyp _x_i1 in
11890 let _x_i2 = o#ctyp _x_i2 in TyApp (_x, _x_i1, _x_i2)
11891 | TyArr (_x, _x_i1, _x_i2) ->
11892 let _x = o#loc _x in
11893 let _x_i1 = o#ctyp _x_i1 in
11894 let _x_i2 = o#ctyp _x_i2 in TyArr (_x, _x_i1, _x_i2)
11895 | TyCls (_x, _x_i1) ->
11896 let _x = o#loc _x in
11897 let _x_i1 = o#ident _x_i1 in TyCls (_x, _x_i1)
11898 | TyLab (_x, _x_i1, _x_i2) ->
11899 let _x = o#loc _x in
11900 let _x_i1 = o#string _x_i1 in
11901 let _x_i2 = o#ctyp _x_i2 in TyLab (_x, _x_i1, _x_i2)
11902 | TyId (_x, _x_i1) ->
11903 let _x = o#loc _x in
11904 let _x_i1 = o#ident _x_i1 in TyId (_x, _x_i1)
11905 | TyMan (_x, _x_i1, _x_i2) ->
11906 let _x = o#loc _x in
11907 let _x_i1 = o#ctyp _x_i1 in
11908 let _x_i2 = o#ctyp _x_i2 in TyMan (_x, _x_i1, _x_i2)
11909 | TyDcl (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
11910 let _x = o#loc _x in
11911 let _x_i1 = o#string _x_i1 in
11912 let _x_i2 = o#list (fun o -> o#ctyp) _x_i2 in
11913 let _x_i3 = o#ctyp _x_i3 in
11914 let _x_i4 =
11915 o#list
11916 (fun o (_x, _x_i1) ->
11917 let _x = o#ctyp _x in
11918 let _x_i1 = o#ctyp _x_i1 in (_x, _x_i1))
11919 _x_i4
11920 in TyDcl (_x, _x_i1, _x_i2, _x_i3, _x_i4)
11921 | TyObj (_x, _x_i1, _x_i2) ->
11922 let _x = o#loc _x in
11923 let _x_i1 = o#ctyp _x_i1 in
11924 let _x_i2 = o#meta_bool _x_i2
11925 in TyObj (_x, _x_i1, _x_i2)
11926 | TyOlb (_x, _x_i1, _x_i2) ->
11927 let _x = o#loc _x in
11928 let _x_i1 = o#string _x_i1 in
11929 let _x_i2 = o#ctyp _x_i2 in TyOlb (_x, _x_i1, _x_i2)
11930 | TyPol (_x, _x_i1, _x_i2) ->
11931 let _x = o#loc _x in
11932 let _x_i1 = o#ctyp _x_i1 in
11933 let _x_i2 = o#ctyp _x_i2 in TyPol (_x, _x_i1, _x_i2)
11934 | TyQuo (_x, _x_i1) ->
11935 let _x = o#loc _x in
11936 let _x_i1 = o#string _x_i1 in TyQuo (_x, _x_i1)
11937 | TyQuP (_x, _x_i1) ->
11938 let _x = o#loc _x in
11939 let _x_i1 = o#string _x_i1 in TyQuP (_x, _x_i1)
11940 | TyQuM (_x, _x_i1) ->
11941 let _x = o#loc _x in
11942 let _x_i1 = o#string _x_i1 in TyQuM (_x, _x_i1)
11943 | TyVrn (_x, _x_i1) ->
11944 let _x = o#loc _x in
11945 let _x_i1 = o#string _x_i1 in TyVrn (_x, _x_i1)
11946 | TyRec (_x, _x_i1) ->
11947 let _x = o#loc _x in
11948 let _x_i1 = o#ctyp _x_i1 in TyRec (_x, _x_i1)
11949 | TyCol (_x, _x_i1, _x_i2) ->
11950 let _x = o#loc _x in
11951 let _x_i1 = o#ctyp _x_i1 in
11952 let _x_i2 = o#ctyp _x_i2 in TyCol (_x, _x_i1, _x_i2)
11953 | TySem (_x, _x_i1, _x_i2) ->
11954 let _x = o#loc _x in
11955 let _x_i1 = o#ctyp _x_i1 in
11956 let _x_i2 = o#ctyp _x_i2 in TySem (_x, _x_i1, _x_i2)
11957 | TyCom (_x, _x_i1, _x_i2) ->
11958 let _x = o#loc _x in
11959 let _x_i1 = o#ctyp _x_i1 in
11960 let _x_i2 = o#ctyp _x_i2 in TyCom (_x, _x_i1, _x_i2)
11961 | TySum (_x, _x_i1) ->
11962 let _x = o#loc _x in
11963 let _x_i1 = o#ctyp _x_i1 in TySum (_x, _x_i1)
11964 | TyOf (_x, _x_i1, _x_i2) ->
11965 let _x = o#loc _x in
11966 let _x_i1 = o#ctyp _x_i1 in
11967 let _x_i2 = o#ctyp _x_i2 in TyOf (_x, _x_i1, _x_i2)
11968 | TyAnd (_x, _x_i1, _x_i2) ->
11969 let _x = o#loc _x in
11970 let _x_i1 = o#ctyp _x_i1 in
11971 let _x_i2 = o#ctyp _x_i2 in TyAnd (_x, _x_i1, _x_i2)
11972 | TyOr (_x, _x_i1, _x_i2) ->
11973 let _x = o#loc _x in
11974 let _x_i1 = o#ctyp _x_i1 in
11975 let _x_i2 = o#ctyp _x_i2 in TyOr (_x, _x_i1, _x_i2)
11976 | TyPrv (_x, _x_i1) ->
11977 let _x = o#loc _x in
11978 let _x_i1 = o#ctyp _x_i1 in TyPrv (_x, _x_i1)
11979 | TyMut (_x, _x_i1) ->
11980 let _x = o#loc _x in
11981 let _x_i1 = o#ctyp _x_i1 in TyMut (_x, _x_i1)
11982 | TyTup (_x, _x_i1) ->
11983 let _x = o#loc _x in
11984 let _x_i1 = o#ctyp _x_i1 in TyTup (_x, _x_i1)
11985 | TySta (_x, _x_i1, _x_i2) ->
11986 let _x = o#loc _x in
11987 let _x_i1 = o#ctyp _x_i1 in
11988 let _x_i2 = o#ctyp _x_i2 in TySta (_x, _x_i1, _x_i2)
11989 | TyVrnEq (_x, _x_i1) ->
11990 let _x = o#loc _x in
11991 let _x_i1 = o#ctyp _x_i1 in TyVrnEq (_x, _x_i1)
11992 | TyVrnSup (_x, _x_i1) ->
11993 let _x = o#loc _x in
11994 let _x_i1 = o#ctyp _x_i1 in TyVrnSup (_x, _x_i1)
11995 | TyVrnInf (_x, _x_i1) ->
11996 let _x = o#loc _x in
11997 let _x_i1 = o#ctyp _x_i1 in TyVrnInf (_x, _x_i1)
11998 | TyVrnInfSup (_x, _x_i1, _x_i2) ->
11999 let _x = o#loc _x in
12000 let _x_i1 = o#ctyp _x_i1 in
12001 let _x_i2 = o#ctyp _x_i2
12002 in TyVrnInfSup (_x, _x_i1, _x_i2)
12003 | TyAmp (_x, _x_i1, _x_i2) ->
12004 let _x = o#loc _x in
12005 let _x_i1 = o#ctyp _x_i1 in
12006 let _x_i2 = o#ctyp _x_i2 in TyAmp (_x, _x_i1, _x_i2)
12007 | TyOfAmp (_x, _x_i1, _x_i2) ->
12008 let _x = o#loc _x in
12009 let _x_i1 = o#ctyp _x_i1 in
12010 let _x_i2 = o#ctyp _x_i2 in TyOfAmp (_x, _x_i1, _x_i2)
12011 | TyAnt (_x, _x_i1) ->
12012 let _x = o#loc _x in
12013 let _x_i1 = o#string _x_i1 in TyAnt (_x, _x_i1)
12015 method class_type : class_type -> class_type =
12016 function
12017 | CtNil _x -> let _x = o#loc _x in CtNil _x
12018 | CtCon (_x, _x_i1, _x_i2, _x_i3) ->
12019 let _x = o#loc _x in
12020 let _x_i1 = o#meta_bool _x_i1 in
12021 let _x_i2 = o#ident _x_i2 in
12022 let _x_i3 = o#ctyp _x_i3
12023 in CtCon (_x, _x_i1, _x_i2, _x_i3)
12024 | CtFun (_x, _x_i1, _x_i2) ->
12025 let _x = o#loc _x in
12026 let _x_i1 = o#ctyp _x_i1 in
12027 let _x_i2 = o#class_type _x_i2
12028 in CtFun (_x, _x_i1, _x_i2)
12029 | CtSig (_x, _x_i1, _x_i2) ->
12030 let _x = o#loc _x in
12031 let _x_i1 = o#ctyp _x_i1 in
12032 let _x_i2 = o#class_sig_item _x_i2
12033 in CtSig (_x, _x_i1, _x_i2)
12034 | CtAnd (_x, _x_i1, _x_i2) ->
12035 let _x = o#loc _x in
12036 let _x_i1 = o#class_type _x_i1 in
12037 let _x_i2 = o#class_type _x_i2
12038 in CtAnd (_x, _x_i1, _x_i2)
12039 | CtCol (_x, _x_i1, _x_i2) ->
12040 let _x = o#loc _x in
12041 let _x_i1 = o#class_type _x_i1 in
12042 let _x_i2 = o#class_type _x_i2
12043 in CtCol (_x, _x_i1, _x_i2)
12044 | CtEq (_x, _x_i1, _x_i2) ->
12045 let _x = o#loc _x in
12046 let _x_i1 = o#class_type _x_i1 in
12047 let _x_i2 = o#class_type _x_i2
12048 in CtEq (_x, _x_i1, _x_i2)
12049 | CtAnt (_x, _x_i1) ->
12050 let _x = o#loc _x in
12051 let _x_i1 = o#string _x_i1 in CtAnt (_x, _x_i1)
12053 method class_str_item : class_str_item -> class_str_item =
12054 function
12055 | CrNil _x -> let _x = o#loc _x in CrNil _x
12056 | CrSem (_x, _x_i1, _x_i2) ->
12057 let _x = o#loc _x in
12058 let _x_i1 = o#class_str_item _x_i1 in
12059 let _x_i2 = o#class_str_item _x_i2
12060 in CrSem (_x, _x_i1, _x_i2)
12061 | CrCtr (_x, _x_i1, _x_i2) ->
12062 let _x = o#loc _x in
12063 let _x_i1 = o#ctyp _x_i1 in
12064 let _x_i2 = o#ctyp _x_i2 in CrCtr (_x, _x_i1, _x_i2)
12065 | CrInh (_x, _x_i1, _x_i2) ->
12066 let _x = o#loc _x in
12067 let _x_i1 = o#class_expr _x_i1 in
12068 let _x_i2 = o#string _x_i2 in CrInh (_x, _x_i1, _x_i2)
12069 | CrIni (_x, _x_i1) ->
12070 let _x = o#loc _x in
12071 let _x_i1 = o#expr _x_i1 in CrIni (_x, _x_i1)
12072 | CrMth (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
12073 let _x = o#loc _x in
12074 let _x_i1 = o#string _x_i1 in
12075 let _x_i2 = o#meta_bool _x_i2 in
12076 let _x_i3 = o#expr _x_i3 in
12077 let _x_i4 = o#ctyp _x_i4
12078 in CrMth (_x, _x_i1, _x_i2, _x_i3, _x_i4)
12079 | CrVal (_x, _x_i1, _x_i2, _x_i3) ->
12080 let _x = o#loc _x in
12081 let _x_i1 = o#string _x_i1 in
12082 let _x_i2 = o#meta_bool _x_i2 in
12083 let _x_i3 = o#expr _x_i3
12084 in CrVal (_x, _x_i1, _x_i2, _x_i3)
12085 | CrVir (_x, _x_i1, _x_i2, _x_i3) ->
12086 let _x = o#loc _x in
12087 let _x_i1 = o#string _x_i1 in
12088 let _x_i2 = o#meta_bool _x_i2 in
12089 let _x_i3 = o#ctyp _x_i3
12090 in CrVir (_x, _x_i1, _x_i2, _x_i3)
12091 | CrVvr (_x, _x_i1, _x_i2, _x_i3) ->
12092 let _x = o#loc _x in
12093 let _x_i1 = o#string _x_i1 in
12094 let _x_i2 = o#meta_bool _x_i2 in
12095 let _x_i3 = o#ctyp _x_i3
12096 in CrVvr (_x, _x_i1, _x_i2, _x_i3)
12097 | CrAnt (_x, _x_i1) ->
12098 let _x = o#loc _x in
12099 let _x_i1 = o#string _x_i1 in CrAnt (_x, _x_i1)
12101 method class_sig_item : class_sig_item -> class_sig_item =
12102 function
12103 | CgNil _x -> let _x = o#loc _x in CgNil _x
12104 | CgCtr (_x, _x_i1, _x_i2) ->
12105 let _x = o#loc _x in
12106 let _x_i1 = o#ctyp _x_i1 in
12107 let _x_i2 = o#ctyp _x_i2 in CgCtr (_x, _x_i1, _x_i2)
12108 | CgSem (_x, _x_i1, _x_i2) ->
12109 let _x = o#loc _x in
12110 let _x_i1 = o#class_sig_item _x_i1 in
12111 let _x_i2 = o#class_sig_item _x_i2
12112 in CgSem (_x, _x_i1, _x_i2)
12113 | CgInh (_x, _x_i1) ->
12114 let _x = o#loc _x in
12115 let _x_i1 = o#class_type _x_i1 in CgInh (_x, _x_i1)
12116 | CgMth (_x, _x_i1, _x_i2, _x_i3) ->
12117 let _x = o#loc _x in
12118 let _x_i1 = o#string _x_i1 in
12119 let _x_i2 = o#meta_bool _x_i2 in
12120 let _x_i3 = o#ctyp _x_i3
12121 in CgMth (_x, _x_i1, _x_i2, _x_i3)
12122 | CgVal (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
12123 let _x = o#loc _x in
12124 let _x_i1 = o#string _x_i1 in
12125 let _x_i2 = o#meta_bool _x_i2 in
12126 let _x_i3 = o#meta_bool _x_i3 in
12127 let _x_i4 = o#ctyp _x_i4
12128 in CgVal (_x, _x_i1, _x_i2, _x_i3, _x_i4)
12129 | CgVir (_x, _x_i1, _x_i2, _x_i3) ->
12130 let _x = o#loc _x in
12131 let _x_i1 = o#string _x_i1 in
12132 let _x_i2 = o#meta_bool _x_i2 in
12133 let _x_i3 = o#ctyp _x_i3
12134 in CgVir (_x, _x_i1, _x_i2, _x_i3)
12135 | CgAnt (_x, _x_i1) ->
12136 let _x = o#loc _x in
12137 let _x_i1 = o#string _x_i1 in CgAnt (_x, _x_i1)
12139 method class_expr : class_expr -> class_expr =
12140 function
12141 | CeNil _x -> let _x = o#loc _x in CeNil _x
12142 | CeApp (_x, _x_i1, _x_i2) ->
12143 let _x = o#loc _x in
12144 let _x_i1 = o#class_expr _x_i1 in
12145 let _x_i2 = o#expr _x_i2 in CeApp (_x, _x_i1, _x_i2)
12146 | CeCon (_x, _x_i1, _x_i2, _x_i3) ->
12147 let _x = o#loc _x in
12148 let _x_i1 = o#meta_bool _x_i1 in
12149 let _x_i2 = o#ident _x_i2 in
12150 let _x_i3 = o#ctyp _x_i3
12151 in CeCon (_x, _x_i1, _x_i2, _x_i3)
12152 | CeFun (_x, _x_i1, _x_i2) ->
12153 let _x = o#loc _x in
12154 let _x_i1 = o#patt _x_i1 in
12155 let _x_i2 = o#class_expr _x_i2
12156 in CeFun (_x, _x_i1, _x_i2)
12157 | CeLet (_x, _x_i1, _x_i2, _x_i3) ->
12158 let _x = o#loc _x in
12159 let _x_i1 = o#meta_bool _x_i1 in
12160 let _x_i2 = o#binding _x_i2 in
12161 let _x_i3 = o#class_expr _x_i3
12162 in CeLet (_x, _x_i1, _x_i2, _x_i3)
12163 | CeStr (_x, _x_i1, _x_i2) ->
12164 let _x = o#loc _x in
12165 let _x_i1 = o#patt _x_i1 in
12166 let _x_i2 = o#class_str_item _x_i2
12167 in CeStr (_x, _x_i1, _x_i2)
12168 | CeTyc (_x, _x_i1, _x_i2) ->
12169 let _x = o#loc _x in
12170 let _x_i1 = o#class_expr _x_i1 in
12171 let _x_i2 = o#class_type _x_i2
12172 in CeTyc (_x, _x_i1, _x_i2)
12173 | CeAnd (_x, _x_i1, _x_i2) ->
12174 let _x = o#loc _x in
12175 let _x_i1 = o#class_expr _x_i1 in
12176 let _x_i2 = o#class_expr _x_i2
12177 in CeAnd (_x, _x_i1, _x_i2)
12178 | CeEq (_x, _x_i1, _x_i2) ->
12179 let _x = o#loc _x in
12180 let _x_i1 = o#class_expr _x_i1 in
12181 let _x_i2 = o#class_expr _x_i2
12182 in CeEq (_x, _x_i1, _x_i2)
12183 | CeAnt (_x, _x_i1) ->
12184 let _x = o#loc _x in
12185 let _x_i1 = o#string _x_i1 in CeAnt (_x, _x_i1)
12187 method binding : binding -> binding =
12188 function
12189 | BiNil _x -> let _x = o#loc _x in BiNil _x
12190 | BiAnd (_x, _x_i1, _x_i2) ->
12191 let _x = o#loc _x in
12192 let _x_i1 = o#binding _x_i1 in
12193 let _x_i2 = o#binding _x_i2 in BiAnd (_x, _x_i1, _x_i2)
12194 | BiEq (_x, _x_i1, _x_i2) ->
12195 let _x = o#loc _x in
12196 let _x_i1 = o#patt _x_i1 in
12197 let _x_i2 = o#expr _x_i2 in BiEq (_x, _x_i1, _x_i2)
12198 | BiAnt (_x, _x_i1) ->
12199 let _x = o#loc _x in
12200 let _x_i1 = o#string _x_i1 in BiAnt (_x, _x_i1)
12202 method unknown : 'a. 'a -> 'a = fun x -> x
12206 class fold =
12207 object ((o : 'self_type))
12208 method string : string -> 'self_type = o#unknown
12210 method list :
12212 ('self_type -> 'a -> 'self_type) -> 'a list -> 'self_type =
12213 fun _f_a ->
12214 function
12215 | [] -> o
12216 | _x :: _x_i1 ->
12217 let o = _f_a o _x in let o = o#list _f_a _x_i1 in o
12219 method with_constr : with_constr -> 'self_type =
12220 function
12221 | WcNil _x -> let o = o#loc _x in o
12222 | WcTyp (_x, _x_i1, _x_i2) ->
12223 let o = o#loc _x in
12224 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12225 | WcMod (_x, _x_i1, _x_i2) ->
12226 let o = o#loc _x in
12227 let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
12228 | WcAnd (_x, _x_i1, _x_i2) ->
12229 let o = o#loc _x in
12230 let o = o#with_constr _x_i1 in
12231 let o = o#with_constr _x_i2 in o
12232 | WcAnt (_x, _x_i1) ->
12233 let o = o#loc _x in let o = o#string _x_i1 in o
12235 method str_item : str_item -> 'self_type =
12236 function
12237 | StNil _x -> let o = o#loc _x in o
12238 | StCls (_x, _x_i1) ->
12239 let o = o#loc _x in let o = o#class_expr _x_i1 in o
12240 | StClt (_x, _x_i1) ->
12241 let o = o#loc _x in let o = o#class_type _x_i1 in o
12242 | StSem (_x, _x_i1, _x_i2) ->
12243 let o = o#loc _x in
12244 let o = o#str_item _x_i1 in
12245 let o = o#str_item _x_i2 in o
12246 | StDir (_x, _x_i1, _x_i2) ->
12247 let o = o#loc _x in
12248 let o = o#string _x_i1 in let o = o#expr _x_i2 in o
12249 | StExc (_x, _x_i1, _x_i2) ->
12250 let o = o#loc _x in
12251 let o = o#ctyp _x_i1 in
12252 let o = o#meta_option (fun o -> o#ident) _x_i2 in o
12253 | StExp (_x, _x_i1) ->
12254 let o = o#loc _x in let o = o#expr _x_i1 in o
12255 | StExt (_x, _x_i1, _x_i2, _x_i3) ->
12256 let o = o#loc _x in
12257 let o = o#string _x_i1 in
12258 let o = o#ctyp _x_i2 in
12259 let o = o#meta_list (fun o -> o#string) _x_i3 in o
12260 | StInc (_x, _x_i1) ->
12261 let o = o#loc _x in let o = o#module_expr _x_i1 in o
12262 | StMod (_x, _x_i1, _x_i2) ->
12263 let o = o#loc _x in
12264 let o = o#string _x_i1 in
12265 let o = o#module_expr _x_i2 in o
12266 | StRecMod (_x, _x_i1) ->
12267 let o = o#loc _x in let o = o#module_binding _x_i1 in o
12268 | StMty (_x, _x_i1, _x_i2) ->
12269 let o = o#loc _x in
12270 let o = o#string _x_i1 in
12271 let o = o#module_type _x_i2 in o
12272 | StOpn (_x, _x_i1) ->
12273 let o = o#loc _x in let o = o#ident _x_i1 in o
12274 | StTyp (_x, _x_i1) ->
12275 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12276 | StVal (_x, _x_i1, _x_i2) ->
12277 let o = o#loc _x in
12278 let o = o#meta_bool _x_i1 in
12279 let o = o#binding _x_i2 in o
12280 | StAnt (_x, _x_i1) ->
12281 let o = o#loc _x in let o = o#string _x_i1 in o
12283 method sig_item : sig_item -> 'self_type =
12284 function
12285 | SgNil _x -> let o = o#loc _x in o
12286 | SgCls (_x, _x_i1) ->
12287 let o = o#loc _x in let o = o#class_type _x_i1 in o
12288 | SgClt (_x, _x_i1) ->
12289 let o = o#loc _x in let o = o#class_type _x_i1 in o
12290 | SgSem (_x, _x_i1, _x_i2) ->
12291 let o = o#loc _x in
12292 let o = o#sig_item _x_i1 in
12293 let o = o#sig_item _x_i2 in o
12294 | SgDir (_x, _x_i1, _x_i2) ->
12295 let o = o#loc _x in
12296 let o = o#string _x_i1 in let o = o#expr _x_i2 in o
12297 | SgExc (_x, _x_i1) ->
12298 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12299 | SgExt (_x, _x_i1, _x_i2, _x_i3) ->
12300 let o = o#loc _x in
12301 let o = o#string _x_i1 in
12302 let o = o#ctyp _x_i2 in
12303 let o = o#meta_list (fun o -> o#string) _x_i3 in o
12304 | SgInc (_x, _x_i1) ->
12305 let o = o#loc _x in let o = o#module_type _x_i1 in o
12306 | SgMod (_x, _x_i1, _x_i2) ->
12307 let o = o#loc _x in
12308 let o = o#string _x_i1 in
12309 let o = o#module_type _x_i2 in o
12310 | SgRecMod (_x, _x_i1) ->
12311 let o = o#loc _x in let o = o#module_binding _x_i1 in o
12312 | SgMty (_x, _x_i1, _x_i2) ->
12313 let o = o#loc _x in
12314 let o = o#string _x_i1 in
12315 let o = o#module_type _x_i2 in o
12316 | SgOpn (_x, _x_i1) ->
12317 let o = o#loc _x in let o = o#ident _x_i1 in o
12318 | SgTyp (_x, _x_i1) ->
12319 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12320 | SgVal (_x, _x_i1, _x_i2) ->
12321 let o = o#loc _x in
12322 let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
12323 | SgAnt (_x, _x_i1) ->
12324 let o = o#loc _x in let o = o#string _x_i1 in o
12326 method rec_binding : rec_binding -> 'self_type =
12327 function
12328 | RbNil _x -> let o = o#loc _x in o
12329 | RbSem (_x, _x_i1, _x_i2) ->
12330 let o = o#loc _x in
12331 let o = o#rec_binding _x_i1 in
12332 let o = o#rec_binding _x_i2 in o
12333 | RbEq (_x, _x_i1, _x_i2) ->
12334 let o = o#loc _x in
12335 let o = o#ident _x_i1 in let o = o#expr _x_i2 in o
12336 | RbAnt (_x, _x_i1) ->
12337 let o = o#loc _x in let o = o#string _x_i1 in o
12339 method patt : patt -> 'self_type =
12340 function
12341 | PaNil _x -> let o = o#loc _x in o
12342 | PaId (_x, _x_i1) ->
12343 let o = o#loc _x in let o = o#ident _x_i1 in o
12344 | PaAli (_x, _x_i1, _x_i2) ->
12345 let o = o#loc _x in
12346 let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
12347 | PaAnt (_x, _x_i1) ->
12348 let o = o#loc _x in let o = o#string _x_i1 in o
12349 | PaAny _x -> let o = o#loc _x in o
12350 | PaApp (_x, _x_i1, _x_i2) ->
12351 let o = o#loc _x in
12352 let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
12353 | PaArr (_x, _x_i1) ->
12354 let o = o#loc _x in let o = o#patt _x_i1 in o
12355 | PaCom (_x, _x_i1, _x_i2) ->
12356 let o = o#loc _x in
12357 let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
12358 | PaSem (_x, _x_i1, _x_i2) ->
12359 let o = o#loc _x in
12360 let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
12361 | PaChr (_x, _x_i1) ->
12362 let o = o#loc _x in let o = o#string _x_i1 in o
12363 | PaInt (_x, _x_i1) ->
12364 let o = o#loc _x in let o = o#string _x_i1 in o
12365 | PaInt32 (_x, _x_i1) ->
12366 let o = o#loc _x in let o = o#string _x_i1 in o
12367 | PaInt64 (_x, _x_i1) ->
12368 let o = o#loc _x in let o = o#string _x_i1 in o
12369 | PaNativeInt (_x, _x_i1) ->
12370 let o = o#loc _x in let o = o#string _x_i1 in o
12371 | PaFlo (_x, _x_i1) ->
12372 let o = o#loc _x in let o = o#string _x_i1 in o
12373 | PaLab (_x, _x_i1, _x_i2) ->
12374 let o = o#loc _x in
12375 let o = o#string _x_i1 in let o = o#patt _x_i2 in o
12376 | PaOlb (_x, _x_i1, _x_i2) ->
12377 let o = o#loc _x in
12378 let o = o#string _x_i1 in let o = o#patt _x_i2 in o
12379 | PaOlbi (_x, _x_i1, _x_i2, _x_i3) ->
12380 let o = o#loc _x in
12381 let o = o#string _x_i1 in
12382 let o = o#patt _x_i2 in let o = o#expr _x_i3 in o
12383 | PaOrp (_x, _x_i1, _x_i2) ->
12384 let o = o#loc _x in
12385 let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
12386 | PaRng (_x, _x_i1, _x_i2) ->
12387 let o = o#loc _x in
12388 let o = o#patt _x_i1 in let o = o#patt _x_i2 in o
12389 | PaRec (_x, _x_i1) ->
12390 let o = o#loc _x in let o = o#patt _x_i1 in o
12391 | PaEq (_x, _x_i1, _x_i2) ->
12392 let o = o#loc _x in
12393 let o = o#ident _x_i1 in let o = o#patt _x_i2 in o
12394 | PaStr (_x, _x_i1) ->
12395 let o = o#loc _x in let o = o#string _x_i1 in o
12396 | PaTup (_x, _x_i1) ->
12397 let o = o#loc _x in let o = o#patt _x_i1 in o
12398 | PaTyc (_x, _x_i1, _x_i2) ->
12399 let o = o#loc _x in
12400 let o = o#patt _x_i1 in let o = o#ctyp _x_i2 in o
12401 | PaTyp (_x, _x_i1) ->
12402 let o = o#loc _x in let o = o#ident _x_i1 in o
12403 | PaVrn (_x, _x_i1) ->
12404 let o = o#loc _x in let o = o#string _x_i1 in o
12406 method module_type : module_type -> 'self_type =
12407 function
12408 | MtNil _x -> let o = o#loc _x in o
12409 | MtId (_x, _x_i1) ->
12410 let o = o#loc _x in let o = o#ident _x_i1 in o
12411 | MtFun (_x, _x_i1, _x_i2, _x_i3) ->
12412 let o = o#loc _x in
12413 let o = o#string _x_i1 in
12414 let o = o#module_type _x_i2 in
12415 let o = o#module_type _x_i3 in o
12416 | MtQuo (_x, _x_i1) ->
12417 let o = o#loc _x in let o = o#string _x_i1 in o
12418 | MtSig (_x, _x_i1) ->
12419 let o = o#loc _x in let o = o#sig_item _x_i1 in o
12420 | MtWit (_x, _x_i1, _x_i2) ->
12421 let o = o#loc _x in
12422 let o = o#module_type _x_i1 in
12423 let o = o#with_constr _x_i2 in o
12424 | MtAnt (_x, _x_i1) ->
12425 let o = o#loc _x in let o = o#string _x_i1 in o
12427 method module_expr : module_expr -> 'self_type =
12428 function
12429 | MeNil _x -> let o = o#loc _x in o
12430 | MeId (_x, _x_i1) ->
12431 let o = o#loc _x in let o = o#ident _x_i1 in o
12432 | MeApp (_x, _x_i1, _x_i2) ->
12433 let o = o#loc _x in
12434 let o = o#module_expr _x_i1 in
12435 let o = o#module_expr _x_i2 in o
12436 | MeFun (_x, _x_i1, _x_i2, _x_i3) ->
12437 let o = o#loc _x in
12438 let o = o#string _x_i1 in
12439 let o = o#module_type _x_i2 in
12440 let o = o#module_expr _x_i3 in o
12441 | MeStr (_x, _x_i1) ->
12442 let o = o#loc _x in let o = o#str_item _x_i1 in o
12443 | MeTyc (_x, _x_i1, _x_i2) ->
12444 let o = o#loc _x in
12445 let o = o#module_expr _x_i1 in
12446 let o = o#module_type _x_i2 in o
12447 | MeAnt (_x, _x_i1) ->
12448 let o = o#loc _x in let o = o#string _x_i1 in o
12450 method module_binding : module_binding -> 'self_type =
12451 function
12452 | MbNil _x -> let o = o#loc _x in o
12453 | MbAnd (_x, _x_i1, _x_i2) ->
12454 let o = o#loc _x in
12455 let o = o#module_binding _x_i1 in
12456 let o = o#module_binding _x_i2 in o
12457 | MbColEq (_x, _x_i1, _x_i2, _x_i3) ->
12458 let o = o#loc _x in
12459 let o = o#string _x_i1 in
12460 let o = o#module_type _x_i2 in
12461 let o = o#module_expr _x_i3 in o
12462 | MbCol (_x, _x_i1, _x_i2) ->
12463 let o = o#loc _x in
12464 let o = o#string _x_i1 in
12465 let o = o#module_type _x_i2 in o
12466 | MbAnt (_x, _x_i1) ->
12467 let o = o#loc _x in let o = o#string _x_i1 in o
12469 method meta_option :
12471 ('self_type -> 'a -> 'self_type) ->
12472 'a meta_option -> 'self_type =
12473 fun _f_a ->
12474 function
12475 | ONone -> o
12476 | OSome _x -> let o = _f_a o _x in o
12477 | OAnt _x -> let o = o#string _x in o
12479 method meta_list :
12481 ('self_type -> 'a -> 'self_type) ->
12482 'a meta_list -> 'self_type =
12483 fun _f_a ->
12484 function
12485 | LNil -> o
12486 | LCons (_x, _x_i1) ->
12487 let o = _f_a o _x in
12488 let o = o#meta_list _f_a _x_i1 in o
12489 | LAnt _x -> let o = o#string _x in o
12491 method meta_bool : meta_bool -> 'self_type =
12492 function
12493 | BTrue -> o
12494 | BFalse -> o
12495 | BAnt _x -> let o = o#string _x in o
12497 method match_case : match_case -> 'self_type =
12498 function
12499 | McNil _x -> let o = o#loc _x in o
12500 | McOr (_x, _x_i1, _x_i2) ->
12501 let o = o#loc _x in
12502 let o = o#match_case _x_i1 in
12503 let o = o#match_case _x_i2 in o
12504 | McArr (_x, _x_i1, _x_i2, _x_i3) ->
12505 let o = o#loc _x in
12506 let o = o#patt _x_i1 in
12507 let o = o#expr _x_i2 in let o = o#expr _x_i3 in o
12508 | McAnt (_x, _x_i1) ->
12509 let o = o#loc _x in let o = o#string _x_i1 in o
12511 method loc : loc -> 'self_type = o#unknown
12513 method ident : ident -> 'self_type =
12514 function
12515 | IdAcc (_x, _x_i1, _x_i2) ->
12516 let o = o#loc _x in
12517 let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
12518 | IdApp (_x, _x_i1, _x_i2) ->
12519 let o = o#loc _x in
12520 let o = o#ident _x_i1 in let o = o#ident _x_i2 in o
12521 | IdLid (_x, _x_i1) ->
12522 let o = o#loc _x in let o = o#string _x_i1 in o
12523 | IdUid (_x, _x_i1) ->
12524 let o = o#loc _x in let o = o#string _x_i1 in o
12525 | IdAnt (_x, _x_i1) ->
12526 let o = o#loc _x in let o = o#string _x_i1 in o
12528 method expr : expr -> 'self_type =
12529 function
12530 | ExNil _x -> let o = o#loc _x in o
12531 | ExId (_x, _x_i1) ->
12532 let o = o#loc _x in let o = o#ident _x_i1 in o
12533 | ExAcc (_x, _x_i1, _x_i2) ->
12534 let o = o#loc _x in
12535 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12536 | ExAnt (_x, _x_i1) ->
12537 let o = o#loc _x in let o = o#string _x_i1 in o
12538 | ExApp (_x, _x_i1, _x_i2) ->
12539 let o = o#loc _x in
12540 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12541 | ExAre (_x, _x_i1, _x_i2) ->
12542 let o = o#loc _x in
12543 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12544 | ExArr (_x, _x_i1) ->
12545 let o = o#loc _x in let o = o#expr _x_i1 in o
12546 | ExSem (_x, _x_i1, _x_i2) ->
12547 let o = o#loc _x in
12548 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12549 | ExAsf _x -> let o = o#loc _x in o
12550 | ExAsr (_x, _x_i1) ->
12551 let o = o#loc _x in let o = o#expr _x_i1 in o
12552 | ExAss (_x, _x_i1, _x_i2) ->
12553 let o = o#loc _x in
12554 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12555 | ExChr (_x, _x_i1) ->
12556 let o = o#loc _x in let o = o#string _x_i1 in o
12557 | ExCoe (_x, _x_i1, _x_i2, _x_i3) ->
12558 let o = o#loc _x in
12559 let o = o#expr _x_i1 in
12560 let o = o#ctyp _x_i2 in let o = o#ctyp _x_i3 in o
12561 | ExFlo (_x, _x_i1) ->
12562 let o = o#loc _x in let o = o#string _x_i1 in o
12563 | ExFor (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5) ->
12564 let o = o#loc _x in
12565 let o = o#string _x_i1 in
12566 let o = o#expr _x_i2 in
12567 let o = o#expr _x_i3 in
12568 let o = o#meta_bool _x_i4 in let o = o#expr _x_i5 in o
12569 | ExFun (_x, _x_i1) ->
12570 let o = o#loc _x in let o = o#match_case _x_i1 in o
12571 | ExIfe (_x, _x_i1, _x_i2, _x_i3) ->
12572 let o = o#loc _x in
12573 let o = o#expr _x_i1 in
12574 let o = o#expr _x_i2 in let o = o#expr _x_i3 in o
12575 | ExInt (_x, _x_i1) ->
12576 let o = o#loc _x in let o = o#string _x_i1 in o
12577 | ExInt32 (_x, _x_i1) ->
12578 let o = o#loc _x in let o = o#string _x_i1 in o
12579 | ExInt64 (_x, _x_i1) ->
12580 let o = o#loc _x in let o = o#string _x_i1 in o
12581 | ExNativeInt (_x, _x_i1) ->
12582 let o = o#loc _x in let o = o#string _x_i1 in o
12583 | ExLab (_x, _x_i1, _x_i2) ->
12584 let o = o#loc _x in
12585 let o = o#string _x_i1 in let o = o#expr _x_i2 in o
12586 | ExLaz (_x, _x_i1) ->
12587 let o = o#loc _x in let o = o#expr _x_i1 in o
12588 | ExLet (_x, _x_i1, _x_i2, _x_i3) ->
12589 let o = o#loc _x in
12590 let o = o#meta_bool _x_i1 in
12591 let o = o#binding _x_i2 in let o = o#expr _x_i3 in o
12592 | ExLmd (_x, _x_i1, _x_i2, _x_i3) ->
12593 let o = o#loc _x in
12594 let o = o#string _x_i1 in
12595 let o = o#module_expr _x_i2 in
12596 let o = o#expr _x_i3 in o
12597 | ExMat (_x, _x_i1, _x_i2) ->
12598 let o = o#loc _x in
12599 let o = o#expr _x_i1 in let o = o#match_case _x_i2 in o
12600 | ExNew (_x, _x_i1) ->
12601 let o = o#loc _x in let o = o#ident _x_i1 in o
12602 | ExObj (_x, _x_i1, _x_i2) ->
12603 let o = o#loc _x in
12604 let o = o#patt _x_i1 in
12605 let o = o#class_str_item _x_i2 in o
12606 | ExOlb (_x, _x_i1, _x_i2) ->
12607 let o = o#loc _x in
12608 let o = o#string _x_i1 in let o = o#expr _x_i2 in o
12609 | ExOvr (_x, _x_i1) ->
12610 let o = o#loc _x in let o = o#rec_binding _x_i1 in o
12611 | ExRec (_x, _x_i1, _x_i2) ->
12612 let o = o#loc _x in
12613 let o = o#rec_binding _x_i1 in
12614 let o = o#expr _x_i2 in o
12615 | ExSeq (_x, _x_i1) ->
12616 let o = o#loc _x in let o = o#expr _x_i1 in o
12617 | ExSnd (_x, _x_i1, _x_i2) ->
12618 let o = o#loc _x in
12619 let o = o#expr _x_i1 in let o = o#string _x_i2 in o
12620 | ExSte (_x, _x_i1, _x_i2) ->
12621 let o = o#loc _x in
12622 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12623 | ExStr (_x, _x_i1) ->
12624 let o = o#loc _x in let o = o#string _x_i1 in o
12625 | ExTry (_x, _x_i1, _x_i2) ->
12626 let o = o#loc _x in
12627 let o = o#expr _x_i1 in let o = o#match_case _x_i2 in o
12628 | ExTup (_x, _x_i1) ->
12629 let o = o#loc _x in let o = o#expr _x_i1 in o
12630 | ExCom (_x, _x_i1, _x_i2) ->
12631 let o = o#loc _x in
12632 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12633 | ExTyc (_x, _x_i1, _x_i2) ->
12634 let o = o#loc _x in
12635 let o = o#expr _x_i1 in let o = o#ctyp _x_i2 in o
12636 | ExVrn (_x, _x_i1) ->
12637 let o = o#loc _x in let o = o#string _x_i1 in o
12638 | ExWhi (_x, _x_i1, _x_i2) ->
12639 let o = o#loc _x in
12640 let o = o#expr _x_i1 in let o = o#expr _x_i2 in o
12642 method ctyp : ctyp -> 'self_type =
12643 function
12644 | TyNil _x -> let o = o#loc _x in o
12645 | TyAli (_x, _x_i1, _x_i2) ->
12646 let o = o#loc _x in
12647 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12648 | TyAny _x -> let o = o#loc _x in o
12649 | TyApp (_x, _x_i1, _x_i2) ->
12650 let o = o#loc _x in
12651 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12652 | TyArr (_x, _x_i1, _x_i2) ->
12653 let o = o#loc _x in
12654 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12655 | TyCls (_x, _x_i1) ->
12656 let o = o#loc _x in let o = o#ident _x_i1 in o
12657 | TyLab (_x, _x_i1, _x_i2) ->
12658 let o = o#loc _x in
12659 let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
12660 | TyId (_x, _x_i1) ->
12661 let o = o#loc _x in let o = o#ident _x_i1 in o
12662 | TyMan (_x, _x_i1, _x_i2) ->
12663 let o = o#loc _x in
12664 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12665 | TyDcl (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
12666 let o = o#loc _x in
12667 let o = o#string _x_i1 in
12668 let o = o#list (fun o -> o#ctyp) _x_i2 in
12669 let o = o#ctyp _x_i3 in
12670 let o =
12671 o#list
12672 (fun o (_x, _x_i1) ->
12673 let o = o#ctyp _x in let o = o#ctyp _x_i1 in o)
12674 _x_i4
12675 in o
12676 | TyObj (_x, _x_i1, _x_i2) ->
12677 let o = o#loc _x in
12678 let o = o#ctyp _x_i1 in let o = o#meta_bool _x_i2 in o
12679 | TyOlb (_x, _x_i1, _x_i2) ->
12680 let o = o#loc _x in
12681 let o = o#string _x_i1 in let o = o#ctyp _x_i2 in o
12682 | TyPol (_x, _x_i1, _x_i2) ->
12683 let o = o#loc _x in
12684 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12685 | TyQuo (_x, _x_i1) ->
12686 let o = o#loc _x in let o = o#string _x_i1 in o
12687 | TyQuP (_x, _x_i1) ->
12688 let o = o#loc _x in let o = o#string _x_i1 in o
12689 | TyQuM (_x, _x_i1) ->
12690 let o = o#loc _x in let o = o#string _x_i1 in o
12691 | TyVrn (_x, _x_i1) ->
12692 let o = o#loc _x in let o = o#string _x_i1 in o
12693 | TyRec (_x, _x_i1) ->
12694 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12695 | TyCol (_x, _x_i1, _x_i2) ->
12696 let o = o#loc _x in
12697 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12698 | TySem (_x, _x_i1, _x_i2) ->
12699 let o = o#loc _x in
12700 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12701 | TyCom (_x, _x_i1, _x_i2) ->
12702 let o = o#loc _x in
12703 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12704 | TySum (_x, _x_i1) ->
12705 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12706 | TyOf (_x, _x_i1, _x_i2) ->
12707 let o = o#loc _x in
12708 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12709 | TyAnd (_x, _x_i1, _x_i2) ->
12710 let o = o#loc _x in
12711 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12712 | TyOr (_x, _x_i1, _x_i2) ->
12713 let o = o#loc _x in
12714 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12715 | TyPrv (_x, _x_i1) ->
12716 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12717 | TyMut (_x, _x_i1) ->
12718 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12719 | TyTup (_x, _x_i1) ->
12720 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12721 | TySta (_x, _x_i1, _x_i2) ->
12722 let o = o#loc _x in
12723 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12724 | TyVrnEq (_x, _x_i1) ->
12725 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12726 | TyVrnSup (_x, _x_i1) ->
12727 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12728 | TyVrnInf (_x, _x_i1) ->
12729 let o = o#loc _x in let o = o#ctyp _x_i1 in o
12730 | TyVrnInfSup (_x, _x_i1, _x_i2) ->
12731 let o = o#loc _x in
12732 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12733 | TyAmp (_x, _x_i1, _x_i2) ->
12734 let o = o#loc _x in
12735 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12736 | TyOfAmp (_x, _x_i1, _x_i2) ->
12737 let o = o#loc _x in
12738 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12739 | TyAnt (_x, _x_i1) ->
12740 let o = o#loc _x in let o = o#string _x_i1 in o
12742 method class_type : class_type -> 'self_type =
12743 function
12744 | CtNil _x -> let o = o#loc _x in o
12745 | CtCon (_x, _x_i1, _x_i2, _x_i3) ->
12746 let o = o#loc _x in
12747 let o = o#meta_bool _x_i1 in
12748 let o = o#ident _x_i2 in let o = o#ctyp _x_i3 in o
12749 | CtFun (_x, _x_i1, _x_i2) ->
12750 let o = o#loc _x in
12751 let o = o#ctyp _x_i1 in let o = o#class_type _x_i2 in o
12752 | CtSig (_x, _x_i1, _x_i2) ->
12753 let o = o#loc _x in
12754 let o = o#ctyp _x_i1 in
12755 let o = o#class_sig_item _x_i2 in o
12756 | CtAnd (_x, _x_i1, _x_i2) ->
12757 let o = o#loc _x in
12758 let o = o#class_type _x_i1 in
12759 let o = o#class_type _x_i2 in o
12760 | CtCol (_x, _x_i1, _x_i2) ->
12761 let o = o#loc _x in
12762 let o = o#class_type _x_i1 in
12763 let o = o#class_type _x_i2 in o
12764 | CtEq (_x, _x_i1, _x_i2) ->
12765 let o = o#loc _x in
12766 let o = o#class_type _x_i1 in
12767 let o = o#class_type _x_i2 in o
12768 | CtAnt (_x, _x_i1) ->
12769 let o = o#loc _x in let o = o#string _x_i1 in o
12771 method class_str_item : class_str_item -> 'self_type =
12772 function
12773 | CrNil _x -> let o = o#loc _x in o
12774 | CrSem (_x, _x_i1, _x_i2) ->
12775 let o = o#loc _x in
12776 let o = o#class_str_item _x_i1 in
12777 let o = o#class_str_item _x_i2 in o
12778 | CrCtr (_x, _x_i1, _x_i2) ->
12779 let o = o#loc _x in
12780 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12781 | CrInh (_x, _x_i1, _x_i2) ->
12782 let o = o#loc _x in
12783 let o = o#class_expr _x_i1 in
12784 let o = o#string _x_i2 in o
12785 | CrIni (_x, _x_i1) ->
12786 let o = o#loc _x in let o = o#expr _x_i1 in o
12787 | CrMth (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
12788 let o = o#loc _x in
12789 let o = o#string _x_i1 in
12790 let o = o#meta_bool _x_i2 in
12791 let o = o#expr _x_i3 in let o = o#ctyp _x_i4 in o
12792 | CrVal (_x, _x_i1, _x_i2, _x_i3) ->
12793 let o = o#loc _x in
12794 let o = o#string _x_i1 in
12795 let o = o#meta_bool _x_i2 in let o = o#expr _x_i3 in o
12796 | CrVir (_x, _x_i1, _x_i2, _x_i3) ->
12797 let o = o#loc _x in
12798 let o = o#string _x_i1 in
12799 let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
12800 | CrVvr (_x, _x_i1, _x_i2, _x_i3) ->
12801 let o = o#loc _x in
12802 let o = o#string _x_i1 in
12803 let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
12804 | CrAnt (_x, _x_i1) ->
12805 let o = o#loc _x in let o = o#string _x_i1 in o
12807 method class_sig_item : class_sig_item -> 'self_type =
12808 function
12809 | CgNil _x -> let o = o#loc _x in o
12810 | CgCtr (_x, _x_i1, _x_i2) ->
12811 let o = o#loc _x in
12812 let o = o#ctyp _x_i1 in let o = o#ctyp _x_i2 in o
12813 | CgSem (_x, _x_i1, _x_i2) ->
12814 let o = o#loc _x in
12815 let o = o#class_sig_item _x_i1 in
12816 let o = o#class_sig_item _x_i2 in o
12817 | CgInh (_x, _x_i1) ->
12818 let o = o#loc _x in let o = o#class_type _x_i1 in o
12819 | CgMth (_x, _x_i1, _x_i2, _x_i3) ->
12820 let o = o#loc _x in
12821 let o = o#string _x_i1 in
12822 let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
12823 | CgVal (_x, _x_i1, _x_i2, _x_i3, _x_i4) ->
12824 let o = o#loc _x in
12825 let o = o#string _x_i1 in
12826 let o = o#meta_bool _x_i2 in
12827 let o = o#meta_bool _x_i3 in let o = o#ctyp _x_i4 in o
12828 | CgVir (_x, _x_i1, _x_i2, _x_i3) ->
12829 let o = o#loc _x in
12830 let o = o#string _x_i1 in
12831 let o = o#meta_bool _x_i2 in let o = o#ctyp _x_i3 in o
12832 | CgAnt (_x, _x_i1) ->
12833 let o = o#loc _x in let o = o#string _x_i1 in o
12835 method class_expr : class_expr -> 'self_type =
12836 function
12837 | CeNil _x -> let o = o#loc _x in o
12838 | CeApp (_x, _x_i1, _x_i2) ->
12839 let o = o#loc _x in
12840 let o = o#class_expr _x_i1 in let o = o#expr _x_i2 in o
12841 | CeCon (_x, _x_i1, _x_i2, _x_i3) ->
12842 let o = o#loc _x in
12843 let o = o#meta_bool _x_i1 in
12844 let o = o#ident _x_i2 in let o = o#ctyp _x_i3 in o
12845 | CeFun (_x, _x_i1, _x_i2) ->
12846 let o = o#loc _x in
12847 let o = o#patt _x_i1 in let o = o#class_expr _x_i2 in o
12848 | CeLet (_x, _x_i1, _x_i2, _x_i3) ->
12849 let o = o#loc _x in
12850 let o = o#meta_bool _x_i1 in
12851 let o = o#binding _x_i2 in
12852 let o = o#class_expr _x_i3 in o
12853 | CeStr (_x, _x_i1, _x_i2) ->
12854 let o = o#loc _x in
12855 let o = o#patt _x_i1 in
12856 let o = o#class_str_item _x_i2 in o
12857 | CeTyc (_x, _x_i1, _x_i2) ->
12858 let o = o#loc _x in
12859 let o = o#class_expr _x_i1 in
12860 let o = o#class_type _x_i2 in o
12861 | CeAnd (_x, _x_i1, _x_i2) ->
12862 let o = o#loc _x in
12863 let o = o#class_expr _x_i1 in
12864 let o = o#class_expr _x_i2 in o
12865 | CeEq (_x, _x_i1, _x_i2) ->
12866 let o = o#loc _x in
12867 let o = o#class_expr _x_i1 in
12868 let o = o#class_expr _x_i2 in o
12869 | CeAnt (_x, _x_i1) ->
12870 let o = o#loc _x in let o = o#string _x_i1 in o
12872 method binding : binding -> 'self_type =
12873 function
12874 | BiNil _x -> let o = o#loc _x in o
12875 | BiAnd (_x, _x_i1, _x_i2) ->
12876 let o = o#loc _x in
12877 let o = o#binding _x_i1 in let o = o#binding _x_i2 in o
12878 | BiEq (_x, _x_i1, _x_i2) ->
12879 let o = o#loc _x in
12880 let o = o#patt _x_i1 in let o = o#expr _x_i2 in o
12881 | BiAnt (_x, _x_i1) ->
12882 let o = o#loc _x in let o = o#string _x_i1 in o
12884 method unknown : 'a. 'a -> 'self_type = fun _ -> o
12888 let map_expr f =
12889 object
12890 inherit map as super
12892 method expr = fun x -> f (super#expr x)
12896 let map_patt f =
12897 object
12898 inherit map as super
12900 method patt = fun x -> f (super#patt x)
12904 let map_ctyp f =
12905 object
12906 inherit map as super
12908 method ctyp = fun x -> f (super#ctyp x)
12912 let map_str_item f =
12913 object
12914 inherit map as super
12916 method str_item = fun x -> f (super#str_item x)
12920 let map_sig_item f =
12921 object
12922 inherit map as super
12924 method sig_item = fun x -> f (super#sig_item x)
12928 let map_loc f =
12929 object
12930 inherit map as super
12932 method loc = fun x -> f (super#loc x)
12940 module DynAst =
12941 struct
12942 module Make (Ast : Sig.Ast) : Sig.DynAst with module Ast = Ast =
12943 struct
12944 module Ast = Ast
12946 type 'a tag =
12947 | Tag_ctyp
12948 | Tag_patt
12949 | Tag_expr
12950 | Tag_module_type
12951 | Tag_sig_item
12952 | Tag_with_constr
12953 | Tag_module_expr
12954 | Tag_str_item
12955 | Tag_class_type
12956 | Tag_class_sig_item
12957 | Tag_class_expr
12958 | Tag_class_str_item
12959 | Tag_match_case
12960 | Tag_ident
12961 | Tag_binding
12962 | Tag_rec_binding
12963 | Tag_module_binding
12965 let string_of_tag =
12966 function
12967 | Tag_ctyp -> "ctyp"
12968 | Tag_patt -> "patt"
12969 | Tag_expr -> "expr"
12970 | Tag_module_type -> "module_type"
12971 | Tag_sig_item -> "sig_item"
12972 | Tag_with_constr -> "with_constr"
12973 | Tag_module_expr -> "module_expr"
12974 | Tag_str_item -> "str_item"
12975 | Tag_class_type -> "class_type"
12976 | Tag_class_sig_item -> "class_sig_item"
12977 | Tag_class_expr -> "class_expr"
12978 | Tag_class_str_item -> "class_str_item"
12979 | Tag_match_case -> "match_case"
12980 | Tag_ident -> "ident"
12981 | Tag_binding -> "binding"
12982 | Tag_rec_binding -> "rec_binding"
12983 | Tag_module_binding -> "module_binding"
12985 let ctyp_tag = Tag_ctyp
12987 let patt_tag = Tag_patt
12989 let expr_tag = Tag_expr
12991 let module_type_tag = Tag_module_type
12993 let sig_item_tag = Tag_sig_item
12995 let with_constr_tag = Tag_with_constr
12997 let module_expr_tag = Tag_module_expr
12999 let str_item_tag = Tag_str_item
13001 let class_type_tag = Tag_class_type
13003 let class_sig_item_tag = Tag_class_sig_item
13005 let class_expr_tag = Tag_class_expr
13007 let class_str_item_tag = Tag_class_str_item
13009 let match_case_tag = Tag_match_case
13011 let ident_tag = Tag_ident
13013 let binding_tag = Tag_binding
13015 let rec_binding_tag = Tag_rec_binding
13017 let module_binding_tag = Tag_module_binding
13019 type dyn
13021 external dyn_tag : 'a tag -> dyn tag = "%identity"
13023 module Pack (X : sig type 'a t
13024 end) =
13025 struct
13026 type pack = ((dyn tag) * Obj.t)
13028 exception Pack_error
13030 let pack tag v = ((dyn_tag tag), (Obj.repr v))
13032 let unpack (tag : 'a tag) (tag', obj) =
13033 if (dyn_tag tag) = tag'
13034 then (Obj.obj obj : 'a X.t)
13035 else raise Pack_error
13037 let print_tag f (tag, _) =
13038 Format.pp_print_string f (string_of_tag tag)
13046 module Quotation =
13047 struct
13048 module Make (Ast : Sig.Camlp4Ast) :
13049 Sig.Quotation with module Ast = Ast =
13050 struct
13051 module Ast = Ast
13053 module DynAst = DynAst.Make(Ast)
13055 module Loc = Ast.Loc
13057 open Format
13059 open Sig
13061 type 'a expand_fun = Loc.t -> string option -> string -> 'a
13063 module Exp_key = DynAst.Pack(struct type 'a t = unit
13064 end)
13066 module Exp_fun =
13067 DynAst.Pack(struct type 'a t = 'a expand_fun
13068 end)
13070 let expanders_table :
13071 (((string * Exp_key.pack) * Exp_fun.pack) list) ref = ref []
13073 let default = ref ""
13075 let translate = ref (fun x -> x)
13077 let expander_name name =
13078 match !translate name with | "" -> !default | name -> name
13080 let find name tag =
13081 let key = ((expander_name name), (Exp_key.pack tag ()))
13082 in Exp_fun.unpack tag (List.assoc key !expanders_table)
13084 let add name tag f =
13085 let elt = ((name, (Exp_key.pack tag ())), (Exp_fun.pack tag f))
13086 in expanders_table := elt :: !expanders_table
13088 let dump_file = ref None
13090 module Error =
13091 struct
13092 type error =
13093 | Finding
13094 | Expanding
13095 | ParsingResult of Loc.t * string
13096 | Locating
13098 type t = (string * string * error * exn)
13100 exception E of t
13102 let print ppf (name, position, ctx, exn) =
13103 let name = if name = "" then !default else name in
13104 let pp x =
13105 fprintf ppf "@?@[<2>While %s %S in a position of %S:" x
13106 name position in
13107 let () =
13108 match ctx with
13109 | Finding ->
13110 (pp "finding quotation";
13111 if !expanders_table = []
13112 then
13113 fprintf ppf
13114 "@ There is no quotation expander available."
13115 else
13116 (fprintf ppf
13117 "@ @[<hv2>Available quotation expanders are:@\n";
13118 List.iter
13119 (fun ((s, t), _) ->
13120 fprintf ppf
13121 "@[<2>%s@ (in@ a@ position@ of %a)@]@ " s
13122 Exp_key.print_tag t)
13123 !expanders_table;
13124 fprintf ppf "@]"))
13125 | Expanding -> pp "expanding quotation"
13126 | Locating -> pp "parsing"
13127 | ParsingResult (loc, str) ->
13128 let () = pp "parsing result of quotation"
13130 (match !dump_file with
13131 | Some dump_file ->
13132 let () = fprintf ppf " dumping result...\n"
13134 (try
13135 let oc = open_out_bin dump_file
13137 (output_string oc str;
13138 output_string oc "\n";
13139 flush oc;
13140 close_out oc;
13141 fprintf ppf "%a:" Loc.print
13142 (Loc.set_file_name dump_file loc))
13143 with
13144 | _ ->
13145 fprintf ppf
13146 "Error while dumping result in file %S; dump aborted"
13147 dump_file)
13148 | None ->
13149 fprintf ppf
13150 "\n(consider setting variable Quotation.dump_file, or using the -QD option)")
13151 in fprintf ppf "@\n%a@]@." ErrorHandler.print exn
13153 let to_string x =
13154 let b = Buffer.create 50 in
13155 let () = bprintf b "%a" print x in Buffer.contents b
13159 let _ = let module M = ErrorHandler.Register(Error) in ()
13161 open Error
13163 let expand_quotation loc expander pos_tag quot =
13164 let loc_name_opt =
13165 if quot.q_loc = "" then None else Some quot.q_loc
13167 try expander loc loc_name_opt quot.q_contents
13168 with | (Loc.Exc_located (_, (Error.E _)) as exc) -> raise exc
13169 | Loc.Exc_located (iloc, exc) ->
13170 let exc1 =
13171 Error.E (((quot.q_name), pos_tag, Expanding, exc))
13172 in raise (Loc.Exc_located (iloc, exc1))
13173 | exc ->
13174 let exc1 =
13175 Error.E (((quot.q_name), pos_tag, Expanding, exc))
13176 in raise (Loc.Exc_located (loc, exc1))
13178 let parse_quotation_result parse loc quot pos_tag str =
13179 try parse loc str
13180 with
13181 | Loc.Exc_located (iloc,
13182 (Error.E ((n, pos_tag, Expanding, exc)))) ->
13183 let ctx = ParsingResult (iloc, quot.q_contents) in
13184 let exc1 = Error.E ((n, pos_tag, ctx, exc))
13185 in raise (Loc.Exc_located (iloc, exc1))
13186 | Loc.Exc_located (iloc, ((Error.E _ as exc))) ->
13187 raise (Loc.Exc_located (iloc, exc))
13188 | Loc.Exc_located (iloc, exc) ->
13189 let ctx = ParsingResult (iloc, quot.q_contents) in
13190 let exc1 = Error.E (((quot.q_name), pos_tag, ctx, exc))
13191 in raise (Loc.Exc_located (iloc, exc1))
13193 let expand loc quotation tag =
13194 let pos_tag = DynAst.string_of_tag tag in
13195 let name = quotation.q_name in
13196 let expander =
13197 try find name tag
13198 with | (Loc.Exc_located (_, (Error.E _)) as exc) -> raise exc
13199 | Loc.Exc_located (qloc, exc) ->
13200 raise
13201 (Loc.Exc_located (qloc,
13202 Error.E ((name, pos_tag, Finding, exc))))
13203 | exc ->
13204 raise
13205 (Loc.Exc_located (loc,
13206 Error.E ((name, pos_tag, Finding, exc)))) in
13207 let loc = Loc.join (Loc.move `start quotation.q_shift loc)
13208 in expand_quotation loc expander pos_tag quotation
13214 module AstFilters =
13215 struct
13216 module Make (Ast : Sig.Camlp4Ast) :
13217 Sig.AstFilters with module Ast = Ast =
13218 struct
13219 module Ast = Ast
13221 type 'a filter = 'a -> 'a
13223 let interf_filters = Queue.create ()
13225 let fold_interf_filters f i = Queue.fold f i interf_filters
13227 let implem_filters = Queue.create ()
13229 let fold_implem_filters f i = Queue.fold f i implem_filters
13231 let register_sig_item_filter f = Queue.add f interf_filters
13233 let register_str_item_filter f = Queue.add f implem_filters
13239 module Camlp4Ast2OCamlAst :
13241 module Make (Camlp4Ast : Sig.Camlp4Ast) :
13243 open Camlp4Ast
13245 val sig_item : sig_item -> Camlp4_import.Parsetree.signature
13247 val str_item : str_item -> Camlp4_import.Parsetree.structure
13249 val phrase : str_item -> Camlp4_import.Parsetree.toplevel_phrase
13253 end =
13254 struct
13255 module Make (Ast : Sig.Camlp4Ast) =
13256 struct
13257 open Format
13259 open Camlp4_import.Parsetree
13261 open Camlp4_import.Longident
13263 open Camlp4_import.Asttypes
13265 open Ast
13267 let constructors_arity () = !Camlp4_config.constructors_arity
13269 let error loc str = Loc.raise loc (Failure str)
13271 let char_of_char_token loc s =
13272 try Token.Eval.char s
13273 with | (Failure _ as exn) -> Loc.raise loc exn
13275 let string_of_string_token loc s =
13276 try Token.Eval.string s
13277 with | (Failure _ as exn) -> Loc.raise loc exn
13279 let remove_underscores s =
13280 let l = String.length s in
13281 let rec remove src dst =
13282 if src >= l
13283 then if dst >= l then s else String.sub s 0 dst
13284 else
13285 (match s.[src] with
13286 | '_' -> remove (src + 1) dst
13287 | c -> (s.[dst] <- c; remove (src + 1) (dst + 1)))
13288 in remove 0 0
13290 let mkloc = Loc.to_ocaml_location
13292 let mkghloc loc = Loc.to_ocaml_location (Loc.ghostify loc)
13294 let mktyp loc d = { ptyp_desc = d; ptyp_loc = mkloc loc; }
13296 let mkpat loc d = { ppat_desc = d; ppat_loc = mkloc loc; }
13298 let mkghpat loc d = { ppat_desc = d; ppat_loc = mkghloc loc; }
13300 let mkexp loc d = { pexp_desc = d; pexp_loc = mkloc loc; }
13302 let mkmty loc d = { pmty_desc = d; pmty_loc = mkloc loc; }
13304 let mksig loc d = { psig_desc = d; psig_loc = mkloc loc; }
13306 let mkmod loc d = { pmod_desc = d; pmod_loc = mkloc loc; }
13308 let mkstr loc d = { pstr_desc = d; pstr_loc = mkloc loc; }
13310 let mkfield loc d = { pfield_desc = d; pfield_loc = mkloc loc; }
13312 let mkcty loc d = { pcty_desc = d; pcty_loc = mkloc loc; }
13314 let mkpcl loc d = { pcl_desc = d; pcl_loc = mkloc loc; }
13316 let mkpolytype t =
13317 match t.ptyp_desc with
13318 | Ptyp_poly (_, _) -> t
13319 | _ -> { (t) with ptyp_desc = Ptyp_poly ([], t); }
13321 let mb2b =
13322 function
13323 | Ast.BTrue -> true
13324 | Ast.BFalse -> false
13325 | Ast.BAnt _ -> assert false
13327 let mkvirtual m = if mb2b m then Virtual else Concrete
13329 let lident s = Lident s
13331 let ldot l s = Ldot (l, s)
13333 let lapply l s = Lapply (l, s)
13335 let conv_con =
13336 let t = Hashtbl.create 73
13338 (List.iter (fun (s, s') -> Hashtbl.add t s s')
13339 [ ("True", "true"); ("False", "false"); (" True", "True");
13340 (" False", "False") ];
13341 fun s -> try Hashtbl.find t s with | Not_found -> s)
13343 let conv_lab =
13344 let t = Hashtbl.create 73
13346 (List.iter (fun (s, s') -> Hashtbl.add t s s')
13347 [ ("val", "contents") ];
13348 fun s -> try Hashtbl.find t s with | Not_found -> s)
13350 let array_function str name =
13351 ldot (lident str)
13352 (if !Camlp4_config.unsafe then "unsafe_" ^ name else name)
13354 let mkrf =
13355 function
13356 | Ast.BTrue -> Recursive
13357 | Ast.BFalse -> Nonrecursive
13358 | Ast.BAnt _ -> assert false
13360 let mkli s =
13361 let rec loop f =
13362 function
13363 | i :: il -> loop (fun s -> ldot (f i) s) il
13364 | [] -> f s
13365 in loop (fun s -> lident s)
13367 let rec ctyp_fa al =
13368 function
13369 | TyApp (_, f, a) -> ctyp_fa (a :: al) f
13370 | f -> (f, al)
13372 let ident_tag ?(conv_lid = fun x -> x) i =
13373 let rec self i acc =
13374 match i with
13375 | Ast.IdAcc (_, i1, i2) -> self i2 (Some (self i1 acc))
13376 | Ast.IdApp (_, i1, i2) ->
13377 let i' =
13378 Lapply (fst (self i1 None), fst (self i2 None)) in
13379 let x =
13380 (match acc with
13381 | None -> i'
13382 | _ ->
13383 error (loc_of_ident i) "invalid long identifier")
13384 in (x, `app)
13385 | Ast.IdUid (_, s) ->
13386 let x =
13387 (match acc with
13388 | None -> lident s
13389 | Some ((acc, (`uident | `app))) -> ldot acc s
13390 | _ ->
13391 error (loc_of_ident i) "invalid long identifier")
13392 in (x, `uident)
13393 | Ast.IdLid (_, s) ->
13394 let x =
13395 (match acc with
13396 | None -> lident (conv_lid s)
13397 | Some ((acc, (`uident | `app))) ->
13398 ldot acc (conv_lid s)
13399 | _ ->
13400 error (loc_of_ident i) "invalid long identifier")
13401 in (x, `lident)
13402 | _ -> error (loc_of_ident i) "invalid long identifier"
13403 in self i None
13405 let ident ?conv_lid i = fst (ident_tag ?conv_lid i)
13407 let long_lident msg i =
13408 match ident_tag i with
13409 | (i, `lident) -> i
13410 | _ -> error (loc_of_ident i) msg
13412 let long_type_ident = long_lident "invalid long identifier type"
13414 let long_class_ident = long_lident "invalid class name"
13416 let long_uident ?(conv_con = fun x -> x) i =
13417 match ident_tag i with
13418 | (Ldot (i, s), `uident) -> ldot i (conv_con s)
13419 | (Lident s, `uident) -> lident (conv_con s)
13420 | (i, `app) -> i
13421 | _ -> error (loc_of_ident i) "uppercase identifier expected"
13423 let rec ctyp_long_id_prefix t =
13424 match t with
13425 | Ast.TyId (_, i) -> ident i
13426 | Ast.TyApp (_, m1, m2) ->
13427 let li1 = ctyp_long_id_prefix m1 in
13428 let li2 = ctyp_long_id_prefix m2 in Lapply (li1, li2)
13429 | t -> error (loc_of_ctyp t) "invalid module expression"
13431 let ctyp_long_id t =
13432 match t with
13433 | Ast.TyId (_, i) -> (false, (long_type_ident i))
13434 | TyApp (loc, _, _) -> error loc "invalid type name"
13435 | TyCls (_, i) -> (true, (ident i))
13436 | t -> error (loc_of_ctyp t) "invalid type"
13438 let rec ty_var_list_of_ctyp =
13439 function
13440 | Ast.TyApp (_, t1, t2) ->
13441 (ty_var_list_of_ctyp t1) @ (ty_var_list_of_ctyp t2)
13442 | Ast.TyQuo (_, s) -> [ s ]
13443 | _ -> assert false
13445 let rec ctyp =
13446 function
13447 | TyId (loc, i) ->
13448 let li = long_type_ident i
13449 in mktyp loc (Ptyp_constr (li, []))
13450 | TyAli (loc, t1, t2) ->
13451 let (t, i) =
13452 (match (t1, t2) with
13453 | (t, TyQuo (_, s)) -> (t, s)
13454 | (TyQuo (_, s), t) -> (t, s)
13455 | _ -> error loc "invalid alias type")
13456 in mktyp loc (Ptyp_alias (ctyp t, i))
13457 | TyAny loc -> mktyp loc Ptyp_any
13458 | (TyApp (loc, _, _) as f) ->
13459 let (f, al) = ctyp_fa [] f in
13460 let (is_cls, li) = ctyp_long_id f
13462 if is_cls
13463 then mktyp loc (Ptyp_class (li, List.map ctyp al, []))
13464 else mktyp loc (Ptyp_constr (li, List.map ctyp al))
13465 | TyArr (loc, (TyLab (_, lab, t1)), t2) ->
13466 mktyp loc (Ptyp_arrow (lab, ctyp t1, ctyp t2))
13467 | TyArr (loc, (TyOlb (loc1, lab, t1)), t2) ->
13468 let t1 =
13469 TyApp (loc1, Ast.TyId (loc1, Ast.IdLid (loc1, "option")),
13471 in mktyp loc (Ptyp_arrow ("?" ^ lab, ctyp t1, ctyp t2))
13472 | TyArr (loc, t1, t2) ->
13473 mktyp loc (Ptyp_arrow ("", ctyp t1, ctyp t2))
13474 | Ast.TyObj (loc, fl, Ast.BFalse) ->
13475 mktyp loc (Ptyp_object (meth_list fl []))
13476 | Ast.TyObj (loc, fl, Ast.BTrue) ->
13477 mktyp loc
13478 (Ptyp_object (meth_list fl [ mkfield loc Pfield_var ]))
13479 | TyCls (loc, id) -> mktyp loc (Ptyp_class (ident id, [], []))
13480 | TyLab (loc, _, _) ->
13481 error loc "labelled type not allowed here"
13482 | TyMan (loc, _, _) ->
13483 error loc "manifest type not allowed here"
13484 | TyOlb (loc, _, _) ->
13485 error loc "labelled type not allowed here"
13486 | TyPol (loc, t1, t2) ->
13487 mktyp loc (Ptyp_poly (ty_var_list_of_ctyp t1, ctyp t2))
13488 | TyQuo (loc, s) -> mktyp loc (Ptyp_var s)
13489 | TyRec (loc, _) -> error loc "record type not allowed here"
13490 | TySum (loc, _) -> error loc "sum type not allowed here"
13491 | TyPrv (loc, _) -> error loc "private type not allowed here"
13492 | TyMut (loc, _) -> error loc "mutable type not allowed here"
13493 | TyOr (loc, _, _) ->
13494 error loc "type1 | type2 not allowed here"
13495 | TyAnd (loc, _, _) ->
13496 error loc "type1 and type2 not allowed here"
13497 | TyOf (loc, _, _) ->
13498 error loc "type1 of type2 not allowed here"
13499 | TyCol (loc, _, _) ->
13500 error loc "type1 : type2 not allowed here"
13501 | TySem (loc, _, _) ->
13502 error loc "type1 ; type2 not allowed here"
13503 | Ast.TyTup (loc, (Ast.TySta (_, t1, t2))) ->
13504 mktyp loc
13505 (Ptyp_tuple
13506 (List.map ctyp (list_of_ctyp t1 (list_of_ctyp t2 []))))
13507 | Ast.TyVrnEq (loc, t) ->
13508 mktyp loc (Ptyp_variant (row_field t, true, None))
13509 | Ast.TyVrnSup (loc, t) ->
13510 mktyp loc (Ptyp_variant (row_field t, false, None))
13511 | Ast.TyVrnInf (loc, t) ->
13512 mktyp loc (Ptyp_variant (row_field t, true, Some []))
13513 | Ast.TyVrnInfSup (loc, t, t') ->
13514 mktyp loc
13515 (Ptyp_variant (row_field t, true, Some (name_tags t')))
13516 | TyAnt (loc, _) -> error loc "antiquotation not allowed here"
13517 | TyOfAmp (_, _, _) | TyAmp (_, _, _) | TySta (_, _, _) |
13518 TyCom (_, _, _) | TyVrn (_, _) | TyQuM (_, _) |
13519 TyQuP (_, _) | TyDcl (_, _, _, _, _) |
13520 TyObj (_, _, (BAnt _)) | TyNil _ | TyTup (_, _) ->
13521 assert false
13522 and row_field =
13523 function
13524 | Ast.TyNil _ -> []
13525 | Ast.TyVrn (_, i) -> [ Rtag (i, true, []) ]
13526 | Ast.TyOfAmp (_, (Ast.TyVrn (_, i)), t) ->
13527 [ Rtag (i, true, List.map ctyp (list_of_ctyp t [])) ]
13528 | Ast.TyOf (_, (Ast.TyVrn (_, i)), t) ->
13529 [ Rtag (i, false, List.map ctyp (list_of_ctyp t [])) ]
13530 | Ast.TyOr (_, t1, t2) -> (row_field t1) @ (row_field t2)
13531 | t -> [ Rinherit (ctyp t) ]
13532 and name_tags =
13533 function
13534 | Ast.TyApp (_, t1, t2) -> (name_tags t1) @ (name_tags t2)
13535 | Ast.TyVrn (_, s) -> [ s ]
13536 | _ -> assert false
13537 and meth_list fl acc =
13538 match fl with
13539 | Ast.TyNil _ -> acc
13540 | Ast.TySem (_, t1, t2) -> meth_list t1 (meth_list t2 acc)
13541 | Ast.TyCol (loc, (Ast.TyId (_, (Ast.IdLid (_, lab)))), t) ->
13542 (mkfield loc (Pfield (lab, mkpolytype (ctyp t)))) :: acc
13543 | _ -> assert false
13545 let mktype loc tl cl tk tm =
13546 let (params, variance) = List.split tl
13549 ptype_params = params;
13550 ptype_cstrs = cl;
13551 ptype_kind = tk;
13552 ptype_manifest = tm;
13553 ptype_loc = mkloc loc;
13554 ptype_variance = variance;
13557 let mkprivate' m = if m then Private else Public
13559 let mkprivate m = mkprivate' (mb2b m)
13561 let mktrecord =
13562 function
13563 | Ast.TyCol (loc, (Ast.TyId (_, (Ast.IdLid (_, s)))),
13564 (Ast.TyMut (_, t))) ->
13565 (s, Mutable, (mkpolytype (ctyp t)), (mkloc loc))
13566 | Ast.TyCol (loc, (Ast.TyId (_, (Ast.IdLid (_, s)))), t) ->
13567 (s, Immutable, (mkpolytype (ctyp t)), (mkloc loc))
13568 | _ -> assert false
13570 let mkvariant =
13571 function
13572 | Ast.TyId (loc, (Ast.IdUid (_, s))) ->
13573 ((conv_con s), [], (mkloc loc))
13574 | Ast.TyOf (loc, (Ast.TyId (_, (Ast.IdUid (_, s)))), t) ->
13575 ((conv_con s), (List.map ctyp (list_of_ctyp t [])),
13576 (mkloc loc))
13577 | _ -> assert false
13579 let rec type_decl tl cl loc m pflag =
13580 function
13581 | Ast.TyMan (_, t1, t2) ->
13582 type_decl tl cl loc (Some (ctyp t1)) pflag t2
13583 | Ast.TyPrv (_, t) -> type_decl tl cl loc m true t
13584 | Ast.TyRec (_, t) ->
13585 mktype loc tl cl
13586 (Ptype_record (List.map mktrecord (list_of_ctyp t []),
13587 mkprivate' pflag))
13589 | Ast.TySum (_, t) ->
13590 mktype loc tl cl
13591 (Ptype_variant (List.map mkvariant (list_of_ctyp t []),
13592 mkprivate' pflag))
13594 | t ->
13595 if m <> None
13596 then
13597 error loc "only one manifest type allowed by definition"
13598 else
13599 (let m =
13600 match t with
13601 | Ast.TyNil _ -> None
13602 | _ -> Some (ctyp t) in
13603 let k = if pflag then Ptype_private else Ptype_abstract
13604 in mktype loc tl cl k m)
13606 let type_decl tl cl t =
13607 type_decl tl cl (loc_of_ctyp t) None false t
13609 let mkvalue_desc t p = { pval_type = ctyp t; pval_prim = p; }
13611 let rec list_of_meta_list =
13612 function
13613 | Ast.LNil -> []
13614 | Ast.LCons (x, xs) -> x :: (list_of_meta_list xs)
13615 | Ast.LAnt _ -> assert false
13617 let mkmutable m = if mb2b m then Mutable else Immutable
13619 let paolab lab p =
13620 match (lab, p) with
13621 | ("",
13622 (Ast.PaId (_, (Ast.IdLid (_, i))) |
13623 Ast.PaTyc (_, (Ast.PaId (_, (Ast.IdLid (_, i)))), _)))
13624 -> i
13625 | ("", p) -> error (loc_of_patt p) "bad ast in label"
13626 | _ -> lab
13628 let opt_private_ctyp =
13629 function
13630 | Ast.TyPrv (_, t) -> (Ptype_private, (ctyp t))
13631 | t -> (Ptype_abstract, (ctyp t))
13633 let rec type_parameters t acc =
13634 match t with
13635 | Ast.TyApp (_, t1, t2) ->
13636 type_parameters t1 (type_parameters t2 acc)
13637 | Ast.TyQuP (_, s) -> (s, (true, false)) :: acc
13638 | Ast.TyQuM (_, s) -> (s, (false, true)) :: acc
13639 | Ast.TyQuo (_, s) -> (s, (false, false)) :: acc
13640 | _ -> assert false
13642 let rec class_parameters t acc =
13643 match t with
13644 | Ast.TyCom (_, t1, t2) ->
13645 class_parameters t1 (class_parameters t2 acc)
13646 | Ast.TyQuP (_, s) -> (s, (true, false)) :: acc
13647 | Ast.TyQuM (_, s) -> (s, (false, true)) :: acc
13648 | Ast.TyQuo (_, s) -> (s, (false, false)) :: acc
13649 | _ -> assert false
13651 let rec type_parameters_and_type_name t acc =
13652 match t with
13653 | Ast.TyApp (_, t1, t2) ->
13654 type_parameters_and_type_name t1 (type_parameters t2 acc)
13655 | Ast.TyId (_, i) -> ((ident i), acc)
13656 | _ -> assert false
13658 let rec mkwithc wc acc =
13659 match wc with
13660 | WcNil _ -> acc
13661 | WcTyp (loc, id_tpl, ct) ->
13662 let (id, tpl) = type_parameters_and_type_name id_tpl [] in
13663 let (params, variance) = List.split tpl in
13664 let (kind, ct) = opt_private_ctyp ct
13666 (id,
13667 (Pwith_type
13669 ptype_params = params;
13670 ptype_cstrs = [];
13671 ptype_kind = kind;
13672 ptype_manifest = Some ct;
13673 ptype_loc = mkloc loc;
13674 ptype_variance = variance;
13675 })) ::
13677 | WcMod (_, i1, i2) ->
13678 ((long_uident i1), (Pwith_module (long_uident i2))) :: acc
13679 | Ast.WcAnd (_, wc1, wc2) -> mkwithc wc1 (mkwithc wc2 acc)
13680 | Ast.WcAnt (loc, _) ->
13681 error loc "bad with constraint (antiquotation)"
13683 let rec patt_fa al =
13684 function
13685 | PaApp (_, f, a) -> patt_fa (a :: al) f
13686 | f -> (f, al)
13688 let rec deep_mkrangepat loc c1 c2 =
13689 if c1 = c2
13690 then mkghpat loc (Ppat_constant (Const_char c1))
13691 else
13692 mkghpat loc
13693 (Ppat_or (mkghpat loc (Ppat_constant (Const_char c1)),
13694 deep_mkrangepat loc (Char.chr ((Char.code c1) + 1)) c2))
13696 let rec mkrangepat loc c1 c2 =
13697 if c1 > c2
13698 then mkrangepat loc c2 c1
13699 else
13700 if c1 = c2
13701 then mkpat loc (Ppat_constant (Const_char c1))
13702 else
13703 mkpat loc
13704 (Ppat_or (mkghpat loc (Ppat_constant (Const_char c1)),
13705 deep_mkrangepat loc (Char.chr ((Char.code c1) + 1)) c2))
13707 let rec patt =
13708 function
13709 | Ast.PaId (loc, (Ast.IdLid (_, s))) -> mkpat loc (Ppat_var s)
13710 | Ast.PaId (loc, i) ->
13711 let p =
13712 Ppat_construct (long_uident ~conv_con i, None,
13713 constructors_arity ())
13714 in mkpat loc p
13715 | PaAli (loc, p1, p2) ->
13716 let (p, i) =
13717 (match (p1, p2) with
13718 | (p, Ast.PaId (_, (Ast.IdLid (_, s)))) -> (p, s)
13719 | (Ast.PaId (_, (Ast.IdLid (_, s))), p) -> (p, s)
13720 | _ -> error loc "invalid alias pattern")
13721 in mkpat loc (Ppat_alias (patt p, i))
13722 | PaAnt (loc, _) -> error loc "antiquotation not allowed here"
13723 | PaAny loc -> mkpat loc Ppat_any
13724 | Ast.PaApp (loc, (Ast.PaId (_, (Ast.IdUid (_, s)))),
13725 (Ast.PaTup (_, (Ast.PaAny loc_any)))) ->
13726 mkpat loc
13727 (Ppat_construct (lident (conv_con s),
13728 Some (mkpat loc_any Ppat_any), false))
13729 | (PaApp (loc, _, _) as f) ->
13730 let (f, al) = patt_fa [] f in
13731 let al = List.map patt al
13733 (match (patt f).ppat_desc with
13734 | Ppat_construct (li, None, _) ->
13735 if constructors_arity ()
13736 then
13737 mkpat loc
13738 (Ppat_construct (li,
13739 Some (mkpat loc (Ppat_tuple al)), true))
13740 else
13741 (let a =
13742 match al with
13743 | [ a ] -> a
13744 | _ -> mkpat loc (Ppat_tuple al)
13745 in mkpat loc (Ppat_construct (li, Some a, false)))
13746 | Ppat_variant (s, None) ->
13747 let a =
13748 if constructors_arity ()
13749 then mkpat loc (Ppat_tuple al)
13750 else
13751 (match al with
13752 | [ a ] -> a
13753 | _ -> mkpat loc (Ppat_tuple al))
13754 in mkpat loc (Ppat_variant (s, Some a))
13755 | _ ->
13756 error (loc_of_patt f)
13757 "this is not a constructor, it cannot be applied in a pattern")
13758 | PaArr (loc, p) ->
13759 mkpat loc (Ppat_array (List.map patt (list_of_patt p [])))
13760 | PaChr (loc, s) ->
13761 mkpat loc
13762 (Ppat_constant (Const_char (char_of_char_token loc s)))
13763 | PaInt (loc, s) ->
13764 let i =
13765 (try int_of_string s
13766 with
13767 | Failure _ ->
13768 error loc
13769 "Integer literal exceeds the range of representable integers of type int")
13770 in mkpat loc (Ppat_constant (Const_int i))
13771 | PaInt32 (loc, s) ->
13772 let i32 =
13773 (try Int32.of_string s
13774 with
13775 | Failure _ ->
13776 error loc
13777 "Integer literal exceeds the range of representable integers of type int32")
13778 in mkpat loc (Ppat_constant (Const_int32 i32))
13779 | PaInt64 (loc, s) ->
13780 let i64 =
13781 (try Int64.of_string s
13782 with
13783 | Failure _ ->
13784 error loc
13785 "Integer literal exceeds the range of representable integers of type int64")
13786 in mkpat loc (Ppat_constant (Const_int64 i64))
13787 | PaNativeInt (loc, s) ->
13788 let nati =
13789 (try Nativeint.of_string s
13790 with
13791 | Failure _ ->
13792 error loc
13793 "Integer literal exceeds the range of representable integers of type nativeint")
13794 in mkpat loc (Ppat_constant (Const_nativeint nati))
13795 | PaFlo (loc, s) ->
13796 mkpat loc
13797 (Ppat_constant (Const_float (remove_underscores s)))
13798 | PaLab (loc, _, _) ->
13799 error loc "labeled pattern not allowed here"
13800 | PaOlb (loc, _, _) | PaOlbi (loc, _, _, _) ->
13801 error loc "labeled pattern not allowed here"
13802 | PaOrp (loc, p1, p2) -> mkpat loc (Ppat_or (patt p1, patt p2))
13803 | PaRng (loc, p1, p2) ->
13804 (match (p1, p2) with
13805 | (PaChr (loc1, c1), PaChr (loc2, c2)) ->
13806 let c1 = char_of_char_token loc1 c1 in
13807 let c2 = char_of_char_token loc2 c2
13808 in mkrangepat loc c1 c2
13809 | _ ->
13810 error loc "range pattern allowed only for characters")
13811 | PaRec (loc, p) ->
13812 mkpat loc
13813 (Ppat_record (List.map mklabpat (list_of_patt p [])))
13814 | PaStr (loc, s) ->
13815 mkpat loc
13816 (Ppat_constant
13817 (Const_string (string_of_string_token loc s)))
13818 | Ast.PaTup (loc, (Ast.PaCom (_, p1, p2))) ->
13819 mkpat loc
13820 (Ppat_tuple
13821 (List.map patt (list_of_patt p1 (list_of_patt p2 []))))
13822 | Ast.PaTup (loc, _) -> error loc "singleton tuple pattern"
13823 | PaTyc (loc, p, t) ->
13824 mkpat loc (Ppat_constraint (patt p, ctyp t))
13825 | PaTyp (loc, i) -> mkpat loc (Ppat_type (long_type_ident i))
13826 | PaVrn (loc, s) -> mkpat loc (Ppat_variant (s, None))
13827 | (PaEq (_, _, _) | PaSem (_, _, _) | PaCom (_, _, _) | PaNil _
13828 as p) -> error (loc_of_patt p) "invalid pattern"
13829 and mklabpat =
13830 function
13831 | Ast.PaEq (_, i, p) ->
13832 ((ident ~conv_lid: conv_lab i), (patt p))
13833 | p -> error (loc_of_patt p) "invalid pattern"
13835 let rec expr_fa al =
13836 function
13837 | ExApp (_, f, a) -> expr_fa (a :: al) f
13838 | f -> (f, al)
13840 let rec class_expr_fa al =
13841 function
13842 | CeApp (_, ce, a) -> class_expr_fa (a :: al) ce
13843 | ce -> (ce, al)
13845 let rec sep_expr_acc l =
13846 function
13847 | ExAcc (_, e1, e2) -> sep_expr_acc (sep_expr_acc l e2) e1
13848 | (Ast.ExId (loc, (Ast.IdUid (_, s))) as e) ->
13849 (match l with
13850 | [] -> [ (loc, [], e) ]
13851 | (loc', sl, e) :: l ->
13852 ((Loc.merge loc loc'), (s :: sl), e) :: l)
13853 | Ast.ExId (_, ((Ast.IdAcc (_, _, _) as i))) ->
13854 let rec normalize_acc =
13855 (function
13856 | Ast.IdAcc (_loc, i1, i2) ->
13857 Ast.ExAcc (_loc, normalize_acc i1, normalize_acc i2)
13858 | Ast.IdApp (_loc, i1, i2) ->
13859 Ast.ExApp (_loc, normalize_acc i1, normalize_acc i2)
13860 | (Ast.IdAnt (_loc, _) | Ast.IdUid (_loc, _) |
13861 Ast.IdLid (_loc, _)
13862 as i) -> Ast.ExId (_loc, i))
13863 in sep_expr_acc l (normalize_acc i)
13864 | e -> ((loc_of_expr e), [], e) :: l
13866 let list_of_opt_ctyp ot acc =
13867 match ot with | Ast.TyNil _ -> acc | t -> list_of_ctyp t acc
13869 let rec expr =
13870 function
13871 | Ast.ExAcc (loc, x, (Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
13872 mkexp loc
13873 (Pexp_apply (mkexp loc (Pexp_ident (Lident "!")),
13874 [ ("", (expr x)) ]))
13875 | (ExAcc (loc, _, _) | Ast.ExId (loc, (Ast.IdAcc (_, _, _))) as
13876 e) ->
13877 let (e, l) =
13878 (match sep_expr_acc [] e with
13879 | (loc, ml, Ast.ExId (_, (Ast.IdUid (_, s)))) :: l ->
13880 let ca = constructors_arity ()
13882 ((mkexp loc (Pexp_construct (mkli s ml, None, ca))),
13884 | (loc, ml, Ast.ExId (_, (Ast.IdLid (_, s)))) :: l ->
13885 ((mkexp loc (Pexp_ident (mkli s ml))), l)
13886 | (_, [], e) :: l -> ((expr e), l)
13887 | _ -> error loc "bad ast in expression") in
13888 let (_, e) =
13889 List.fold_left
13890 (fun (loc_bp, e1) (loc_ep, ml, e2) ->
13891 match e2 with
13892 | Ast.ExId (_, (Ast.IdLid (_, s))) ->
13893 let loc = Loc.merge loc_bp loc_ep
13895 (loc,
13896 (mkexp loc
13897 (Pexp_field (e1, mkli (conv_lab s) ml))))
13898 | _ ->
13899 error (loc_of_expr e2)
13900 "lowercase identifier expected")
13901 (loc, e) l
13902 in e
13903 | ExAnt (loc, _) -> error loc "antiquotation not allowed here"
13904 | (ExApp (loc, _, _) as f) ->
13905 let (f, al) = expr_fa [] f in
13906 let al = List.map label_expr al
13908 (match (expr f).pexp_desc with
13909 | Pexp_construct (li, None, _) ->
13910 let al = List.map snd al
13912 if constructors_arity ()
13913 then
13914 mkexp loc
13915 (Pexp_construct (li,
13916 Some (mkexp loc (Pexp_tuple al)), true))
13917 else
13918 (let a =
13919 match al with
13920 | [ a ] -> a
13921 | _ -> mkexp loc (Pexp_tuple al)
13923 mkexp loc
13924 (Pexp_construct (li, Some a, false)))
13925 | Pexp_variant (s, None) ->
13926 let al = List.map snd al in
13927 let a =
13928 if constructors_arity ()
13929 then mkexp loc (Pexp_tuple al)
13930 else
13931 (match al with
13932 | [ a ] -> a
13933 | _ -> mkexp loc (Pexp_tuple al))
13934 in mkexp loc (Pexp_variant (s, Some a))
13935 | _ -> mkexp loc (Pexp_apply (expr f, al)))
13936 | ExAre (loc, e1, e2) ->
13937 mkexp loc
13938 (Pexp_apply
13939 (mkexp loc (Pexp_ident (array_function "Array" "get")),
13940 [ ("", (expr e1)); ("", (expr e2)) ]))
13941 | ExArr (loc, e) ->
13942 mkexp loc (Pexp_array (List.map expr (list_of_expr e [])))
13943 | ExAsf loc -> mkexp loc Pexp_assertfalse
13944 | ExAss (loc, e, v) ->
13945 let e =
13946 (match e with
13947 | Ast.ExAcc (loc, x,
13948 (Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
13949 Pexp_apply (mkexp loc (Pexp_ident (Lident ":=")),
13950 [ ("", (expr x)); ("", (expr v)) ])
13951 | ExAcc (loc, _, _) ->
13952 (match (expr e).pexp_desc with
13953 | Pexp_field (e, lab) ->
13954 Pexp_setfield (e, lab, expr v)
13955 | _ -> error loc "bad record access")
13956 | ExAre (_, e1, e2) ->
13957 Pexp_apply
13958 (mkexp loc
13959 (Pexp_ident (array_function "Array" "set")),
13960 [ ("", (expr e1)); ("", (expr e2)); ("", (expr v)) ])
13961 | Ast.ExId (_, (Ast.IdLid (_, lab))) ->
13962 Pexp_setinstvar (lab, expr v)
13963 | ExSte (_, e1, e2) ->
13964 Pexp_apply
13965 (mkexp loc
13966 (Pexp_ident (array_function "String" "set")),
13967 [ ("", (expr e1)); ("", (expr e2)); ("", (expr v)) ])
13968 | _ -> error loc "bad left part of assignment")
13969 in mkexp loc e
13970 | ExAsr (loc, e) -> mkexp loc (Pexp_assert (expr e))
13971 | ExChr (loc, s) ->
13972 mkexp loc
13973 (Pexp_constant (Const_char (char_of_char_token loc s)))
13974 | ExCoe (loc, e, t1, t2) ->
13975 let t1 =
13976 (match t1 with | Ast.TyNil _ -> None | t -> Some (ctyp t))
13977 in mkexp loc (Pexp_constraint (expr e, t1, Some (ctyp t2)))
13978 | ExFlo (loc, s) ->
13979 mkexp loc
13980 (Pexp_constant (Const_float (remove_underscores s)))
13981 | ExFor (loc, i, e1, e2, df, el) ->
13982 let e3 = ExSeq (loc, el) in
13983 let df = if mb2b df then Upto else Downto
13984 in mkexp loc (Pexp_for (i, expr e1, expr e2, df, expr e3))
13985 | Ast.ExFun (loc, (Ast.McArr (_, (PaLab (_, lab, po)), w, e)))
13987 mkexp loc
13988 (Pexp_function (lab, None,
13989 [ ((patt_of_lab loc lab po), (when_expr e w)) ]))
13990 | Ast.ExFun (loc,
13991 (Ast.McArr (_, (PaOlbi (_, lab, p, e1)), w, e2))) ->
13992 let lab = paolab lab p
13994 mkexp loc
13995 (Pexp_function ("?" ^ lab, Some (expr e1),
13996 [ ((patt p), (when_expr e2 w)) ]))
13997 | Ast.ExFun (loc, (Ast.McArr (_, (PaOlb (_, lab, p)), w, e)))
13999 let lab = paolab lab p
14001 mkexp loc
14002 (Pexp_function ("?" ^ lab, None,
14003 [ ((patt_of_lab loc lab p), (when_expr e w)) ]))
14004 | ExFun (loc, a) ->
14005 mkexp loc (Pexp_function ("", None, match_case a []))
14006 | ExIfe (loc, e1, e2, e3) ->
14007 mkexp loc
14008 (Pexp_ifthenelse (expr e1, expr e2, Some (expr e3)))
14009 | ExInt (loc, s) ->
14010 let i =
14011 (try int_of_string s
14012 with
14013 | Failure _ ->
14014 error loc
14015 "Integer literal exceeds the range of representable integers of type int")
14016 in mkexp loc (Pexp_constant (Const_int i))
14017 | ExInt32 (loc, s) ->
14018 let i32 =
14019 (try Int32.of_string s
14020 with
14021 | Failure _ ->
14022 error loc
14023 "Integer literal exceeds the range of representable integers of type int32")
14024 in mkexp loc (Pexp_constant (Const_int32 i32))
14025 | ExInt64 (loc, s) ->
14026 let i64 =
14027 (try Int64.of_string s
14028 with
14029 | Failure _ ->
14030 error loc
14031 "Integer literal exceeds the range of representable integers of type int64")
14032 in mkexp loc (Pexp_constant (Const_int64 i64))
14033 | ExNativeInt (loc, s) ->
14034 let nati =
14035 (try Nativeint.of_string s
14036 with
14037 | Failure _ ->
14038 error loc
14039 "Integer literal exceeds the range of representable integers of type nativeint")
14040 in mkexp loc (Pexp_constant (Const_nativeint nati))
14041 | ExLab (loc, _, _) ->
14042 error loc "labeled expression not allowed here"
14043 | ExLaz (loc, e) -> mkexp loc (Pexp_lazy (expr e))
14044 | ExLet (loc, rf, bi, e) ->
14045 mkexp loc (Pexp_let (mkrf rf, binding bi [], expr e))
14046 | ExLmd (loc, i, me, e) ->
14047 mkexp loc (Pexp_letmodule (i, module_expr me, expr e))
14048 | ExMat (loc, e, a) ->
14049 mkexp loc (Pexp_match (expr e, match_case a []))
14050 | ExNew (loc, id) -> mkexp loc (Pexp_new (long_type_ident id))
14051 | ExObj (loc, po, cfl) ->
14052 let p =
14053 (match po with | Ast.PaNil _ -> Ast.PaAny loc | p -> p) in
14054 let cil = class_str_item cfl []
14055 in mkexp loc (Pexp_object (((patt p), cil)))
14056 | ExOlb (loc, _, _) ->
14057 error loc "labeled expression not allowed here"
14058 | ExOvr (loc, iel) ->
14059 mkexp loc (Pexp_override (mkideexp iel []))
14060 | ExRec (loc, lel, eo) ->
14061 (match lel with
14062 | Ast.RbNil _ -> error loc "empty record"
14063 | _ ->
14064 let eo =
14065 (match eo with
14066 | Ast.ExNil _ -> None
14067 | e -> Some (expr e))
14068 in mkexp loc (Pexp_record (mklabexp lel [], eo)))
14069 | ExSeq (_loc, e) ->
14070 let rec loop =
14071 (function
14072 | [] -> expr (Ast.ExId (_loc, Ast.IdUid (_loc, "()")))
14073 | [ e ] -> expr e
14074 | e :: el ->
14075 let _loc = Loc.merge (loc_of_expr e) _loc
14076 in mkexp _loc (Pexp_sequence (expr e, loop el)))
14077 in loop (list_of_expr e [])
14078 | ExSnd (loc, e, s) -> mkexp loc (Pexp_send (expr e, s))
14079 | ExSte (loc, e1, e2) ->
14080 mkexp loc
14081 (Pexp_apply
14082 (mkexp loc
14083 (Pexp_ident (array_function "String" "get")),
14084 [ ("", (expr e1)); ("", (expr e2)) ]))
14085 | ExStr (loc, s) ->
14086 mkexp loc
14087 (Pexp_constant
14088 (Const_string (string_of_string_token loc s)))
14089 | ExTry (loc, e, a) ->
14090 mkexp loc (Pexp_try (expr e, match_case a []))
14091 | Ast.ExTup (loc, (Ast.ExCom (_, e1, e2))) ->
14092 mkexp loc
14093 (Pexp_tuple
14094 (List.map expr (list_of_expr e1 (list_of_expr e2 []))))
14095 | Ast.ExTup (loc, _) -> error loc "singleton tuple"
14096 | ExTyc (loc, e, t) ->
14097 mkexp loc (Pexp_constraint (expr e, Some (ctyp t), None))
14098 | Ast.ExId (loc, (Ast.IdUid (_, "()"))) ->
14099 mkexp loc (Pexp_construct (lident "()", None, true))
14100 | Ast.ExId (loc, (Ast.IdLid (_, s))) ->
14101 mkexp loc (Pexp_ident (lident s))
14102 | Ast.ExId (loc, (Ast.IdUid (_, s))) ->
14103 mkexp loc
14104 (Pexp_construct (lident (conv_con s), None, true))
14105 | ExVrn (loc, s) -> mkexp loc (Pexp_variant (s, None))
14106 | ExWhi (loc, e1, el) ->
14107 let e2 = ExSeq (loc, el)
14108 in mkexp loc (Pexp_while (expr e1, expr e2))
14109 | Ast.ExCom (loc, _, _) ->
14110 error loc "expr, expr: not allowed here"
14111 | Ast.ExSem (loc, _, _) ->
14112 error loc
14113 "expr; expr: not allowed here, use do {...} or [|...|] to surround them"
14114 | (ExId (_, _) | ExNil _ as e) ->
14115 error (loc_of_expr e) "invalid expr"
14116 and patt_of_lab _loc lab =
14117 function
14118 | Ast.PaNil _ -> patt (Ast.PaId (_loc, Ast.IdLid (_loc, lab)))
14119 | p -> patt p
14120 and expr_of_lab _loc lab =
14121 function
14122 | Ast.ExNil _ -> expr (Ast.ExId (_loc, Ast.IdLid (_loc, lab)))
14123 | e -> expr e
14124 and label_expr =
14125 function
14126 | ExLab (loc, lab, eo) -> (lab, (expr_of_lab loc lab eo))
14127 | ExOlb (loc, lab, eo) ->
14128 (("?" ^ lab), (expr_of_lab loc lab eo))
14129 | e -> ("", (expr e))
14130 and binding x acc =
14131 match x with
14132 | Ast.BiAnd (_, x, y) -> binding x (binding y acc)
14133 | Ast.BiEq (_, p, e) -> ((patt p), (expr e)) :: acc
14134 | Ast.BiNil _ -> acc
14135 | _ -> assert false
14136 and match_case x acc =
14137 match x with
14138 | Ast.McOr (_, x, y) -> match_case x (match_case y acc)
14139 | Ast.McArr (_, p, w, e) -> ((patt p), (when_expr e w)) :: acc
14140 | Ast.McNil _ -> acc
14141 | _ -> assert false
14142 and when_expr e w =
14143 match w with
14144 | Ast.ExNil _ -> expr e
14145 | w -> mkexp (loc_of_expr w) (Pexp_when (expr w, expr e))
14146 and mklabexp x acc =
14147 match x with
14148 | Ast.RbSem (_, x, y) -> mklabexp x (mklabexp y acc)
14149 | Ast.RbEq (_, i, e) ->
14150 ((ident ~conv_lid: conv_lab i), (expr e)) :: acc
14151 | _ -> assert false
14152 and mkideexp x acc =
14153 match x with
14154 | Ast.RbNil _ -> acc
14155 | Ast.RbSem (_, x, y) -> mkideexp x (mkideexp y acc)
14156 | Ast.RbEq (_, (Ast.IdLid (_, s)), e) -> (s, (expr e)) :: acc
14157 | _ -> assert false
14158 and mktype_decl x acc =
14159 match x with
14160 | Ast.TyAnd (_, x, y) -> mktype_decl x (mktype_decl y acc)
14161 | Ast.TyDcl (_, c, tl, td, cl) ->
14162 let cl =
14163 List.map
14164 (fun (t1, t2) ->
14165 let loc =
14166 Loc.merge (loc_of_ctyp t1) (loc_of_ctyp t2)
14167 in ((ctyp t1), (ctyp t2), (mkloc loc)))
14171 (type_decl (List.fold_right type_parameters tl []) cl td)) ::
14173 | _ -> assert false
14174 and module_type =
14175 function
14176 | Ast.MtNil loc ->
14177 error loc "abstract/nil module type not allowed here"
14178 | Ast.MtId (loc, i) -> mkmty loc (Pmty_ident (long_uident i))
14179 | Ast.MtFun (loc, n, nt, mt) ->
14180 mkmty loc
14181 (Pmty_functor (n, module_type nt, module_type mt))
14182 | Ast.MtQuo (loc, _) ->
14183 error loc "module type variable not allowed here"
14184 | Ast.MtSig (loc, sl) ->
14185 mkmty loc (Pmty_signature (sig_item sl []))
14186 | Ast.MtWit (loc, mt, wc) ->
14187 mkmty loc (Pmty_with (module_type mt, mkwithc wc []))
14188 | Ast.MtAnt (_, _) -> assert false
14189 and sig_item s l =
14190 match s with
14191 | Ast.SgNil _ -> l
14192 | SgCls (loc, cd) ->
14193 (mksig loc
14194 (Psig_class
14195 (List.map class_info_class_type
14196 (list_of_class_type cd [])))) ::
14198 | SgClt (loc, ctd) ->
14199 (mksig loc
14200 (Psig_class_type
14201 (List.map class_info_class_type
14202 (list_of_class_type ctd [])))) ::
14204 | Ast.SgSem (_, sg1, sg2) -> sig_item sg1 (sig_item sg2 l)
14205 | SgDir (_, _, _) -> l
14206 | Ast.SgExc (loc, (Ast.TyId (_, (Ast.IdUid (_, s))))) ->
14207 (mksig loc (Psig_exception (conv_con s, []))) :: l
14208 | Ast.SgExc (loc,
14209 (Ast.TyOf (_, (Ast.TyId (_, (Ast.IdUid (_, s)))), t))) ->
14210 (mksig loc
14211 (Psig_exception (conv_con s,
14212 List.map ctyp (list_of_ctyp t [])))) ::
14214 | SgExc (_, _) -> assert false
14215 | SgExt (loc, n, t, sl) ->
14216 (mksig loc
14217 (Psig_value (n, mkvalue_desc t (list_of_meta_list sl)))) ::
14219 | SgInc (loc, mt) ->
14220 (mksig loc (Psig_include (module_type mt))) :: l
14221 | SgMod (loc, n, mt) ->
14222 (mksig loc (Psig_module (n, module_type mt))) :: l
14223 | SgRecMod (loc, mb) ->
14224 (mksig loc (Psig_recmodule (module_sig_binding mb []))) ::
14226 | SgMty (loc, n, mt) ->
14227 let si =
14228 (match mt with
14229 | MtQuo (_, _) -> Pmodtype_abstract
14230 | _ -> Pmodtype_manifest (module_type mt))
14231 in (mksig loc (Psig_modtype (n, si))) :: l
14232 | SgOpn (loc, id) ->
14233 (mksig loc (Psig_open (long_uident id))) :: l
14234 | SgTyp (loc, tdl) ->
14235 (mksig loc (Psig_type (mktype_decl tdl []))) :: l
14236 | SgVal (loc, n, t) ->
14237 (mksig loc (Psig_value (n, mkvalue_desc t []))) :: l
14238 | Ast.SgAnt (loc, _) -> error loc "antiquotation in sig_item"
14239 and module_sig_binding x acc =
14240 match x with
14241 | Ast.MbAnd (_, x, y) ->
14242 module_sig_binding x (module_sig_binding y acc)
14243 | Ast.MbCol (_, s, mt) -> (s, (module_type mt)) :: acc
14244 | _ -> assert false
14245 and module_str_binding x acc =
14246 match x with
14247 | Ast.MbAnd (_, x, y) ->
14248 module_str_binding x (module_str_binding y acc)
14249 | Ast.MbColEq (_, s, mt, me) ->
14250 (s, (module_type mt), (module_expr me)) :: acc
14251 | _ -> assert false
14252 and module_expr =
14253 function
14254 | Ast.MeNil loc -> error loc "nil module expression"
14255 | Ast.MeId (loc, i) -> mkmod loc (Pmod_ident (long_uident i))
14256 | Ast.MeApp (loc, me1, me2) ->
14257 mkmod loc (Pmod_apply (module_expr me1, module_expr me2))
14258 | Ast.MeFun (loc, n, mt, me) ->
14259 mkmod loc
14260 (Pmod_functor (n, module_type mt, module_expr me))
14261 | Ast.MeStr (loc, sl) ->
14262 mkmod loc (Pmod_structure (str_item sl []))
14263 | Ast.MeTyc (loc, me, mt) ->
14264 mkmod loc
14265 (Pmod_constraint (module_expr me, module_type mt))
14266 | Ast.MeAnt (loc, _) ->
14267 error loc "antiquotation in module_expr"
14268 and str_item s l =
14269 match s with
14270 | Ast.StNil _ -> l
14271 | StCls (loc, cd) ->
14272 (mkstr loc
14273 (Pstr_class
14274 (List.map class_info_class_expr
14275 (list_of_class_expr cd [])))) ::
14277 | StClt (loc, ctd) ->
14278 (mkstr loc
14279 (Pstr_class_type
14280 (List.map class_info_class_type
14281 (list_of_class_type ctd [])))) ::
14283 | Ast.StSem (_, st1, st2) -> str_item st1 (str_item st2 l)
14284 | StDir (_, _, _) -> l
14285 | Ast.StExc (loc, (Ast.TyId (_, (Ast.IdUid (_, s)))), Ast.
14286 ONone) ->
14287 (mkstr loc (Pstr_exception (conv_con s, []))) :: l
14288 | Ast.StExc (loc,
14289 (Ast.TyOf (_, (Ast.TyId (_, (Ast.IdUid (_, s)))), t)), Ast.
14290 ONone) ->
14291 (mkstr loc
14292 (Pstr_exception (conv_con s,
14293 List.map ctyp (list_of_ctyp t [])))) ::
14295 | Ast.StExc (loc, (Ast.TyId (_, (Ast.IdUid (_, s)))),
14296 (Ast.OSome i)) ->
14297 (mkstr loc (Pstr_exn_rebind (conv_con s, ident i))) :: l
14298 | StExc (_, _, _) -> assert false
14299 | StExp (loc, e) -> (mkstr loc (Pstr_eval (expr e))) :: l
14300 | StExt (loc, n, t, sl) ->
14301 (mkstr loc
14302 (Pstr_primitive (n,
14303 mkvalue_desc t (list_of_meta_list sl)))) ::
14305 | StInc (loc, me) ->
14306 (mkstr loc (Pstr_include (module_expr me))) :: l
14307 | StMod (loc, n, me) ->
14308 (mkstr loc (Pstr_module (n, module_expr me))) :: l
14309 | StRecMod (loc, mb) ->
14310 (mkstr loc (Pstr_recmodule (module_str_binding mb []))) ::
14312 | StMty (loc, n, mt) ->
14313 (mkstr loc (Pstr_modtype (n, module_type mt))) :: l
14314 | StOpn (loc, id) ->
14315 (mkstr loc (Pstr_open (long_uident id))) :: l
14316 | StTyp (loc, tdl) ->
14317 (mkstr loc (Pstr_type (mktype_decl tdl []))) :: l
14318 | StVal (loc, rf, bi) ->
14319 (mkstr loc (Pstr_value (mkrf rf, binding bi []))) :: l
14320 | Ast.StAnt (loc, _) -> error loc "antiquotation in str_item"
14321 and class_type =
14322 function
14323 | CtCon (loc, Ast.BFalse, id, tl) ->
14324 mkcty loc
14325 (Pcty_constr (long_class_ident id,
14326 List.map ctyp (list_of_opt_ctyp tl [])))
14327 | CtFun (loc, (TyLab (_, lab, t)), ct) ->
14328 mkcty loc (Pcty_fun (lab, ctyp t, class_type ct))
14329 | CtFun (loc, (TyOlb (loc1, lab, t)), ct) ->
14330 let t =
14331 TyApp (loc1, Ast.TyId (loc1, Ast.IdLid (loc1, "option")),
14333 in mkcty loc (Pcty_fun ("?" ^ lab, ctyp t, class_type ct))
14334 | CtFun (loc, t, ct) ->
14335 mkcty loc (Pcty_fun ("", ctyp t, class_type ct))
14336 | CtSig (loc, t_o, ctfl) ->
14337 let t =
14338 (match t_o with | Ast.TyNil _ -> Ast.TyAny loc | t -> t) in
14339 let cil = class_sig_item ctfl []
14340 in mkcty loc (Pcty_signature (((ctyp t), cil)))
14341 | CtCon (loc, _, _, _) ->
14342 error loc "invalid virtual class inside a class type"
14343 | CtAnt (_, _) | CtEq (_, _, _) | CtCol (_, _, _) |
14344 CtAnd (_, _, _) | CtNil _ -> assert false
14345 and class_info_class_expr ci =
14346 match ci with
14347 | CeEq (_, (CeCon (loc, vir, (IdLid (_, name)), params)), ce)
14349 let (loc_params, (params, variance)) =
14350 (match params with
14351 | Ast.TyNil _ -> (loc, ([], []))
14352 | t ->
14353 ((loc_of_ctyp t),
14354 (List.split (class_parameters t []))))
14357 pci_virt = if mb2b vir then Virtual else Concrete;
14358 pci_params = (params, (mkloc loc_params));
14359 pci_name = name;
14360 pci_expr = class_expr ce;
14361 pci_loc = mkloc loc;
14362 pci_variance = variance;
14364 | ce -> error (loc_of_class_expr ce) "bad class definition"
14365 and class_info_class_type ci =
14366 match ci with
14367 | CtEq (_, (CtCon (loc, vir, (IdLid (_, name)), params)), ct) |
14368 CtCol (_, (CtCon (loc, vir, (IdLid (_, name)), params)),
14371 let (loc_params, (params, variance)) =
14372 (match params with
14373 | Ast.TyNil _ -> (loc, ([], []))
14374 | t ->
14375 ((loc_of_ctyp t),
14376 (List.split (class_parameters t []))))
14379 pci_virt = if mb2b vir then Virtual else Concrete;
14380 pci_params = (params, (mkloc loc_params));
14381 pci_name = name;
14382 pci_expr = class_type ct;
14383 pci_loc = mkloc loc;
14384 pci_variance = variance;
14386 | ct ->
14387 error (loc_of_class_type ct)
14388 "bad class/class type declaration/definition"
14389 and class_sig_item c l =
14390 match c with
14391 | Ast.CgNil _ -> l
14392 | CgCtr (loc, t1, t2) ->
14393 (Pctf_cstr (((ctyp t1), (ctyp t2), (mkloc loc)))) :: l
14394 | Ast.CgSem (_, csg1, csg2) ->
14395 class_sig_item csg1 (class_sig_item csg2 l)
14396 | CgInh (_, ct) -> (Pctf_inher (class_type ct)) :: l
14397 | CgMth (loc, s, pf, t) ->
14398 (Pctf_meth
14399 ((s, (mkprivate pf), (mkpolytype (ctyp t)), (mkloc loc)))) ::
14401 | CgVal (loc, s, b, v, t) ->
14402 (Pctf_val
14403 ((s, (mkmutable b), (mkvirtual v), (ctyp t),
14404 (mkloc loc)))) ::
14406 | CgVir (loc, s, b, t) ->
14407 (Pctf_virt
14408 ((s, (mkprivate b), (mkpolytype (ctyp t)), (mkloc loc)))) ::
14410 | CgAnt (_, _) -> assert false
14411 and class_expr =
14412 function
14413 | (CeApp (loc, _, _) as c) ->
14414 let (ce, el) = class_expr_fa [] c in
14415 let el = List.map label_expr el
14416 in mkpcl loc (Pcl_apply (class_expr ce, el))
14417 | CeCon (loc, Ast.BFalse, id, tl) ->
14418 mkpcl loc
14419 (Pcl_constr (long_class_ident id,
14420 List.map ctyp (list_of_opt_ctyp tl [])))
14421 | CeFun (loc, (PaLab (_, lab, po)), ce) ->
14422 mkpcl loc
14423 (Pcl_fun (lab, None, patt_of_lab loc lab po,
14424 class_expr ce))
14425 | CeFun (loc, (PaOlbi (_, lab, p, e)), ce) ->
14426 let lab = paolab lab p
14428 mkpcl loc
14429 (Pcl_fun ("?" ^ lab, Some (expr e), patt p,
14430 class_expr ce))
14431 | CeFun (loc, (PaOlb (_, lab, p)), ce) ->
14432 let lab = paolab lab p
14434 mkpcl loc
14435 (Pcl_fun ("?" ^ lab, None, patt_of_lab loc lab p,
14436 class_expr ce))
14437 | CeFun (loc, p, ce) ->
14438 mkpcl loc (Pcl_fun ("", None, patt p, class_expr ce))
14439 | CeLet (loc, rf, bi, ce) ->
14440 mkpcl loc (Pcl_let (mkrf rf, binding bi [], class_expr ce))
14441 | CeStr (loc, po, cfl) ->
14442 let p =
14443 (match po with | Ast.PaNil _ -> Ast.PaAny loc | p -> p) in
14444 let cil = class_str_item cfl []
14445 in mkpcl loc (Pcl_structure (((patt p), cil)))
14446 | CeTyc (loc, ce, ct) ->
14447 mkpcl loc (Pcl_constraint (class_expr ce, class_type ct))
14448 | CeCon (loc, _, _, _) ->
14449 error loc "invalid virtual class inside a class expression"
14450 | CeAnt (_, _) | CeEq (_, _, _) | CeAnd (_, _, _) | CeNil _ ->
14451 assert false
14452 and class_str_item c l =
14453 match c with
14454 | CrNil _ -> l
14455 | CrCtr (loc, t1, t2) ->
14456 (Pcf_cstr (((ctyp t1), (ctyp t2), (mkloc loc)))) :: l
14457 | Ast.CrSem (_, cst1, cst2) ->
14458 class_str_item cst1 (class_str_item cst2 l)
14459 | CrInh (_, ce, "") -> (Pcf_inher (class_expr ce, None)) :: l
14460 | CrInh (_, ce, pb) ->
14461 (Pcf_inher (class_expr ce, Some pb)) :: l
14462 | CrIni (_, e) -> (Pcf_init (expr e)) :: l
14463 | CrMth (loc, s, b, e, t) ->
14464 let t =
14465 (match t with
14466 | Ast.TyNil _ -> None
14467 | t -> Some (mkpolytype (ctyp t))) in
14468 let e = mkexp loc (Pexp_poly (expr e, t))
14469 in (Pcf_meth ((s, (mkprivate b), e, (mkloc loc)))) :: l
14470 | CrVal (loc, s, b, e) ->
14471 (Pcf_val ((s, (mkmutable b), (expr e), (mkloc loc)))) :: l
14472 | CrVir (loc, s, b, t) ->
14473 (Pcf_virt
14474 ((s, (mkprivate b), (mkpolytype (ctyp t)), (mkloc loc)))) ::
14476 | CrVvr (loc, s, b, t) ->
14477 (Pcf_valvirt ((s, (mkmutable b), (ctyp t), (mkloc loc)))) ::
14479 | CrAnt (_, _) -> assert false
14481 let sig_item ast = sig_item ast []
14483 let str_item ast = str_item ast []
14485 let directive =
14486 function
14487 | Ast.ExNil _ -> Pdir_none
14488 | ExStr (_, s) -> Pdir_string s
14489 | ExInt (_, i) -> Pdir_int (int_of_string i)
14490 | Ast.ExId (_, (Ast.IdUid (_, "True"))) -> Pdir_bool true
14491 | Ast.ExId (_, (Ast.IdUid (_, "False"))) -> Pdir_bool false
14492 | e -> Pdir_ident (ident (ident_of_expr e))
14494 let phrase =
14495 function
14496 | StDir (_, d, dp) -> Ptop_dir (d, directive dp)
14497 | si -> Ptop_def (str_item si)
14503 module CleanAst =
14504 struct
14505 module Make (Ast : Sig.Camlp4Ast) =
14506 struct
14507 class clean_ast =
14508 object inherit Ast.map as super
14510 method with_constr =
14511 fun wc ->
14512 match super#with_constr wc with
14513 | Ast.WcAnd (_, (Ast.WcNil _), wc) |
14514 Ast.WcAnd (_, wc, (Ast.WcNil _)) -> wc
14515 | wc -> wc
14517 method expr =
14518 fun e ->
14519 match super#expr e with
14520 | Ast.ExLet (_, _, (Ast.BiNil _), e) |
14521 Ast.ExRec (_, (Ast.RbNil _), e) |
14522 Ast.ExCom (_, (Ast.ExNil _), e) |
14523 Ast.ExCom (_, e, (Ast.ExNil _)) |
14524 Ast.ExSem (_, (Ast.ExNil _), e) |
14525 Ast.ExSem (_, e, (Ast.ExNil _)) -> e
14526 | e -> e
14528 method patt =
14529 fun p ->
14530 match super#patt p with
14531 | Ast.PaAli (_, p, (Ast.PaNil _)) |
14532 Ast.PaOrp (_, (Ast.PaNil _), p) |
14533 Ast.PaOrp (_, p, (Ast.PaNil _)) |
14534 Ast.PaCom (_, (Ast.PaNil _), p) |
14535 Ast.PaCom (_, p, (Ast.PaNil _)) |
14536 Ast.PaSem (_, (Ast.PaNil _), p) |
14537 Ast.PaSem (_, p, (Ast.PaNil _)) -> p
14538 | p -> p
14540 method match_case =
14541 fun mc ->
14542 match super#match_case mc with
14543 | Ast.McOr (_, (Ast.McNil _), mc) |
14544 Ast.McOr (_, mc, (Ast.McNil _)) -> mc
14545 | mc -> mc
14547 method binding =
14548 fun bi ->
14549 match super#binding bi with
14550 | Ast.BiAnd (_, (Ast.BiNil _), bi) |
14551 Ast.BiAnd (_, bi, (Ast.BiNil _)) -> bi
14552 | bi -> bi
14554 method rec_binding =
14555 fun rb ->
14556 match super#rec_binding rb with
14557 | Ast.RbSem (_, (Ast.RbNil _), bi) |
14558 Ast.RbSem (_, bi, (Ast.RbNil _)) -> bi
14559 | bi -> bi
14561 method module_binding =
14562 fun mb ->
14563 match super#module_binding mb with
14564 | Ast.MbAnd (_, (Ast.MbNil _), mb) |
14565 Ast.MbAnd (_, mb, (Ast.MbNil _)) -> mb
14566 | mb -> mb
14568 method ctyp =
14569 fun t ->
14570 match super#ctyp t with
14571 | Ast.TyPol (_, (Ast.TyNil _), t) |
14572 Ast.TyAli (_, (Ast.TyNil _), t) |
14573 Ast.TyAli (_, t, (Ast.TyNil _)) |
14574 Ast.TyArr (_, t, (Ast.TyNil _)) |
14575 Ast.TyArr (_, (Ast.TyNil _), t) |
14576 Ast.TyOr (_, (Ast.TyNil _), t) |
14577 Ast.TyOr (_, t, (Ast.TyNil _)) |
14578 Ast.TyOf (_, t, (Ast.TyNil _)) |
14579 Ast.TyAnd (_, (Ast.TyNil _), t) |
14580 Ast.TyAnd (_, t, (Ast.TyNil _)) |
14581 Ast.TySem (_, t, (Ast.TyNil _)) |
14582 Ast.TySem (_, (Ast.TyNil _), t) |
14583 Ast.TyCom (_, (Ast.TyNil _), t) |
14584 Ast.TyCom (_, t, (Ast.TyNil _)) |
14585 Ast.TyAmp (_, t, (Ast.TyNil _)) |
14586 Ast.TyAmp (_, (Ast.TyNil _), t) |
14587 Ast.TySta (_, (Ast.TyNil _), t) |
14588 Ast.TySta (_, t, (Ast.TyNil _)) -> t
14589 | t -> t
14591 method sig_item =
14592 fun sg ->
14593 match super#sig_item sg with
14594 | Ast.SgSem (_, (Ast.SgNil _), sg) |
14595 Ast.SgSem (_, sg, (Ast.SgNil _)) -> sg
14596 | Ast.SgTyp (loc, (Ast.TyNil _)) -> Ast.SgNil loc
14597 | sg -> sg
14599 method str_item =
14600 fun st ->
14601 match super#str_item st with
14602 | Ast.StSem (_, (Ast.StNil _), st) |
14603 Ast.StSem (_, st, (Ast.StNil _)) -> st
14604 | Ast.StTyp (loc, (Ast.TyNil _)) -> Ast.StNil loc
14605 | Ast.StVal (loc, _, (Ast.BiNil _)) -> Ast.StNil loc
14606 | st -> st
14608 method module_type =
14609 fun mt ->
14610 match super#module_type mt with
14611 | Ast.MtWit (_, mt, (Ast.WcNil _)) -> mt
14612 | mt -> mt
14614 method class_expr =
14615 fun ce ->
14616 match super#class_expr ce with
14617 | Ast.CeAnd (_, (Ast.CeNil _), ce) |
14618 Ast.CeAnd (_, ce, (Ast.CeNil _)) -> ce
14619 | ce -> ce
14621 method class_type =
14622 fun ct ->
14623 match super#class_type ct with
14624 | Ast.CtAnd (_, (Ast.CtNil _), ct) |
14625 Ast.CtAnd (_, ct, (Ast.CtNil _)) -> ct
14626 | ct -> ct
14628 method class_sig_item =
14629 fun csg ->
14630 match super#class_sig_item csg with
14631 | Ast.CgSem (_, (Ast.CgNil _), csg) |
14632 Ast.CgSem (_, csg, (Ast.CgNil _)) -> csg
14633 | csg -> csg
14635 method class_str_item =
14636 fun cst ->
14637 match super#class_str_item cst with
14638 | Ast.CrSem (_, (Ast.CrNil _), cst) |
14639 Ast.CrSem (_, cst, (Ast.CrNil _)) -> cst
14640 | cst -> cst
14648 module CommentFilter :
14650 module Make (Token : Sig.Camlp4Token) :
14652 open Token
14654 type t
14656 val mk : unit -> t
14658 val define : Token.Filter.t -> t -> unit
14660 val filter :
14661 t -> (Token.t * Loc.t) Stream.t -> (Token.t * Loc.t) Stream.t
14663 val take_list : t -> (string * Loc.t) list
14665 val take_stream : t -> (string * Loc.t) Stream.t
14669 end =
14670 struct
14671 module Make (Token : Sig.Camlp4Token) =
14672 struct
14673 open Token
14675 type t =
14676 (((string * Loc.t) Stream.t) * ((string * Loc.t) Queue.t))
14678 let mk () =
14679 let q = Queue.create () in
14680 let f _ = try Some (Queue.take q) with | Queue.Empty -> None
14681 in ((Stream.from f), q)
14683 let filter (_, q) =
14684 let rec self (__strm : _ Stream.t) =
14685 match Stream.peek __strm with
14686 | Some ((Sig.COMMENT x, loc)) ->
14687 (Stream.junk __strm;
14688 let xs = __strm in (Queue.add (x, loc) q; self xs))
14689 | Some x ->
14690 (Stream.junk __strm;
14691 let xs = __strm
14692 in Stream.icons x (Stream.slazy (fun _ -> self xs)))
14693 | _ -> Stream.sempty
14694 in self
14696 let take_list (_, q) =
14697 let rec self accu =
14698 if Queue.is_empty q
14699 then accu
14700 else self ((Queue.take q) :: accu)
14701 in self []
14703 let take_stream = fst
14705 let define token_fiter comments_strm =
14706 Token.Filter.define_filter token_fiter
14707 (fun previous strm -> previous (filter comments_strm strm))
14713 module DynLoader : sig include Sig.DynLoader
14714 end =
14715 struct
14716 type t = string Queue.t
14718 exception Error of string * string
14720 let include_dir x y = Queue.add y x
14722 let fold_load_path x f acc = Queue.fold (fun x y -> f y x) acc x
14724 let mk ?(ocaml_stdlib = true) ?(camlp4_stdlib = true) () =
14725 let q = Queue.create ()
14727 (if ocaml_stdlib
14728 then include_dir q Camlp4_config.ocaml_standard_library
14729 else ();
14730 if camlp4_stdlib
14731 then
14732 (include_dir q Camlp4_config.camlp4_standard_library;
14733 include_dir q
14734 (Filename.concat Camlp4_config.camlp4_standard_library
14735 "Camlp4Parsers");
14736 include_dir q
14737 (Filename.concat Camlp4_config.camlp4_standard_library
14738 "Camlp4Printers");
14739 include_dir q
14740 (Filename.concat Camlp4_config.camlp4_standard_library
14741 "Camlp4Filters"))
14742 else ();
14743 include_dir q ".";
14746 let find_in_path x name =
14747 if not (Filename.is_implicit name)
14748 then if Sys.file_exists name then name else raise Not_found
14749 else
14750 (let res =
14751 fold_load_path x
14752 (fun dir ->
14753 function
14754 | None ->
14755 let fullname = Filename.concat dir name
14757 if Sys.file_exists fullname
14758 then Some fullname
14759 else None
14760 | x -> x)
14761 None
14762 in match res with | None -> raise Not_found | Some x -> x)
14764 let load =
14765 let _initialized = ref false
14767 fun _path file ->
14768 raise
14769 (Error (file, "native-code program cannot do a dynamic load"))
14773 module EmptyError : sig include Sig.Error
14774 end =
14775 struct
14776 type t = unit
14778 exception E of t
14780 let print _ = assert false
14782 let to_string _ = assert false
14786 module EmptyPrinter :
14787 sig module Make (Ast : Sig.Ast) : Sig.Printer(Ast).S
14788 end =
14789 struct
14790 module Make (Ast : Sig.Ast) =
14791 struct
14792 let print_interf ?input_file:(_) ?output_file:(_) _ =
14793 failwith "No interface printer"
14795 let print_implem ?input_file:(_) ?output_file:(_) _ =
14796 failwith "No implementation printer"
14802 module FreeVars :
14804 module Make (Ast : Sig.Camlp4Ast) :
14806 module S : Set.S with type elt = string
14808 val fold_binding_vars :
14809 (string -> 'accu -> 'accu) -> Ast.binding -> 'accu -> 'accu
14811 class ['accu] c_fold_pattern_vars :
14812 (string -> 'accu -> 'accu) ->
14813 'accu ->
14814 object inherit Ast.fold
14815 val acc : 'accu
14816 method acc : 'accu
14820 val fold_pattern_vars :
14821 (string -> 'accu -> 'accu) -> Ast.patt -> 'accu -> 'accu
14823 class ['accu] fold_free_vars :
14824 (string -> 'accu -> 'accu) ->
14825 ?env_init: S.t ->
14826 'accu ->
14827 object ('self_type)
14828 inherit Ast.fold
14830 val free : 'accu
14832 val env : S.t
14834 method free : 'accu
14836 method set_env : S.t -> 'self_type
14838 method add_atom : string -> 'self_type
14840 method add_patt : Ast.patt -> 'self_type
14842 method add_binding : Ast.binding -> 'self_type
14846 val free_vars : S.t -> Ast.expr -> S.t
14850 end =
14851 struct
14852 module Make (Ast : Sig.Camlp4Ast) =
14853 struct
14854 module S = Set.Make(String)
14856 let rec fold_binding_vars f bi acc =
14857 match bi with
14858 | Ast.BiAnd (_, bi1, bi2) ->
14859 fold_binding_vars f bi1 (fold_binding_vars f bi2 acc)
14860 | Ast.BiEq (_, (Ast.PaId (_, (Ast.IdLid (_, i)))), _) ->
14861 f i acc
14862 | _ -> assert false
14864 class ['accu] c_fold_pattern_vars f init =
14865 object inherit Ast.fold as super
14867 val acc = init
14869 method acc : 'accu = acc
14871 method patt =
14872 function
14873 | Ast.PaId (_, (Ast.IdLid (_, s))) |
14874 Ast.PaLab (_, s, (Ast.PaNil _)) |
14875 Ast.PaOlb (_, s, (Ast.PaNil _)) -> {< acc = f s acc; >}
14876 | p -> super#patt p
14880 let fold_pattern_vars f p init =
14881 ((new c_fold_pattern_vars f init)#patt p)#acc
14883 class ['accu] fold_free_vars (f : string -> 'accu -> 'accu)
14884 ?(env_init = S.empty) free_init =
14885 object (o)
14886 inherit Ast.fold as super
14888 val free = (free_init : 'accu)
14890 val env = (env_init : S.t)
14892 method free = free
14894 method set_env = fun env -> {< env = env; >}
14896 method add_atom = fun s -> {< env = S.add s env; >}
14898 method add_patt =
14899 fun p -> {< env = fold_pattern_vars S.add p env; >}
14901 method add_binding =
14902 fun bi -> {< env = fold_binding_vars S.add bi env; >}
14904 method expr =
14905 function
14906 | Ast.ExId (_, (Ast.IdLid (_, s))) |
14907 Ast.ExLab (_, s, (Ast.ExNil _)) |
14908 Ast.ExOlb (_, s, (Ast.ExNil _)) ->
14909 if S.mem s env then o else {< free = f s free; >}
14910 | Ast.ExLet (_, Ast.BFalse, bi, e) ->
14911 (((o#add_binding bi)#expr e)#set_env env)#binding bi
14912 | Ast.ExLet (_, Ast.BTrue, bi, e) ->
14913 (((o#add_binding bi)#expr e)#binding bi)#set_env env
14914 | Ast.ExFor (_, s, e1, e2, _, e3) ->
14915 ((((o#expr e1)#expr e2)#add_atom s)#expr e3)#set_env
14917 | Ast.ExId (_, _) | Ast.ExNew (_, _) -> o
14918 | Ast.ExObj (_, p, cst) ->
14919 ((o#add_patt p)#class_str_item cst)#set_env env
14920 | e -> super#expr e
14922 method match_case =
14923 function
14924 | Ast.McArr (_, p, e1, e2) ->
14925 (((o#add_patt p)#expr e1)#expr e2)#set_env env
14926 | m -> super#match_case m
14928 method str_item =
14929 function
14930 | Ast.StExt (_, s, t, _) -> (o#ctyp t)#add_atom s
14931 | Ast.StVal (_, Ast.BFalse, bi) ->
14932 (o#binding bi)#add_binding bi
14933 | Ast.StVal (_, Ast.BTrue, bi) ->
14934 (o#add_binding bi)#binding bi
14935 | st -> super#str_item st
14937 method class_expr =
14938 function
14939 | Ast.CeFun (_, p, ce) ->
14940 ((o#add_patt p)#class_expr ce)#set_env env
14941 | Ast.CeLet (_, Ast.BFalse, bi, ce) ->
14942 (((o#binding bi)#add_binding bi)#class_expr ce)#set_env
14944 | Ast.CeLet (_, Ast.BTrue, bi, ce) ->
14945 (((o#add_binding bi)#binding bi)#class_expr ce)#set_env
14947 | Ast.CeStr (_, p, cst) ->
14948 ((o#add_patt p)#class_str_item cst)#set_env env
14949 | ce -> super#class_expr ce
14951 method class_str_item =
14952 function
14953 | (Ast.CrInh (_, _, "") as cst) -> super#class_str_item cst
14954 | Ast.CrInh (_, ce, s) -> (o#class_expr ce)#add_atom s
14955 | Ast.CrVal (_, s, _, e) -> (o#expr e)#add_atom s
14956 | Ast.CrVvr (_, s, _, t) -> (o#ctyp t)#add_atom s
14957 | cst -> super#class_str_item cst
14959 method module_expr =
14960 function
14961 | Ast.MeStr (_, st) -> (o#str_item st)#set_env env
14962 | me -> super#module_expr me
14966 let free_vars env_init e =
14967 let fold = new fold_free_vars S.add ~env_init S.empty
14968 in (fold#expr e)#free
14974 module Grammar =
14975 struct
14976 module Context =
14977 struct
14978 module type S =
14980 module Token : Sig.Token
14982 open Token
14984 type t
14986 val call_with_ctx :
14987 (Token.t * Loc.t) Stream.t -> (t -> 'a) -> 'a
14989 val loc_bp : t -> Loc.t
14991 val loc_ep : t -> Loc.t
14993 val stream : t -> (Token.t * Loc.t) Stream.t
14995 val peek_nth : t -> int -> (Token.t * Loc.t) option
14997 val njunk : t -> int -> unit
14999 val junk : (Token.t * Loc.t) Stream.t -> unit
15001 val bp : (Token.t * Loc.t) Stream.t -> Loc.t
15005 module Make (Token : Sig.Token) : S with module Token = Token =
15006 struct
15007 module Token = Token
15009 open Token
15011 type t =
15012 { mutable strm : (Token.t * Loc.t) Stream.t;
15013 mutable loc : Loc.t
15016 let loc_bp c =
15017 match Stream.peek c.strm with
15018 | None -> Loc.ghost
15019 | Some ((_, loc)) -> loc
15021 let loc_ep c = c.loc
15023 let set_loc c =
15024 match Stream.peek c.strm with
15025 | Some ((_, loc)) -> c.loc <- loc
15026 | None -> ()
15028 let mk strm =
15029 match Stream.peek strm with
15030 | Some ((_, loc)) -> { strm = strm; loc = loc; }
15031 | None -> { strm = strm; loc = Loc.ghost; }
15033 let stream c = c.strm
15035 let peek_nth c n =
15036 let list = Stream.npeek n c.strm in
15037 let rec loop list n =
15038 match (list, n) with
15039 | ((((_, loc) as x)) :: _, 1) -> (c.loc <- loc; Some x)
15040 | (_ :: l, n) -> loop l (n - 1)
15041 | ([], _) -> None
15042 in loop list n
15044 let njunk c n =
15045 (for i = 1 to n do Stream.junk c.strm done; set_loc c)
15047 let streams = ref []
15049 let mk strm =
15050 let c = mk strm in
15051 let () = streams := (strm, c) :: !streams in c
15053 let junk strm =
15054 (set_loc (List.assq strm !streams); Stream.junk strm)
15056 let bp strm = loc_bp (List.assq strm !streams)
15058 let call_with_ctx strm f =
15059 let streams_v = !streams in
15060 let r =
15061 try f (mk strm)
15062 with | exc -> (streams := streams_v; raise exc)
15063 in (streams := streams_v; r)
15069 module Structure =
15070 struct
15071 open Sig.Grammar
15073 module type S =
15075 module Loc : Sig.Loc
15077 module Token : Sig.Token with module Loc = Loc
15079 module Lexer : Sig.Lexer with module Loc = Loc
15080 and module Token = Token
15082 module Context : Context.S with module Token = Token
15084 module Action : Sig.Grammar.Action
15086 type gram =
15087 { gfilter : Token.Filter.t;
15088 gkeywords : (string, int ref) Hashtbl.t;
15089 glexer :
15090 Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t;
15091 warning_verbose : bool ref; error_verbose : bool ref
15094 type efun =
15095 Context.t -> (Token.t * Loc.t) Stream.t -> Action.t
15097 type token_pattern = ((Token.t -> bool) * string)
15099 type internal_entry =
15100 { egram : gram; ename : string;
15101 mutable estart : int -> efun;
15102 mutable econtinue : int -> Loc.t -> Action.t -> efun;
15103 mutable edesc : desc
15105 and desc =
15106 | Dlevels of level list
15107 | Dparser of ((Token.t * Loc.t) Stream.t -> Action.t)
15108 and level =
15109 { assoc : assoc; lname : string option; lsuffix : tree;
15110 lprefix : tree
15112 and symbol =
15113 | Smeta of string * symbol list * Action.t
15114 | Snterm of internal_entry
15115 | Snterml of internal_entry * string
15116 | Slist0 of symbol
15117 | Slist0sep of symbol * symbol
15118 | Slist1 of symbol
15119 | Slist1sep of symbol * symbol
15120 | Sopt of symbol
15121 | Sself
15122 | Snext
15123 | Stoken of token_pattern
15124 | Skeyword of string
15125 | Stree of tree
15126 and tree =
15127 | Node of node
15128 | LocAct of Action.t * Action.t list
15129 | DeadEnd
15130 and node =
15131 { node : symbol; son : tree; brother : tree
15134 type production_rule = ((symbol list) * Action.t)
15136 type single_extend_statment =
15137 ((string option) * (assoc option) * (production_rule list))
15139 type extend_statment =
15140 ((position option) * (single_extend_statment list))
15142 type delete_statment = symbol list
15144 type ('a, 'b, 'c) fold =
15145 internal_entry ->
15146 symbol list -> ('a Stream.t -> 'b) -> 'a Stream.t -> 'c
15148 type ('a, 'b, 'c) foldsep =
15149 internal_entry ->
15150 symbol list ->
15151 ('a Stream.t -> 'b) ->
15152 ('a Stream.t -> unit) -> 'a Stream.t -> 'c
15154 val get_filter : gram -> Token.Filter.t
15156 val using : gram -> string -> unit
15158 val removing : gram -> string -> unit
15162 module Make (Lexer : Sig.Lexer) =
15163 struct
15164 module Loc = Lexer.Loc
15166 module Token = Lexer.Token
15168 module Action : Sig.Grammar.Action =
15169 struct
15170 type t = Obj.t
15172 let mk = Obj.repr
15174 let get = Obj.obj
15176 let getf = Obj.obj
15178 let getf2 = Obj.obj
15182 module Lexer = Lexer
15184 type gram =
15185 { gfilter : Token.Filter.t;
15186 gkeywords : (string, int ref) Hashtbl.t;
15187 glexer :
15188 Loc.t -> char Stream.t -> (Token.t * Loc.t) Stream.t;
15189 warning_verbose : bool ref; error_verbose : bool ref
15192 module Context = Context.Make(Token)
15194 type efun =
15195 Context.t -> (Token.t * Loc.t) Stream.t -> Action.t
15197 type token_pattern = ((Token.t -> bool) * string)
15199 type internal_entry =
15200 { egram : gram; ename : string;
15201 mutable estart : int -> efun;
15202 mutable econtinue : int -> Loc.t -> Action.t -> efun;
15203 mutable edesc : desc
15205 and desc =
15206 | Dlevels of level list
15207 | Dparser of ((Token.t * Loc.t) Stream.t -> Action.t)
15208 and level =
15209 { assoc : assoc; lname : string option; lsuffix : tree;
15210 lprefix : tree
15212 and symbol =
15213 | Smeta of string * symbol list * Action.t
15214 | Snterm of internal_entry
15215 | Snterml of internal_entry * string
15216 | Slist0 of symbol
15217 | Slist0sep of symbol * symbol
15218 | Slist1 of symbol
15219 | Slist1sep of symbol * symbol
15220 | Sopt of symbol
15221 | Sself
15222 | Snext
15223 | Stoken of token_pattern
15224 | Skeyword of string
15225 | Stree of tree
15226 and tree =
15227 | Node of node
15228 | LocAct of Action.t * Action.t list
15229 | DeadEnd
15230 and node =
15231 { node : symbol; son : tree; brother : tree
15234 type production_rule = ((symbol list) * Action.t)
15236 type single_extend_statment =
15237 ((string option) * (assoc option) * (production_rule list))
15239 type extend_statment =
15240 ((position option) * (single_extend_statment list))
15242 type delete_statment = symbol list
15244 type ('a, 'b, 'c) fold =
15245 internal_entry ->
15246 symbol list -> ('a Stream.t -> 'b) -> 'a Stream.t -> 'c
15248 type ('a, 'b, 'c) foldsep =
15249 internal_entry ->
15250 symbol list ->
15251 ('a Stream.t -> 'b) ->
15252 ('a Stream.t -> unit) -> 'a Stream.t -> 'c
15254 let get_filter g = g.gfilter
15256 type 'a not_filtered = 'a
15258 let using { gkeywords = table; gfilter = filter } kwd =
15259 let r =
15260 try Hashtbl.find table kwd
15261 with
15262 | Not_found ->
15263 let r = ref 0 in (Hashtbl.add table kwd r; r)
15264 in (Token.Filter.keyword_added filter kwd (!r = 0); incr r)
15266 let removing { gkeywords = table; gfilter = filter } kwd =
15267 let r = Hashtbl.find table kwd in
15268 let () = decr r
15270 if !r = 0
15271 then
15272 (Token.Filter.keyword_removed filter kwd;
15273 Hashtbl.remove table kwd)
15274 else ()
15280 module Search =
15281 struct
15282 module Make (Structure : Structure.S) =
15283 struct
15284 open Structure
15286 let tree_in_entry prev_symb tree =
15287 function
15288 | Dlevels levels ->
15289 let rec search_levels =
15290 (function
15291 | [] -> tree
15292 | level :: levels ->
15293 (match search_level level with
15294 | Some tree -> tree
15295 | None -> search_levels levels))
15296 and search_level level =
15297 (match search_tree level.lsuffix with
15298 | Some t ->
15299 Some
15300 (Node
15301 { node = Sself; son = t; brother = DeadEnd;
15303 | None -> search_tree level.lprefix)
15304 and search_tree t =
15305 if (tree <> DeadEnd) && (t == tree)
15306 then Some t
15307 else
15308 (match t with
15309 | Node n ->
15310 (match search_symbol n.node with
15311 | Some symb ->
15312 Some
15313 (Node
15315 node = symb;
15316 son = n.son;
15317 brother = DeadEnd;
15319 | None ->
15320 (match search_tree n.son with
15321 | Some t ->
15322 Some
15323 (Node
15325 node = n.node;
15326 son = t;
15327 brother = DeadEnd;
15329 | None -> search_tree n.brother))
15330 | LocAct (_, _) | DeadEnd -> None)
15331 and search_symbol symb =
15332 (match symb with
15333 | Snterm _ | Snterml (_, _) | Slist0 _ |
15334 Slist0sep (_, _) | Slist1 _ | Slist1sep (_, _) |
15335 Sopt _ | Stoken _ | Stree _ | Skeyword _ when
15336 symb == prev_symb -> Some symb
15337 | Slist0 symb ->
15338 (match search_symbol symb with
15339 | Some symb -> Some (Slist0 symb)
15340 | None -> None)
15341 | Slist0sep (symb, sep) ->
15342 (match search_symbol symb with
15343 | Some symb -> Some (Slist0sep (symb, sep))
15344 | None ->
15345 (match search_symbol sep with
15346 | Some sep -> Some (Slist0sep (symb, sep))
15347 | None -> None))
15348 | Slist1 symb ->
15349 (match search_symbol symb with
15350 | Some symb -> Some (Slist1 symb)
15351 | None -> None)
15352 | Slist1sep (symb, sep) ->
15353 (match search_symbol symb with
15354 | Some symb -> Some (Slist1sep (symb, sep))
15355 | None ->
15356 (match search_symbol sep with
15357 | Some sep -> Some (Slist1sep (symb, sep))
15358 | None -> None))
15359 | Sopt symb ->
15360 (match search_symbol symb with
15361 | Some symb -> Some (Sopt symb)
15362 | None -> None)
15363 | Stree t ->
15364 (match search_tree t with
15365 | Some t -> Some (Stree t)
15366 | None -> None)
15367 | _ -> None)
15368 in search_levels levels
15369 | Dparser _ -> tree
15375 module Tools =
15376 struct
15377 module Make (Structure : Structure.S) =
15378 struct
15379 open Structure
15381 let empty_entry ename _ _ _ =
15382 raise (Stream.Error ("entry [" ^ (ename ^ "] is empty")))
15384 let is_level_labelled n lev =
15385 match lev.lname with | Some n1 -> n = n1 | None -> false
15387 let warning_verbose = ref true
15389 let rec get_token_list entry tokl last_tok tree =
15390 match tree with
15391 | Node
15393 node = (Stoken _ | Skeyword _ as tok);
15394 son = son;
15395 brother = DeadEnd
15396 } -> get_token_list entry (last_tok :: tokl) tok son
15397 | _ ->
15398 if tokl = []
15399 then None
15400 else
15401 Some
15402 (((List.rev (last_tok :: tokl)), last_tok, tree))
15404 let is_antiquot s =
15405 let len = String.length s in (len > 1) && (s.[0] = '$')
15407 let eq_Stoken_ids s1 s2 =
15408 (not (is_antiquot s1)) &&
15409 ((not (is_antiquot s2)) && (s1 = s2))
15411 let logically_eq_symbols entry =
15412 let rec eq_symbols s1 s2 =
15413 match (s1, s2) with
15414 | (Snterm e1, Snterm e2) -> e1.ename = e2.ename
15415 | (Snterm e1, Sself) -> e1.ename = entry.ename
15416 | (Sself, Snterm e2) -> entry.ename = e2.ename
15417 | (Snterml (e1, l1), Snterml (e2, l2)) ->
15418 (e1.ename = e2.ename) && (l1 = l2)
15419 | (Slist0 s1, Slist0 s2) -> eq_symbols s1 s2
15420 | (Slist0sep (s1, sep1), Slist0sep (s2, sep2)) ->
15421 (eq_symbols s1 s2) && (eq_symbols sep1 sep2)
15422 | (Slist1 s1, Slist1 s2) -> eq_symbols s1 s2
15423 | (Slist1sep (s1, sep1), Slist1sep (s2, sep2)) ->
15424 (eq_symbols s1 s2) && (eq_symbols sep1 sep2)
15425 | (Sopt s1, Sopt s2) -> eq_symbols s1 s2
15426 | (Stree t1, Stree t2) -> eq_trees t1 t2
15427 | (Stoken ((_, s1)), Stoken ((_, s2))) ->
15428 eq_Stoken_ids s1 s2
15429 | _ -> s1 = s2
15430 and eq_trees t1 t2 =
15431 match (t1, t2) with
15432 | (Node n1, Node n2) ->
15433 (eq_symbols n1.node n2.node) &&
15434 ((eq_trees n1.son n2.son) &&
15435 (eq_trees n1.brother n2.brother))
15436 | ((LocAct (_, _) | DeadEnd), (LocAct (_, _) | DeadEnd))
15437 -> true
15438 | _ -> false
15439 in eq_symbols
15441 let rec eq_symbol s1 s2 =
15442 match (s1, s2) with
15443 | (Snterm e1, Snterm e2) -> e1 == e2
15444 | (Snterml (e1, l1), Snterml (e2, l2)) ->
15445 (e1 == e2) && (l1 = l2)
15446 | (Slist0 s1, Slist0 s2) -> eq_symbol s1 s2
15447 | (Slist0sep (s1, sep1), Slist0sep (s2, sep2)) ->
15448 (eq_symbol s1 s2) && (eq_symbol sep1 sep2)
15449 | (Slist1 s1, Slist1 s2) -> eq_symbol s1 s2
15450 | (Slist1sep (s1, sep1), Slist1sep (s2, sep2)) ->
15451 (eq_symbol s1 s2) && (eq_symbol sep1 sep2)
15452 | (Sopt s1, Sopt s2) -> eq_symbol s1 s2
15453 | (Stree _, Stree _) -> false
15454 | (Stoken ((_, s1)), Stoken ((_, s2))) ->
15455 eq_Stoken_ids s1 s2
15456 | _ -> s1 = s2
15462 module Print :
15464 module Make (Structure : Structure.S) :
15466 val flatten_tree :
15467 Structure.tree -> (Structure.symbol list) list
15469 val print_symbol :
15470 Format.formatter -> Structure.symbol -> unit
15472 val print_meta :
15473 Format.formatter -> string -> Structure.symbol list -> unit
15475 val print_symbol1 :
15476 Format.formatter -> Structure.symbol -> unit
15478 val print_rule :
15479 Format.formatter -> Structure.symbol list -> unit
15481 val print_level :
15482 Format.formatter ->
15483 (Format.formatter -> unit -> unit) ->
15484 (Structure.symbol list) list -> unit
15486 val levels : Format.formatter -> Structure.level list -> unit
15488 val entry :
15489 Format.formatter -> Structure.internal_entry -> unit
15493 module MakeDump (Structure : Structure.S) :
15495 val print_symbol :
15496 Format.formatter -> Structure.symbol -> unit
15498 val print_meta :
15499 Format.formatter -> string -> Structure.symbol list -> unit
15501 val print_symbol1 :
15502 Format.formatter -> Structure.symbol -> unit
15504 val print_rule :
15505 Format.formatter -> Structure.symbol list -> unit
15507 val print_level :
15508 Format.formatter ->
15509 (Format.formatter -> unit -> unit) ->
15510 (Structure.symbol list) list -> unit
15512 val levels : Format.formatter -> Structure.level list -> unit
15514 val entry :
15515 Format.formatter -> Structure.internal_entry -> unit
15519 end =
15520 struct
15521 module Make (Structure : Structure.S) =
15522 struct
15523 open Structure
15525 open Format
15527 open Sig.Grammar
15529 let rec flatten_tree =
15530 function
15531 | DeadEnd -> []
15532 | LocAct (_, _) -> [ [] ]
15533 | Node { node = n; brother = b; son = s } ->
15534 (List.map (fun l -> n :: l) (flatten_tree s)) @
15535 (flatten_tree b)
15537 let rec print_symbol ppf =
15538 function
15539 | Smeta (n, sl, _) -> print_meta ppf n sl
15540 | Slist0 s -> fprintf ppf "LIST0 %a" print_symbol1 s
15541 | Slist0sep (s, t) ->
15542 fprintf ppf "LIST0 %a SEP %a" print_symbol1 s
15543 print_symbol1 t
15544 | Slist1 s -> fprintf ppf "LIST1 %a" print_symbol1 s
15545 | Slist1sep (s, t) ->
15546 fprintf ppf "LIST1 %a SEP %a" print_symbol1 s
15547 print_symbol1 t
15548 | Sopt s -> fprintf ppf "OPT %a" print_symbol1 s
15549 | Snterml (e, l) -> fprintf ppf "%s@ LEVEL@ %S" e.ename l
15550 | (Snterm _ | Snext | Sself | Stree _ | Stoken _ |
15551 Skeyword _
15552 as s) -> print_symbol1 ppf s
15553 and print_meta ppf n sl =
15554 let rec loop i =
15555 function
15556 | [] -> ()
15557 | s :: sl ->
15558 let j =
15559 (try String.index_from n i ' '
15560 with | Not_found -> String.length n)
15562 (fprintf ppf "%s %a" (String.sub n i (j - i))
15563 print_symbol1 s;
15564 if sl = []
15565 then ()
15566 else
15567 (fprintf ppf " ";
15568 loop (min (j + 1) (String.length n)) sl))
15569 in loop 0 sl
15570 and print_symbol1 ppf =
15571 function
15572 | Snterm e -> pp_print_string ppf e.ename
15573 | Sself -> pp_print_string ppf "SELF"
15574 | Snext -> pp_print_string ppf "NEXT"
15575 | Stoken ((_, descr)) -> pp_print_string ppf descr
15576 | Skeyword s -> fprintf ppf "%S" s
15577 | Stree t ->
15578 print_level ppf pp_print_space (flatten_tree t)
15579 | (Smeta (_, _, _) | Snterml (_, _) | Slist0 _ |
15580 Slist0sep (_, _) | Slist1 _ | Slist1sep (_, _) |
15581 Sopt _
15582 as s) -> fprintf ppf "(%a)" print_symbol s
15583 and print_rule ppf symbols =
15584 (fprintf ppf "@[<hov 0>";
15585 let _ =
15586 List.fold_left
15587 (fun sep symbol ->
15588 (fprintf ppf "%t%a" sep print_symbol symbol;
15589 fun ppf -> fprintf ppf ";@ "))
15590 (fun _ -> ()) symbols
15591 in fprintf ppf "@]")
15592 and print_level ppf pp_print_space rules =
15593 (fprintf ppf "@[<hov 0>[ ";
15594 let _ =
15595 List.fold_left
15596 (fun sep rule ->
15597 (fprintf ppf "%t%a" sep print_rule rule;
15598 fun ppf -> fprintf ppf "%a| " pp_print_space ()))
15599 (fun _ -> ()) rules
15600 in fprintf ppf " ]@]")
15602 let levels ppf elev =
15603 let _ =
15604 List.fold_left
15605 (fun sep lev ->
15606 let rules =
15607 (List.map (fun t -> Sself :: t)
15608 (flatten_tree lev.lsuffix))
15609 @ (flatten_tree lev.lprefix)
15611 (fprintf ppf "%t@[<hov 2>" sep;
15612 (match lev.lname with
15613 | Some n -> fprintf ppf "%S@;<1 2>" n
15614 | None -> ());
15615 (match lev.assoc with
15616 | LeftA -> fprintf ppf "LEFTA"
15617 | RightA -> fprintf ppf "RIGHTA"
15618 | NonA -> fprintf ppf "NONA");
15619 fprintf ppf "@]@;<1 2>";
15620 print_level ppf pp_force_newline rules;
15621 fun ppf -> fprintf ppf "@,| "))
15622 (fun _ -> ()) elev
15623 in ()
15625 let entry ppf e =
15626 (fprintf ppf "@[<v 0>%s: [ " e.ename;
15627 (match e.edesc with
15628 | Dlevels elev -> levels ppf elev
15629 | Dparser _ -> fprintf ppf "<parser>");
15630 fprintf ppf " ]@]")
15634 module MakeDump (Structure : Structure.S) =
15635 struct
15636 open Structure
15638 open Format
15640 open Sig.Grammar
15642 type brothers = | Bro of symbol * brothers list
15644 let rec print_tree ppf tree =
15645 let rec get_brothers acc =
15646 function
15647 | DeadEnd -> List.rev acc
15648 | LocAct (_, _) -> List.rev acc
15649 | Node { node = n; brother = b; son = s } ->
15650 get_brothers ((Bro (n, get_brothers [] s)) :: acc) b
15651 and print_brothers ppf brothers =
15652 if brothers = []
15653 then fprintf ppf "@ []"
15654 else
15655 List.iter
15656 (function
15657 | Bro (n, xs) ->
15658 (fprintf ppf "@ @[<hv2>- %a" print_symbol n;
15659 (match xs with
15660 | [] -> ()
15661 | [ _ ] ->
15662 (try
15663 print_children ppf (get_children [] xs)
15664 with
15665 | Exit ->
15666 fprintf ppf ":%a" print_brothers xs)
15667 | _ -> fprintf ppf ":%a" print_brothers xs);
15668 fprintf ppf "@]"))
15669 brothers
15670 and print_children ppf =
15671 List.iter (fprintf ppf ";@ %a" print_symbol)
15672 and get_children acc =
15673 function
15674 | [] -> List.rev acc
15675 | [ Bro (n, x) ] -> get_children (n :: acc) x
15676 | _ -> raise Exit
15677 in print_brothers ppf (get_brothers [] tree)
15678 and print_symbol ppf =
15679 function
15680 | Smeta (n, sl, _) -> print_meta ppf n sl
15681 | Slist0 s -> fprintf ppf "LIST0 %a" print_symbol1 s
15682 | Slist0sep (s, t) ->
15683 fprintf ppf "LIST0 %a SEP %a" print_symbol1 s
15684 print_symbol1 t
15685 | Slist1 s -> fprintf ppf "LIST1 %a" print_symbol1 s
15686 | Slist1sep (s, t) ->
15687 fprintf ppf "LIST1 %a SEP %a" print_symbol1 s
15688 print_symbol1 t
15689 | Sopt s -> fprintf ppf "OPT %a" print_symbol1 s
15690 | Snterml (e, l) -> fprintf ppf "%s@ LEVEL@ %S" e.ename l
15691 | (Snterm _ | Snext | Sself | Stree _ | Stoken _ |
15692 Skeyword _
15693 as s) -> print_symbol1 ppf s
15694 and print_meta ppf n sl =
15695 let rec loop i =
15696 function
15697 | [] -> ()
15698 | s :: sl ->
15699 let j =
15700 (try String.index_from n i ' '
15701 with | Not_found -> String.length n)
15703 (fprintf ppf "%s %a" (String.sub n i (j - i))
15704 print_symbol1 s;
15705 if sl = []
15706 then ()
15707 else
15708 (fprintf ppf " ";
15709 loop (min (j + 1) (String.length n)) sl))
15710 in loop 0 sl
15711 and print_symbol1 ppf =
15712 function
15713 | Snterm e -> pp_print_string ppf e.ename
15714 | Sself -> pp_print_string ppf "SELF"
15715 | Snext -> pp_print_string ppf "NEXT"
15716 | Stoken ((_, descr)) -> pp_print_string ppf descr
15717 | Skeyword s -> fprintf ppf "%S" s
15718 | Stree t -> print_tree ppf t
15719 | (Smeta (_, _, _) | Snterml (_, _) | Slist0 _ |
15720 Slist0sep (_, _) | Slist1 _ | Slist1sep (_, _) |
15721 Sopt _
15722 as s) -> fprintf ppf "(%a)" print_symbol s
15723 and print_rule ppf symbols =
15724 (fprintf ppf "@[<hov 0>";
15725 let _ =
15726 List.fold_left
15727 (fun sep symbol ->
15728 (fprintf ppf "%t%a" sep print_symbol symbol;
15729 fun ppf -> fprintf ppf ";@ "))
15730 (fun _ -> ()) symbols
15731 in fprintf ppf "@]")
15732 and print_level ppf pp_print_space rules =
15733 (fprintf ppf "@[<hov 0>[ ";
15734 let _ =
15735 List.fold_left
15736 (fun sep rule ->
15737 (fprintf ppf "%t%a" sep print_rule rule;
15738 fun ppf -> fprintf ppf "%a| " pp_print_space ()))
15739 (fun _ -> ()) rules
15740 in fprintf ppf " ]@]")
15742 let levels ppf elev =
15743 let _ =
15744 List.fold_left
15745 (fun sep lev ->
15746 (fprintf ppf "%t@[<v2>" sep;
15747 (match lev.lname with
15748 | Some n -> fprintf ppf "%S@;<1 2>" n
15749 | None -> ());
15750 (match lev.assoc with
15751 | LeftA -> fprintf ppf "LEFTA"
15752 | RightA -> fprintf ppf "RIGHTA"
15753 | NonA -> fprintf ppf "NONA");
15754 fprintf ppf "@]@;<1 2>";
15755 fprintf ppf "@[<v2>suffix:@ ";
15756 print_tree ppf lev.lsuffix;
15757 fprintf ppf "@]@ @[<v2>prefix:@ ";
15758 print_tree ppf lev.lprefix;
15759 fprintf ppf "@]";
15760 fun ppf -> fprintf ppf "@,| "))
15761 (fun _ -> ()) elev
15762 in ()
15764 let entry ppf e =
15765 (fprintf ppf "@[<v 0>%s: [ " e.ename;
15766 (match e.edesc with
15767 | Dlevels elev -> levels ppf elev
15768 | Dparser _ -> fprintf ppf "<parser>");
15769 fprintf ppf " ]@]")
15775 module Failed =
15776 struct
15777 module Make (Structure : Structure.S) =
15778 struct
15779 module Tools = Tools.Make(Structure)
15781 module Search = Search.Make(Structure)
15783 module Print = Print.Make(Structure)
15785 open Structure
15787 open Format
15789 let rec name_of_symbol entry =
15790 function
15791 | Snterm e -> "[" ^ (e.ename ^ "]")
15792 | Snterml (e, l) ->
15793 "[" ^ (e.ename ^ (" level " ^ (l ^ "]")))
15794 | Sself | Snext -> "[" ^ (entry.ename ^ "]")
15795 | Stoken ((_, descr)) -> descr
15796 | Skeyword kwd -> "\"" ^ (kwd ^ "\"")
15797 | _ -> "???"
15799 let rec name_of_symbol_failed entry =
15800 function
15801 | Slist0 s -> name_of_symbol_failed entry s
15802 | Slist0sep (s, _) -> name_of_symbol_failed entry s
15803 | Slist1 s -> name_of_symbol_failed entry s
15804 | Slist1sep (s, _) -> name_of_symbol_failed entry s
15805 | Sopt s -> name_of_symbol_failed entry s
15806 | Stree t -> name_of_tree_failed entry t
15807 | s -> name_of_symbol entry s
15808 and name_of_tree_failed entry =
15809 function
15810 | Node { node = s; brother = bro; son = son } ->
15811 let tokl =
15812 (match s with
15813 | Stoken _ | Skeyword _ ->
15814 Tools.get_token_list entry [] s son
15815 | _ -> None)
15817 (match tokl with
15818 | None ->
15819 let txt = name_of_symbol_failed entry s in
15820 let txt =
15821 (match (s, son) with
15822 | (Sopt _, Node _) ->
15823 txt ^
15824 (" or " ^
15825 (name_of_tree_failed entry son))
15826 | _ -> txt) in
15827 let txt =
15828 (match bro with
15829 | DeadEnd | LocAct (_, _) -> txt
15830 | Node _ ->
15831 txt ^
15832 (" or " ^
15833 (name_of_tree_failed entry bro)))
15834 in txt
15835 | Some ((tokl, _, _)) ->
15836 List.fold_left
15837 (fun s tok ->
15838 (if s = "" then "" else s ^ " then ") ^
15839 (match tok with
15840 | Stoken ((_, descr)) -> descr
15841 | Skeyword kwd -> kwd
15842 | _ -> assert false))
15843 "" tokl)
15844 | DeadEnd | LocAct (_, _) -> "???"
15846 let magic _s x = Obj.magic x
15848 let tree_failed entry prev_symb_result prev_symb tree =
15849 let txt = name_of_tree_failed entry tree in
15850 let txt =
15851 match prev_symb with
15852 | Slist0 s ->
15853 let txt1 = name_of_symbol_failed entry s
15854 in txt1 ^ (" or " ^ (txt ^ " expected"))
15855 | Slist1 s ->
15856 let txt1 = name_of_symbol_failed entry s
15857 in txt1 ^ (" or " ^ (txt ^ " expected"))
15858 | Slist0sep (s, sep) ->
15859 (match magic "tree_failed: 'a -> list 'b"
15860 prev_symb_result
15861 with
15862 | [] ->
15863 let txt1 = name_of_symbol_failed entry s
15864 in txt1 ^ (" or " ^ (txt ^ " expected"))
15865 | _ ->
15866 let txt1 = name_of_symbol_failed entry sep
15867 in txt1 ^ (" or " ^ (txt ^ " expected")))
15868 | Slist1sep (s, sep) ->
15869 (match magic "tree_failed: 'a -> list 'b"
15870 prev_symb_result
15871 with
15872 | [] ->
15873 let txt1 = name_of_symbol_failed entry s
15874 in txt1 ^ (" or " ^ (txt ^ " expected"))
15875 | _ ->
15876 let txt1 = name_of_symbol_failed entry sep
15877 in txt1 ^ (" or " ^ (txt ^ " expected")))
15878 | Sopt _ | Stree _ -> txt ^ " expected"
15879 | _ ->
15880 txt ^
15881 (" expected after " ^
15882 (name_of_symbol entry prev_symb))
15884 (if !(entry.egram.error_verbose)
15885 then
15886 (let tree =
15887 Search.tree_in_entry prev_symb tree entry.edesc in
15888 let ppf = err_formatter
15890 (fprintf ppf "@[<v 0>@,";
15891 fprintf ppf "----------------------------------@,";
15892 fprintf ppf
15893 "Parse error in entry [%s], rule:@;<0 2>"
15894 entry.ename;
15895 fprintf ppf "@[";
15896 Print.print_level ppf pp_force_newline
15897 (Print.flatten_tree tree);
15898 fprintf ppf "@]@,";
15899 fprintf ppf "----------------------------------@,";
15900 fprintf ppf "@]@."))
15901 else ();
15902 txt ^ (" (in [" ^ (entry.ename ^ "])")))
15904 let symb_failed entry prev_symb_result prev_symb symb =
15905 let tree =
15906 Node { node = symb; brother = DeadEnd; son = DeadEnd; }
15907 in tree_failed entry prev_symb_result prev_symb tree
15909 let symb_failed_txt e s1 s2 = symb_failed e 0 s1 s2
15915 module Parser =
15916 struct
15917 module Make (Structure : Structure.S) =
15918 struct
15919 module Tools = Tools.Make(Structure)
15921 module Failed = Failed.Make(Structure)
15923 module Print = Print.Make(Structure)
15925 open Structure
15927 open Sig.Grammar
15929 module Stream =
15930 struct
15931 include Stream
15933 let junk strm = Context.junk strm
15935 let count strm = Context.bp strm
15939 let add_loc c bp parse_fun strm =
15940 let x = parse_fun c strm in
15941 let ep = Context.loc_ep c in
15942 let loc = Loc.merge bp ep in (x, loc)
15944 let level_number entry lab =
15945 let rec lookup levn =
15946 function
15947 | [] -> failwith ("unknown level " ^ lab)
15948 | lev :: levs ->
15949 if Tools.is_level_labelled lab lev
15950 then levn
15951 else lookup (succ levn) levs
15953 match entry.edesc with
15954 | Dlevels elev -> lookup 0 elev
15955 | Dparser _ -> raise Not_found
15957 let strict_parsing = ref false
15959 let strict_parsing_warning = ref false
15961 let rec top_symb entry =
15962 function
15963 | Sself | Snext -> Snterm entry
15964 | Snterml (e, _) -> Snterm e
15965 | Slist1sep (s, sep) -> Slist1sep (top_symb entry s, sep)
15966 | _ -> raise Stream.Failure
15968 let top_tree entry =
15969 function
15970 | Node { node = s; brother = bro; son = son } ->
15971 Node
15972 { node = top_symb entry s; brother = bro; son = son;
15974 | LocAct (_, _) | DeadEnd -> raise Stream.Failure
15976 let entry_of_symb entry =
15977 function
15978 | Sself | Snext -> entry
15979 | Snterm e -> e
15980 | Snterml (e, _) -> e
15981 | _ -> raise Stream.Failure
15983 let continue entry loc a s c son p1 (__strm : _ Stream.t) =
15984 let a =
15985 (entry_of_symb entry s).econtinue 0 loc a c __strm in
15986 let act =
15987 try p1 __strm
15988 with
15989 | Stream.Failure ->
15990 raise
15991 (Stream.Error (Failed.tree_failed entry a s son))
15992 in Action.mk (fun _ -> Action.getf act a)
15994 let skip_if_empty c bp p strm =
15995 if (Context.loc_ep c) == bp
15996 then Action.mk (fun _ -> p strm)
15997 else raise Stream.Failure
15999 let do_recover parser_of_tree entry nlevn alevn loc a s c son
16000 (__strm : _ Stream.t) =
16002 parser_of_tree entry nlevn alevn (top_tree entry son) c
16003 __strm
16004 with
16005 | Stream.Failure ->
16006 (try
16007 skip_if_empty c loc
16008 (fun (__strm : _ Stream.t) -> raise Stream.Failure)
16009 __strm
16010 with
16011 | Stream.Failure ->
16012 continue entry loc a s c son
16013 (parser_of_tree entry nlevn alevn son c) __strm)
16015 let recover parser_of_tree entry nlevn alevn loc a s c son
16016 strm =
16017 if !strict_parsing
16018 then
16019 raise (Stream.Error (Failed.tree_failed entry a s son))
16020 else
16021 (let _ =
16022 if !strict_parsing_warning
16023 then
16024 (let msg = Failed.tree_failed entry a s son
16026 (Format.eprintf
16027 "Warning: trying to recover from syntax error";
16028 if entry.ename <> ""
16029 then Format.eprintf " in [%s]" entry.ename
16030 else ();
16031 Format.eprintf "\n%s%a@." msg Loc.print loc))
16032 else ()
16034 do_recover parser_of_tree entry nlevn alevn loc a s c
16035 son strm)
16037 let rec parser_of_tree entry nlevn alevn =
16038 function
16039 | DeadEnd ->
16040 (fun _ (__strm : _ Stream.t) -> raise Stream.Failure)
16041 | LocAct (act, _) -> (fun _ (__strm : _ Stream.t) -> act)
16042 | Node
16044 node = Sself;
16045 son = LocAct (act, _);
16046 brother = DeadEnd
16047 } ->
16048 (fun c (__strm : _ Stream.t) ->
16049 let a = entry.estart alevn c __strm
16050 in Action.getf act a)
16051 | Node { node = Sself; son = LocAct (act, _); brother = bro
16052 } ->
16053 let p2 = parser_of_tree entry nlevn alevn bro
16055 (fun c (__strm : _ Stream.t) ->
16056 match try Some (entry.estart alevn c __strm)
16057 with | Stream.Failure -> None
16058 with
16059 | Some a -> Action.getf act a
16060 | _ -> p2 c __strm)
16061 | Node { node = s; son = son; brother = DeadEnd } ->
16062 let tokl =
16063 (match s with
16064 | Stoken _ | Skeyword _ ->
16065 Tools.get_token_list entry [] s son
16066 | _ -> None)
16068 (match tokl with
16069 | None ->
16070 let ps = parser_of_symbol entry nlevn s in
16071 let p1 = parser_of_tree entry nlevn alevn son in
16072 let p1 = parser_cont p1 entry nlevn alevn s son
16074 (fun c (__strm : _ Stream.t) ->
16075 let bp = Stream.count __strm in
16076 let a = ps c __strm in
16077 let act =
16078 try p1 c bp a __strm
16079 with
16080 | Stream.Failure ->
16081 raise (Stream.Error "")
16082 in Action.getf act a)
16083 | Some ((tokl, last_tok, son)) ->
16084 let p1 = parser_of_tree entry nlevn alevn son in
16085 let p1 =
16086 parser_cont p1 entry nlevn alevn last_tok son
16087 in parser_of_token_list p1 tokl)
16088 | Node { node = s; son = son; brother = bro } ->
16089 let tokl =
16090 (match s with
16091 | Stoken _ | Skeyword _ ->
16092 Tools.get_token_list entry [] s son
16093 | _ -> None)
16095 (match tokl with
16096 | None ->
16097 let ps = parser_of_symbol entry nlevn s in
16098 let p1 = parser_of_tree entry nlevn alevn son in
16099 let p1 =
16100 parser_cont p1 entry nlevn alevn s son in
16101 let p2 = parser_of_tree entry nlevn alevn bro
16103 (fun c (__strm : _ Stream.t) ->
16104 let bp = Stream.count __strm
16106 match try Some (ps c __strm)
16107 with | Stream.Failure -> None
16108 with
16109 | Some a ->
16110 let act =
16111 (try p1 c bp a __strm
16112 with
16113 | Stream.Failure ->
16114 raise (Stream.Error ""))
16115 in Action.getf act a
16116 | _ -> p2 c __strm)
16117 | Some ((tokl, last_tok, son)) ->
16118 let p1 = parser_of_tree entry nlevn alevn son in
16119 let p1 =
16120 parser_cont p1 entry nlevn alevn last_tok son in
16121 let p1 = parser_of_token_list p1 tokl in
16122 let p2 = parser_of_tree entry nlevn alevn bro
16124 (fun c (__strm : _ Stream.t) ->
16125 try p1 c __strm
16126 with | Stream.Failure -> p2 c __strm))
16128 parser_cont p1 entry nlevn alevn s son c loc a
16129 (__strm : _ Stream.t) =
16130 try p1 c __strm
16131 with
16132 | Stream.Failure ->
16133 (try
16134 recover parser_of_tree entry nlevn alevn loc a s c
16135 son __strm
16136 with
16137 | Stream.Failure ->
16138 raise
16139 (Stream.Error (Failed.tree_failed entry a s son)))
16140 and parser_of_token_list p1 tokl =
16141 let rec loop n =
16142 function
16143 | Stoken ((tematch, _)) :: tokl ->
16144 (match tokl with
16145 | [] ->
16146 let ps c _ =
16147 (match Context.peek_nth c n with
16148 | Some ((tok, _)) when tematch tok ->
16149 (Context.njunk c n; Action.mk tok)
16150 | _ -> raise Stream.Failure)
16152 (fun c (__strm : _ Stream.t) ->
16153 let bp = Stream.count __strm in
16154 let a = ps c __strm in
16155 let act =
16156 try p1 c bp a __strm
16157 with
16158 | Stream.Failure ->
16159 raise (Stream.Error "")
16160 in Action.getf act a)
16161 | _ ->
16162 let ps c _ =
16163 (match Context.peek_nth c n with
16164 | Some ((tok, _)) when tematch tok -> tok
16165 | _ -> raise Stream.Failure) in
16166 let p1 = loop (n + 1) tokl
16168 (fun c (__strm : _ Stream.t) ->
16169 let tok = ps c __strm in
16170 let s = __strm in
16171 let act = p1 c s in Action.getf act tok))
16172 | Skeyword kwd :: tokl ->
16173 (match tokl with
16174 | [] ->
16175 let ps c _ =
16176 (match Context.peek_nth c n with
16177 | Some ((tok, _)) when
16178 Token.match_keyword kwd tok ->
16179 (Context.njunk c n; Action.mk tok)
16180 | _ -> raise Stream.Failure)
16182 (fun c (__strm : _ Stream.t) ->
16183 let bp = Stream.count __strm in
16184 let a = ps c __strm in
16185 let act =
16186 try p1 c bp a __strm
16187 with
16188 | Stream.Failure ->
16189 raise (Stream.Error "")
16190 in Action.getf act a)
16191 | _ ->
16192 let ps c _ =
16193 (match Context.peek_nth c n with
16194 | Some ((tok, _)) when
16195 Token.match_keyword kwd tok -> tok
16196 | _ -> raise Stream.Failure) in
16197 let p1 = loop (n + 1) tokl
16199 (fun c (__strm : _ Stream.t) ->
16200 let tok = ps c __strm in
16201 let s = __strm in
16202 let act = p1 c s in Action.getf act tok))
16203 | _ -> invalid_arg "parser_of_token_list"
16204 in loop 1 tokl
16205 and parser_of_symbol entry nlevn =
16206 function
16207 | Smeta (_, symbl, act) ->
16208 let act = Obj.magic act entry symbl in
16209 let pl = List.map (parser_of_symbol entry nlevn) symbl
16211 (fun c ->
16212 Obj.magic
16213 (List.fold_left
16214 (fun act p -> Obj.magic act (p c)) act pl))
16215 | Slist0 s ->
16216 let ps = parser_of_symbol entry nlevn s in
16217 let rec loop c al (__strm : _ Stream.t) =
16218 (match try Some (ps c __strm)
16219 with | Stream.Failure -> None
16220 with
16221 | Some a -> loop c (a :: al) __strm
16222 | _ -> al)
16224 (fun c (__strm : _ Stream.t) ->
16225 let a = loop c [] __strm in Action.mk (List.rev a))
16226 | Slist0sep (symb, sep) ->
16227 let ps = parser_of_symbol entry nlevn symb in
16228 let pt = parser_of_symbol entry nlevn sep in
16229 let rec kont c al (__strm : _ Stream.t) =
16230 (match try Some (pt c __strm)
16231 with | Stream.Failure -> None
16232 with
16233 | Some v ->
16234 let a =
16235 (try ps c __strm
16236 with
16237 | Stream.Failure ->
16238 raise
16239 (Stream.Error
16240 (Failed.symb_failed entry v sep symb)))
16241 in kont c (a :: al) __strm
16242 | _ -> al)
16244 (fun c (__strm : _ Stream.t) ->
16245 match try Some (ps c __strm)
16246 with | Stream.Failure -> None
16247 with
16248 | Some a ->
16249 let s = __strm
16250 in Action.mk (List.rev (kont c [ a ] s))
16251 | _ -> Action.mk [])
16252 | Slist1 s ->
16253 let ps = parser_of_symbol entry nlevn s in
16254 let rec loop c al (__strm : _ Stream.t) =
16255 (match try Some (ps c __strm)
16256 with | Stream.Failure -> None
16257 with
16258 | Some a -> loop c (a :: al) __strm
16259 | _ -> al)
16261 (fun c (__strm : _ Stream.t) ->
16262 let a = ps c __strm in
16263 let s = __strm
16264 in Action.mk (List.rev (loop c [ a ] s)))
16265 | Slist1sep (symb, sep) ->
16266 let ps = parser_of_symbol entry nlevn symb in
16267 let pt = parser_of_symbol entry nlevn sep in
16268 let rec kont c al (__strm : _ Stream.t) =
16269 (match try Some (pt c __strm)
16270 with | Stream.Failure -> None
16271 with
16272 | Some v ->
16273 let a =
16274 (try ps c __strm
16275 with
16276 | Stream.Failure ->
16277 (try parse_top_symb' entry symb c __strm
16278 with
16279 | Stream.Failure ->
16280 raise
16281 (Stream.Error
16282 (Failed.symb_failed entry v sep
16283 symb))))
16284 in kont c (a :: al) __strm
16285 | _ -> al)
16287 (fun c (__strm : _ Stream.t) ->
16288 let a = ps c __strm in
16289 let s = __strm
16290 in Action.mk (List.rev (kont c [ a ] s)))
16291 | Sopt s ->
16292 let ps = parser_of_symbol entry nlevn s
16294 (fun c (__strm : _ Stream.t) ->
16295 match try Some (ps c __strm)
16296 with | Stream.Failure -> None
16297 with
16298 | Some a -> Action.mk (Some a)
16299 | _ -> Action.mk None)
16300 | Stree t ->
16301 let pt = parser_of_tree entry 1 0 t
16303 (fun c (__strm : _ Stream.t) ->
16304 let bp = Stream.count __strm in
16305 let (act, loc) = add_loc c bp pt __strm
16306 in Action.getf act loc)
16307 | Snterm e ->
16308 (fun c (__strm : _ Stream.t) -> e.estart 0 c __strm)
16309 | Snterml (e, l) ->
16310 (fun c (__strm : _ Stream.t) ->
16311 e.estart (level_number e l) c __strm)
16312 | Sself ->
16313 (fun c (__strm : _ Stream.t) -> entry.estart 0 c __strm)
16314 | Snext ->
16315 (fun c (__strm : _ Stream.t) ->
16316 entry.estart nlevn c __strm)
16317 | Skeyword kwd ->
16318 (fun _ (__strm : _ Stream.t) ->
16319 match Stream.peek __strm with
16320 | Some ((tok, _)) when Token.match_keyword kwd tok
16321 -> (Stream.junk __strm; Action.mk tok)
16322 | _ -> raise Stream.Failure)
16323 | Stoken ((f, _)) ->
16324 (fun _ (__strm : _ Stream.t) ->
16325 match Stream.peek __strm with
16326 | Some ((tok, _)) when f tok ->
16327 (Stream.junk __strm; Action.mk tok)
16328 | _ -> raise Stream.Failure)
16329 and parse_top_symb' entry symb c =
16330 parser_of_symbol entry 0 (top_symb entry symb) c
16331 and parse_top_symb entry symb strm =
16332 Context.call_with_ctx strm
16333 (fun c -> parse_top_symb' entry symb c (Context.stream c))
16335 let rec start_parser_of_levels entry clevn =
16336 function
16337 | [] ->
16338 (fun _ _ (__strm : _ Stream.t) -> raise Stream.Failure)
16339 | lev :: levs ->
16340 let p1 = start_parser_of_levels entry (succ clevn) levs
16342 (match lev.lprefix with
16343 | DeadEnd -> p1
16344 | tree ->
16345 let alevn =
16346 (match lev.assoc with
16347 | LeftA | NonA -> succ clevn
16348 | RightA -> clevn) in
16349 let p2 =
16350 parser_of_tree entry (succ clevn) alevn tree
16352 (match levs with
16353 | [] ->
16354 (fun levn c (__strm : _ Stream.t) ->
16355 let bp = Stream.count __strm in
16356 let (act, loc) =
16357 add_loc c bp p2 __strm in
16358 let strm = __strm in
16359 let a = Action.getf act loc
16360 in entry.econtinue levn loc a c strm)
16361 | _ ->
16362 (fun levn c strm ->
16363 if levn > clevn
16364 then p1 levn c strm
16365 else
16366 (let (__strm : _ Stream.t) = strm in
16367 let bp = Stream.count __strm
16369 match try
16370 Some
16371 (add_loc c bp p2 __strm)
16372 with
16373 | Stream.Failure -> None
16374 with
16375 | Some ((act, loc)) ->
16376 let a = Action.getf act loc
16378 entry.econtinue levn loc a
16379 c strm
16380 | _ -> p1 levn c __strm))))
16382 let start_parser_of_entry entry =
16383 match entry.edesc with
16384 | Dlevels [] -> Tools.empty_entry entry.ename
16385 | Dlevels elev -> start_parser_of_levels entry 0 elev
16386 | Dparser p -> (fun _ _ strm -> p strm)
16388 let rec continue_parser_of_levels entry clevn =
16389 function
16390 | [] ->
16391 (fun _ _ _ _ (__strm : _ Stream.t) ->
16392 raise Stream.Failure)
16393 | lev :: levs ->
16394 let p1 =
16395 continue_parser_of_levels entry (succ clevn) levs
16397 (match lev.lsuffix with
16398 | DeadEnd -> p1
16399 | tree ->
16400 let alevn =
16401 (match lev.assoc with
16402 | LeftA | NonA -> succ clevn
16403 | RightA -> clevn) in
16404 let p2 =
16405 parser_of_tree entry (succ clevn) alevn tree
16407 (fun c levn bp a strm ->
16408 if levn > clevn
16409 then p1 c levn bp a strm
16410 else
16411 (let (__strm : _ Stream.t) = strm in
16412 let bp = Stream.count __strm
16414 try p1 c levn bp a __strm
16415 with
16416 | Stream.Failure ->
16417 let (act, loc) =
16418 add_loc c bp p2 __strm in
16419 let a = Action.getf2 act a loc
16421 entry.econtinue levn loc a c
16422 strm)))
16424 let continue_parser_of_entry entry =
16425 match entry.edesc with
16426 | Dlevels elev ->
16427 let p = continue_parser_of_levels entry 0 elev
16429 (fun levn bp a c (__strm : _ Stream.t) ->
16430 try p c levn bp a __strm
16431 with | Stream.Failure -> a)
16432 | Dparser _ ->
16433 (fun _ _ _ _ (__strm : _ Stream.t) ->
16434 raise Stream.Failure)
16440 module Insert =
16441 struct
16442 module Make (Structure : Structure.S) =
16443 struct
16444 module Tools = Tools.Make(Structure)
16446 module Parser = Parser.Make(Structure)
16448 open Structure
16450 open Format
16452 open Sig.Grammar
16454 let is_before s1 s2 =
16455 match (s1, s2) with
16456 | ((Skeyword _ | Stoken _), (Skeyword _ | Stoken _)) ->
16457 false
16458 | ((Skeyword _ | Stoken _), _) -> true
16459 | _ -> false
16461 let rec derive_eps =
16462 function
16463 | Slist0 _ -> true
16464 | Slist0sep (_, _) -> true
16465 | Sopt _ -> true
16466 | Stree t -> tree_derive_eps t
16467 | Smeta (_, _, _) | Slist1 _ | Slist1sep (_, _) | Snterm _
16468 | Snterml (_, _) | Snext | Sself | Stoken _ |
16469 Skeyword _ -> false
16470 and tree_derive_eps =
16471 function
16472 | LocAct (_, _) -> true
16473 | Node { node = s; brother = bro; son = son } ->
16474 ((derive_eps s) && (tree_derive_eps son)) ||
16475 (tree_derive_eps bro)
16476 | DeadEnd -> false
16478 let empty_lev lname assoc =
16479 let assoc = match assoc with | Some a -> a | None -> LeftA
16482 assoc = assoc;
16483 lname = lname;
16484 lsuffix = DeadEnd;
16485 lprefix = DeadEnd;
16488 let change_lev entry lev n lname assoc =
16489 let a =
16490 match assoc with
16491 | None -> lev.assoc
16492 | Some a ->
16494 (a <> lev.assoc) && !(entry.egram.warning_verbose)
16495 then
16496 (eprintf
16497 "<W> Changing associativity of level \"%s\"\n"
16499 flush stderr)
16500 else ();
16503 ((match lname with
16504 | Some n ->
16506 (lname <> lev.lname) &&
16507 !(entry.egram.warning_verbose)
16508 then
16509 (eprintf "<W> Level label \"%s\" ignored\n" n;
16510 flush stderr)
16511 else ()
16512 | None -> ());
16514 assoc = a;
16515 lname = lev.lname;
16516 lsuffix = lev.lsuffix;
16517 lprefix = lev.lprefix;
16520 let change_to_self entry =
16521 function | Snterm e when e == entry -> Sself | x -> x
16523 let get_level entry position levs =
16524 match position with
16525 | Some First -> ([], empty_lev, levs)
16526 | Some Last -> (levs, empty_lev, [])
16527 | Some (Level n) ->
16528 let rec get =
16529 (function
16530 | [] ->
16531 (eprintf
16532 "No level labelled \"%s\" in entry \"%s\"\n"
16533 n entry.ename;
16534 flush stderr;
16535 failwith "Grammar.extend")
16536 | lev :: levs ->
16537 if Tools.is_level_labelled n lev
16538 then ([], (change_lev entry lev n), levs)
16539 else
16540 (let (levs1, rlev, levs2) = get levs
16541 in ((lev :: levs1), rlev, levs2)))
16542 in get levs
16543 | Some (Before n) ->
16544 let rec get =
16545 (function
16546 | [] ->
16547 (eprintf
16548 "No level labelled \"%s\" in entry \"%s\"\n"
16549 n entry.ename;
16550 flush stderr;
16551 failwith "Grammar.extend")
16552 | lev :: levs ->
16553 if Tools.is_level_labelled n lev
16554 then ([], empty_lev, (lev :: levs))
16555 else
16556 (let (levs1, rlev, levs2) = get levs
16557 in ((lev :: levs1), rlev, levs2)))
16558 in get levs
16559 | Some (After n) ->
16560 let rec get =
16561 (function
16562 | [] ->
16563 (eprintf
16564 "No level labelled \"%s\" in entry \"%s\"\n"
16565 n entry.ename;
16566 flush stderr;
16567 failwith "Grammar.extend")
16568 | lev :: levs ->
16569 if Tools.is_level_labelled n lev
16570 then ([ lev ], empty_lev, levs)
16571 else
16572 (let (levs1, rlev, levs2) = get levs
16573 in ((lev :: levs1), rlev, levs2)))
16574 in get levs
16575 | None ->
16576 (match levs with
16577 | lev :: levs ->
16578 ([], (change_lev entry lev "<top>"), levs)
16579 | [] -> ([], empty_lev, []))
16581 let rec check_gram entry =
16582 function
16583 | Snterm e ->
16584 if ( != ) e.egram entry.egram
16585 then
16586 (eprintf
16588 Error: entries \"%s\" and \"%s\" do not belong to the same grammar.\n"
16589 entry.ename e.ename;
16590 flush stderr;
16591 failwith "Grammar.extend error")
16592 else ()
16593 | Snterml (e, _) ->
16594 if ( != ) e.egram entry.egram
16595 then
16596 (eprintf
16598 Error: entries \"%s\" and \"%s\" do not belong to the same grammar.\n"
16599 entry.ename e.ename;
16600 flush stderr;
16601 failwith "Grammar.extend error")
16602 else ()
16603 | Smeta (_, sl, _) -> List.iter (check_gram entry) sl
16604 | Slist0sep (s, t) ->
16605 (check_gram entry t; check_gram entry s)
16606 | Slist1sep (s, t) ->
16607 (check_gram entry t; check_gram entry s)
16608 | Slist0 s -> check_gram entry s
16609 | Slist1 s -> check_gram entry s
16610 | Sopt s -> check_gram entry s
16611 | Stree t -> tree_check_gram entry t
16612 | Snext | Sself | Stoken _ | Skeyword _ -> ()
16613 and tree_check_gram entry =
16614 function
16615 | Node { node = n; brother = bro; son = son } ->
16616 (check_gram entry n;
16617 tree_check_gram entry bro;
16618 tree_check_gram entry son)
16619 | LocAct (_, _) | DeadEnd -> ()
16621 let get_initial =
16622 function
16623 | Sself :: symbols -> (true, symbols)
16624 | symbols -> (false, symbols)
16626 let insert_tokens gram symbols =
16627 let rec insert =
16628 function
16629 | Smeta (_, sl, _) -> List.iter insert sl
16630 | Slist0 s -> insert s
16631 | Slist1 s -> insert s
16632 | Slist0sep (s, t) -> (insert s; insert t)
16633 | Slist1sep (s, t) -> (insert s; insert t)
16634 | Sopt s -> insert s
16635 | Stree t -> tinsert t
16636 | Skeyword kwd -> using gram kwd
16637 | Snterm _ | Snterml (_, _) | Snext | Sself | Stoken _ ->
16639 and tinsert =
16640 function
16641 | Node { node = s; brother = bro; son = son } ->
16642 (insert s; tinsert bro; tinsert son)
16643 | LocAct (_, _) | DeadEnd -> ()
16644 in List.iter insert symbols
16646 let insert_tree entry gsymbols action tree =
16647 let rec insert symbols tree =
16648 match symbols with
16649 | s :: sl -> insert_in_tree s sl tree
16650 | [] ->
16651 (match tree with
16652 | Node { node = s; son = son; brother = bro } ->
16653 Node
16655 node = s;
16656 son = son;
16657 brother = insert [] bro;
16659 | LocAct (old_action, action_list) ->
16660 let () =
16661 if !(entry.egram.warning_verbose)
16662 then
16663 eprintf
16664 "<W> Grammar extension: in [%s] some rule has been masked@."
16665 entry.ename
16666 else ()
16667 in LocAct (action, old_action :: action_list)
16668 | DeadEnd -> LocAct (action, []))
16669 and insert_in_tree s sl tree =
16670 match try_insert s sl tree with
16671 | Some t -> t
16672 | None ->
16673 Node
16675 node = s;
16676 son = insert sl DeadEnd;
16677 brother = tree;
16679 and try_insert s sl tree =
16680 match tree with
16681 | Node { node = s1; son = son; brother = bro } ->
16682 if Tools.eq_symbol s s1
16683 then
16684 (let t =
16685 Node
16687 node = s1;
16688 son = insert sl son;
16689 brother = bro;
16691 in Some t)
16692 else
16694 (is_before s1 s) ||
16695 ((derive_eps s) && (not (derive_eps s1)))
16696 then
16697 (let bro =
16698 match try_insert s sl bro with
16699 | Some bro -> bro
16700 | None ->
16701 Node
16703 node = s;
16704 son = insert sl DeadEnd;
16705 brother = bro;
16706 } in
16707 let t =
16708 Node { node = s1; son = son; brother = bro; }
16709 in Some t)
16710 else
16711 (match try_insert s sl bro with
16712 | Some bro ->
16713 let t =
16714 Node
16715 { node = s1; son = son; brother = bro; }
16716 in Some t
16717 | None -> None)
16718 | LocAct (_, _) | DeadEnd -> None
16719 and insert_new =
16720 function
16721 | s :: sl ->
16722 Node
16723 { node = s; son = insert_new sl; brother = DeadEnd;
16725 | [] -> LocAct (action, [])
16726 in insert gsymbols tree
16728 let insert_level entry e1 symbols action slev =
16729 match e1 with
16730 | true ->
16732 assoc = slev.assoc;
16733 lname = slev.lname;
16734 lsuffix =
16735 insert_tree entry symbols action slev.lsuffix;
16736 lprefix = slev.lprefix;
16738 | false ->
16740 assoc = slev.assoc;
16741 lname = slev.lname;
16742 lsuffix = slev.lsuffix;
16743 lprefix =
16744 insert_tree entry symbols action slev.lprefix;
16747 let levels_of_rules entry position rules =
16748 let elev =
16749 match entry.edesc with
16750 | Dlevels elev -> elev
16751 | Dparser _ ->
16752 (eprintf "Error: entry not extensible: \"%s\"\n"
16753 entry.ename;
16754 flush stderr;
16755 failwith "Grammar.extend")
16757 if rules = []
16758 then elev
16759 else
16760 (let (levs1, make_lev, levs2) =
16761 get_level entry position elev in
16762 let (levs, _) =
16763 List.fold_left
16764 (fun (levs, make_lev) (lname, assoc, level) ->
16765 let lev = make_lev lname assoc in
16766 let lev =
16767 List.fold_left
16768 (fun lev (symbols, action) ->
16769 let symbols =
16770 List.map (change_to_self entry)
16771 symbols
16773 (List.iter (check_gram entry) symbols;
16774 let (e1, symbols) =
16775 get_initial symbols
16777 (insert_tokens entry.egram symbols;
16778 insert_level entry e1 symbols
16779 action lev)))
16780 lev level
16781 in ((lev :: levs), empty_lev))
16782 ([], make_lev) rules
16783 in levs1 @ ((List.rev levs) @ levs2))
16785 let extend entry (position, rules) =
16786 let elev = levels_of_rules entry position rules
16788 (entry.edesc <- Dlevels elev;
16789 entry.estart <-
16790 (fun lev c strm ->
16791 let f = Parser.start_parser_of_entry entry
16792 in (entry.estart <- f; f lev c strm));
16793 entry.econtinue <-
16794 fun lev bp a c strm ->
16795 let f = Parser.continue_parser_of_entry entry
16796 in (entry.econtinue <- f; f lev bp a c strm))
16802 module Delete =
16803 struct
16804 module Make (Structure : Structure.S) =
16805 struct
16806 module Tools = Tools.Make(Structure)
16808 module Parser = Parser.Make(Structure)
16810 open Structure
16812 let delete_rule_in_tree entry =
16813 let rec delete_in_tree symbols tree =
16814 match (symbols, tree) with
16815 | (s :: sl, Node n) ->
16816 if Tools.logically_eq_symbols entry s n.node
16817 then delete_son sl n
16818 else
16819 (match delete_in_tree symbols n.brother with
16820 | Some ((dsl, t)) ->
16821 Some
16822 ((dsl,
16823 (Node
16825 node = n.node;
16826 son = n.son;
16827 brother = t;
16828 })))
16829 | None -> None)
16830 | (_ :: _, _) -> None
16831 | ([], Node n) ->
16832 (match delete_in_tree [] n.brother with
16833 | Some ((dsl, t)) ->
16834 Some
16835 ((dsl,
16836 (Node
16838 node = n.node;
16839 son = n.son;
16840 brother = t;
16841 })))
16842 | None -> None)
16843 | ([], DeadEnd) -> None
16844 | ([], LocAct (_, [])) -> Some (((Some []), DeadEnd))
16845 | ([], LocAct (_, (action :: list))) ->
16846 Some ((None, (LocAct (action, list))))
16847 and delete_son sl n =
16848 match delete_in_tree sl n.son with
16849 | Some ((Some dsl, DeadEnd)) ->
16850 Some (((Some (n.node :: dsl)), (n.brother)))
16851 | Some ((Some dsl, t)) ->
16852 let t =
16853 Node
16854 { node = n.node; son = t; brother = n.brother; }
16855 in Some (((Some (n.node :: dsl)), t))
16856 | Some ((None, t)) ->
16857 let t =
16858 Node
16859 { node = n.node; son = t; brother = n.brother; }
16860 in Some ((None, t))
16861 | None -> None
16862 in delete_in_tree
16864 let rec decr_keyw_use gram =
16865 function
16866 | Skeyword kwd -> removing gram kwd
16867 | Smeta (_, sl, _) -> List.iter (decr_keyw_use gram) sl
16868 | Slist0 s -> decr_keyw_use gram s
16869 | Slist1 s -> decr_keyw_use gram s
16870 | Slist0sep (s1, s2) ->
16871 (decr_keyw_use gram s1; decr_keyw_use gram s2)
16872 | Slist1sep (s1, s2) ->
16873 (decr_keyw_use gram s1; decr_keyw_use gram s2)
16874 | Sopt s -> decr_keyw_use gram s
16875 | Stree t -> decr_keyw_use_in_tree gram t
16876 | Sself | Snext | Snterm _ | Snterml (_, _) | Stoken _ ->
16878 and decr_keyw_use_in_tree gram =
16879 function
16880 | DeadEnd | LocAct (_, _) -> ()
16881 | Node n ->
16882 (decr_keyw_use gram n.node;
16883 decr_keyw_use_in_tree gram n.son;
16884 decr_keyw_use_in_tree gram n.brother)
16886 let rec delete_rule_in_suffix entry symbols =
16887 function
16888 | lev :: levs ->
16889 (match delete_rule_in_tree entry symbols lev.lsuffix
16890 with
16891 | Some ((dsl, t)) ->
16892 ((match dsl with
16893 | Some dsl ->
16894 List.iter (decr_keyw_use entry.egram) dsl
16895 | None -> ());
16896 (match t with
16897 | DeadEnd when lev.lprefix == DeadEnd -> levs
16898 | _ ->
16899 let lev =
16901 assoc = lev.assoc;
16902 lname = lev.lname;
16903 lsuffix = t;
16904 lprefix = lev.lprefix;
16906 in lev :: levs))
16907 | None ->
16908 let levs =
16909 delete_rule_in_suffix entry symbols levs
16910 in lev :: levs)
16911 | [] -> raise Not_found
16913 let rec delete_rule_in_prefix entry symbols =
16914 function
16915 | lev :: levs ->
16916 (match delete_rule_in_tree entry symbols lev.lprefix
16917 with
16918 | Some ((dsl, t)) ->
16919 ((match dsl with
16920 | Some dsl ->
16921 List.iter (decr_keyw_use entry.egram) dsl
16922 | None -> ());
16923 (match t with
16924 | DeadEnd when lev.lsuffix == DeadEnd -> levs
16925 | _ ->
16926 let lev =
16928 assoc = lev.assoc;
16929 lname = lev.lname;
16930 lsuffix = lev.lsuffix;
16931 lprefix = t;
16933 in lev :: levs))
16934 | None ->
16935 let levs =
16936 delete_rule_in_prefix entry symbols levs
16937 in lev :: levs)
16938 | [] -> raise Not_found
16940 let rec delete_rule_in_level_list entry symbols levs =
16941 match symbols with
16942 | Sself :: symbols ->
16943 delete_rule_in_suffix entry symbols levs
16944 | Snterm e :: symbols when e == entry ->
16945 delete_rule_in_suffix entry symbols levs
16946 | _ -> delete_rule_in_prefix entry symbols levs
16948 let delete_rule entry sl =
16949 match entry.edesc with
16950 | Dlevels levs ->
16951 let levs = delete_rule_in_level_list entry sl levs
16953 (entry.edesc <- Dlevels levs;
16954 entry.estart <-
16955 (fun lev c strm ->
16956 let f = Parser.start_parser_of_entry entry
16957 in (entry.estart <- f; f lev c strm));
16958 entry.econtinue <-
16959 (fun lev bp a c strm ->
16960 let f = Parser.continue_parser_of_entry entry
16961 in (entry.econtinue <- f; f lev bp a c strm)))
16962 | Dparser _ -> ()
16968 module Fold :
16970 module Make (Structure : Structure.S) :
16972 open Structure
16974 val sfold0 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
16976 val sfold1 : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) fold
16978 val sfold0sep : ('a -> 'b -> 'b) -> 'b -> (_, 'a, 'b) foldsep
16982 end =
16983 struct
16984 module Make (Structure : Structure.S) =
16985 struct
16986 open Structure
16988 open Format
16990 module Parse = Parser.Make(Structure)
16992 module Fail = Failed.Make(Structure)
16994 open Sig.Grammar
16996 module Stream =
16997 struct
16998 include Stream
17000 let junk strm = Context.junk strm
17002 let count strm = Context.bp strm
17006 let sfold0 f e _entry _symbl psymb =
17007 let rec fold accu (__strm : _ Stream.t) =
17008 match try Some (psymb __strm)
17009 with | Stream.Failure -> None
17010 with
17011 | Some a -> fold (f a accu) __strm
17012 | _ -> accu
17013 in fun (__strm : _ Stream.t) -> fold e __strm
17015 let sfold1 f e _entry _symbl psymb =
17016 let rec fold accu (__strm : _ Stream.t) =
17017 match try Some (psymb __strm)
17018 with | Stream.Failure -> None
17019 with
17020 | Some a -> fold (f a accu) __strm
17021 | _ -> accu
17023 fun (__strm : _ Stream.t) ->
17024 let a = psymb __strm
17026 try fold (f a e) __strm
17027 with | Stream.Failure -> raise (Stream.Error "")
17029 let sfold0sep f e entry symbl psymb psep =
17030 let failed =
17031 function
17032 | [ symb; sep ] -> Fail.symb_failed_txt entry sep symb
17033 | _ -> "failed" in
17034 let rec kont accu (__strm : _ Stream.t) =
17035 match try Some (psep __strm)
17036 with | Stream.Failure -> None
17037 with
17038 | Some () ->
17039 let a =
17040 (try psymb __strm
17041 with
17042 | Stream.Failure ->
17043 raise (Stream.Error (failed symbl)))
17044 in kont (f a accu) __strm
17045 | _ -> accu
17047 fun (__strm : _ Stream.t) ->
17048 match try Some (psymb __strm)
17049 with | Stream.Failure -> None
17050 with
17051 | Some a -> kont (f a e) __strm
17052 | _ -> e
17054 let sfold1sep f e entry symbl psymb psep =
17055 let failed =
17056 function
17057 | [ symb; sep ] -> Fail.symb_failed_txt entry sep symb
17058 | _ -> "failed" in
17059 let parse_top =
17060 function
17061 | [ symb; _ ] -> Parse.parse_top_symb entry symb
17062 | _ -> raise Stream.Failure in
17063 let rec kont accu (__strm : _ Stream.t) =
17064 match try Some (psep __strm)
17065 with | Stream.Failure -> None
17066 with
17067 | Some () ->
17068 let a =
17069 (try
17070 try psymb __strm
17071 with
17072 | Stream.Failure ->
17073 let a =
17074 (try parse_top symbl __strm
17075 with
17076 | Stream.Failure ->
17077 raise (Stream.Error (failed symbl)))
17078 in Obj.magic a
17079 with | Stream.Failure -> raise (Stream.Error ""))
17080 in kont (f a accu) __strm
17081 | _ -> accu
17083 fun (__strm : _ Stream.t) ->
17084 let a = psymb __strm in kont (f a e) __strm
17090 module Entry =
17091 struct
17092 module Make (Structure : Structure.S) =
17093 struct
17094 module Dump = Print.MakeDump(Structure)
17096 module Print = Print.Make(Structure)
17098 module Tools = Tools.Make(Structure)
17100 open Format
17102 open Structure
17104 type 'a t = internal_entry
17106 let name e = e.ename
17108 let print ppf e = fprintf ppf "%a@\n" Print.entry e
17110 let dump ppf e = fprintf ppf "%a@\n" Dump.entry e
17112 let mk g n =
17114 egram = g;
17115 ename = n;
17116 estart = Tools.empty_entry n;
17117 econtinue =
17118 (fun _ _ _ _ (__strm : _ Stream.t) ->
17119 raise Stream.Failure);
17120 edesc = Dlevels [];
17123 let action_parse entry ts : Action.t =
17124 Context.call_with_ctx ts
17125 (fun c ->
17126 try entry.estart 0 c (Context.stream c)
17127 with
17128 | Stream.Failure ->
17129 Loc.raise (Context.loc_ep c)
17130 (Stream.Error
17131 ("illegal begin of " ^ entry.ename))
17132 | (Loc.Exc_located (_, _) as exc) -> raise exc
17133 | exc -> Loc.raise (Context.loc_ep c) exc)
17135 let lex entry loc cs = entry.egram.glexer loc cs
17137 let lex_string entry loc str =
17138 lex entry loc (Stream.of_string str)
17140 let filter entry ts =
17141 Token.Filter.filter (get_filter entry.egram) ts
17143 let parse_tokens_after_filter entry ts =
17144 Action.get (action_parse entry ts)
17146 let parse_tokens_before_filter entry ts =
17147 parse_tokens_after_filter entry (filter entry ts)
17149 let parse entry loc cs =
17150 parse_tokens_before_filter entry (lex entry loc cs)
17152 let parse_string entry loc str =
17153 parse_tokens_before_filter entry (lex_string entry loc str)
17155 let of_parser g n (p : (Token.t * Loc.t) Stream.t -> 'a) :
17156 'a t =
17158 egram = g;
17159 ename = n;
17160 estart = (fun _ _ ts -> Action.mk (p ts));
17161 econtinue =
17162 (fun _ _ _ _ (__strm : _ Stream.t) ->
17163 raise Stream.Failure);
17164 edesc = Dparser (fun ts -> Action.mk (p ts));
17167 let setup_parser e (p : (Token.t * Loc.t) Stream.t -> 'a) =
17168 let f ts = Action.mk (p ts)
17170 (e.estart <- (fun _ _ -> f);
17171 e.econtinue <-
17172 (fun _ _ _ _ (__strm : _ Stream.t) ->
17173 raise Stream.Failure);
17174 e.edesc <- Dparser f)
17176 let clear e =
17177 (e.estart <-
17178 (fun _ _ (__strm : _ Stream.t) -> raise Stream.Failure);
17179 e.econtinue <-
17180 (fun _ _ _ _ (__strm : _ Stream.t) ->
17181 raise Stream.Failure);
17182 e.edesc <- Dlevels [])
17184 let obj x = x
17190 module Static =
17191 struct
17192 module Make (Lexer : Sig.Lexer) :
17193 Sig.Grammar.Static with module Loc = Lexer.Loc
17194 and module Token = Lexer.Token =
17195 struct
17196 module Structure = Structure.Make(Lexer)
17198 module Delete = Delete.Make(Structure)
17200 module Insert = Insert.Make(Structure)
17202 module Fold = Fold.Make(Structure)
17204 include Structure
17206 let gram =
17207 let gkeywords = Hashtbl.create 301
17210 gkeywords = gkeywords;
17211 gfilter = Token.Filter.mk (Hashtbl.mem gkeywords);
17212 glexer = Lexer.mk ();
17213 warning_verbose = ref true;
17214 error_verbose = Camlp4_config.verbose;
17217 module Entry =
17218 struct
17219 module E = Entry.Make(Structure)
17221 type 'a t = 'a E.t
17223 let mk = E.mk gram
17225 let of_parser name strm = E.of_parser gram name strm
17227 let setup_parser = E.setup_parser
17229 let name = E.name
17231 let print = E.print
17233 let clear = E.clear
17235 let dump = E.dump
17237 let obj x = x
17241 let get_filter () = gram.gfilter
17243 let lex loc cs = gram.glexer loc cs
17245 let lex_string loc str = lex loc (Stream.of_string str)
17247 let filter ts = Token.Filter.filter gram.gfilter ts
17249 let parse_tokens_after_filter entry ts =
17250 Entry.E.parse_tokens_after_filter entry ts
17252 let parse_tokens_before_filter entry ts =
17253 parse_tokens_after_filter entry (filter ts)
17255 let parse entry loc cs =
17256 parse_tokens_before_filter entry (lex loc cs)
17258 let parse_string entry loc str =
17259 parse_tokens_before_filter entry (lex_string loc str)
17261 let delete_rule = Delete.delete_rule
17263 let srules e rl =
17264 let t =
17265 List.fold_left
17266 (fun tree (symbols, action) ->
17267 Insert.insert_tree e symbols action tree)
17268 DeadEnd rl
17269 in Stree t
17271 let sfold0 = Fold.sfold0
17273 let sfold1 = Fold.sfold1
17275 let sfold0sep = Fold.sfold0sep
17277 let extend = Insert.extend
17283 module Dynamic =
17284 struct
17285 module Make (Lexer : Sig.Lexer) :
17286 Sig.Grammar.Dynamic with module Loc = Lexer.Loc
17287 and module Token = Lexer.Token =
17288 struct
17289 module Structure = Structure.Make(Lexer)
17291 module Delete = Delete.Make(Structure)
17293 module Insert = Insert.Make(Structure)
17295 module Entry = Entry.Make(Structure)
17297 module Fold = Fold.Make(Structure)
17299 include Structure
17301 let mk () =
17302 let gkeywords = Hashtbl.create 301
17305 gkeywords = gkeywords;
17306 gfilter = Token.Filter.mk (Hashtbl.mem gkeywords);
17307 glexer = Lexer.mk ();
17308 warning_verbose = ref true;
17309 error_verbose = Camlp4_config.verbose;
17312 let get_filter g = g.gfilter
17314 let lex g loc cs = g.glexer loc cs
17316 let lex_string g loc str = lex g loc (Stream.of_string str)
17318 let filter g ts = Token.Filter.filter g.gfilter ts
17320 let parse_tokens_after_filter entry ts =
17321 Entry.parse_tokens_after_filter entry ts
17323 let parse_tokens_before_filter entry ts =
17324 parse_tokens_after_filter entry (filter entry.egram ts)
17326 let parse entry loc cs =
17327 parse_tokens_before_filter entry (lex entry.egram loc cs)
17329 let parse_string entry loc str =
17330 parse_tokens_before_filter entry
17331 (lex_string entry.egram loc str)
17333 let delete_rule = Delete.delete_rule
17335 let srules e rl =
17336 let t =
17337 List.fold_left
17338 (fun tree (symbols, action) ->
17339 Insert.insert_tree e symbols action tree)
17340 DeadEnd rl
17341 in Stree t
17343 let sfold0 = Fold.sfold0
17345 let sfold1 = Fold.sfold1
17347 let sfold0sep = Fold.sfold0sep
17349 let extend = Insert.extend
17359 module Printers =
17360 struct
17361 module DumpCamlp4Ast :
17363 module Id : Sig.Id
17365 module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S
17367 end =
17368 struct
17369 module Id =
17370 struct
17371 let name = "Camlp4Printers.DumpCamlp4Ast"
17373 let version = "$Id$"
17377 module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S =
17378 struct
17379 include Syntax
17381 let with_open_out_file x f =
17382 match x with
17383 | Some file ->
17384 let oc = open_out_bin file
17385 in (f oc; flush oc; close_out oc)
17386 | None ->
17387 (set_binary_mode_out stdout true; f stdout; flush stdout)
17389 let dump_ast magic ast oc =
17390 (output_string oc magic; output_value oc ast)
17392 let print_interf ?input_file:(_) ?output_file ast =
17393 with_open_out_file output_file
17394 (dump_ast Camlp4_config.camlp4_ast_intf_magic_number ast)
17396 let print_implem ?input_file:(_) ?output_file ast =
17397 with_open_out_file output_file
17398 (dump_ast Camlp4_config.camlp4_ast_impl_magic_number ast)
17404 module DumpOCamlAst :
17406 module Id : Sig.Id
17408 module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.Ast).S
17410 end =
17411 struct
17412 module Id : Sig.Id =
17413 struct
17414 let name = "Camlp4Printers.DumpOCamlAst"
17416 let version = "$Id$"
17420 module Make (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.Ast).S =
17421 struct
17422 include Syntax
17424 module Ast2pt = Struct.Camlp4Ast2OCamlAst.Make(Ast)
17426 let with_open_out_file x f =
17427 match x with
17428 | Some file ->
17429 let oc = open_out_bin file
17430 in (f oc; flush oc; close_out oc)
17431 | None ->
17432 (set_binary_mode_out stdout true; f stdout; flush stdout)
17434 let dump_pt magic fname pt oc =
17435 (output_string oc magic;
17436 output_value oc (if fname = "-" then "" else fname);
17437 output_value oc pt)
17439 let print_interf ?(input_file = "-") ?output_file ast =
17440 let pt = Ast2pt.sig_item ast
17442 with_open_out_file output_file
17443 (dump_pt Camlp4_config.ocaml_ast_intf_magic_number
17444 input_file pt)
17446 let print_implem ?(input_file = "-") ?output_file ast =
17447 let pt = Ast2pt.str_item ast
17449 with_open_out_file output_file
17450 (dump_pt Camlp4_config.ocaml_ast_impl_magic_number
17451 input_file pt)
17457 module Null :
17459 module Id : Sig.Id
17461 module Make (Syntax : Sig.Syntax) : Sig.Printer(Syntax.Ast).S
17463 end =
17464 struct
17465 module Id =
17466 struct let name = "Camlp4.Printers.Null"
17467 let version = "$Id$"
17470 module Make (Syntax : Sig.Syntax) =
17471 struct
17472 include Syntax
17474 let print_interf ?input_file:(_) ?output_file:(_) _ = ()
17476 let print_implem ?input_file:(_) ?output_file:(_) _ = ()
17482 module OCaml :
17484 module Id : Sig.Id
17486 module Make (Syntax : Sig.Camlp4Syntax) :
17488 open Format
17490 include Sig.Camlp4Syntax with module Loc = Syntax.Loc
17491 and module Token = Syntax.Token and module Ast = Syntax.Ast
17492 and module Gram = Syntax.Gram
17494 type sep = (unit, formatter, unit) format
17496 val list' :
17497 (formatter -> 'a -> unit) ->
17498 ('b, formatter, unit) format ->
17499 (unit, formatter, unit) format ->
17500 formatter -> 'a list -> unit
17502 val list :
17503 (formatter -> 'a -> unit) ->
17504 ('b, formatter, unit) format -> formatter -> 'a list -> unit
17506 val lex_string : string -> Token.t
17508 val is_infix : string -> bool
17510 val is_keyword : string -> bool
17512 val ocaml_char : string -> string
17514 val get_expr_args :
17515 Ast.expr -> Ast.expr list -> (Ast.expr * (Ast.expr list))
17517 val get_patt_args :
17518 Ast.patt -> Ast.patt list -> (Ast.patt * (Ast.patt list))
17520 val get_ctyp_args :
17521 Ast.ctyp -> Ast.ctyp list -> (Ast.ctyp * (Ast.ctyp list))
17523 val expr_fun_args : Ast.expr -> ((Ast.patt list) * Ast.expr)
17525 class printer :
17526 ?curry_constr: bool ->
17527 ?comments: bool ->
17528 unit ->
17529 object ('a)
17530 method interf : formatter -> Ast.sig_item -> unit
17532 method implem : formatter -> Ast.str_item -> unit
17534 method sig_item : formatter -> Ast.sig_item -> unit
17536 method str_item : formatter -> Ast.str_item -> unit
17538 val pipe : bool
17540 val semi : bool
17542 val semisep : sep
17544 val value_val : string
17546 val value_let : string
17548 method anti : formatter -> string -> unit
17550 method class_declaration :
17551 formatter -> Ast.class_expr -> unit
17553 method class_expr : formatter -> Ast.class_expr -> unit
17555 method class_sig_item :
17556 formatter -> Ast.class_sig_item -> unit
17558 method class_str_item :
17559 formatter -> Ast.class_str_item -> unit
17561 method class_type : formatter -> Ast.class_type -> unit
17563 method constrain :
17564 formatter -> (Ast.ctyp * Ast.ctyp) -> unit
17566 method ctyp : formatter -> Ast.ctyp -> unit
17568 method ctyp1 : formatter -> Ast.ctyp -> unit
17570 method constructor_type : formatter -> Ast.ctyp -> unit
17572 method dot_expr : formatter -> Ast.expr -> unit
17574 method apply_expr : formatter -> Ast.expr -> unit
17576 method expr : formatter -> Ast.expr -> unit
17578 method expr_list : formatter -> Ast.expr list -> unit
17580 method expr_list_cons :
17581 bool -> formatter -> Ast.expr -> unit
17583 method functor_arg :
17584 formatter -> (string * Ast.module_type) -> unit
17586 method functor_args :
17587 formatter -> (string * Ast.module_type) list -> unit
17589 method ident : formatter -> Ast.ident -> unit
17591 method numeric : formatter -> string -> string -> unit
17593 method binding : formatter -> Ast.binding -> unit
17595 method record_binding :
17596 formatter -> Ast.rec_binding -> unit
17598 method match_case : formatter -> Ast.match_case -> unit
17600 method match_case_aux :
17601 formatter -> Ast.match_case -> unit
17603 method mk_expr_list :
17604 Ast.expr -> ((Ast.expr list) * (Ast.expr option))
17606 method mk_patt_list :
17607 Ast.patt -> ((Ast.patt list) * (Ast.patt option))
17609 method module_expr :
17610 formatter -> Ast.module_expr -> unit
17612 method module_expr_get_functor_args :
17613 (string * Ast.module_type) list ->
17614 Ast.module_expr ->
17615 (((string * Ast.module_type) list) * Ast.
17616 module_expr * (Ast.module_type option))
17618 method module_rec_binding :
17619 formatter -> Ast.module_binding -> unit
17621 method module_type :
17622 formatter -> Ast.module_type -> unit
17624 method mutable_flag :
17625 formatter -> Ast.meta_bool -> unit
17627 method direction_flag :
17628 formatter -> Ast.meta_bool -> unit
17630 method rec_flag : formatter -> Ast.meta_bool -> unit
17632 method flag :
17633 formatter -> Ast.meta_bool -> string -> unit
17635 method node : formatter -> 'b -> ('b -> Loc.t) -> unit
17637 method patt : formatter -> Ast.patt -> unit
17639 method patt1 : formatter -> Ast.patt -> unit
17641 method patt2 : formatter -> Ast.patt -> unit
17643 method patt3 : formatter -> Ast.patt -> unit
17645 method patt4 : formatter -> Ast.patt -> unit
17647 method patt5 : formatter -> Ast.patt -> unit
17649 method patt_tycon : formatter -> Ast.patt -> unit
17651 method patt_expr_fun_args :
17652 formatter -> (Ast.patt * Ast.expr) -> unit
17654 method patt_class_expr_fun_args :
17655 formatter -> (Ast.patt * Ast.class_expr) -> unit
17657 method print_comments_before :
17658 Loc.t -> formatter -> unit
17660 method private_flag :
17661 formatter -> Ast.meta_bool -> unit
17663 method virtual_flag :
17664 formatter -> Ast.meta_bool -> unit
17666 method quoted_string : formatter -> string -> unit
17668 method raise_match_failure : formatter -> Loc.t -> unit
17670 method reset : 'a
17672 method reset_semi : 'a
17674 method semisep : sep
17676 method set_comments : bool -> 'a
17678 method set_curry_constr : bool -> 'a
17680 method set_loc_and_comments : 'a
17682 method set_semisep : sep -> 'a
17684 method simple_ctyp : formatter -> Ast.ctyp -> unit
17686 method simple_expr : formatter -> Ast.expr -> unit
17688 method simple_patt : formatter -> Ast.patt -> unit
17690 method seq : formatter -> Ast.expr -> unit
17692 method string : formatter -> string -> unit
17694 method sum_type : formatter -> Ast.ctyp -> unit
17696 method type_params : formatter -> Ast.ctyp list -> unit
17698 method class_params : formatter -> Ast.ctyp -> unit
17700 method under_pipe : 'a
17702 method under_semi : 'a
17704 method var : formatter -> string -> unit
17706 method with_constraint :
17707 formatter -> Ast.with_constr -> unit
17711 val with_outfile :
17712 string option -> (formatter -> 'a -> unit) -> 'a -> unit
17714 val print :
17715 string option ->
17716 (printer -> formatter -> 'a -> unit) -> 'a -> unit
17720 module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
17721 Ast).S
17723 end =
17724 struct
17725 open Format
17727 module Id =
17728 struct let name = "Camlp4.Printers.OCaml"
17729 let version = "$Id$"
17732 module Make (Syntax : Sig.Camlp4Syntax) =
17733 struct
17734 include Syntax
17736 type sep = (unit, formatter, unit) format
17738 let pp = fprintf
17740 let cut f = fprintf f "@ "
17742 let list' elt sep sep' f =
17743 let rec loop =
17744 function
17745 | [] -> ()
17746 | x :: xs -> (pp f sep; elt f x; pp f sep'; loop xs)
17748 function
17749 | [] -> ()
17750 | [ x ] -> (elt f x; pp f sep')
17751 | x :: xs -> (elt f x; pp f sep'; loop xs)
17753 let list elt sep f =
17754 let rec loop =
17755 function | [] -> () | x :: xs -> (pp f sep; elt f x; loop xs)
17757 function
17758 | [] -> ()
17759 | [ x ] -> elt f x
17760 | x :: xs -> (elt f x; loop xs)
17762 let rec list_of_meta_list =
17763 function
17764 | Ast.LNil -> []
17765 | Ast.LCons (x, xs) -> x :: (list_of_meta_list xs)
17766 | Ast.LAnt x -> assert false
17768 let meta_list elt sep f mxs =
17769 let xs = list_of_meta_list mxs in list elt sep f xs
17771 module CommentFilter = Struct.CommentFilter.Make(Token)
17773 let comment_filter = CommentFilter.mk ()
17775 let _ = CommentFilter.define (Gram.get_filter ()) comment_filter
17777 module StringSet = Set.Make(String)
17779 let infix_lidents =
17780 [ "asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or" ]
17782 let is_infix =
17783 let first_chars =
17784 [ '='; '<'; '>'; '|'; '&'; '$'; '@'; '^'; '+'; '-'; '*'; '/';
17785 '%'; '\\' ]
17786 and infixes =
17787 List.fold_right StringSet.add infix_lidents StringSet.empty
17789 fun s ->
17790 (StringSet.mem s infixes) ||
17791 ((s <> "") && (List.mem s.[0] first_chars))
17793 let is_keyword =
17794 let keywords =
17795 List.fold_right StringSet.add
17796 [ "and"; "as"; "assert"; "begin"; "class"; "constraint";
17797 "do"; "done"; "downto"; "else"; "end"; "exception";
17798 "external"; "false"; "for"; "fun"; "function"; "functor";
17799 "if"; "in"; "include"; "inherit"; "initializer"; "lazy";
17800 "let"; "match"; "method"; "module"; "mutable"; "new";
17801 "object"; "of"; "open"; "parser"; "private"; "rec";
17802 "sig"; "struct"; "then"; "to"; "true"; "try"; "type";
17803 "val"; "virtual"; "when"; "while"; "with" ]
17804 StringSet.empty
17805 in fun s -> StringSet.mem s keywords
17807 module Lexer = Struct.Lexer.Make(Token)
17809 let _ = let module M = ErrorHandler.Register(Lexer.Error) in ()
17811 open Sig
17813 let lexer s =
17814 Lexer.from_string ~quotations: !Camlp4_config.quotations Loc.
17815 ghost s
17817 let lex_string str =
17819 let (__strm : _ Stream.t) = lexer str
17821 match Stream.peek __strm with
17822 | Some ((tok, _)) ->
17823 (Stream.junk __strm;
17824 (match Stream.peek __strm with
17825 | Some ((EOI, _)) -> (Stream.junk __strm; tok)
17826 | _ -> raise (Stream.Error "")))
17827 | _ -> raise Stream.Failure
17828 with
17829 | Stream.Failure | Stream.Error _ ->
17830 failwith
17831 (sprintf
17832 "Cannot print %S this string contains more than one token"
17833 str)
17834 | Lexer.Error.E exn ->
17835 failwith
17836 (sprintf
17837 "Cannot print %S this identifier does not respect OCaml lexing rules (%s)"
17838 str (Lexer.Error.to_string exn))
17840 let ocaml_char = function | "'" -> "\\'" | c -> c
17842 let rec get_expr_args a al =
17843 match a with
17844 | Ast.ExApp (_, a1, a2) -> get_expr_args a1 (a2 :: al)
17845 | _ -> (a, al)
17847 let rec get_patt_args a al =
17848 match a with
17849 | Ast.PaApp (_, a1, a2) -> get_patt_args a1 (a2 :: al)
17850 | _ -> (a, al)
17852 let rec get_ctyp_args a al =
17853 match a with
17854 | Ast.TyApp (_, a1, a2) -> get_ctyp_args a1 (a2 :: al)
17855 | _ -> (a, al)
17857 let is_irrefut_patt = Ast.is_irrefut_patt
17859 let rec expr_fun_args =
17860 function
17861 | (Ast.ExFun (_, (Ast.McArr (_, p, (Ast.ExNil _), e))) as ge)
17863 if is_irrefut_patt p
17864 then (let (pl, e) = expr_fun_args e in ((p :: pl), e))
17865 else ([], ge)
17866 | ge -> ([], ge)
17868 let rec class_expr_fun_args =
17869 function
17870 | (Ast.CeFun (_, p, ce) as ge) ->
17871 if is_irrefut_patt p
17872 then
17873 (let (pl, ce) = class_expr_fun_args ce in ((p :: pl), ce))
17874 else ([], ge)
17875 | ge -> ([], ge)
17877 let rec do_print_comments_before loc f (__strm : _ Stream.t) =
17878 match Stream.peek __strm with
17879 | Some ((comm, comm_loc)) when Loc.strictly_before comm_loc loc
17881 (Stream.junk __strm;
17882 let s = __strm in
17883 let () = f comm comm_loc
17884 in do_print_comments_before loc f s)
17885 | _ -> ()
17887 class printer ?curry_constr:(init_curry_constr = false)
17888 ?(comments = true) () =
17889 object (o)
17890 val pipe = false
17892 val semi = false
17894 method under_pipe = {< pipe = true; >}
17896 method under_semi = {< semi = true; >}
17898 method reset_semi = {< semi = false; >}
17900 method reset = {< pipe = false; semi = false; >}
17902 val semisep = (";;" : sep)
17904 val andsep = ("@]@ @[<2>and@ " : sep)
17906 val value_val = "val"
17908 val value_let = "let"
17910 val mode = if comments then `comments else `no_comments
17912 val curry_constr = init_curry_constr
17914 val var_conversion = false
17916 method semisep = semisep
17918 method set_semisep = fun s -> {< semisep = s; >}
17920 method set_comments =
17921 fun b ->
17922 {< mode = if b then `comments else `no_comments; >}
17924 method set_loc_and_comments = {< mode = `loc_and_comments; >}
17926 method set_curry_constr = fun b -> {< curry_constr = b; >}
17928 method print_comments_before =
17929 fun loc f ->
17930 match mode with
17931 | `comments ->
17932 do_print_comments_before loc
17933 (fun c _ -> pp f "%s@ " c)
17934 (CommentFilter.take_stream comment_filter)
17935 | `loc_and_comments ->
17936 let () = pp f "(*loc: %a*)@ " Loc.dump loc
17938 do_print_comments_before loc
17939 (fun s -> pp f "%s(*comm_loc: %a*)@ " s Loc.dump)
17940 (CommentFilter.take_stream comment_filter)
17941 | _ -> ()
17943 method var =
17944 fun f ->
17945 function
17946 | "" -> pp f "$lid:\"\"$"
17947 | "[]" -> pp f "[]"
17948 | "()" -> pp f "()"
17949 | " True" -> pp f "True"
17950 | " False" -> pp f "False"
17951 | v ->
17952 (match (var_conversion, v) with
17953 | (true, "val") -> pp f "contents"
17954 | (true, "True") -> pp f "true"
17955 | (true, "False") -> pp f "false"
17956 | _ ->
17957 (match lex_string v with
17958 | LIDENT s | UIDENT s | ESCAPED_IDENT s when
17959 is_keyword s -> pp f "%s__" s
17960 | LIDENT s | ESCAPED_IDENT s when
17961 List.mem s infix_lidents -> pp f "( %s )" s
17962 | SYMBOL s -> pp f "( %s )" s
17963 | LIDENT s | UIDENT s | ESCAPED_IDENT s ->
17964 pp_print_string f s
17965 | tok ->
17966 failwith
17967 (sprintf
17968 "Bad token used as an identifier: %s"
17969 (Token.to_string tok))))
17971 method type_params =
17972 fun f ->
17973 function
17974 | [] -> ()
17975 | [ x ] -> pp f "%a@ " o#ctyp x
17976 | l -> pp f "@[<1>(%a)@]@ " (list o#ctyp ",@ ") l
17978 method class_params =
17979 fun f ->
17980 function
17981 | Ast.TyCom (_, t1, t2) ->
17982 pp f "@[<1>%a,@ %a@]" o#class_params t1
17983 o#class_params t2
17984 | x -> o#ctyp f x
17986 method mutable_flag = fun f b -> o#flag f b "mutable"
17988 method rec_flag = fun f b -> o#flag f b "rec"
17990 method virtual_flag = fun f b -> o#flag f b "virtual"
17992 method private_flag = fun f b -> o#flag f b "private"
17994 method flag =
17995 fun f b n ->
17996 match b with
17997 | Ast.BTrue -> (pp_print_string f n; pp f "@ ")
17998 | Ast.BFalse -> ()
17999 | Ast.BAnt s -> o#anti f s
18001 method anti = fun f s -> pp f "$%s$" s
18003 method seq =
18004 fun f ->
18005 function
18006 | Ast.ExSem (_, e1, e2) ->
18007 pp f "%a;@ %a" o#under_semi#seq e1 o#seq e2
18008 | Ast.ExSeq (_, e) -> o#seq f e
18009 | e -> o#expr f e
18011 method match_case =
18012 fun f ->
18013 function
18014 | Ast.McNil _loc ->
18015 pp f "@[<2>@ _ ->@ %a@]" o#raise_match_failure _loc
18016 | a -> o#match_case_aux f a
18018 method match_case_aux =
18019 fun f ->
18020 function
18021 | Ast.McNil _ -> ()
18022 | Ast.McAnt (_, s) -> o#anti f s
18023 | Ast.McOr (_, a1, a2) ->
18024 pp f "%a%a" o#match_case_aux a1 o#match_case_aux a2
18025 | Ast.McArr (_, p, (Ast.ExNil _), e) ->
18026 pp f "@ | @[<2>%a@ ->@ %a@]" o#patt p
18027 o#under_pipe#expr e
18028 | Ast.McArr (_, p, w, e) ->
18029 pp f "@ | @[<2>%a@ when@ %a@ ->@ %a@]" o#patt p
18030 o#under_pipe#expr w o#under_pipe#expr e
18032 method binding =
18033 fun f bi ->
18034 let () = o#node f bi Ast.loc_of_binding
18036 match bi with
18037 | Ast.BiNil _ -> ()
18038 | Ast.BiAnd (_, b1, b2) ->
18039 (o#binding f b1; pp f andsep; o#binding f b2)
18040 | Ast.BiEq (_, p, e) ->
18041 let (pl, e) =
18042 (match p with
18043 | Ast.PaTyc (_, _, _) -> ([], e)
18044 | _ -> expr_fun_args e)
18046 (match (p, e) with
18047 | (Ast.PaId (_, (Ast.IdLid (_, _))),
18048 Ast.ExTyc (_, e, t)) ->
18049 pp f "%a :@ %a =@ %a"
18050 (list o#simple_patt "@ ") (p :: pl)
18051 o#ctyp t o#expr e
18052 | _ ->
18053 pp f "%a @[<0>%a=@]@ %a" o#simple_patt p
18054 (list' o#simple_patt "" "@ ") pl o#expr e)
18055 | Ast.BiAnt (_, s) -> o#anti f s
18057 method record_binding =
18058 fun f bi ->
18059 let () = o#node f bi Ast.loc_of_rec_binding
18061 match bi with
18062 | Ast.RbNil _ -> ()
18063 | Ast.RbEq (_, i, e) ->
18064 pp f "@ @[<2>%a =@ %a@];" o#var_ident i o#expr e
18065 | Ast.RbSem (_, b1, b2) ->
18066 (o#under_semi#record_binding f b1;
18067 o#under_semi#record_binding f b2)
18068 | Ast.RbAnt (_, s) -> o#anti f s
18070 method mk_patt_list =
18071 function
18072 | Ast.PaApp (_,
18073 (Ast.PaApp (_, (Ast.PaId (_, (Ast.IdUid (_, "::")))),
18074 p1)),
18075 p2) ->
18076 let (pl, c) = o#mk_patt_list p2 in ((p1 :: pl), c)
18077 | Ast.PaId (_, (Ast.IdUid (_, "[]"))) -> ([], None)
18078 | p -> ([], (Some p))
18080 method mk_expr_list =
18081 function
18082 | Ast.ExApp (_,
18083 (Ast.ExApp (_, (Ast.ExId (_, (Ast.IdUid (_, "::")))),
18084 e1)),
18085 e2) ->
18086 let (el, c) = o#mk_expr_list e2 in ((e1 :: el), c)
18087 | Ast.ExId (_, (Ast.IdUid (_, "[]"))) -> ([], None)
18088 | e -> ([], (Some e))
18090 method expr_list =
18091 fun f ->
18092 function
18093 | [] -> pp f "[]"
18094 | [ e ] -> pp f "[ %a ]" o#under_semi#expr e
18095 | el ->
18096 pp f "@[<2>[ %a@] ]" (list o#under_semi#expr ";@ ")
18099 method expr_list_cons =
18100 fun simple f e ->
18101 let (el, c) = o#mk_expr_list e
18103 match c with
18104 | None -> o#expr_list f el
18105 | Some x ->
18106 (if simple
18107 then pp f "@[<2>(%a)@]"
18108 else pp f "@[<2>%a@]")
18109 (list o#under_semi#dot_expr " ::@ ") (el @ [ x ])
18111 method patt_expr_fun_args =
18112 fun f (p, e) ->
18113 let (pl, e) = expr_fun_args e
18115 pp f "%a@ ->@ %a" (list o#patt "@ ") (p :: pl) o#expr e
18117 method patt_class_expr_fun_args =
18118 fun f (p, ce) ->
18119 let (pl, ce) = class_expr_fun_args ce
18121 pp f "%a =@]@ %a" (list o#patt "@ ") (p :: pl)
18122 o#class_expr ce
18124 method constrain =
18125 fun f (t1, t2) ->
18126 pp f "@[<2>constraint@ %a =@ %a@]" o#ctyp t1 o#ctyp t2
18128 method sum_type =
18129 fun f t ->
18130 match Ast.list_of_ctyp t [] with
18131 | [] -> ()
18132 | ts -> pp f "@[<hv0>| %a@]" (list o#ctyp "@ | ") ts
18134 method string = fun f -> pp f "%s"
18136 method quoted_string = fun f -> pp f "%S"
18138 method numeric =
18139 fun f num suff ->
18140 if num.[0] = '-'
18141 then pp f "(%s%s)" num suff
18142 else pp f "%s%s" num suff
18144 method module_expr_get_functor_args =
18145 fun accu ->
18146 function
18147 | Ast.MeFun (_, s, mt, me) ->
18148 o#module_expr_get_functor_args ((s, mt) :: accu) me
18149 | Ast.MeTyc (_, me, mt) ->
18150 ((List.rev accu), me, (Some mt))
18151 | me -> ((List.rev accu), me, None)
18153 method functor_args = fun f -> list o#functor_arg "@ " f
18155 method functor_arg =
18156 fun f (s, mt) ->
18157 pp f "@[<2>(%a :@ %a)@]" o#var s o#module_type mt
18159 method module_rec_binding =
18160 fun f ->
18161 function
18162 | Ast.MbNil _ -> ()
18163 | Ast.MbColEq (_, s, mt, me) ->
18164 pp f "@[<2>%a :@ %a =@ %a@]" o#var s o#module_type mt
18165 o#module_expr me
18166 | Ast.MbCol (_, s, mt) ->
18167 pp f "@[<2>%a :@ %a@]" o#var s o#module_type mt
18168 | Ast.MbAnd (_, mb1, mb2) ->
18169 (o#module_rec_binding f mb1;
18170 pp f andsep;
18171 o#module_rec_binding f mb2)
18172 | Ast.MbAnt (_, s) -> o#anti f s
18174 method class_declaration =
18175 fun f ->
18176 function
18177 | Ast.CeTyc (_, ce, ct) ->
18178 pp f "%a :@ %a" o#class_expr ce o#class_type ct
18179 | ce -> o#class_expr f ce
18181 method raise_match_failure =
18182 fun f _loc ->
18183 let n = Loc.file_name _loc in
18184 let l = Loc.start_line _loc in
18185 let c = (Loc.start_off _loc) - (Loc.start_bol _loc)
18187 o#expr f
18188 (Ast.ExApp (_loc,
18189 Ast.ExId (_loc, Ast.IdLid (_loc, "raise")),
18190 Ast.ExApp (_loc,
18191 Ast.ExApp (_loc,
18192 Ast.ExApp (_loc,
18193 Ast.ExId (_loc,
18194 Ast.IdUid (_loc, "Match_failure")),
18195 Ast.ExStr (_loc, Ast.safe_string_escaped n)),
18196 Ast.ExInt (_loc, string_of_int l)),
18197 Ast.ExInt (_loc, string_of_int c))))
18199 method node : 'a. formatter -> 'a -> ('a -> Loc.t) -> unit =
18200 fun f node loc_of_node ->
18201 o#print_comments_before (loc_of_node node) f
18203 method ident =
18204 fun f i ->
18205 let () = o#node f i Ast.loc_of_ident
18207 match i with
18208 | Ast.IdAcc (_, i1, i2) ->
18209 pp f "%a.@,%a" o#ident i1 o#ident i2
18210 | Ast.IdApp (_, i1, i2) ->
18211 pp f "%a@,(%a)" o#ident i1 o#ident i2
18212 | Ast.IdAnt (_, s) -> o#anti f s
18213 | Ast.IdLid (_, s) | Ast.IdUid (_, s) -> o#var f s
18215 method private var_ident = {< var_conversion = true; >}#ident
18217 method expr =
18218 fun f e ->
18219 let () = o#node f e Ast.loc_of_expr
18221 match e with
18222 | (Ast.ExLet (_, _, _, _) | Ast.ExLmd (_, _, _, _) as
18223 e) when semi -> pp f "(%a)" o#reset#expr e
18224 | (Ast.ExMat (_, _, _) | Ast.ExTry (_, _, _) |
18225 Ast.ExFun (_, _)
18226 as e) when pipe || semi ->
18227 pp f "(%a)" o#reset#expr e
18228 | Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "~-")))),
18229 x) -> pp f "@[<2>-@ %a@]" o#dot_expr x
18230 | Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, "~-.")))),
18231 x) -> pp f "@[<2>-.@ %a@]" o#dot_expr x
18232 | Ast.ExApp (_,
18233 (Ast.ExApp (_,
18234 (Ast.ExId (_, (Ast.IdUid (_, "::")))), _)),
18235 _) -> o#expr_list_cons false f e
18236 | Ast.ExApp (_loc,
18237 (Ast.ExApp (_, (Ast.ExId (_, (Ast.IdLid (_, n)))),
18238 x)),
18239 y) when is_infix n ->
18240 pp f "@[<2>%a@ %s@ %a@]" o#apply_expr x n
18241 o#apply_expr y
18242 | Ast.ExApp (_, x, y) ->
18243 let (a, al) = get_expr_args x [ y ]
18246 (not curry_constr) &&
18247 (Ast.is_expr_constructor a)
18248 then
18249 (match al with
18250 | [ Ast.ExTup (_, _) ] ->
18251 pp f "@[<2>%a@ (%a)@]" o#apply_expr x
18252 o#expr y
18253 | [ _ ] ->
18254 pp f "@[<2>%a@ %a@]" o#apply_expr x
18255 o#apply_expr y
18256 | al ->
18257 pp f "@[<2>%a@ (%a)@]" o#apply_expr a
18258 (list o#under_pipe#expr ",@ ") al)
18259 else
18260 pp f "@[<2>%a@]" (list o#apply_expr "@ ")
18261 (a :: al)
18262 | Ast.ExAss (_,
18263 (Ast.ExAcc (_, e1,
18264 (Ast.ExId (_, (Ast.IdLid (_, "val")))))),
18265 e2) ->
18266 pp f "@[<2>%a :=@ %a@]" o#dot_expr e1 o#expr e2
18267 | Ast.ExAss (_, e1, e2) ->
18268 pp f "@[<2>%a@ <-@ %a@]" o#dot_expr e1 o#expr e2
18269 | Ast.ExFun (loc, (Ast.McNil _)) ->
18270 pp f "@[<2>fun@ _@ ->@ %a@]" o#raise_match_failure
18272 | Ast.ExFun (_, (Ast.McArr (_, p, (Ast.ExNil _), e)))
18273 when is_irrefut_patt p ->
18274 pp f "@[<2>fun@ %a@]" o#patt_expr_fun_args (p, e)
18275 | Ast.ExFun (_, a) ->
18276 pp f "@[<hv0>function%a@]" o#match_case a
18277 | Ast.ExIfe (_, e1, e2, e3) ->
18278 pp f
18279 "@[<hv0>@[<2>if@ %a@]@ @[<2>then@ %a@]@ @[<2>else@ %a@]@]"
18280 o#expr e1 o#under_semi#expr e2 o#under_semi#expr
18282 | Ast.ExLaz (_, e) ->
18283 pp f "@[<2>lazy@ %a@]" o#simple_expr e
18284 | Ast.ExLet (_, r, bi, e) ->
18285 (match e with
18286 | Ast.ExLet (_, _, _, _) ->
18287 pp f "@[<0>@[<2>let %a%a in@]@ %a@]"
18288 o#rec_flag r o#binding bi o#reset_semi#expr
18290 | _ ->
18291 pp f
18292 "@[<hv0>@[<2>let %a%a@]@ @[<hv2>in@ %a@]@]"
18293 o#rec_flag r o#binding bi o#reset_semi#expr
18295 | Ast.ExMat (_, e, a) ->
18296 pp f "@[<hv0>@[<hv0>@[<2>match %a@]@ with@]%a@]"
18297 o#expr e o#match_case a
18298 | Ast.ExTry (_, e, a) ->
18299 pp f "@[<0>@[<hv2>try@ %a@]@ @[<0>with%a@]@]"
18300 o#expr e o#match_case a
18301 | Ast.ExAsf _ -> pp f "@[<2>assert@ false@]"
18302 | Ast.ExAsr (_, e) ->
18303 pp f "@[<2>assert@ %a@]" o#dot_expr e
18304 | Ast.ExLmd (_, s, me, e) ->
18305 pp f "@[<2>let module %a =@ %a@]@ @[<2>in@ %a@]"
18306 o#var s o#module_expr me o#reset_semi#expr e
18307 | e -> o#apply_expr f e
18309 method apply_expr =
18310 fun f e ->
18311 let () = o#node f e Ast.loc_of_expr
18313 match e with
18314 | Ast.ExNew (_, i) -> pp f "@[<2>new@ %a@]" o#ident i
18315 | e -> o#dot_expr f e
18317 method dot_expr =
18318 fun f e ->
18319 let () = o#node f e Ast.loc_of_expr
18321 match e with
18322 | Ast.ExAcc (_, e,
18323 (Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
18324 pp f "@[<2>!@,%a@]" o#simple_expr e
18325 | Ast.ExAcc (_, e1, e2) ->
18326 pp f "@[<2>%a.@,%a@]" o#dot_expr e1 o#dot_expr e2
18327 | Ast.ExAre (_, e1, e2) ->
18328 pp f "@[<2>%a.@,(%a)@]" o#dot_expr e1 o#expr e2
18329 | Ast.ExSte (_, e1, e2) ->
18330 pp f "%a.@[<1>[@,%a@]@,]" o#dot_expr e1 o#expr e2
18331 | Ast.ExSnd (_, e, s) ->
18332 pp f "@[<2>%a#@,%s@]" o#dot_expr e s
18333 | e -> o#simple_expr f e
18335 method simple_expr =
18336 fun f e ->
18337 let () = o#node f e Ast.loc_of_expr
18339 match e with
18340 | Ast.ExNil _ -> ()
18341 | Ast.ExSeq (_, e) -> pp f "@[<hv1>(%a)@]" o#seq e
18342 | Ast.ExApp (_,
18343 (Ast.ExApp (_,
18344 (Ast.ExId (_, (Ast.IdUid (_, "::")))), _)),
18345 _) -> o#expr_list_cons true f e
18346 | Ast.ExTup (_, e) -> pp f "@[<1>(%a)@]" o#expr e
18347 | Ast.ExArr (_, e) ->
18348 pp f "@[<0>@[<2>[|@ %a@]@ |]@]" o#under_semi#expr e
18349 | Ast.ExCoe (_, e, (Ast.TyNil _), t) ->
18350 pp f "@[<2>(%a :>@ %a)@]" o#expr e o#ctyp t
18351 | Ast.ExCoe (_, e, t1, t2) ->
18352 pp f "@[<2>(%a :@ %a :>@ %a)@]" o#expr e o#ctyp t1
18353 o#ctyp t2
18354 | Ast.ExTyc (_, e, t) ->
18355 pp f "@[<2>(%a :@ %a)@]" o#expr e o#ctyp t
18356 | Ast.ExAnt (_, s) -> o#anti f s
18357 | Ast.ExFor (_, s, e1, e2, df, e3) ->
18358 pp f
18359 "@[<hv0>@[<hv2>@[<2>for %a =@ %a@ %a@ %a@ do@]@ %a@]@ done@]"
18360 o#var s o#expr e1 o#direction_flag df o#expr e2
18361 o#seq e3
18362 | Ast.ExInt (_, s) -> o#numeric f s ""
18363 | Ast.ExNativeInt (_, s) -> o#numeric f s "n"
18364 | Ast.ExInt64 (_, s) -> o#numeric f s "L"
18365 | Ast.ExInt32 (_, s) -> o#numeric f s "l"
18366 | Ast.ExFlo (_, s) -> o#numeric f s ""
18367 | Ast.ExChr (_, s) -> pp f "'%s'" (ocaml_char s)
18368 | Ast.ExId (_, i) -> o#var_ident f i
18369 | Ast.ExRec (_, b, (Ast.ExNil _)) ->
18370 pp f "@[<hv0>@[<hv2>{%a@]@ }@]" o#record_binding b
18371 | Ast.ExRec (_, b, e) ->
18372 pp f "@[<hv0>@[<hv2>{@ (%a)@ with%a@]@ }@]"
18373 o#expr e o#record_binding b
18374 | Ast.ExStr (_, s) -> pp f "\"%s\"" s
18375 | Ast.ExWhi (_, e1, e2) ->
18376 pp f "@[<2>while@ %a@ do@ %a@ done@]" o#expr e1
18377 o#seq e2
18378 | Ast.ExLab (_, s, (Ast.ExNil _)) -> pp f "~%s" s
18379 | Ast.ExLab (_, s, e) ->
18380 pp f "@[<2>~%s:@ %a@]" s o#dot_expr e
18381 | Ast.ExOlb (_, s, (Ast.ExNil _)) -> pp f "?%s" s
18382 | Ast.ExOlb (_, s, e) ->
18383 pp f "@[<2>?%s:@ %a@]" s o#dot_expr e
18384 | Ast.ExVrn (_, s) -> pp f "`%a" o#var s
18385 | Ast.ExOvr (_, b) ->
18386 pp f "@[<hv0>@[<hv2>{<%a@]@ >}@]" o#record_binding
18388 | Ast.ExObj (_, (Ast.PaNil _), cst) ->
18389 pp f "@[<hv0>@[<hv2>object@ %a@]@ end@]"
18390 o#class_str_item cst
18391 | Ast.ExObj (_, (Ast.PaTyc (_, p, t)), cst) ->
18392 pp f
18393 "@[<hv0>@[<hv2>object @[<1>(%a :@ %a)@]@ %a@]@ end@]"
18394 o#patt p o#ctyp t o#class_str_item cst
18395 | Ast.ExObj (_, p, cst) ->
18396 pp f
18397 "@[<hv0>@[<hv2>object @[<2>(%a)@]@ %a@]@ end@]"
18398 o#patt p o#class_str_item cst
18399 | Ast.ExCom (_, e1, e2) ->
18400 pp f "%a,@ %a" o#simple_expr e1 o#simple_expr e2
18401 | Ast.ExSem (_, e1, e2) ->
18402 pp f "%a;@ %a" o#under_semi#expr e1 o#expr e2
18403 | Ast.ExApp (_, _, _) | Ast.ExAcc (_, _, _) |
18404 Ast.ExAre (_, _, _) | Ast.ExSte (_, _, _) |
18405 Ast.ExAss (_, _, _) | Ast.ExSnd (_, _, _) |
18406 Ast.ExFun (_, _) | Ast.ExMat (_, _, _) |
18407 Ast.ExTry (_, _, _) | Ast.ExIfe (_, _, _, _) |
18408 Ast.ExLet (_, _, _, _) | Ast.ExLmd (_, _, _, _) |
18409 Ast.ExAsr (_, _) | Ast.ExAsf _ | Ast.ExLaz (_, _) |
18410 Ast.ExNew (_, _) -> pp f "(%a)" o#reset#expr e
18412 method direction_flag =
18413 fun f b ->
18414 match b with
18415 | Ast.BTrue -> pp_print_string f "to"
18416 | Ast.BFalse -> pp_print_string f "downto"
18417 | Ast.BAnt s -> o#anti f s
18419 method patt =
18420 fun f p ->
18421 let () = o#node f p Ast.loc_of_patt
18423 match p with
18424 | Ast.PaAli (_, p1, p2) ->
18425 pp f "@[<1>(%a@ as@ %a)@]" o#patt p1 o#patt p2
18426 | Ast.PaEq (_, i, p) ->
18427 pp f "@[<2>%a =@ %a@]" o#var_ident i o#patt p
18428 | Ast.PaSem (_, p1, p2) ->
18429 pp f "%a;@ %a" o#patt p1 o#patt p2
18430 | p -> o#patt1 f p
18432 method patt1 =
18433 fun f ->
18434 function
18435 | Ast.PaOrp (_, p1, p2) ->
18436 pp f "@[<2>%a@ |@ %a@]" o#patt1 p1 o#patt2 p2
18437 | p -> o#patt2 f p
18439 method patt2 = fun f p -> o#patt3 f p
18441 method patt3 =
18442 fun f ->
18443 function
18444 | Ast.PaRng (_, p1, p2) ->
18445 pp f "@[<2>%a@ ..@ %a@]" o#patt3 p1 o#patt4 p2
18446 | Ast.PaCom (_, p1, p2) ->
18447 pp f "%a,@ %a" o#patt3 p1 o#patt3 p2
18448 | p -> o#patt4 f p
18450 method patt4 =
18451 fun f ->
18452 function
18453 | (Ast.PaApp (_,
18454 (Ast.PaApp (_,
18455 (Ast.PaId (_, (Ast.IdUid (_, "::")))), _)),
18457 as p) ->
18458 let (pl, c) = o#mk_patt_list p
18460 (match c with
18461 | None ->
18462 pp f "@[<2>[@ %a@]@ ]" (list o#patt ";@ ") pl
18463 | Some x ->
18464 pp f "@[<2>%a@]" (list o#patt5 " ::@ ")
18465 (pl @ [ x ]))
18466 | p -> o#patt5 f p
18468 method patt5 =
18469 fun f ->
18470 function
18471 | (Ast.PaApp (_,
18472 (Ast.PaApp (_,
18473 (Ast.PaId (_, (Ast.IdUid (_, "::")))), _)),
18475 as p) -> o#simple_patt f p
18476 | Ast.PaApp (_, x, y) ->
18477 let (a, al) = get_patt_args x [ y ]
18479 if not (Ast.is_patt_constructor a)
18480 then
18481 Format.eprintf
18482 "WARNING: strange pattern application of a non constructor@."
18483 else
18484 if curry_constr
18485 then
18486 pp f "@[<2>%a@]" (list o#simple_patt "@ ")
18487 (a :: al)
18488 else
18489 (match al with
18490 | [ Ast.PaTup (_, _) ] ->
18491 pp f "@[<2>%a@ (%a)@]" o#simple_patt x
18492 o#patt y
18493 | [ _ ] ->
18494 pp f "@[<2>%a@ %a@]" o#patt5 x
18495 o#simple_patt y
18496 | al ->
18497 pp f "@[<2>%a@ (%a)@]" o#patt5 a
18498 (list o#simple_patt ",@ ") al)
18499 | p -> o#simple_patt f p
18501 method simple_patt =
18502 fun f p ->
18503 let () = o#node f p Ast.loc_of_patt
18505 match p with
18506 | Ast.PaNil _ -> ()
18507 | Ast.PaId (_, i) -> o#var_ident f i
18508 | Ast.PaAnt (_, s) -> o#anti f s
18509 | Ast.PaAny _ -> pp f "_"
18510 | Ast.PaTup (_, p) -> pp f "@[<1>(%a)@]" o#patt3 p
18511 | Ast.PaRec (_, p) -> pp f "@[<hv2>{@ %a@]@ }" o#patt p
18512 | Ast.PaStr (_, s) -> pp f "\"%s\"" s
18513 | Ast.PaTyc (_, p, t) ->
18514 pp f "@[<1>(%a :@ %a)@]" o#patt p o#ctyp t
18515 | Ast.PaNativeInt (_, s) -> o#numeric f s "n"
18516 | Ast.PaInt64 (_, s) -> o#numeric f s "L"
18517 | Ast.PaInt32 (_, s) -> o#numeric f s "l"
18518 | Ast.PaInt (_, s) -> o#numeric f s ""
18519 | Ast.PaFlo (_, s) -> o#numeric f s ""
18520 | Ast.PaChr (_, s) -> pp f "'%s'" (ocaml_char s)
18521 | Ast.PaLab (_, s, (Ast.PaNil _)) -> pp f "~%s" s
18522 | Ast.PaVrn (_, s) -> pp f "`%a" o#var s
18523 | Ast.PaTyp (_, i) -> pp f "@[<2>#%a@]" o#ident i
18524 | Ast.PaArr (_, p) -> pp f "@[<2>[|@ %a@]@ |]" o#patt p
18525 | Ast.PaLab (_, s, p) ->
18526 pp f "@[<2>~%s:@ (%a)@]" s o#patt p
18527 | Ast.PaOlb (_, s, (Ast.PaNil _)) -> pp f "?%s" s
18528 | Ast.PaOlb (_, "", p) ->
18529 pp f "@[<2>?(%a)@]" o#patt_tycon p
18530 | Ast.PaOlb (_, s, p) ->
18531 pp f "@[<2>?%s:@,@[<1>(%a)@]@]" s o#patt_tycon p
18532 | Ast.PaOlbi (_, "", p, e) ->
18533 pp f "@[<2>?(%a =@ %a)@]" o#patt_tycon p o#expr e
18534 | Ast.PaOlbi (_, s, p, e) ->
18535 pp f "@[<2>?%s:@,@[<1>(%a =@ %a)@]@]" s
18536 o#patt_tycon p o#expr e
18537 | (Ast.PaApp (_, _, _) | Ast.PaAli (_, _, _) |
18538 Ast.PaOrp (_, _, _) | Ast.PaRng (_, _, _) |
18539 Ast.PaCom (_, _, _) | Ast.PaSem (_, _, _) |
18540 Ast.PaEq (_, _, _)
18541 as p) -> pp f "@[<1>(%a)@]" o#patt p
18543 method patt_tycon =
18544 fun f ->
18545 function
18546 | Ast.PaTyc (_, p, t) ->
18547 pp f "%a :@ %a" o#patt p o#ctyp t
18548 | p -> o#patt f p
18550 method simple_ctyp =
18551 fun f t ->
18552 let () = o#node f t Ast.loc_of_ctyp
18554 match t with
18555 | Ast.TyId (_, i) -> o#ident f i
18556 | Ast.TyAnt (_, s) -> o#anti f s
18557 | Ast.TyAny _ -> pp f "_"
18558 | Ast.TyLab (_, s, t) ->
18559 pp f "@[<2>%s:@ %a@]" s o#simple_ctyp t
18560 | Ast.TyOlb (_, s, t) ->
18561 pp f "@[<2>?%s:@ %a@]" s o#simple_ctyp t
18562 | Ast.TyObj (_, (Ast.TyNil _), Ast.BFalse) ->
18563 pp f "< >"
18564 | Ast.TyObj (_, (Ast.TyNil _), Ast.BTrue) ->
18565 pp f "< .. >"
18566 | Ast.TyObj (_, t, Ast.BTrue) ->
18567 pp f "@[<0>@[<2><@ %a;@ ..@]@ >@]" o#ctyp t
18568 | Ast.TyObj (_, t, Ast.BFalse) ->
18569 pp f "@[<0>@[<2><@ %a@]@ >@]" o#ctyp t
18570 | Ast.TyQuo (_, s) -> pp f "'%a" o#var s
18571 | Ast.TyRec (_, t) -> pp f "@[<2>{@ %a@]@ }" o#ctyp t
18572 | Ast.TySum (_, t) -> pp f "@[<0>%a@]" o#sum_type t
18573 | Ast.TyTup (_, t) -> pp f "@[<1>(%a)@]" o#ctyp t
18574 | Ast.TyVrnEq (_, t) ->
18575 pp f "@[<2>[@ %a@]@ ]" o#sum_type t
18576 | Ast.TyVrnInf (_, t) ->
18577 pp f "@[<2>[<@ %a@]@,]" o#sum_type t
18578 | Ast.TyVrnInfSup (_, t1, t2) ->
18579 let (a, al) = get_ctyp_args t2 []
18581 pp f "@[<2>[<@ %a@ >@ %a@]@ ]" o#sum_type t1
18582 (list o#simple_ctyp "@ ") (a :: al)
18583 | Ast.TyVrnSup (_, t) ->
18584 pp f "@[<2>[>@ %a@]@,]" o#sum_type t
18585 | Ast.TyCls (_, i) -> pp f "@[<2>#%a@]" o#ident i
18586 | Ast.TyMan (_, t1, t2) ->
18587 pp f "@[<2>%a =@ %a@]" o#simple_ctyp t1
18588 o#simple_ctyp t2
18589 | Ast.TyVrn (_, s) -> pp f "`%a" o#var s
18590 | Ast.TySta (_, t1, t2) ->
18591 pp f "%a *@ %a" o#simple_ctyp t1 o#simple_ctyp t2
18592 | Ast.TyNil _ -> assert false
18593 | t -> pp f "@[<1>(%a)@]" o#ctyp t
18595 method ctyp =
18596 fun f t ->
18597 let () = o#node f t Ast.loc_of_ctyp
18599 match t with
18600 | Ast.TyAli (_, t1, t2) ->
18601 pp f "@[<2>%a@ as@ %a@]" o#simple_ctyp t1
18602 o#simple_ctyp t2
18603 | Ast.TyArr (_, t1, t2) ->
18604 pp f "@[<2>%a@ ->@ %a@]" o#ctyp1 t1 o#ctyp t2
18605 | Ast.TyQuP (_, s) -> pp f "+'%a" o#var s
18606 | Ast.TyQuM (_, s) -> pp f "-'%a" o#var s
18607 | Ast.TyOr (_, t1, t2) ->
18608 pp f "%a@ | %a" o#ctyp t1 o#ctyp t2
18609 | Ast.TyCol (_, t1, (Ast.TyMut (_, t2))) ->
18610 pp f "@[mutable@ %a :@ %a@]" o#ctyp t1 o#ctyp t2
18611 | Ast.TyCol (_, t1, t2) ->
18612 pp f "@[<2>%a :@ %a@]" o#ctyp t1 o#ctyp t2
18613 | Ast.TySem (_, t1, t2) ->
18614 pp f "%a;@ %a" o#ctyp t1 o#ctyp t2
18615 | Ast.TyOf (_, t, (Ast.TyNil _)) -> o#ctyp f t
18616 | Ast.TyOf (_, t1, t2) ->
18617 pp f "@[<h>%a@ @[<3>of@ %a@]@]" o#ctyp t1
18618 o#constructor_type t2
18619 | Ast.TyOfAmp (_, t1, t2) ->
18620 pp f "@[<h>%a@ @[<3>of &@ %a@]@]" o#ctyp t1
18621 o#constructor_type t2
18622 | Ast.TyAnd (_, t1, t2) ->
18623 pp f "%a@ and %a" o#ctyp t1 o#ctyp t2
18624 | Ast.TyMut (_, t) ->
18625 pp f "@[<2>mutable@ %a@]" o#ctyp t
18626 | Ast.TyAmp (_, t1, t2) ->
18627 pp f "%a@ &@ %a" o#ctyp t1 o#ctyp t2
18628 | Ast.TyDcl (_, tn, tp, te, cl) ->
18629 (pp f "@[<2>%a%a@]" o#type_params tp o#var tn;
18630 (match te with
18631 | Ast.TyNil _ -> ()
18632 | _ -> pp f " =@ %a" o#ctyp te);
18633 if cl <> []
18634 then pp f "@ %a" (list o#constrain "@ ") cl
18635 else ())
18636 | t -> o#ctyp1 f t
18638 method ctyp1 =
18639 fun f ->
18640 function
18641 | Ast.TyApp (_, t1, t2) ->
18642 (match get_ctyp_args t1 [ t2 ] with
18643 | (_, [ _ ]) ->
18644 pp f "@[<2>%a@ %a@]" o#simple_ctyp t2
18645 o#simple_ctyp t1
18646 | (a, al) ->
18647 pp f "@[<2>(%a)@ %a@]" (list o#ctyp ",@ ") al
18648 o#simple_ctyp a)
18649 | Ast.TyPol (_, t1, t2) ->
18650 let (a, al) = get_ctyp_args t1 []
18652 pp f "@[<2>%a.@ %a@]" (list o#ctyp "@ ") (a :: al)
18653 o#ctyp t2
18654 | Ast.TyPrv (_, t) ->
18655 pp f "@[private@ %a@]" o#simple_ctyp t
18656 | t -> o#simple_ctyp f t
18658 method constructor_type =
18659 fun f t ->
18660 match t with
18661 | Ast.TyAnd (loc, t1, t2) ->
18662 let () = o#node f t (fun _ -> loc)
18664 pp f "%a@ * %a" o#constructor_type t1
18665 o#constructor_type t2
18666 | Ast.TyArr (_, _, _) -> pp f "(%a)" o#ctyp t
18667 | t -> o#ctyp f t
18669 method sig_item =
18670 fun f sg ->
18671 let () = o#node f sg Ast.loc_of_sig_item
18673 match sg with
18674 | Ast.SgNil _ -> ()
18675 | Ast.SgSem (_, sg, (Ast.SgNil _)) |
18676 Ast.SgSem (_, (Ast.SgNil _), sg) -> o#sig_item f sg
18677 | Ast.SgSem (_, sg1, sg2) ->
18678 (o#sig_item f sg1; cut f; o#sig_item f sg2)
18679 | Ast.SgExc (_, t) ->
18680 pp f "@[<2>exception@ %a%(%)@]" o#ctyp t semisep
18681 | Ast.SgExt (_, s, t, sl) ->
18682 pp f "@[<2>external@ %a :@ %a =@ %a%(%)@]"
18683 o#var s o#ctyp t (meta_list o#quoted_string "@ ")
18684 sl semisep
18685 | Ast.SgMod (_, s1, (Ast.MtFun (_, s2, mt1, mt2))) ->
18686 let rec loop accu =
18687 (function
18688 | Ast.MtFun (_, s, mt1, mt2) ->
18689 loop ((s, mt1) :: accu) mt2
18690 | mt -> ((List.rev accu), mt)) in
18691 let (al, mt) = loop [ (s2, mt1) ] mt2
18693 pp f "@[<2>module %a@ @[<0>%a@] :@ %a%(%)@]"
18694 o#var s1 o#functor_args al o#module_type mt
18695 semisep
18696 | Ast.SgMod (_, s, mt) ->
18697 pp f "@[<2>module %a :@ %a%(%)@]" o#var s
18698 o#module_type mt semisep
18699 | Ast.SgMty (_, s, (Ast.MtNil _)) ->
18700 pp f "@[<2>module type %a%(%)@]" o#var s semisep
18701 | Ast.SgMty (_, s, mt) ->
18702 pp f "@[<2>module type %a =@ %a%(%)@]" o#var s
18703 o#module_type mt semisep
18704 | Ast.SgOpn (_, sl) ->
18705 pp f "@[<2>open@ %a%(%)@]" o#ident sl semisep
18706 | Ast.SgTyp (_, t) ->
18707 pp f "@[<hv0>@[<hv2>type %a@]%(%)@]" o#ctyp t
18708 semisep
18709 | Ast.SgVal (_, s, t) ->
18710 pp f "@[<2>%s %a :@ %a%(%)@]" value_val o#var s
18711 o#ctyp t semisep
18712 | Ast.SgInc (_, mt) ->
18713 pp f "@[<2>include@ %a%(%)@]" o#module_type mt
18714 semisep
18715 | Ast.SgClt (_, ct) ->
18716 pp f "@[<2>class type %a%(%)@]" o#class_type ct
18717 semisep
18718 | Ast.SgCls (_, ce) ->
18719 pp f "@[<2>class %a%(%)@]" o#class_type ce semisep
18720 | Ast.SgRecMod (_, mb) ->
18721 pp f "@[<2>module rec %a%(%)@]"
18722 o#module_rec_binding mb semisep
18723 | Ast.SgDir (_, _, _) -> ()
18724 | Ast.SgAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
18726 method str_item =
18727 fun f st ->
18728 let () = o#node f st Ast.loc_of_str_item
18730 match st with
18731 | Ast.StNil _ -> ()
18732 | Ast.StSem (_, st, (Ast.StNil _)) |
18733 Ast.StSem (_, (Ast.StNil _), st) -> o#str_item f st
18734 | Ast.StSem (_, st1, st2) ->
18735 (o#str_item f st1; cut f; o#str_item f st2)
18736 | Ast.StExc (_, t, Ast.ONone) ->
18737 pp f "@[<2>exception@ %a%(%)@]" o#ctyp t semisep
18738 | Ast.StExc (_, t, (Ast.OSome sl)) ->
18739 pp f "@[<2>exception@ %a =@ %a%(%)@]" o#ctyp t
18740 o#ident sl semisep
18741 | Ast.StExt (_, s, t, sl) ->
18742 pp f "@[<2>external@ %a :@ %a =@ %a%(%)@]"
18743 o#var s o#ctyp t (meta_list o#quoted_string "@ ")
18744 sl semisep
18745 | Ast.StMod (_, s1, (Ast.MeFun (_, s2, mt1, me))) ->
18746 (match o#module_expr_get_functor_args [ (s2, mt1) ]
18748 with
18749 | (al, me, Some mt2) ->
18750 pp f
18751 "@[<2>module %a@ @[<0>%a@] :@ %a =@ %a%(%)@]"
18752 o#var s1 o#functor_args al o#module_type mt2
18753 o#module_expr me semisep
18754 | (al, me, _) ->
18755 pp f "@[<2>module %a@ @[<0>%a@] =@ %a%(%)@]"
18756 o#var s1 o#functor_args al o#module_expr me
18757 semisep)
18758 | Ast.StMod (_, s, (Ast.MeTyc (_, me, mt))) ->
18759 pp f "@[<2>module %a :@ %a =@ %a%(%)@]" o#var s
18760 o#module_type mt o#module_expr me semisep
18761 | Ast.StMod (_, s, me) ->
18762 pp f "@[<2>module %a =@ %a%(%)@]" o#var s
18763 o#module_expr me semisep
18764 | Ast.StMty (_, s, mt) ->
18765 pp f "@[<2>module type %a =@ %a%(%)@]" o#var s
18766 o#module_type mt semisep
18767 | Ast.StOpn (_, sl) ->
18768 pp f "@[<2>open@ %a%(%)@]" o#ident sl semisep
18769 | Ast.StTyp (_, t) ->
18770 pp f "@[<hv0>@[<hv2>type %a@]%(%)@]" o#ctyp t
18771 semisep
18772 | Ast.StVal (_, r, bi) ->
18773 pp f "@[<2>%s %a%a%(%)@]" value_let o#rec_flag r
18774 o#binding bi semisep
18775 | Ast.StExp (_, e) ->
18776 pp f "@[<2>let _ =@ %a%(%)@]" o#expr e semisep
18777 | Ast.StInc (_, me) ->
18778 pp f "@[<2>include@ %a%(%)@]" o#module_expr me
18779 semisep
18780 | Ast.StClt (_, ct) ->
18781 pp f "@[<2>class type %a%(%)@]" o#class_type ct
18782 semisep
18783 | Ast.StCls (_, ce) ->
18784 pp f "@[<hv2>class %a%(%)@]" o#class_declaration ce
18785 semisep
18786 | Ast.StRecMod (_, mb) ->
18787 pp f "@[<2>module rec %a%(%)@]"
18788 o#module_rec_binding mb semisep
18789 | Ast.StDir (_, _, _) -> ()
18790 | Ast.StAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
18791 | Ast.StExc (_, _, (Ast.OAnt _)) -> assert false
18793 method module_type =
18794 fun f mt ->
18795 let () = o#node f mt Ast.loc_of_module_type
18797 match mt with
18798 | Ast.MtNil _ -> assert false
18799 | Ast.MtId (_, i) -> o#ident f i
18800 | Ast.MtAnt (_, s) -> o#anti f s
18801 | Ast.MtFun (_, s, mt1, mt2) ->
18802 pp f "@[<2>functor@ @[<1>(%a :@ %a)@]@ ->@ %a@]"
18803 o#var s o#module_type mt1 o#module_type mt2
18804 | Ast.MtQuo (_, s) -> pp f "'%a" o#var s
18805 | Ast.MtSig (_, sg) ->
18806 pp f "@[<hv0>@[<hv2>sig@ %a@]@ end@]" o#sig_item sg
18807 | Ast.MtWit (_, mt, wc) ->
18808 pp f "@[<2>%a@ with@ %a@]" o#module_type mt
18809 o#with_constraint wc
18811 method with_constraint =
18812 fun f wc ->
18813 let () = o#node f wc Ast.loc_of_with_constr
18815 match wc with
18816 | Ast.WcNil _ -> ()
18817 | Ast.WcTyp (_, t1, t2) ->
18818 pp f "@[<2>type@ %a =@ %a@]" o#ctyp t1 o#ctyp t2
18819 | Ast.WcMod (_, i1, i2) ->
18820 pp f "@[<2>module@ %a =@ %a@]" o#ident i1 o#ident
18822 | Ast.WcAnd (_, wc1, wc2) ->
18823 (o#with_constraint f wc1;
18824 pp f andsep;
18825 o#with_constraint f wc2)
18826 | Ast.WcAnt (_, s) -> o#anti f s
18828 method module_expr =
18829 fun f me ->
18830 let () = o#node f me Ast.loc_of_module_expr
18832 match me with
18833 | Ast.MeNil _ -> assert false
18834 | Ast.MeId (_, i) -> o#ident f i
18835 | Ast.MeAnt (_, s) -> o#anti f s
18836 | Ast.MeApp (_, me1, me2) ->
18837 pp f "@[<2>%a@,(%a)@]" o#module_expr me1
18838 o#module_expr me2
18839 | Ast.MeFun (_, s, mt, me) ->
18840 pp f "@[<2>functor@ @[<1>(%a :@ %a)@]@ ->@ %a@]"
18841 o#var s o#module_type mt o#module_expr me
18842 | Ast.MeStr (_, st) ->
18843 pp f "@[<hv0>@[<hv2>struct@ %a@]@ end@]" o#str_item
18845 | Ast.MeTyc (_, (Ast.MeStr (_, st)),
18846 (Ast.MtSig (_, sg))) ->
18847 pp f
18848 "@[<2>@[<hv2>struct@ %a@]@ end :@ @[<hv2>sig@ %a@]@ end@]"
18849 o#str_item st o#sig_item sg
18850 | Ast.MeTyc (_, me, mt) ->
18851 pp f "@[<1>(%a :@ %a)@]" o#module_expr me
18852 o#module_type mt
18854 method class_expr =
18855 fun f ce ->
18856 let () = o#node f ce Ast.loc_of_class_expr
18858 match ce with
18859 | Ast.CeApp (_, ce, e) ->
18860 pp f "@[<2>%a@ %a@]" o#class_expr ce o#expr e
18861 | Ast.CeCon (_, Ast.BFalse, i, (Ast.TyNil _)) ->
18862 pp f "@[<2>%a@]" o#ident i
18863 | Ast.CeCon (_, Ast.BFalse, i, t) ->
18864 pp f "@[<2>@[<1>[%a]@]@ %a@]" o#class_params t
18865 o#ident i
18866 | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
18867 (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
18868 | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
18869 pp f "@[<2>virtual@ @[<1>[%a]@]@ %a@]"
18870 o#class_params t o#var i
18871 | Ast.CeFun (_, p, ce) ->
18872 pp f "@[<2>fun@ %a@ ->@ %a@]" o#patt p o#class_expr
18874 | Ast.CeLet (_, r, bi, ce) ->
18875 pp f "@[<2>let %a%a@]@ @[<2>in@ %a@]" o#rec_flag r
18876 o#binding bi o#class_expr ce
18877 | Ast.CeStr (_, (Ast.PaNil _), cst) ->
18878 pp f "@[<hv0>@[<hv2>object %a@]@ end@]"
18879 o#class_str_item cst
18880 | Ast.CeStr (_, p, cst) ->
18881 pp f
18882 "@[<hv0>@[<hv2>object @[<1>(%a)@]@ %a@]@ end@]"
18883 o#patt p o#class_str_item cst
18884 | Ast.CeTyc (_, ce, ct) ->
18885 pp f "@[<1>(%a :@ %a)@]" o#class_expr ce
18886 o#class_type ct
18887 | Ast.CeAnt (_, s) -> o#anti f s
18888 | Ast.CeAnd (_, ce1, ce2) ->
18889 (o#class_expr f ce1;
18890 pp f andsep;
18891 o#class_expr f ce2)
18892 | Ast.CeEq (_, ce1, (Ast.CeFun (_, p, ce2))) when
18893 is_irrefut_patt p ->
18894 pp f "@[<2>%a@ %a" o#class_expr ce1
18895 o#patt_class_expr_fun_args (p, ce2)
18896 | Ast.CeEq (_, ce1, ce2) ->
18897 pp f "@[<2>%a =@]@ %a" o#class_expr ce1
18898 o#class_expr ce2
18899 | _ -> assert false
18901 method class_type =
18902 fun f ct ->
18903 let () = o#node f ct Ast.loc_of_class_type
18905 match ct with
18906 | Ast.CtCon (_, Ast.BFalse, i, (Ast.TyNil _)) ->
18907 pp f "@[<2>%a@]" o#ident i
18908 | Ast.CtCon (_, Ast.BFalse, i, t) ->
18909 pp f "@[<2>[@,%a@]@,]@ %a" o#class_params t
18910 o#ident i
18911 | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
18912 (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
18913 | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
18914 pp f "@[<2>virtual@ [@,%a@]@,]@ %a" o#class_params
18915 t o#var i
18916 | Ast.CtFun (_, t, ct) ->
18917 pp f "@[<2>%a@ ->@ %a@]" o#simple_ctyp t
18918 o#class_type ct
18919 | Ast.CtSig (_, (Ast.TyNil _), csg) ->
18920 pp f "@[<hv0>@[<hv2>object@ %a@]@ end@]"
18921 o#class_sig_item csg
18922 | Ast.CtSig (_, t, csg) ->
18923 pp f
18924 "@[<hv0>@[<hv2>object @[<1>(%a)@]@ %a@]@ end@]"
18925 o#ctyp t o#class_sig_item csg
18926 | Ast.CtAnt (_, s) -> o#anti f s
18927 | Ast.CtAnd (_, ct1, ct2) ->
18928 (o#class_type f ct1;
18929 pp f andsep;
18930 o#class_type f ct2)
18931 | Ast.CtCol (_, ct1, ct2) ->
18932 pp f "%a :@ %a" o#class_type ct1 o#class_type ct2
18933 | Ast.CtEq (_, ct1, ct2) ->
18934 pp f "%a =@ %a" o#class_type ct1 o#class_type ct2
18935 | _ -> assert false
18937 method class_sig_item =
18938 fun f csg ->
18939 let () = o#node f csg Ast.loc_of_class_sig_item
18941 match csg with
18942 | Ast.CgNil _ -> ()
18943 | Ast.CgSem (_, csg, (Ast.CgNil _)) |
18944 Ast.CgSem (_, (Ast.CgNil _), csg) ->
18945 o#class_sig_item f csg
18946 | Ast.CgSem (_, csg1, csg2) ->
18947 (o#class_sig_item f csg1;
18948 cut f;
18949 o#class_sig_item f csg2)
18950 | Ast.CgCtr (_, t1, t2) ->
18951 pp f "@[<2>constraint@ %a =@ %a%(%)@]" o#ctyp t1
18952 o#ctyp t2 semisep
18953 | Ast.CgInh (_, ct) ->
18954 pp f "@[<2>inherit@ %a%(%)@]" o#class_type ct
18955 semisep
18956 | Ast.CgMth (_, s, pr, t) ->
18957 pp f "@[<2>method %a%a :@ %a%(%)@]" o#private_flag
18958 pr o#var s o#ctyp t semisep
18959 | Ast.CgVir (_, s, pr, t) ->
18960 pp f "@[<2>method virtual %a%a :@ %a%(%)@]"
18961 o#private_flag pr o#var s o#ctyp t semisep
18962 | Ast.CgVal (_, s, mu, vi, t) ->
18963 pp f "@[<2>%s %a%a%a :@ %a%(%)@]" value_val
18964 o#mutable_flag mu o#virtual_flag vi o#var s
18965 o#ctyp t semisep
18966 | Ast.CgAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
18968 method class_str_item =
18969 fun f cst ->
18970 let () = o#node f cst Ast.loc_of_class_str_item
18972 match cst with
18973 | Ast.CrNil _ -> ()
18974 | Ast.CrSem (_, cst, (Ast.CrNil _)) |
18975 Ast.CrSem (_, (Ast.CrNil _), cst) ->
18976 o#class_str_item f cst
18977 | Ast.CrSem (_, cst1, cst2) ->
18978 (o#class_str_item f cst1;
18979 cut f;
18980 o#class_str_item f cst2)
18981 | Ast.CrCtr (_, t1, t2) ->
18982 pp f "@[<2>constraint %a =@ %a%(%)@]" o#ctyp t1
18983 o#ctyp t2 semisep
18984 | Ast.CrInh (_, ce, "") ->
18985 pp f "@[<2>inherit@ %a%(%)@]" o#class_expr ce
18986 semisep
18987 | Ast.CrInh (_, ce, s) ->
18988 pp f "@[<2>inherit@ %a as@ %a%(%)@]" o#class_expr
18989 ce o#var s semisep
18990 | Ast.CrIni (_, e) ->
18991 pp f "@[<2>initializer@ %a%(%)@]" o#expr e semisep
18992 | Ast.CrMth (_, s, pr, e, (Ast.TyNil _)) ->
18993 pp f "@[<2>method %a%a =@ %a%(%)@]" o#private_flag
18994 pr o#var s o#expr e semisep
18995 | Ast.CrMth (_, s, pr, e, t) ->
18996 pp f "@[<2>method %a%a :@ %a =@ %a%(%)@]"
18997 o#private_flag pr o#var s o#ctyp t o#expr e
18998 semisep
18999 | Ast.CrVir (_, s, pr, t) ->
19000 pp f "@[<2>method virtual@ %a%a :@ %a%(%)@]"
19001 o#private_flag pr o#var s o#ctyp t semisep
19002 | Ast.CrVvr (_, s, mu, t) ->
19003 pp f "@[<2>%s virtual %a%a :@ %a%(%)@]" value_val
19004 o#mutable_flag mu o#var s o#ctyp t semisep
19005 | Ast.CrVal (_, s, mu, e) ->
19006 pp f "@[<2>%s %a%a =@ %a%(%)@]" value_val
19007 o#mutable_flag mu o#var s o#expr e semisep
19008 | Ast.CrAnt (_, s) -> pp f "%a%(%)" o#anti s semisep
19010 method implem =
19011 fun f st ->
19012 match st with
19013 | Ast.StExp (_, e) ->
19014 pp f "@[<0>%a%(%)@]@." o#expr e semisep
19015 | st -> pp f "@[<v0>%a@]@." o#str_item st
19017 method interf = fun f sg -> pp f "@[<v0>%a@]@." o#sig_item sg
19021 let with_outfile output_file fct arg =
19022 let call close f =
19023 ((try fct f arg with | exn -> (close (); raise exn));
19024 close ())
19026 match output_file with
19027 | None -> call (fun () -> ()) std_formatter
19028 | Some s ->
19029 let oc = open_out s in
19030 let f = formatter_of_out_channel oc
19031 in call (fun () -> close_out oc) f
19033 let print output_file fct =
19034 let o = new printer () in with_outfile output_file (fct o)
19036 let print_interf ?input_file:(_) ?output_file sg =
19037 print output_file (fun o -> o#interf) sg
19039 let print_implem ?input_file:(_) ?output_file st =
19040 print output_file (fun o -> o#implem) st
19044 module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
19045 Ast).S =
19046 struct
19047 include Make(Syntax)
19049 let semisep : sep ref = ref ("@\n" : sep)
19051 let margin = ref 78
19053 let comments = ref true
19055 let locations = ref false
19057 let curry_constr = ref false
19059 let print output_file fct =
19060 let o =
19061 new printer ~comments: !comments ~curry_constr: !curry_constr
19062 () in
19063 let o = o#set_semisep !semisep in
19064 let o = if !locations then o#set_loc_and_comments else o
19066 with_outfile output_file
19067 (fun f ->
19068 let () = Format.pp_set_margin f !margin
19069 in Format.fprintf f "@[<v0>%a@]@." (fct o))
19071 let print_interf ?input_file:(_) ?output_file sg =
19072 print output_file (fun o -> o#interf) sg
19074 let print_implem ?input_file:(_) ?output_file st =
19075 print output_file (fun o -> o#implem) st
19077 let check_sep s =
19078 if String.contains s '%'
19079 then failwith "-sep Format error, % found in string"
19080 else (Obj.magic (Struct.Token.Eval.string s : string) : sep)
19082 let _ =
19083 Options.add "-l" (Arg.Int (fun i -> margin := i))
19084 "<length> line length for pretty printing."
19086 let _ =
19087 Options.add "-ss" (Arg.Unit (fun () -> semisep := ";;"))
19088 " Print double semicolons."
19090 let _ =
19091 Options.add "-no_ss" (Arg.Unit (fun () -> semisep := ""))
19092 " Do not print double semicolons (default)."
19094 let _ =
19095 Options.add "-sep"
19096 (Arg.String (fun s -> semisep := check_sep s))
19097 " Use this string between phrases."
19099 let _ =
19100 Options.add "-curry-constr" (Arg.Set curry_constr)
19101 "Use currified constructors."
19103 let _ =
19104 Options.add "-no_comments" (Arg.Clear comments)
19105 "Do not add comments."
19107 let _ =
19108 Options.add "-add_locations" (Arg.Set locations)
19109 "Add locations as comment."
19115 module OCamlr :
19117 module Id : Sig.Id
19119 module Make (Syntax : Sig.Camlp4Syntax) :
19121 open Format
19123 include Sig.Camlp4Syntax with module Loc = Syntax.Loc
19124 and module Token = Syntax.Token and module Ast = Syntax.Ast
19125 and module Gram = Syntax.Gram
19127 class printer :
19128 ?curry_constr: bool ->
19129 ?comments: bool ->
19130 unit -> object ('a) inherit OCaml.Make(Syntax).printer
19133 val with_outfile :
19134 string option -> (formatter -> 'a -> unit) -> 'a -> unit
19136 val print :
19137 string option ->
19138 (printer -> formatter -> 'a -> unit) -> 'a -> unit
19142 module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
19143 Ast).S
19145 end =
19146 struct
19147 open Format
19149 module Id =
19150 struct let name = "Camlp4.Printers.OCamlr"
19151 let version = "$Id$"
19154 module Make (Syntax : Sig.Camlp4Syntax) =
19155 struct
19156 include Syntax
19158 open Sig
19160 module PP_o = OCaml.Make(Syntax)
19162 open PP_o
19164 let pp = fprintf
19166 let is_keyword =
19167 let keywords = [ "where" ]
19168 and not_keywords = [ "false"; "function"; "true"; "val" ]
19170 fun s ->
19171 (not (List.mem s not_keywords)) &&
19172 ((is_keyword s) || (List.mem s keywords))
19174 class printer ?curry_constr:(init_curry_constr = true)
19175 ?(comments = true) () =
19176 object (o)
19177 inherit
19178 PP_o.printer ~curry_constr: init_curry_constr ~comments () as
19179 super
19181 val semisep = (";" : sep)
19183 val andsep = ("@]@ @[<2>and@ " : sep)
19185 val value_val = "value"
19187 val value_let = "value"
19189 val mode = if comments then `comments else `no_comments
19191 val curry_constr = init_curry_constr
19193 val first_match_case = true
19195 method under_pipe = o
19197 method under_semi = o
19199 method reset_semi = o
19201 method reset = o
19203 method private unset_first_match_case =
19204 {< first_match_case = false; >}
19206 method private set_first_match_case =
19207 {< first_match_case = true; >}
19209 method seq =
19210 fun f e ->
19211 let rec self right f e =
19212 let go_right = self right
19213 and go_left = self false
19215 match e with
19216 | Ast.ExLet (_, r, bi, e1) ->
19217 if right
19218 then
19219 pp f "@[<2>let %a%a@];@ %a" o#rec_flag r
19220 o#binding bi go_right e1
19221 else pp f "(%a)" o#expr e
19222 | Ast.ExSeq (_, e) -> go_right f e
19223 | Ast.ExSem (_, e1, e2) ->
19224 (pp f "%a;@ " go_left e1;
19225 (match (right, e2) with
19226 | (true, Ast.ExLet (_, r, bi, e3)) ->
19227 pp f "@[<2>let %a%a@];@ %a" o#rec_flag r
19228 o#binding bi go_right e3
19229 | _ -> go_right f e2))
19230 | e -> o#expr f e
19231 in self true f e
19233 method var =
19234 fun f ->
19235 function
19236 | "" -> pp f "$lid:\"\"$"
19237 | "[]" -> pp f "[]"
19238 | "()" -> pp f "()"
19239 | " True" -> pp f "True"
19240 | " False" -> pp f "False"
19241 | v ->
19242 (match lex_string v with
19243 | LIDENT s | UIDENT s | ESCAPED_IDENT s when
19244 is_keyword s -> pp f "%s__" s
19245 | SYMBOL s -> pp f "( %s )" s
19246 | LIDENT s | UIDENT s | ESCAPED_IDENT s ->
19247 pp_print_string f s
19248 | tok ->
19249 failwith
19250 (sprintf "Bad token used as an identifier: %s"
19251 (Token.to_string tok)))
19253 method type_params =
19254 fun f ->
19255 function
19256 | [] -> ()
19257 | [ x ] -> pp f "@ %a" o#ctyp x
19258 | l -> pp f "@ @[<1>%a@]" (list o#ctyp "@ ") l
19260 method match_case =
19261 fun f ->
19262 function
19263 | Ast.McNil _ -> pp f "@ []"
19264 | m ->
19265 pp f "@ [ %a ]" o#set_first_match_case#match_case_aux
19268 method match_case_aux =
19269 fun f ->
19270 function
19271 | Ast.McNil _ -> ()
19272 | Ast.McAnt (_, s) -> o#anti f s
19273 | Ast.McOr (_, a1, a2) ->
19274 pp f "%a%a" o#match_case_aux a1
19275 o#unset_first_match_case#match_case_aux a2
19276 | Ast.McArr (_, p, (Ast.ExNil _), e) ->
19277 let () = if first_match_case then () else pp f "@ | "
19279 pp f "@[<2>%a@ ->@ %a@]" o#patt p o#under_pipe#expr
19281 | Ast.McArr (_, p, w, e) ->
19282 let () = if first_match_case then () else pp f "@ | "
19284 pp f "@[<2>%a@ when@ %a@ ->@ %a@]" o#patt p
19285 o#under_pipe#expr w o#under_pipe#expr e
19287 method sum_type = fun f t -> pp f "@[<hv0>[ %a ]@]" o#ctyp t
19289 method ident =
19290 fun f i ->
19291 let () = o#node f i Ast.loc_of_ident
19293 match i with
19294 | Ast.IdApp (_, i1, i2) ->
19295 pp f "%a@ %a" o#dot_ident i1 o#dot_ident i2
19296 | i -> o#dot_ident f i
19298 method private dot_ident =
19299 fun f i ->
19300 let () = o#node f i Ast.loc_of_ident
19302 match i with
19303 | Ast.IdAcc (_, i1, i2) ->
19304 pp f "%a.@,%a" o#dot_ident i1 o#dot_ident i2
19305 | Ast.IdAnt (_, s) -> o#anti f s
19306 | Ast.IdLid (_, s) | Ast.IdUid (_, s) -> o#var f s
19307 | i -> pp f "(%a)" o#ident i
19309 method patt4 =
19310 fun f ->
19311 function
19312 | (Ast.PaApp (_,
19313 (Ast.PaApp (_,
19314 (Ast.PaId (_, (Ast.IdUid (_, "::")))), _)),
19316 as p) ->
19317 let (pl, c) = o#mk_patt_list p
19319 (match c with
19320 | None ->
19321 pp f "@[<2>[@ %a@]@ ]" (list o#patt ";@ ") pl
19322 | Some x ->
19323 pp f "@[<2>[ %a ::@ %a ]@]"
19324 (list o#patt ";@ ") pl o#patt x)
19325 | p -> super#patt4 f p
19327 method expr_list_cons =
19328 fun _ f e ->
19329 let (el, c) = o#mk_expr_list e
19331 match c with
19332 | None -> o#expr_list f el
19333 | Some x ->
19334 pp f "@[<2>[ %a ::@ %a ]@]" (list o#expr ";@ ") el
19335 o#expr x
19337 method expr =
19338 fun f e ->
19339 let () = o#node f e Ast.loc_of_expr
19341 match e with
19342 | Ast.ExAss (_, e1, e2) ->
19343 pp f "@[<2>%a@ :=@ %a@]" o#dot_expr e1 o#expr e2
19344 | Ast.ExFun (_, (Ast.McArr (_, p, (Ast.ExNil _), e)))
19345 when Ast.is_irrefut_patt p ->
19346 pp f "@[<2>fun@ %a@]" o#patt_expr_fun_args (p, e)
19347 | Ast.ExFun (_, a) ->
19348 pp f "@[<hv0>fun%a@]" o#match_case a
19349 | Ast.ExAsf _ -> pp f "@[<2>assert@ False@]"
19350 | e -> super#expr f e
19352 method dot_expr =
19353 fun f e ->
19354 let () = o#node f e Ast.loc_of_expr
19356 match e with
19357 | Ast.ExAcc (_, e,
19358 (Ast.ExId (_, (Ast.IdLid (_, "val"))))) ->
19359 pp f "@[<2>%a.@,val@]" o#simple_expr e
19360 | e -> super#dot_expr f e
19362 method ctyp =
19363 fun f t ->
19364 let () = o#node f t Ast.loc_of_ctyp
19366 match t with
19367 | Ast.TyDcl (_, tn, tp, te, cl) ->
19368 (pp f "@[<2>%a%a@]" o#var tn o#type_params tp;
19369 (match te with
19370 | Ast.TyNil _ -> ()
19371 | _ -> pp f " =@ %a" o#ctyp te);
19372 if cl <> []
19373 then pp f "@ %a" (list o#constrain "@ ") cl
19374 else ())
19375 | Ast.TyCol (_, t1, (Ast.TyMut (_, t2))) ->
19376 pp f "@[%a :@ mutable %a@]" o#ctyp t1 o#ctyp t2
19377 | t -> super#ctyp f t
19379 method simple_ctyp =
19380 fun f t ->
19381 let () = o#node f t Ast.loc_of_ctyp
19383 match t with
19384 | Ast.TyVrnEq (_, t) ->
19385 pp f "@[<2>[ =@ %a@]@ ]" o#ctyp t
19386 | Ast.TyVrnInf (_, t) ->
19387 pp f "@[<2>[ <@ %a@]@,]" o#ctyp t
19388 | Ast.TyVrnInfSup (_, t1, t2) ->
19389 pp f "@[<2>[ <@ %a@ >@ %a@]@ ]" o#ctyp t1 o#ctyp t2
19390 | Ast.TyVrnSup (_, t) ->
19391 pp f "@[<2>[ >@ %a@]@,]" o#ctyp t
19392 | Ast.TyMan (_, t1, t2) ->
19393 pp f "@[<2>%a@ ==@ %a@]" o#simple_ctyp t1
19394 o#simple_ctyp t2
19395 | Ast.TyLab (_, s, t) ->
19396 pp f "@[<2>~%s:@ %a@]" s o#simple_ctyp t
19397 | t -> super#simple_ctyp f t
19399 method ctyp1 =
19400 fun f ->
19401 function
19402 | Ast.TyApp (_, t1, t2) ->
19403 (match get_ctyp_args t1 [ t2 ] with
19404 | (_, [ _ ]) ->
19405 pp f "@[<2>%a@ %a@]" o#simple_ctyp t1
19406 o#simple_ctyp t2
19407 | (a, al) ->
19408 pp f "@[<2>%a@]" (list o#simple_ctyp "@ ")
19409 (a :: al))
19410 | Ast.TyPol (_, t1, t2) ->
19411 let (a, al) = get_ctyp_args t1 []
19413 pp f "@[<2>! %a.@ %a@]" (list o#ctyp "@ ")
19414 (a :: al) o#ctyp t2
19415 | t -> super#ctyp1 f t
19417 method constructor_type =
19418 fun f t ->
19419 match t with
19420 | Ast.TyAnd (loc, t1, t2) ->
19421 let () = o#node f t (fun _ -> loc)
19423 pp f "%a@ and %a" o#constructor_type t1
19424 o#constructor_type t2
19425 | t -> o#ctyp f t
19427 method str_item =
19428 fun f st ->
19429 match st with
19430 | Ast.StExp (_, e) ->
19431 pp f "@[<2>%a%(%)@]" o#expr e semisep
19432 | st -> super#str_item f st
19434 method module_expr =
19435 fun f me ->
19436 let () = o#node f me Ast.loc_of_module_expr
19438 match me with
19439 | Ast.MeApp (_, me1, me2) ->
19440 pp f "@[<2>%a@,(%a)@]" o#module_expr me1
19441 o#module_expr me2
19442 | me -> super#module_expr f me
19444 method implem = fun f st -> pp f "@[<v0>%a@]@." o#str_item st
19446 method class_type =
19447 fun f ct ->
19448 let () = o#node f ct Ast.loc_of_class_type
19450 match ct with
19451 | Ast.CtFun (_, t, ct) ->
19452 pp f "@[<2>[ %a ] ->@ %a@]" o#simple_ctyp t
19453 o#class_type ct
19454 | Ast.CtCon (_, Ast.BFalse, i, (Ast.TyNil _)) ->
19455 pp f "@[<2>%a@]" o#ident i
19456 | Ast.CtCon (_, Ast.BFalse, i, t) ->
19457 pp f "@[<2>%a [@,%a@]@,]" o#ident i o#class_params
19459 | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
19460 (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
19461 | Ast.CtCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
19462 pp f "@[<2>virtual@ %a@ [@,%a@]@,]" o#var i
19463 o#class_params t
19464 | ct -> super#class_type f ct
19466 method class_expr =
19467 fun f ce ->
19468 let () = o#node f ce Ast.loc_of_class_expr
19470 match ce with
19471 | Ast.CeCon (_, Ast.BFalse, i, (Ast.TyNil _)) ->
19472 pp f "@[<2>%a@]" o#ident i
19473 | Ast.CeCon (_, Ast.BFalse, i, t) ->
19474 pp f "@[<2>%a@ @[<1>[%a]@]@]" o#ident i
19475 o#class_params t
19476 | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)),
19477 (Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
19478 | Ast.CeCon (_, Ast.BTrue, (Ast.IdLid (_, i)), t) ->
19479 pp f "@[<2>virtual@ %a@ @[<1>[%a]@]@]" o#var i
19480 o#ctyp t
19481 | ce -> super#class_expr f ce
19485 let with_outfile = with_outfile
19487 let print = print
19489 let print_interf = print_interf
19491 let print_implem = print_implem
19495 module MakeMore (Syntax : Sig.Camlp4Syntax) : Sig.Printer(Syntax.
19496 Ast).S =
19497 struct
19498 include Make(Syntax)
19500 let margin = ref 78
19502 let comments = ref true
19504 let locations = ref false
19506 let curry_constr = ref true
19508 let print output_file fct =
19509 let o =
19510 new printer ~comments: !comments ~curry_constr: !curry_constr
19511 () in
19512 let o = if !locations then o#set_loc_and_comments else o
19514 with_outfile output_file
19515 (fun f ->
19516 let () = Format.pp_set_margin f !margin
19517 in Format.fprintf f "@[<v0>%a@]@." (fct o))
19519 let print_interf ?input_file:(_) ?output_file sg =
19520 print output_file (fun o -> o#interf) sg
19522 let print_implem ?input_file:(_) ?output_file st =
19523 print output_file (fun o -> o#implem) st
19525 let _ =
19526 Options.add "-l" (Arg.Int (fun i -> margin := i))
19527 "<length> line length for pretty printing."
19529 let _ =
19530 Options.add "-no_comments" (Arg.Clear comments)
19531 "Do not add comments."
19533 let _ =
19534 Options.add "-add_locations" (Arg.Set locations)
19535 "Add locations as comment."
19543 module OCamlInitSyntax =
19544 struct
19545 module Make
19546 (Ast : Sig.Camlp4Ast)
19547 (Gram :
19548 Sig.Grammar.Static with module Loc = Ast.Loc with
19549 type Token.t = Sig.camlp4_token)
19550 (Quotation : Sig.Quotation with module Ast = Sig.Camlp4AstToAst(Ast)) :
19551 Sig.Camlp4Syntax with module Loc = Ast.Loc and module Ast = Ast
19552 and module Token = Gram.Token and module Gram = Gram
19553 and module Quotation = Quotation =
19554 struct
19555 module Loc = Ast.Loc
19557 module Ast = Ast
19559 module Gram = Gram
19561 module Token = Gram.Token
19563 open Sig
19565 type warning = Loc.t -> string -> unit
19567 let default_warning loc txt =
19568 Format.eprintf "<W> %a: %s@." Loc.print loc txt
19570 let current_warning = ref default_warning
19572 let print_warning loc txt = !current_warning loc txt
19574 let a_CHAR = Gram.Entry.mk "a_CHAR"
19576 let a_FLOAT = Gram.Entry.mk "a_FLOAT"
19578 let a_INT = Gram.Entry.mk "a_INT"
19580 let a_INT32 = Gram.Entry.mk "a_INT32"
19582 let a_INT64 = Gram.Entry.mk "a_INT64"
19584 let a_LABEL = Gram.Entry.mk "a_LABEL"
19586 let a_LIDENT = Gram.Entry.mk "a_LIDENT"
19588 let a_NATIVEINT = Gram.Entry.mk "a_NATIVEINT"
19590 let a_OPTLABEL = Gram.Entry.mk "a_OPTLABEL"
19592 let a_STRING = Gram.Entry.mk "a_STRING"
19594 let a_UIDENT = Gram.Entry.mk "a_UIDENT"
19596 let a_ident = Gram.Entry.mk "a_ident"
19598 let amp_ctyp = Gram.Entry.mk "amp_ctyp"
19600 let and_ctyp = Gram.Entry.mk "and_ctyp"
19602 let match_case = Gram.Entry.mk "match_case"
19604 let match_case0 = Gram.Entry.mk "match_case0"
19606 let binding = Gram.Entry.mk "binding"
19608 let class_declaration = Gram.Entry.mk "class_declaration"
19610 let class_description = Gram.Entry.mk "class_description"
19612 let class_expr = Gram.Entry.mk "class_expr"
19614 let class_fun_binding = Gram.Entry.mk "class_fun_binding"
19616 let class_fun_def = Gram.Entry.mk "class_fun_def"
19618 let class_info_for_class_expr =
19619 Gram.Entry.mk "class_info_for_class_expr"
19621 let class_info_for_class_type =
19622 Gram.Entry.mk "class_info_for_class_type"
19624 let class_longident = Gram.Entry.mk "class_longident"
19626 let class_longident_and_param =
19627 Gram.Entry.mk "class_longident_and_param"
19629 let class_name_and_param = Gram.Entry.mk "class_name_and_param"
19631 let class_sig_item = Gram.Entry.mk "class_sig_item"
19633 let class_signature = Gram.Entry.mk "class_signature"
19635 let class_str_item = Gram.Entry.mk "class_str_item"
19637 let class_structure = Gram.Entry.mk "class_structure"
19639 let class_type = Gram.Entry.mk "class_type"
19641 let class_type_declaration = Gram.Entry.mk "class_type_declaration"
19643 let class_type_longident = Gram.Entry.mk "class_type_longident"
19645 let class_type_longident_and_param =
19646 Gram.Entry.mk "class_type_longident_and_param"
19648 let class_type_plus = Gram.Entry.mk "class_type_plus"
19650 let comma_ctyp = Gram.Entry.mk "comma_ctyp"
19652 let comma_expr = Gram.Entry.mk "comma_expr"
19654 let comma_ipatt = Gram.Entry.mk "comma_ipatt"
19656 let comma_patt = Gram.Entry.mk "comma_patt"
19658 let comma_type_parameter = Gram.Entry.mk "comma_type_parameter"
19660 let constrain = Gram.Entry.mk "constrain"
19662 let constructor_arg_list = Gram.Entry.mk "constructor_arg_list"
19664 let constructor_declaration = Gram.Entry.mk "constructor_declaration"
19666 let constructor_declarations =
19667 Gram.Entry.mk "constructor_declarations"
19669 let ctyp = Gram.Entry.mk "ctyp"
19671 let cvalue_binding = Gram.Entry.mk "cvalue_binding"
19673 let direction_flag = Gram.Entry.mk "direction_flag"
19675 let dummy = Gram.Entry.mk "dummy"
19677 let entry_eoi = Gram.Entry.mk "entry_eoi"
19679 let eq_expr = Gram.Entry.mk "eq_expr"
19681 let expr = Gram.Entry.mk "expr"
19683 let expr_eoi = Gram.Entry.mk "expr_eoi"
19685 let field_expr = Gram.Entry.mk "field_expr"
19687 let fun_binding = Gram.Entry.mk "fun_binding"
19689 let fun_def = Gram.Entry.mk "fun_def"
19691 let ident = Gram.Entry.mk "ident"
19693 let implem = Gram.Entry.mk "implem"
19695 let interf = Gram.Entry.mk "interf"
19697 let ipatt = Gram.Entry.mk "ipatt"
19699 let ipatt_tcon = Gram.Entry.mk "ipatt_tcon"
19701 let label = Gram.Entry.mk "label"
19703 let label_declaration = Gram.Entry.mk "label_declaration"
19705 let label_expr = Gram.Entry.mk "label_expr"
19707 let label_ipatt = Gram.Entry.mk "label_ipatt"
19709 let label_longident = Gram.Entry.mk "label_longident"
19711 let label_patt = Gram.Entry.mk "label_patt"
19713 let labeled_ipatt = Gram.Entry.mk "labeled_ipatt"
19715 let let_binding = Gram.Entry.mk "let_binding"
19717 let meth_list = Gram.Entry.mk "meth_list"
19719 let module_binding = Gram.Entry.mk "module_binding"
19721 let module_binding0 = Gram.Entry.mk "module_binding0"
19723 let module_declaration = Gram.Entry.mk "module_declaration"
19725 let module_expr = Gram.Entry.mk "module_expr"
19727 let module_longident = Gram.Entry.mk "module_longident"
19729 let module_longident_with_app =
19730 Gram.Entry.mk "module_longident_with_app"
19732 let module_rec_declaration = Gram.Entry.mk "module_rec_declaration"
19734 let module_type = Gram.Entry.mk "module_type"
19736 let more_ctyp = Gram.Entry.mk "more_ctyp"
19738 let name_tags = Gram.Entry.mk "name_tags"
19740 let opt_as_lident = Gram.Entry.mk "opt_as_lident"
19742 let opt_class_self_patt = Gram.Entry.mk "opt_class_self_patt"
19744 let opt_class_self_type = Gram.Entry.mk "opt_class_self_type"
19746 let opt_class_signature = Gram.Entry.mk "opt_class_signature"
19748 let opt_class_structure = Gram.Entry.mk "opt_class_structure"
19750 let opt_comma_ctyp = Gram.Entry.mk "opt_comma_ctyp"
19752 let opt_dot_dot = Gram.Entry.mk "opt_dot_dot"
19754 let opt_eq_ctyp = Gram.Entry.mk "opt_eq_ctyp"
19756 let opt_expr = Gram.Entry.mk "opt_expr"
19758 let opt_meth_list = Gram.Entry.mk "opt_meth_list"
19760 let opt_mutable = Gram.Entry.mk "opt_mutable"
19762 let opt_polyt = Gram.Entry.mk "opt_polyt"
19764 let opt_private = Gram.Entry.mk "opt_private"
19766 let opt_rec = Gram.Entry.mk "opt_rec"
19768 let opt_sig_items = Gram.Entry.mk "opt_sig_items"
19770 let opt_str_items = Gram.Entry.mk "opt_str_items"
19772 let opt_virtual = Gram.Entry.mk "opt_virtual"
19774 let opt_when_expr = Gram.Entry.mk "opt_when_expr"
19776 let patt = Gram.Entry.mk "patt"
19778 let patt_as_patt_opt = Gram.Entry.mk "patt_as_patt_opt"
19780 let patt_eoi = Gram.Entry.mk "patt_eoi"
19782 let patt_tcon = Gram.Entry.mk "patt_tcon"
19784 let phrase = Gram.Entry.mk "phrase"
19786 let poly_type = Gram.Entry.mk "poly_type"
19788 let row_field = Gram.Entry.mk "row_field"
19790 let sem_expr = Gram.Entry.mk "sem_expr"
19792 let sem_expr_for_list = Gram.Entry.mk "sem_expr_for_list"
19794 let sem_patt = Gram.Entry.mk "sem_patt"
19796 let sem_patt_for_list = Gram.Entry.mk "sem_patt_for_list"
19798 let semi = Gram.Entry.mk "semi"
19800 let sequence = Gram.Entry.mk "sequence"
19802 let do_sequence = Gram.Entry.mk "do_sequence"
19804 let sig_item = Gram.Entry.mk "sig_item"
19806 let sig_items = Gram.Entry.mk "sig_items"
19808 let star_ctyp = Gram.Entry.mk "star_ctyp"
19810 let str_item = Gram.Entry.mk "str_item"
19812 let str_items = Gram.Entry.mk "str_items"
19814 let top_phrase = Gram.Entry.mk "top_phrase"
19816 let type_constraint = Gram.Entry.mk "type_constraint"
19818 let type_declaration = Gram.Entry.mk "type_declaration"
19820 let type_ident_and_parameters =
19821 Gram.Entry.mk "type_ident_and_parameters"
19823 let type_kind = Gram.Entry.mk "type_kind"
19825 let type_longident = Gram.Entry.mk "type_longident"
19827 let type_longident_and_parameters =
19828 Gram.Entry.mk "type_longident_and_parameters"
19830 let type_parameter = Gram.Entry.mk "type_parameter"
19832 let type_parameters = Gram.Entry.mk "type_parameters"
19834 let typevars = Gram.Entry.mk "typevars"
19836 let use_file = Gram.Entry.mk "use_file"
19838 let val_longident = Gram.Entry.mk "val_longident"
19840 let value_let = Gram.Entry.mk "value_let"
19842 let value_val = Gram.Entry.mk "value_val"
19844 let with_constr = Gram.Entry.mk "with_constr"
19846 let expr_quot = Gram.Entry.mk "quotation of expression"
19848 let patt_quot = Gram.Entry.mk "quotation of pattern"
19850 let ctyp_quot = Gram.Entry.mk "quotation of type"
19852 let str_item_quot = Gram.Entry.mk "quotation of structure item"
19854 let sig_item_quot = Gram.Entry.mk "quotation of signature item"
19856 let class_str_item_quot =
19857 Gram.Entry.mk "quotation of class structure item"
19859 let class_sig_item_quot =
19860 Gram.Entry.mk "quotation of class signature item"
19862 let module_expr_quot = Gram.Entry.mk "quotation of module expression"
19864 let module_type_quot = Gram.Entry.mk "quotation of module type"
19866 let class_type_quot = Gram.Entry.mk "quotation of class type"
19868 let class_expr_quot = Gram.Entry.mk "quotation of class expression"
19870 let with_constr_quot = Gram.Entry.mk "quotation of with constraint"
19872 let binding_quot = Gram.Entry.mk "quotation of binding"
19874 let rec_binding_quot = Gram.Entry.mk "quotation of record binding"
19876 let match_case_quot =
19877 Gram.Entry.mk "quotation of match_case (try/match/function case)"
19879 let module_binding_quot =
19880 Gram.Entry.mk "quotation of module rec binding"
19882 let ident_quot = Gram.Entry.mk "quotation of identifier"
19884 let prefixop =
19885 Gram.Entry.mk "prefix operator (start with '!', '?', '~')"
19887 let infixop0 =
19888 Gram.Entry.mk
19889 "infix operator (level 0) (comparison operators, and some others)"
19891 let infixop1 =
19892 Gram.Entry.mk "infix operator (level 1) (start with '^', '@')"
19894 let infixop2 =
19895 Gram.Entry.mk "infix operator (level 2) (start with '+', '-')"
19897 let infixop3 =
19898 Gram.Entry.mk "infix operator (level 3) (start with '*', '/', '%')"
19900 let infixop4 =
19901 Gram.Entry.mk
19902 "infix operator (level 4) (start with \"**\") (right assoc)"
19904 let _ =
19905 Gram.extend (top_phrase : 'top_phrase Gram.Entry.t)
19906 ((fun () ->
19907 (None,
19908 [ (None, None,
19909 [ ([ Gram.Stoken
19910 (((function | EOI -> true | _ -> false), "EOI")) ],
19911 (Gram.Action.mk
19912 (fun (__camlp4_0 : Gram.Token.t)
19913 (_loc : Gram.Loc.t) ->
19914 match __camlp4_0 with
19915 | EOI -> (None : 'top_phrase)
19916 | _ -> assert false))) ]) ]))
19919 module AntiquotSyntax =
19920 struct
19921 module Loc = Ast.Loc
19923 module Ast = Sig.Camlp4AstToAst(Ast)
19925 module Gram = Gram
19927 let antiquot_expr = Gram.Entry.mk "antiquot_expr"
19929 let antiquot_patt = Gram.Entry.mk "antiquot_patt"
19931 let _ =
19932 (Gram.extend (antiquot_expr : 'antiquot_expr Gram.Entry.t)
19933 ((fun () ->
19934 (None,
19935 [ (None, None,
19936 [ ([ Gram.Snterm
19937 (Gram.Entry.obj (expr : 'expr Gram.Entry.t));
19938 Gram.Stoken
19939 (((function | EOI -> true | _ -> false),
19940 "EOI")) ],
19941 (Gram.Action.mk
19942 (fun (__camlp4_0 : Gram.Token.t) (x : 'expr)
19943 (_loc : Gram.Loc.t) ->
19944 match __camlp4_0 with
19945 | EOI -> (x : 'antiquot_expr)
19946 | _ -> assert false))) ]) ]))
19947 ());
19948 Gram.extend (antiquot_patt : 'antiquot_patt Gram.Entry.t)
19949 ((fun () ->
19950 (None,
19951 [ (None, None,
19952 [ ([ Gram.Snterm
19953 (Gram.Entry.obj (patt : 'patt Gram.Entry.t));
19954 Gram.Stoken
19955 (((function | EOI -> true | _ -> false),
19956 "EOI")) ],
19957 (Gram.Action.mk
19958 (fun (__camlp4_0 : Gram.Token.t) (x : 'patt)
19959 (_loc : Gram.Loc.t) ->
19960 match __camlp4_0 with
19961 | EOI -> (x : 'antiquot_patt)
19962 | _ -> assert false))) ]) ]))
19963 ()))
19965 let parse_expr loc str = Gram.parse_string antiquot_expr loc str
19967 let parse_patt loc str = Gram.parse_string antiquot_patt loc str
19971 module Quotation = Quotation
19973 let wrap directive_handler pa init_loc cs =
19974 let rec loop loc =
19975 let (pl, stopped_at_directive) = pa loc cs
19977 match stopped_at_directive with
19978 | Some new_loc ->
19979 let pl =
19980 (match List.rev pl with
19981 | [] -> assert false
19982 | x :: xs ->
19983 (match directive_handler x with
19984 | None -> xs
19985 | Some x -> x :: xs))
19986 in (List.rev pl) @ (loop new_loc)
19987 | None -> pl
19988 in loop init_loc
19990 let parse_implem ?(directive_handler = fun _ -> None) _loc cs =
19991 let l = wrap directive_handler (Gram.parse implem) _loc cs
19992 in Ast.stSem_of_list l
19994 let parse_interf ?(directive_handler = fun _ -> None) _loc cs =
19995 let l = wrap directive_handler (Gram.parse interf) _loc cs
19996 in Ast.sgSem_of_list l
19998 let print_interf ?input_file:(_) ?output_file:(_) _ =
19999 failwith "No interface printer"
20001 let print_implem ?input_file:(_) ?output_file:(_) _ =
20002 failwith "No implementation printer"
20008 module PreCast :
20010 type camlp4_token =
20011 Sig.camlp4_token =
20012 | KEYWORD of string
20013 | SYMBOL of string
20014 | LIDENT of string
20015 | UIDENT of string
20016 | ESCAPED_IDENT of string
20017 | INT of int * string
20018 | INT32 of int32 * string
20019 | INT64 of int64 * string
20020 | NATIVEINT of nativeint * string
20021 | FLOAT of float * string
20022 | CHAR of char * string
20023 | STRING of string * string
20024 | LABEL of string
20025 | OPTLABEL of string
20026 | QUOTATION of Sig.quotation
20027 | ANTIQUOT of string * string
20028 | COMMENT of string
20029 | BLANKS of string
20030 | NEWLINE
20031 | LINE_DIRECTIVE of int * string option
20032 | EOI
20034 module Id : Sig.Id
20036 module Loc : Sig.Loc
20038 module Ast : Sig.Camlp4Ast with module Loc = Loc
20040 module Token : Sig.Token with module Loc = Loc and type t = camlp4_token
20042 module Lexer : Sig.Lexer with module Loc = Loc and module Token = Token
20044 module Gram : Sig.Grammar.Static with module Loc = Loc
20045 and module Token = Token
20047 module Quotation :
20048 Sig.Quotation with module Ast = Sig.Camlp4AstToAst(Ast)
20050 module DynLoader : Sig.DynLoader
20052 module AstFilters : Sig.AstFilters with module Ast = Ast
20054 module Syntax : Sig.Camlp4Syntax with module Loc = Loc
20055 and module Token = Token and module Ast = Ast and module Gram = Gram
20056 and module Quotation = Quotation
20058 module Printers :
20060 module OCaml : Sig.Printer(Ast).S
20062 module OCamlr : Sig.Printer(Ast).S
20064 module DumpOCamlAst : Sig.Printer(Ast).S
20066 module DumpCamlp4Ast : Sig.Printer(Ast).S
20068 module Null : Sig.Printer(Ast).S
20072 module MakeGram (Lexer : Sig.Lexer with module Loc = Loc) :
20073 Sig.Grammar.Static with module Loc = Loc and module Token = Lexer.Token
20075 module MakeSyntax (U : sig end) : Sig.Syntax
20077 end =
20078 struct
20079 module Id = struct let name = "Camlp4.PreCast"
20080 let version = "$Id$"
20083 type camlp4_token =
20084 Sig.camlp4_token =
20085 | KEYWORD of string
20086 | SYMBOL of string
20087 | LIDENT of string
20088 | UIDENT of string
20089 | ESCAPED_IDENT of string
20090 | INT of int * string
20091 | INT32 of int32 * string
20092 | INT64 of int64 * string
20093 | NATIVEINT of nativeint * string
20094 | FLOAT of float * string
20095 | CHAR of char * string
20096 | STRING of string * string
20097 | LABEL of string
20098 | OPTLABEL of string
20099 | QUOTATION of Sig.quotation
20100 | ANTIQUOT of string * string
20101 | COMMENT of string
20102 | BLANKS of string
20103 | NEWLINE
20104 | LINE_DIRECTIVE of int * string option
20105 | EOI
20107 module Loc = Struct.Loc
20109 module Ast = Struct.Camlp4Ast.Make(Loc)
20111 module Token = Struct.Token.Make(Loc)
20113 module Lexer = Struct.Lexer.Make(Token)
20115 module Gram = Struct.Grammar.Static.Make(Lexer)
20117 module DynLoader = Struct.DynLoader
20119 module Quotation = Struct.Quotation.Make(Ast)
20121 module MakeSyntax (U : sig end) =
20122 OCamlInitSyntax.Make(Ast)(Gram)(Quotation)
20124 module Syntax = MakeSyntax(struct end)
20126 module AstFilters = Struct.AstFilters.Make(Ast)
20128 module MakeGram = Struct.Grammar.Static.Make
20130 module Printers =
20131 struct
20132 module OCaml = Printers.OCaml.Make(Syntax)
20134 module OCamlr = Printers.OCamlr.Make(Syntax)
20136 module DumpOCamlAst = Printers.DumpOCamlAst.Make(Syntax)
20138 module DumpCamlp4Ast = Printers.DumpCamlp4Ast.Make(Syntax)
20140 module Null = Printers.Null.Make(Syntax)
20146 module Register :
20148 module Plugin
20149 (Id : Sig.Id) (Plugin : functor (Unit : sig end) -> sig end) :
20150 sig end
20152 module SyntaxPlugin
20153 (Id : Sig.Id) (SyntaxPlugin : functor (Syn : Sig.Syntax) -> sig end) :
20154 sig end
20156 module SyntaxExtension
20157 (Id : Sig.Id) (SyntaxExtension : Sig.SyntaxExtension) : sig end
20159 module OCamlSyntaxExtension
20160 (Id : Sig.Id)
20161 (SyntaxExtension :
20162 functor (Syntax : Sig.Camlp4Syntax) -> Sig.Camlp4Syntax) :
20163 sig end
20165 type 'a parser_fun =
20166 ?directive_handler: ('a -> 'a option) ->
20167 PreCast.Loc.t -> char Stream.t -> 'a
20169 val register_str_item_parser : PreCast.Ast.str_item parser_fun -> unit
20171 val register_sig_item_parser : PreCast.Ast.sig_item parser_fun -> unit
20173 val register_parser :
20174 PreCast.Ast.str_item parser_fun ->
20175 PreCast.Ast.sig_item parser_fun -> unit
20177 module Parser
20178 (Id : Sig.Id) (Maker : functor (Ast : Sig.Ast) -> Sig.Parser(Ast).S) :
20179 sig end
20181 module OCamlParser
20182 (Id : Sig.Id)
20183 (Maker : functor (Ast : Sig.Camlp4Ast) -> Sig.Parser(Ast).S) :
20184 sig end
20186 module OCamlPreCastParser
20187 (Id : Sig.Id) (Parser : Sig.Parser(PreCast.Ast).S) : sig end
20189 type 'a printer_fun =
20190 ?input_file: string -> ?output_file: string -> 'a -> unit
20192 val register_str_item_printer : PreCast.Ast.str_item printer_fun -> unit
20194 val register_sig_item_printer : PreCast.Ast.sig_item printer_fun -> unit
20196 val register_printer :
20197 PreCast.Ast.str_item printer_fun ->
20198 PreCast.Ast.sig_item printer_fun -> unit
20200 module Printer
20201 (Id : Sig.Id)
20202 (Maker : functor (Syn : Sig.Syntax) -> Sig.Printer(Syn.Ast).S) :
20203 sig end
20205 module OCamlPrinter
20206 (Id : Sig.Id)
20207 (Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer(Syn.Ast).S) :
20208 sig end
20210 module OCamlPreCastPrinter
20211 (Id : Sig.Id) (Printer : Sig.Printer(PreCast.Ast).S) : sig end
20213 module AstFilter
20214 (Id : Sig.Id) (Maker : functor (F : Sig.AstFilters) -> sig end) :
20215 sig end
20217 val declare_dyn_module : string -> (unit -> unit) -> unit
20219 val iter_and_take_callbacks : ((string * (unit -> unit)) -> unit) -> unit
20221 val loaded_modules : (string list) ref
20223 module CurrentParser : Sig.Parser(PreCast.Ast).S
20225 module CurrentPrinter : Sig.Printer(PreCast.Ast).S
20227 val enable_ocaml_printer : unit -> unit
20229 val enable_ocamlr_printer : unit -> unit
20231 val enable_null_printer : unit -> unit
20233 val enable_dump_ocaml_ast_printer : unit -> unit
20235 val enable_dump_camlp4_ast_printer : unit -> unit
20237 end =
20238 struct
20239 module PP = Printers
20241 open PreCast
20243 type 'a parser_fun =
20244 ?directive_handler: ('a -> 'a option) ->
20245 PreCast.Loc.t -> char Stream.t -> 'a
20247 type 'a printer_fun =
20248 ?input_file: string -> ?output_file: string -> 'a -> unit
20250 let sig_item_parser =
20251 ref (fun ?directive_handler:(_) _ _ -> failwith "No interface parser")
20253 let str_item_parser =
20255 (fun ?directive_handler:(_) _ _ ->
20256 failwith "No implementation parser")
20258 let sig_item_printer =
20260 (fun ?input_file:(_) ?output_file:(_) _ ->
20261 failwith "No interface printer")
20263 let str_item_printer =
20265 (fun ?input_file:(_) ?output_file:(_) _ ->
20266 failwith "No implementation printer")
20268 let callbacks = Queue.create ()
20270 let loaded_modules = ref []
20272 let iter_and_take_callbacks f =
20273 let rec loop () = loop (f (Queue.take callbacks))
20274 in try loop () with | Queue.Empty -> ()
20276 let declare_dyn_module m f =
20277 (loaded_modules := m :: !loaded_modules; Queue.add (m, f) callbacks)
20279 let register_str_item_parser f = str_item_parser := f
20281 let register_sig_item_parser f = sig_item_parser := f
20283 let register_parser f g = (str_item_parser := f; sig_item_parser := g)
20285 let register_str_item_printer f = str_item_printer := f
20287 let register_sig_item_printer f = sig_item_printer := f
20289 let register_printer f g = (str_item_printer := f; sig_item_printer := g)
20291 module Plugin
20292 (Id : Sig.Id) (Maker : functor (Unit : sig end) -> sig end) =
20293 struct
20294 let _ =
20295 declare_dyn_module Id.name
20296 (fun _ -> let module M = Maker(struct end) in ())
20300 module SyntaxExtension (Id : Sig.Id) (Maker : Sig.SyntaxExtension) =
20301 struct
20302 let _ =
20303 declare_dyn_module Id.name
20304 (fun _ -> let module M = Maker(Syntax) in ())
20308 module OCamlSyntaxExtension
20309 (Id : Sig.Id)
20310 (Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Camlp4Syntax) =
20311 struct
20312 let _ =
20313 declare_dyn_module Id.name
20314 (fun _ -> let module M = Maker(Syntax) in ())
20318 module SyntaxPlugin
20319 (Id : Sig.Id) (Maker : functor (Syn : Sig.Syntax) -> sig end) =
20320 struct
20321 let _ =
20322 declare_dyn_module Id.name
20323 (fun _ -> let module M = Maker(Syntax) in ())
20327 module Printer
20328 (Id : Sig.Id)
20329 (Maker : functor (Syn : Sig.Syntax) -> Sig.Printer(Syn.Ast).S) =
20330 struct
20331 let _ =
20332 declare_dyn_module Id.name
20333 (fun _ -> let module M = Maker(Syntax)
20334 in register_printer M.print_implem M.print_interf)
20338 module OCamlPrinter
20339 (Id : Sig.Id)
20340 (Maker : functor (Syn : Sig.Camlp4Syntax) -> Sig.Printer(Syn.Ast).S) =
20341 struct
20342 let _ =
20343 declare_dyn_module Id.name
20344 (fun _ -> let module M = Maker(Syntax)
20345 in register_printer M.print_implem M.print_interf)
20349 module OCamlPreCastPrinter
20350 (Id : Sig.Id) (P : Sig.Printer(PreCast.Ast).S) =
20351 struct
20352 let _ =
20353 declare_dyn_module Id.name
20354 (fun _ -> register_printer P.print_implem P.print_interf)
20358 module Parser
20359 (Id : Sig.Id) (Maker : functor (Ast : Sig.Ast) -> Sig.Parser(Ast).S) =
20360 struct
20361 let _ =
20362 declare_dyn_module Id.name
20363 (fun _ -> let module M = Maker(PreCast.Ast)
20364 in register_parser M.parse_implem M.parse_interf)
20368 module OCamlParser
20369 (Id : Sig.Id)
20370 (Maker : functor (Ast : Sig.Camlp4Ast) -> Sig.Parser(Ast).S) =
20371 struct
20372 let _ =
20373 declare_dyn_module Id.name
20374 (fun _ -> let module M = Maker(PreCast.Ast)
20375 in register_parser M.parse_implem M.parse_interf)
20379 module OCamlPreCastParser (Id : Sig.Id) (P : Sig.Parser(PreCast.Ast).S) =
20380 struct
20381 let _ =
20382 declare_dyn_module Id.name
20383 (fun _ -> register_parser P.parse_implem P.parse_interf)
20387 module AstFilter
20388 (Id : Sig.Id) (Maker : functor (F : Sig.AstFilters) -> sig end) =
20389 struct
20390 let _ =
20391 declare_dyn_module Id.name
20392 (fun _ -> let module M = Maker(AstFilters) in ())
20396 let _ = sig_item_parser := Syntax.parse_interf
20398 let _ = str_item_parser := Syntax.parse_implem
20400 module CurrentParser =
20401 struct
20402 module Ast = Ast
20404 let parse_interf ?directive_handler loc strm =
20405 !sig_item_parser ?directive_handler loc strm
20407 let parse_implem ?directive_handler loc strm =
20408 !str_item_parser ?directive_handler loc strm
20412 module CurrentPrinter =
20413 struct
20414 module Ast = Ast
20416 let print_interf ?input_file ?output_file ast =
20417 !sig_item_printer ?input_file ?output_file ast
20419 let print_implem ?input_file ?output_file ast =
20420 !str_item_printer ?input_file ?output_file ast
20424 let enable_ocaml_printer () =
20425 let module M = OCamlPrinter(PP.OCaml.Id)(PP.OCaml.MakeMore) in ()
20427 let enable_ocamlr_printer () =
20428 let module M = OCamlPrinter(PP.OCamlr.Id)(PP.OCamlr.MakeMore) in ()
20430 let enable_dump_ocaml_ast_printer () =
20431 let module M = OCamlPrinter(PP.DumpOCamlAst.Id)(PP.DumpOCamlAst.Make)
20432 in ()
20434 let enable_dump_camlp4_ast_printer () =
20435 let module M = Printer(PP.DumpCamlp4Ast.Id)(PP.DumpCamlp4Ast.Make)
20436 in ()
20438 let enable_null_printer () =
20439 let module M = Printer(PP.Null.Id)(PP.Null.Make) in ()