module Bs_version : sig 
#1 "bs_version.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

val version : string

val header : string 

val package_name : string
end = struct
#1 "bs_version.ml"

(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)    
let version = "4.0.12"
let header = 
   "// Generated by BUCKLESCRIPT VERSION 4.0.12, PLEASE EDIT WITH CARE"  
let package_name = "bs-platform"   
    
end
module Config_whole_compiler : sig 
#1 "config_whole_compiler.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* System configuration *)

val version: string
        (* The current version number of the system *)

val standard_library: string
        (* The directory containing the standard libraries *)
val standard_runtime: string
        (* The full path to the standard bytecode interpreter ocamlrun *)
val ccomp_type: string
        (* The "kind" of the C compiler, assembler and linker used: one of
               "cc" (for Unix-style C compilers)
               "msvc" (for Microsoft Visual C++ and MASM) *)
val bytecomp_c_compiler: string
        (* The C compiler to use for compiling C files
           with the bytecode compiler *)
val bytecomp_c_libraries: string
        (* The C libraries to link with custom runtimes *)
val native_c_compiler: string
        (* The C compiler to use for compiling C files
           with the native-code compiler *)
val native_c_libraries: string
        (* The C libraries to link with native-code programs *)
val native_pack_linker: string
        (* The linker to use for packaging (ocamlopt -pack) and for partial
           links (ocamlopt -output-obj). *)
val mkdll: string
        (* The linker command line to build dynamic libraries. *)
val mkexe: string
        (* The linker command line to build executables. *)
val mkmaindll: string
        (* The linker command line to build main programs as dlls. *)
val ranlib: string
        (* Command to randomize a library, or "" if not needed *)
val ar: string
        (* Name of the ar command, or "" if not needed  (MSVC) *)
val cc_profile : string
        (* The command line option to the C compiler to enable profiling. *)

val load_path: string list ref
        (* Directories in the search path for .cmi and .cmo files *)

val interface_suffix: string ref
        (* Suffix for interface file names *)

val exec_magic_number: string
        (* Magic number for bytecode executable files *)
val cmi_magic_number: string
        (* Magic number for compiled interface files *)
val cmo_magic_number: string
        (* Magic number for object bytecode files *)
val cma_magic_number: string
        (* Magic number for archive files *)
val cmx_magic_number: string
        (* Magic number for compilation unit descriptions *)
val cmxa_magic_number: string
        (* Magic number for libraries of compilation unit descriptions *)
val ast_intf_magic_number: string
        (* Magic number for file holding an interface syntax tree *)
val ast_impl_magic_number: string
        (* Magic number for file holding an implementation syntax tree *)
val cmxs_magic_number: string
        (* Magic number for dynamically-loadable plugins *)
val cmt_magic_number: string
        (* Magic number for compiled interface files *)

val max_tag: int
        (* Biggest tag that can be stored in the header of a regular block. *)
val lazy_tag : int
        (* Normally the same as Obj.lazy_tag.  Separate definition because
           of technical reasons for bootstrapping. *)
val max_young_wosize: int
        (* Maximal size of arrays that are directly allocated in the
           minor heap *)
val stack_threshold: int
        (* Size in words of safe area at bottom of VM stack,
           see byterun/config.h *)

val architecture: string
        (* Name of processor type for the native-code compiler *)
val model: string
        (* Name of processor submodel for the native-code compiler *)
(* val system: string *)
        (* Name of operating system for the native-code compiler *)

val asm: string
        (* The assembler (and flags) to use for assembling
           ocamlopt-generated code. *)

val asm_cfi_supported: bool
        (* Whether assembler understands CFI directives *)
val with_frame_pointers : bool
        (* Whether assembler should maintain frame pointers *)

val ext_obj: string
        (* Extension for object files, e.g. [.o] under Unix. *)
val ext_asm: string
        (* Extension for assembler files, e.g. [.s] under Unix. *)
val ext_lib: string
        (* Extension for library files, e.g. [.a] under Unix. *)
val ext_dll: string
        (* Extension for dynamically-loaded libraries, e.g. [.so] under Unix.*)

val default_executable_name: string
        (* Name of executable produced by linking if none is given with -o,
           e.g. [a.out] under Unix. *)

val systhread_supported : bool
        (* Whether the system thread library is implemented *)

(* val host : string *)
        (* Whether the compiler is a cross-compiler *)

(* val target : string *)
        (* Whether the compiler is a cross-compiler *)

val print_config : out_channel -> unit;;


end = struct
#1 "config_whole_compiler.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(***********************************************************************)
(**                                                                   **)
(**               WARNING WARNING WARNING                             **)
(**                                                                   **)
(** When you change this file, you must make the parallel change      **)
(** in config.mlbuild                                                 **)
(**                                                                   **)
(***********************************************************************)


(* The main OCaml version string has moved to ../VERSION *)
let version = "4.02.3+BS"
let standard_library =
  Filename.concat (Filename.dirname Sys.executable_name)  "ocaml"
let standard_library_default = standard_library

let standard_runtime = "ocamlrun" (*dont care:path to ocamlrun*)
let ccomp_type = "cc"(*dont care: cc or msvc*)
let bytecomp_c_compiler = "gcc -O  -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O" (*dont care*)
let bytecomp_c_libraries = "-lcurses -lpthread" (*dont care*)
let native_c_compiler = "gcc -O  -D_FILE_OFFSET_BITS=64 -D_REENTRANT" (*dont care*)
let native_c_libraries = ""(*dont care*)
let native_pack_linker = "ld -r -arch x86_64  -o"(*dont care*) 
let ranlib = "ranlib"(*dont care*)
let ar = ""(*dont care*)
let cc_profile = "-pg"(*dont care*)
let mkdll = ""(*dont care*)
let mkexe = ""(*dont care*)
let mkmaindll = ""(*dont care*)

let exec_magic_number = "Caml1999X011"
and cmi_magic_number = "Caml1999I017"
and cmo_magic_number = "Caml1999O010"
and cma_magic_number = "Caml1999A011"
and cmx_magic_number = "Caml1999Y014"
and cmxa_magic_number = "Caml1999Z013"
and ast_impl_magic_number = "Caml1999M016"
and ast_intf_magic_number = "Caml1999N015"
and cmxs_magic_number = "Caml2007D002"
and cmt_magic_number = "Caml2012T004"

let load_path = ref ([] : string list)

let interface_suffix = ref ".mli"

let max_tag = 245
(* This is normally the same as in obj.ml, but we have to define it
   separately because it can differ when we're in the middle of a
   bootstrapping phase. *)
let lazy_tag = 246

let max_young_wosize = 256
let stack_threshold = 256 (* see byterun/config.h *)

let architecture = "amd64" (*dont care*)
let model = "default"(*dont care*)
let system = "macosx"

let asm = "clang -arch x86_64 -c"
let asm_cfi_supported = false (*dont care*)
let with_frame_pointers = false (*dontcare*)

let ext_obj = ".o" (*dont care*)
let ext_asm = ".s" (*dont care*)
let ext_lib = ".a" (*dont caer*)
let ext_dll = ".a" (*dont care*)

let host = "%%HOST%%"
let target = "%%TARGET%%"

let default_executable_name =
  match Sys.os_type with
    "Unix" -> "a.out"
  | "Win32" | "Cygwin" -> "camlprog.exe"
  | _ -> "camlprog"

let systhread_supported = false (*dontcare*);;

let print_config oc =
  let p name valu = Printf.fprintf oc "%s: %s\n" name valu in
  let p_bool name valu = Printf.fprintf oc "%s: %B\n" name valu in
  p "version" version;
  p "standard_library_default" standard_library_default;
  p "standard_library" standard_library;
  p "standard_runtime" standard_runtime;
  p "ccomp_type" ccomp_type;
  p "bytecomp_c_compiler" bytecomp_c_compiler;
  p "bytecomp_c_libraries" bytecomp_c_libraries;
  p "native_c_compiler" native_c_compiler;
  p "native_c_libraries" native_c_libraries;
  p "native_pack_linker" native_pack_linker;
  p "ranlib" ranlib;
  p "cc_profile" cc_profile;
  p "architecture" architecture;
  p "model" model;
  p "system" system;
  p "asm" asm;
  p_bool "asm_cfi_supported" asm_cfi_supported;
  p_bool "with_frame_pointers" with_frame_pointers;
  p "ext_obj" ext_obj;
  p "ext_asm" ext_asm;
  p "ext_lib" ext_lib;
  p "ext_dll" ext_dll;
  p "os_type" Sys.os_type;
  p "default_executable_name" default_executable_name;
  p_bool "systhread_supported" systhread_supported;
  p "host" host;
  p "target" target;

  (* print the magic number *)
  p "exec_magic_number" exec_magic_number;
  p "cmi_magic_number" cmi_magic_number;
  p "cmo_magic_number" cmo_magic_number;
  p "cma_magic_number" cma_magic_number;
  p "cmx_magic_number" cmx_magic_number;
  p "cmxa_magic_number" cmxa_magic_number;
  p "ast_impl_magic_number" ast_impl_magic_number;
  p "ast_intf_magic_number" ast_intf_magic_number;
  p "cmxs_magic_number" cmxs_magic_number;
  p "cmt_magic_number" cmt_magic_number;

  flush oc;
;;


end
module Config = Config_whole_compiler 
module Clflags : sig 
#1 "clflags.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 2005 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

val objfiles : string list ref
val ccobjs : string list ref
val dllibs : string list ref
val compile_only : bool ref
val output_name : string option ref
val include_dirs : string list ref
val no_std_include : bool ref
val print_types : bool ref
val make_archive : bool ref
val debug : bool ref
val fast : bool ref
val link_everything : bool ref
val custom_runtime : bool ref
val no_check_prims : bool ref
val bytecode_compatible_32 : bool ref
val output_c_object : bool ref
val output_complete_object : bool ref
val all_ccopts : string list ref
val classic : bool ref
val nopervasives : bool ref
val open_modules : string list ref
val preprocessor : string option ref
val all_ppx : string list ref
val annotations : bool ref
val binary_annotations : bool ref
val use_threads : bool ref
val use_vmthreads : bool ref
val noassert : bool ref
val verbose : bool ref
val noprompt : bool ref
val nopromptcont : bool ref
val init_file : string option ref
val noinit : bool ref
val use_prims : string ref
val use_runtime : string ref
val principal : bool ref
val real_paths : bool ref
val recursive_types : bool ref
val strict_sequence : bool ref
val strict_formats : bool ref
val applicative_functors : bool ref
val make_runtime : bool ref
val gprofile : bool ref
val c_compiler : string option ref
val no_auto_link : bool ref
val dllpaths : string list ref
val make_package : bool ref
val for_package : string option ref
val error_size : int ref
val float_const_prop : bool ref
val transparent_modules : bool ref
val dump_source : bool ref
val dump_parsetree : bool ref
val dump_typedtree : bool ref
val dump_rawlambda : bool ref
val dump_lambda : bool ref
val dump_clambda : bool ref
val dump_instr : bool ref
val keep_asm_file : bool ref
val optimize_for_speed : bool ref
val dump_cmm : bool ref
val dump_selection : bool ref
val dump_cse : bool ref
val dump_live : bool ref
val dump_spill : bool ref
val dump_split : bool ref
val dump_interf : bool ref
val dump_prefer : bool ref
val dump_regalloc : bool ref
val dump_reload : bool ref
val dump_scheduling : bool ref
val dump_linear : bool ref
val keep_startup_file : bool ref
val dump_combine : bool ref
val native_code : bool ref
val inline_threshold : int ref
val dont_write_files : bool ref
val std_include_flag : string -> string
val std_include_dir : unit -> string list
val shared : bool ref
val dlcode : bool ref
val runtime_variant : string ref
val force_slash : bool ref
val keep_docs : bool ref
val keep_locs : bool ref
val unsafe_string : bool ref
val opaque : bool ref


 
type mli_status = Mli_na | Mli_exists | Mli_non_exists
val no_implicit_current_dir : bool ref
val assume_no_mli : mli_status ref 
val record_event_when_debug : bool ref 
val bs_vscode : bool
val dont_record_crc_unit : string option ref
val bs_only : bool ref (* set true on bs top*)
val no_assert_false : bool ref


type color_setting = Auto | Always | Never
val parse_color_setting : string -> color_setting option
val color : color_setting option ref


end = struct
#1 "clflags.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Command-line parameters *)

let objfiles = ref ([] : string list)   (* .cmo and .cma files *)
and ccobjs = ref ([] : string list)     (* .o, .a, .so and -cclib -lxxx *)
and dllibs = ref ([] : string list)     (* .so and -dllib -lxxx *)

let compile_only = ref false            (* -c *)
and output_name = ref (None : string option) (* -o *)
and include_dirs = ref ([] : string list)(* -I *)
and no_std_include = ref false          (* -nostdlib *)
and print_types = ref false             (* -i *)
and make_archive = ref false            (* -a *)
and debug = ref false                   (* -g *)
and fast = ref false                    (* -unsafe *)
and link_everything = ref false         (* -linkall *)
and custom_runtime = ref false          (* -custom *)
and no_check_prims = ref false          (* -no-check-prims *)
and bytecode_compatible_32 = ref false  (* -compat-32 *)
and output_c_object = ref false         (* -output-obj *)
and output_complete_object = ref false  (* -output-complete-obj *)
and all_ccopts = ref ([] : string list)     (* -ccopt *)
and classic = ref false                 (* -nolabels *)
and nopervasives = ref false            (* -nopervasives *)
and preprocessor = ref(None : string option) (* -pp *)
and all_ppx = ref ([] : string list)        (* -ppx *)
let annotations = ref false             (* -annot *)
let binary_annotations = ref false      (* -annot *)
and use_threads = ref false             (* -thread *)
and use_vmthreads = ref false           (* -vmthread *)
and noassert = ref false                (* -noassert *)
and verbose = ref false                 (* -verbose *)
and noprompt = ref false                (* -noprompt *)
and nopromptcont = ref false            (* -nopromptcont *)
and init_file = ref (None : string option)   (* -init *)
and noinit = ref false                  (* -noinit *)
and open_modules = ref []               (* -open *)
and use_prims = ref ""                  (* -use-prims ... *)
and use_runtime = ref ""                (* -use-runtime ... *)
and principal = ref false               (* -principal *)
and real_paths = ref true               (* -short-paths *)
and recursive_types = ref false         (* -rectypes *)
and strict_sequence = ref false         (* -strict-sequence *)
and strict_formats = ref false          (* -strict-formats *)
and applicative_functors = ref true     (* -no-app-funct *)
and make_runtime = ref false            (* -make-runtime *)
and gprofile = ref false                (* -p *)
and c_compiler = ref (None: string option) (* -cc *)
and no_auto_link = ref false            (* -noautolink *)
and dllpaths = ref ([] : string list)   (* -dllpath *)
and make_package = ref false            (* -pack *)
and for_package = ref (None: string option) (* -for-pack *)
and error_size = ref 500                (* -error-size *)
and float_const_prop = ref true         (* -no-float-const-prop *)
and transparent_modules = ref false     (* -trans-mod *)
let dump_source = ref false             (* -dsource *)
let dump_parsetree = ref false          (* -dparsetree *)
and dump_typedtree = ref false          (* -dtypedtree *)
and dump_rawlambda = ref false          (* -drawlambda *)
and dump_lambda = ref false             (* -dlambda *)
and dump_clambda = ref false            (* -dclambda *)
and dump_instr = ref false              (* -dinstr *)

let keep_asm_file = ref false           (* -S *)
let optimize_for_speed = ref true       (* -compact *)
and opaque = ref false                  (* -opaque *)

and dump_cmm = ref false                (* -dcmm *)
let dump_selection = ref false          (* -dsel *)
let dump_cse = ref false                (* -dcse *)
let dump_live = ref false               (* -dlive *)
let dump_spill = ref false              (* -dspill *)
let dump_split = ref false              (* -dsplit *)
let dump_interf = ref false             (* -dinterf *)
let dump_prefer = ref false             (* -dprefer *)
let dump_regalloc = ref false           (* -dalloc *)
let dump_reload = ref false             (* -dreload *)
let dump_scheduling = ref false         (* -dscheduling *)
let dump_linear = ref false             (* -dlinear *)
let keep_startup_file = ref false       (* -dstartup *)
let dump_combine = ref false            (* -dcombine *)
let native_code = ref false             (* set to true under ocamlopt *)
let inline_threshold = ref 10
let force_slash = ref false             (* for ocamldep *)

let dont_write_files = ref false        (* set to true under ocamldoc *)

let std_include_flag prefix =
  if !no_std_include then ""
  else (prefix ^ (Filename.quote Config.standard_library))
;;

let std_include_dir () =
  if !no_std_include then [] else [Config.standard_library]
;;

let shared = ref false (* -shared *)
let dlcode = ref true (* not -nodynlink *)

let runtime_variant = ref "";;      (* -runtime-variant *)

let keep_docs = ref false              (* -keep-docs *)
let keep_locs = ref false              (* -keep-locs *)
let unsafe_string = ref true;;         (* -safe-string / -unsafe-string *)


 
type mli_status = Mli_na | Mli_exists | Mli_non_exists
let no_implicit_current_dir = ref false
let assume_no_mli = ref Mli_na
let record_event_when_debug = ref true (* turned off in BuckleScript*)
let bs_vscode = 
    try ignore @@ Sys.getenv "BS_VSCODE" ; true with _ -> false
    (* We get it from environment variable mostly due to 
       we don't want to rebuild when flip on or off
    *)
let dont_record_crc_unit : string option ref = ref None
let bs_only = ref false
let no_assert_false = ref false


type color_setting = Auto | Always | Never
let parse_color_setting = function
  | "auto" -> Some Auto
  | "always" -> Some Always
  | "never" -> Some Never
  | _ -> None
let color = ref None ;; (* -color *)


end
module Misc : sig 
#1 "misc.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Miscellaneous useful types and functions *)

val fatal_error: string -> 'a
exception Fatal_error

val try_finally : (unit -> 'a) -> (unit -> unit) -> 'a;;

val map_end: ('a -> 'b) -> 'a list -> 'b list -> 'b list
        (* [map_end f l t] is [map f l @ t], just more efficient. *)
val map_left_right: ('a -> 'b) -> 'a list -> 'b list
        (* Like [List.map], with guaranteed left-to-right evaluation order *)
val for_all2: ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
        (* Same as [List.for_all] but for a binary predicate.
           In addition, this [for_all2] never fails: given two lists
           with different lengths, it returns false. *)
val replicate_list: 'a -> int -> 'a list
        (* [replicate_list elem n] is the list with [n] elements
           all identical to [elem]. *)
val list_remove: 'a -> 'a list -> 'a list
        (* [list_remove x l] returns a copy of [l] with the first
           element equal to [x] removed. *)
val split_last: 'a list -> 'a list * 'a
        (* Return the last element and the other elements of the given list. *)
val samelist: ('a -> 'a -> bool) -> 'a list -> 'a list -> bool
        (* Like [List.for_all2] but returns [false] if the two
           lists have different length. *)

val may: ('a -> unit) -> 'a option -> unit
val may_map: ('a -> 'b) -> 'a option -> 'b option

val find_in_path: string list -> string -> string
        (* Search a file in a list of directories. *)
val find_in_path_rel: string list -> string -> string
        (* Search a relative file in a list of directories. *)
val find_in_path_uncap: string list -> string -> string
        (* Same, but search also for uncapitalized name, i.e.
           if name is Foo.ml, allow /path/Foo.ml and /path/foo.ml
           to match. *)
val remove_file: string -> unit
        (* Delete the given file if it exists. Never raise an error. *)
val expand_directory: string -> string -> string
        (* [expand_directory alt file] eventually expands a [+] at the
           beginning of file into [alt] (an alternate root directory) *)

val create_hashtable: int -> ('a * 'b) list -> ('a, 'b) Hashtbl.t
        (* Create a hashtable of the given size and fills it with the
           given bindings. *)

val copy_file: in_channel -> out_channel -> unit
        (* [copy_file ic oc] reads the contents of file [ic] and copies
           them to [oc]. It stops when encountering EOF on [ic]. *)
val copy_file_chunk: in_channel -> out_channel -> int -> unit
        (* [copy_file_chunk ic oc n] reads [n] bytes from [ic] and copies
           them to [oc]. It raises [End_of_file] when encountering
           EOF on [ic]. *)
val string_of_file: in_channel -> string
        (* [string_of_file ic] reads the contents of file [ic] and copies
           them to a string. It stops when encountering EOF on [ic]. *)
val log2: int -> int
        (* [log2 n] returns [s] such that [n = 1 lsl s]
           if [n] is a power of 2*)
val align: int -> int -> int
        (* [align n a] rounds [n] upwards to a multiple of [a]
           (a power of 2). *)
val no_overflow_add: int -> int -> bool
        (* [no_overflow_add n1 n2] returns [true] if the computation of
           [n1 + n2] does not overflow. *)
val no_overflow_sub: int -> int -> bool
        (* [no_overflow_add n1 n2] returns [true] if the computation of
           [n1 - n2] does not overflow. *)
val no_overflow_lsl: int -> bool
        (* [no_overflow_add n] returns [true] if the computation of
           [n lsl 1] does not overflow. *)

val chop_extension_if_any: string -> string
        (* Like Filename.chop_extension but returns the initial file
           name if it has no extension *)

val chop_extensions: string -> string
        (* Return the given file name without its extensions. The extensions
           is the longest suffix starting with a period and not including
           a directory separator, [.xyz.uvw] for instance.

           Return the given name if it does not contain an extension. *)

val search_substring: string -> string -> int -> int
        (* [search_substring pat str start] returns the position of the first
           occurrence of string [pat] in string [str].  Search starts
           at offset [start] in [str].  Raise [Not_found] if [pat]
           does not occur. *)

val replace_substring: before:string -> after:string -> string -> string
        (* [search_substring ~before ~after str] replaces all occurences
           of [before] with [after] in [str] and returns the resulting string. *)

val rev_split_words: string -> string list
        (* [rev_split_words s] splits [s] in blank-separated words, and return
           the list of words in reverse order. *)

val get_ref: 'a list ref -> 'a list
        (* [get_ref lr] returns the content of the list reference [lr] and reset
           its content to the empty list. *)


val fst3: 'a * 'b * 'c -> 'a
val snd3: 'a * 'b * 'c -> 'b
val thd3: 'a * 'b * 'c -> 'c

val fst4: 'a * 'b * 'c * 'd -> 'a
val snd4: 'a * 'b * 'c * 'd -> 'b
val thd4: 'a * 'b * 'c * 'd -> 'c
val for4: 'a * 'b * 'c * 'd -> 'd

module LongString :
  sig
    type t = bytes array
    val create : int -> t
    val length : t -> int
    val get : t -> int -> char
    val set : t -> int -> char -> unit
    val blit : t -> int -> t -> int -> int -> unit
    val output : out_channel -> t -> int -> int -> unit
    val unsafe_blit_to_bytes : t -> int -> bytes -> int -> int -> unit
    val input_bytes : in_channel -> int -> t
  end

val edit_distance : string -> string -> int -> int option
(** [edit_distance a b cutoff] computes the edit distance between
    strings [a] and [b]. To help efficiency, it uses a cutoff: if the
    distance [d] is smaller than [cutoff], it returns [Some d], else
    [None].

    The distance algorithm currently used is Damerau-Levenshtein: it
    computes the number of insertion, deletion, substitution of
    letters, or swapping of adjacent letters to go from one word to the
    other. The particular algorithm may change in the future.
*)

val split : string -> char -> string list
(** [String.split string char] splits the string [string] at every char
    [char], and returns the list of sub-strings between the chars.
    [String.concat (String.make 1 c) (String.split s c)] is the identity.
    @since 4.01
 *)

val cut_at : string -> char -> string * string
(** [String.cut_at s c] returns a pair containing the sub-string before
   the first occurrence of [c] in [s], and the sub-string after the
   first occurrence of [c] in [s].
   [let (before, after) = String.cut_at s c in
    before ^ String.make 1 c ^ after] is the identity if [s] contains [c].

   Raise [Not_found] if the character does not appear in the string
   @since 4.01
*)





(* Color handling *)
module Color : sig
  type color =
    | Black
    | Red
    | Green
    | Yellow
    | Blue
    | Magenta
    | Cyan
    | White
  ;;

  type style =
    | FG of color (* foreground *)
    | BG of color (* background *)
    | Bold
    | Reset

    | Dim


  val ansi_of_style_l : style list -> string
  (* ANSI escape sequence for the given style *)

  type styles = {
    error: style list;
    warning: style list;
    loc: style list;
  }

  val default_styles: styles
  val get_styles: unit -> styles
  val set_styles: styles -> unit

  val setup : Clflags.color_setting option -> unit
  (* [setup opt] will enable or disable color handling on standard formatters
     according to the value of color setting [opt].
     Only the first call to this function has an effect. *)

  val set_color_tag_handling : Format.formatter -> unit
  (* adds functions to support color tags to the given formatter. *)
end


end = struct
#1 "misc.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Errors *)

exception Fatal_error

let fatal_error msg =
  prerr_string ">> Fatal error: "; prerr_endline msg; raise Fatal_error

(* Exceptions *)

let try_finally work cleanup =
  let result = (try work () with e -> cleanup (); raise e) in
  cleanup ();
  result
;;

(* List functions *)

let rec map_end f l1 l2 =
  match l1 with
    [] -> l2
  | hd::tl -> f hd :: map_end f tl l2

let rec map_left_right f = function
    [] -> []
  | hd::tl -> let res = f hd in res :: map_left_right f tl

let rec for_all2 pred l1 l2 =
  match (l1, l2) with
    ([], []) -> true
  | (hd1::tl1, hd2::tl2) -> pred hd1 hd2 && for_all2 pred tl1 tl2
  | (_, _) -> false

let rec replicate_list elem n =
  if n <= 0 then [] else elem :: replicate_list elem (n-1)

let rec list_remove x = function
    [] -> []
  | hd :: tl ->
      if hd = x then tl else hd :: list_remove x tl

let rec split_last = function
    [] -> assert false
  | [x] -> ([], x)
  | hd :: tl ->
      let (lst, last) = split_last tl in
      (hd :: lst, last)

let rec samelist pred l1 l2 =
  match (l1, l2) with
  | ([], []) -> true
  | (hd1 :: tl1, hd2 :: tl2) -> pred hd1 hd2 && samelist pred tl1 tl2
  | (_, _) -> false

(* Options *)

let may f = function
    Some x -> f x
  | None -> ()

let may_map f = function
    Some x -> Some (f x)
  | None -> None

(* File functions *)

let find_in_path path name =
  if not (Filename.is_implicit name) then
    if Sys.file_exists name then name else raise Not_found
  else begin
    let rec try_dir = function
      [] -> raise Not_found
    | dir::rem ->
        let fullname = Filename.concat dir name in
        if Sys.file_exists fullname then fullname else try_dir rem
    in try_dir path
  end

let find_in_path_rel path name =
  let rec simplify s =
    let open Filename in
    let base = basename s in
    let dir = dirname s in
    if dir = s then dir
    else if base = current_dir_name then simplify dir
    else concat (simplify dir) base
  in
  let rec try_dir = function
    [] -> raise Not_found
  | dir::rem ->
      let fullname = simplify (Filename.concat dir name) in
      if Sys.file_exists fullname then fullname else try_dir rem
  in try_dir path

let find_in_path_uncap path name =
  let uname = String.uncapitalize name in
  let rec try_dir = function
    [] -> raise Not_found
  | dir::rem ->
      let fullname = Filename.concat dir name
      and ufullname = Filename.concat dir uname in
      if Sys.file_exists ufullname then ufullname
      else if Sys.file_exists fullname then fullname
      else try_dir rem
  in try_dir path

let remove_file filename =
  try
    Sys.remove filename
  with Sys_error msg ->
    ()

(* Expand a -I option: if it starts with +, make it relative to the standard
   library directory *)

let expand_directory alt s =
  if String.length s > 0 && s.[0] = '+'
  then Filename.concat alt
                       (String.sub s 1 (String.length s - 1))
  else s

(* Hashtable functions *)

let create_hashtable size init =
  let tbl = Hashtbl.create size in
  List.iter (fun (key, data) -> Hashtbl.add tbl key data) init;
  tbl

(* File copy *)

let copy_file ic oc =
  let buff = Bytes.create 0x1000 in
  let rec copy () =
    let n = input ic buff 0 0x1000 in
    if n = 0 then () else (output oc buff 0 n; copy())
  in copy()

let copy_file_chunk ic oc len =
  let buff = Bytes.create 0x1000 in
  let rec copy n =
    if n <= 0 then () else begin
      let r = input ic buff 0 (min n 0x1000) in
      if r = 0 then raise End_of_file else (output oc buff 0 r; copy(n-r))
    end
  in copy len

let string_of_file ic =
  let b = Buffer.create 0x10000 in
  let buff = Bytes.create 0x1000 in
  let rec copy () =
    let n = input ic buff 0 0x1000 in
    if n = 0 then Buffer.contents b else
      (Buffer.add_subbytes b buff 0 n; copy())
  in copy()

(* Integer operations *)

let rec log2 n =
  if n <= 1 then 0 else 1 + log2(n asr 1)

let align n a =
  if n >= 0 then (n + a - 1) land (-a) else n land (-a)

let no_overflow_add a b = (a lxor b) lor (a lxor (lnot (a+b))) < 0

let no_overflow_sub a b = (a lxor (lnot b)) lor (b lxor (a-b)) < 0

let no_overflow_lsl a = min_int asr 1 <= a && a <= max_int asr 1

(* String operations *)

let chop_extension_if_any fname =
  try Filename.chop_extension fname with Invalid_argument _ -> fname

let chop_extensions file =
  let dirname = Filename.dirname file and basename = Filename.basename file in
  try
    let pos = String.index basename '.' in
    let basename = String.sub basename 0 pos in
    if Filename.is_implicit file && dirname = Filename.current_dir_name then
      basename
    else
      Filename.concat dirname basename
  with Not_found -> file

let search_substring pat str start =
  let rec search i j =
    if j >= String.length pat then i
    else if i + j >= String.length str then raise Not_found
    else if str.[i + j] = pat.[j] then search i (j+1)
    else search (i+1) 0
  in search start 0

let replace_substring ~before ~after str =
  let rec search acc curr =
    match search_substring before str curr with
      | next ->
         let prefix = String.sub str curr (next - curr) in
         search (prefix :: acc) (next + String.length before)
      | exception Not_found ->
        let suffix = String.sub str curr (String.length str - curr) in
        List.rev (suffix :: acc)
  in String.concat after (search [] 0)

let rev_split_words s =
  let rec split1 res i =
    if i >= String.length s then res else begin
      match s.[i] with
        ' ' | '\t' | '\r' | '\n' -> split1 res (i+1)
      | _ -> split2 res i (i+1)
    end
  and split2 res i j =
    if j >= String.length s then String.sub s i (j-i) :: res else begin
      match s.[j] with
        ' ' | '\t' | '\r' | '\n' -> split1 (String.sub s i (j-i) :: res) (j+1)
      | _ -> split2 res i (j+1)
    end
  in split1 [] 0

let get_ref r =
  let v = !r in
  r := []; v

let fst3 (x, _, _) = x
let snd3 (_,x,_) = x
let thd3 (_,_,x) = x

let fst4 (x, _, _, _) = x
let snd4 (_,x,_, _) = x
let thd4 (_,_,x,_) = x
let for4 (_,_,_,x) = x


module LongString = struct
  type t = bytes array

  let create str_size =
    let tbl_size = str_size / Sys.max_string_length + 1 in
    let tbl = Array.make tbl_size Bytes.empty in
    for i = 0 to tbl_size - 2 do
      tbl.(i) <- Bytes.create Sys.max_string_length;
    done;
    tbl.(tbl_size - 1) <- Bytes.create (str_size mod Sys.max_string_length);
    tbl

  let length tbl =
    let tbl_size = Array.length tbl in
    Sys.max_string_length * (tbl_size - 1) + Bytes.length tbl.(tbl_size - 1)

  let get tbl ind =
    Bytes.get tbl.(ind / Sys.max_string_length) (ind mod Sys.max_string_length)

  let set tbl ind c =
    Bytes.set tbl.(ind / Sys.max_string_length) (ind mod Sys.max_string_length)
              c

  let blit src srcoff dst dstoff len =
    for i = 0 to len - 1 do
      set dst (dstoff + i) (get src (srcoff + i))
    done

  let output oc tbl pos len =
    for i = pos to pos + len - 1 do
      output_char oc (get tbl i)
    done

  let unsafe_blit_to_bytes src srcoff dst dstoff len =
    for i = 0 to len - 1 do
      Bytes.unsafe_set dst (dstoff + i) (get src (srcoff + i))
    done

  let input_bytes ic len =
    let tbl = create len in
    Array.iter (fun str -> really_input ic str 0 (Bytes.length str)) tbl;
    tbl
end


let edit_distance a b cutoff =
  let la, lb = String.length a, String.length b in
  let cutoff =
    (* using max_int for cutoff would cause overflows in (i + cutoff + 1);
       we bring it back to the (max la lb) worstcase *)
    min (max la lb) cutoff in
  if abs (la - lb) > cutoff then None
  else begin
    (* initialize with 'cutoff + 1' so that not-yet-written-to cases have
       the worst possible cost; this is useful when computing the cost of
       a case just at the boundary of the cutoff diagonal. *)
    let m = Array.make_matrix (la + 1) (lb + 1) (cutoff + 1) in
    m.(0).(0) <- 0;
    for i = 1 to la do
      m.(i).(0) <- i;
    done;
    for j = 1 to lb do
      m.(0).(j) <- j;
    done;
    for i = 1 to la do
      for j = max 1 (i - cutoff - 1) to min lb (i + cutoff + 1) do
        let cost = if a.[i-1] = b.[j-1] then 0 else 1 in
        let best =
          (* insert, delete or substitute *)
          min (1 + min m.(i-1).(j) m.(i).(j-1)) (m.(i-1).(j-1) + cost)
        in
        let best =
          (* swap two adjacent letters; we use "cost" again in case of
             a swap between two identical letters; this is slightly
             redundant as this is a double-substitution case, but it
             was done this way in most online implementations and
             imitation has its virtues *)
          if not (i > 1 && j > 1 && a.[i-1] = b.[j-2] && a.[i-2] = b.[j-1])
          then best
          else min best (m.(i-2).(j-2) + cost)
        in
        m.(i).(j) <- best
      done;
    done;
    let result = m.(la).(lb) in
    if result > cutoff
    then None
    else Some result
  end


(* split a string [s] at every char [c], and return the list of sub-strings *)
let split s c =
  let len = String.length s in
  let rec iter pos to_rev =
    if pos = len then List.rev ("" :: to_rev) else
      match try
              Some ( String.index_from s pos c )
        with Not_found -> None
      with
          Some pos2 ->
            if pos2 = pos then iter (pos+1) ("" :: to_rev) else
              iter (pos2+1) ((String.sub s pos (pos2-pos)) :: to_rev)
        | None -> List.rev ( String.sub s pos (len-pos) :: to_rev )
  in
  iter 0 []

let cut_at s c =
  let pos = String.index s c in
  String.sub s 0 pos, String.sub s (pos+1) (String.length s - pos - 1)





(* Color handling *)
module Color = struct
  (* use ANSI color codes, see https://en.wikipedia.org/wiki/ANSI_escape_code *)
  type color =
    | Black
    | Red
    | Green
    | Yellow
    | Blue
    | Magenta
    | Cyan
    | White
  ;;

  type style =
    | FG of color (* foreground *)
    | BG of color (* background *)
    | Bold
    | Reset

    | Dim


  let ansi_of_color = function
    | Black -> "0"
    | Red -> "1"
    | Green -> "2"
    | Yellow -> "3"
    | Blue -> "4"
    | Magenta -> "5"
    | Cyan -> "6"
    | White -> "7"

  let code_of_style = function
    | FG c -> "3" ^ ansi_of_color c
    | BG c -> "4" ^ ansi_of_color c
    | Bold -> "1"
    | Reset -> "0"

    | Dim -> "2"


  let ansi_of_style_l l =
    let s = match l with
      | [] -> code_of_style Reset
      | [s] -> code_of_style s
      | _ -> String.concat ";" (List.map code_of_style l)
    in
    "\x1b[" ^ s ^ "m"

  type styles = {
    error: style list;
    warning: style list;
    loc: style list;
  }

  let default_styles = {
    warning = [Bold; FG Magenta];
    error = [Bold; FG Red];
    loc = [Bold];
  }

  let cur_styles = ref default_styles
  let get_styles () = !cur_styles
  let set_styles s = cur_styles := s

  (* map a tag to a style, if the tag is known.
     @raise Not_found otherwise *)
  let style_of_tag s = match s with
    | "error" -> (!cur_styles).error
    | "warning" -> (!cur_styles).warning
    | "loc" -> (!cur_styles).loc

    | "info" -> [Bold; FG Yellow]
    | "dim" -> [Dim]
    | "filename" -> [FG Cyan]

    | _ -> raise Not_found

  let color_enabled = ref true

  (* either prints the tag of [s] or delegate to [or_else] *)
  let mark_open_tag ~or_else s =
    try
      let style = style_of_tag s in
      if !color_enabled then ansi_of_style_l style else ""
    with Not_found -> or_else s

  let mark_close_tag ~or_else s =
    try
      let _ = style_of_tag s in
      if !color_enabled then ansi_of_style_l [Reset] else ""
    with Not_found -> or_else s

  (* add color handling to formatter [ppf] *)
  let set_color_tag_handling ppf =
    let open Format in
    let functions = pp_get_formatter_tag_functions ppf () in
    let functions' = {functions with
      mark_open_tag=(mark_open_tag ~or_else:functions.mark_open_tag);
      mark_close_tag=(mark_close_tag ~or_else:functions.mark_close_tag);
    } in
    pp_set_mark_tags ppf true; (* enable tags *)
    pp_set_formatter_tag_functions ppf functions'

  (* external isatty : out_channel -> bool = "caml_sys_isatty" *)

  (* reasonable heuristic on whether colors should be enabled *)
   let should_enable_color () = false  
(*    let term = try Sys.getenv "TERM" with Not_found -> "" in
    term <> "dumb"
    && term <> "" *)
(*    && isatty stderr *)

  let setup =
    let first = ref true in (* initialize only once *)
    let formatter_l = [Format.std_formatter; Format.err_formatter; Format.str_formatter] in
    fun o ->
      if !first then (
        first := false;
        Format.set_mark_tags true;
        List.iter set_color_tag_handling formatter_l;
        color_enabled := (match o with
          | Some Clflags.Always -> true
          | Some Clflags.Auto -> should_enable_color ()
          | Some Clflags.Never -> false
          | None -> should_enable_color ()
        )
      );
      ()
end


end
module Terminfo : sig 
#1 "terminfo.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Basic interface to the terminfo database *)

type status =
  | Uninitialised
  | Bad_term
  | Good_term of int  (* number of lines of the terminal *)
;;
external setup : out_channel -> status = "caml_terminfo_setup";;
external backup : int -> unit = "caml_terminfo_backup";;
external standout : bool -> unit = "caml_terminfo_standout";;
external resume : int -> unit = "caml_terminfo_resume";;

end = struct
#1 "terminfo.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Basic interface to the terminfo database *)

type status =
  | Uninitialised
  | Bad_term
  | Good_term of int
;;
external setup : out_channel -> status = "caml_terminfo_setup";;
external backup : int -> unit = "caml_terminfo_backup";;
external standout : bool -> unit = "caml_terminfo_standout";;
external resume : int -> unit = "caml_terminfo_resume";;

end
module Warnings : sig 
#1 "warnings.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Pierre Weis && Damien Doligez, INRIA Rocquencourt        *)
(*                                                                     *)
(*  Copyright 1998 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Format

type t =
  | Comment_start                           (*  1 *)
  | Comment_not_end                         (*  2 *)
  | Deprecated of string                    (*  3 *)
  | Fragile_match of string                 (*  4 *)
  | Partial_application                     (*  5 *)
  | Labels_omitted                          (*  6 *)
  | Method_override of string list          (*  7 *)
  | Partial_match of string                 (*  8 *)
  | Non_closed_record_pattern of string     (*  9 *)
  | Statement_type                          (* 10 *)
  | Unused_match                            (* 11 *)
  | Unused_pat                              (* 12 *)
  | Instance_variable_override of string list (* 13 *)
  | Illegal_backslash                       (* 14 *)
  | Implicit_public_methods of string list  (* 15 *)
  | Unerasable_optional_argument            (* 16 *)
  | Undeclared_virtual_method of string     (* 17 *)
  | Not_principal of string                 (* 18 *)
  | Without_principality of string          (* 19 *)
  | Unused_argument                         (* 20 *)
  | Nonreturning_statement                  (* 21 *)
  | Preprocessor of string                  (* 22 *)
  | Useless_record_with                     (* 23 *)
  | Bad_module_name of string               (* 24 *)
  | All_clauses_guarded                     (* 25 *)
  | Unused_var of string                    (* 26 *)
  | Unused_var_strict of string             (* 27 *)
  | Wildcard_arg_to_constant_constr         (* 28 *)
  | Eol_in_string                           (* 29 *)
  | Duplicate_definitions of string * string * string * string (* 30 *)
  | Multiple_definition of string * string * string (* 31 *)
  | Unused_value_declaration of string      (* 32 *)
  | Unused_open of string                   (* 33 *)
  | Unused_type_declaration of string       (* 34 *)
  | Unused_for_index of string              (* 35 *)
  | Unused_ancestor of string               (* 36 *)
  | Unused_constructor of string * bool * bool (* 37 *)
  | Unused_extension of string * bool * bool   (* 38 *)
  | Unused_rec_flag                         (* 39 *)
  | Name_out_of_scope of string * string list * bool   (* 40 *)
  | Ambiguous_name of string list * string list * bool (* 41 *)
  | Disambiguated_name of string            (* 42 *)
  | Nonoptional_label of string             (* 43 *)
  | Open_shadow_identifier of string * string (* 44 *)
  | Open_shadow_label_constructor of string * string (* 45 *)
  | Bad_env_variable of string * string     (* 46 *)
  | Attribute_payload of string * string    (* 47 *)
  | Eliminated_optional_arguments of string list (* 48 *)
  | No_cmi_file of string                   (* 49 *)
  | Bad_docstring of bool                   (* 50 *)

  | Bs_unused_attribute of string           (* 101 *)
  | Bs_polymorphic_comparison               (* 102 *)
  | Bs_ffi_warning of string                (* 103 *)
  | Bs_derive_warning of string             (* 104 *)
;;

val parse_options : bool -> string -> unit;;

val is_active : t -> bool;;
val is_error : t -> bool;;

val defaults_w : string;;
val defaults_warn_error : string;;

val print : formatter -> t -> unit;;

exception Errors of int;;

val check_fatal : unit -> unit;;

val help_warnings: unit -> unit

type state
val backup: unit -> state
val restore: state -> unit


val message : t -> string 
val number: t -> int
val super_print : (t -> string) -> formatter -> t -> unit;;


end = struct
#1 "warnings.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Pierre Weis && Damien Doligez, INRIA Rocquencourt        *)
(*                                                                     *)
(*  Copyright 1998 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* When you change this, you need to update the documentation:
   - man/ocamlc.m   in ocaml
   - man/ocamlopt.m in ocaml
   - manual/cmds/comp.etex   in the doc sources
   - manual/cmds/native.etex in the doc sources
*)

type t =
  | Comment_start                           (*  1 *)
  | Comment_not_end                         (*  2 *)
  | Deprecated of string                    (*  3 *)
  | Fragile_match of string                 (*  4 *)
  | Partial_application                     (*  5 *)
  | Labels_omitted                          (*  6 *)
  | Method_override of string list          (*  7 *)
  | Partial_match of string                 (*  8 *)
  | Non_closed_record_pattern of string     (*  9 *)
  | Statement_type                          (* 10 *)
  | Unused_match                            (* 11 *)
  | Unused_pat                              (* 12 *)
  | Instance_variable_override of string list (* 13 *)
  | Illegal_backslash                       (* 14 *)
  | Implicit_public_methods of string list  (* 15 *)
  | Unerasable_optional_argument            (* 16 *)
  | Undeclared_virtual_method of string     (* 17 *)
  | Not_principal of string                 (* 18 *)
  | Without_principality of string          (* 19 *)
  | Unused_argument                         (* 20 *)
  | Nonreturning_statement                  (* 21 *)
  | Preprocessor of string                  (* 22 *)
  | Useless_record_with                     (* 23 *)
  | Bad_module_name of string               (* 24 *)
  | All_clauses_guarded                     (* 25 *)
  | Unused_var of string                    (* 26 *)
  | Unused_var_strict of string             (* 27 *)
  | Wildcard_arg_to_constant_constr         (* 28 *)
  | Eol_in_string                           (* 29 *)
  | Duplicate_definitions of string * string * string * string (*30 *)
  | Multiple_definition of string * string * string (* 31 *)
  | Unused_value_declaration of string      (* 32 *)
  | Unused_open of string                   (* 33 *)
  | Unused_type_declaration of string       (* 34 *)
  | Unused_for_index of string              (* 35 *)
  | Unused_ancestor of string               (* 36 *)
  | Unused_constructor of string * bool * bool  (* 37 *)
  | Unused_extension of string * bool * bool    (* 38 *)
  | Unused_rec_flag                         (* 39 *)
  | Name_out_of_scope of string * string list * bool (* 40 *)
  | Ambiguous_name of string list * string list *  bool    (* 41 *)
  | Disambiguated_name of string            (* 42 *)
  | Nonoptional_label of string             (* 43 *)
  | Open_shadow_identifier of string * string (* 44 *)
  | Open_shadow_label_constructor of string * string (* 45 *)
  | Bad_env_variable of string * string     (* 46 *)
  | Attribute_payload of string * string    (* 47 *)
  | Eliminated_optional_arguments of string list (* 48 *)
  | No_cmi_file of string                   (* 49 *)
  | Bad_docstring of bool                   (* 50 *)

  | Bs_unused_attribute of string           (* 101 *)
  | Bs_polymorphic_comparison               (* 102 *)
  | Bs_ffi_warning of string                (* 103 *)
  | Bs_derive_warning of string             (* 104 *)
;;

(* If you remove a warning, leave a hole in the numbering.  NEVER change
   the numbers of existing warnings.
   If you add a new warning, add it at the end with a new number;
   do NOT reuse one of the holes.
*)

let number = function
  | Comment_start -> 1
  | Comment_not_end -> 2
  | Deprecated _ -> 3
  | Fragile_match _ -> 4
  | Partial_application -> 5
  | Labels_omitted -> 6
  | Method_override _ -> 7
  | Partial_match _ -> 8
  | Non_closed_record_pattern _ -> 9
  | Statement_type -> 10
  | Unused_match -> 11
  | Unused_pat -> 12
  | Instance_variable_override _ -> 13
  | Illegal_backslash -> 14
  | Implicit_public_methods _ -> 15
  | Unerasable_optional_argument -> 16
  | Undeclared_virtual_method _ -> 17
  | Not_principal _ -> 18
  | Without_principality _ -> 19
  | Unused_argument -> 20
  | Nonreturning_statement -> 21
  | Preprocessor _ -> 22
  | Useless_record_with -> 23
  | Bad_module_name _ -> 24
  | All_clauses_guarded -> 25
  | Unused_var _ -> 26
  | Unused_var_strict _ -> 27
  | Wildcard_arg_to_constant_constr -> 28
  | Eol_in_string -> 29
  | Duplicate_definitions _ -> 30
  | Multiple_definition _ -> 31
  | Unused_value_declaration _ -> 32
  | Unused_open _ -> 33
  | Unused_type_declaration _ -> 34
  | Unused_for_index _ -> 35
  | Unused_ancestor _ -> 36
  | Unused_constructor _ -> 37
  | Unused_extension _ -> 38
  | Unused_rec_flag -> 39
  | Name_out_of_scope _ -> 40
  | Ambiguous_name _ -> 41
  | Disambiguated_name _ -> 42
  | Nonoptional_label _ -> 43
  | Open_shadow_identifier _ -> 44
  | Open_shadow_label_constructor _ -> 45
  | Bad_env_variable _ -> 46
  | Attribute_payload _ -> 47
  | Eliminated_optional_arguments _ -> 48
  | No_cmi_file _ -> 49
  | Bad_docstring _ -> 50

  | Bs_unused_attribute _ -> 101
  | Bs_polymorphic_comparison -> 102
  | Bs_ffi_warning _ -> 103
  | Bs_derive_warning _ -> 104
;;

let last_warning_number = 104
(* Must be the max number returned by the [number] function. *)
let letter_all = 
  let rec loop i = if i = 0 then [] else i :: loop (i - 1) in
  loop last_warning_number

let letter = function
  | 'a' ->
    letter_all
  | 'b' -> []
  | 'c' -> [1; 2]
  | 'd' -> [3]
  | 'e' -> [4]
  | 'f' -> [5]
  | 'g' -> []
  | 'h' -> []
  | 'i' -> []
  | 'j' -> []
  | 'k' -> [32; 33; 34; 35; 36; 37; 38; 39]
  | 'l' -> [6]
  | 'm' -> [7]
  | 'n' -> []
  | 'o' -> []
  | 'p' -> [8]
  | 'q' -> []
  | 'r' -> [9]
  | 's' -> [10]
  | 't' -> []
  | 'u' -> [11; 12]
  | 'v' -> [13]
  | 'w' -> []
  | 'x' -> [14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 30]
  | 'y' -> [26]
  | 'z' -> [27]
  | _ -> assert false
;;

type state =
  {
    active: bool array;
    error: bool array;
  }

let current =
  ref
    {
      active = Array.make (last_warning_number + 1) true;
      error = Array.make (last_warning_number + 1) false;
    }

let backup () = !current

let restore x = current := x

let is_active x = (!current).active.(number x);;
let is_error x = (!current).error.(number x);;

let parse_opt error active flags s =
  let set i = flags.(i) <- true in
  let clear i = flags.(i) <- false in
  let set_all i = active.(i) <- true; error.(i) <- true in
  let error () = raise (Arg.Bad "Ill-formed list of warnings") in
  let rec get_num n i =
    if i >= String.length s then i, n
    else match s.[i] with
    | '0'..'9' -> get_num (10 * n + Char.code s.[i] - Char.code '0') (i + 1)
    | _ -> i, n
  in
  let get_range i =
    let i, n1 = get_num 0 i in
    if i + 2 < String.length s && s.[i] = '.' && s.[i + 1] = '.' then
      let i, n2 = get_num 0 (i + 2) in
      if n2 < n1 then error ();
      i, n1, n2
    else
      i, n1, n1
  in
  let rec loop i =
    if i >= String.length s then () else
    match s.[i] with
    | 'A' .. 'Z' ->
       List.iter set (letter (Char.lowercase s.[i]));
       loop (i+1)
    | 'a' .. 'z' ->
       List.iter clear (letter s.[i]);
       loop (i+1)
    | '+' -> loop_letter_num set (i+1)
    | '-' -> loop_letter_num clear (i+1)
    | '@' -> loop_letter_num set_all (i+1)
    | c -> error ()
  and loop_letter_num myset i =
    if i >= String.length s then error () else
    match s.[i] with
    | '0' .. '9' ->
        let i, n1, n2 = get_range i in
        for n = n1 to min n2 last_warning_number do myset n done;
        loop i
    | 'A' .. 'Z' ->
       List.iter myset (letter (Char.lowercase s.[i]));
       loop (i+1)
    | 'a' .. 'z' ->
       List.iter myset (letter s.[i]);
       loop (i+1)
    | _ -> error ()
  in
  loop 0
;;

let parse_options errflag s =
  let error = Array.copy (!current).error in
  let active = Array.copy (!current).active in
  parse_opt error active (if errflag then error else active) s;
  current := {error; active}

(* If you change these, don't forget to change them in man/ocamlc.m *)
let defaults_w = "+a-4-6-7-9-27-29-32..39-41..42-44-45-48-50-102";;
let defaults_warn_error = "-a";;

let () = parse_options false defaults_w;;
let () = parse_options true defaults_warn_error;;

let message = function
  | Comment_start -> "this is the start of a comment."
  | Comment_not_end -> "this is not the end of a comment."
  | Deprecated s -> "deprecated: " ^ s
  | Fragile_match "" ->
      "this pattern-matching is fragile."
  | Fragile_match s ->
      "this pattern-matching is fragile.\n\
       It will remain exhaustive when constructors are added to type " ^ s ^ "."
  | Partial_application ->
      "this function application is partial,\n\
       maybe some arguments are missing."
  | Labels_omitted ->
      "labels were omitted in the application of this function."
  | Method_override [lab] ->
      "the method " ^ lab ^ " is overridden."
  | Method_override (cname :: slist) ->
      String.concat " "
        ("the following methods are overridden by the class"
         :: cname  :: ":\n " :: slist)
  | Method_override [] -> assert false
  | Partial_match "" -> "this pattern-matching is not exhaustive."
  | Partial_match s ->
      "this pattern-matching is not exhaustive.\n\
       Here is an example of a value that is not matched:\n" ^ s
  | Non_closed_record_pattern s ->
      "the following labels are not bound in this record pattern:\n" ^ s ^
      "\nEither bind these labels explicitly or add '; _' to the pattern."
  | Statement_type ->
      "this expression should have type unit."
  | Unused_match -> "this match case is unused."
  | Unused_pat   -> "this sub-pattern is unused."
  | Instance_variable_override [lab] ->
      "the instance variable " ^ lab ^ " is overridden.\n" ^
      "The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"
  | Instance_variable_override (cname :: slist) ->
      String.concat " "
        ("the following instance variables are overridden by the class"
         :: cname  :: ":\n " :: slist) ^
      "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"
  | Instance_variable_override [] -> assert false
  | Illegal_backslash -> "illegal backslash escape in string."
  | Implicit_public_methods l ->
      "the following private methods were made public implicitly:\n "
      ^ String.concat " " l ^ "."
  | Unerasable_optional_argument -> "this optional argument cannot be erased."
  | Undeclared_virtual_method m -> "the virtual method "^m^" is not declared."
  | Not_principal s -> s^" is not principal."
  | Without_principality s -> s^" without principality."
  | Unused_argument -> "this argument will not be used by the function."
  | Nonreturning_statement ->
      "this statement never returns (or has an unsound type.)"
  | Preprocessor s -> s
  | Useless_record_with ->
      "all the fields are explicitly listed in this record:\n\
       the 'with' clause is useless."
  | Bad_module_name (modname) ->
      "bad source file name: \"" ^ modname ^ "\" is not a valid module name."
  | All_clauses_guarded ->
      "bad style, all clauses in this pattern-matching are guarded."
  | Unused_var v | Unused_var_strict v -> "unused variable " ^ v ^ "."
  | Wildcard_arg_to_constant_constr ->
     "wildcard pattern given as argument to a constant constructor"
  | Eol_in_string ->
     "unescaped end-of-line in a string constant (non-portable code)"
  | Duplicate_definitions (kind, cname, tc1, tc2) ->
      Printf.sprintf "the %s %s is defined in both types %s and %s."
        kind cname tc1 tc2
  | Multiple_definition(modname, file1, file2) ->
      Printf.sprintf
        "files %s and %s both define a module named %s"
        file1 file2 modname
  | Unused_value_declaration v -> "unused value " ^ v ^ "."
  | Unused_open s -> "unused open " ^ s ^ "."
  | Unused_type_declaration s -> "unused type " ^ s ^ "."
  | Unused_for_index s -> "unused for-loop index " ^ s ^ "."
  | Unused_ancestor s -> "unused ancestor variable " ^ s ^ "."
  | Unused_constructor (s, false, false) -> "unused constructor " ^ s ^ "."
  | Unused_constructor (s, true, _) ->
      "constructor " ^ s ^
      " is never used to build values.\n\
        (However, this constructor appears in patterns.)"
  | Unused_constructor (s, false, true) ->
      "constructor " ^ s ^
      " is never used to build values.\n\
        Its type is exported as a private type."
  | Unused_extension (s, false, false) ->
      "unused extension constructor " ^ s ^ "."
  | Unused_extension (s, true, _) ->
      "extension constructor " ^ s ^
      " is never used to build values.\n\
        (However, this constructor appears in patterns.)"
  | Unused_extension (s, false, true) ->
      "extension constructor " ^ s ^
      " is never used to build values.\n\
        It is exported or rebound as a private extension."
  | Unused_rec_flag ->
      "unused rec flag."
  | Name_out_of_scope (ty, [nm], false) ->
      nm ^ " was selected from type " ^ ty ^
      ".\nIt is not visible in the current scope, and will not \n\
       be selected if the type becomes unknown."
  | Name_out_of_scope (_, _, false) -> assert false
  | Name_out_of_scope (ty, slist, true) ->
      "this record of type "^ ty ^" contains fields that are \n\
       not visible in the current scope: "
      ^ String.concat " " slist ^ ".\n\
       They will not be selected if the type becomes unknown."
  | Ambiguous_name ([s], tl, false) ->
      s ^ " belongs to several types: " ^ String.concat " " tl ^
      "\nThe first one was selected. Please disambiguate if this is wrong."
  | Ambiguous_name (_, _, false) -> assert false
  | Ambiguous_name (slist, tl, true) ->
      "these field labels belong to several types: " ^
      String.concat " " tl ^
      "\nThe first one was selected. Please disambiguate if this is wrong."
  | Disambiguated_name s ->
      "this use of " ^ s ^ " required disambiguation."
  | Nonoptional_label s ->
      "the label " ^ s ^ " is not optional."
  | Open_shadow_identifier (kind, s) ->
      Printf.sprintf
        "this open statement shadows the %s identifier %s (which is later used)"
        kind s
  | Open_shadow_label_constructor (kind, s) ->
      Printf.sprintf
        "this open statement shadows the %s %s (which is later used)"
        kind s
  | Bad_env_variable (var, s) ->
      Printf.sprintf "illegal environment variable %s : %s" var s
  | Attribute_payload (a, s) ->
      Printf.sprintf "illegal payload for attribute '%s'.\n%s" a s
  | Eliminated_optional_arguments sl ->
      Printf.sprintf "implicit elimination of optional argument%s %s"
        (if List.length sl = 1 then "" else "s")
        (String.concat ", " sl)
  | No_cmi_file s ->
      "no cmi file was found in path for module " ^ s
  | Bad_docstring unattached ->
      if unattached then "unattached documentation comment (ignored)"
      else "ambiguous documentation comment"
  | Bs_unused_attribute s ->
      "Unused BuckleScript attribute: " ^ s
  | Bs_polymorphic_comparison ->
      "polymorphic comparison introduced (maybe unsafe)"
  | Bs_ffi_warning s ->
      "BuckleScript FFI warning: " ^ s
  | Bs_derive_warning s ->
      "BuckleScript bs.deriving warning: " ^ s 
;;

let nerrors = ref 0;;

let print ppf w =
  let msg = message w in
  let num = number w in
  Format.fprintf ppf "%d: %s" num msg;
  Format.pp_print_flush ppf ();
  if (!current).error.(num) then incr nerrors
;;


(* used by super-errors. Copied from the `print` above *)
let super_print message ppf w =
  let msg = message w in
  let num = number w in
  Format.fprintf ppf "%s" msg;
  Format.pp_print_flush ppf ();
  if (!current).error.(num) then incr nerrors
;;


exception Errors of int;;

let check_fatal () =
  if !nerrors > 0 then begin
    let e = Errors !nerrors in
    nerrors := 0;
    raise e;
  end;
;;

let descriptions =
  [
    1, "Suspicious-looking start-of-comment mark.";
    2, "Suspicious-looking end-of-comment mark.";
    3, "Deprecated feature.";
    4, "Fragile pattern matching: matching that will remain complete even\n\
   \    if additional constructors are added to one of the variant types\n\
   \    matched.";
    5, "Partially applied function: expression whose result has function\n\
   \    type and is ignored.";
    6, "Label omitted in function application.";
    7, "Method overridden.";
    8, "Partial match: missing cases in pattern-matching.";
    9, "Missing fields in a record pattern.";
   10, "Expression on the left-hand side of a sequence that doesn't have type\n\
   \    \"unit\" (and that is not a function, see warning number 5).";
   11, "Redundant case in a pattern matching (unused match case).";
   12, "Redundant sub-pattern in a pattern-matching.";
   13, "Instance variable overridden.";
   14, "Illegal backslash escape in a string constant.";
   15, "Private method made public implicitly.";
   16, "Unerasable optional argument.";
   17, "Undeclared virtual method.";
   18, "Non-principal type.";
   19, "Type without principality.";
   20, "Unused function argument.";
   21, "Non-returning statement.";
   22, "Proprocessor warning.";
   23, "Useless record \"with\" clause.";
   24, "Bad module name: the source file name is not a valid OCaml module \
        name.";
   25, "Pattern-matching with all clauses guarded.  Exhaustiveness cannot be\n\
   \    checked.";
   26, "Suspicious unused variable: unused variable that is bound\n\
   \    with \"let\" or \"as\", and doesn't start with an underscore (\"_\")\n\
   \    character.";
   27, "Innocuous unused variable: unused variable that is not bound with\n\
   \    \"let\" nor \"as\", and doesn't start with an underscore (\"_\")\n\
   \    character.";
   28, "Wildcard pattern given as argument to a constant constructor.";
   29, "Unescaped end-of-line in a string constant (non-portable code).";
   30, "Two labels or constructors of the same name are defined in two\n\
   \    mutually recursive types.";
   31, "A module is linked twice in the same executable.";
   32, "Unused value declaration.";
   33, "Unused open statement.";
   34, "Unused type declaration.";
   35, "Unused for-loop index.";
   36, "Unused ancestor variable.";
   37, "Unused constructor.";
   38, "Unused extension constructor.";
   39, "Unused rec flag.";
   40, "Constructor or label name used out of scope.";
   41, "Ambiguous constructor or label name.";
   42, "Disambiguated constructor or label name.";
   43, "Nonoptional label applied as optional.";
   44, "Open statement shadows an already defined identifier.";
   45, "Open statement shadows an already defined label or constructor.";
   46, "Error in environment variable.";
   47, "Illegal attribute payload.";
   48, "Implicit elimination of optional arguments.";
   49, "Missing cmi file when looking up module alias.";
   50, "Unexpected documentation comment.";
   101,"Unused bs attributes";
  ]
;;

let help_warnings () =
  List.iter (fun (i, s) -> Printf.printf "%3i %s\n" i s) descriptions;
  print_endline "  A all warnings";
  for i = Char.code 'b' to Char.code 'z' do
    let c = Char.chr i in
    match letter c with
    | [] -> ()
    | [n] ->
        Printf.printf "  %c warning %i\n" (Char.uppercase c) n
    | l ->
        Printf.printf "  %c warnings %s.\n"
          (Char.uppercase c)
          (String.concat ", " (List.map string_of_int l))
  done;
  exit 0
;;

end
module Location : sig 
#1 "location.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Source code locations (ranges of positions), used in parsetree. *)

open Format

type t = {
  loc_start: Lexing.position;
  loc_end: Lexing.position;
  loc_ghost: bool;
}

(* Note on the use of Lexing.position in this module.
   If [pos_fname = ""], then use [!input_name] instead.
   If [pos_lnum = -1], then [pos_bol = 0]. Use [pos_cnum] and
     re-parse the file to get the line and character numbers.
   Else all fields are correct.
*)

val none : t
(** An arbitrary value of type [t]; describes an empty ghost range. *)

val in_file : string -> t
(** Return an empty ghost range located in a given file. *)

val init : Lexing.lexbuf -> string -> unit
(** Set the file name and line number of the [lexbuf] to be the start
    of the named file. *)

val curr : Lexing.lexbuf -> t
(** Get the location of the current token from the [lexbuf]. *)

val symbol_rloc: unit -> t
val symbol_gloc: unit -> t

(** [rhs_loc n] returns the location of the symbol at position [n], starting
  at 1, in the current parser rule. *)
val rhs_loc: int -> t

val input_name: string ref
val input_lexbuf: Lexing.lexbuf option ref

val get_pos_info: Lexing.position -> string * int * int (* file, line, char *)
val print_loc: formatter -> t -> unit
val print_error: formatter -> t -> unit
val print_error_cur_file: formatter -> unit -> unit
val print_warning: t -> formatter -> Warnings.t -> unit
val formatter_for_warnings : formatter ref
val prerr_warning: t -> Warnings.t -> unit
val echo_eof: unit -> unit
val reset: unit -> unit

val warning_printer : (t -> formatter -> Warnings.t -> unit) ref
(** Hook for intercepting warnings. *)

val default_warning_printer : t -> formatter -> Warnings.t -> unit
(** Original warning printer for use in hooks. *)

val highlight_locations: formatter -> t list -> bool

type 'a loc = {
  txt : 'a;
  loc : t;
}

val mknoloc : 'a -> 'a loc
val mkloc : 'a -> t -> 'a loc

val print: formatter -> t -> unit
val print_filename: formatter -> string -> unit

val absolute_path: string -> string

val show_filename: string -> string
    (** In -absname mode, return the absolute path for this filename.
        Otherwise, returns the filename unchanged. *)


val absname: bool ref

(* Support for located errors *)

type error =
  {
    loc: t;
    msg: string;
    sub: error list;
    if_highlight: string; (* alternative message if locations are highlighted *)
  }

exception Error of error

val print_error_prefix: formatter -> unit -> unit
  (* print the prefix "Error:" possibly with style *)

val error: ?loc:t -> ?sub:error list -> ?if_highlight:string -> string -> error

 
val pp_ksprintf : ?before:(formatter -> unit) -> (string -> 'a) -> ('b, formatter, unit, 'a) format4 -> 'b


val errorf: ?loc:t -> ?sub:error list -> ?if_highlight:string
            -> ('a, Format.formatter, unit, error) format4 -> 'a

val raise_errorf: ?loc:t -> ?sub:error list -> ?if_highlight:string
            -> ('a, Format.formatter, unit, 'b) format4 -> 'a

val error_of_printer: t -> (formatter -> 'a -> unit) -> 'a -> error

val error_of_printer_file: (formatter -> 'a -> unit) -> 'a -> error

val error_of_exn: exn -> error option

val register_error_of_exn: (exn -> error option) -> unit
  (* Each compiler module which defines a custom type of exception
     which can surface as a user-visible error should register
     a "printer" for this exception using [register_error_of_exn].
     The result of the printer is an [error] value containing
     a location, a message, and optionally sub-messages (each of them
     being located as well). *)

val report_error: formatter -> error -> unit

val error_reporter : (formatter -> error -> unit) ref
(** Hook for intercepting error reports. *)

val default_error_reporter : formatter -> error -> unit
(** Original error reporter for use in hooks. *)

val report_exception: formatter -> exn -> unit
  (* Reraise the exception if it is unknown. *)

end = struct
#1 "location.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Lexing

let absname = ref false
    (* This reference should be in Clflags, but it would create an additional
       dependency and make bootstrapping Camlp4 more difficult. *)

type t = { loc_start: position; loc_end: position; loc_ghost: bool };;

let in_file name =
  let loc = {
    pos_fname = name;
    pos_lnum = 1;
    pos_bol = 0;
    pos_cnum = -1;
  } in
  { loc_start = loc; loc_end = loc; loc_ghost = true }
;;

let none = in_file "_none_";;

let curr lexbuf = {
  loc_start = lexbuf.lex_start_p;
  loc_end = lexbuf.lex_curr_p;
  loc_ghost = false
};;

let init lexbuf fname =
  lexbuf.lex_curr_p <- {
    pos_fname = fname;
    pos_lnum = 1;
    pos_bol = 0;
    pos_cnum = 0;
  }
;;

let symbol_rloc () = {
  loc_start = Parsing.symbol_start_pos ();
  loc_end = Parsing.symbol_end_pos ();
  loc_ghost = false;
};;

let symbol_gloc () = {
  loc_start = Parsing.symbol_start_pos ();
  loc_end = Parsing.symbol_end_pos ();
  loc_ghost = true;
};;

let rhs_loc n = {
  loc_start = Parsing.rhs_start_pos n;
  loc_end = Parsing.rhs_end_pos n;
  loc_ghost = false;
};;

let input_name = ref "_none_"
let input_lexbuf = ref (None : lexbuf option)

(* Terminal info *)

let status = ref Terminfo.Uninitialised

let num_loc_lines = ref 0 (* number of lines already printed after input *)

let print_updating_num_loc_lines ppf f arg =
  let open Format in
  let out_functions = pp_get_formatter_out_functions ppf () in
  let out_string str start len =
    let rec count i c =
      if i = start + len then c
      else if String.get str i = '\n' then count (succ i) (succ c)
      else count (succ i) c in
    num_loc_lines := !num_loc_lines + count start 0 ;
    out_functions.out_string str start len in
  pp_set_formatter_out_functions ppf
    { out_functions with out_string } ;
  f ppf arg ;
  pp_print_flush ppf ();
  pp_set_formatter_out_functions ppf out_functions

(* Highlight the locations using standout mode. *)

let highlight_terminfo ppf num_lines lb locs =
  Format.pp_print_flush ppf ();  (* avoid mixing Format and normal output *)
  (* Char 0 is at offset -lb.lex_abs_pos in lb.lex_buffer. *)
  let pos0 = -lb.lex_abs_pos in
  (* Do nothing if the buffer does not contain the whole phrase. *)
  if pos0 < 0 then raise Exit;
  (* Count number of lines in phrase *)
  let lines = ref !num_loc_lines in
  for i = pos0 to lb.lex_buffer_len - 1 do
    if Bytes.get lb.lex_buffer i = '\n' then incr lines
  done;
  (* If too many lines, give up *)
  if !lines >= num_lines - 2 then raise Exit;
  (* Move cursor up that number of lines *)
  flush stdout; Terminfo.backup !lines;
  (* Print the input, switching to standout for the location *)
  let bol = ref false in
  print_string "# ";
  for pos = 0 to lb.lex_buffer_len - pos0 - 1 do
    if !bol then (print_string "  "; bol := false);
    if List.exists (fun loc -> pos = loc.loc_start.pos_cnum) locs then
      Terminfo.standout true;
    if List.exists (fun loc -> pos = loc.loc_end.pos_cnum) locs then
      Terminfo.standout false;
    let c = Bytes.get lb.lex_buffer (pos + pos0) in
    print_char c;
    bol := (c = '\n')
  done;
  (* Make sure standout mode is over *)
  Terminfo.standout false;
  (* Position cursor back to original location *)
  Terminfo.resume !num_loc_lines;
  flush stdout

(* Highlight the location by printing it again. *)

let highlight_dumb ppf lb loc =
  (* Char 0 is at offset -lb.lex_abs_pos in lb.lex_buffer. *)
  let pos0 = -lb.lex_abs_pos in
  (* Do nothing if the buffer does not contain the whole phrase. *)
  if pos0 < 0 then raise Exit;
  let end_pos = lb.lex_buffer_len - pos0 - 1 in
  (* Determine line numbers for the start and end points *)
  let line_start = ref 0 and line_end = ref 0 in
  for pos = 0 to end_pos do
    if Bytes.get lb.lex_buffer (pos + pos0) = '\n' then begin
      if loc.loc_start.pos_cnum > pos then incr line_start;
      if loc.loc_end.pos_cnum   > pos then incr line_end;
    end
  done;
  (* Print character location (useful for Emacs) *)
  Format.fprintf ppf "Characters %i-%i:@."
                 loc.loc_start.pos_cnum loc.loc_end.pos_cnum;
  (* Print the input, underlining the location *)
  Format.pp_print_string ppf "  ";
  let line = ref 0 in
  let pos_at_bol = ref 0 in
  for pos = 0 to end_pos do
    match Bytes.get lb.lex_buffer (pos + pos0) with
    | '\n' ->
      if !line = !line_start && !line = !line_end then begin
        (* loc is on one line: underline location *)
        Format.fprintf ppf "@.  ";
        for _i = !pos_at_bol to loc.loc_start.pos_cnum - 1 do
          Format.pp_print_char ppf ' '
        done;
        for _i = loc.loc_start.pos_cnum to loc.loc_end.pos_cnum - 1 do
          Format.pp_print_char ppf '^'
        done
      end;
      if !line >= !line_start && !line <= !line_end then begin
        Format.fprintf ppf "@.";
        if pos < loc.loc_end.pos_cnum then Format.pp_print_string ppf "  "
      end;
      incr line;
      pos_at_bol := pos + 1
    | '\r' -> () (* discard *)
    | c ->
      if !line = !line_start && !line = !line_end then
        (* loc is on one line: print whole line *)
        Format.pp_print_char ppf c
      else if !line = !line_start then
        (* first line of multiline loc:
           print a dot for each char before loc_start *)
        if pos < loc.loc_start.pos_cnum then
          Format.pp_print_char ppf '.'
        else
          Format.pp_print_char ppf c
      else if !line = !line_end then
        (* last line of multiline loc: print a dot for each char
           after loc_end, even whitespaces *)
        if pos < loc.loc_end.pos_cnum then
          Format.pp_print_char ppf c
        else
          Format.pp_print_char ppf '.'
      else if !line > !line_start && !line < !line_end then
        (* intermediate line of multiline loc: print whole line *)
        Format.pp_print_char ppf c
  done

(* Highlight the location using one of the supported modes. *)

let rec highlight_locations ppf locs =
  match !status with
    Terminfo.Uninitialised ->
      status := Terminfo.setup stdout; highlight_locations ppf locs
  | Terminfo.Bad_term ->
      begin match !input_lexbuf with
        None -> false
      | Some lb ->
          let norepeat =
            try Sys.getenv "TERM" = "norepeat" with Not_found -> false in
          if norepeat then false else
            let loc1 = List.hd locs in
            try highlight_dumb ppf lb loc1; true
            with Exit -> false
      end
  | Terminfo.Good_term num_lines ->
      begin match !input_lexbuf with
        None -> false
      | Some lb ->
          try highlight_terminfo ppf num_lines lb locs; true
          with Exit -> false
      end

(* Print the location in some way or another *)

open Format

let absolute_path s = (* This function could go into Filename *)
  let open Filename in
  let s = if is_relative s then concat (Sys.getcwd ()) s else s in
  (* Now simplify . and .. components *)
  let rec aux s =
    let base = basename s in
    let dir = dirname s in
    if dir = s then dir
    else if base = current_dir_name then aux dir
    else if base = parent_dir_name then dirname (aux dir)
    else concat (aux dir) base
  in
  aux s

let show_filename file =
  if !absname then absolute_path file else file

let print_filename ppf file =
  Format.fprintf ppf "%s" (show_filename file)

let reset () =
  num_loc_lines := 0

let (msg_file, msg_line, msg_chars, msg_to, msg_colon) =
  ("File \"", "\", line ", ", characters ", "-", ":")

(* return file, line, char from the given position *)
let get_pos_info pos =
  (pos.pos_fname, pos.pos_lnum, pos.pos_cnum - pos.pos_bol)
;;

let setup_colors () =
  Misc.Color.setup !Clflags.color

let print_loc ppf loc =
  setup_colors ();
  let (file, line, startchar) = get_pos_info loc.loc_start in
 
  let startchar = 
    if Clflags.bs_vscode then startchar + 1 else startchar in 
    
  let endchar = loc.loc_end.pos_cnum - loc.loc_start.pos_cnum + startchar in
  if file = "//toplevel//" then begin
    if highlight_locations ppf [loc] then () else
      fprintf ppf "Characters %i-%i"
              loc.loc_start.pos_cnum loc.loc_end.pos_cnum
  end else begin
    fprintf ppf "%s@{<loc>%a%s%i" msg_file print_filename file msg_line line;
    if startchar >= 0 then
      fprintf ppf "%s%i%s%i" msg_chars startchar msg_to endchar;
    fprintf ppf "@}"
  end
;;

let print ppf loc =
  setup_colors ();
  if loc.loc_start.pos_fname = "//toplevel//"
  && highlight_locations ppf [loc] then ()
  else fprintf ppf "@{<loc>%a@}%s@." print_loc loc msg_colon
;;

let error_prefix = "Error"
let warning_prefix = "Warning"

let print_error_prefix ppf () =
  setup_colors ();
  fprintf ppf "@{<error>%s@}:" error_prefix;
  ()
;;

let print_error ppf loc =
  print ppf loc;
  print_error_prefix ppf ()
;;

let print_error_cur_file ppf () = print_error ppf (in_file !input_name);;

let default_warning_printer loc ppf w =
  if Warnings.is_active w then begin
    setup_colors ();
    print ppf loc;
    fprintf ppf "@{<warning>%s@} %a@." warning_prefix Warnings.print w
  end
;;

let warning_printer = ref default_warning_printer ;;

let print_warning loc ppf w =
  print_updating_num_loc_lines ppf (!warning_printer loc) w
;;

let formatter_for_warnings = ref err_formatter;;
let prerr_warning loc w = print_warning loc !formatter_for_warnings w;;

let echo_eof () =
  print_newline ();
  incr num_loc_lines

type 'a loc = {
  txt : 'a;
  loc : t;
}

let mkloc txt loc = { txt ; loc }
let mknoloc txt = mkloc txt none


type error =
  {
    loc: t;
    msg: string;
    sub: error list;
    if_highlight: string; (* alternative message if locations are highlighted *)
  }

let pp_ksprintf ?before k fmt =
  let buf = Buffer.create 64 in
  let ppf = Format.formatter_of_buffer buf in
  Misc.Color.set_color_tag_handling ppf;
  begin match before with
    | None -> ()
    | Some f -> f ppf
  end;
  kfprintf
    (fun _ ->
      pp_print_flush ppf ();
      let msg = Buffer.contents buf in
      k msg)
    ppf fmt

(* Shift the formatter's offset by the length of the error prefix, which
   is always added by the compiler after the message has been formatted *)
let print_phanton_error_prefix ppf =
  Format.pp_print_as ppf (String.length error_prefix + 2 (* ": " *)) ""

let errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") fmt =
  pp_ksprintf
    ~before:print_phanton_error_prefix
    (fun msg -> {loc; msg; sub; if_highlight})
    fmt

let error ?(loc = none) ?(sub = []) ?(if_highlight = "") msg =
  {loc; msg; sub; if_highlight}

let error_of_exn : (exn -> error option) list ref = ref []

let register_error_of_exn f = error_of_exn := f :: !error_of_exn

let error_of_exn exn =
  let rec loop = function
    | [] -> None
    | f :: rest ->
        match f exn with
        | Some _ as r -> r
        | None -> loop rest
  in
  loop !error_of_exn

let rec default_error_reporter ppf ({loc; msg; sub; if_highlight} as err) =
  let highlighted =
    if if_highlight <> "" then
      let rec collect_locs locs {loc; sub; if_highlight; _} =
        List.fold_left collect_locs (loc :: locs) sub
      in
      let locs = collect_locs [] err in
      highlight_locations ppf locs
    else
      false
  in
  if highlighted then
    Format.pp_print_string ppf if_highlight
  else begin
    fprintf ppf "%a%a %s" print loc print_error_prefix () msg;
    List.iter (Format.fprintf ppf "@\n@[<2>%a@]" default_error_reporter) sub
  end

let error_reporter = ref default_error_reporter

let report_error ppf err =
  print_updating_num_loc_lines ppf !error_reporter err
;;

let error_of_printer loc print x =
  errorf ~loc "%a@?" print x

let error_of_printer_file print x =
  error_of_printer (in_file !input_name) print x

let () =
  register_error_of_exn
    (function
      | Sys_error msg ->
          Some (errorf ~loc:(in_file !input_name)
                "I/O error: %s" msg)
      | Warnings.Errors n ->
          Some
            (errorf ~loc:(in_file !input_name)
             "Some fatal warnings were triggered (%d occurrences)" n)
      | _ ->
          None
    )


let rec report_exception_rec n ppf exn =
  try match error_of_exn exn with
  | Some err ->
      fprintf ppf "@[%a@]@." report_error err
  | None -> raise exn
  with exn when n > 0 ->
    report_exception_rec (n-1) ppf exn

let report_exception ppf exn = report_exception_rec 5 ppf exn


exception Error of error

let () =
  register_error_of_exn
    (function
      | Error e -> Some e
      | _ -> None
    )

let raise_errorf ?(loc = none) ?(sub = []) ?(if_highlight = "") =
  pp_ksprintf
    ~before:print_phanton_error_prefix
    (fun msg -> raise (Error ({loc; msg; sub; if_highlight})))

end
(** Interface as module  *)
module Asttypes
= struct
#1 "asttypes.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Auxiliary a.s.t. types used by parsetree and typedtree. *)

type constant =
    Const_int of int
  | Const_char of char
  | Const_string of string * string option
  | Const_float of string
  | Const_int32 of int32
  | Const_int64 of int64
  | Const_nativeint of nativeint

type rec_flag = Nonrecursive | Recursive

type direction_flag = Upto | Downto

type private_flag = Private | Public

type mutable_flag = Immutable | Mutable

type virtual_flag = Virtual | Concrete

type override_flag = Override | Fresh

type closed_flag = Closed | Open

type label = string

type 'a loc = 'a Location.loc = {
  txt : 'a;
  loc : Location.t;
}


type variance =
  | Covariant
  | Contravariant
  | Invariant

end
module Longident : sig 
#1 "longident.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Long identifiers, used in parsetree. *)

type t =
    Lident of string
  | Ldot of t * string
  | Lapply of t * t

val flatten: t -> string list
val last: t -> string
val parse: string -> t

end = struct
#1 "longident.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

type t =
    Lident of string
  | Ldot of t * string
  | Lapply of t * t

let rec flat accu = function
    Lident s -> s :: accu
  | Ldot(lid, s) -> flat (s :: accu) lid
  | Lapply(_, _) -> Misc.fatal_error "Longident.flat"

let flatten lid = flat [] lid

let last = function
    Lident s -> s
  | Ldot(_, s) -> s
  | Lapply(_, _) -> Misc.fatal_error "Longident.last"

let rec split_at_dots s pos =
  try
    let dot = String.index_from s pos '.' in
    String.sub s pos (dot - pos) :: split_at_dots s (dot + 1)
  with Not_found ->
    [String.sub s pos (String.length s - pos)]

let parse s =
  match split_at_dots s 0 with
    [] -> Lident ""  (* should not happen, but don't put assert false
                        so as not to crash the toplevel (see Genprintval) *)
  | hd :: tl -> List.fold_left (fun p s -> Ldot(p, s)) (Lident hd) tl

end
(** Interface as module  *)
module Parsetree
= struct
#1 "parsetree.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** Abstract syntax tree produced by parsing *)

open Asttypes

(** {2 Extension points} *)

type attribute = string loc * payload
       (* [@id ARG]
          [@@id ARG]

          Metadata containers passed around within the AST.
          The compiler ignores unknown attributes.
       *)

and extension = string loc * payload
      (* [%id ARG]
         [%%id ARG]

         Sub-language placeholder -- rejected by the typechecker.
      *)

and attributes = attribute list

and payload =
  | PStr of structure
  | PTyp of core_type  (* : T *)
  | PPat of pattern * expression option  (* ? P  or  ? P when E *)

(** {2 Core language} *)

(* Type expressions *)

and core_type =
    {
     ptyp_desc: core_type_desc;
     ptyp_loc: Location.t;
     ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and core_type_desc =
  | Ptyp_any
        (*  _ *)
  | Ptyp_var of string
        (* 'a *)
  | Ptyp_arrow of label * core_type * core_type
        (* T1 -> T2       (label = "")
           ~l:T1 -> T2    (label = "l")
           ?l:T1 -> T2    (label = "?l")
         *)
  | Ptyp_tuple of core_type list
        (* T1 * ... * Tn

           Invariant: n >= 2
        *)
  | Ptyp_constr of Longident.t loc * core_type list
        (* tconstr
           T tconstr
           (T1, ..., Tn) tconstr
         *)
  | Ptyp_object of (string * attributes * core_type) list * closed_flag
        (* < l1:T1; ...; ln:Tn >     (flag = Closed)
           < l1:T1; ...; ln:Tn; .. > (flag = Open)
         *)
  | Ptyp_class of Longident.t loc * core_type list
        (* #tconstr
           T #tconstr
           (T1, ..., Tn) #tconstr
         *)
  | Ptyp_alias of core_type * string
        (* T as 'a *)
  | Ptyp_variant of row_field list * closed_flag * label list option
        (* [ `A|`B ]         (flag = Closed; labels = None)
           [> `A|`B ]        (flag = Open;   labels = None)
           [< `A|`B ]        (flag = Closed; labels = Some [])
           [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
         *)
  | Ptyp_poly of string list * core_type
        (* 'a1 ... 'an. T

           Can only appear in the following context:

           - As the core_type of a Ppat_constraint node corresponding
             to a constraint on a let-binding: let x : 'a1 ... 'an. T
             = e ...

           - Under Cfk_virtual for methods (not values).

           - As the core_type of a Pctf_method node.

           - As the core_type of a Pexp_poly node.

           - As the pld_type field of a label_declaration.

           - As a core_type of a Ptyp_object node.
         *)

  | Ptyp_package of package_type
        (* (module S) *)
  | Ptyp_extension of extension
        (* [%id] *)

and package_type = Longident.t loc * (Longident.t loc * core_type) list
      (*
        (module S)
        (module S with type t1 = T1 and ... and tn = Tn)
       *)

and row_field =
  | Rtag of label * attributes * bool * core_type list
        (* [`A]                   ( true,  [] )
           [`A of T]              ( false, [T] )
           [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
           [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

          - The 2nd field is true if the tag contains a
            constant (empty) constructor.
          - '&' occurs when several types are used for the same constructor
            (see 4.2 in the manual)

          - TODO: switch to a record representation, and keep location
        *)
  | Rinherit of core_type
        (* [ T ] *)

(* Patterns *)

and pattern =
    {
     ppat_desc: pattern_desc;
     ppat_loc: Location.t;
     ppat_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and pattern_desc =
  | Ppat_any
        (* _ *)
  | Ppat_var of string loc
        (* x *)
  | Ppat_alias of pattern * string loc
        (* P as 'a *)
  | Ppat_constant of constant
        (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
  | Ppat_interval of constant * constant
        (* 'a'..'z'

           Other forms of interval are recognized by the parser
           but rejected by the type-checker. *)
  | Ppat_tuple of pattern list
        (* (P1, ..., Pn)

           Invariant: n >= 2
        *)
  | Ppat_construct of Longident.t loc * pattern option
        (* C                None
           C P              Some P
           C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
         *)
  | Ppat_variant of label * pattern option
        (* `A             (None)
           `A P           (Some P)
         *)
  | Ppat_record of (Longident.t loc * pattern) list * closed_flag
        (* { l1=P1; ...; ln=Pn }     (flag = Closed)
           { l1=P1; ...; ln=Pn; _}   (flag = Open)

           Invariant: n > 0
         *)
  | Ppat_array of pattern list
        (* [| P1; ...; Pn |] *)
  | Ppat_or of pattern * pattern
        (* P1 | P2 *)
  | Ppat_constraint of pattern * core_type
        (* (P : T) *)
  | Ppat_type of Longident.t loc
        (* #tconst *)
  | Ppat_lazy of pattern
        (* lazy P *)
  | Ppat_unpack of string loc
        (* (module P)
           Note: (module P : S) is represented as
           Ppat_constraint(Ppat_unpack, Ptyp_package)
         *)
  | Ppat_exception of pattern
        (* exception P *)
  | Ppat_extension of extension
        (* [%id] *)

(* Value expressions *)

and expression =
    {
     pexp_desc: expression_desc;
     pexp_loc: Location.t;
     pexp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and expression_desc =
  | Pexp_ident of Longident.t loc
        (* x
           M.x
         *)
  | Pexp_constant of constant
        (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
  | Pexp_let of rec_flag * value_binding list * expression
        (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
           let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
         *)
  | Pexp_function of case list
        (* function P1 -> E1 | ... | Pn -> En *)
  | Pexp_fun of label * expression option * pattern * expression
        (* fun P -> E1                          (lab = "", None)
           fun ~l:P -> E1                       (lab = "l", None)
           fun ?l:P -> E1                       (lab = "?l", None)
           fun ?l:(P = E0) -> E1                (lab = "?l", Some E0)

           Notes:
           - If E0 is provided, lab must start with '?'.
           - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
           - "let f P = E" is represented using Pexp_fun.
         *)
  | Pexp_apply of expression * (label * expression) list
        (* E0 ~l1:E1 ... ~ln:En
           li can be empty (non labeled argument) or start with '?'
           (optional argument).

           Invariant: n > 0
         *)
  | Pexp_match of expression * case list
        (* match E0 with P1 -> E1 | ... | Pn -> En *)
  | Pexp_try of expression * case list
        (* try E0 with P1 -> E1 | ... | Pn -> En *)
  | Pexp_tuple of expression list
        (* (E1, ..., En)

           Invariant: n >= 2
        *)
  | Pexp_construct of Longident.t loc * expression option
        (* C                None
           C E              Some E
           C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
        *)
  | Pexp_variant of label * expression option
        (* `A             (None)
           `A E           (Some E)
         *)
  | Pexp_record of (Longident.t loc * expression) list * expression option
        (* { l1=P1; ...; ln=Pn }     (None)
           { E0 with l1=P1; ...; ln=Pn }   (Some E0)

           Invariant: n > 0
         *)
  | Pexp_field of expression * Longident.t loc
        (* E.l *)
  | Pexp_setfield of expression * Longident.t loc * expression
        (* E1.l <- E2 *)
  | Pexp_array of expression list
        (* [| E1; ...; En |] *)
  | Pexp_ifthenelse of expression * expression * expression option
        (* if E1 then E2 else E3 *)
  | Pexp_sequence of expression * expression
        (* E1; E2 *)
  | Pexp_while of expression * expression
        (* while E1 do E2 done *)
  | Pexp_for of
      pattern *  expression * expression * direction_flag * expression
        (* for i = E1 to E2 do E3 done      (flag = Upto)
           for i = E1 downto E2 do E3 done  (flag = Downto)
         *)
  | Pexp_constraint of expression * core_type
        (* (E : T) *)
  | Pexp_coerce of expression * core_type option * core_type
        (* (E :> T)        (None, T)
           (E : T0 :> T)   (Some T0, T)
         *)
  | Pexp_send of expression * string
        (*  E # m *)
  | Pexp_new of Longident.t loc
        (* new M.c *)
  | Pexp_setinstvar of string loc * expression
        (* x <- 2 *)
  | Pexp_override of (string loc * expression) list
        (* {< x1 = E1; ...; Xn = En >} *)
  | Pexp_letmodule of string loc * module_expr * expression
        (* let module M = ME in E *)
  | Pexp_assert of expression
        (* assert E
           Note: "assert false" is treated in a special way by the
           type-checker. *)
  | Pexp_lazy of expression
        (* lazy E *)
  | Pexp_poly of expression * core_type option
        (* Used for method bodies.

           Can only be used as the expression under Cfk_concrete
           for methods (not values). *)
  | Pexp_object of class_structure
        (* object ... end *)
  | Pexp_newtype of string * expression
        (* fun (type t) -> E *)
  | Pexp_pack of module_expr
        (* (module ME)

           (module ME : S) is represented as
           Pexp_constraint(Pexp_pack, Ptyp_package S) *)
  | Pexp_open of override_flag * Longident.t loc * expression
        (* let open M in E
           let! open M in E
        *)
  | Pexp_extension of extension
        (* [%id] *)

and case =   (* (P -> E) or (P when E0 -> E) *)
    {
     pc_lhs: pattern;
     pc_guard: expression option;
     pc_rhs: expression;
    }

(* Value descriptions *)

and value_description =
    {
     pval_name: string loc;
     pval_type: core_type;
     pval_prim: string list;
     pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
     pval_loc: Location.t;
    }

(*
  val x: T                            (prim = [])
  external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])

  Note: when used under Pstr_primitive, prim cannot be empty
*)

(* Type declarations *)

and type_declaration =
    {
     ptype_name: string loc;
     ptype_params: (core_type * variance) list;
           (* ('a1,...'an) t; None represents  _*)
     ptype_cstrs: (core_type * core_type * Location.t) list;
           (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
     ptype_kind: type_kind;
     ptype_private: private_flag;   (* = private ... *)
     ptype_manifest: core_type option;  (* = T *)
     ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
     ptype_loc: Location.t;
    }

(*
  type t                     (abstract, no manifest)
  type t = T0                (abstract, manifest=T0)
  type t = C of T | ...      (variant,  no manifest)
  type t = T0 = C of T | ... (variant,  manifest=T0)
  type t = {l: T; ...}       (record,   no manifest)
  type t = T0 = {l : T; ...} (record,   manifest=T0)
  type t = ..                (open,     no manifest)
*)

and type_kind =
  | Ptype_abstract
  | Ptype_variant of constructor_declaration list
        (* Invariant: non-empty list *)
  | Ptype_record of label_declaration list
        (* Invariant: non-empty list *)
  | Ptype_open

and label_declaration =
    {
     pld_name: string loc;
     pld_mutable: mutable_flag;
     pld_type: core_type;
     pld_loc: Location.t;
     pld_attributes: attributes; (* l [@id1] [@id2] : T *)
    }

(*  { ...; l: T; ... }            (mutable=Immutable)
    { ...; mutable l: T; ... }    (mutable=Mutable)

    Note: T can be a Ptyp_poly.
*)

and constructor_declaration =
    {
     pcd_name: string loc;
     pcd_args: core_type list;
     pcd_res: core_type option;
     pcd_loc: Location.t;
     pcd_attributes: attributes; (* C [@id1] [@id2] of ... *)
    }
(*
  | C of T1 * ... * Tn     (res = None)
  | C: T0                  (args = [], res = Some T0)
  | C: T1 * ... * Tn -> T0 (res = Some T0)
*)

and type_extension =
    {
     ptyext_path: Longident.t loc;
     ptyext_params: (core_type * variance) list;
     ptyext_constructors: extension_constructor list;
     ptyext_private: private_flag;
     ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
    }
(*
  type t += ...
*)

and extension_constructor =
    {
     pext_name: string loc;
     pext_kind : extension_constructor_kind;
     pext_loc : Location.t;
     pext_attributes: attributes; (* C [@id1] [@id2] of ... *)
    }

and extension_constructor_kind =
    Pext_decl of core_type list * core_type option
      (*
         | C of T1 * ... * Tn     ([T1; ...; Tn], None)
         | C: T0                  ([], Some T0)
         | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
       *)
  | Pext_rebind of Longident.t loc
      (*
         | C = D
       *)

(** {2 Class language} *)

(* Type expressions for the class language *)

and class_type =
    {
     pcty_desc: class_type_desc;
     pcty_loc: Location.t;
     pcty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and class_type_desc =
  | Pcty_constr of Longident.t loc * core_type list
        (* c
           ['a1, ..., 'an] c *)
  | Pcty_signature of class_signature
        (* object ... end *)
  | Pcty_arrow of label * core_type * class_type
        (* T -> CT       (label = "")
           ~l:T -> CT    (label = "l")
           ?l:T -> CT    (label = "?l")
         *)
  | Pcty_extension of extension
        (* [%id] *)

and class_signature =
    {
     pcsig_self: core_type;
     pcsig_fields: class_type_field list;
    }
(* object('selfpat) ... end
   object ... end             (self = Ptyp_any)
 *)

and class_type_field =
    {
     pctf_desc: class_type_field_desc;
     pctf_loc: Location.t;
     pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

and class_type_field_desc =
  | Pctf_inherit of class_type
        (* inherit CT *)
  | Pctf_val of (string * mutable_flag * virtual_flag * core_type)
        (* val x: T *)
  | Pctf_method  of (string * private_flag * virtual_flag * core_type)
        (* method x: T

           Note: T can be a Ptyp_poly.
         *)
  | Pctf_constraint  of (core_type * core_type)
        (* constraint T1 = T2 *)
  | Pctf_attribute of attribute
        (* [@@@id] *)
  | Pctf_extension of extension
        (* [%%id] *)

and 'a class_infos =
    {
     pci_virt: virtual_flag;
     pci_params: (core_type * variance) list;
     pci_name: string loc;
     pci_expr: 'a;
     pci_loc: Location.t;
     pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
    }
(* class c = ...
   class ['a1,...,'an] c = ...
   class virtual c = ...

   Also used for "class type" declaration.
*)

and class_description = class_type class_infos

and class_type_declaration = class_type class_infos

(* Value expressions for the class language *)

and class_expr =
    {
     pcl_desc: class_expr_desc;
     pcl_loc: Location.t;
     pcl_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and class_expr_desc =
  | Pcl_constr of Longident.t loc * core_type list
        (* c
           ['a1, ..., 'an] c *)
  | Pcl_structure of class_structure
        (* object ... end *)
  | Pcl_fun of label * expression option * pattern * class_expr
        (* fun P -> CE                          (lab = "", None)
           fun ~l:P -> CE                       (lab = "l", None)
           fun ?l:P -> CE                       (lab = "?l", None)
           fun ?l:(P = E0) -> CE                (lab = "?l", Some E0)
         *)
  | Pcl_apply of class_expr * (label * expression) list
        (* CE ~l1:E1 ... ~ln:En
           li can be empty (non labeled argument) or start with '?'
           (optional argument).

           Invariant: n > 0
         *)
  | Pcl_let of rec_flag * value_binding list * class_expr
        (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
           let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
         *)
  | Pcl_constraint of class_expr * class_type
        (* (CE : CT) *)
  | Pcl_extension of extension
        (* [%id] *)

and class_structure =
    {
     pcstr_self: pattern;
     pcstr_fields: class_field list;
    }
(* object(selfpat) ... end
   object ... end           (self = Ppat_any)
 *)

and class_field =
    {
     pcf_desc: class_field_desc;
     pcf_loc: Location.t;
     pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

and class_field_desc =
  | Pcf_inherit of override_flag * class_expr * string option
        (* inherit CE
           inherit CE as x
           inherit! CE
           inherit! CE as x
         *)
  | Pcf_val of (string loc * mutable_flag * class_field_kind)
        (* val x = E
           val virtual x: T
         *)
  | Pcf_method of (string loc * private_flag * class_field_kind)
        (* method x = E            (E can be a Pexp_poly)
           method virtual x: T     (T can be a Ptyp_poly)
         *)
  | Pcf_constraint of (core_type * core_type)
        (* constraint T1 = T2 *)
  | Pcf_initializer of expression
        (* initializer E *)
  | Pcf_attribute of attribute
        (* [@@@id] *)
  | Pcf_extension of extension
        (* [%%id] *)

and class_field_kind =
  | Cfk_virtual of core_type
  | Cfk_concrete of override_flag * expression

and class_declaration = class_expr class_infos

(** {2 Module language} *)

(* Type expressions for the module language *)

and module_type =
    {
     pmty_desc: module_type_desc;
     pmty_loc: Location.t;
     pmty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and module_type_desc =
  | Pmty_ident of Longident.t loc
        (* S *)
  | Pmty_signature of signature
        (* sig ... end *)
  | Pmty_functor of string loc * module_type option * module_type
        (* functor(X : MT1) -> MT2 *)
  | Pmty_with of module_type * with_constraint list
        (* MT with ... *)
  | Pmty_typeof of module_expr
        (* module type of ME *)
  | Pmty_extension of extension
        (* [%id] *)
  | Pmty_alias of Longident.t loc
        (* (module M) *)

and signature = signature_item list

and signature_item =
    {
     psig_desc: signature_item_desc;
     psig_loc: Location.t;
    }

and signature_item_desc =
  | Psig_value of value_description
        (*
          val x: T
          external x: T = "s1" ... "sn"
         *)
  | Psig_type of type_declaration list
        (* type t1 = ... and ... and tn = ... *)
  | Psig_typext of type_extension
        (* type t1 += ... *)
  | Psig_exception of extension_constructor
        (* exception C of T *)
  | Psig_module of module_declaration
        (* module X : MT *)
  | Psig_recmodule of module_declaration list
        (* module rec X1 : MT1 and ... and Xn : MTn *)
  | Psig_modtype of module_type_declaration
        (* module type S = MT
           module type S *)
  | Psig_open of open_description
        (* open X *)
  | Psig_include of include_description
        (* include MT *)
  | Psig_class of class_description list
        (* class c1 : ... and ... and cn : ... *)
  | Psig_class_type of class_type_declaration list
        (* class type ct1 = ... and ... and ctn = ... *)
  | Psig_attribute of attribute
        (* [@@@id] *)
  | Psig_extension of extension * attributes
        (* [%%id] *)

and module_declaration =
    {
     pmd_name: string loc;
     pmd_type: module_type;
     pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
     pmd_loc: Location.t;
    }
(* S : MT *)

and module_type_declaration =
    {
     pmtd_name: string loc;
     pmtd_type: module_type option;
     pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
     pmtd_loc: Location.t;
    }
(* S = MT
   S       (abstract module type declaration, pmtd_type = None)
*)

and open_description =
    {
     popen_lid: Longident.t loc;
     popen_override: override_flag;
     popen_loc: Location.t;
     popen_attributes: attributes;
    }
(* open! X - popen_override = Override (silences the 'used identifier
                              shadowing' warning)
   open  X - popen_override = Fresh
 *)

and 'a include_infos =
    {
     pincl_mod: 'a;
     pincl_loc: Location.t;
     pincl_attributes: attributes;
    }

and include_description = module_type include_infos
(* include MT *)

and include_declaration = module_expr include_infos
(* include ME *)

and with_constraint =
  | Pwith_type of Longident.t loc * type_declaration
        (* with type X.t = ...

           Note: the last component of the longident must match
           the name of the type_declaration. *)
  | Pwith_module of Longident.t loc * Longident.t loc
        (* with module X.Y = Z *)
  | Pwith_typesubst of type_declaration
        (* with type t := ... *)
  | Pwith_modsubst of string loc * Longident.t loc
        (* with module X := Z *)

(* Value expressions for the module language *)

and module_expr =
    {
     pmod_desc: module_expr_desc;
     pmod_loc: Location.t;
     pmod_attributes: attributes; (* ... [@id1] [@id2] *)
    }

and module_expr_desc =
  | Pmod_ident of Longident.t loc
        (* X *)
  | Pmod_structure of structure
        (* struct ... end *)
  | Pmod_functor of string loc * module_type option * module_expr
        (* functor(X : MT1) -> ME *)
  | Pmod_apply of module_expr * module_expr
        (* ME1(ME2) *)
  | Pmod_constraint of module_expr * module_type
        (* (ME : MT) *)
  | Pmod_unpack of expression
        (* (val E) *)
  | Pmod_extension of extension
        (* [%id] *)

and structure = structure_item list

and structure_item =
    {
     pstr_desc: structure_item_desc;
     pstr_loc: Location.t;
    }

and structure_item_desc =
  | Pstr_eval of expression * attributes
        (* E *)
  | Pstr_value of rec_flag * value_binding list
        (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
           let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
         *)
  | Pstr_primitive of value_description
        (* external x: T = "s1" ... "sn" *)
  | Pstr_type of type_declaration list
        (* type t1 = ... and ... and tn = ... *)
  | Pstr_typext of type_extension
        (* type t1 += ... *)
  | Pstr_exception of extension_constructor
        (* exception C of T
           exception C = M.X *)
  | Pstr_module of module_binding
        (* module X = ME *)
  | Pstr_recmodule of module_binding list
        (* module rec X1 = ME1 and ... and Xn = MEn *)
  | Pstr_modtype of module_type_declaration
        (* module type S = MT *)
  | Pstr_open of open_description
        (* open X *)
  | Pstr_class of class_declaration list
        (* class c1 = ... and ... and cn = ... *)
  | Pstr_class_type of class_type_declaration list
        (* class type ct1 = ... and ... and ctn = ... *)
  | Pstr_include of include_declaration
        (* include ME *)
  | Pstr_attribute of attribute
        (* [@@@id] *)
  | Pstr_extension of extension * attributes
        (* [%%id] *)

and value_binding =
  {
    pvb_pat: pattern;
    pvb_expr: expression;
    pvb_attributes: attributes;
    pvb_loc: Location.t;
  }

and module_binding =
    {
     pmb_name: string loc;
     pmb_expr: module_expr;
     pmb_attributes: attributes;
     pmb_loc: Location.t;
    }
(* X = ME *)

(** {2 Toplevel} *)

(* Toplevel phrases *)

type toplevel_phrase =
  | Ptop_def of structure
  | Ptop_dir of string * directive_argument
     (* #use, #load ... *)

and directive_argument =
  | Pdir_none
  | Pdir_string of string
  | Pdir_int of int
  | Pdir_ident of Longident.t
  | Pdir_bool of bool

end
module Docstrings : sig 
#1 "docstrings.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                              Leo White                              *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** (Re)Initialise all docstring state *)
val init : unit -> unit

(** Emit warnings for unattached and ambiguous docstrings *)
val warn_bad_docstrings : unit -> unit

(** {3 Docstrings} *)

(** Documentation comments *)
type docstring

(** Create a docstring *)
val docstring : string -> Location.t -> docstring

(** Get the text of a docstring *)
val docstring_body : docstring -> string

(** Get the location of a docstring *)
val docstring_loc : docstring -> Location.t

(** {3 Set functions}

   These functions are used by the lexer to associate docstrings to
   the locations of tokens. *)

(** Docstrings immediately preceding a token *)
val set_pre_docstrings : Lexing.position -> docstring list -> unit

(** Docstrings immediately following a token *)
val set_post_docstrings : Lexing.position -> docstring list -> unit

(** Docstrings not immediately adjacent to a token *)
val set_floating_docstrings : Lexing.position -> docstring list -> unit

(** Docstrings immediately following the token which precedes this one *)
val set_pre_extra_docstrings : Lexing.position -> docstring list -> unit

(** Docstrings immediately preceding the token which follows this one *)
val set_post_extra_docstrings : Lexing.position -> docstring list -> unit

(** {3 Items}

    The {!docs} type represents documentation attached to an item. *)

type docs =
  { docs_pre: docstring option;
    docs_post: docstring option; }

val empty_docs : docs

val docs_attr : docstring -> Parsetree.attribute

(** Convert item documentation to attributes and add them to an
    attribute list *)
val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

(** Fetch the item documentation for the current symbol. This also
    marks this documentation (for ambiguity warnings). *)
val symbol_docs : unit -> docs
val symbol_docs_lazy : unit -> docs Lazy.t

(** Fetch the item documentation for the symbols between two
    positions. This also marks this documentation (for ambiguity
    warnings). *)
val rhs_docs : int -> int -> docs
val rhs_docs_lazy : int -> int -> docs Lazy.t

(** Mark the item documentation for the current symbol (for ambiguity
    warnings). *)
val mark_symbol_docs : unit -> unit

(** Mark as associated the item documentation for the symbols between
    two positions (for ambiguity warnings) *)
val mark_rhs_docs : int -> int -> unit

(** {3 Fields and constructors}

    The {!info} type represents documentation attached to a field or
    constructor. *)

type info = docstring option

val empty_info : info

val info_attr : docstring -> Parsetree.attribute

(** Convert field info to attributes and add them to an
    attribute list *)
val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

(** Fetch the field info for the current symbol. *)
val symbol_info : unit -> info

(** Fetch the field info following the symbol at a given position. *)
val rhs_info : int -> info

(** {3 Unattached comments}

    The {!text} type represents documentation which is not attached to
    anything. *)

type text = docstring list

val empty_text : text

val text_attr : docstring -> Parsetree.attribute

(** Convert text to attributes and add them to an attribute list *)
val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

(** Fetch the text preceding the current symbol. *)
val symbol_text : unit -> text
val symbol_text_lazy : unit -> text Lazy.t

(** Fetch the text preceding the symbol at the given position. *)
val rhs_text : int -> text
val rhs_text_lazy : int -> text Lazy.t

(** {3 Extra text}

    There may be additional text attached to the delimiters of a block
    (e.g. [struct] and [end]). This is fetched by the following
    functions, which are applied to the contents of the block rather
    than the delimiters. *)

(** Fetch additional text preceding the current symbol *)
val symbol_pre_extra_text : unit -> text

(** Fetch additional text following the current symbol *)
val symbol_post_extra_text : unit -> text

(** Fetch additional text preceding the symbol at the given position *)
val rhs_pre_extra_text : int -> text

(** Fetch additional text following the symbol at the given position *)
val rhs_post_extra_text : int -> text

end = struct
#1 "docstrings.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                              Leo White                              *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Location

(* Docstrings *)

(* A docstring is "attached" if it has been inserted in the AST. This
   is used for generating unexpected docstring warnings. *)
type ds_attached =
  | Unattached   (* Not yet attached anything.*)
  | Info         (* Attached to a field or constructor. *)
  | Docs         (* Attached to an item or as floating text. *)

(* A docstring is "associated" with an item if there are no blank lines between
   them. This is used for generating docstring ambiguity warnings. *)
type ds_associated =
  | Zero             (* Not associated with an item *)
  | One              (* Associated with one item *)
  | Many             (* Associated with multiple items (ambiguity) *)

type docstring =
  { ds_body: string;
    ds_loc: Location.t;
    mutable ds_attached: ds_attached;
    mutable ds_associated: ds_associated; }

(* List of docstrings *)

let docstrings : docstring list ref = ref []

(* Warn for unused and ambiguous docstrings *)

let warn_bad_docstrings () =
  if Warnings.is_active (Warnings.Bad_docstring true) then begin
    List.iter
      (fun ds ->
         match ds.ds_attached with
         | Info -> ()
         | Unattached ->
           prerr_warning ds.ds_loc (Warnings.Bad_docstring true)
         | Docs ->
             match ds.ds_associated with
             | Zero | One -> ()
             | Many ->
               prerr_warning ds.ds_loc (Warnings.Bad_docstring false))
      (List.rev !docstrings)
end

(* Docstring constructors and descturctors *)

let docstring body loc =
  let ds =
    { ds_body = body;
      ds_loc = loc;
      ds_attached = Unattached;
      ds_associated = Zero; }
  in
  docstrings := ds :: !docstrings;
  ds

let docstring_body ds = ds.ds_body

let docstring_loc ds = ds.ds_loc

(* Docstrings attached to items *)

type docs =
  { docs_pre: docstring option;
    docs_post: docstring option; }

let empty_docs = { docs_pre = None; docs_post = None }

let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

let docs_attr ds =
  let open Asttypes in
  let open Parsetree in
  let exp =
    { pexp_desc = Pexp_constant (Const_string(ds.ds_body, None));
      pexp_loc = ds.ds_loc;
      pexp_attributes = []; }
  in
  let item =
    { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
  in
    (doc_loc, PStr [item])

let add_docs_attrs docs attrs =
  let attrs =
    match docs.docs_pre with
    | None -> attrs
    | Some ds -> docs_attr ds :: attrs
  in
  let attrs =
    match docs.docs_post with
    | None -> attrs
    | Some ds -> attrs @ [docs_attr ds]
  in
  attrs

(* Docstrings attached to consturctors or fields *)

type info = docstring option

let empty_info = None

let info_attr = docs_attr

let add_info_attrs info attrs =
  let attrs =
    match info with
    | None -> attrs
    | Some ds -> attrs @ [info_attr ds]
  in
  attrs

(* Docstrings not attached to a specifc item *)

type text = docstring list

let empty_text = []

let text_loc = {txt = "ocaml.text"; loc = Location.none}

let text_attr ds =
  let open Asttypes in
  let open Parsetree in
  let exp =
    { pexp_desc = Pexp_constant (Const_string(ds.ds_body, None));
      pexp_loc = ds.ds_loc;
      pexp_attributes = []; }
  in
  let item =
    { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
  in
    (text_loc, PStr [item])

let add_text_attrs dsl attrs =
  (List.map text_attr dsl) @ attrs

(* Find the first non-info docstring in a list, attach it and return it *)
let get_docstring ~info dsl =
  let rec loop = function
    | [] -> None
    | {ds_attached = Info; _} :: rest -> loop rest
    | ds :: rest ->
        ds.ds_attached <- if info then Info else Docs;
        Some ds
  in
  loop dsl

(* Find all the non-info docstrings in a list, attach them and return them *)
let get_docstrings dsl =
  let rec loop acc = function
    | [] -> List.rev acc
    | {ds_attached = Info; _} :: rest -> loop acc rest
    | ds :: rest ->
        ds.ds_attached <- Docs;
        loop (ds :: acc) rest
  in
    loop [] dsl

(* "Associate" all the docstrings in a list *)
let associate_docstrings dsl =
  List.iter
    (fun ds ->
       match ds.ds_associated with
       | Zero -> ds.ds_associated <- One
       | (One | Many) -> ds.ds_associated <- Many)
    dsl

(* Map from positions to pre docstrings *)

let pre_table : (Lexing.position, docstring list) Hashtbl.t =
  Hashtbl.create 50

let set_pre_docstrings pos dsl =
  if dsl <> [] then Hashtbl.add pre_table pos dsl

let get_pre_docs pos =
  try
    let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
  with Not_found -> None

let mark_pre_docs pos =
  try
    let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl
  with Not_found -> ()

(* Map from positions to post docstrings *)

let post_table : (Lexing.position, docstring list) Hashtbl.t =
  Hashtbl.create 50

let set_post_docstrings pos dsl =
  if dsl <> [] then Hashtbl.add post_table pos dsl

let get_post_docs pos =
  try
    let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
  with Not_found -> None

let mark_post_docs pos =
  try
    let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl
  with Not_found -> ()

let get_info pos =
  try
    let dsl = Hashtbl.find post_table pos in
      get_docstring ~info:true dsl
  with Not_found -> None

(* Map from positions to floating docstrings *)

let floating_table : (Lexing.position, docstring list) Hashtbl.t =
  Hashtbl.create 50

let set_floating_docstrings pos dsl =
  if dsl <> [] then Hashtbl.add floating_table pos dsl

let get_text pos =
  try
    let dsl = Hashtbl.find floating_table pos in
      get_docstrings dsl
  with Not_found -> []

(* Maps from positions to extra docstrings *)

let pre_extra_table : (Lexing.position, docstring list) Hashtbl.t =
  Hashtbl.create 50

let set_pre_extra_docstrings pos dsl =
  if dsl <> [] then Hashtbl.add pre_extra_table pos dsl

let get_pre_extra_text pos =
  try
    let dsl = Hashtbl.find pre_extra_table pos in
      get_docstrings dsl
  with Not_found -> []

let post_extra_table : (Lexing.position, docstring list) Hashtbl.t =
  Hashtbl.create 50

let set_post_extra_docstrings pos dsl =
  if dsl <> [] then Hashtbl.add post_extra_table pos dsl

let get_post_extra_text pos =
  try
    let dsl = Hashtbl.find post_extra_table pos in
      get_docstrings dsl
  with Not_found -> []

(* Docstrings from parser actions *)

let symbol_docs () =
  { docs_pre = get_pre_docs (Parsing.symbol_start_pos ());
    docs_post = get_post_docs (Parsing.symbol_end_pos ()); }

let symbol_docs_lazy () =
  let p1 = Parsing.symbol_start_pos () in
  let p2 = Parsing.symbol_end_pos () in
    lazy { docs_pre = get_pre_docs p1;
           docs_post = get_post_docs p2; }

let rhs_docs pos1 pos2 =
  { docs_pre = get_pre_docs (Parsing.rhs_start_pos pos1);
    docs_post = get_post_docs (Parsing.rhs_end_pos pos2); }

let rhs_docs_lazy pos1 pos2 =
  let p1 = Parsing.rhs_start_pos pos1 in
  let p2 = Parsing.rhs_end_pos pos2 in
    lazy { docs_pre = get_pre_docs p1;
           docs_post = get_post_docs p2; }

let mark_symbol_docs () =
  mark_pre_docs (Parsing.symbol_start_pos ());
  mark_post_docs (Parsing.symbol_end_pos ())

let mark_rhs_docs pos1 pos2 =
  mark_pre_docs (Parsing.rhs_start_pos pos1);
  mark_post_docs (Parsing.rhs_end_pos pos2)

let symbol_info () =
  get_info (Parsing.symbol_end_pos ())

let rhs_info pos =
  get_info (Parsing.rhs_end_pos pos)

let symbol_text () =
  get_text (Parsing.symbol_start_pos ())

let symbol_text_lazy () =
  let pos = Parsing.symbol_start_pos () in
    lazy (get_text pos)

let rhs_text pos =
  get_text (Parsing.rhs_start_pos pos)

let rhs_text_lazy pos =
  let pos = Parsing.rhs_start_pos pos in
    lazy (get_text pos)

let symbol_pre_extra_text () =
  get_pre_extra_text (Parsing.symbol_start_pos ())

let symbol_post_extra_text () =
  get_post_extra_text (Parsing.symbol_end_pos ())

let rhs_pre_extra_text pos =
  get_pre_extra_text (Parsing.rhs_start_pos pos)

let rhs_post_extra_text pos =
  get_post_extra_text (Parsing.rhs_end_pos pos)


(* (Re)Initialise all comment state *)

let init () =
  docstrings := [];
  Hashtbl.reset pre_table;
  Hashtbl.reset post_table;
  Hashtbl.reset floating_table;
  Hashtbl.reset pre_extra_table;
  Hashtbl.reset post_extra_table




end
module Ast_helper : sig 
#1 "ast_helper.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2012 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** Helpers to produce Parsetree fragments *)

open Parsetree
open Asttypes
open Docstrings

type lid = Longident.t loc
type str = string loc
type loc = Location.t
type attrs = attribute list

(** {2 Default locations} *)

val default_loc: loc ref
    (** Default value for all optional location arguments. *)

val with_default_loc: loc -> (unit -> 'a) -> 'a
    (** Set the [default_loc] within the scope of the execution
        of the provided function. *)

(** {2 Core language} *)

(** Type expressions *)
module Typ :
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
    val attr: core_type -> attribute -> core_type

    val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
    val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
    val arrow: ?loc:loc -> ?attrs:attrs -> label -> core_type -> core_type
               -> core_type
    val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val object_: ?loc:loc -> ?attrs:attrs ->
                  (string * attributes * core_type) list -> closed_flag ->
                  core_type
    val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
    val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                 -> label list option -> core_type
    val poly: ?loc:loc -> ?attrs:attrs -> string list -> core_type -> core_type
    val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                 -> core_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

    val force_poly: core_type -> core_type
  end

(** Patterns *)
module Pat:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
    val attr:pattern -> attribute -> pattern

    val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
    val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
    val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
    val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
    val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
    val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                -> pattern
    val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
    val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
    val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
    val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
  end

(** Expressions *)
module Exp:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
    val attr: expression -> attribute -> expression

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
              -> expression -> expression
    val fun_: ?loc:loc -> ?attrs:attrs -> label -> expression option -> pattern
              -> expression -> expression
    val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
    val apply: ?loc:loc -> ?attrs:attrs -> expression
               -> (label * expression) list -> expression
    val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                -> expression
    val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
    val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                   -> expression
    val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                 -> expression
    val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                -> expression option -> expression
    val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
    val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                  -> expression
    val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression option -> expression
    val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
    val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                -> expression
    val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
              -> direction_flag -> expression -> expression
    val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                -> core_type -> expression
    val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                     -> expression
    val send: ?loc:loc -> ?attrs:attrs -> expression -> string -> expression
    val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                  -> expression
    val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                   -> expression
    val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option -> expression
    val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
    val newtype: ?loc:loc -> ?attrs:attrs -> string -> expression -> expression
    val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
    val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression -> expression
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression

    val case: pattern -> ?guard:expression -> expression -> case
  end

(** Value declarations *)
module Val:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?prim:string list -> str -> core_type -> value_description
  end

(** Type declarations *)
module Type:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?params:(core_type * variance) list -> ?cstrs:(core_type * core_type * loc) list ->
      ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
      type_declaration

    val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?args:core_type list -> ?res:core_type -> str -> constructor_declaration
    val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?mut:mutable_flag -> str -> core_type -> label_declaration
  end

(** Type extensions *)
module Te:
  sig
    val mk: ?attrs:attrs -> ?docs:docs ->
      ?params:(core_type * variance) list -> ?priv:private_flag ->
      lid -> extension_constructor list -> type_extension

    val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> extension_constructor_kind -> extension_constructor

    val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      ?args:core_type list -> ?res:core_type -> str -> extension_constructor
    val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> lid -> extension_constructor
  end

(** {2 Module language} *)

(** Module type expressions *)
module Mty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
    val attr: module_type -> attribute -> module_type

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
    val functor_: ?loc:loc -> ?attrs:attrs ->
      str -> module_type option -> module_type -> module_type
    val with_: ?loc:loc -> ?attrs:attrs -> module_type -> with_constraint list -> module_type
    val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
  end

(** Module expressions *)
module Mod:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
    val attr: module_expr -> attribute -> module_expr

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
    val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
    val functor_: ?loc:loc -> ?attrs:attrs ->
      str -> module_type option -> module_expr -> module_expr
    val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr -> module_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type -> module_expr
    val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
  end

(** Signature items *)
module Sig:
  sig
    val mk: ?loc:loc -> signature_item_desc -> signature_item

    val value: ?loc:loc -> value_description -> signature_item
    val type_: ?loc:loc -> type_declaration list -> signature_item
    val type_extension: ?loc:loc -> type_extension -> signature_item
    val exception_: ?loc:loc -> extension_constructor -> signature_item
    val module_: ?loc:loc -> module_declaration -> signature_item
    val rec_module: ?loc:loc -> module_declaration list -> signature_item
    val modtype: ?loc:loc -> module_type_declaration -> signature_item
    val open_: ?loc:loc -> open_description -> signature_item
    val include_: ?loc:loc -> include_description -> signature_item
    val class_: ?loc:loc -> class_description list -> signature_item
    val class_type: ?loc:loc -> class_type_declaration list -> signature_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
    val attribute: ?loc:loc -> attribute -> signature_item
    val text: text -> signature_item list
  end

(** Structure items *)
module Str:
  sig
    val mk: ?loc:loc -> structure_item_desc -> structure_item

    val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
    val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
    val primitive: ?loc:loc -> value_description -> structure_item
    val type_: ?loc:loc -> type_declaration list -> structure_item
    val type_extension: ?loc:loc -> type_extension -> structure_item
    val exception_: ?loc:loc -> extension_constructor -> structure_item
    val module_: ?loc:loc -> module_binding -> structure_item
    val rec_module: ?loc:loc -> module_binding list -> structure_item
    val modtype: ?loc:loc -> module_type_declaration -> structure_item
    val open_: ?loc:loc -> open_description -> structure_item
    val class_: ?loc:loc -> class_declaration list -> structure_item
    val class_type: ?loc:loc -> class_type_declaration list -> structure_item
    val include_: ?loc:loc -> include_declaration -> structure_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
    val attribute: ?loc:loc -> attribute -> structure_item
    val text: text -> structure_item list
  end

(** Module declarations *)
module Md:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> module_type -> module_declaration
  end

(** Module type declarations *)
module Mtd:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?typ:module_type -> str -> module_type_declaration
  end

(** Module bindings *)
module Mb:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> module_expr -> module_binding
  end

(* Opens *)
module Opn:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
      ?override:override_flag -> lid -> open_description
  end

(* Includes *)
module Incl:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
  end

(** Value bindings *)

module Vb:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      pattern -> expression -> value_binding
  end


(** {2 Class language} *)

(** Class type expressions *)
module Cty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
    val attr: class_type -> attribute -> class_type

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
    val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
    val arrow: ?loc:loc -> ?attrs:attrs -> label -> core_type -> class_type -> class_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
  end

(** Class type fields *)
module Ctf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      class_type_field_desc -> class_type_field
    val attr: class_type_field -> attribute -> class_type_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
    val val_: ?loc:loc -> ?attrs:attrs -> string -> mutable_flag -> virtual_flag -> core_type -> class_type_field
    val method_: ?loc:loc -> ?attrs:attrs -> string -> private_flag -> virtual_flag -> core_type -> class_type_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type -> class_type_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
    val attribute: ?loc:loc -> attribute -> class_type_field
    val text: text -> class_type_field list
  end

(** Class expressions *)
module Cl:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
    val attr: class_expr -> attribute -> class_expr

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
    val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
    val fun_: ?loc:loc -> ?attrs:attrs -> label -> expression option -> pattern -> class_expr -> class_expr
    val apply: ?loc:loc -> ?attrs:attrs -> class_expr -> (label * expression) list -> class_expr
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list -> class_expr -> class_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type -> class_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
  end

(** Class fields *)
module Cf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc -> class_field
    val attr: class_field -> attribute -> class_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr -> string option -> class_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag -> class_field_kind -> class_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag -> class_field_kind -> class_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type -> class_field
    val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
    val attribute: ?loc:loc -> attribute -> class_field
    val text: text -> class_field list

    val virtual_: core_type -> class_field_kind
    val concrete: override_flag -> expression -> class_field_kind

  end

(** Classes *)
module Ci:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?virt:virtual_flag -> ?params:(core_type * variance) list ->
      str -> 'a -> 'a class_infos
  end

(** Class signatures *)
module Csig:
  sig
    val mk: core_type -> class_type_field list -> class_signature
  end

(** Class structures *)
module Cstr:
  sig
    val mk: pattern -> class_field list -> class_structure
  end

end = struct
#1 "ast_helper.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2012 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** Helpers to produce Parsetree fragments *)

open Asttypes
open Parsetree
open Docstrings

type lid = Longident.t loc
type str = string loc
type loc = Location.t
type attrs = attribute list

let default_loc = ref Location.none

let with_default_loc l f =
  let old = !default_loc in
  default_loc := l;
  try let r = f () in default_loc := old; r
  with exn -> default_loc := old; raise exn

module Typ = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
  let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

  let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
  let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
  let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
  let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
  let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
  let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
  let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
  let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
  let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
  let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
  let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
  let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

  let force_poly t =
    match t.ptyp_desc with
    | Ptyp_poly _ -> t
    | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)
end

module Pat = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
  let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

  let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
  let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
  let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
  let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
  let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
  let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
  let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
  let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
  let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
  let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
  let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
  let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
  let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
  let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
  let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
  let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
  let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
end

module Exp = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
  let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

  let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
  let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
  let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
  let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
  let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
  let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
  let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
  let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
  let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
  let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
  let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
  let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
  let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
  let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
  let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
  let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
  let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
  let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
  let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
  let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
  let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
  let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
  let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
  let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
  let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
  let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
  let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
  let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
  let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
  let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
  let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
  let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
  let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)

  let case lhs ?guard rhs =
    {
     pc_lhs = lhs;
     pc_guard = guard;
     pc_rhs = rhs;
    }
end

module Mty = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
  let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

  let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
  let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
  let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
  let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
  let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
  let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
end

module Mod = struct
let mk ?(loc = !default_loc) ?(attrs = []) d =
  {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
  let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

  let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
  let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
  let functor_ ?loc ?attrs arg arg_ty body =
    mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
  let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
  let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
  let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
end

module Sig = struct
  let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

  let value ?loc a = mk ?loc (Psig_value a)
  let type_ ?loc a = mk ?loc (Psig_type a)
  let type_extension ?loc a = mk ?loc (Psig_typext a)
  let exception_ ?loc a = mk ?loc (Psig_exception a)
  let module_ ?loc a = mk ?loc (Psig_module a)
  let rec_module ?loc a = mk ?loc (Psig_recmodule a)
  let modtype ?loc a = mk ?loc (Psig_modtype a)
  let open_ ?loc a = mk ?loc (Psig_open a)
  let include_ ?loc a = mk ?loc (Psig_include a)
  let class_ ?loc a = mk ?loc (Psig_class a)
  let class_type ?loc a = mk ?loc (Psig_class_type a)
  let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
  let attribute ?loc a = mk ?loc (Psig_attribute a)
  let text txt =
    List.map
      (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
      txt
end

module Str = struct
  let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

  let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
  let value ?loc a b = mk ?loc (Pstr_value (a, b))
  let primitive ?loc a = mk ?loc (Pstr_primitive a)
  let type_ ?loc a = mk ?loc (Pstr_type a)
  let type_extension ?loc a = mk ?loc (Pstr_typext a)
  let exception_ ?loc a = mk ?loc (Pstr_exception a)
  let module_ ?loc a = mk ?loc (Pstr_module a)
  let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
  let modtype ?loc a = mk ?loc (Pstr_modtype a)
  let open_ ?loc a = mk ?loc (Pstr_open a)
  let class_ ?loc a = mk ?loc (Pstr_class a)
  let class_type ?loc a = mk ?loc (Pstr_class_type a)
  let include_ ?loc a = mk ?loc (Pstr_include a)
  let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
  let attribute ?loc a = mk ?loc (Pstr_attribute a)
  let text txt =
    List.map
      (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
      txt
end

module Cl = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {
     pcl_desc = d;
     pcl_loc = loc;
     pcl_attributes = attrs;
    }
  let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

  let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
  let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
  let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
  let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
  let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
  let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
end

module Cty = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {
     pcty_desc = d;
     pcty_loc = loc;
     pcty_attributes = attrs;
    }
  let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

  let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
  let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
  let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
end

module Ctf = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
           ?(docs = empty_docs) d =
    {
     pctf_desc = d;
     pctf_loc = loc;
     pctf_attributes = add_docs_attrs docs attrs;
    }

  let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
  let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
  let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
  let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
  let attribute ?loc a = mk ?loc (Pctf_attribute a)
  let text txt =
    List.map
      (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
      txt

  let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

end

module Cf = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) d =
    {
     pcf_desc = d;
     pcf_loc = loc;
     pcf_attributes = add_docs_attrs docs attrs;
    }

  let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
  let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
  let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
  let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
  let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
  let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
  let attribute ?loc a = mk ?loc (Pcf_attribute a)
  let text txt =
    List.map
      (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
      txt

  let virtual_ ct = Cfk_virtual ct
  let concrete o e = Cfk_concrete (o, e)

  let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

end

module Val = struct
  let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(prim = []) name typ =
    {
     pval_name = name;
     pval_type = typ;
     pval_attributes = add_docs_attrs docs attrs;
     pval_loc = loc;
     pval_prim = prim;
    }
end

module Md = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) name typ =
    {
     pmd_name = name;
     pmd_type = typ;
     pmd_attributes =
       add_text_attrs text (add_docs_attrs docs attrs);
     pmd_loc = loc;
    }
end

module Mtd = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) ?typ name =
    {
     pmtd_name = name;
     pmtd_type = typ;
     pmtd_attributes =
       add_text_attrs text (add_docs_attrs docs attrs);
     pmtd_loc = loc;
    }
end

module Mb = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) name expr =
    {
     pmb_name = name;
     pmb_expr = expr;
     pmb_attributes =
       add_text_attrs text (add_docs_attrs docs attrs);
     pmb_loc = loc;
    }
end

module Opn = struct
  let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(override = Fresh) lid =
    {
     popen_lid = lid;
     popen_override = override;
     popen_loc = loc;
     popen_attributes = add_docs_attrs docs attrs;
    }
end

module Incl = struct
  let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
    {
     pincl_mod = mexpr;
     pincl_loc = loc;
     pincl_attributes = add_docs_attrs docs attrs;
    }

end

module Vb = struct
  let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(text = []) pat expr =
    {
     pvb_pat = pat;
     pvb_expr = expr;
     pvb_attributes =
       add_text_attrs text (add_docs_attrs docs attrs);
     pvb_loc = loc;
    }
end

module Ci = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = [])
        ?(virt = Concrete) ?(params = []) name expr =
    {
     pci_virt = virt;
     pci_params = params;
     pci_name = name;
     pci_expr = expr;
     pci_attributes =
       add_text_attrs text (add_docs_attrs docs attrs);
     pci_loc = loc;
    }
end

module Type = struct
  let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = [])
      ?(params = [])
      ?(cstrs = [])
      ?(kind = Ptype_abstract)
      ?(priv = Public)
      ?manifest
      name =
    {
     ptype_name = name;
     ptype_params = params;
     ptype_cstrs = cstrs;
     ptype_kind = kind;
     ptype_private = priv;
     ptype_manifest = manifest;
     ptype_attributes =
       add_text_attrs text (add_docs_attrs docs attrs);
     ptype_loc = loc;
    }

  let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
        ?(args = []) ?res name =
    {
     pcd_name = name;
     pcd_args = args;
     pcd_res = res;
     pcd_loc = loc;
     pcd_attributes = add_info_attrs info attrs;
    }

  let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
        ?(mut = Immutable) name typ =
    {
     pld_name = name;
     pld_mutable = mut;
     pld_type = typ;
     pld_loc = loc;
     pld_attributes = add_info_attrs info attrs;
    }

end

(** Type extensions *)
module Te = struct
  let mk ?(attrs = []) ?(docs = empty_docs)
        ?(params = []) ?(priv = Public) path constructors =
    {
     ptyext_path = path;
     ptyext_params = params;
     ptyext_constructors = constructors;
     ptyext_private = priv;
     ptyext_attributes = add_docs_attrs docs attrs;
    }

  let constructor ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(info = empty_info) name kind =
    {
     pext_name = name;
     pext_kind = kind;
     pext_loc = loc;
     pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
    }

  let decl ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(info = empty_info) ?(args = []) ?res name =
    {
     pext_name = name;
     pext_kind = Pext_decl(args, res);
     pext_loc = loc;
     pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
    }

  let rebind ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(info = empty_info) name lid =
    {
     pext_name = name;
     pext_kind = Pext_rebind lid;
     pext_loc = loc;
     pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
    }

end

module Csig = struct
  let mk self fields =
    {
     pcsig_self = self;
     pcsig_fields = fields;
    }
end

module Cstr = struct
  let mk self fields =
    {
     pcstr_self = self;
     pcstr_fields = fields;
    }
end


end
module Syntaxerr : sig 
#1 "syntaxerr.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Auxiliary type for reporting syntax errors *)

open Format

type error =
    Unclosed of Location.t * string * Location.t * string
  | Expecting of Location.t * string
  | Not_expecting of Location.t * string
  | Applicative_path of Location.t
  | Variable_in_scope of Location.t * string
  | Other of Location.t
  | Ill_formed_ast of Location.t * string

exception Error of error
exception Escape_error

val report_error: formatter -> error -> unit
 (* Deprecated.  Use Location.{error_of_exn, report_error}. *)

val location_of_error: error -> Location.t
val ill_formed_ast: Location.t -> string -> 'a

end = struct
#1 "syntaxerr.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1997 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Auxiliary type for reporting syntax errors *)

type error =
    Unclosed of Location.t * string * Location.t * string
  | Expecting of Location.t * string
  | Not_expecting of Location.t * string
  | Applicative_path of Location.t
  | Variable_in_scope of Location.t * string
  | Other of Location.t
  | Ill_formed_ast of Location.t * string

exception Error of error
exception Escape_error

let prepare_error = function
  | Unclosed(opening_loc, opening, closing_loc, closing) ->
      Location.errorf ~loc:closing_loc
        ~sub:[
          Location.errorf ~loc:opening_loc
            "This '%s' might be unmatched" opening
        ]
        ~if_highlight:
          (Printf.sprintf "Syntax error: '%s' expected, \
                           the highlighted '%s' might be unmatched"
             closing opening)
        "Syntax error: '%s' expected" closing

  | Expecting (loc, nonterm) ->
      Location.errorf ~loc "Syntax error: %s expected." nonterm
  | Not_expecting (loc, nonterm) ->
      Location.errorf ~loc "Syntax error: %s not expected." nonterm
  | Applicative_path loc ->
      Location.errorf ~loc
        "Syntax error: applicative paths of the form F(X).t \
         are not supported when the option -no-app-func is set."
  | Variable_in_scope (loc, var) ->
      Location.errorf ~loc
        "In this scoped type, variable '%s \
         is reserved for the local type %s."
         var var
  | Other loc ->
      Location.errorf ~loc "Syntax error"
  | Ill_formed_ast (loc, s) ->
      Location.errorf ~loc "broken invariant in parsetree: %s" s

let () =
  Location.register_error_of_exn
    (function
      | Error err -> Some (prepare_error err)
      | _ -> None
    )


let report_error ppf err =
  Location.report_error ppf (prepare_error err)

let location_of_error = function
  | Unclosed(l,_,_,_)
  | Applicative_path l
  | Variable_in_scope(l,_)
  | Other l
  | Not_expecting (l, _)
  | Ill_formed_ast (l, _)
  | Expecting (l, _) -> l


let ill_formed_ast loc s =
  raise (Error (Ill_formed_ast (loc, s)))

end
module Parser : sig 
#1 "parser.mli"
type token =
  | AMPERAMPER
  | AMPERSAND
  | AND
  | AS
  | ASSERT
  | BACKQUOTE
  | BANG
  | BAR
  | BARBAR
  | BARRBRACKET
  | BEGIN
  | CHAR of (char)
  | CLASS
  | COLON
  | COLONCOLON
  | COLONEQUAL
  | COLONGREATER
  | COMMA
  | CONSTRAINT
  | DO
  | DONE
  | DOT
  | DOTDOT
  | DOWNTO
  | ELSE
  | END
  | EOF
  | EQUAL
  | EXCEPTION
  | EXTERNAL
  | FALSE
  | FLOAT of (string)
  | FOR
  | FUN
  | FUNCTION
  | FUNCTOR
  | GREATER
  | GREATERRBRACE
  | GREATERRBRACKET
  | IF
  | IN
  | INCLUDE
  | INFIXOP0 of (string)
  | INFIXOP1 of (string)
  | INFIXOP2 of (string)
  | INFIXOP3 of (string)
  | INFIXOP4 of (string)
  | INHERIT
  | INITIALIZER
  | INT of (int)
  | INT32 of (int32)
  | INT64 of (int64)
  | LABEL of (string)
  | LAZY
  | LBRACE
  | LBRACELESS
  | LBRACKET
  | LBRACKETBAR
  | LBRACKETLESS
  | LBRACKETGREATER
  | LBRACKETPERCENT
  | LBRACKETPERCENTPERCENT
  | LESS
  | LESSMINUS
  | LET
  | LIDENT of (string)
  | LPAREN
  | LBRACKETAT
  | LBRACKETATAT
  | LBRACKETATATAT
  | MATCH
  | METHOD
  | MINUS
  | MINUSDOT
  | MINUSGREATER
  | MODULE
  | MUTABLE
  | NATIVEINT of (nativeint)
  | NEW
  | NONREC
  | OBJECT
  | OF
  | OPEN
  | OPTLABEL of (string)
  | OR
  | PERCENT
  | PLUS
  | PLUSDOT
  | PLUSEQ
  | PREFIXOP of (string)
  | PRIVATE
  | QUESTION
  | QUOTE
  | RBRACE
  | RBRACKET
  | REC
  | RPAREN
  | SEMI
  | SEMISEMI
  | SHARP
  | SHARPOP of (string)
  | SIG
  | STAR
  | STRING of (string * string option)
  | STRUCT
  | THEN
  | TILDE
  | TO
  | TRUE
  | TRY
  | TYPE
  | UIDENT of (string)
  | UNDERSCORE
  | VAL
  | VIRTUAL
  | WHEN
  | WHILE
  | WITH
  | COMMENT of (string * Location.t)
  | DOCSTRING of (Docstrings.docstring)
  | EOL

val implementation :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.structure
val interface :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.signature
val toplevel_phrase :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.toplevel_phrase
val use_file :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.toplevel_phrase list
val parse_core_type :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.core_type
val parse_expression :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.expression
val parse_pattern :
  (Lexing.lexbuf  -> token) -> Lexing.lexbuf -> Parsetree.pattern

end = struct
#1 "parser.ml"
type token =
  | AMPERAMPER
  | AMPERSAND
  | AND
  | AS
  | ASSERT
  | BACKQUOTE
  | BANG
  | BAR
  | BARBAR
  | BARRBRACKET
  | BEGIN
  | CHAR of (char)
  | CLASS
  | COLON
  | COLONCOLON
  | COLONEQUAL
  | COLONGREATER
  | COMMA
  | CONSTRAINT
  | DO
  | DONE
  | DOT
  | DOTDOT
  | DOWNTO
  | ELSE
  | END
  | EOF
  | EQUAL
  | EXCEPTION
  | EXTERNAL
  | FALSE
  | FLOAT of (string)
  | FOR
  | FUN
  | FUNCTION
  | FUNCTOR
  | GREATER
  | GREATERRBRACE
  | GREATERRBRACKET
  | IF
  | IN
  | INCLUDE
  | INFIXOP0 of (string)
  | INFIXOP1 of (string)
  | INFIXOP2 of (string)
  | INFIXOP3 of (string)
  | INFIXOP4 of (string)
  | INHERIT
  | INITIALIZER
  | INT of (int)
  | INT32 of (int32)
  | INT64 of (int64)
  | LABEL of (string)
  | LAZY
  | LBRACE
  | LBRACELESS
  | LBRACKET
  | LBRACKETBAR
  | LBRACKETLESS
  | LBRACKETGREATER
  | LBRACKETPERCENT
  | LBRACKETPERCENTPERCENT
  | LESS
  | LESSMINUS
  | LET
  | LIDENT of (string)
  | LPAREN
  | LBRACKETAT
  | LBRACKETATAT
  | LBRACKETATATAT
  | MATCH
  | METHOD
  | MINUS
  | MINUSDOT
  | MINUSGREATER
  | MODULE
  | MUTABLE
  | NATIVEINT of (nativeint)
  | NEW
  | NONREC
  | OBJECT
  | OF
  | OPEN
  | OPTLABEL of (string)
  | OR
  | PERCENT
  | PLUS
  | PLUSDOT
  | PLUSEQ
  | PREFIXOP of (string)
  | PRIVATE
  | QUESTION
  | QUOTE
  | RBRACE
  | RBRACKET
  | REC
  | RPAREN
  | SEMI
  | SEMISEMI
  | SHARP
  | SHARPOP of (string)
  | SIG
  | STAR
  | STRING of (string * string option)
  | STRUCT
  | THEN
  | TILDE
  | TO
  | TRUE
  | TRY
  | TYPE
  | UIDENT of (string)
  | UNDERSCORE
  | VAL
  | VIRTUAL
  | WHEN
  | WHILE
  | WITH
  | COMMENT of (string * Location.t)
  | DOCSTRING of (Docstrings.docstring)
  | EOL

open Parsing;;
let _ = parse_error;;
# 16 "parsing/parser.mly"
open Location
open Asttypes
open Longident
open Parsetree
open Ast_helper
open Docstrings

let mktyp d = Typ.mk ~loc:(symbol_rloc()) d
let mkpat d = Pat.mk ~loc:(symbol_rloc()) d
let mkexp d = Exp.mk ~loc:(symbol_rloc()) d
let mkmty d = Mty.mk ~loc:(symbol_rloc()) d
let mksig d = Sig.mk ~loc:(symbol_rloc()) d
let mkmod d = Mod.mk ~loc:(symbol_rloc()) d
let mkstr d = Str.mk ~loc:(symbol_rloc()) d
let mkclass d = Cl.mk ~loc:(symbol_rloc()) d
let mkcty d = Cty.mk ~loc:(symbol_rloc()) d
let mkctf ?attrs ?docs d =
  Ctf.mk ~loc:(symbol_rloc()) ?attrs ?docs d
let mkcf ?attrs ?docs d =
  Cf.mk ~loc:(symbol_rloc()) ?attrs ?docs d

let mkrhs rhs pos = mkloc rhs (rhs_loc pos)
let mkoption d =
  let loc = {d.ptyp_loc with loc_ghost = true} in
  Typ.mk ~loc (Ptyp_constr(mkloc (Ldot (Lident "*predef*", "option")) loc,[d]))

let reloc_pat x = { x with ppat_loc = symbol_rloc () };;
let reloc_exp x = { x with pexp_loc = symbol_rloc () };;

let mkoperator name pos =
  let loc = rhs_loc pos in
  Exp.mk ~loc (Pexp_ident(mkloc (Lident name) loc))

let mkpatvar name pos =
  Pat.mk ~loc:(rhs_loc pos) (Ppat_var (mkrhs name pos))

(*
  Ghost expressions and patterns:
  expressions and patterns that do not appear explicitly in the
  source file they have the loc_ghost flag set to true.
  Then the profiler will not try to instrument them and the
  -annot option will not try to display their type.

  Every grammar rule that generates an element with a location must
  make at most one non-ghost element, the topmost one.

  How to tell whether your location must be ghost:
  A location corresponds to a range of characters in the source file.
  If the location contains a piece of code that is syntactically
  valid (according to the documentation), and corresponds to the
  AST node, then the location must be real; in all other cases,
  it must be ghost.
*)
let ghexp d = Exp.mk ~loc:(symbol_gloc ()) d
let ghpat d = Pat.mk ~loc:(symbol_gloc ()) d
let ghtyp d = Typ.mk ~loc:(symbol_gloc ()) d
let ghloc d = { txt = d; loc = symbol_gloc () }
let ghstr d = Str.mk ~loc:(symbol_gloc()) d

let ghunit () =
  ghexp (Pexp_construct (mknoloc (Lident "()"), None))

let mkinfix arg1 name arg2 =
  mkexp(Pexp_apply(mkoperator name 2, ["", arg1; "", arg2]))

let neg_float_string f =
  if String.length f > 0 && f.[0] = '-'
  then String.sub f 1 (String.length f - 1)
  else "-" ^ f

let mkuminus name arg =
  match name, arg.pexp_desc with
  | "-", Pexp_constant(Const_int n) ->
      mkexp(Pexp_constant(Const_int(-n)))
  | "-", Pexp_constant(Const_int32 n) ->
      mkexp(Pexp_constant(Const_int32(Int32.neg n)))
  | "-", Pexp_constant(Const_int64 n) ->
      mkexp(Pexp_constant(Const_int64(Int64.neg n)))
  | "-", Pexp_constant(Const_nativeint n) ->
      mkexp(Pexp_constant(Const_nativeint(Nativeint.neg n)))
  | ("-" | "-."), Pexp_constant(Const_float f) ->
      mkexp(Pexp_constant(Const_float(neg_float_string f)))
  | _ ->
      mkexp(Pexp_apply(mkoperator ("~" ^ name) 1, ["", arg]))

let mkuplus name arg =
  let desc = arg.pexp_desc in
  match name, desc with
  | "+", Pexp_constant(Const_int _)
  | "+", Pexp_constant(Const_int32 _)
  | "+", Pexp_constant(Const_int64 _)
  | "+", Pexp_constant(Const_nativeint _)
  | ("+" | "+."), Pexp_constant(Const_float _) -> mkexp desc
  | _ ->
      mkexp(Pexp_apply(mkoperator ("~" ^ name) 1, ["", arg]))

let mkexp_cons consloc args loc =
  Exp.mk ~loc (Pexp_construct(mkloc (Lident "::") consloc, Some args))

let mkpat_cons consloc args loc =
  Pat.mk ~loc (Ppat_construct(mkloc (Lident "::") consloc, Some args))

let rec mktailexp nilloc = function
    [] ->
      let loc = { nilloc with loc_ghost = true } in
      let nil = { txt = Lident "[]"; loc = loc } in
      Exp.mk ~loc (Pexp_construct (nil, None))
  | e1 :: el ->
      let exp_el = mktailexp nilloc el in
      let loc = {loc_start = e1.pexp_loc.loc_start;
               loc_end = exp_el.pexp_loc.loc_end;
               loc_ghost = true}
      in
      let arg = Exp.mk ~loc (Pexp_tuple [e1; exp_el]) in
      mkexp_cons {loc with loc_ghost = true} arg loc

let rec mktailpat nilloc = function
    [] ->
      let loc = { nilloc with loc_ghost = true } in
      let nil = { txt = Lident "[]"; loc = loc } in
      Pat.mk ~loc (Ppat_construct (nil, None))
  | p1 :: pl ->
      let pat_pl = mktailpat nilloc pl in
      let loc = {loc_start = p1.ppat_loc.loc_start;
               loc_end = pat_pl.ppat_loc.loc_end;
               loc_ghost = true}
      in
      let arg = Pat.mk ~loc (Ppat_tuple [p1; pat_pl]) in
      mkpat_cons {loc with loc_ghost = true} arg loc

let mkstrexp e attrs =
  { pstr_desc = Pstr_eval (e, attrs); pstr_loc = e.pexp_loc }

let mkexp_constraint e (t1, t2) =
  match t1, t2 with
  | Some t, None -> ghexp(Pexp_constraint(e, t))
  | _, Some t -> ghexp(Pexp_coerce(e, t1, t))
  | None, None -> assert false

let array_function str name =
  ghloc (Ldot(Lident str, (if !Clflags.fast then "unsafe_" ^ name else name)))

let syntax_error () =
  raise Syntaxerr.Escape_error

let unclosed opening_name opening_num closing_name closing_num =
  raise(Syntaxerr.Error(Syntaxerr.Unclosed(rhs_loc opening_num, opening_name,
                                           rhs_loc closing_num, closing_name)))

let expecting pos nonterm =
    raise Syntaxerr.(Error(Expecting(rhs_loc pos, nonterm)))

let not_expecting pos nonterm =
    raise Syntaxerr.(Error(Not_expecting(rhs_loc pos, nonterm)))

let bigarray_function str name =
  ghloc (Ldot(Ldot(Lident "Bigarray", str), name))

let bigarray_untuplify = function
    { pexp_desc = Pexp_tuple explist; pexp_loc = _ } -> explist
  | exp -> [exp]

let bigarray_get arr arg =
  let get = if !Clflags.fast then "unsafe_get" else "get" in
  match bigarray_untuplify arg with
    [c1] ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" get)),
                       ["", arr; "", c1]))
  | [c1;c2] ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array2" get)),
                       ["", arr; "", c1; "", c2]))
  | [c1;c2;c3] ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array3" get)),
                       ["", arr; "", c1; "", c2; "", c3]))
  | coords ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Genarray" "get")),
                       ["", arr; "", ghexp(Pexp_array coords)]))

let bigarray_set arr arg newval =
  let set = if !Clflags.fast then "unsafe_set" else "set" in
  match bigarray_untuplify arg with
    [c1] ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array1" set)),
                       ["", arr; "", c1; "", newval]))
  | [c1;c2] ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array2" set)),
                       ["", arr; "", c1; "", c2; "", newval]))
  | [c1;c2;c3] ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Array3" set)),
                       ["", arr; "", c1; "", c2; "", c3; "", newval]))
  | coords ->
      mkexp(Pexp_apply(ghexp(Pexp_ident(bigarray_function "Genarray" "set")),
                       ["", arr;
                        "", ghexp(Pexp_array coords);
                        "", newval]))

let lapply p1 p2 =
  if !Clflags.applicative_functors
  then Lapply(p1, p2)
  else raise (Syntaxerr.Error(Syntaxerr.Applicative_path (symbol_rloc())))

let exp_of_label lbl pos =
  mkexp (Pexp_ident(mkrhs (Lident(Longident.last lbl)) pos))

let pat_of_label lbl pos =
  mkpat (Ppat_var (mkrhs (Longident.last lbl) pos))

let check_variable vl loc v =
  if List.mem v vl then
    raise Syntaxerr.(Error(Variable_in_scope(loc,v)))

let varify_constructors var_names t =
  let rec loop t =
    let desc =
      match t.ptyp_desc with
      | Ptyp_any -> Ptyp_any
      | Ptyp_var x ->
          check_variable var_names t.ptyp_loc x;
          Ptyp_var x
      | Ptyp_arrow (label,core_type,core_type') ->
          Ptyp_arrow(label, loop core_type, loop core_type')
      | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
      | Ptyp_constr( { txt = Lident s }, []) when List.mem s var_names ->
          Ptyp_var s
      | Ptyp_constr(longident, lst) ->
          Ptyp_constr(longident, List.map loop lst)
      | Ptyp_object (lst, o) ->
          Ptyp_object
            (List.map (fun (s, attrs, t) -> (s, attrs, loop t)) lst, o)
      | Ptyp_class (longident, lst) ->
          Ptyp_class (longident, List.map loop lst)
      | Ptyp_alias(core_type, string) ->
          check_variable var_names t.ptyp_loc string;
          Ptyp_alias(loop core_type, string)
      | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
          Ptyp_variant(List.map loop_row_field row_field_list,
                       flag, lbl_lst_option)
      | Ptyp_poly(string_lst, core_type) ->
          List.iter (check_variable var_names t.ptyp_loc) string_lst;
          Ptyp_poly(string_lst, loop core_type)
      | Ptyp_package(longident,lst) ->
          Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
      | Ptyp_extension (s, arg) ->
          Ptyp_extension (s, arg)
    in
    {t with ptyp_desc = desc}
  and loop_row_field  =
    function
      | Rtag(label,attrs,flag,lst) ->
          Rtag(label,attrs,flag,List.map loop lst)
      | Rinherit t ->
          Rinherit (loop t)
  in
  loop t

let wrap_type_annotation newtypes core_type body =
  let exp = mkexp(Pexp_constraint(body,core_type)) in
  let exp =
    List.fold_right (fun newtype exp -> mkexp (Pexp_newtype (newtype, exp)))
      newtypes exp
  in
  (exp, ghtyp(Ptyp_poly(newtypes,varify_constructors newtypes core_type)))

let wrap_exp_attrs body (ext, attrs) =
  (* todo: keep exact location for the entire attribute *)
  let body = {body with pexp_attributes = attrs @ body.pexp_attributes} in
  match ext with
  | None -> body
  | Some id -> ghexp(Pexp_extension (id, PStr [mkstrexp body []]))

let mkexp_attrs d attrs =
  wrap_exp_attrs (mkexp d) attrs

let text_str pos = Str.text (rhs_text pos)
let text_sig pos = Sig.text (rhs_text pos)
let text_cstr pos = Cf.text (rhs_text pos)
let text_csig pos = Ctf.text (rhs_text pos)
let text_def pos = [Ptop_def (Str.text (rhs_text pos))]

let extra_text text pos items =
  let pre_extras = rhs_pre_extra_text pos in
  let post_extras = rhs_post_extra_text pos in
    text pre_extras @ items @ text post_extras

let extra_str pos items = extra_text Str.text pos items
let extra_sig pos items = extra_text Sig.text pos items
let extra_cstr pos items = extra_text Cf.text pos items
let extra_csig pos items = extra_text Ctf.text pos items
let extra_def pos items =
  extra_text (fun txt -> [Ptop_def (Str.text txt)]) pos items

let add_nonrec rf attrs pos =
  match rf with
  | Recursive -> attrs
  | Nonrecursive ->
      let name = { txt = "nonrec"; loc = rhs_loc pos } in
        (name, PStr []) :: attrs

type let_binding =
  { lb_pattern: pattern;
    lb_expression: expression;
    lb_attributes: attributes;
    lb_docs: docs Lazy.t;
    lb_text: text Lazy.t;
    lb_loc: Location.t; }

type let_bindings =
  { lbs_bindings: let_binding list;
    lbs_rec: rec_flag;
    lbs_extension: string Asttypes.loc option;
    lbs_attributes: attributes;
    lbs_loc: Location.t }

let mklb (p, e) attrs =
  { lb_pattern = p;
    lb_expression = e;
    lb_attributes = attrs;
    lb_docs = symbol_docs_lazy ();
    lb_text = symbol_text_lazy ();
    lb_loc = symbol_rloc (); }

let mklbs (ext, attrs) rf lb =
  { lbs_bindings = [lb];
    lbs_rec = rf;
    lbs_extension = ext ;
    lbs_attributes = attrs;
    lbs_loc = symbol_rloc (); }

let addlb lbs lb =
  { lbs with lbs_bindings = lb :: lbs.lbs_bindings }

let val_of_let_bindings lbs =
  let str =
    match lbs.lbs_bindings with
    | [ {lb_pattern = { ppat_desc = Ppat_any; ppat_loc = _ }; _} as lb ] ->
        let exp = wrap_exp_attrs lb.lb_expression
                    (None, lbs.lbs_attributes) in
        mkstr (Pstr_eval (exp, lb.lb_attributes))
    | bindings ->
        if lbs.lbs_attributes <> [] then
          raise Syntaxerr.(Error(Not_expecting(lbs.lbs_loc, "attributes")));
        let bindings =
          List.map
            (fun lb ->
               Vb.mk ~loc:lb.lb_loc ~attrs:lb.lb_attributes
                 ~docs:(Lazy.force lb.lb_docs)
                 ~text:(Lazy.force lb.lb_text)
                 lb.lb_pattern lb.lb_expression)
            bindings
        in
        mkstr(Pstr_value(lbs.lbs_rec, List.rev bindings))
  in
  match lbs.lbs_extension with
  | None -> str
  | Some id -> ghstr (Pstr_extension((id, PStr [str]), []))

let expr_of_let_bindings lbs body =
  let bindings =
    List.map
      (fun lb ->
         if lb.lb_attributes <> [] then
           raise Syntaxerr.(Error(Not_expecting(lb.lb_loc, "item attribute")));
         Vb.mk ~loc:lb.lb_loc lb.lb_pattern lb.lb_expression)
      lbs.lbs_bindings
  in
    mkexp_attrs (Pexp_let(lbs.lbs_rec, List.rev bindings, body))
      (lbs.lbs_extension, lbs.lbs_attributes)

let class_of_let_bindings lbs body =
  let bindings =
    List.map
      (fun lb ->
         if lb.lb_attributes <> [] then
           raise Syntaxerr.(Error(Not_expecting(lb.lb_loc, "item attribute")));
         Vb.mk ~loc:lb.lb_loc lb.lb_pattern lb.lb_expression)
      lbs.lbs_bindings
  in
    if lbs.lbs_extension <> None then
      raise Syntaxerr.(Error(Not_expecting(lbs.lbs_loc, "extension")));
    if lbs.lbs_attributes <> [] then
      raise Syntaxerr.(Error(Not_expecting(lbs.lbs_loc, "attributes")));
    mkclass(Pcl_let (lbs.lbs_rec, List.rev bindings, body))

# 511 "parsing/parser.ml"
let yytransl_const = [|
  257 (* AMPERAMPER *);
  258 (* AMPERSAND *);
  259 (* AND *);
  260 (* AS *);
  261 (* ASSERT *);
  262 (* BACKQUOTE *);
  263 (* BANG *);
  264 (* BAR *);
  265 (* BARBAR *);
  266 (* BARRBRACKET *);
  267 (* BEGIN *);
  269 (* CLASS *);
  270 (* COLON *);
  271 (* COLONCOLON *);
  272 (* COLONEQUAL *);
  273 (* COLONGREATER *);
  274 (* COMMA *);
  275 (* CONSTRAINT *);
  276 (* DO *);
  277 (* DONE *);
  278 (* DOT *);
  279 (* DOTDOT *);
  280 (* DOWNTO *);
  281 (* ELSE *);
  282 (* END *);
    0 (* EOF *);
  283 (* EQUAL *);
  284 (* EXCEPTION *);
  285 (* EXTERNAL *);
  286 (* FALSE *);
  288 (* FOR *);
  289 (* FUN *);
  290 (* FUNCTION *);
  291 (* FUNCTOR *);
  292 (* GREATER *);
  293 (* GREATERRBRACE *);
  294 (* GREATERRBRACKET *);
  295 (* IF *);
  296 (* IN *);
  297 (* INCLUDE *);
  303 (* INHERIT *);
  304 (* INITIALIZER *);
  309 (* LAZY *);
  310 (* LBRACE *);
  311 (* LBRACELESS *);
  312 (* LBRACKET *);
  313 (* LBRACKETBAR *);
  314 (* LBRACKETLESS *);
  315 (* LBRACKETGREATER *);
  316 (* LBRACKETPERCENT *);
  317 (* LBRACKETPERCENTPERCENT *);
  318 (* LESS *);
  319 (* LESSMINUS *);
  320 (* LET *);
  322 (* LPAREN *);
  323 (* LBRACKETAT *);
  324 (* LBRACKETATAT *);
  325 (* LBRACKETATATAT *);
  326 (* MATCH *);
  327 (* METHOD *);
  328 (* MINUS *);
  329 (* MINUSDOT *);
  330 (* MINUSGREATER *);
  331 (* MODULE *);
  332 (* MUTABLE *);
  334 (* NEW *);
  335 (* NONREC *);
  336 (* OBJECT *);
  337 (* OF *);
  338 (* OPEN *);
  340 (* OR *);
  341 (* PERCENT *);
  342 (* PLUS *);
  343 (* PLUSDOT *);
  344 (* PLUSEQ *);
  346 (* PRIVATE *);
  347 (* QUESTION *);
  348 (* QUOTE *);
  349 (* RBRACE *);
  350 (* RBRACKET *);
  351 (* REC *);
  352 (* RPAREN *);
  353 (* SEMI *);
  354 (* SEMISEMI *);
  355 (* SHARP *);
  357 (* SIG *);
  358 (* STAR *);
  360 (* STRUCT *);
  361 (* THEN *);
  362 (* TILDE *);
  363 (* TO *);
  364 (* TRUE *);
  365 (* TRY *);
  366 (* TYPE *);
  368 (* UNDERSCORE *);
  369 (* VAL *);
  370 (* VIRTUAL *);
  371 (* WHEN *);
  372 (* WHILE *);
  373 (* WITH *);
  376 (* EOL *);
    0|]

let yytransl_block = [|
  268 (* CHAR *);
  287 (* FLOAT *);
  298 (* INFIXOP0 *);
  299 (* INFIXOP1 *);
  300 (* INFIXOP2 *);
  301 (* INFIXOP3 *);
  302 (* INFIXOP4 *);
  305 (* INT *);
  306 (* INT32 *);
  307 (* INT64 *);
  308 (* LABEL *);
  321 (* LIDENT *);
  333 (* NATIVEINT *);
  339 (* OPTLABEL *);
  345 (* PREFIXOP *);
  356 (* SHARPOP *);
  359 (* STRING *);
  367 (* UIDENT *);
  374 (* COMMENT *);
  375 (* DOCSTRING *);
    0|]

let yylhs = "\255\255\
\001\000\002\000\003\000\003\000\003\000\010\000\010\000\014\000\
\014\000\004\000\016\000\016\000\017\000\017\000\017\000\017\000\
\017\000\017\000\017\000\005\000\006\000\007\000\020\000\020\000\
\021\000\021\000\023\000\023\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
\008\000\008\000\030\000\030\000\030\000\015\000\015\000\015\000\
\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
\015\000\015\000\015\000\042\000\045\000\045\000\045\000\036\000\
\037\000\037\000\046\000\047\000\022\000\022\000\022\000\022\000\
\022\000\022\000\022\000\022\000\022\000\022\000\009\000\009\000\
\009\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\
\050\000\050\000\050\000\050\000\050\000\050\000\050\000\050\000\
\039\000\057\000\060\000\060\000\060\000\054\000\055\000\056\000\
\056\000\061\000\062\000\063\000\063\000\038\000\040\000\040\000\
\065\000\066\000\069\000\069\000\069\000\068\000\068\000\074\000\
\074\000\070\000\070\000\070\000\070\000\070\000\070\000\075\000\
\075\000\075\000\075\000\075\000\075\000\075\000\075\000\079\000\
\080\000\080\000\080\000\081\000\081\000\082\000\082\000\082\000\
\082\000\082\000\082\000\082\000\083\000\083\000\084\000\084\000\
\084\000\084\000\085\000\085\000\085\000\085\000\085\000\071\000\
\071\000\071\000\071\000\071\000\094\000\094\000\094\000\094\000\
\094\000\094\000\097\000\098\000\098\000\099\000\099\000\100\000\
\100\000\100\000\100\000\100\000\100\000\101\000\101\000\101\000\
\103\000\086\000\058\000\058\000\104\000\105\000\041\000\041\000\
\106\000\107\000\012\000\012\000\012\000\072\000\072\000\072\000\
\072\000\072\000\072\000\072\000\072\000\112\000\112\000\109\000\
\109\000\108\000\108\000\110\000\111\000\111\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
\026\000\026\000\114\000\114\000\114\000\114\000\114\000\114\000\
\114\000\114\000\114\000\114\000\114\000\114\000\114\000\114\000\
\114\000\114\000\114\000\114\000\114\000\114\000\114\000\114\000\
\114\000\114\000\114\000\114\000\114\000\114\000\114\000\114\000\
\114\000\114\000\114\000\114\000\114\000\114\000\114\000\114\000\
\114\000\114\000\114\000\114\000\114\000\114\000\114\000\114\000\
\114\000\114\000\076\000\076\000\132\000\132\000\133\000\133\000\
\133\000\133\000\134\000\093\000\093\000\135\000\135\000\135\000\
\135\000\135\000\031\000\031\000\140\000\141\000\137\000\137\000\
\092\000\092\000\092\000\117\000\117\000\143\000\143\000\118\000\
\118\000\118\000\119\000\119\000\128\000\128\000\144\000\144\000\
\144\000\145\000\145\000\131\000\131\000\129\000\129\000\089\000\
\089\000\089\000\089\000\089\000\019\000\019\000\019\000\019\000\
\019\000\019\000\019\000\019\000\019\000\019\000\019\000\019\000\
\019\000\019\000\019\000\113\000\113\000\139\000\139\000\139\000\
\139\000\139\000\139\000\139\000\139\000\139\000\139\000\139\000\
\139\000\139\000\139\000\139\000\139\000\139\000\139\000\139\000\
\139\000\139\000\139\000\146\000\146\000\146\000\150\000\150\000\
\149\000\149\000\149\000\149\000\151\000\151\000\051\000\152\000\
\152\000\032\000\033\000\033\000\153\000\154\000\158\000\158\000\
\157\000\157\000\157\000\157\000\157\000\157\000\157\000\157\000\
\157\000\157\000\156\000\156\000\156\000\161\000\162\000\162\000\
\164\000\164\000\165\000\165\000\165\000\166\000\163\000\163\000\
\163\000\167\000\073\000\073\000\159\000\159\000\159\000\168\000\
\169\000\035\000\035\000\053\000\171\000\171\000\171\000\171\000\
\160\000\160\000\160\000\175\000\176\000\034\000\052\000\178\000\
\178\000\178\000\178\000\178\000\178\000\179\000\179\000\179\000\
\180\000\181\000\182\000\183\000\049\000\049\000\184\000\184\000\
\184\000\184\000\185\000\185\000\138\000\138\000\090\000\090\000\
\177\000\177\000\018\000\018\000\186\000\186\000\188\000\188\000\
\188\000\188\000\188\000\190\000\190\000\174\000\174\000\191\000\
\191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
\191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
\191\000\191\000\027\000\027\000\198\000\197\000\197\000\194\000\
\194\000\195\000\195\000\193\000\193\000\199\000\199\000\200\000\
\200\000\196\000\196\000\189\000\189\000\095\000\095\000\077\000\
\077\000\201\000\201\000\173\000\173\000\192\000\192\000\192\000\
\202\000\087\000\127\000\127\000\127\000\127\000\127\000\127\000\
\127\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
\147\000\147\000\147\000\147\000\064\000\064\000\136\000\136\000\
\136\000\136\000\136\000\203\000\203\000\203\000\203\000\203\000\
\203\000\203\000\203\000\203\000\203\000\203\000\203\000\203\000\
\203\000\203\000\203\000\203\000\203\000\203\000\203\000\203\000\
\203\000\203\000\170\000\170\000\170\000\170\000\170\000\126\000\
\126\000\120\000\120\000\120\000\120\000\120\000\125\000\125\000\
\148\000\148\000\025\000\025\000\187\000\187\000\187\000\048\000\
\048\000\096\000\096\000\078\000\078\000\011\000\011\000\011\000\
\011\000\011\000\011\000\011\000\121\000\142\000\142\000\155\000\
\155\000\122\000\122\000\091\000\091\000\088\000\088\000\067\000\
\067\000\102\000\102\000\102\000\102\000\102\000\059\000\059\000\
\116\000\116\000\130\000\130\000\123\000\123\000\124\000\124\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\205\000\205\000\028\000\207\000\044\000\013\000\
\013\000\172\000\172\000\115\000\115\000\115\000\029\000\043\000\
\206\000\206\000\206\000\206\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000"

let yylen = "\002\000\
\002\000\002\000\002\000\002\000\001\000\002\000\001\000\000\000\
\002\000\001\000\001\000\003\000\001\000\002\000\004\000\003\000\
\003\000\002\000\002\000\002\000\002\000\002\000\002\000\005\000\
\001\000\001\000\002\000\001\000\001\000\003\000\003\000\004\000\
\004\000\003\000\004\000\005\000\005\000\003\000\003\000\004\000\
\006\000\008\000\006\000\005\000\005\000\004\000\002\000\001\000\
\003\000\001\000\000\000\002\000\002\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\002\000\001\000\003\000\002\000\004\000\002\000\004\000\
\001\000\002\000\005\000\004\000\001\000\003\000\003\000\004\000\
\003\000\004\000\003\000\003\000\001\000\002\000\000\000\002\000\
\002\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\002\000\001\000\
\004\000\003\000\002\000\006\000\003\000\004\000\005\000\001\000\
\002\000\006\000\005\000\000\000\002\000\005\000\001\000\002\000\
\006\000\006\000\002\000\004\000\002\000\000\000\003\000\003\000\
\002\000\001\000\002\000\002\000\003\000\002\000\001\000\004\000\
\001\000\003\000\003\000\005\000\005\000\003\000\003\000\002\000\
\003\000\005\000\000\000\000\000\002\000\005\000\003\000\003\000\
\003\000\003\000\002\000\001\000\002\000\000\000\006\000\005\000\
\005\000\006\000\006\000\006\000\004\000\007\000\010\000\001\000\
\006\000\004\000\005\000\003\000\004\000\001\000\003\000\003\000\
\002\000\001\000\002\000\003\000\000\000\000\000\002\000\003\000\
\003\000\006\000\003\000\002\000\001\000\005\000\005\000\003\000\
\003\000\003\000\001\000\002\000\007\000\007\000\001\000\002\000\
\008\000\007\000\001\000\002\000\003\000\005\000\002\000\005\000\
\002\000\004\000\002\000\002\000\001\000\001\000\001\000\000\000\
\002\000\001\000\003\000\001\000\001\000\003\000\001\000\002\000\
\003\000\007\000\007\000\004\000\004\000\007\000\006\000\006\000\
\005\000\001\000\002\000\002\000\007\000\005\000\006\000\010\000\
\003\000\008\000\003\000\003\000\003\000\003\000\003\000\003\000\
\003\000\003\000\003\000\003\000\003\000\003\000\003\000\003\000\
\003\000\003\000\003\000\003\000\003\000\003\000\002\000\002\000\
\005\000\007\000\007\000\007\000\003\000\003\000\003\000\004\000\
\004\000\002\000\001\000\001\000\001\000\001\000\003\000\003\000\
\004\000\003\000\004\000\004\000\003\000\005\000\005\000\005\000\
\005\000\005\000\005\000\005\000\005\000\003\000\003\000\005\000\
\005\000\004\000\004\000\002\000\006\000\006\000\004\000\004\000\
\006\000\006\000\002\000\002\000\003\000\004\000\004\000\002\000\
\006\000\006\000\003\000\003\000\004\000\006\000\005\000\008\000\
\007\000\001\000\001\000\002\000\001\000\001\000\002\000\002\000\
\002\000\002\000\001\000\001\000\002\000\002\000\007\000\008\000\
\003\000\005\000\001\000\002\000\005\000\003\000\001\000\003\000\
\002\000\002\000\005\000\001\000\003\000\003\000\005\000\002\000\
\002\000\005\000\003\000\003\000\003\000\001\000\001\000\003\000\
\002\000\003\000\001\000\003\000\005\000\001\000\003\000\002\000\
\004\000\002\000\002\000\002\000\001\000\003\000\003\000\001\000\
\002\000\002\000\003\000\003\000\008\000\008\000\003\000\003\000\
\002\000\002\000\002\000\001\000\001\000\001\000\001\000\003\000\
\001\000\001\000\002\000\003\000\003\000\004\000\004\000\004\000\
\002\000\004\000\003\000\003\000\005\000\005\000\004\000\004\000\
\006\000\006\000\001\000\003\000\003\000\003\000\001\000\003\000\
\001\000\002\000\004\000\003\000\003\000\001\000\005\000\001\000\
\002\000\007\000\001\000\002\000\007\000\006\000\003\000\000\000\
\000\000\002\000\003\000\002\000\003\000\002\000\005\000\005\000\
\004\000\007\000\000\000\001\000\003\000\002\000\001\000\003\000\
\002\000\001\000\000\000\001\000\003\000\002\000\000\000\001\000\
\001\000\002\000\001\000\003\000\001\000\001\000\002\000\003\000\
\004\000\001\000\006\000\005\000\000\000\002\000\004\000\002\000\
\001\000\001\000\002\000\005\000\007\000\008\000\008\000\001\000\
\001\000\001\000\001\000\002\000\002\000\001\000\001\000\002\000\
\003\000\004\000\004\000\005\000\001\000\003\000\006\000\005\000\
\004\000\004\000\001\000\002\000\002\000\003\000\001\000\003\000\
\001\000\003\000\001\000\002\000\001\000\004\000\001\000\006\000\
\004\000\005\000\003\000\001\000\003\000\001\000\003\000\002\000\
\001\000\001\000\002\000\004\000\003\000\002\000\002\000\003\000\
\005\000\003\000\004\000\005\000\004\000\002\000\004\000\006\000\
\004\000\001\000\001\000\003\000\004\000\001\000\003\000\001\000\
\003\000\001\000\001\000\005\000\002\000\001\000\000\000\001\000\
\003\000\001\000\002\000\001\000\003\000\001\000\003\000\001\000\
\003\000\001\000\003\000\001\000\003\000\003\000\002\000\001\000\
\004\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\002\000\002\000\002\000\002\000\002\000\002\000\
\002\000\002\000\002\000\002\000\001\000\001\000\001\000\003\000\
\003\000\002\000\003\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\002\000\001\000\001\000\001\000\001\000\
\003\000\001\000\002\000\002\000\001\000\001\000\001\000\003\000\
\001\000\003\000\001\000\003\000\001\000\003\000\004\000\001\000\
\003\000\001\000\003\000\001\000\003\000\002\000\003\000\003\000\
\003\000\003\000\003\000\003\000\002\000\000\000\001\000\000\000\
\001\000\001\000\001\000\000\000\001\000\000\000\001\000\000\000\
\001\000\000\000\001\000\001\000\002\000\002\000\000\000\001\000\
\000\000\001\000\000\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\
\001\000\001\000\001\000\003\000\004\000\004\000\004\000\000\000\
\002\000\000\000\002\000\000\000\002\000\003\000\004\000\004\000\
\001\000\002\000\002\000\004\000\002\000\002\000\002\000\002\000\
\002\000\002\000\002\000"

let yydefred = "\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\060\002\000\000\000\000\000\000\
\117\002\062\002\000\000\000\000\000\000\000\000\000\000\059\002\
\063\002\064\002\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\165\002\166\002\
\000\000\065\002\000\000\000\000\000\000\167\002\168\002\000\000\
\000\000\061\002\118\002\000\000\000\000\123\002\000\000\237\002\
\000\000\000\000\000\000\000\000\000\000\066\001\050\000\000\000\
\055\000\000\000\057\000\058\000\059\000\000\000\061\000\062\000\
\000\000\000\000\065\000\000\000\067\000\073\000\210\001\119\000\
\000\000\199\000\000\000\000\000\000\000\000\000\000\000\000\000\
\019\001\020\001\112\002\083\001\171\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\238\002\000\000\091\000\000\000\
\098\000\099\000\000\000\000\000\104\000\000\000\090\000\093\000\
\094\000\095\000\096\000\000\000\100\000\000\000\112\000\195\000\
\005\000\000\000\239\002\000\000\000\000\000\000\007\000\000\000\
\013\000\000\000\240\002\000\000\000\000\000\000\010\000\011\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\125\002\009\002\241\002\000\000\026\002\010\002\
\251\001\000\000\000\000\255\001\000\000\000\000\242\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\079\002\000\000\
\000\000\000\000\000\000\134\001\243\002\000\000\000\000\155\001\
\117\001\000\000\000\000\066\002\132\001\133\001\000\000\000\000\
\000\000\000\000\000\000\000\000\078\002\077\002\141\002\000\000\
\052\001\021\001\022\001\000\000\000\000\153\002\000\000\109\002\
\110\002\000\000\111\002\107\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\048\000\000\000\000\000\000\000\000\000\000\000\000\000\102\001\
\000\000\056\001\058\002\000\000\000\000\115\002\000\000\000\000\
\044\001\000\000\171\002\172\002\173\002\174\002\175\002\176\002\
\177\002\178\002\179\002\180\002\181\002\182\002\183\002\184\002\
\185\002\186\002\187\002\188\002\189\002\190\002\191\002\192\002\
\193\002\194\002\195\002\169\002\196\002\197\002\198\002\199\002\
\200\002\201\002\202\002\203\002\204\002\205\002\206\002\207\002\
\208\002\209\002\210\002\211\002\212\002\213\002\170\002\214\002\
\215\002\216\002\217\002\218\002\000\000\000\000\000\000\000\000\
\000\000\000\000\082\002\103\002\102\002\000\000\101\002\000\000\
\104\002\097\002\099\002\085\002\086\002\087\002\088\002\089\002\
\098\002\000\000\000\000\000\000\100\002\106\002\000\000\000\000\
\105\002\000\000\116\002\090\002\096\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\160\002\000\000\
\051\001\052\000\000\000\145\002\000\000\000\000\001\000\000\000\
\000\000\000\000\000\000\053\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\018\001\000\000\000\000\
\084\001\000\000\172\001\000\000\074\000\000\000\120\000\000\000\
\200\000\066\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\067\001\070\001\000\000\000\000\
\000\000\007\001\008\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\085\000\077\000\128\002\000\000\000\000\
\000\000\088\000\000\000\000\000\002\000\103\000\089\000\000\000\
\113\000\000\000\196\000\000\000\003\000\004\000\006\000\009\000\
\014\000\000\000\000\000\000\000\019\000\000\000\018\000\000\000\
\121\002\000\000\035\002\000\000\000\000\162\002\000\000\022\002\
\000\000\056\002\014\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\008\002\132\002\000\000\015\002\
\020\000\252\001\000\000\000\000\000\000\000\000\000\000\000\000\
\011\002\021\000\130\001\000\000\129\001\137\001\138\001\119\002\
\000\000\000\000\000\000\000\000\000\000\000\000\145\001\000\000\
\091\002\000\000\000\000\095\002\000\000\000\000\093\002\084\002\
\000\000\068\002\067\002\069\002\070\002\071\002\073\002\072\002\
\074\002\075\002\076\002\139\001\000\000\000\000\000\000\000\000\
\022\000\131\001\000\000\121\001\122\001\000\000\000\000\000\000\
\000\000\000\000\229\002\000\000\000\000\026\001\000\000\000\000\
\000\000\000\000\108\002\000\000\000\000\000\000\000\000\094\002\
\000\000\092\002\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\213\000\000\000\000\000\000\000\028\000\000\000\
\000\000\000\000\000\000\000\000\068\000\047\000\000\000\000\000\
\000\000\000\000\039\001\038\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\233\002\000\000\
\000\000\000\000\000\000\143\002\000\000\000\000\083\002\000\000\
\024\001\000\000\000\000\023\001\000\000\081\002\080\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\053\001\
\000\000\000\000\148\000\000\000\000\000\000\000\201\001\200\001\
\000\000\188\001\000\000\000\000\000\000\049\000\225\002\000\000\
\000\000\000\000\000\000\000\000\124\002\113\002\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\205\000\000\000\000\000\000\000\000\000\
\000\000\225\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\075\001\073\001\059\001\
\000\000\072\001\068\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\106\000\086\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\139\002\136\002\
\135\002\140\002\000\000\137\002\017\000\000\000\016\000\012\000\
\034\002\000\000\032\002\000\000\037\002\018\002\000\000\000\000\
\000\000\000\000\013\002\000\000\055\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\122\002\126\002\000\000\
\000\000\000\000\050\002\000\000\016\002\000\000\000\000\141\001\
\140\001\000\000\000\000\000\000\000\000\000\000\000\000\148\001\
\000\000\147\001\119\001\118\001\128\001\000\000\124\001\000\000\
\158\001\000\000\000\000\136\001\000\000\230\002\227\002\000\000\
\000\000\000\000\029\001\027\001\025\001\000\000\000\000\000\000\
\203\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\214\001\052\002\000\000\000\000\000\000\212\000\
\000\000\214\000\000\000\215\000\209\000\220\000\000\000\207\000\
\000\000\211\000\000\000\000\000\000\000\229\000\000\000\000\000\
\092\001\000\000\023\000\025\000\026\000\000\000\000\000\027\000\
\000\000\039\000\000\000\038\000\031\000\030\000\034\000\000\000\
\000\000\101\001\000\000\104\001\000\000\000\000\055\001\054\001\
\000\000\048\001\047\001\043\001\042\001\220\002\000\000\000\000\
\231\002\232\002\000\000\000\000\000\000\000\000\000\000\061\001\
\115\001\000\000\116\001\000\000\028\001\223\002\000\000\000\000\
\000\000\000\000\000\000\000\000\071\000\072\000\000\000\017\001\
\016\001\000\000\105\000\000\000\191\001\000\000\000\000\000\000\
\000\000\194\001\190\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\086\001\000\000\000\000\000\000\
\000\000\000\000\087\001\078\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\084\000\083\000\000\000\079\000\078\000\000\000\000\000\000\000\
\237\001\000\000\129\002\000\000\000\000\000\000\000\000\000\000\
\110\000\000\000\000\000\000\000\000\000\000\000\015\000\000\000\
\019\002\038\002\000\000\000\000\000\000\023\002\021\002\000\000\
\000\000\000\000\249\001\054\002\000\000\025\002\000\000\000\000\
\000\000\012\002\000\000\000\000\133\002\000\000\127\002\254\001\
\000\000\120\002\000\000\000\000\164\001\000\000\143\001\142\001\
\146\001\144\001\000\000\000\000\152\001\151\001\000\000\221\002\
\000\000\000\000\000\000\000\000\000\000\127\000\000\000\198\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\212\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\096\001\097\001\000\000\000\000\000\000\000\000\
\000\000\000\000\046\000\000\000\000\000\040\000\000\000\035\000\
\033\000\000\000\000\000\000\000\000\000\085\001\000\000\063\001\
\000\000\000\000\000\000\075\000\000\000\118\000\000\000\000\000\
\145\000\000\000\000\000\000\000\000\000\000\000\000\000\156\000\
\149\000\233\000\000\000\000\000\189\001\000\000\176\001\000\000\
\193\001\000\000\222\002\041\001\040\001\000\000\000\000\000\000\
\000\000\031\001\030\001\081\001\000\000\000\000\089\001\000\000\
\090\001\000\000\000\000\176\001\076\000\000\000\000\000\000\000\
\037\001\035\001\000\000\033\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\196\001\000\000\000\000\
\111\000\109\000\000\000\000\000\167\001\000\000\000\000\033\002\
\040\002\000\000\020\002\042\002\000\000\000\000\000\000\000\000\
\057\002\000\000\000\000\028\002\000\000\017\002\000\000\051\002\
\164\002\163\001\000\000\000\000\150\001\149\001\036\001\034\001\
\032\001\000\000\204\001\202\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\174\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\135\000\000\000\
\000\000\000\000\137\000\121\000\125\000\000\000\215\001\053\002\
\211\001\000\000\000\000\147\002\146\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\210\000\000\000\094\001\000\000\
\093\001\000\000\000\000\044\000\000\000\045\000\000\000\037\000\
\036\000\000\000\236\002\000\000\000\000\000\000\062\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\155\000\000\000\192\001\000\000\
\182\001\000\000\000\000\000\000\000\000\000\000\000\000\205\001\
\206\001\000\000\000\000\149\002\000\000\239\000\058\001\057\001\
\050\001\049\001\046\001\045\001\000\000\000\000\000\000\000\000\
\000\000\088\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\238\001\114\000\000\000\000\000\115\000\000\000\000\000\036\002\
\024\002\043\002\250\001\246\001\000\000\000\000\000\000\000\000\
\154\001\153\001\000\000\130\002\178\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\182\000\000\000\000\000\
\000\000\177\000\000\000\000\000\000\000\000\000\131\000\000\000\
\000\000\000\000\000\000\134\000\000\000\169\001\170\001\000\000\
\230\000\000\000\217\000\208\000\206\000\000\000\000\000\000\000\
\000\000\024\000\000\000\041\000\043\000\226\000\227\000\000\000\
\146\000\000\000\153\000\000\000\154\000\000\000\000\000\000\000\
\152\000\151\002\000\000\000\000\000\000\151\000\000\000\000\000\
\000\000\000\000\000\000\207\001\000\000\000\000\173\001\000\000\
\000\000\000\000\224\001\225\001\226\001\227\001\065\001\000\000\
\077\001\000\000\000\000\000\000\082\001\174\001\122\000\000\000\
\000\000\000\000\000\000\197\000\000\000\000\000\197\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\230\001\231\001\
\000\000\041\002\000\000\031\002\000\000\201\000\000\000\000\000\
\000\000\000\000\000\000\176\000\175\000\000\000\000\000\000\000\
\000\000\172\000\047\002\000\000\000\000\129\000\000\000\143\000\
\000\000\142\000\139\000\138\000\000\000\000\000\098\001\095\001\
\000\000\242\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\185\001\000\000\000\000\000\000\
\217\001\000\000\208\001\000\000\175\001\000\000\000\000\000\000\
\222\001\228\001\229\001\064\001\000\000\000\000\091\001\202\000\
\240\001\244\001\176\001\108\000\000\000\223\001\232\001\198\000\
\000\000\126\001\125\001\131\002\173\000\000\000\180\000\000\000\
\000\000\000\000\000\000\000\000\189\000\183\000\170\000\000\000\
\000\000\136\000\000\000\000\000\042\000\157\000\150\000\000\000\
\000\000\000\000\165\000\000\000\000\000\000\000\000\000\209\001\
\000\000\000\000\000\000\183\001\219\001\000\000\000\000\000\000\
\000\000\233\001\000\000\079\001\000\000\171\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\188\000\
\000\000\141\000\140\000\240\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\161\000\000\000\000\000\000\000\
\000\000\000\000\234\001\235\001\080\001\187\000\184\000\157\002\
\158\002\000\000\000\000\000\000\000\000\185\000\169\000\163\000\
\164\000\000\000\000\000\000\000\000\000\162\000\186\001\000\000\
\236\001\000\000\000\000\000\000\000\000\000\000\166\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\186\000\000\000\
\000\000\000\000\221\001\167\000"

let yydgoto = "\008\000\
\056\000\101\000\123\000\131\000\149\000\159\000\173\000\055\002\
\102\000\124\000\132\000\058\000\081\001\127\000\059\000\135\000\
\136\000\193\001\233\001\078\002\022\003\147\001\032\002\215\000\
\060\000\061\000\191\002\110\001\062\000\063\000\161\000\065\000\
\066\000\067\000\068\000\069\000\070\000\071\000\072\000\073\000\
\074\000\075\000\076\000\077\000\079\002\078\000\117\001\149\001\
\120\003\110\000\111\000\112\000\079\000\114\000\115\000\116\000\
\117\000\118\000\072\001\162\002\119\000\161\001\066\003\150\001\
\080\000\119\001\199\000\010\002\187\003\089\004\076\004\013\003\
\239\002\223\004\090\004\131\001\194\001\091\004\082\002\083\002\
\074\003\241\003\085\005\140\004\137\004\133\004\081\000\095\005\
\098\003\185\005\150\004\099\003\167\004\077\004\078\004\079\004\
\213\004\214\004\062\005\134\005\175\005\171\005\101\005\120\000\
\163\001\082\000\121\001\199\003\106\004\200\003\198\003\005\003\
\177\000\083\000\034\001\183\001\016\003\014\003\084\000\085\000\
\086\000\102\004\087\000\088\000\222\000\089\000\090\000\223\000\
\232\000\048\002\229\000\133\001\134\001\143\002\127\002\091\000\
\100\003\186\005\182\000\092\000\113\001\061\002\017\003\224\000\
\225\000\183\000\184\000\152\000\219\001\222\001\220\001\099\004\
\093\000\115\001\077\001\089\002\247\003\155\004\151\004\096\005\
\090\002\078\003\091\002\083\003\029\004\241\002\184\003\152\004\
\153\004\154\004\015\002\003\002\244\002\080\004\097\005\098\005\
\146\003\018\005\046\005\019\005\020\005\021\005\022\005\121\003\
\042\005\153\000\154\000\155\000\156\000\157\000\158\000\189\001\
\177\002\178\002\179\002\045\004\052\004\053\004\139\003\042\004\
\247\002\190\001\063\001\029\001\030\001\056\002\082\001"

let yysindex = "\020\008\
\217\062\157\006\112\044\005\044\107\015\144\064\150\068\000\000\
\132\004\108\002\087\070\132\004\000\000\202\001\101\000\017\001\
\000\000\000\000\132\004\132\004\132\004\132\004\025\003\000\000\
\000\000\000\000\132\004\150\070\082\255\049\063\139\063\219\058\
\219\058\029\005\000\000\184\055\219\058\132\004\000\000\000\000\
\232\004\000\000\132\004\132\004\142\255\000\000\000\000\087\070\
\217\062\000\000\000\000\132\004\185\255\000\000\132\004\000\000\
\040\001\047\000\155\011\024\000\217\071\000\000\000\000\246\002\
\000\000\056\000\000\000\000\000\000\000\222\001\000\000\000\000\
\034\002\055\002\000\000\047\000\000\000\000\000\000\000\000\000\
\048\002\000\000\217\069\155\000\087\070\087\070\144\064\144\064\
\000\000\000\000\000\000\000\000\000\000\202\001\101\000\024\004\
\066\005\157\006\185\255\017\001\000\000\136\003\000\000\056\000\
\000\000\000\000\055\002\047\000\000\000\157\006\000\000\000\000\
\000\000\000\000\000\000\135\002\000\000\158\002\000\000\000\000\
\000\000\108\002\000\000\060\002\096\002\047\000\000\000\227\002\
\000\000\228\044\000\000\082\004\047\000\082\004\000\000\000\000\
\011\009\213\002\172\255\135\004\010\003\133\073\107\015\140\003\
\108\002\243\002\000\000\000\000\000\000\076\000\000\000\000\000\
\000\000\212\001\019\000\000\000\144\003\182\002\000\000\043\005\
\246\002\150\068\150\069\024\003\135\067\205\067\000\000\144\059\
\102\003\183\003\028\003\000\000\000\000\074\000\036\004\000\000\
\000\000\150\068\150\068\000\000\000\000\000\000\085\004\152\004\
\219\058\219\058\083\004\087\070\000\000\000\000\000\000\040\056\
\000\000\000\000\000\000\226\063\207\003\000\000\126\004\000\000\
\000\000\088\004\000\000\000\000\079\002\152\071\189\004\150\068\
\199\066\213\002\144\064\149\004\111\002\217\062\091\005\036\004\
\000\000\087\070\000\000\217\004\014\001\229\004\145\255\000\000\
\147\004\000\000\000\000\234\004\161\004\000\000\149\072\190\004\
\000\000\190\004\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\016\005\128\062\128\062\132\004\
\142\255\213\004\000\000\000\000\000\000\087\070\000\000\225\004\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\179\000\000\000\000\000\000\000\000\000\
\000\000\087\070\000\000\000\000\000\000\041\000\118\255\128\062\
\144\064\204\004\108\002\193\002\243\002\008\005\000\000\226\004\
\000\000\000\000\144\064\000\000\185\004\144\064\000\000\219\058\
\155\011\047\000\132\004\000\000\087\005\009\006\144\064\144\064\
\144\064\144\064\144\064\144\064\144\064\144\064\144\064\144\064\
\144\064\144\064\144\064\144\064\144\064\144\064\144\064\144\064\
\144\064\144\064\144\064\144\064\144\064\000\000\150\068\144\064\
\000\000\185\004\000\000\250\004\000\000\207\003\000\000\207\003\
\000\000\000\000\144\064\031\004\087\070\087\070\054\005\059\005\
\087\070\054\005\024\070\098\001\000\000\000\000\144\064\098\001\
\098\001\000\000\000\000\126\004\152\001\149\004\024\004\002\005\
\157\006\000\000\059\002\000\000\000\000\000\000\173\002\027\005\
\074\003\000\000\185\004\128\005\000\000\000\000\000\000\051\005\
\000\000\207\003\000\000\066\006\000\000\000\000\000\000\000\000\
\000\000\082\004\047\000\082\004\000\000\082\004\000\000\073\012\
\000\000\025\004\000\000\077\005\165\005\000\000\073\012\000\000\
\073\012\000\000\000\000\171\005\151\005\093\005\107\015\059\003\
\083\004\029\001\123\005\186\005\000\000\000\000\182\005\000\000\
\000\000\000\000\061\003\096\005\120\005\107\015\095\007\243\002\
\000\000\000\000\000\000\084\061\000\000\000\000\000\000\000\000\
\191\005\187\005\064\000\122\005\249\003\125\005\000\000\125\005\
\000\000\134\005\102\003\000\000\135\255\183\003\000\000\000\000\
\129\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\044\002\148\061\212\061\020\062\
\000\000\000\000\139\005\000\000\000\000\150\068\192\002\128\062\
\083\004\083\004\000\000\098\001\208\004\000\000\245\002\126\004\
\042\004\173\005\000\000\003\039\116\001\003\039\083\004\000\000\
\236\005\000\000\107\015\043\003\150\069\001\060\100\002\068\005\
\100\005\071\066\000\000\150\068\149\005\014\005\000\000\011\001\
\144\064\139\001\167\003\214\003\000\000\000\000\098\001\124\006\
\024\003\144\064\000\000\000\000\024\003\144\064\059\005\199\003\
\144\064\187\255\122\255\219\058\107\015\150\068\000\000\164\005\
\166\005\148\005\132\004\000\000\150\068\195\005\000\000\118\001\
\000\000\152\011\214\012\000\000\170\005\000\000\000\000\168\005\
\150\005\193\002\241\005\024\004\025\003\193\002\047\000\000\000\
\150\068\053\004\000\000\108\003\156\005\042\004\000\000\000\000\
\098\003\000\000\239\000\254\005\128\062\000\000\000\000\150\070\
\059\005\144\064\144\064\152\056\000\000\000\000\134\073\134\073\
\081\073\026\007\149\072\081\073\143\012\143\012\143\012\143\012\
\165\002\229\005\229\005\143\012\165\002\165\002\081\073\229\005\
\165\002\165\002\165\002\000\000\229\005\015\005\047\000\062\065\
\006\006\000\000\213\005\193\002\126\004\126\004\149\072\144\064\
\144\064\144\064\217\005\098\001\098\001\000\000\000\000\000\000\
\001\006\000\000\000\000\081\073\221\005\019\005\143\255\201\005\
\072\004\254\003\000\000\000\000\109\003\020\006\024\004\226\004\
\216\002\047\000\098\003\107\015\024\006\126\004\000\000\000\000\
\000\000\000\000\017\006\000\000\000\000\082\004\000\000\000\000\
\000\000\218\000\000\000\041\006\000\000\000\000\073\012\191\000\
\025\001\029\016\000\000\236\001\000\000\226\005\218\005\196\005\
\107\015\047\003\107\015\107\015\117\003\000\000\000\000\187\001\
\108\002\242\005\000\000\215\005\000\000\129\003\150\068\000\000\
\000\000\032\003\150\068\032\000\063\003\004\006\034\001\000\000\
\156\013\000\000\000\000\000\000\000\000\170\002\000\000\052\006\
\000\000\096\255\096\255\000\000\233\005\000\000\000\000\144\064\
\144\064\144\064\000\000\000\000\000\000\007\006\187\000\240\005\
\000\000\196\065\133\073\003\006\000\000\182\002\232\005\244\005\
\239\005\083\004\000\000\000\000\047\000\194\001\144\064\000\000\
\015\006\000\000\150\068\000\000\000\000\000\000\023\006\000\000\
\023\006\000\000\114\060\144\064\071\066\000\000\029\000\081\006\
\000\000\144\064\000\000\000\000\000\000\076\006\025\003\000\000\
\105\071\000\000\024\004\000\000\000\000\000\000\000\000\253\000\
\000\000\000\000\149\072\000\000\149\072\065\006\000\000\000\000\
\149\072\000\000\000\000\000\000\000\000\000\000\083\004\121\255\
\000\000\000\000\193\002\226\004\047\000\144\064\148\255\000\000\
\000\000\016\002\000\000\083\004\000\000\000\000\213\002\047\000\
\024\004\047\000\043\001\112\005\000\000\000\000\053\002\000\000\
\000\000\043\002\000\000\131\005\000\000\056\001\067\006\005\006\
\108\002\000\000\000\000\144\064\011\006\083\000\161\004\190\004\
\190\004\179\000\166\255\144\064\000\000\036\011\144\064\227\060\
\129\065\068\006\000\000\000\000\107\015\067\006\047\000\033\006\
\036\006\249\071\003\005\069\000\174\255\144\064\089\006\024\004\
\000\000\000\000\025\003\000\000\000\000\252\005\194\004\105\006\
\000\000\000\000\000\000\024\004\036\002\108\003\118\002\099\006\
\000\000\026\006\115\005\024\004\056\006\226\255\000\000\073\012\
\000\000\000\000\107\015\064\001\116\006\000\000\000\000\108\002\
\043\000\083\004\000\000\000\000\107\015\000\000\014\006\083\004\
\243\002\000\000\242\005\053\006\000\000\019\006\000\000\000\000\
\095\007\000\000\249\003\038\006\000\000\249\003\000\000\000\000\
\000\000\000\000\150\068\059\003\000\000\000\000\205\255\000\000\
\055\072\182\000\217\255\106\006\042\004\000\000\108\002\000\000\
\097\010\156\004\047\000\196\065\094\001\141\046\003\039\047\000\
\000\000\037\006\007\000\040\006\203\003\114\006\114\006\128\006\
\047\006\079\006\000\000\000\000\144\064\144\064\150\068\087\072\
\024\004\112\005\000\000\156\255\157\255\000\000\160\255\000\000\
\000\000\144\064\144\064\108\006\024\005\000\000\181\072\000\000\
\049\006\107\015\150\068\000\000\036\002\000\000\025\003\107\015\
\000\000\107\015\142\255\144\064\142\255\117\255\047\000\000\000\
\000\000\000\000\150\068\042\004\000\000\227\070\000\000\060\006\
\000\000\130\006\000\000\000\000\000\000\051\004\235\000\062\005\
\085\002\000\000\000\000\000\000\090\006\084\001\000\000\100\006\
\000\000\144\064\163\002\000\000\000\000\196\065\129\006\103\006\
\000\000\000\000\104\006\000\000\109\006\149\072\097\010\036\002\
\112\005\152\006\144\000\042\004\150\003\000\000\254\003\059\002\
\000\000\000\000\024\004\060\006\000\000\059\002\159\006\000\000\
\000\000\046\002\000\000\000\000\065\001\000\000\107\015\108\002\
\000\000\242\005\024\003\000\000\172\006\000\000\107\015\000\000\
\000\000\000\000\037\004\090\000\000\000\000\000\000\000\000\000\
\000\000\012\003\000\000\000\000\114\014\168\006\133\073\118\006\
\141\046\122\006\000\000\161\006\083\004\120\006\000\000\093\006\
\042\003\182\002\007\067\107\015\156\004\008\005\000\000\080\004\
\083\004\024\070\000\000\000\000\000\000\047\003\000\000\000\000\
\000\000\037\006\047\000\000\000\000\000\144\064\071\066\107\015\
\144\064\096\006\101\006\107\015\000\000\107\006\000\000\125\006\
\000\000\144\064\037\255\000\000\079\255\000\000\110\006\000\000\
\000\000\149\072\000\000\144\064\144\064\144\064\000\000\083\004\
\081\006\112\005\059\255\255\002\047\000\156\004\047\000\000\003\
\047\000\133\006\135\006\047\000\000\000\081\006\000\000\101\000\
\000\000\219\048\034\071\000\000\111\003\142\006\192\006\000\000\
\000\000\152\001\001\002\000\000\037\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\169\255\090\006\179\006\107\015\
\119\006\000\000\144\064\001\002\047\000\012\003\144\064\144\064\
\144\064\047\000\096\005\096\005\149\001\000\000\189\006\187\006\
\000\000\000\000\222\002\121\001\000\000\097\010\107\015\000\000\
\000\000\000\000\000\000\000\000\193\006\014\006\242\005\020\062\
\000\000\000\000\107\015\000\000\000\000\115\005\153\003\087\001\
\144\003\141\046\159\001\107\015\137\004\000\000\145\006\207\006\
\156\004\000\000\097\010\003\039\179\003\135\066\000\000\097\001\
\223\255\144\004\156\004\000\000\024\070\000\000\000\000\202\006\
\000\000\083\004\000\000\000\000\000\000\083\004\071\066\144\064\
\149\072\000\000\059\003\000\000\000\000\000\000\000\000\019\073\
\000\000\107\015\000\000\195\001\000\000\113\006\060\006\059\005\
\000\000\000\000\059\005\123\006\059\005\000\000\152\001\083\004\
\192\006\192\001\133\006\000\000\083\004\107\015\000\000\101\000\
\094\002\032\002\000\000\000\000\000\000\000\000\000\000\132\006\
\000\000\107\015\146\003\129\065\000\000\000\000\000\000\115\005\
\149\072\149\072\149\072\000\000\240\003\240\003\000\000\107\015\
\134\006\107\015\118\002\101\000\152\001\071\002\000\000\000\000\
\047\000\000\000\107\015\000\000\031\001\000\000\206\003\208\003\
\156\006\047\003\087\000\000\000\000\000\109\001\097\010\141\046\
\083\004\000\000\000\000\000\000\156\004\000\000\243\002\000\000\
\097\010\000\000\000\000\000\000\083\004\144\064\000\000\000\000\
\138\006\000\000\083\004\171\006\047\000\059\005\059\005\007\066\
\226\006\059\005\012\005\083\004\000\000\207\000\059\005\148\006\
\000\000\133\006\000\000\221\003\000\000\127\002\116\001\083\004\
\000\000\000\000\000\000\000\000\229\003\144\064\000\000\000\000\
\000\000\000\000\000\000\000\000\152\001\000\000\000\000\000\000\
\083\004\000\000\000\000\000\000\000\000\097\010\000\000\107\015\
\012\003\058\004\186\002\047\000\000\000\000\000\000\000\178\006\
\083\004\000\000\108\000\236\006\000\000\000\000\000\000\244\006\
\245\006\189\070\000\000\107\015\248\006\144\064\239\006\000\000\
\133\006\192\006\249\006\000\000\000\000\107\015\116\001\083\004\
\083\004\000\000\144\064\000\000\250\006\000\000\047\000\115\005\
\170\006\181\006\059\005\207\003\133\006\015\007\047\000\000\000\
\097\010\000\000\000\000\000\000\029\016\029\016\090\006\083\004\
\006\007\172\001\083\004\107\015\000\000\144\064\197\006\029\016\
\083\004\083\004\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\021\007\059\005\059\005\107\015\000\000\000\000\000\000\
\000\000\017\007\144\064\107\015\083\004\000\000\000\000\083\004\
\000\000\029\016\028\007\030\007\083\004\107\015\000\000\083\004\
\205\006\047\000\107\015\107\015\004\004\083\004\000\000\083\004\
\083\004\144\064\000\000\000\000"

let yyrindex = "\000\000\
\047\008\048\008\208\006\000\000\000\000\000\000\000\000\000\000\
\213\070\000\000\000\000\057\064\000\000\115\003\000\000\000\000\
\000\000\000\000\214\068\071\067\016\068\231\064\000\000\000\000\
\000\000\000\000\213\070\000\000\000\000\000\000\000\000\000\000\
\000\000\080\068\234\016\000\000\000\000\231\064\000\000\000\000\
\000\000\000\000\247\003\237\001\194\006\000\000\000\000\000\000\
\071\000\000\000\000\000\231\064\212\003\000\000\231\064\000\000\
\000\000\226\009\071\000\102\017\154\038\000\000\000\000\064\054\
\000\000\103\054\000\000\000\000\000\000\147\054\000\000\000\000\
\192\054\214\054\000\000\223\054\000\000\000\000\000\000\000\000\
\000\000\000\000\251\022\115\023\014\022\132\022\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\115\003\000\000\000\000\
\000\000\110\000\212\003\000\000\000\000\000\000\000\000\121\014\
\000\000\000\000\063\049\181\049\000\000\110\000\000\000\000\000\
\000\000\000\000\000\000\240\050\000\000\089\051\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\209\006\000\000\208\006\
\000\000\000\000\000\000\000\000\127\004\000\000\000\000\000\000\
\000\000\060\013\060\013\000\000\010\039\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\037\015\000\000\237\039\082\040\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\086\045\000\000\
\000\000\164\002\032\006\000\000\000\000\000\000\149\006\200\045\
\000\000\000\000\003\057\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\115\003\000\000\252\006\000\000\
\000\000\000\000\000\000\000\000\248\052\000\000\000\000\000\000\
\000\000\022\069\000\000\000\000\000\000\197\004\223\054\243\005\
\000\000\000\000\096\001\155\004\000\000\201\255\000\000\000\000\
\091\000\000\000\000\000\000\000\130\004\000\000\094\000\254\000\
\000\000\092\005\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\067\055\215\006\215\006\199\006\
\034\004\086\069\000\000\000\000\000\000\151\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\117\057\205\057\000\000\000\000\000\000\037\058\125\058\
\000\000\153\000\000\000\000\000\000\000\000\000\000\000\215\006\
\000\000\000\000\000\000\000\000\000\000\091\006\000\000\000\000\
\000\000\000\000\000\000\000\000\248\002\000\000\000\000\000\000\
\071\000\247\047\080\068\000\000\064\054\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\202\031\000\000\000\000\000\000\000\000\
\000\000\050\003\000\000\000\000\000\000\115\003\000\000\115\003\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\224\017\169\020\000\000\000\000\000\000\233\023\
\095\024\000\000\000\000\252\006\138\010\000\000\000\000\000\000\
\214\004\202\007\181\049\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\248\002\000\000\000\000\000\000\000\000\000\000\
\000\000\115\003\000\000\111\007\000\000\000\000\000\000\000\000\
\000\000\000\000\127\004\000\000\000\000\000\000\000\000\000\000\
\000\000\071\001\000\000\048\007\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\027\007\000\000\000\000\
\144\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\202\255\000\000\150\000\168\000\254\000\000\000\092\005\
\000\000\000\000\201\000\000\000\000\000\202\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\215\006\
\003\057\149\043\000\000\215\024\000\000\000\000\000\000\252\006\
\228\006\000\000\000\000\000\000\000\000\000\000\172\011\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\077\025\000\000\
\000\000\000\000\000\000\000\000\015\001\000\000\169\004\000\000\
\161\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\199\006\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\019\039\000\000\000\000\000\000\223\054\000\000\
\000\000\000\000\000\000\122\052\000\000\047\004\000\000\000\000\
\000\000\000\000\000\000\000\000\215\006\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\133\034\244\034\
\080\009\127\005\207\015\094\035\064\032\183\032\046\033\164\033\
\002\029\195\025\058\026\027\034\120\029\239\029\200\035\176\026\
\102\030\220\030\083\031\000\000\039\027\000\000\070\053\175\004\
\105\005\000\000\000\000\000\000\252\006\252\006\090\016\000\000\
\000\000\000\000\087\018\033\021\152\021\000\000\000\000\000\000\
\206\018\000\000\000\000\050\036\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\181\049\000\000\000\000\000\000\252\006\000\000\000\000\
\000\000\000\000\017\012\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\003\054\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\029\007\000\000\000\000\000\000\153\255\
\000\000\183\040\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\131\041\000\000\030\041\000\000\000\000\000\000\000\000\
\000\000\028\001\161\255\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\019\004\000\000\009\010\
\000\000\198\003\043\008\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\046\048\122\048\000\000\000\000\
\000\000\203\053\000\000\000\000\122\052\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\158\027\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\111\001\000\000\219\255\000\000\169\000\000\000\000\000\000\000\
\170\000\000\000\000\000\000\000\000\000\000\000\224\006\229\006\
\000\000\000\000\000\000\000\000\070\053\000\000\000\000\000\000\
\000\000\053\001\000\000\185\001\000\000\000\000\022\069\014\054\
\000\000\122\052\000\000\144\052\000\000\000\000\000\000\000\000\
\000\000\219\004\000\000\022\069\000\000\000\000\205\049\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\130\004\254\000\
\092\005\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\118\050\014\054\000\000\
\000\000\000\000\243\072\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\161\002\128\003\
\000\000\243\010\000\000\000\000\068\013\181\049\000\000\000\000\
\000\000\000\000\181\049\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\027\002\000\000\000\000\000\000\000\000\000\000\153\001\
\000\000\000\000\232\041\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\005\000\044\001\000\000\246\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\228\006\000\000\000\000\000\000\
\000\000\000\000\014\054\000\000\000\000\000\000\000\000\223\054\
\000\000\000\000\000\000\000\000\199\001\234\006\234\006\215\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\125\039\
\000\000\247\006\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\224\051\000\000\000\000\000\000\
\000\000\000\000\245\004\000\000\044\255\231\004\058\008\000\000\
\000\000\000\000\000\000\047\004\000\000\024\007\000\000\008\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\068\019\
\000\000\000\000\188\019\000\000\051\020\151\036\000\000\255\049\
\033\043\114\004\000\000\228\006\000\000\000\000\000\000\233\013\
\000\000\000\000\000\000\008\002\000\000\233\013\000\000\000\000\
\000\000\071\001\000\000\000\000\000\000\065\059\000\000\000\000\
\000\000\079\042\000\000\000\000\172\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\069\047\000\000\216\005\
\000\000\000\000\128\047\000\000\192\008\000\000\000\000\001\007\
\000\000\139\048\000\000\000\000\000\000\091\006\000\000\000\000\
\092\053\020\046\000\000\000\000\000\000\231\048\000\000\000\000\
\000\000\018\052\122\052\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\181\000\000\000\000\000\000\000\000\000\000\000\219\001\
\020\028\189\052\000\000\000\000\058\008\000\000\058\008\014\007\
\058\008\018\007\018\007\058\008\000\000\139\028\000\000\000\000\
\000\000\000\000\032\007\157\046\177\050\000\000\236\050\000\000\
\000\000\131\049\077\052\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\058\007\000\000\000\000\
\000\000\000\000\000\000\077\052\014\054\000\000\000\000\000\000\
\000\000\233\013\000\000\000\000\000\000\052\005\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\180\042\000\000\
\000\000\000\000\000\000\000\000\000\000\077\052\000\000\000\000\
\013\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\079\046\000\000\000\000\000\000\
\000\000\242\001\000\000\000\000\000\000\009\002\000\000\000\000\
\252\036\000\000\000\000\000\000\000\000\000\000\000\000\086\001\
\000\000\000\000\000\000\054\002\000\000\019\007\014\007\000\000\
\000\000\000\000\000\000\037\007\000\000\000\000\131\049\039\051\
\106\051\243\001\018\007\000\000\058\050\000\000\000\000\000\000\
\239\052\223\054\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\077\052\
\102\037\203\037\048\038\000\000\080\012\221\012\000\000\000\000\
\038\065\000\000\000\000\000\000\068\007\181\049\000\000\000\000\
\233\013\000\000\000\000\000\000\250\003\000\000\000\000\000\000\
\000\000\053\049\000\000\000\000\000\000\227\004\000\000\000\000\
\114\053\000\000\000\000\187\047\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\216\046\000\000\000\000\000\000\
\000\000\000\000\009\005\000\000\058\008\000\000\000\000\000\000\
\000\000\000\000\000\000\058\050\000\000\000\000\000\000\000\000\
\000\000\069\002\000\000\000\000\000\000\239\052\000\000\215\051\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\068\007\000\000\000\000\000\000\
\190\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\038\007\000\000\227\009\000\000\000\000\000\000\000\000\
\019\047\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\018\007\165\051\000\000\000\000\000\000\000\000\000\000\215\051\
\193\053\000\000\000\000\000\000\044\014\000\000\227\009\227\009\
\045\007\050\007\000\000\056\007\018\007\000\000\227\009\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\048\003\
\000\000\000\000\047\005\000\000\000\000\000\000\000\000\000\000\
\239\042\193\053\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\180\005\000\000\000\000\155\002\
\000\000\000\000\000\000\000\000\184\005\000\000\000\000\105\004\
\255\006\227\009\000\000\000\000\000\000\159\004\000\000\225\006\
\211\008\000\000\000\000\000\000"

let yygindex = "\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\092\000\
\243\255\000\000\086\000\253\255\232\006\255\007\062\000\000\000\
\204\255\135\000\063\000\091\255\000\000\148\254\000\007\071\255\
\210\007\163\014\243\252\017\000\022\004\014\000\049\000\052\000\
\066\000\000\000\000\000\000\000\000\000\075\000\088\000\000\000\
\097\000\000\000\002\000\004\000\094\254\000\000\000\000\083\254\
\000\000\000\000\000\000\000\000\099\000\000\000\000\000\000\000\
\000\000\000\000\238\254\160\252\000\000\000\000\000\000\006\000\
\000\000\000\000\164\255\207\254\136\254\018\252\114\252\072\255\
\103\004\168\003\000\000\048\004\056\253\115\255\055\004\000\000\
\000\000\000\000\000\000\000\000\000\000\016\003\247\255\204\251\
\201\254\036\254\129\252\057\003\139\251\029\252\010\252\090\003\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\140\005\205\004\168\004\000\000\000\000\
\103\255\030\000\231\000\140\255\005\002\009\253\093\255\190\008\
\049\011\000\000\000\000\000\000\106\255\251\006\142\012\062\006\
\001\000\086\255\073\006\134\254\000\000\034\007\112\006\214\011\
\189\252\088\253\212\254\000\000\000\000\000\000\220\004\076\004\
\000\000\000\000\166\006\119\255\220\005\010\008\000\000\079\004\
\000\000\000\000\080\008\073\002\080\005\045\252\184\251\244\252\
\210\253\000\000\015\254\000\000\000\000\234\255\000\000\000\000\
\235\251\249\255\240\251\105\254\254\253\034\254\000\000\000\000\
\247\002\000\000\000\000\252\003\160\251\000\000\170\003\154\004\
\000\000\115\253\003\012\126\255\000\000\009\000\067\254\010\006\
\136\255\215\254\130\255\000\000\253\003\000\000\000\000\000\000\
\238\006\000\000\000\000\000\000\026\000\053\255\000\000"

let yytablesize = 19189
let yytable = "\126\000\
\133\000\140\001\160\000\108\000\200\001\109\000\069\002\205\000\
\147\002\213\001\181\001\251\002\195\001\218\001\059\002\191\000\
\180\001\145\003\192\002\228\000\209\001\204\003\185\001\240\002\
\026\002\187\000\181\002\034\002\187\000\009\004\034\004\234\000\
\062\001\244\001\151\002\187\000\187\000\187\000\187\000\077\003\
\193\000\225\003\189\003\187\000\147\003\245\002\031\002\252\002\
\025\005\064\000\187\000\064\000\064\000\103\000\187\000\027\002\
\172\004\221\000\031\001\187\000\187\000\050\002\064\001\051\002\
\128\000\134\000\129\002\104\000\187\000\174\000\051\000\187\000\
\084\001\249\001\009\005\201\001\105\000\073\001\246\002\173\001\
\246\002\175\001\215\004\057\002\154\001\003\005\005\005\141\001\
\125\000\106\000\149\002\048\005\057\000\028\002\206\004\243\004\
\159\001\064\000\107\000\108\000\113\000\109\000\225\004\185\000\
\008\002\230\002\231\002\085\001\159\002\087\000\247\001\108\000\
\132\001\109\000\136\001\137\001\072\002\070\002\226\000\253\002\
\157\004\044\003\064\002\071\001\245\001\185\000\171\001\164\001\
\246\001\012\005\188\001\045\003\242\004\159\002\063\002\247\001\
\178\004\013\005\248\001\150\000\074\001\184\002\113\003\185\002\
\043\002\179\001\227\000\224\003\071\001\103\000\197\001\252\004\
\027\002\154\002\249\004\116\004\118\004\159\002\060\004\120\004\
\164\002\103\000\185\000\104\000\188\004\002\004\202\001\064\003\
\023\005\027\002\164\002\069\003\105\000\020\004\244\004\104\000\
\085\001\106\005\064\000\182\001\085\001\006\004\085\001\080\002\
\105\000\106\000\042\003\185\000\062\001\128\000\250\001\172\001\
\007\002\134\000\107\000\134\000\113\000\106\000\117\004\119\004\
\107\001\166\001\032\005\002\002\061\004\119\005\107\000\029\002\
\113\000\185\000\000\002\001\002\189\000\071\002\238\002\170\001\
\020\004\004\002\106\001\057\005\189\000\189\000\072\005\067\003\
\211\001\103\003\185\000\221\001\221\001\139\002\138\004\038\002\
\031\002\189\000\065\005\219\003\073\005\044\002\114\003\188\000\
\252\001\253\001\196\000\012\005\077\005\215\002\092\005\039\002\
\027\002\208\000\209\000\210\000\211\000\041\004\164\002\121\004\
\104\005\218\000\146\001\154\002\165\001\003\004\064\000\076\001\
\000\005\184\001\146\001\146\001\065\001\021\004\020\002\185\000\
\129\002\069\001\070\001\189\002\154\002\154\005\205\001\146\001\
\043\003\133\002\075\001\134\002\104\005\078\001\100\004\167\003\
\245\001\185\000\167\000\206\000\246\001\107\001\166\001\079\001\
\065\002\107\001\166\001\247\001\062\004\086\001\248\001\049\005\
\187\000\035\002\125\003\212\002\229\002\213\002\066\002\106\001\
\065\004\067\002\114\001\106\001\190\002\073\002\074\005\208\002\
\047\004\210\005\205\002\193\000\018\004\166\002\051\000\085\002\
\075\002\136\005\092\002\202\002\066\005\245\001\064\000\064\000\
\101\002\246\001\252\003\104\003\105\003\160\005\137\005\073\001\
\247\001\201\004\103\001\248\001\206\001\110\001\094\002\185\000\
\051\000\165\001\192\003\187\000\160\005\165\001\205\003\110\001\
\124\002\093\002\032\003\178\005\130\002\087\000\235\002\233\004\
\064\000\101\004\080\001\200\000\133\003\173\002\144\002\175\002\
\204\005\176\002\024\003\000\003\208\004\168\003\211\004\087\005\
\027\002\085\001\201\000\153\002\012\005\240\002\048\004\087\000\
\068\002\192\002\094\005\224\004\185\000\140\003\185\000\206\003\
\220\003\085\003\108\000\068\003\109\000\161\001\091\002\024\005\
\084\002\185\000\140\002\141\002\209\002\168\005\145\002\165\005\
\132\001\195\004\019\004\156\002\051\000\251\001\202\000\159\001\
\108\001\111\001\180\004\030\002\135\001\126\002\215\003\253\003\
\135\005\159\001\063\002\111\001\109\001\018\004\127\005\103\001\
\179\001\202\004\139\005\110\001\030\002\029\002\110\001\179\001\
\029\002\179\001\002\002\240\002\103\000\143\004\136\003\097\003\
\094\002\092\002\116\005\179\005\181\003\108\001\029\002\080\003\
\203\000\202\001\104\000\204\000\229\003\212\000\144\004\203\002\
\111\005\109\001\085\001\105\000\085\001\200\000\085\001\095\004\
\096\004\136\003\141\003\250\001\107\003\081\005\027\002\134\000\
\106\000\134\000\161\004\134\000\201\000\250\001\032\000\166\005\
\024\003\107\000\161\001\113\000\213\000\160\001\091\002\079\005\
\084\002\250\001\049\004\082\004\216\003\163\002\192\002\160\001\
\082\004\246\002\208\004\024\004\153\005\159\001\058\002\111\001\
\159\001\108\001\111\001\030\002\250\001\250\001\105\001\032\004\
\202\000\002\002\002\002\064\004\203\002\109\001\203\002\038\004\
\182\003\130\003\214\000\162\001\142\003\029\002\122\005\002\002\
\136\003\054\000\207\005\005\002\250\001\038\003\192\002\192\002\
\094\002\092\002\240\002\163\002\016\005\247\001\193\002\172\003\
\064\000\050\005\038\002\200\000\222\002\224\002\226\002\137\003\
\154\003\188\003\203\000\218\001\227\002\204\000\036\002\185\000\
\155\003\156\003\201\000\093\004\107\003\231\003\010\000\136\003\
\162\004\244\003\081\003\187\000\030\002\046\003\226\002\112\001\
\038\002\167\000\206\000\160\001\023\003\157\005\160\001\228\000\
\027\002\082\004\015\003\163\002\217\003\210\003\082\003\119\002\
\091\003\185\000\088\003\089\003\115\004\100\001\202\000\100\001\
\193\002\168\004\226\002\105\001\209\001\185\000\120\002\193\002\
\128\001\129\001\193\002\027\002\048\003\079\002\143\003\005\002\
\162\001\135\003\119\002\126\002\194\002\221\000\123\005\128\005\
\044\005\173\003\041\002\055\003\079\002\108\003\109\003\200\000\
\163\002\120\002\026\003\082\004\191\005\064\000\250\001\071\003\
\203\000\017\000\192\004\204\000\112\001\173\004\201\000\245\003\
\027\003\254\002\113\005\129\005\115\005\043\004\193\004\154\002\
\001\004\048\002\123\003\137\001\226\002\012\002\181\003\156\002\
\097\003\033\000\049\002\248\002\254\003\255\003\000\004\048\004\
\193\002\037\000\188\001\130\005\056\005\249\002\187\004\036\002\
\185\000\025\004\202\000\047\003\119\002\094\004\071\005\179\001\
\119\002\212\005\079\002\079\002\128\001\129\001\084\005\027\002\
\058\003\060\003\227\003\120\002\036\002\185\000\160\003\120\002\
\158\003\079\002\079\002\114\001\079\002\056\003\093\005\243\003\
\134\004\067\005\136\004\139\004\194\003\131\005\085\001\051\000\
\116\001\221\000\054\000\079\002\203\000\178\003\179\003\204\000\
\014\002\203\001\028\003\134\000\228\002\048\002\250\001\048\002\
\250\001\218\000\250\001\250\001\039\005\113\001\049\002\192\002\
\049\002\058\004\148\002\195\003\204\001\252\002\058\005\228\002\
\082\004\148\002\186\001\188\003\185\000\185\000\228\002\048\004\
\203\003\040\004\002\002\054\004\222\000\163\003\202\001\148\002\
\148\002\166\003\050\004\014\005\082\004\204\001\148\002\145\003\
\114\001\156\004\159\003\228\002\228\002\082\004\246\002\250\001\
\226\003\052\003\027\002\219\000\118\001\148\002\221\000\016\005\
\148\002\228\002\131\003\219\002\227\000\130\004\228\002\191\004\
\038\002\228\002\147\003\228\002\148\002\158\000\218\000\197\000\
\245\001\120\001\113\001\198\000\246\001\234\003\226\002\202\001\
\250\001\197\003\232\003\247\001\080\001\192\002\248\001\152\003\
\158\000\148\002\202\001\239\003\202\001\240\003\044\005\158\000\
\250\003\222\000\185\000\156\002\038\002\188\003\249\003\250\001\
\004\004\235\003\236\003\007\004\012\002\228\002\148\002\175\003\
\030\004\148\002\165\004\080\001\158\000\158\000\185\000\033\000\
\219\000\013\002\147\002\012\002\167\000\206\000\123\001\037\000\
\185\000\237\003\158\000\148\002\027\002\099\005\148\002\185\000\
\103\005\158\000\158\000\226\002\158\000\185\000\080\001\081\000\
\216\002\082\004\082\004\159\002\245\001\150\002\184\004\157\001\
\246\001\160\001\080\001\082\004\012\002\156\002\217\002\247\001\
\179\001\212\000\248\001\202\001\233\003\046\004\036\002\185\000\
\154\002\159\005\222\004\238\003\197\004\165\001\067\004\014\002\
\162\001\218\001\002\002\137\001\002\003\003\003\158\000\137\001\
\202\001\056\004\032\000\137\001\189\000\137\001\014\002\154\002\
\213\000\137\001\137\001\250\001\199\004\137\001\250\001\161\002\
\247\001\027\002\131\002\248\001\068\004\171\004\137\001\202\001\
\082\004\166\001\157\002\185\000\152\005\157\001\181\001\056\004\
\209\001\111\004\112\004\013\000\180\001\027\002\076\002\014\002\
\162\005\098\001\099\001\004\003\154\003\250\001\214\000\123\004\
\208\005\209\005\190\000\077\002\182\001\054\000\018\000\033\002\
\218\002\195\001\038\002\163\002\058\003\185\000\137\001\156\002\
\135\004\059\004\088\004\011\004\185\000\137\001\204\001\014\000\
\024\000\025\000\026\000\082\004\236\002\156\002\177\001\226\002\
\111\001\104\001\227\000\226\002\199\001\226\005\015\000\016\000\
\137\001\137\001\030\002\137\001\137\001\172\005\170\004\169\000\
\195\005\196\005\109\001\023\000\042\000\015\003\237\002\195\001\
\044\002\038\002\127\001\183\004\035\002\170\000\137\001\191\001\
\208\001\250\004\151\000\202\001\176\000\112\001\044\002\033\000\
\185\000\015\003\083\001\151\005\147\000\222\004\050\000\037\000\
\156\002\038\002\217\005\173\005\217\000\041\000\245\001\247\001\
\156\002\015\003\246\001\198\001\045\000\196\004\156\002\127\003\
\187\001\247\001\002\002\212\000\248\001\043\005\169\003\221\004\
\225\005\185\000\247\001\203\004\027\002\255\002\128\003\032\000\
\170\003\247\001\247\001\250\001\204\004\209\004\235\005\044\002\
\053\000\129\000\154\002\199\001\032\000\027\002\044\002\159\002\
\216\001\254\004\213\000\072\004\177\001\218\004\247\001\247\001\
\216\001\054\000\232\004\097\003\160\002\235\004\187\001\199\001\
\128\004\228\004\044\002\204\001\247\001\185\000\131\004\177\001\
\132\004\255\004\187\001\247\001\247\001\148\001\247\001\132\001\
\246\004\247\004\147\000\189\000\149\004\198\002\224\002\081\000\
\214\000\251\001\027\002\156\002\234\001\088\004\054\000\054\000\
\007\005\010\005\147\000\161\002\081\000\199\001\054\000\164\003\
\202\001\153\003\038\002\202\001\202\001\017\005\235\001\236\001\
\237\001\081\000\081\000\081\000\081\000\147\000\151\000\097\003\
\247\001\199\001\079\003\151\000\151\000\202\001\029\003\029\005\
\081\000\146\001\152\002\199\002\110\005\189\000\055\005\080\001\
\154\003\185\000\238\001\152\002\045\005\157\003\088\004\176\000\
\176\000\138\005\176\000\176\000\081\000\176\000\027\002\081\000\
\030\003\162\003\081\000\081\000\081\000\157\001\039\003\176\000\
\176\000\157\001\081\000\156\002\196\001\157\001\245\001\157\001\
\147\000\081\000\246\001\157\001\185\000\239\001\182\004\157\001\
\104\004\247\001\204\001\122\003\248\001\081\000\218\004\081\000\
\157\001\081\000\081\000\101\002\203\002\176\000\176\000\240\001\
\241\001\242\001\217\000\040\003\080\005\081\000\234\004\101\002\
\081\000\228\004\238\004\068\005\081\000\207\001\088\005\158\005\
\212\000\089\005\202\001\091\005\245\001\157\001\202\001\163\005\
\246\001\157\001\132\001\243\001\054\000\158\003\053\005\247\001\
\102\005\088\004\248\001\157\001\228\004\185\000\124\005\157\001\
\204\004\032\000\127\001\088\004\144\002\144\002\127\001\213\000\
\202\001\008\005\127\001\144\002\127\001\002\002\234\005\185\000\
\127\001\199\002\157\001\157\001\117\005\157\001\157\001\185\000\
\245\001\144\002\210\001\202\001\246\001\127\001\027\005\144\002\
\218\004\204\001\159\004\247\001\072\003\031\003\200\004\228\002\
\157\001\251\001\142\001\185\000\199\002\214\000\147\000\132\005\
\198\000\133\005\144\002\144\002\054\000\250\001\185\000\116\003\
\118\003\217\000\140\005\202\001\144\005\145\005\073\003\203\005\
\149\005\228\004\111\001\032\000\136\002\155\005\137\002\160\004\
\189\000\143\001\059\005\185\000\127\001\228\004\014\000\216\001\
\138\002\117\003\144\001\202\001\159\002\228\002\254\001\185\000\
\248\001\180\002\164\005\119\003\002\002\015\000\016\000\127\001\
\127\001\087\002\127\001\127\001\202\001\088\004\159\002\227\004\
\002\002\174\005\023\000\248\001\145\001\202\001\241\000\088\002\
\083\005\163\002\248\001\248\001\176\000\127\001\146\001\123\002\
\060\005\202\001\199\001\224\002\123\002\054\000\033\000\075\005\
\159\002\083\001\189\005\169\005\100\005\185\000\037\000\248\001\
\248\001\228\004\224\002\224\002\041\000\186\001\199\001\197\005\
\109\005\202\005\061\005\045\000\148\001\248\001\163\002\224\002\
\164\002\076\005\187\001\170\005\248\001\248\001\255\001\248\001\
\002\002\002\002\132\001\130\000\122\000\009\002\132\001\011\002\
\218\004\121\005\214\005\224\002\083\004\132\001\224\002\053\000\
\132\001\219\005\220\005\224\002\051\000\151\000\185\000\227\000\
\202\001\224\002\019\002\202\001\151\000\164\002\151\000\223\005\
\224\002\202\001\002\002\084\004\151\000\087\000\030\002\032\000\
\186\000\248\001\144\000\083\001\198\001\085\004\051\000\226\002\
\224\002\224\002\179\000\151\000\151\000\202\001\236\005\129\004\
\002\002\176\000\226\002\086\004\224\002\202\001\040\002\087\000\
\202\001\132\001\029\000\045\002\144\000\202\001\002\002\142\004\
\202\001\202\001\086\002\226\002\179\000\114\002\114\002\042\002\
\087\002\047\002\017\004\028\004\046\002\232\002\132\004\233\002\
\194\000\087\002\054\000\176\000\176\000\176\000\088\002\114\002\
\216\001\234\002\245\001\176\000\135\001\159\002\246\001\088\002\
\184\005\066\002\187\005\194\000\067\002\247\001\049\002\138\001\
\248\001\151\000\194\000\151\000\193\005\052\002\150\005\159\002\
\151\000\092\003\176\000\176\000\159\002\251\001\160\000\176\000\
\159\002\176\000\159\002\060\002\159\002\159\002\159\002\194\000\
\194\000\217\000\074\002\184\005\184\005\163\004\054\000\125\004\
\062\002\160\000\213\005\058\002\159\002\194\000\066\001\164\004\
\160\000\081\002\151\000\176\000\194\000\194\000\119\002\194\000\
\054\000\185\000\176\000\221\005\030\002\067\001\068\001\151\000\
\151\000\111\001\224\005\163\002\112\003\160\000\160\000\185\000\
\184\005\148\001\217\000\159\002\229\005\163\002\176\000\032\001\
\132\002\232\005\233\005\160\000\133\001\019\003\033\001\152\002\
\133\001\186\000\160\000\160\000\034\003\160\000\142\002\133\001\
\036\003\194\000\133\001\227\000\020\003\021\003\241\000\241\000\
\241\000\241\000\242\003\133\001\006\003\007\003\241\000\241\000\
\241\000\158\002\182\001\241\000\241\000\164\002\241\000\241\000\
\241\000\241\000\241\000\241\000\120\001\176\000\241\000\241\000\
\241\000\241\000\241\000\241\000\036\002\185\000\080\001\160\000\
\152\001\165\002\241\000\241\000\006\003\009\003\241\000\241\000\
\241\000\241\000\182\002\133\001\183\002\241\000\241\000\067\001\
\153\001\036\002\185\000\159\000\148\001\185\000\080\001\192\000\
\186\002\151\000\187\002\241\000\241\000\188\002\241\000\008\003\
\010\003\241\000\241\000\241\000\195\002\241\000\159\000\196\002\
\241\000\241\000\192\000\197\002\151\000\159\000\147\000\151\000\
\241\000\192\000\241\000\201\002\206\002\207\002\151\000\181\000\
\151\000\151\000\210\002\241\000\241\000\211\002\241\000\241\000\
\241\000\241\000\159\000\159\000\176\000\214\002\192\000\241\000\
\176\000\241\000\181\000\063\002\241\000\242\002\151\000\241\000\
\159\000\181\000\029\000\241\000\192\000\029\000\032\000\159\000\
\159\000\101\002\159\000\192\000\192\000\018\003\192\000\029\000\
\029\000\049\003\051\003\050\003\054\003\062\003\181\000\176\000\
\151\000\061\003\063\003\065\003\029\000\029\000\029\000\029\000\
\076\003\084\003\099\001\101\003\181\000\102\003\005\002\110\003\
\176\000\115\003\029\000\029\000\181\000\111\003\181\000\138\001\
\176\000\124\003\176\000\138\001\159\000\132\003\134\003\138\001\
\192\000\138\001\138\003\149\003\217\000\138\001\138\001\029\000\
\148\001\138\001\029\000\122\001\029\000\029\000\029\000\029\000\
\151\003\150\003\138\001\206\001\161\003\029\000\096\002\097\002\
\098\002\099\002\247\001\213\001\029\000\171\003\176\003\180\003\
\181\000\167\000\100\002\183\003\190\003\191\003\059\001\196\003\
\029\000\230\000\029\000\158\001\029\000\029\000\148\001\006\003\
\207\003\209\003\147\000\218\003\248\003\246\003\010\004\167\002\
\029\000\014\004\138\001\029\000\015\004\167\001\023\004\029\000\
\251\003\138\001\026\004\031\004\174\001\147\000\134\002\217\000\
\035\004\036\004\168\002\151\000\147\000\176\000\176\000\101\002\
\039\004\010\000\151\000\051\004\138\001\138\001\055\004\138\001\
\138\001\199\002\167\000\206\000\066\004\148\001\057\004\103\004\
\217\000\147\000\147\000\098\004\105\004\108\004\109\004\110\004\
\127\004\148\001\138\001\124\004\120\001\156\004\158\004\147\000\
\120\001\148\001\166\004\174\004\120\001\151\000\120\001\147\000\
\151\000\147\000\120\001\120\001\169\004\175\004\176\004\179\004\
\169\002\094\000\151\000\177\004\190\004\170\002\198\004\120\001\
\054\000\096\002\097\002\098\002\099\002\210\004\151\000\212\004\
\095\000\016\000\216\004\217\004\033\003\100\002\037\002\236\004\
\176\000\219\004\220\004\011\005\237\004\096\000\240\004\144\004\
\026\005\077\002\239\004\147\000\040\005\245\004\075\004\087\004\
\002\005\176\000\004\005\151\000\151\000\041\005\028\005\120\001\
\175\000\033\000\063\005\051\005\064\005\078\005\120\001\114\005\
\191\000\037\000\086\005\108\005\176\000\126\005\148\001\097\000\
\216\000\141\005\101\002\142\005\090\005\220\000\045\000\148\005\
\156\005\120\001\120\001\191\000\120\001\120\001\032\000\151\000\
\176\000\032\000\191\000\177\005\217\000\151\000\098\000\151\000\
\180\005\181\005\182\005\032\000\032\000\188\005\192\005\120\001\
\176\000\190\005\099\000\151\000\014\005\100\000\201\005\191\000\
\032\000\032\000\032\000\032\000\001\000\002\000\003\000\004\000\
\005\000\006\000\007\000\200\005\205\005\191\000\032\000\032\000\
\211\005\215\005\218\005\176\000\191\000\191\000\222\005\191\000\
\090\001\227\005\156\001\228\005\075\004\230\005\051\000\087\000\
\159\002\008\000\224\002\032\000\051\000\228\002\032\000\034\002\
\148\001\095\002\032\000\032\000\126\000\234\002\163\002\199\001\
\164\002\032\000\235\002\213\001\151\000\097\001\098\001\099\001\
\032\000\216\000\046\002\213\001\151\000\148\002\148\002\076\001\
\213\001\191\000\150\002\149\002\032\000\149\002\032\000\205\004\
\032\000\032\000\151\000\220\001\151\000\213\001\151\000\213\001\
\213\001\101\001\102\001\199\001\032\000\151\002\154\002\032\000\
\176\000\151\000\087\004\032\000\213\001\155\002\104\001\105\001\
\106\001\107\001\156\002\175\000\175\000\217\001\175\000\175\000\
\152\002\175\000\155\002\134\002\176\000\151\000\168\001\109\001\
\213\001\151\000\181\004\175\000\175\000\070\005\213\001\213\001\
\213\001\229\004\134\002\134\002\226\004\150\002\213\001\167\005\
\147\005\125\005\174\002\107\004\201\003\213\001\137\000\134\002\
\138\000\139\000\032\000\087\004\140\000\086\003\172\002\177\001\
\142\000\175\000\175\000\146\002\228\002\213\001\216\000\151\000\
\151\000\087\003\113\004\134\002\053\003\165\003\134\002\224\001\
\230\004\213\001\155\001\134\002\213\001\012\004\216\005\047\005\
\185\004\134\002\145\000\107\005\204\002\151\000\000\000\168\000\
\134\002\146\000\052\005\205\004\178\000\148\003\000\000\000\000\
\194\000\077\002\000\000\000\000\077\002\147\000\148\000\000\000\
\134\002\134\002\000\000\075\004\151\000\000\000\077\002\000\000\
\000\000\194\000\077\002\000\000\134\002\176\000\000\000\125\002\
\151\000\000\000\000\000\077\002\077\002\077\002\077\002\151\000\
\000\000\151\000\000\000\000\000\000\000\194\000\087\004\000\000\
\075\004\151\000\077\002\176\000\000\000\000\000\000\000\000\000\
\087\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\176\000\216\000\077\002\000\000\
\000\000\077\002\000\000\125\002\077\002\077\002\077\002\151\000\
\194\000\000\000\194\000\194\000\077\002\000\000\199\001\000\000\
\000\000\084\002\000\000\077\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\151\000\000\000\000\000\000\000\077\002\
\000\000\077\002\156\001\077\002\077\002\000\000\156\001\151\000\
\000\000\176\000\156\001\000\000\156\001\000\000\070\003\077\002\
\156\001\224\002\077\002\075\003\156\001\151\000\077\002\151\000\
\175\000\000\000\000\000\000\000\000\000\156\001\000\000\000\000\
\151\000\000\000\000\000\000\000\224\002\217\001\000\000\003\001\
\000\000\000\000\000\000\224\002\075\004\151\000\000\000\000\000\
\000\000\000\000\087\004\000\000\000\000\000\000\075\004\178\000\
\214\001\000\000\178\000\178\000\000\000\178\000\093\003\000\000\
\224\002\224\002\000\000\000\000\000\000\176\000\000\000\178\000\
\178\000\000\000\000\000\000\000\156\001\171\002\224\002\000\000\
\000\000\194\000\000\000\000\000\000\000\000\000\224\002\000\000\
\224\002\000\000\000\000\000\000\000\000\000\000\000\000\156\001\
\156\001\129\003\156\001\156\001\000\000\178\000\214\001\000\000\
\000\000\000\000\000\000\075\004\000\000\151\000\205\004\194\000\
\000\000\000\000\000\000\000\000\000\000\156\001\000\000\000\000\
\000\000\199\001\000\000\000\000\000\000\175\000\000\000\151\000\
\000\000\151\000\224\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\151\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\168\000\
\000\000\000\000\168\000\000\000\000\000\000\000\075\004\175\000\
\175\000\175\000\151\000\151\000\168\000\000\000\000\000\175\000\
\000\000\151\000\190\000\000\000\000\000\151\000\217\001\000\000\
\000\000\168\000\168\000\168\000\168\000\000\000\175\000\000\000\
\000\000\224\002\151\000\194\000\193\003\190\000\175\000\175\000\
\168\000\151\000\000\000\175\000\190\000\175\000\000\000\151\000\
\000\000\000\000\000\000\151\000\000\000\216\000\000\000\194\000\
\151\000\151\000\217\001\000\000\168\000\000\000\217\001\000\000\
\000\000\190\000\000\000\168\000\168\000\000\000\000\000\175\000\
\123\001\000\000\168\000\000\000\000\000\000\000\175\000\190\000\
\010\000\168\000\176\001\000\000\000\000\000\000\190\000\190\000\
\000\000\190\000\000\000\000\000\222\003\000\000\216\000\168\000\
\000\000\168\000\175\000\000\000\000\000\000\000\000\000\228\003\
\000\000\230\003\000\000\000\000\178\000\168\000\000\000\000\000\
\168\000\220\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\194\000\194\000\000\000\000\000\194\000\000\000\
\194\000\000\000\137\000\190\000\138\000\139\000\032\000\000\000\
\140\000\000\000\000\000\177\001\142\000\000\000\013\004\003\001\
\000\000\175\000\003\001\000\000\000\000\000\000\000\000\003\001\
\000\000\003\001\000\000\000\000\003\001\003\001\000\000\003\001\
\003\001\003\001\003\001\003\001\003\001\033\004\145\000\003\001\
\003\001\003\001\037\004\003\001\003\001\146\000\000\000\000\000\
\000\000\126\003\000\000\000\000\003\001\000\000\000\000\003\001\
\003\001\147\000\148\000\000\000\000\000\000\000\003\001\003\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\213\001\000\000\000\000\003\001\000\000\000\000\003\001\
\000\000\178\000\000\000\003\001\003\001\000\000\003\001\000\000\
\000\000\003\001\003\001\000\000\000\000\000\000\000\000\000\000\
\175\000\003\001\092\004\217\001\175\000\000\000\000\000\097\004\
\000\000\000\000\000\000\000\000\003\001\003\001\000\000\003\001\
\003\001\003\001\003\001\178\000\178\000\178\000\000\000\000\000\
\003\001\000\000\003\001\178\000\000\000\003\001\000\000\000\000\
\003\001\000\000\000\000\175\000\003\001\000\000\000\000\000\000\
\000\000\000\000\250\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\214\001\178\000\175\000\000\000\141\004\214\001\
\000\000\178\000\000\000\000\000\175\000\000\000\175\000\000\000\
\000\000\224\002\224\002\000\000\000\000\000\000\000\000\000\000\
\216\000\000\000\000\000\000\000\000\000\000\000\224\002\000\000\
\000\000\000\000\077\002\178\000\000\000\224\002\000\000\000\000\
\000\000\000\000\178\000\224\002\224\002\224\002\224\002\000\000\
\000\000\000\000\000\000\000\000\000\000\221\003\000\000\186\004\
\123\001\000\000\224\002\000\000\123\001\189\004\178\000\000\000\
\123\001\224\002\123\001\000\000\000\000\000\000\123\001\000\000\
\000\000\000\000\123\001\000\000\000\000\194\000\224\002\224\002\
\000\000\224\002\000\000\123\001\000\000\000\000\224\002\224\002\
\000\000\224\002\000\000\216\000\224\002\000\000\000\000\000\000\
\000\000\175\000\175\000\224\002\000\000\000\000\000\000\179\000\
\000\000\000\000\000\000\195\000\000\000\214\001\000\000\224\002\
\000\000\000\000\000\000\224\002\216\000\000\000\000\000\027\004\
\000\000\000\000\231\004\123\001\195\000\000\000\000\000\224\002\
\000\000\000\000\123\001\224\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\195\000\000\000\000\000\000\000\000\000\123\001\123\001\000\000\
\123\001\123\001\199\001\000\000\251\004\000\000\253\004\000\000\
\001\005\000\000\000\000\006\005\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\123\001\175\000\000\000\000\000\000\000\
\000\000\000\000\015\005\195\000\000\000\195\000\195\000\000\000\
\000\000\213\001\000\000\199\001\178\000\175\000\000\000\000\000\
\178\000\000\000\000\000\030\005\031\005\000\000\213\001\000\000\
\069\004\036\005\138\000\139\000\032\000\000\000\140\000\000\000\
\175\000\070\004\071\004\213\001\000\000\213\001\213\001\000\000\
\000\000\000\000\000\000\226\002\000\000\000\000\000\000\214\001\
\072\004\000\000\213\001\073\004\175\000\054\005\000\000\000\000\
\216\000\178\001\000\000\074\004\145\000\000\000\000\000\000\000\
\178\000\000\000\000\000\146\000\175\000\000\000\213\001\000\000\
\178\000\000\000\214\001\000\000\213\001\213\001\213\001\147\000\
\148\000\000\000\179\000\215\001\213\001\179\000\179\000\000\000\
\179\000\000\000\000\000\213\001\181\000\000\000\000\000\175\000\
\000\000\000\000\179\000\179\000\000\000\207\000\000\000\000\000\
\000\000\000\000\000\000\213\001\195\000\000\000\217\001\000\000\
\000\000\000\000\077\002\000\000\000\000\077\002\000\000\213\001\
\000\000\105\005\213\001\000\000\000\000\000\000\000\000\077\002\
\179\000\215\001\000\000\077\002\217\001\000\000\000\000\112\005\
\126\002\000\000\195\000\000\000\077\002\077\002\077\002\077\002\
\138\002\000\000\000\000\000\000\000\000\118\005\000\000\000\000\
\120\005\000\000\000\000\077\002\000\000\178\000\214\001\000\000\
\000\000\000\000\000\000\057\003\175\000\000\000\199\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\077\002\
\000\000\000\000\077\002\000\000\126\002\077\002\077\002\077\002\
\175\000\156\001\000\000\000\000\143\005\077\002\000\000\000\000\
\000\000\000\000\000\000\000\000\077\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\242\001\
\077\002\000\000\077\002\000\000\077\002\077\002\195\000\199\001\
\000\000\000\000\000\000\137\000\000\000\138\000\139\000\032\000\
\077\002\140\000\151\001\077\002\141\000\142\000\000\000\077\002\
\178\000\000\000\195\000\176\005\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\143\000\181\000\
\181\000\214\001\181\000\181\000\000\000\181\000\144\000\144\003\
\000\000\000\000\000\000\000\000\000\000\000\000\146\000\181\000\
\181\000\000\000\000\000\000\000\178\000\000\000\198\005\199\005\
\000\000\005\004\147\000\148\000\180\000\000\000\206\005\057\003\
\000\000\175\000\000\000\000\000\000\000\000\000\000\000\179\000\
\178\000\000\000\000\000\000\000\000\000\181\000\181\000\014\000\
\000\000\000\000\199\001\226\002\000\000\195\000\195\000\175\000\
\178\000\195\000\000\000\195\000\199\001\000\000\015\000\016\000\
\226\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\175\000\000\000\000\000\023\000\000\000\226\002\000\000\226\002\
\226\002\231\005\000\000\214\001\000\000\000\000\000\000\137\000\
\000\000\138\000\139\000\032\000\226\002\140\000\000\000\033\000\
\141\000\142\000\083\001\000\000\241\001\000\000\000\000\037\000\
\178\001\000\000\000\000\000\000\000\000\041\000\000\000\178\001\
\226\002\178\001\143\000\226\002\045\000\175\000\000\000\226\002\
\226\002\000\000\144\000\145\000\000\000\000\000\226\002\000\000\
\000\000\000\000\146\000\000\000\049\000\226\002\000\000\000\000\
\000\000\000\000\000\000\000\000\179\000\000\000\147\000\148\000\
\053\000\226\002\000\000\000\000\000\000\226\002\226\002\000\000\
\214\001\000\000\000\000\000\000\000\000\000\000\199\001\194\000\
\199\001\226\002\000\000\000\000\226\002\138\002\000\000\000\000\
\000\000\000\000\000\000\000\000\214\001\000\000\179\000\179\000\
\179\000\175\000\000\000\102\002\138\002\138\002\179\000\180\000\
\180\000\000\000\180\000\180\000\000\000\180\000\000\000\000\000\
\175\000\138\002\000\000\000\000\000\000\000\000\000\000\180\000\
\180\000\000\000\000\000\107\000\128\002\215\001\179\000\000\000\
\000\000\000\000\215\001\000\000\179\000\138\002\010\000\242\001\
\138\002\000\000\242\001\000\000\000\000\138\002\000\000\000\000\
\000\000\000\000\000\000\138\002\242\001\180\000\180\000\000\000\
\000\000\000\000\138\002\000\000\000\000\000\000\179\000\000\000\
\000\000\242\001\242\001\242\001\242\001\179\000\000\000\000\000\
\175\000\000\000\138\002\138\002\000\000\000\000\000\000\000\000\
\242\001\000\000\000\000\000\000\000\000\000\000\138\002\000\000\
\137\000\179\000\138\000\139\000\032\000\178\000\140\000\000\000\
\000\000\177\001\142\000\000\000\242\001\000\000\000\000\242\001\
\195\000\151\001\242\001\242\001\242\001\000\000\000\000\000\000\
\000\000\000\000\242\001\214\001\000\000\090\001\000\000\000\000\
\000\000\242\001\194\000\000\000\145\000\000\000\000\000\000\000\
\000\000\181\000\000\000\146\000\214\001\242\001\000\000\242\001\
\215\001\242\001\242\001\000\000\000\000\000\000\000\000\147\000\
\148\000\096\001\097\001\098\001\099\001\242\001\000\000\000\000\
\242\001\000\000\151\001\000\000\242\001\000\000\000\000\000\000\
\000\000\000\000\220\002\181\000\181\000\181\000\200\002\000\000\
\000\000\185\000\000\000\181\000\000\000\059\003\101\001\102\001\
\000\000\214\001\000\000\000\000\241\001\000\000\000\000\241\001\
\000\000\000\000\000\000\104\001\105\001\106\001\107\001\178\001\
\224\002\241\001\181\000\181\000\000\000\000\000\000\000\181\000\
\000\000\181\000\000\000\000\000\109\001\000\000\241\001\241\001\
\241\001\241\001\000\000\000\000\180\000\102\002\000\000\179\000\
\000\000\000\000\000\000\179\000\000\000\241\001\000\000\000\000\
\000\000\000\000\000\000\181\000\000\000\137\000\000\000\138\000\
\139\000\032\000\128\002\140\000\000\000\214\001\141\000\142\000\
\000\000\241\001\000\000\000\000\241\001\000\000\000\000\241\001\
\241\001\241\001\215\001\000\000\161\005\000\000\181\000\241\001\
\143\000\000\000\000\000\239\001\000\000\000\000\241\001\000\000\
\144\000\145\000\000\000\179\000\000\000\000\000\000\000\000\000\
\146\000\000\000\241\001\179\000\241\001\215\001\241\001\241\001\
\000\000\161\002\000\000\107\000\147\000\148\000\000\000\000\000\
\000\000\000\000\241\001\000\000\000\000\241\001\151\001\000\000\
\107\000\241\001\000\000\000\000\000\000\181\000\000\000\000\000\
\000\000\000\000\000\000\000\000\194\005\107\000\000\000\107\000\
\107\000\180\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\107\000\000\000\000\000\000\000\
\000\000\000\000\000\000\161\002\000\000\161\002\161\002\161\002\
\092\000\161\002\000\000\000\000\161\002\161\002\000\000\000\000\
\107\000\000\000\000\000\180\000\180\000\180\000\000\000\107\000\
\107\000\000\000\000\000\180\000\180\000\000\000\107\000\000\000\
\179\000\215\001\000\000\000\000\000\000\107\000\000\000\161\002\
\000\000\000\000\000\000\174\003\000\000\000\000\161\002\000\000\
\000\000\151\001\180\000\180\000\181\000\107\000\000\000\180\000\
\181\000\180\000\161\002\161\002\000\000\000\000\000\000\000\000\
\000\000\107\000\000\000\000\000\107\000\000\000\000\000\000\000\
\178\001\000\000\000\000\000\000\000\000\044\004\000\000\000\000\
\231\000\231\000\000\000\180\000\000\000\000\000\000\000\181\000\
\000\000\000\000\180\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\137\000\000\000\138\000\139\000\032\000\
\181\000\140\000\000\000\179\000\141\000\142\000\180\000\000\000\
\181\000\000\000\181\000\000\000\000\000\000\000\000\000\000\000\
\224\002\000\000\000\000\224\002\215\001\000\000\143\000\000\000\
\000\000\000\000\000\000\000\000\000\000\224\002\144\000\145\000\
\000\000\138\001\139\001\000\000\000\000\000\000\146\000\179\000\
\000\000\000\000\224\002\000\000\224\002\224\002\000\000\000\000\
\000\000\000\000\147\000\148\000\000\000\180\000\000\000\000\000\
\000\000\224\002\000\000\179\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\151\001\000\000\000\000\
\000\000\000\000\000\000\179\000\253\001\224\002\000\000\000\000\
\000\000\000\000\000\000\239\001\000\000\224\002\239\001\000\000\
\000\000\000\000\000\000\224\002\000\000\181\000\181\000\000\000\
\239\001\151\001\224\002\000\000\000\000\000\000\215\001\000\000\
\000\000\000\000\000\000\151\001\000\000\239\001\239\001\239\001\
\239\001\000\000\224\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\239\001\000\000\224\002\000\000\
\000\000\224\002\000\000\102\002\180\000\194\004\000\000\000\000\
\180\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\239\001\000\000\000\000\239\001\000\000\000\000\239\001\239\001\
\239\001\000\000\151\001\000\000\000\000\178\001\239\001\010\000\
\092\000\176\001\000\000\000\000\000\000\239\001\151\001\180\000\
\181\000\000\000\000\000\215\001\000\000\092\000\151\001\000\000\
\000\000\239\001\195\000\239\001\000\000\239\001\239\001\000\000\
\180\000\181\000\092\000\000\000\092\000\092\000\000\000\215\001\
\180\000\239\001\180\000\000\000\239\001\000\000\000\000\000\000\
\239\001\092\000\000\000\000\000\181\000\000\000\000\000\000\000\
\000\000\137\000\000\000\138\000\139\000\032\000\151\001\140\000\
\000\000\000\000\141\000\142\000\000\000\092\000\000\000\000\000\
\181\000\000\000\000\000\081\004\000\000\092\000\000\000\000\000\
\000\000\000\000\000\000\092\000\143\000\000\000\000\000\000\000\
\181\000\000\000\092\000\000\000\144\000\145\000\006\001\000\000\
\000\000\000\000\000\000\151\001\146\000\000\000\151\001\151\001\
\000\000\000\000\092\000\000\000\000\000\000\000\000\000\000\000\
\147\000\148\000\000\000\181\000\000\000\000\000\092\000\000\000\
\000\000\092\000\000\000\000\000\000\000\180\000\180\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\179\000\103\002\104\002\105\002\106\002\107\002\108\002\109\002\
\110\002\111\002\112\002\113\002\114\002\115\002\116\002\117\002\
\118\002\119\002\120\002\121\002\122\002\123\002\215\001\125\002\
\000\000\000\000\000\000\000\000\000\000\195\000\000\000\000\000\
\000\000\081\004\000\000\000\000\000\000\135\002\000\000\215\001\
\000\000\000\000\000\000\000\000\253\001\151\001\253\001\253\001\
\181\000\148\002\000\000\000\000\253\001\000\000\000\000\000\000\
\000\000\253\001\000\000\000\000\000\000\253\001\253\001\253\001\
\180\000\000\000\000\000\000\000\181\000\000\000\253\001\253\001\
\253\001\253\001\000\000\000\000\207\004\000\000\000\000\000\000\
\253\001\180\000\000\000\000\000\215\001\253\001\000\000\000\000\
\000\000\000\000\000\000\253\001\253\001\000\000\000\000\000\000\
\000\000\013\001\000\000\000\000\180\000\000\000\000\000\000\000\
\000\000\253\001\000\000\000\000\253\001\000\000\000\000\253\001\
\253\001\253\001\000\000\253\001\000\000\000\000\000\000\253\001\
\180\000\000\000\000\000\000\000\000\000\000\000\253\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\180\000\253\001\253\001\000\000\253\001\253\001\253\001\253\001\
\215\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\253\001\000\000\000\000\253\001\000\000\000\000\
\000\000\253\001\000\000\180\000\000\000\181\000\000\000\000\000\
\000\000\000\000\137\000\000\000\138\000\139\000\032\000\151\001\
\140\000\000\000\000\000\141\000\142\000\000\000\000\000\000\000\
\207\004\000\000\000\000\181\000\000\000\037\005\038\005\000\000\
\000\000\000\000\000\000\000\000\000\000\143\000\000\000\000\000\
\081\004\000\000\000\000\025\003\181\000\144\000\145\000\000\000\
\000\000\000\000\000\000\000\000\035\003\146\000\006\001\000\000\
\037\003\006\001\000\000\041\003\000\000\000\000\006\001\000\000\
\006\001\147\000\148\000\006\001\006\001\081\004\000\000\006\001\
\180\000\006\001\006\001\006\001\000\000\000\000\006\001\006\001\
\006\001\079\002\006\001\006\001\000\000\000\000\000\000\000\000\
\000\000\181\000\000\000\006\001\180\000\151\001\006\001\006\001\
\000\000\000\000\000\000\000\000\000\000\006\001\006\001\000\000\
\000\000\000\000\000\000\000\000\231\000\231\000\000\000\000\000\
\000\000\000\000\000\000\006\001\000\000\000\000\006\001\000\000\
\000\000\000\000\006\001\006\001\000\000\006\001\000\000\000\000\
\006\001\006\001\000\000\000\000\000\000\000\000\000\000\000\000\
\006\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\106\003\006\001\006\001\181\000\006\001\006\001\
\006\001\006\001\000\000\000\000\000\000\000\000\000\000\006\001\
\000\000\006\001\207\004\000\000\006\001\000\000\000\000\006\001\
\000\000\081\004\000\000\006\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\081\004\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\137\000\180\000\138\000\139\000\
\032\000\013\001\140\000\000\000\013\001\141\000\142\000\000\000\
\000\000\013\001\000\000\013\001\000\000\114\002\013\001\013\001\
\000\000\000\000\013\001\180\000\013\001\013\001\013\001\143\000\
\000\000\013\001\013\001\013\001\000\000\013\001\013\001\144\000\
\144\003\000\000\000\000\000\000\180\000\000\000\013\001\146\000\
\081\004\013\001\013\001\207\004\000\000\000\000\000\000\000\000\
\013\001\013\001\177\003\147\000\148\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\013\001\000\000\
\000\000\013\001\000\000\000\000\000\000\013\001\013\001\000\000\
\013\001\000\000\000\000\013\001\013\001\000\000\000\000\000\000\
\000\000\180\000\000\000\013\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\081\004\208\003\000\000\013\001\013\001\
\000\000\013\001\013\001\013\001\013\001\000\000\000\000\000\000\
\000\000\000\000\013\001\000\000\013\001\000\000\000\000\013\001\
\000\000\000\000\013\001\000\000\000\000\000\000\013\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\223\003\000\000\000\000\000\000\000\000\000\000\000\000\224\000\
\000\000\000\000\000\000\000\000\000\000\180\000\000\000\000\000\
\000\000\079\002\079\002\079\002\079\002\000\000\000\000\079\002\
\079\002\079\002\079\002\079\002\079\002\079\002\079\002\079\002\
\079\002\079\002\079\002\079\002\079\002\079\002\079\002\079\002\
\000\000\079\002\079\002\079\002\079\002\079\002\079\002\079\002\
\079\002\000\000\000\000\000\000\000\000\079\002\079\002\000\000\
\022\004\079\002\079\002\079\002\079\002\079\002\079\002\079\002\
\079\002\079\002\079\002\079\002\079\002\079\002\000\000\079\002\
\079\002\079\002\079\002\000\000\000\000\079\002\079\002\079\002\
\058\002\079\002\079\002\079\002\079\002\079\002\079\002\000\000\
\079\002\079\002\079\002\079\002\079\002\000\000\079\002\079\002\
\000\000\000\000\000\000\079\002\079\002\079\002\079\002\079\002\
\079\002\079\002\079\002\000\000\079\002\000\000\079\002\079\002\
\000\000\079\002\079\002\079\002\079\002\079\002\000\000\079\002\
\079\002\000\000\079\002\079\002\079\002\079\002\029\001\079\002\
\079\002\000\000\079\002\000\000\000\000\000\000\079\002\000\000\
\000\000\000\000\000\000\000\000\000\000\114\002\114\002\114\002\
\114\002\114\002\000\000\114\002\114\002\114\002\114\002\114\002\
\114\002\114\002\114\002\114\002\114\002\114\002\114\002\114\002\
\114\002\114\002\114\002\000\000\122\004\114\002\114\002\114\002\
\114\002\114\002\114\002\114\002\114\002\000\000\000\000\000\000\
\000\000\114\002\114\002\000\000\000\000\114\002\114\002\114\002\
\114\002\114\002\114\002\114\002\114\002\114\002\114\002\114\002\
\114\002\114\002\000\000\114\002\114\002\114\002\114\002\000\000\
\000\000\114\002\114\002\114\002\000\000\114\002\114\002\114\002\
\114\002\114\002\114\002\000\000\114\002\114\002\114\002\114\002\
\114\002\000\000\114\002\114\002\000\000\000\000\000\000\114\002\
\114\002\114\002\114\002\114\002\114\002\114\002\114\002\000\000\
\114\002\000\000\114\002\114\002\000\000\114\002\114\002\114\002\
\114\002\114\002\000\000\114\002\114\002\060\001\114\002\114\002\
\114\002\114\002\000\000\114\002\114\002\000\000\114\002\000\000\
\000\000\000\000\114\002\000\000\000\000\000\000\000\000\224\000\
\224\000\224\000\224\000\000\000\000\000\000\000\000\000\224\000\
\224\000\224\000\000\000\000\000\224\000\224\000\224\000\224\000\
\224\000\224\000\224\000\224\000\224\000\000\000\000\000\224\000\
\224\000\224\000\224\000\224\000\224\000\000\000\000\000\000\000\
\000\000\000\000\000\000\224\000\224\000\000\000\000\000\224\000\
\224\000\224\000\224\000\224\000\224\000\224\000\224\000\224\000\
\000\000\000\000\000\000\000\000\241\004\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\224\000\224\000\000\000\224\000\
\248\004\000\000\224\000\224\000\224\000\000\000\224\000\224\000\
\224\000\224\000\224\000\000\000\000\000\000\000\000\000\000\000\
\000\000\224\000\000\000\224\000\224\000\224\000\224\000\224\000\
\000\000\000\000\000\000\000\000\224\000\224\000\000\000\224\000\
\224\000\224\000\224\000\036\001\000\000\224\000\000\000\000\000\
\224\000\000\000\224\000\000\000\000\000\224\000\000\000\000\000\
\224\000\033\005\034\005\035\005\224\000\000\000\029\001\029\001\
\029\001\029\001\000\000\000\000\029\001\029\001\029\001\029\001\
\029\001\029\001\029\001\029\001\029\001\029\001\029\001\029\001\
\029\001\029\001\029\001\029\001\029\001\000\000\029\001\029\001\
\029\001\029\001\029\001\029\001\029\001\029\001\000\000\000\000\
\000\000\000\000\029\001\029\001\000\000\000\000\029\001\029\001\
\029\001\029\001\029\001\029\001\029\001\029\001\029\001\029\001\
\029\001\029\001\029\001\000\000\029\001\029\001\029\001\029\001\
\000\000\000\000\029\001\029\001\029\001\000\000\029\001\029\001\
\029\001\029\001\029\001\029\001\000\000\029\001\029\001\029\001\
\029\001\029\001\000\000\029\001\029\001\000\000\000\000\000\000\
\029\001\029\001\029\001\029\001\029\001\029\001\029\001\029\001\
\000\000\029\001\000\000\029\001\029\001\000\000\029\001\029\001\
\029\001\029\001\029\001\034\001\029\001\029\001\000\000\029\001\
\029\001\029\001\029\001\000\000\029\001\029\001\000\000\029\001\
\000\000\000\000\000\000\029\001\000\000\060\001\060\001\060\001\
\060\001\060\001\000\000\060\001\060\001\060\001\060\001\060\001\
\060\001\060\001\060\001\060\001\060\001\060\001\060\001\060\001\
\060\001\060\001\060\001\000\000\000\000\060\001\060\001\060\001\
\060\001\060\001\060\001\060\001\060\001\000\000\000\000\000\000\
\000\000\060\001\060\001\000\000\000\000\060\001\060\001\060\001\
\060\001\060\001\060\001\060\001\060\001\060\001\060\001\060\001\
\060\001\060\001\000\000\060\001\060\001\060\001\060\001\000\000\
\000\000\060\001\060\001\060\001\000\000\060\001\060\001\060\001\
\060\001\060\001\060\001\000\000\060\001\060\001\060\001\060\001\
\060\001\000\000\060\001\060\001\000\000\000\000\000\000\060\001\
\060\001\060\001\060\001\060\001\060\001\060\001\060\001\000\000\
\060\001\000\000\060\001\060\001\000\000\060\001\060\001\060\001\
\060\001\060\001\032\001\060\001\060\001\000\000\060\001\060\001\
\060\001\060\001\000\000\060\001\060\001\000\000\060\001\000\000\
\000\000\000\000\060\001\036\001\036\001\036\001\036\001\000\000\
\000\000\036\001\036\001\036\001\036\001\036\001\036\001\036\001\
\036\001\036\001\036\001\036\001\036\001\036\001\036\001\036\001\
\036\001\036\001\000\000\036\001\036\001\036\001\036\001\036\001\
\036\001\036\001\036\001\000\000\000\000\000\000\000\000\036\001\
\036\001\000\000\000\000\036\001\036\001\036\001\036\001\036\001\
\036\001\036\001\036\001\036\001\036\001\036\001\036\001\036\001\
\000\000\036\001\036\001\036\001\036\001\000\000\000\000\036\001\
\036\001\036\001\000\000\036\001\036\001\036\001\036\001\036\001\
\036\001\000\000\036\001\036\001\036\001\036\001\036\001\000\000\
\036\001\036\001\000\000\000\000\000\000\036\001\036\001\036\001\
\036\001\036\001\036\001\036\001\036\001\000\000\036\001\000\000\
\036\001\036\001\000\000\036\001\036\001\036\001\036\001\036\001\
\069\001\036\001\036\001\000\000\036\001\036\001\036\001\036\001\
\000\000\036\001\036\001\000\000\036\001\000\000\000\000\000\000\
\036\001\000\000\000\000\034\001\034\001\034\001\034\001\000\000\
\000\000\034\001\034\001\034\001\034\001\034\001\034\001\034\001\
\034\001\034\001\034\001\034\001\034\001\034\001\034\001\034\001\
\034\001\034\001\000\000\034\001\034\001\034\001\034\001\034\001\
\034\001\034\001\034\001\000\000\000\000\000\000\000\000\034\001\
\034\001\000\000\000\000\034\001\034\001\034\001\034\001\034\001\
\034\001\034\001\034\001\034\001\034\001\034\001\034\001\034\001\
\000\000\034\001\034\001\034\001\034\001\000\000\000\000\034\001\
\034\001\034\001\000\000\034\001\034\001\034\001\034\001\034\001\
\034\001\000\000\034\001\034\001\034\001\034\001\034\001\000\000\
\034\001\034\001\000\000\000\000\000\000\034\001\034\001\034\001\
\034\001\034\001\034\001\034\001\034\001\000\000\034\001\000\000\
\034\001\034\001\000\000\034\001\034\001\034\001\034\001\034\001\
\071\001\034\001\034\001\000\000\034\001\034\001\034\001\034\001\
\000\000\034\001\034\001\000\000\034\001\000\000\000\000\000\000\
\034\001\000\000\032\001\032\001\032\001\032\001\000\000\000\000\
\032\001\032\001\032\001\032\001\032\001\032\001\032\001\032\001\
\032\001\032\001\032\001\032\001\032\001\032\001\032\001\032\001\
\032\001\000\000\032\001\032\001\032\001\032\001\032\001\032\001\
\032\001\032\001\000\000\000\000\000\000\000\000\032\001\032\001\
\000\000\000\000\032\001\032\001\032\001\032\001\032\001\032\001\
\032\001\032\001\032\001\032\001\032\001\032\001\032\001\000\000\
\032\001\032\001\032\001\032\001\000\000\000\000\032\001\032\001\
\032\001\000\000\032\001\032\001\032\001\032\001\032\001\032\001\
\000\000\032\001\032\001\032\001\032\001\032\001\000\000\032\001\
\032\001\000\000\000\000\000\000\032\001\032\001\032\001\032\001\
\032\001\032\001\032\001\032\001\000\000\032\001\000\000\032\001\
\032\001\000\000\032\001\032\001\032\001\032\001\032\001\074\001\
\032\001\032\001\000\000\032\001\032\001\032\001\032\001\000\000\
\032\001\032\001\000\000\032\001\000\000\000\000\000\000\032\001\
\069\001\069\001\069\001\069\001\069\001\000\000\069\001\069\001\
\069\001\069\001\069\001\069\001\069\001\069\001\069\001\069\001\
\069\001\069\001\069\001\069\001\069\001\069\001\000\000\000\000\
\069\001\069\001\069\001\069\001\069\001\069\001\069\001\069\001\
\000\000\000\000\000\000\000\000\069\001\069\001\000\000\000\000\
\069\001\069\001\069\001\069\001\069\001\069\001\069\001\069\001\
\069\001\069\001\069\001\069\001\069\001\000\000\069\001\069\001\
\069\001\069\001\000\000\000\000\069\001\069\001\069\001\000\000\
\069\001\069\001\069\001\069\001\069\001\069\001\000\000\069\001\
\069\001\069\001\069\001\069\001\000\000\069\001\069\001\000\000\
\000\000\000\000\069\001\069\001\069\001\069\001\069\001\069\001\
\069\001\069\001\000\000\069\001\000\000\069\001\069\001\000\000\
\069\001\069\001\069\001\000\000\000\000\021\001\069\001\069\001\
\000\000\069\001\069\001\069\001\069\001\000\000\069\001\069\001\
\000\000\069\001\000\000\000\000\000\000\069\001\000\000\000\000\
\071\001\071\001\071\001\071\001\071\001\000\000\071\001\071\001\
\071\001\071\001\071\001\071\001\071\001\071\001\071\001\071\001\
\071\001\071\001\071\001\071\001\071\001\071\001\000\000\000\000\
\071\001\071\001\071\001\071\001\071\001\071\001\071\001\071\001\
\000\000\000\000\000\000\000\000\071\001\071\001\000\000\000\000\
\071\001\071\001\071\001\071\001\071\001\071\001\071\001\071\001\
\071\001\071\001\071\001\071\001\071\001\000\000\071\001\071\001\
\071\001\071\001\000\000\000\000\071\001\071\001\071\001\000\000\
\071\001\071\001\071\001\071\001\071\001\071\001\000\000\071\001\
\071\001\071\001\071\001\071\001\000\000\071\001\071\001\000\000\
\000\000\000\000\071\001\071\001\071\001\071\001\071\001\071\001\
\071\001\071\001\000\000\071\001\000\000\071\001\071\001\000\000\
\071\001\071\001\071\001\022\001\000\000\000\000\071\001\071\001\
\000\000\071\001\071\001\071\001\071\001\000\000\071\001\071\001\
\000\000\071\001\000\000\000\000\000\000\071\001\000\000\074\001\
\074\001\074\001\074\001\074\001\000\000\074\001\074\001\074\001\
\074\001\074\001\074\001\074\001\074\001\074\001\074\001\074\001\
\074\001\074\001\074\001\074\001\074\001\000\000\000\000\074\001\
\074\001\074\001\074\001\074\001\074\001\074\001\074\001\000\000\
\000\000\000\000\000\000\074\001\074\001\000\000\000\000\074\001\
\074\001\074\001\074\001\074\001\074\001\074\001\074\001\074\001\
\074\001\074\001\074\001\074\001\000\000\074\001\074\001\074\001\
\074\001\000\000\000\000\074\001\074\001\074\001\000\000\074\001\
\074\001\074\001\074\001\074\001\074\001\000\000\074\001\074\001\
\074\001\074\001\074\001\000\000\074\001\074\001\000\000\000\000\
\000\000\074\001\074\001\074\001\074\001\074\001\074\001\074\001\
\074\001\000\000\074\001\000\000\074\001\074\001\000\000\074\001\
\074\001\074\001\223\000\000\000\000\000\074\001\074\001\000\000\
\074\001\074\001\074\001\074\001\000\000\074\001\074\001\000\000\
\074\001\000\000\000\000\000\000\074\001\021\001\021\001\021\001\
\021\001\000\000\000\000\000\000\000\000\021\001\021\001\021\001\
\000\000\000\000\021\001\021\001\021\001\021\001\021\001\021\001\
\021\001\021\001\021\001\021\001\000\000\021\001\021\001\021\001\
\021\001\021\001\021\001\000\000\000\000\000\000\000\000\000\000\
\000\000\021\001\021\001\000\000\000\000\021\001\021\001\021\001\
\021\001\021\001\021\001\021\001\021\001\021\001\000\000\000\000\
\000\000\021\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\021\001\021\001\000\000\021\001\000\000\000\000\
\021\001\021\001\021\001\000\000\021\001\021\001\021\001\021\001\
\021\001\000\000\000\000\000\000\000\000\000\000\000\000\021\001\
\021\001\021\001\021\001\021\001\021\001\021\001\000\000\000\000\
\021\001\000\000\021\001\021\001\000\000\021\001\021\001\021\001\
\021\001\021\001\234\000\021\001\000\000\000\000\021\001\021\001\
\021\001\000\000\000\000\021\001\000\000\000\000\021\001\000\000\
\000\000\000\000\021\001\022\001\022\001\022\001\022\001\000\000\
\000\000\000\000\000\000\022\001\022\001\022\001\000\000\000\000\
\022\001\022\001\022\001\022\001\022\001\022\001\022\001\022\001\
\022\001\022\001\000\000\022\001\022\001\022\001\022\001\022\001\
\022\001\000\000\000\000\000\000\000\000\000\000\000\000\022\001\
\022\001\000\000\000\000\022\001\022\001\022\001\022\001\022\001\
\022\001\022\001\022\001\022\001\000\000\000\000\000\000\022\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\022\001\022\001\000\000\022\001\000\000\000\000\022\001\022\001\
\022\001\000\000\022\001\022\001\022\001\022\001\022\001\000\000\
\000\000\000\000\000\000\000\000\000\000\022\001\022\001\022\001\
\022\001\022\001\022\001\022\001\000\000\000\000\022\001\000\000\
\022\001\022\001\000\000\022\001\022\001\022\001\022\001\022\001\
\235\000\022\001\000\000\000\000\022\001\022\001\022\001\000\000\
\000\000\022\001\000\000\000\000\022\001\000\000\000\000\000\000\
\022\001\000\000\223\000\223\000\223\000\223\000\000\000\000\000\
\000\000\000\000\223\000\223\000\223\000\000\000\000\000\223\000\
\223\000\223\000\223\000\223\000\223\000\223\000\223\000\223\000\
\000\000\000\000\223\000\223\000\223\000\223\000\223\000\223\000\
\000\000\000\000\000\000\000\000\000\000\000\000\223\000\223\000\
\000\000\000\000\223\000\223\000\223\000\223\000\223\000\223\000\
\223\000\223\000\223\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\223\000\
\223\000\000\000\223\000\000\000\000\000\223\000\223\000\223\000\
\000\000\223\000\223\000\223\000\223\000\223\000\000\000\000\000\
\000\000\000\000\000\000\000\000\223\000\000\000\223\000\223\000\
\223\000\223\000\223\000\000\000\000\000\000\000\000\000\223\000\
\223\000\000\000\223\000\223\000\223\000\000\000\236\000\000\000\
\223\000\000\000\000\000\223\000\000\000\223\000\000\000\000\000\
\223\000\000\000\000\000\223\000\000\000\000\000\000\000\223\000\
\000\000\000\000\234\000\234\000\234\000\234\000\000\000\000\000\
\000\000\000\000\234\000\234\000\234\000\000\000\000\000\234\000\
\234\000\234\000\234\000\234\000\000\000\234\000\234\000\234\000\
\000\000\000\000\234\000\234\000\234\000\234\000\234\000\234\000\
\000\000\000\000\000\000\000\000\000\000\000\000\234\000\234\000\
\000\000\000\000\234\000\234\000\234\000\234\000\234\000\234\000\
\234\000\234\000\234\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\234\000\
\234\000\000\000\234\000\000\000\000\000\234\000\234\000\234\000\
\000\000\234\000\234\000\234\000\234\000\234\000\000\000\000\000\
\000\000\000\000\000\000\000\000\234\000\000\000\234\000\234\000\
\234\000\234\000\234\000\000\000\000\000\000\000\000\000\234\000\
\234\000\000\000\234\000\234\000\234\000\234\000\014\001\000\000\
\234\000\000\000\000\000\234\000\000\000\234\000\000\000\000\000\
\234\000\000\000\000\000\234\000\000\000\000\000\000\000\234\000\
\235\000\235\000\235\000\235\000\000\000\000\000\000\000\000\000\
\235\000\235\000\235\000\000\000\000\000\235\000\235\000\235\000\
\235\000\235\000\235\000\235\000\235\000\235\000\000\000\000\000\
\235\000\235\000\235\000\235\000\235\000\235\000\000\000\000\000\
\000\000\000\000\000\000\000\000\235\000\235\000\000\000\000\000\
\235\000\235\000\235\000\235\000\235\000\235\000\235\000\235\000\
\235\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\235\000\235\000\000\000\
\235\000\000\000\000\000\235\000\235\000\235\000\000\000\235\000\
\235\000\235\000\235\000\235\000\000\000\000\000\000\000\000\000\
\000\000\000\000\235\000\000\000\235\000\235\000\235\000\235\000\
\235\000\000\000\000\000\000\000\000\000\235\000\235\000\000\000\
\235\000\235\000\235\000\000\000\015\001\000\000\235\000\000\000\
\000\000\235\000\000\000\235\000\000\000\000\000\235\000\000\000\
\000\000\235\000\000\000\000\000\000\000\235\000\236\000\236\000\
\236\000\236\000\000\000\000\000\000\000\000\000\236\000\236\000\
\236\000\000\000\000\000\236\000\236\000\236\000\236\000\236\000\
\236\000\236\000\236\000\236\000\000\000\000\000\236\000\236\000\
\236\000\236\000\236\000\236\000\000\000\000\000\000\000\000\000\
\000\000\000\000\236\000\236\000\000\000\000\000\236\000\236\000\
\236\000\236\000\236\000\236\000\236\000\236\000\236\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\236\000\236\000\000\000\236\000\000\000\
\000\000\236\000\236\000\236\000\000\000\236\000\236\000\236\000\
\236\000\236\000\000\000\000\000\000\000\000\000\000\000\000\000\
\236\000\000\000\236\000\236\000\236\000\236\000\236\000\000\000\
\000\000\000\000\000\000\236\000\236\000\000\000\236\000\236\000\
\236\000\000\000\246\000\000\000\236\000\000\000\000\000\236\000\
\000\000\236\000\000\000\000\000\236\000\000\000\000\000\236\000\
\000\000\000\000\000\000\236\000\000\000\000\000\014\001\014\001\
\014\001\014\001\000\000\000\000\000\000\000\000\014\001\014\001\
\014\001\000\000\000\000\014\001\014\001\014\001\014\001\014\001\
\014\001\014\001\014\001\014\001\000\000\000\000\014\001\014\001\
\014\001\014\001\014\001\014\001\000\000\000\000\000\000\000\000\
\000\000\000\000\014\001\014\001\000\000\000\000\014\001\014\001\
\014\001\014\001\014\001\014\001\014\001\014\001\014\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\014\001\014\001\000\000\014\001\000\000\
\000\000\014\001\014\001\014\001\000\000\014\001\014\001\014\001\
\014\001\014\001\000\000\000\000\000\000\000\000\000\000\000\000\
\014\001\000\000\014\001\014\001\014\001\014\001\014\001\000\000\
\000\000\000\000\000\000\014\001\014\001\000\000\014\001\014\001\
\014\001\247\000\000\000\000\000\014\001\000\000\000\000\014\001\
\000\000\014\001\000\000\000\000\014\001\000\000\000\000\014\001\
\000\000\000\000\000\000\014\001\015\001\015\001\015\001\015\001\
\000\000\000\000\000\000\000\000\015\001\015\001\015\001\000\000\
\000\000\015\001\015\001\015\001\015\001\015\001\015\001\015\001\
\015\001\015\001\000\000\000\000\015\001\015\001\015\001\015\001\
\015\001\015\001\000\000\000\000\000\000\000\000\000\000\000\000\
\015\001\015\001\000\000\000\000\015\001\015\001\015\001\015\001\
\015\001\015\001\015\001\015\001\015\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\015\001\015\001\000\000\015\001\000\000\000\000\015\001\
\015\001\015\001\000\000\015\001\015\001\015\001\015\001\015\001\
\000\000\000\000\000\000\000\000\000\000\000\000\015\001\000\000\
\015\001\015\001\015\001\015\001\015\001\000\000\000\000\000\000\
\000\000\015\001\015\001\000\000\015\001\015\001\015\001\254\000\
\000\000\000\000\015\001\000\000\000\000\015\001\000\000\015\001\
\000\000\000\000\015\001\000\000\000\000\015\001\000\000\000\000\
\000\000\015\001\246\000\246\000\246\000\246\000\000\000\000\000\
\000\000\000\000\246\000\246\000\246\000\000\000\000\000\246\000\
\246\000\246\000\246\000\246\000\246\000\246\000\246\000\246\000\
\000\000\000\000\246\000\246\000\246\000\246\000\246\000\246\000\
\000\000\000\000\000\000\000\000\000\000\000\000\246\000\246\000\
\000\000\000\000\246\000\246\000\246\000\246\000\246\000\246\000\
\000\000\246\000\246\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\246\000\
\246\000\000\000\246\000\000\000\000\000\246\000\246\000\246\000\
\000\000\246\000\246\000\246\000\246\000\246\000\000\000\000\000\
\000\000\000\000\000\000\000\000\246\000\000\000\246\000\246\000\
\246\000\246\000\246\000\000\000\000\000\000\000\000\000\246\000\
\246\000\000\000\246\000\246\000\246\000\246\000\253\000\000\000\
\246\000\000\000\000\000\246\000\000\000\246\000\000\000\000\000\
\246\000\000\000\000\000\246\000\000\000\000\000\000\000\246\000\
\000\000\247\000\247\000\247\000\247\000\000\000\000\000\000\000\
\000\000\247\000\247\000\247\000\000\000\000\000\247\000\247\000\
\247\000\247\000\247\000\247\000\247\000\247\000\247\000\000\000\
\000\000\247\000\247\000\247\000\247\000\247\000\247\000\000\000\
\000\000\000\000\000\000\000\000\000\000\247\000\247\000\000\000\
\000\000\247\000\247\000\247\000\247\000\247\000\247\000\000\000\
\247\000\247\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\247\000\247\000\
\000\000\247\000\000\000\000\000\247\000\247\000\247\000\000\000\
\247\000\247\000\247\000\247\000\247\000\000\000\000\000\000\000\
\000\000\000\000\000\000\247\000\000\000\247\000\247\000\247\000\
\247\000\247\000\000\000\000\000\000\000\000\000\247\000\247\000\
\000\000\247\000\247\000\247\000\247\000\228\000\000\000\247\000\
\000\000\000\000\247\000\000\000\247\000\000\000\000\000\247\000\
\000\000\000\000\247\000\000\000\000\000\000\000\247\000\254\000\
\254\000\254\000\254\000\000\000\000\000\000\000\000\000\254\000\
\254\000\254\000\000\000\000\000\254\000\254\000\254\000\254\000\
\254\000\254\000\254\000\254\000\254\000\000\000\000\000\254\000\
\254\000\254\000\254\000\254\000\254\000\000\000\000\000\000\000\
\000\000\000\000\000\000\254\000\254\000\000\000\000\000\254\000\
\254\000\254\000\254\000\254\000\254\000\000\000\254\000\254\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\254\000\254\000\000\000\254\000\
\000\000\000\000\254\000\254\000\254\000\000\000\254\000\254\000\
\254\000\254\000\254\000\000\000\000\000\000\000\000\000\000\000\
\000\000\254\000\000\000\254\000\254\000\254\000\254\000\254\000\
\000\000\000\000\000\000\000\000\254\000\254\000\000\000\254\000\
\254\000\254\000\254\000\231\000\000\000\254\000\000\000\000\000\
\254\000\000\000\254\000\000\000\000\000\254\000\000\000\000\000\
\254\000\000\000\000\000\000\000\254\000\000\000\253\000\253\000\
\253\000\253\000\000\000\000\000\000\000\000\000\253\000\253\000\
\253\000\000\000\000\000\253\000\253\000\253\000\253\000\253\000\
\253\000\253\000\253\000\253\000\000\000\000\000\253\000\253\000\
\253\000\253\000\253\000\253\000\000\000\000\000\000\000\000\000\
\000\000\000\000\253\000\253\000\000\000\000\000\253\000\253\000\
\253\000\253\000\253\000\253\000\000\000\253\000\253\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\253\000\253\000\000\000\253\000\000\000\
\000\000\253\000\253\000\253\000\000\000\253\000\253\000\253\000\
\253\000\253\000\000\000\000\000\000\000\000\000\000\000\000\000\
\253\000\000\000\253\000\253\000\253\000\253\000\253\000\000\000\
\000\000\000\000\000\000\253\000\253\000\000\000\253\000\253\000\
\253\000\253\000\232\000\000\000\253\000\000\000\000\000\253\000\
\000\000\253\000\000\000\000\000\253\000\000\000\000\000\253\000\
\000\000\000\000\000\000\253\000\000\000\228\000\228\000\228\000\
\228\000\000\000\000\000\000\000\000\000\000\000\228\000\228\000\
\000\000\000\000\228\000\228\000\228\000\228\000\228\000\228\000\
\228\000\228\000\228\000\000\000\000\000\228\000\228\000\228\000\
\228\000\228\000\228\000\000\000\000\000\000\000\000\000\000\000\
\000\000\228\000\228\000\000\000\000\000\228\000\228\000\228\000\
\228\000\228\000\228\000\228\000\228\000\228\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\228\000\228\000\000\000\228\000\000\000\000\000\
\228\000\228\000\228\000\000\000\228\000\228\000\228\000\228\000\
\228\000\000\000\000\000\000\000\000\000\000\000\000\000\228\000\
\000\000\228\000\228\000\228\000\228\000\228\000\000\000\000\000\
\000\000\000\000\228\000\228\000\000\000\228\000\228\000\228\000\
\228\000\245\000\000\000\228\000\000\000\000\000\228\000\000\000\
\228\000\000\000\000\000\228\000\000\000\000\000\228\000\000\000\
\000\000\000\000\228\000\231\000\231\000\231\000\231\000\000\000\
\000\000\000\000\000\000\000\000\231\000\231\000\000\000\000\000\
\231\000\231\000\231\000\231\000\231\000\231\000\231\000\231\000\
\231\000\000\000\000\000\231\000\231\000\231\000\231\000\231\000\
\231\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\
\231\000\000\000\000\000\231\000\231\000\231\000\231\000\231\000\
\231\000\231\000\231\000\231\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\231\000\231\000\000\000\231\000\000\000\000\000\231\000\231\000\
\231\000\000\000\231\000\231\000\231\000\231\000\231\000\000\000\
\000\000\000\000\000\000\000\000\000\000\231\000\000\000\231\000\
\231\000\231\000\231\000\231\000\000\000\000\000\000\000\000\000\
\231\000\231\000\000\000\231\000\231\000\231\000\231\000\251\000\
\000\000\231\000\000\000\000\000\231\000\000\000\231\000\000\000\
\000\000\231\000\000\000\000\000\231\000\000\000\000\000\000\000\
\231\000\000\000\232\000\232\000\232\000\232\000\000\000\000\000\
\000\000\000\000\000\000\232\000\232\000\000\000\000\000\232\000\
\232\000\232\000\232\000\232\000\232\000\232\000\232\000\232\000\
\000\000\000\000\232\000\232\000\232\000\232\000\232\000\232\000\
\000\000\000\000\000\000\000\000\000\000\000\000\232\000\232\000\
\000\000\000\000\232\000\232\000\232\000\232\000\232\000\232\000\
\232\000\232\000\232\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\232\000\
\232\000\000\000\232\000\000\000\000\000\232\000\232\000\232\000\
\000\000\232\000\232\000\232\000\232\000\232\000\000\000\000\000\
\000\000\000\000\000\000\000\000\232\000\000\000\232\000\232\000\
\232\000\232\000\232\000\000\000\000\000\000\000\000\000\232\000\
\232\000\000\000\232\000\232\000\232\000\232\000\252\000\000\000\
\232\000\000\000\000\000\232\000\000\000\232\000\000\000\000\000\
\232\000\000\000\000\000\232\000\000\000\000\000\000\000\232\000\
\000\000\245\000\245\000\245\000\245\000\000\000\000\000\000\000\
\000\000\245\000\245\000\245\000\000\000\000\000\245\000\245\000\
\245\000\245\000\245\000\245\000\245\000\245\000\245\000\000\000\
\000\000\245\000\245\000\245\000\245\000\245\000\245\000\000\000\
\000\000\000\000\000\000\000\000\000\000\245\000\245\000\000\000\
\000\000\245\000\245\000\245\000\245\000\245\000\000\000\000\000\
\245\000\245\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\245\000\245\000\
\000\000\245\000\000\000\000\000\245\000\245\000\245\000\000\000\
\245\000\245\000\245\000\245\000\245\000\000\000\000\000\000\000\
\000\000\000\000\000\000\245\000\000\000\245\000\000\000\245\000\
\245\000\245\000\000\000\000\000\000\000\000\000\245\000\245\000\
\000\000\245\000\245\000\245\000\245\000\248\000\000\000\000\000\
\000\000\000\000\245\000\000\000\245\000\000\000\000\000\245\000\
\000\000\000\000\245\000\000\000\000\000\000\000\245\000\251\000\
\251\000\251\000\251\000\000\000\000\000\000\000\000\000\251\000\
\251\000\251\000\000\000\000\000\251\000\251\000\251\000\251\000\
\251\000\251\000\251\000\251\000\251\000\000\000\000\000\251\000\
\251\000\251\000\251\000\251\000\251\000\000\000\000\000\000\000\
\000\000\000\000\000\000\251\000\251\000\000\000\000\000\251\000\
\251\000\251\000\251\000\251\000\000\000\000\000\251\000\251\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\251\000\251\000\000\000\251\000\
\000\000\000\000\251\000\251\000\251\000\000\000\251\000\251\000\
\251\000\251\000\251\000\000\000\000\000\000\000\000\000\000\000\
\000\000\251\000\000\000\251\000\000\000\251\000\251\000\251\000\
\000\000\000\000\000\000\000\000\251\000\251\000\000\000\251\000\
\251\000\251\000\251\000\249\000\000\000\000\000\000\000\000\000\
\251\000\000\000\251\000\000\000\000\000\251\000\000\000\000\000\
\251\000\000\000\000\000\000\000\251\000\000\000\252\000\252\000\
\252\000\252\000\000\000\000\000\000\000\000\000\252\000\252\000\
\252\000\000\000\000\000\252\000\252\000\252\000\252\000\252\000\
\252\000\252\000\252\000\252\000\000\000\000\000\252\000\252\000\
\252\000\252\000\252\000\252\000\000\000\000\000\000\000\000\000\
\000\000\000\000\252\000\252\000\000\000\000\000\252\000\252\000\
\252\000\252\000\252\000\000\000\000\000\252\000\252\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\252\000\252\000\000\000\252\000\000\000\
\000\000\252\000\252\000\252\000\000\000\252\000\252\000\252\000\
\252\000\252\000\000\000\000\000\000\000\000\000\000\000\000\000\
\252\000\000\000\252\000\000\000\252\000\252\000\252\000\000\000\
\000\000\000\000\000\000\252\000\252\000\000\000\252\000\252\000\
\252\000\252\000\250\000\000\000\000\000\000\000\000\000\252\000\
\000\000\252\000\000\000\000\000\252\000\000\000\000\000\252\000\
\000\000\000\000\000\000\252\000\000\000\248\000\248\000\248\000\
\248\000\000\000\000\000\000\000\000\000\248\000\248\000\248\000\
\000\000\000\000\248\000\248\000\248\000\248\000\248\000\248\000\
\248\000\248\000\248\000\000\000\000\000\248\000\248\000\248\000\
\248\000\248\000\248\000\000\000\000\000\000\000\000\000\000\000\
\000\000\248\000\248\000\000\000\000\000\248\000\248\000\248\000\
\248\000\248\000\000\000\000\000\248\000\248\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\248\000\248\000\000\000\248\000\000\000\000\000\
\248\000\248\000\248\000\000\000\248\000\248\000\248\000\248\000\
\248\000\000\000\000\000\000\000\000\000\000\000\000\000\248\000\
\000\000\248\000\000\000\248\000\248\000\248\000\000\000\000\000\
\000\000\000\000\248\000\248\000\000\000\248\000\248\000\248\000\
\248\000\204\000\000\000\000\000\000\000\000\000\248\000\000\000\
\248\000\000\000\000\000\248\000\000\000\000\000\248\000\000\000\
\000\000\000\000\248\000\249\000\249\000\249\000\249\000\000\000\
\000\000\000\000\000\000\249\000\249\000\249\000\000\000\000\000\
\249\000\249\000\249\000\249\000\249\000\249\000\249\000\249\000\
\249\000\000\000\000\000\249\000\249\000\249\000\249\000\249\000\
\249\000\000\000\000\000\000\000\000\000\000\000\000\000\249\000\
\249\000\000\000\000\000\249\000\249\000\249\000\249\000\249\000\
\000\000\000\000\249\000\249\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\249\000\249\000\000\000\249\000\000\000\000\000\249\000\249\000\
\249\000\000\000\249\000\249\000\249\000\249\000\249\000\000\000\
\000\000\000\000\000\000\000\000\000\000\249\000\000\000\249\000\
\000\000\249\000\249\000\249\000\000\000\000\000\000\000\000\000\
\249\000\249\000\000\000\249\000\249\000\249\000\249\000\255\000\
\000\000\000\000\000\000\000\000\249\000\000\000\249\000\000\000\
\000\000\249\000\000\000\000\000\249\000\000\000\000\000\000\000\
\249\000\000\000\250\000\250\000\250\000\250\000\000\000\000\000\
\000\000\000\000\250\000\250\000\250\000\000\000\000\000\250\000\
\250\000\250\000\250\000\250\000\250\000\250\000\250\000\250\000\
\000\000\000\000\250\000\250\000\250\000\250\000\250\000\250\000\
\000\000\000\000\000\000\000\000\000\000\000\000\250\000\250\000\
\000\000\000\000\250\000\250\000\250\000\250\000\250\000\000\000\
\000\000\250\000\250\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\250\000\
\250\000\000\000\250\000\000\000\000\000\250\000\250\000\250\000\
\000\000\250\000\250\000\250\000\250\000\250\000\000\000\000\000\
\000\000\000\000\000\000\000\000\250\000\000\000\250\000\000\000\
\250\000\250\000\250\000\000\000\000\000\000\000\000\000\250\000\
\250\000\000\000\250\000\250\000\250\000\250\000\001\001\000\000\
\000\000\000\000\000\000\250\000\000\000\250\000\000\000\000\000\
\250\000\000\000\000\000\250\000\000\000\000\000\000\000\250\000\
\000\000\204\000\204\000\204\000\204\000\000\000\000\000\000\000\
\000\000\204\000\204\000\204\000\000\000\000\000\204\000\204\000\
\204\000\204\000\204\000\204\000\204\000\204\000\204\000\000\000\
\000\000\204\000\204\000\204\000\204\000\204\000\204\000\000\000\
\000\000\000\000\000\000\000\000\000\000\204\000\204\000\000\000\
\000\000\204\000\204\000\204\000\204\000\204\000\204\000\204\000\
\204\000\204\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\204\000\204\000\
\000\000\000\000\000\000\000\000\204\000\204\000\204\000\000\000\
\204\000\000\000\000\000\204\000\204\000\000\000\000\000\000\000\
\000\000\000\000\000\000\204\000\000\000\204\000\204\000\000\000\
\000\000\204\000\000\000\000\000\000\000\000\000\204\000\204\000\
\000\000\204\000\204\000\204\000\204\000\243\000\000\000\204\000\
\000\000\000\000\204\000\000\000\204\000\000\000\000\000\204\000\
\000\000\000\000\204\000\000\000\000\000\000\000\204\000\255\000\
\255\000\255\000\255\000\000\000\000\000\000\000\000\000\255\000\
\255\000\255\000\000\000\000\000\255\000\255\000\000\000\255\000\
\255\000\255\000\255\000\255\000\255\000\000\000\000\000\255\000\
\255\000\255\000\255\000\255\000\255\000\000\000\000\000\000\000\
\000\000\000\000\000\000\255\000\255\000\000\000\000\000\255\000\
\255\000\255\000\000\000\000\000\000\000\000\000\255\000\255\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\255\000\255\000\000\000\255\000\
\000\000\000\000\000\000\255\000\255\000\000\000\255\000\000\000\
\000\000\255\000\255\000\000\000\000\000\000\000\000\000\000\000\
\000\000\255\000\000\000\255\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\255\000\255\000\000\000\255\000\
\255\000\255\000\255\000\244\000\000\000\000\000\000\000\000\000\
\255\000\000\000\255\000\000\000\000\000\255\000\000\000\000\000\
\255\000\000\000\000\000\000\000\255\000\000\000\001\001\001\001\
\001\001\001\001\000\000\000\000\000\000\000\000\001\001\001\001\
\001\001\000\000\000\000\001\001\001\001\000\000\001\001\001\001\
\001\001\001\001\001\001\001\001\000\000\000\000\001\001\001\001\
\001\001\001\001\001\001\001\001\000\000\000\000\000\000\000\000\
\000\000\000\000\001\001\001\001\000\000\000\000\001\001\001\001\
\001\001\000\000\000\000\000\000\000\000\001\001\001\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\001\001\001\001\000\000\001\001\000\000\
\000\000\000\000\001\001\001\001\000\000\001\001\000\000\000\000\
\001\001\001\001\000\000\000\000\000\000\000\000\000\000\000\000\
\001\001\000\000\001\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\001\001\001\001\000\000\001\001\001\001\
\001\001\001\001\000\001\000\000\000\000\000\000\000\000\001\001\
\000\000\001\001\000\000\000\000\001\001\000\000\000\000\001\001\
\000\000\000\000\000\000\001\001\000\000\243\000\243\000\243\000\
\243\000\000\000\000\000\000\000\000\000\243\000\243\000\243\000\
\000\000\000\000\243\000\243\000\000\000\243\000\243\000\243\000\
\243\000\243\000\243\000\000\000\000\000\243\000\243\000\243\000\
\243\000\243\000\243\000\000\000\000\000\000\000\000\000\000\000\
\000\000\243\000\243\000\000\000\000\000\243\000\243\000\243\000\
\000\000\000\000\000\000\000\000\243\000\243\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\243\000\243\000\000\000\243\000\000\000\000\000\
\000\000\243\000\243\000\000\000\243\000\000\000\000\000\243\000\
\243\000\000\000\000\000\000\000\000\000\000\000\000\000\243\000\
\000\000\243\000\000\000\000\000\005\001\000\000\000\000\000\000\
\000\000\000\000\243\000\243\000\000\000\243\000\243\000\243\000\
\243\000\000\000\000\000\000\000\000\000\000\000\243\000\000\000\
\243\000\000\000\000\000\243\000\000\000\000\000\243\000\000\000\
\000\000\000\000\243\000\244\000\244\000\244\000\244\000\000\000\
\000\000\000\000\000\000\244\000\244\000\244\000\000\000\000\000\
\244\000\244\000\000\000\244\000\244\000\244\000\244\000\244\000\
\244\000\000\000\000\000\244\000\244\000\244\000\244\000\244\000\
\244\000\000\000\000\000\000\000\000\000\000\000\000\000\244\000\
\244\000\000\000\000\000\244\000\244\000\244\000\000\000\000\000\
\000\000\000\000\244\000\244\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\244\000\244\000\000\000\244\000\000\000\000\000\000\000\244\000\
\244\000\000\000\244\000\000\000\000\000\244\000\244\000\000\000\
\000\000\000\000\000\000\004\001\000\000\244\000\000\000\244\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\244\000\244\000\000\000\244\000\244\000\244\000\244\000\000\000\
\000\000\000\000\000\000\000\000\244\000\000\000\244\000\000\000\
\000\000\244\000\000\000\000\000\244\000\000\000\000\000\000\000\
\244\000\000\000\000\001\000\001\000\001\000\001\000\000\000\000\
\000\000\000\000\000\001\000\001\000\001\000\000\000\000\000\001\
\000\001\000\000\000\001\000\001\000\001\000\001\000\001\000\001\
\000\000\000\000\000\001\000\001\000\001\000\001\000\001\000\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\001\
\000\000\000\000\000\001\000\001\000\001\000\000\000\000\000\000\
\000\000\000\001\000\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\
\000\001\000\000\000\001\000\000\000\000\100\001\000\001\000\001\
\000\000\000\001\000\000\000\000\000\001\000\001\000\000\000\000\
\000\000\000\000\000\000\000\000\000\001\000\000\000\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\
\000\001\000\000\000\001\000\001\000\001\000\001\000\000\000\000\
\000\000\000\000\000\000\000\001\005\001\000\001\000\000\005\001\
\000\001\000\000\000\000\000\001\005\001\005\001\005\001\000\001\
\000\000\005\001\005\001\000\000\005\001\005\001\005\001\005\001\
\005\001\005\001\000\000\000\000\005\001\005\001\005\001\000\000\
\005\001\005\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\005\001\000\000\000\000\005\001\005\001\000\000\000\000\
\000\000\000\000\000\000\005\001\005\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\005\001\000\000\000\000\005\001\000\000\000\000\002\001\
\005\001\005\001\000\000\005\001\000\000\000\000\005\001\005\001\
\000\000\000\000\000\000\000\000\000\000\000\000\005\001\000\000\
\005\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\005\001\005\001\000\000\005\001\005\001\005\001\005\001\
\000\000\000\000\000\000\000\000\000\000\005\001\000\000\005\001\
\000\000\000\000\005\001\004\001\000\000\005\001\004\001\000\000\
\000\000\005\001\000\000\004\001\004\001\004\001\000\000\000\000\
\004\001\004\001\000\000\004\001\004\001\004\001\004\001\004\001\
\004\001\000\000\000\000\004\001\004\001\004\001\000\000\004\001\
\004\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\004\001\000\000\000\000\004\001\004\001\000\000\000\000\000\000\
\000\000\000\000\004\001\004\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\004\001\099\001\000\000\004\001\000\000\000\000\000\000\004\001\
\004\001\000\000\004\001\000\000\000\000\004\001\004\001\000\000\
\000\000\000\000\000\000\000\000\000\000\004\001\000\000\004\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\004\001\004\001\000\000\004\001\004\001\004\001\004\001\000\000\
\000\000\000\000\000\000\000\000\004\001\100\001\004\001\000\000\
\100\001\004\001\000\000\000\000\004\001\100\001\000\000\100\001\
\004\001\000\000\100\001\100\001\000\000\100\001\100\001\100\001\
\100\001\100\001\100\001\000\000\000\000\100\001\100\001\100\001\
\000\000\100\001\100\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\100\001\000\000\000\000\100\001\100\001\000\000\
\000\000\000\000\000\000\000\000\100\001\100\001\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\009\001\000\000\
\000\000\000\000\100\001\000\000\000\000\100\001\000\000\000\000\
\000\000\100\001\100\001\000\000\100\001\000\000\000\000\100\001\
\100\001\000\000\000\000\000\000\000\000\000\000\000\000\100\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\100\001\100\001\000\000\100\001\100\001\100\001\
\100\001\000\000\000\000\000\000\000\000\000\000\100\001\002\001\
\100\001\000\000\002\001\100\001\000\000\000\000\100\001\002\001\
\000\000\002\001\100\001\000\000\002\001\002\001\000\000\002\001\
\002\001\002\001\002\001\002\001\002\001\000\000\000\000\002\001\
\002\001\002\001\000\000\002\001\002\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\002\001\000\000\000\000\002\001\
\002\001\000\000\000\000\000\000\000\000\000\000\002\001\002\001\
\000\000\000\000\000\000\237\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\002\001\000\000\000\000\002\001\
\000\000\000\000\000\000\002\001\002\001\000\000\002\001\000\000\
\000\000\002\001\002\001\000\000\000\000\000\000\000\000\000\000\
\000\000\002\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\002\001\002\001\000\000\002\001\
\002\001\002\001\002\001\000\000\000\000\000\000\000\000\000\000\
\002\001\099\001\002\001\000\000\099\001\002\001\000\000\000\000\
\002\001\099\001\000\000\099\001\002\001\000\000\099\001\099\001\
\000\000\099\001\099\001\099\001\099\001\099\001\099\001\000\000\
\000\000\099\001\099\001\099\001\000\000\099\001\099\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\099\001\000\000\
\000\000\099\001\099\001\000\000\000\000\000\000\000\000\000\000\
\099\001\099\001\000\000\000\000\000\000\012\001\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\099\001\000\000\
\000\000\099\001\000\000\000\000\000\000\099\001\099\001\000\000\
\099\001\000\000\000\000\099\001\099\001\000\000\000\000\000\000\
\000\000\000\000\000\000\099\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\099\001\099\001\
\000\000\099\001\099\001\099\001\099\001\000\000\009\001\000\000\
\000\000\009\001\099\001\000\000\099\001\000\000\009\001\099\001\
\009\001\000\000\099\001\009\001\009\001\000\000\099\001\009\001\
\000\000\009\001\009\001\009\001\000\000\000\000\009\001\009\001\
\009\001\000\000\009\001\009\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\009\001\000\000\000\000\009\001\009\001\
\000\000\000\000\000\000\000\000\000\000\009\001\009\001\000\000\
\000\000\000\000\011\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\009\001\000\000\000\000\009\001\000\000\
\000\000\000\000\009\001\009\001\000\000\009\001\000\000\000\000\
\009\001\009\001\000\000\000\000\000\000\000\000\000\000\000\000\
\009\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\009\001\009\001\000\000\009\001\009\001\
\009\001\009\001\000\000\237\000\000\000\000\000\237\000\009\001\
\000\000\009\001\000\000\237\000\009\001\237\000\000\000\009\001\
\237\000\237\000\000\000\009\001\237\000\000\000\237\000\237\000\
\237\000\000\000\000\000\237\000\237\000\237\000\000\000\237\000\
\237\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\237\000\000\000\000\000\237\000\237\000\000\000\000\000\000\000\
\000\000\000\000\237\000\237\000\000\000\000\000\000\000\010\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\237\000\000\000\000\000\237\000\000\000\000\000\000\000\237\000\
\237\000\000\000\237\000\000\000\000\000\237\000\237\000\000\000\
\000\000\000\000\000\000\000\000\000\000\237\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\237\000\237\000\000\000\237\000\237\000\237\000\237\000\000\000\
\000\000\000\000\000\000\000\000\237\000\012\001\237\000\000\000\
\012\001\237\000\000\000\000\000\237\000\012\001\000\000\012\001\
\237\000\000\000\012\001\012\001\000\000\000\000\012\001\000\000\
\012\001\012\001\012\001\000\000\000\000\012\001\012\001\012\001\
\000\000\012\001\012\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\012\001\000\000\000\000\012\001\012\001\000\000\
\000\000\000\000\000\000\000\000\012\001\012\001\000\000\000\000\
\000\000\203\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\012\001\000\000\000\000\012\001\000\000\000\000\
\000\000\012\001\012\001\000\000\012\001\000\000\000\000\012\001\
\012\001\000\000\000\000\000\000\000\000\000\000\000\000\012\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\012\001\012\001\000\000\012\001\012\001\012\001\
\012\001\000\000\011\001\000\000\000\000\011\001\012\001\000\000\
\012\001\000\000\011\001\012\001\011\001\000\000\012\001\011\001\
\011\001\000\000\012\001\011\001\000\000\011\001\011\001\011\001\
\000\000\000\000\011\001\011\001\011\001\000\000\011\001\011\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\011\001\
\000\000\000\000\011\001\011\001\000\000\000\000\000\000\000\000\
\000\000\011\001\011\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\011\001\
\000\000\121\002\011\001\000\000\000\000\000\000\011\001\011\001\
\000\000\011\001\116\000\000\000\011\001\011\001\000\000\000\000\
\000\000\000\000\000\000\000\000\011\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\011\001\
\011\001\000\000\011\001\011\001\011\001\011\001\000\000\010\001\
\000\000\000\000\010\001\011\001\000\000\011\001\000\000\010\001\
\011\001\010\001\000\000\011\001\010\001\010\001\000\000\011\001\
\010\001\000\000\010\001\010\001\010\001\000\000\000\000\010\001\
\010\001\010\001\000\000\010\001\010\001\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\010\001\000\000\000\000\010\001\
\010\001\000\000\000\000\000\000\000\000\000\000\010\001\010\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\010\001\000\000\000\000\010\001\
\000\000\000\000\000\000\010\001\010\001\000\000\010\001\000\000\
\000\000\010\001\010\001\000\000\238\000\000\000\000\000\000\000\
\000\000\010\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\010\001\010\001\000\000\010\001\
\010\001\010\001\010\001\000\000\000\000\000\000\000\000\000\000\
\010\001\203\000\010\001\000\000\203\000\010\001\000\000\000\000\
\010\001\203\000\000\000\203\000\010\001\000\000\203\000\203\000\
\000\000\000\000\203\000\000\000\203\000\203\000\203\000\000\000\
\000\000\203\000\203\000\203\000\000\000\203\000\203\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\203\000\000\000\
\000\000\203\000\203\000\000\000\000\000\000\000\000\000\000\000\
\203\000\203\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\203\000\000\000\
\000\000\203\000\000\000\000\000\000\000\203\000\203\000\000\000\
\203\000\000\000\000\000\203\000\203\000\000\000\000\000\000\000\
\000\000\000\000\000\000\203\000\044\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\203\000\203\000\
\000\000\203\000\000\000\203\000\203\000\000\000\000\000\000\000\
\000\000\000\000\203\000\000\000\203\000\000\000\000\000\203\000\
\000\000\121\002\203\000\121\002\121\002\121\002\203\000\000\000\
\000\000\121\002\116\000\000\000\000\000\000\000\121\002\000\000\
\000\000\000\000\121\002\121\002\121\002\000\000\000\000\116\000\
\000\000\000\000\000\000\121\002\121\002\121\002\121\002\000\000\
\000\000\000\000\000\000\000\000\116\000\121\002\116\000\116\000\
\000\000\000\000\121\002\000\000\000\000\000\000\000\000\000\000\
\121\002\121\002\137\000\116\000\138\000\139\000\032\000\000\000\
\140\000\000\000\000\000\177\001\243\002\000\000\121\002\000\000\
\000\000\121\002\121\002\000\000\121\002\121\002\121\002\116\000\
\121\002\004\002\116\000\121\002\121\002\000\000\116\000\116\000\
\000\000\000\000\000\000\121\002\000\000\116\000\145\000\000\000\
\000\000\000\000\000\000\000\000\116\000\146\000\121\002\121\002\
\000\000\121\002\121\002\121\002\121\002\000\000\000\000\121\002\
\116\000\147\000\148\000\000\000\116\000\116\000\000\000\121\002\
\121\002\000\000\121\002\000\000\238\000\000\000\121\002\238\000\
\116\000\000\000\000\000\116\000\238\000\000\000\238\000\000\000\
\000\000\238\000\238\000\000\000\000\000\238\000\000\000\238\000\
\238\000\238\000\000\000\000\000\238\000\000\000\238\000\000\000\
\238\000\238\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\238\000\000\000\000\000\238\000\238\000\000\000\000\000\
\000\000\000\000\000\000\238\000\238\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\005\002\000\000\
\000\000\238\000\000\000\000\000\238\000\000\000\000\000\000\000\
\238\000\238\000\000\000\238\000\000\000\000\000\238\000\238\000\
\000\000\000\000\000\000\000\000\000\000\000\000\238\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\238\000\238\000\000\000\238\000\238\000\238\000\238\000\
\000\000\000\000\000\000\000\000\000\000\238\000\000\000\238\000\
\000\000\000\000\238\000\000\000\044\002\238\000\044\002\044\002\
\044\002\238\000\000\000\000\000\044\002\000\000\000\000\000\000\
\000\000\044\002\000\000\000\000\000\000\044\002\044\002\044\002\
\000\000\000\000\000\000\000\000\000\000\000\000\044\002\044\002\
\044\002\044\002\000\000\000\000\000\000\000\000\000\000\000\000\
\044\002\000\000\000\000\000\000\000\000\044\002\000\000\000\000\
\000\000\000\000\000\000\044\002\044\002\045\002\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\044\002\000\000\000\000\044\002\000\000\000\000\044\002\
\044\002\044\002\000\000\044\002\000\000\000\000\044\002\044\002\
\000\000\000\000\000\000\000\000\000\000\000\000\044\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\044\002\044\002\000\000\044\002\044\002\044\002\044\002\
\000\000\004\002\000\000\004\002\004\002\004\002\000\000\000\000\
\000\000\004\002\044\002\000\000\000\000\044\002\004\002\000\000\
\000\000\044\002\004\002\004\002\004\002\000\000\000\000\000\000\
\000\000\000\000\000\000\004\002\004\002\004\002\004\002\000\000\
\000\000\000\000\000\000\000\000\000\000\004\002\000\000\000\000\
\000\000\000\000\004\002\000\000\000\000\000\000\000\000\000\000\
\004\002\004\002\003\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\004\002\000\000\
\000\000\004\002\000\000\000\000\004\002\004\002\004\002\000\000\
\004\002\000\000\000\000\004\002\004\002\000\000\000\000\000\000\
\000\000\000\000\000\000\004\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\004\002\004\002\
\000\000\004\002\004\002\004\002\000\000\000\000\005\002\004\002\
\005\002\005\002\005\002\000\000\000\000\000\000\005\002\004\002\
\000\000\000\000\004\002\005\002\000\000\000\000\004\002\005\002\
\005\002\005\002\000\000\000\000\000\000\000\000\000\000\000\000\
\005\002\005\002\005\002\005\002\000\000\000\000\000\000\000\000\
\000\000\000\000\005\002\000\000\000\000\000\000\000\000\005\002\
\000\000\000\000\000\000\000\000\000\000\005\002\005\002\001\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\005\002\000\000\000\000\005\002\000\000\
\000\000\005\002\005\002\005\002\000\000\005\002\000\000\000\000\
\005\002\005\002\000\000\000\000\000\000\000\000\000\000\000\000\
\005\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\005\002\005\002\000\000\005\002\005\002\
\005\002\000\000\000\000\000\000\005\002\045\002\000\000\045\002\
\045\002\045\002\000\000\000\000\005\002\045\002\000\000\005\002\
\000\000\000\000\045\002\005\002\000\000\000\000\045\002\045\002\
\045\002\000\000\000\000\000\000\000\000\000\000\000\000\045\002\
\045\002\045\002\045\002\000\000\000\000\000\000\000\000\000\000\
\000\000\045\002\000\000\000\000\000\000\000\000\045\002\000\000\
\000\000\000\000\000\000\000\000\045\002\045\002\002\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\045\002\000\000\000\000\045\002\000\000\000\000\
\045\002\045\002\045\002\000\000\045\002\000\000\000\000\045\002\
\045\002\000\000\000\000\000\000\000\000\000\000\000\000\045\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\045\002\045\002\000\000\045\002\045\002\045\002\
\045\002\000\000\003\002\000\000\003\002\003\002\003\002\000\000\
\000\000\000\000\003\002\045\002\000\000\000\000\045\002\003\002\
\000\000\000\000\045\002\003\002\003\002\003\002\000\000\000\000\
\000\000\000\000\000\000\000\000\003\002\003\002\003\002\003\002\
\000\000\000\000\000\000\000\000\000\000\000\000\003\002\000\000\
\000\000\000\000\000\000\003\002\000\000\000\000\000\000\000\000\
\000\000\003\002\003\002\000\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\002\
\000\000\000\000\003\002\000\000\000\000\003\002\003\002\003\002\
\000\000\003\002\000\000\000\000\000\000\003\002\000\000\000\000\
\000\000\000\000\000\000\000\000\003\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\002\
\003\002\000\000\003\002\003\002\003\002\003\002\000\000\001\002\
\000\000\001\002\001\002\001\002\000\000\000\000\193\000\001\002\
\003\002\000\000\000\000\003\002\001\002\000\000\000\000\003\002\
\001\002\001\002\001\002\000\000\000\000\000\000\000\000\000\000\
\000\000\001\002\001\002\001\002\001\002\000\000\000\000\000\000\
\000\000\000\000\000\000\001\002\000\000\000\000\000\000\000\000\
\001\002\000\000\000\000\000\000\000\000\000\000\001\002\001\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\082\000\000\000\000\000\000\000\001\002\000\000\000\000\001\002\
\000\000\000\000\001\002\001\002\001\002\000\000\001\002\000\000\
\000\000\000\000\001\002\000\000\000\000\000\000\000\000\000\000\
\000\000\001\002\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\001\002\001\002\000\000\001\002\
\001\002\001\002\001\002\000\000\000\000\000\000\002\002\000\000\
\002\002\002\002\002\002\000\000\000\000\001\002\002\002\000\000\
\001\002\000\000\000\000\002\002\001\002\000\000\000\000\002\002\
\002\002\002\002\000\000\000\000\000\000\000\000\000\000\000\000\
\002\002\002\002\002\002\002\002\000\000\000\000\000\000\000\000\
\000\000\000\000\002\002\000\000\000\000\000\000\000\000\002\002\
\000\000\000\000\000\000\000\000\000\000\002\002\002\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\002\002\000\000\000\000\002\002\000\000\
\000\000\002\002\002\002\002\002\226\002\002\002\000\000\000\000\
\000\000\002\002\000\000\000\000\000\000\000\000\000\000\000\000\
\002\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\002\002\002\002\000\000\002\002\002\002\
\002\002\002\002\000\000\000\002\000\000\000\002\000\002\000\002\
\000\000\000\000\000\000\000\002\002\002\000\000\000\000\002\002\
\000\002\000\000\000\000\002\002\000\002\000\002\000\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\002\000\002\000\002\
\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\002\
\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\
\000\000\000\000\000\002\000\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\193\000\000\000\
\000\002\193\000\000\000\000\002\000\000\000\000\000\002\000\002\
\000\002\000\000\000\002\193\000\000\000\000\000\000\002\000\000\
\000\000\193\000\000\000\000\000\129\000\000\002\000\000\000\000\
\193\000\193\000\193\000\193\000\000\000\000\000\000\000\000\000\
\000\002\000\002\000\000\000\002\000\002\000\002\000\002\193\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\082\000\000\002\000\000\082\000\000\002\000\000\000\000\000\000\
\000\002\000\000\000\000\193\000\000\000\082\000\193\000\000\000\
\000\000\000\000\193\000\193\000\000\000\000\000\000\000\000\000\
\000\000\193\000\082\000\082\000\082\000\082\000\000\000\000\000\
\193\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\082\000\000\000\000\000\193\000\000\000\193\000\000\000\
\193\000\193\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\193\000\082\000\000\000\193\000\
\082\000\000\000\000\000\193\000\082\000\082\000\000\000\000\000\
\000\000\000\000\000\000\082\000\000\000\000\000\000\000\121\000\
\000\000\000\000\082\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\082\000\000\000\
\082\000\000\000\082\000\082\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\082\000\000\000\
\000\000\082\000\000\000\000\000\226\002\082\000\000\000\226\002\
\000\000\226\002\226\002\226\002\226\002\000\000\000\000\226\002\
\226\002\226\002\000\000\000\000\000\000\000\000\000\000\226\002\
\000\000\000\000\000\000\000\000\000\000\000\000\226\002\000\000\
\226\002\226\002\226\002\226\002\226\002\226\002\226\002\000\000\
\226\002\000\000\000\000\226\002\000\000\226\002\000\000\000\000\
\000\000\000\000\000\000\226\002\226\002\226\002\226\002\226\002\
\226\002\226\002\226\002\226\002\226\002\226\002\000\000\000\000\
\226\002\226\002\000\000\000\000\226\002\226\002\226\002\000\000\
\226\002\226\002\226\002\226\002\226\002\226\002\000\000\226\002\
\226\002\226\002\226\002\169\001\226\002\000\000\226\002\226\002\
\000\000\000\000\226\002\226\002\000\000\226\002\000\000\226\002\
\000\000\226\002\226\002\226\002\000\000\226\002\226\002\226\002\
\000\000\000\000\000\000\226\002\000\000\000\000\226\002\000\000\
\226\002\226\002\226\002\226\002\226\002\226\002\000\000\000\000\
\226\002\009\000\010\000\011\000\000\000\000\000\000\000\012\000\
\013\000\014\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\015\000\016\000\017\000\018\000\019\000\020\000\021\000\000\000\
\000\000\000\000\000\000\022\000\000\000\023\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\024\000\025\000\026\000\
\000\000\027\000\028\000\029\000\030\000\031\000\000\000\000\000\
\032\000\033\000\000\000\000\000\034\000\035\000\036\000\000\000\
\000\000\037\000\038\000\000\000\039\000\040\000\000\000\041\000\
\000\000\042\000\043\000\000\000\044\000\114\002\045\000\000\000\
\000\000\000\000\046\000\047\000\000\000\048\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\130\000\122\000\
\000\000\000\000\000\000\050\000\000\000\000\000\000\000\000\000\
\051\000\052\000\053\000\054\000\009\000\010\000\011\000\000\000\
\055\000\000\000\012\000\013\000\014\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\015\000\016\000\017\000\018\000\019\000\
\020\000\021\000\000\000\000\000\000\000\000\000\022\000\000\000\
\023\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\024\000\025\000\026\000\000\000\027\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\033\000\000\000\000\000\034\000\
\035\000\036\000\000\000\000\000\037\000\038\000\000\000\039\000\
\040\000\000\000\041\000\000\000\042\000\043\000\000\000\044\000\
\000\000\045\000\000\000\000\000\000\000\046\000\047\000\135\001\
\048\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\122\000\000\000\000\000\000\000\050\000\000\000\
\000\000\000\000\000\000\051\000\052\000\053\000\054\000\000\000\
\000\000\000\000\000\000\055\000\000\000\000\000\000\000\000\000\
\009\000\010\000\011\000\000\000\000\000\000\000\012\000\013\000\
\014\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\015\000\
\016\000\017\000\018\000\019\000\020\000\021\000\000\000\000\000\
\000\000\000\000\022\000\000\000\023\000\000\000\000\000\000\000\
\000\000\000\000\000\000\130\000\024\000\025\000\026\000\000\000\
\027\000\028\000\029\000\030\000\031\000\000\000\000\000\032\000\
\033\000\000\000\000\000\034\000\035\000\036\000\000\000\000\000\
\037\000\038\000\000\000\039\000\040\000\000\000\041\000\000\000\
\042\000\043\000\000\000\044\000\000\000\045\000\000\000\000\000\
\000\000\046\000\047\000\000\000\048\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\122\000\000\000\
\000\000\000\000\050\000\000\000\000\000\000\000\132\000\051\000\
\052\000\053\000\054\000\000\000\000\000\114\002\000\000\055\000\
\000\000\114\002\000\000\114\002\000\000\114\002\000\000\114\002\
\000\000\114\002\114\002\114\002\114\002\000\000\114\002\114\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\114\002\
\114\002\114\002\114\002\114\002\114\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\114\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\114\002\114\002\
\114\002\114\002\114\002\114\002\000\000\114\002\114\002\000\000\
\000\000\114\002\114\002\000\000\000\000\114\002\114\002\114\002\
\114\002\114\002\114\002\000\000\107\002\114\002\000\000\114\002\
\114\002\000\000\114\002\000\000\000\000\000\000\000\000\114\002\
\114\002\000\000\000\000\114\002\000\000\000\000\000\000\000\000\
\114\002\000\000\114\002\114\002\000\000\114\002\114\002\114\002\
\114\002\000\000\000\000\000\000\114\002\000\000\000\000\114\002\
\000\000\114\002\000\000\114\002\114\002\114\002\000\000\135\001\
\114\002\000\000\000\000\135\001\000\000\135\001\000\000\135\001\
\000\000\135\001\000\000\135\001\000\000\135\001\135\001\133\000\
\135\001\135\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\135\001\000\000\000\000\135\001\135\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\135\001\135\001\135\001\135\001\000\000\135\001\000\000\135\001\
\135\001\000\000\000\000\135\001\000\000\000\000\000\000\000\000\
\135\001\135\001\135\001\000\000\000\000\000\000\000\000\135\001\
\000\000\135\001\128\000\130\000\135\001\000\000\130\000\130\000\
\000\000\000\000\135\001\000\000\000\000\135\001\000\000\000\000\
\130\000\130\000\135\001\000\000\135\001\135\001\130\000\135\001\
\135\001\000\000\135\001\000\000\000\000\130\000\135\001\130\000\
\130\000\135\001\000\000\135\001\000\000\000\000\135\001\135\001\
\000\000\000\000\135\001\000\000\130\000\000\000\000\000\000\000\
\000\000\000\000\130\000\130\000\130\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\132\000\000\000\
\130\000\132\000\132\000\130\000\000\000\000\000\130\000\130\000\
\130\000\000\000\130\000\132\000\132\000\000\000\130\000\000\000\
\000\000\132\000\000\000\000\000\000\000\130\000\000\000\000\000\
\132\000\000\000\132\000\132\000\000\000\000\000\000\000\000\000\
\000\000\130\000\000\000\130\000\000\000\130\000\130\000\132\000\
\000\000\000\000\000\000\000\000\000\000\132\000\132\000\178\000\
\000\000\130\000\000\000\000\000\130\000\000\000\000\000\000\000\
\000\000\000\000\000\000\132\000\000\000\000\000\132\000\000\000\
\000\000\132\000\132\000\132\000\000\000\132\000\000\000\000\000\
\000\000\132\000\000\000\000\000\107\002\000\000\000\000\107\002\
\132\000\000\000\000\000\000\000\107\002\000\000\000\000\000\000\
\000\000\107\002\107\002\000\000\132\000\000\000\132\000\107\002\
\132\000\132\000\125\002\000\000\000\000\000\000\107\002\000\000\
\107\002\107\002\131\002\000\000\132\000\000\000\000\000\132\000\
\000\000\000\000\000\000\000\000\137\000\107\002\138\000\139\000\
\032\000\000\000\140\000\000\000\000\000\177\001\071\004\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\000\
\000\000\107\002\133\000\133\000\107\002\000\000\125\002\107\002\
\107\002\107\002\000\000\000\000\133\000\133\000\000\000\107\002\
\145\000\000\000\133\000\000\000\000\000\107\002\107\002\146\000\
\000\000\133\000\000\000\133\000\133\000\000\000\224\002\000\000\
\000\000\000\000\107\002\147\000\148\000\000\000\107\002\107\002\
\133\000\000\000\000\000\000\000\000\000\000\000\133\000\133\000\
\000\000\000\000\107\002\000\000\000\000\107\002\000\000\000\000\
\000\000\000\000\128\000\000\000\133\000\128\000\128\000\133\000\
\000\000\000\000\000\000\133\000\133\000\000\000\133\000\128\000\
\128\000\000\000\133\000\000\000\000\000\128\000\000\000\000\000\
\000\000\133\000\000\000\000\000\128\000\216\001\128\000\128\000\
\000\000\000\000\000\000\000\000\000\000\133\000\000\000\133\000\
\000\000\133\000\133\000\128\000\000\000\000\000\000\000\000\000\
\000\000\128\000\128\000\000\000\130\002\133\000\000\000\130\002\
\133\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\
\000\000\130\002\128\000\000\000\000\000\000\000\128\000\128\000\
\000\000\128\000\000\000\000\000\000\000\128\000\130\002\130\002\
\130\002\130\002\000\000\000\000\128\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\130\002\000\000\000\000\
\128\000\000\000\128\000\000\000\128\000\128\000\000\000\000\000\
\000\000\006\002\000\000\000\000\000\000\000\000\000\000\178\000\
\128\000\130\002\178\000\128\000\000\000\121\002\000\000\130\002\
\130\002\130\002\006\002\000\000\178\000\000\000\121\002\130\002\
\000\000\000\000\000\000\000\000\000\000\000\000\130\002\000\000\
\000\000\178\000\178\000\178\000\178\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\130\002\000\000\130\002\121\002\
\178\000\000\000\121\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\130\002\121\002\000\000\130\002\000\000\000\000\
\000\000\000\000\131\002\000\000\178\000\131\002\000\000\000\000\
\026\002\000\000\178\000\178\000\178\000\000\000\000\000\131\002\
\000\000\026\002\178\000\000\000\000\000\000\000\000\000\000\000\
\000\000\178\000\000\000\000\000\131\002\131\002\131\002\131\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\178\000\
\000\000\178\000\026\002\131\002\000\000\026\002\007\002\000\000\
\000\000\000\000\000\000\000\000\000\000\178\000\026\002\000\000\
\178\000\000\000\000\000\000\000\000\000\000\000\224\002\131\002\
\000\000\224\002\000\000\122\002\000\000\131\002\131\002\131\002\
\000\000\000\000\000\000\224\002\122\002\131\002\000\000\000\000\
\000\000\224\002\000\000\000\000\131\002\000\000\000\000\000\000\
\224\002\000\000\224\002\224\002\000\000\000\000\000\000\000\000\
\000\000\000\000\131\002\000\000\131\002\122\002\224\002\224\002\
\122\002\000\000\000\000\000\000\000\000\224\002\224\002\000\000\
\131\002\122\002\000\000\131\002\000\000\216\001\000\000\000\000\
\216\001\000\000\000\000\224\002\007\002\216\001\224\002\000\000\
\000\000\000\000\216\001\224\002\000\000\224\002\102\000\000\000\
\216\001\224\002\000\000\000\000\000\000\000\000\000\000\216\001\
\224\002\216\001\216\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\224\002\000\000\216\001\000\000\
\224\002\224\002\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\224\002\000\000\000\000\224\002\
\000\000\000\000\216\001\000\000\000\000\216\001\000\000\000\000\
\216\001\216\001\216\001\000\000\000\000\000\000\000\000\052\002\
\216\001\006\002\000\000\000\000\006\002\000\000\000\000\216\001\
\000\000\006\002\213\001\000\000\000\000\000\000\006\002\000\000\
\000\000\000\000\006\002\216\001\006\002\006\002\000\000\216\001\
\216\001\000\000\006\002\006\002\000\000\006\002\006\002\006\002\
\000\000\000\000\000\000\216\001\000\000\006\002\216\001\000\000\
\000\000\000\000\006\002\000\000\006\002\000\000\006\002\006\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\006\002\224\002\000\000\006\002\000\000\
\000\000\006\002\000\000\000\000\006\002\006\002\006\002\000\000\
\000\000\000\000\000\000\006\002\006\002\000\000\000\000\006\002\
\000\000\000\000\006\002\006\002\177\001\006\002\006\002\006\002\
\000\000\000\000\000\000\000\000\006\002\006\002\000\000\006\002\
\000\000\000\000\000\000\006\002\006\002\000\000\000\000\004\002\
\000\000\000\000\000\000\000\000\000\000\000\000\007\002\006\002\
\006\002\007\002\006\002\000\000\006\002\000\000\007\002\000\000\
\006\002\000\000\000\000\007\002\000\000\000\000\000\000\000\000\
\006\002\007\002\000\000\006\002\000\000\000\000\080\000\000\000\
\007\002\000\000\007\002\007\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\002\
\000\000\000\000\137\000\000\000\138\000\139\000\032\000\000\000\
\140\000\000\000\000\000\141\000\142\000\000\000\000\000\000\000\
\000\000\000\000\000\000\007\002\000\000\192\001\007\002\000\000\
\000\000\007\002\007\002\007\002\000\000\143\000\000\000\000\000\
\007\002\007\002\000\000\000\000\007\002\144\000\145\000\007\002\
\007\002\226\002\011\002\000\000\007\002\146\000\102\000\000\000\
\000\000\007\002\000\000\000\000\007\002\000\000\000\000\007\002\
\007\002\147\000\148\000\102\000\005\002\000\000\007\002\000\000\
\007\002\007\002\000\000\000\000\007\002\000\000\000\000\007\002\
\102\000\000\000\102\000\102\000\000\000\007\002\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\102\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\007\002\000\000\000\000\007\002\177\001\000\000\007\002\
\007\002\007\002\000\000\102\000\000\000\000\000\007\002\007\002\
\000\000\000\000\213\001\102\000\000\000\213\001\007\002\000\000\
\000\000\102\000\213\001\000\000\000\000\000\000\000\000\213\001\
\102\000\000\000\007\002\000\000\000\000\213\001\007\002\000\000\
\000\000\000\000\007\002\000\000\213\001\000\000\213\001\213\001\
\102\000\000\000\007\002\000\000\000\000\007\002\000\000\000\000\
\000\000\000\000\000\000\213\001\102\000\000\000\000\000\102\000\
\178\001\000\000\000\000\000\000\224\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\213\001\
\000\000\224\002\213\001\000\000\000\000\213\001\213\001\213\001\
\000\000\000\000\000\000\000\000\177\001\213\001\224\002\177\001\
\224\002\224\002\000\000\000\000\213\001\000\000\000\000\000\000\
\000\000\177\001\000\000\000\000\000\000\224\002\000\000\177\001\
\213\001\000\000\000\000\000\000\213\001\213\001\177\001\000\000\
\177\001\177\001\000\000\180\001\000\000\000\000\000\000\097\000\
\213\001\224\002\000\000\213\001\000\000\177\001\000\000\000\000\
\000\000\224\002\000\000\000\000\000\000\000\000\080\000\224\002\
\000\000\080\000\000\000\000\000\000\000\000\000\224\002\000\000\
\000\000\177\001\000\000\080\000\177\001\000\000\000\000\000\000\
\177\001\177\001\000\000\000\000\000\000\000\000\224\002\177\001\
\080\000\080\000\080\000\080\000\000\000\000\000\177\001\000\000\
\000\000\000\000\224\002\000\000\121\002\224\002\179\001\080\000\
\000\000\000\000\177\001\000\000\000\000\000\000\177\001\177\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\226\002\177\001\080\000\226\002\177\001\080\000\000\000\
\000\000\226\002\080\000\080\000\000\000\000\000\226\002\000\000\
\000\000\080\000\000\000\000\000\226\002\000\000\000\000\000\000\
\080\000\000\000\000\000\226\002\000\000\226\002\226\002\000\000\
\101\000\000\000\000\000\000\000\080\000\000\000\080\000\000\000\
\080\000\080\000\226\002\000\000\000\000\000\000\000\000\000\000\
\000\000\181\001\000\000\000\000\080\000\000\000\000\000\080\000\
\000\000\000\000\000\000\000\000\000\000\177\001\226\002\000\000\
\177\001\226\002\000\000\000\000\000\000\226\002\226\002\000\000\
\000\000\000\000\177\001\000\000\226\002\000\000\000\000\000\000\
\177\001\000\000\000\000\226\002\000\000\000\000\000\000\177\001\
\000\000\177\001\177\001\000\000\000\000\000\000\000\000\226\002\
\000\000\000\000\000\000\226\002\226\002\000\000\177\001\000\000\
\000\000\000\000\000\000\000\000\184\001\000\000\000\000\226\002\
\000\000\000\000\226\002\000\000\000\000\000\000\000\000\000\000\
\178\001\000\000\177\001\178\001\000\000\177\001\000\000\000\000\
\000\000\177\001\177\001\000\000\000\000\178\001\000\000\000\000\
\177\001\000\000\000\000\178\001\000\000\000\000\000\000\177\001\
\000\000\000\000\178\001\000\000\178\001\178\001\000\000\000\000\
\000\000\000\000\000\000\177\001\000\000\000\000\226\002\177\001\
\177\001\178\001\000\000\000\000\000\000\000\000\000\000\117\000\
\000\000\000\000\000\000\177\001\000\000\000\000\177\001\000\000\
\000\000\000\000\000\000\180\001\000\000\178\001\180\001\097\000\
\178\001\000\000\000\000\000\000\178\001\178\001\000\000\000\000\
\180\001\000\000\000\000\178\001\097\000\000\000\180\001\000\000\
\000\000\000\000\178\001\000\000\000\000\180\001\000\000\180\001\
\180\001\097\000\000\000\097\000\097\000\000\000\178\001\000\000\
\000\000\168\001\178\001\178\001\180\001\000\000\000\000\000\000\
\097\000\000\000\000\000\000\000\000\000\000\000\178\001\000\000\
\000\000\178\001\000\000\000\000\000\000\000\000\179\001\000\000\
\180\001\179\001\000\000\180\001\097\000\000\000\000\000\180\001\
\180\001\000\000\000\000\179\001\097\000\000\000\180\001\000\000\
\000\000\179\001\097\000\000\000\000\000\180\001\000\000\000\000\
\179\001\097\000\179\001\179\001\000\000\000\000\000\000\000\000\
\000\000\180\001\000\000\000\000\224\002\180\001\180\001\179\001\
\000\000\097\000\000\000\000\000\000\000\000\000\000\000\000\000\
\101\000\180\001\000\000\000\000\180\001\097\000\000\000\000\000\
\097\000\000\000\000\000\179\001\000\000\101\000\179\001\000\000\
\000\000\181\001\179\001\179\001\181\001\000\000\000\000\000\000\
\000\000\179\001\101\000\000\000\101\000\101\000\181\001\000\000\
\179\001\224\002\000\000\000\000\181\001\000\000\000\000\000\000\
\000\000\101\000\000\000\181\001\179\001\181\001\181\001\000\000\
\179\001\179\001\000\000\000\000\000\000\000\000\000\000\069\000\
\000\000\000\000\181\001\000\000\179\001\101\000\000\000\179\001\
\000\000\000\000\000\000\000\000\000\000\101\000\000\000\000\000\
\000\000\000\000\000\000\101\000\184\001\000\000\181\001\184\001\
\000\000\181\001\101\000\000\000\000\000\181\001\181\001\000\000\
\000\000\184\001\000\000\000\000\181\001\000\000\000\000\184\001\
\000\000\000\000\101\000\181\001\070\000\000\000\184\001\000\000\
\184\001\184\001\000\000\000\000\000\000\000\000\101\000\181\001\
\000\000\101\000\000\000\181\001\181\001\184\001\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\226\002\181\001\
\000\000\000\000\181\001\000\000\000\000\000\000\226\002\117\000\
\000\000\184\001\000\000\226\002\184\001\000\000\000\000\000\000\
\184\001\184\001\000\000\000\000\117\000\000\000\213\001\184\001\
\226\002\000\000\226\002\226\002\000\000\000\000\184\001\213\001\
\000\000\117\000\000\000\117\000\117\000\000\000\000\000\226\002\
\000\000\000\000\184\001\000\000\000\000\000\000\184\001\184\001\
\117\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\168\001\184\001\226\002\000\000\184\001\226\002\000\000\
\000\000\000\000\226\002\226\002\117\000\000\000\168\001\117\000\
\000\000\226\002\000\000\117\000\117\000\000\000\000\000\000\000\
\226\002\000\000\117\000\168\001\000\000\168\001\168\001\000\000\
\000\000\117\000\000\000\000\000\226\002\000\000\000\000\000\000\
\226\002\226\002\168\001\000\000\000\000\117\000\000\000\000\000\
\000\000\117\000\117\000\000\000\226\002\224\002\000\000\226\002\
\000\000\000\000\000\000\000\000\224\002\117\000\168\001\224\002\
\117\000\168\001\000\000\000\000\000\000\168\001\168\001\000\000\
\000\000\224\002\000\000\123\000\168\001\000\000\000\000\000\000\
\000\000\000\000\000\000\168\001\000\000\000\000\224\002\000\000\
\224\002\224\002\000\000\000\000\000\000\000\000\000\000\168\001\
\000\000\124\000\000\000\168\001\168\001\224\002\000\000\000\000\
\000\000\224\002\000\000\000\000\000\000\000\000\000\000\168\001\
\000\000\000\000\168\001\000\000\000\000\000\000\224\002\000\000\
\000\000\224\002\000\000\000\000\224\002\000\000\000\000\069\000\
\000\000\224\002\069\000\224\002\000\000\224\002\224\002\224\002\
\000\000\000\000\000\000\000\000\069\000\000\000\224\002\000\000\
\000\000\000\000\224\002\000\000\000\000\000\000\000\000\000\000\
\000\000\069\000\224\002\069\000\069\000\000\000\224\002\224\002\
\000\000\000\000\000\000\000\000\000\000\000\000\224\002\069\000\
\069\000\224\002\224\002\000\000\070\000\224\002\224\002\070\000\
\226\002\000\000\000\000\000\000\224\002\000\000\000\000\000\000\
\000\000\070\000\226\002\224\002\069\000\000\000\000\000\069\000\
\000\000\000\000\000\000\069\000\069\000\000\000\070\000\224\002\
\070\000\070\000\069\000\224\002\224\002\000\000\000\000\000\000\
\000\000\069\000\000\000\000\000\070\000\070\000\000\000\224\002\
\000\000\000\000\224\002\000\000\000\000\069\000\213\001\000\000\
\000\000\069\000\069\000\000\000\000\000\000\000\213\001\213\001\
\000\000\070\000\000\000\213\001\070\000\069\000\000\000\000\000\
\070\000\070\000\000\000\000\000\213\001\000\000\000\000\070\000\
\213\001\000\000\213\001\213\001\000\000\224\002\070\000\000\000\
\000\000\213\001\000\000\213\001\213\001\000\000\000\000\213\001\
\000\000\000\000\070\000\000\000\000\000\000\000\070\000\070\000\
\213\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\070\000\213\001\000\000\000\000\213\001\000\000\
\000\000\213\001\213\001\213\001\213\001\000\000\000\000\213\001\
\000\000\213\001\213\001\213\001\213\001\000\000\000\000\054\000\
\213\001\000\000\213\001\000\000\000\000\224\002\000\000\000\000\
\224\002\213\001\000\000\000\000\213\001\000\000\000\000\000\000\
\213\001\213\001\224\002\000\000\000\000\213\001\000\000\000\000\
\000\000\213\001\213\001\123\000\213\001\000\000\123\000\224\002\
\000\000\224\002\224\002\000\000\000\000\213\001\056\000\000\000\
\123\000\000\000\000\000\000\000\000\000\224\002\224\002\000\000\
\000\000\124\000\000\000\000\000\124\000\123\000\000\000\123\000\
\123\000\000\000\000\000\000\000\000\000\000\000\124\000\000\000\
\000\000\000\000\224\002\000\000\123\000\224\002\000\000\000\000\
\000\000\000\000\224\002\124\000\000\000\124\000\124\000\000\000\
\224\002\000\000\060\000\000\000\000\000\000\000\000\000\224\002\
\123\000\000\000\124\000\123\000\000\000\000\000\000\000\123\000\
\123\000\000\000\000\000\224\002\000\000\000\000\123\000\224\002\
\224\002\000\000\000\000\000\000\000\000\123\000\124\000\000\000\
\000\000\124\000\000\000\224\002\000\000\124\000\124\000\000\000\
\000\000\123\000\000\000\000\000\124\000\123\000\123\000\063\000\
\226\002\000\000\000\000\124\000\000\000\000\000\000\000\000\000\
\226\002\123\000\226\002\000\000\000\000\226\002\000\000\124\000\
\000\000\000\000\000\000\124\000\124\000\064\000\000\000\226\002\
\000\000\000\000\226\002\000\000\226\002\226\002\224\002\124\000\
\000\000\000\000\000\000\000\000\226\002\000\000\226\002\226\002\
\000\000\226\002\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\226\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\226\002\000\000\000\000\
\226\002\000\000\000\000\000\000\226\002\226\002\000\000\226\002\
\000\000\000\000\226\002\226\002\000\000\224\002\226\002\226\002\
\224\002\000\000\226\002\000\000\000\000\226\002\000\000\000\000\
\000\000\000\000\224\002\000\000\226\002\000\000\226\002\000\000\
\000\000\000\000\226\002\226\002\000\000\000\000\000\000\224\002\
\226\002\224\002\224\002\000\000\226\002\226\002\226\002\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\224\002\000\000\
\226\002\000\000\039\002\000\000\039\002\039\002\039\002\054\000\
\039\002\000\000\000\000\039\002\039\002\000\000\000\000\000\000\
\000\000\000\000\224\002\000\000\054\000\224\002\000\000\000\000\
\000\000\000\000\224\002\000\000\000\000\039\002\000\000\000\000\
\224\002\054\000\000\000\054\000\054\000\039\002\039\002\224\002\
\000\000\000\000\000\000\000\000\000\000\039\002\056\000\000\000\
\054\000\000\000\000\000\224\002\000\000\000\000\000\000\224\002\
\224\002\039\002\039\002\056\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\224\002\054\000\000\000\000\000\054\000\
\056\000\000\000\056\000\056\000\054\000\000\000\000\000\000\000\
\000\000\000\000\054\000\000\000\000\000\000\000\000\000\056\000\
\000\000\054\000\060\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\054\000\000\000\060\000\
\000\000\054\000\054\000\056\000\000\000\000\000\056\000\000\000\
\000\000\000\000\000\000\056\000\060\000\054\000\060\000\060\000\
\000\000\056\000\000\000\000\000\000\000\000\000\000\000\000\000\
\056\000\000\000\000\000\060\000\000\000\000\000\000\000\063\000\
\000\000\000\000\000\000\000\000\056\000\000\000\000\000\000\000\
\056\000\056\000\000\000\000\000\063\000\000\000\000\000\060\000\
\000\000\000\000\060\000\000\000\056\000\064\000\000\000\060\000\
\000\000\063\000\000\000\063\000\063\000\060\000\224\002\000\000\
\000\000\000\000\064\000\000\000\060\000\000\000\000\000\000\000\
\063\000\000\000\000\000\224\002\000\000\000\000\000\000\064\000\
\060\000\064\000\064\000\000\000\060\000\060\000\000\000\000\000\
\224\002\000\000\224\002\224\002\063\000\000\000\064\000\063\000\
\060\000\000\000\000\000\000\000\063\000\000\000\000\000\224\002\
\000\000\000\000\063\000\000\000\000\000\000\000\000\000\000\000\
\000\000\063\000\064\000\000\000\000\000\064\000\000\000\000\000\
\000\000\000\000\064\000\224\002\000\000\063\000\224\002\000\000\
\064\000\063\000\063\000\224\002\000\000\000\000\000\000\064\000\
\000\000\224\002\000\000\000\000\000\000\063\000\000\000\000\000\
\224\002\000\000\000\000\064\000\000\000\000\000\000\000\064\000\
\064\000\000\000\000\000\000\000\224\002\000\000\000\000\000\000\
\224\002\224\002\219\002\064\000\000\000\000\000\000\000\219\002\
\219\002\219\002\219\002\000\000\224\002\219\002\219\002\219\002\
\219\002\000\000\000\000\000\000\000\000\219\002\000\000\000\000\
\000\000\000\000\000\000\000\000\219\002\000\000\219\002\219\002\
\219\002\219\002\219\002\219\002\219\002\000\000\000\000\000\000\
\000\000\219\002\000\000\219\002\000\000\000\000\000\000\000\000\
\000\000\219\002\219\002\219\002\219\002\219\002\219\002\219\002\
\219\002\219\002\219\002\219\002\000\000\000\000\219\002\219\002\
\000\000\000\000\219\002\219\002\219\002\219\002\000\000\219\002\
\219\002\219\002\219\002\219\002\000\000\219\002\000\000\219\002\
\219\002\000\000\219\002\000\000\219\002\219\002\000\000\000\000\
\219\002\219\002\000\000\219\002\000\000\219\002\000\000\000\000\
\219\002\219\002\000\000\000\000\219\002\219\002\000\000\000\000\
\000\000\219\002\000\000\000\000\219\002\000\000\219\002\219\002\
\219\002\219\002\219\002\219\002\000\000\000\000\219\002\035\001\
\036\001\037\001\000\000\000\000\009\000\010\000\038\001\000\000\
\039\001\000\000\012\000\013\000\000\000\000\000\040\001\041\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\042\001\000\000\000\000\017\000\018\000\019\000\
\020\000\021\000\000\000\043\001\000\000\000\000\022\000\000\000\
\000\000\044\001\045\001\046\001\047\001\048\001\000\000\000\000\
\024\000\025\000\026\000\000\000\027\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\000\000\049\001\000\000\034\000\
\035\000\036\000\000\000\000\000\000\000\038\000\000\000\050\001\
\051\001\000\000\052\001\000\000\042\000\043\000\000\000\044\000\
\000\000\000\000\000\000\053\001\054\001\055\001\056\001\057\001\
\058\001\000\000\000\000\000\000\000\000\000\000\000\000\059\001\
\000\000\000\000\000\000\060\001\000\000\061\001\050\000\000\000\
\000\000\000\000\000\000\051\000\052\000\000\000\054\000\035\001\
\036\001\037\001\000\000\055\000\009\000\010\000\038\001\000\000\
\039\001\000\000\012\000\013\000\000\000\000\000\000\000\041\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\042\001\000\000\000\000\017\000\018\000\019\000\
\020\000\021\000\000\000\043\001\000\000\000\000\022\000\000\000\
\000\000\044\001\045\001\046\001\047\001\048\001\000\000\000\000\
\024\000\025\000\026\000\000\000\027\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\000\000\049\001\000\000\034\000\
\035\000\036\000\000\000\000\000\000\000\038\000\000\000\050\001\
\051\001\000\000\052\001\000\000\042\000\043\000\000\000\044\000\
\000\000\000\000\000\000\053\001\054\001\055\001\056\001\057\001\
\058\001\000\000\000\000\000\000\000\000\000\000\000\000\059\001\
\000\000\000\000\000\000\060\001\000\000\061\001\050\000\000\000\
\000\000\000\000\000\000\051\000\052\000\000\000\054\000\035\001\
\036\001\037\001\000\000\055\000\009\000\010\000\038\001\000\000\
\039\001\000\000\012\000\013\000\000\000\000\000\000\000\041\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\042\001\000\000\000\000\017\000\018\000\019\000\
\020\000\021\000\000\000\043\001\000\000\000\000\022\000\000\000\
\000\000\044\001\045\001\046\001\047\001\048\001\000\000\000\000\
\024\000\025\000\026\000\000\000\027\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\000\000\049\001\000\000\034\000\
\035\000\036\000\000\000\000\000\000\000\038\000\000\000\050\001\
\051\001\000\000\090\003\000\000\042\000\043\000\000\000\044\000\
\000\000\000\000\000\000\053\001\054\001\055\001\056\001\057\001\
\058\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\060\001\000\000\061\001\050\000\000\000\
\000\000\000\000\226\002\051\000\052\000\000\000\054\000\226\002\
\226\002\226\002\226\002\055\000\000\000\226\002\226\002\000\000\
\000\000\000\000\000\000\000\000\000\000\226\002\000\000\000\000\
\000\000\000\000\000\000\000\000\226\002\000\000\226\002\000\000\
\226\002\226\002\226\002\226\002\226\002\000\000\000\000\000\000\
\000\000\226\002\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\226\002\226\002\226\002\226\002\226\002\226\002\226\002\
\226\002\226\002\226\002\226\002\000\000\000\000\226\002\226\002\
\000\000\000\000\226\002\226\002\226\002\000\000\000\000\226\002\
\226\002\226\002\226\002\226\002\000\000\000\000\000\000\226\002\
\226\002\000\000\226\002\000\000\000\000\226\002\000\000\000\000\
\226\002\226\002\000\000\226\002\000\000\226\002\000\000\000\000\
\000\000\226\002\000\000\000\000\000\000\226\002\000\000\000\000\
\000\000\226\002\000\000\000\000\226\002\000\000\226\002\226\002\
\000\000\226\002\226\002\226\002\094\002\000\000\226\002\000\000\
\000\000\165\002\165\002\165\002\000\000\000\000\000\000\165\002\
\165\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\165\002\165\002\165\002\165\002\165\002\000\000\
\000\000\000\000\000\000\165\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\165\002\165\002\165\002\
\000\000\165\002\165\002\165\002\165\002\165\002\000\000\000\000\
\165\002\000\000\000\000\000\000\165\002\165\002\165\002\000\000\
\000\000\000\000\165\002\000\000\165\002\165\002\000\000\000\000\
\000\000\165\002\165\002\000\000\165\002\000\000\000\000\000\000\
\000\000\000\000\165\002\165\002\095\002\165\002\000\000\000\000\
\000\000\166\002\166\002\166\002\094\002\000\000\000\000\166\002\
\166\002\000\000\000\000\165\002\000\000\000\000\000\000\000\000\
\165\002\165\002\000\000\165\002\000\000\000\000\000\000\000\000\
\165\002\000\000\166\002\166\002\166\002\166\002\166\002\000\000\
\000\000\000\000\000\000\166\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\166\002\166\002\166\002\
\000\000\166\002\166\002\166\002\166\002\166\002\000\000\000\000\
\166\002\000\000\000\000\000\000\166\002\166\002\166\002\000\000\
\000\000\000\000\166\002\000\000\166\002\166\002\000\000\000\000\
\000\000\166\002\166\002\000\000\166\002\000\000\000\000\000\000\
\000\000\000\000\166\002\166\002\092\002\166\002\000\000\000\000\
\000\000\167\002\167\002\167\002\095\002\000\000\000\000\167\002\
\167\002\000\000\000\000\166\002\000\000\000\000\000\000\000\000\
\166\002\166\002\000\000\166\002\000\000\000\000\000\000\000\000\
\166\002\000\000\167\002\167\002\167\002\167\002\167\002\000\000\
\000\000\000\000\000\000\167\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\167\002\167\002\167\002\
\000\000\167\002\167\002\167\002\167\002\167\002\000\000\000\000\
\167\002\000\000\000\000\000\000\167\002\167\002\167\002\000\000\
\000\000\000\000\167\002\000\000\167\002\167\002\000\000\000\000\
\000\000\167\002\167\002\000\000\167\002\000\000\000\000\000\000\
\000\000\000\000\167\002\167\002\093\002\167\002\000\000\000\000\
\000\000\168\002\168\002\168\002\092\002\000\000\000\000\168\002\
\168\002\000\000\000\000\167\002\000\000\000\000\000\000\000\000\
\167\002\167\002\000\000\167\002\000\000\000\000\000\000\000\000\
\167\002\000\000\168\002\168\002\168\002\168\002\168\002\000\000\
\000\000\000\000\000\000\168\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\168\002\168\002\168\002\
\000\000\168\002\168\002\168\002\168\002\168\002\000\000\000\000\
\168\002\000\000\000\000\000\000\168\002\168\002\168\002\000\000\
\000\000\000\000\168\002\000\000\168\002\168\002\000\000\000\000\
\000\000\168\002\168\002\000\000\168\002\000\000\000\000\000\000\
\000\000\000\000\168\002\168\002\000\000\168\002\000\000\000\000\
\000\000\000\000\000\000\000\000\093\002\235\000\236\000\237\000\
\000\000\000\000\000\000\168\002\000\000\238\000\000\000\239\000\
\168\002\168\002\000\000\168\002\000\000\240\000\241\000\242\000\
\168\002\000\000\243\000\244\000\245\000\000\000\246\000\247\000\
\248\000\000\000\249\000\250\000\251\000\252\000\000\000\000\000\
\000\000\253\000\254\000\255\000\000\000\000\000\000\000\000\000\
\000\000\000\001\001\001\000\000\000\000\000\000\000\000\002\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\003\001\004\001\000\000\000\000\000\000\000\000\
\005\001\006\001\000\000\000\000\000\000\007\001\008\001\000\000\
\009\001\000\000\010\001\011\001\012\001\000\000\013\001\000\000\
\000\000\000\000\000\000\000\000\014\001\000\000\000\000\000\000\
\000\000\015\001\000\000\000\000\000\000\000\000\000\000\016\001\
\008\002\000\000\017\001\018\001\008\002\019\001\020\001\021\001\
\022\001\023\001\000\000\024\001\025\001\026\001\027\001\028\001\
\000\000\008\002\000\000\008\002\000\000\000\000\245\001\000\000\
\000\000\000\000\008\002\008\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\008\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\008\002\
\008\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\008\002\000\000\000\000\
\000\000\008\002\000\000\008\002\008\002\008\002\000\000\008\002\
\000\000\000\000\008\002\000\000\000\000\000\000\000\000\035\001\
\036\001\037\001\000\000\000\000\000\000\010\000\225\001\000\000\
\039\001\000\000\000\000\013\000\245\001\008\002\226\001\041\001\
\000\000\008\002\000\000\008\002\000\000\000\000\008\002\000\000\
\000\000\000\000\042\001\162\000\000\000\017\000\018\000\008\002\
\000\000\008\002\000\000\043\001\000\000\000\000\000\000\000\000\
\000\000\044\001\045\001\046\001\047\001\048\001\000\000\000\000\
\024\000\025\000\026\000\000\000\163\000\164\000\000\000\165\000\
\166\000\000\000\000\000\032\000\000\000\049\001\000\000\000\000\
\167\000\168\000\000\000\000\000\000\000\000\000\000\000\227\001\
\228\001\000\000\229\001\000\000\042\000\000\000\000\000\000\000\
\000\000\000\000\000\000\053\001\054\001\230\001\231\001\057\001\
\232\001\000\000\000\000\000\000\000\000\000\000\000\000\059\001\
\000\000\000\000\171\000\060\001\000\000\061\001\050\000\000\000\
\000\000\000\000\000\000\051\000\000\000\000\000\054\000\172\000\
\035\001\036\001\037\001\000\000\000\000\000\000\010\000\225\001\
\000\000\039\001\000\000\000\000\013\000\000\000\000\000\000\000\
\041\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\042\001\162\000\000\000\017\000\018\000\
\000\000\000\000\000\000\000\000\043\001\000\000\000\000\000\000\
\000\000\000\000\044\001\045\001\046\001\047\001\048\001\000\000\
\000\000\024\000\025\000\026\000\000\000\163\000\164\000\000\000\
\165\000\166\000\000\000\000\000\032\000\000\000\049\001\000\000\
\000\000\167\000\168\000\000\000\000\000\000\000\000\000\000\000\
\227\001\228\001\000\000\229\001\000\000\042\000\000\000\000\000\
\000\000\000\000\000\000\000\000\053\001\054\001\230\001\231\001\
\057\001\232\001\000\000\000\000\000\000\000\000\000\000\000\000\
\059\001\000\000\000\000\171\000\060\001\000\000\061\001\050\000\
\000\000\000\000\000\000\000\000\051\000\000\000\001\003\054\000\
\172\000\035\001\036\001\037\001\000\000\000\000\000\000\010\000\
\225\001\000\000\039\001\000\000\000\000\013\000\000\000\000\000\
\000\000\041\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\042\001\162\000\000\000\017\000\
\018\000\000\000\000\000\000\000\000\000\043\001\000\000\000\000\
\000\000\000\000\000\000\044\001\045\001\046\001\047\001\048\001\
\000\000\000\000\024\000\025\000\026\000\000\000\163\000\164\000\
\000\000\165\000\166\000\000\000\000\000\032\000\000\000\049\001\
\000\000\000\000\167\000\168\000\000\000\000\000\000\000\000\000\
\000\000\227\001\228\001\000\000\229\001\000\000\042\000\000\000\
\000\000\000\000\000\000\000\000\000\000\053\001\054\001\230\001\
\231\001\057\001\232\001\000\000\000\000\000\000\000\000\000\000\
\000\000\059\001\000\000\000\000\171\000\060\001\000\000\061\001\
\050\000\000\000\000\000\000\000\000\000\051\000\000\000\202\003\
\054\000\172\000\035\001\036\001\037\001\000\000\000\000\000\000\
\010\000\225\001\000\000\039\001\000\000\000\000\013\000\000\000\
\000\000\000\000\041\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\042\001\162\000\000\000\
\017\000\018\000\000\000\000\000\000\000\000\000\043\001\000\000\
\000\000\000\000\000\000\000\000\044\001\045\001\046\001\047\001\
\048\001\000\000\000\000\024\000\025\000\026\000\000\000\163\000\
\164\000\000\000\165\000\166\000\000\000\000\000\032\000\000\000\
\049\001\000\000\000\000\167\000\168\000\000\000\000\000\000\000\
\000\000\000\000\227\001\228\001\000\000\229\001\000\000\042\000\
\000\000\000\000\000\000\000\000\000\000\000\000\053\001\054\001\
\230\001\231\001\057\001\232\001\000\000\000\000\000\000\000\000\
\000\000\000\000\059\001\000\000\000\000\171\000\060\001\000\000\
\061\001\050\000\000\000\000\000\000\000\000\000\051\000\000\000\
\008\004\054\000\172\000\035\001\036\001\037\001\000\000\000\000\
\000\000\010\000\225\001\000\000\039\001\000\000\000\000\013\000\
\000\000\000\000\000\000\041\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\042\001\162\000\
\000\000\017\000\018\000\000\000\000\000\000\000\000\000\043\001\
\000\000\000\000\000\000\000\000\000\000\044\001\045\001\046\001\
\047\001\048\001\000\000\000\000\024\000\025\000\026\000\000\000\
\163\000\164\000\000\000\165\000\166\000\000\000\000\000\032\000\
\000\000\049\001\000\000\221\002\167\000\168\000\000\000\000\000\
\000\000\010\000\000\000\227\001\228\001\000\000\229\001\013\000\
\042\000\000\000\000\000\000\000\000\000\000\000\000\000\053\001\
\054\001\230\001\231\001\057\001\232\001\000\000\000\000\162\000\
\000\000\017\000\018\000\059\001\000\000\000\000\171\000\060\001\
\000\000\061\001\050\000\000\000\000\000\000\000\000\000\051\000\
\000\000\000\000\054\000\172\000\024\000\025\000\026\000\000\000\
\163\000\164\000\000\000\165\000\166\000\000\000\000\000\032\000\
\000\000\000\000\000\000\223\002\167\000\168\000\000\000\000\000\
\000\000\010\000\000\000\169\000\000\000\000\000\000\000\013\000\
\042\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\170\000\000\000\000\000\000\000\000\000\000\000\162\000\
\000\000\017\000\018\000\000\000\000\000\000\000\171\000\000\000\
\000\000\000\000\050\000\000\000\000\000\000\000\000\000\051\000\
\000\000\000\000\054\000\172\000\024\000\025\000\026\000\000\000\
\163\000\164\000\000\000\165\000\166\000\000\000\000\000\032\000\
\000\000\000\000\000\000\225\002\167\000\168\000\000\000\000\000\
\000\000\010\000\000\000\169\000\000\000\000\000\000\000\013\000\
\042\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\170\000\000\000\000\000\000\000\000\000\000\000\162\000\
\000\000\017\000\018\000\000\000\000\000\000\000\171\000\000\000\
\000\000\000\000\050\000\000\000\000\000\000\000\000\000\051\000\
\000\000\000\000\054\000\172\000\024\000\025\000\026\000\000\000\
\163\000\164\000\000\000\165\000\166\000\000\000\000\000\032\000\
\000\000\000\000\000\000\000\000\167\000\168\000\000\000\000\000\
\000\000\000\000\000\000\169\000\000\000\000\000\000\000\000\000\
\042\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\170\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\171\000\000\000\
\000\000\000\000\050\000\000\000\000\000\000\000\000\000\051\000\
\000\000\000\000\054\000\172\000\009\000\010\000\011\000\000\000\
\000\000\000\000\012\000\013\000\014\000\053\002\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\015\000\016\000\017\000\018\000\019\000\
\020\000\021\000\000\000\000\000\000\000\000\000\022\000\000\000\
\023\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\024\000\025\000\026\000\000\000\027\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\033\000\000\000\000\000\034\000\
\035\000\036\000\000\000\000\000\037\000\038\000\000\000\039\000\
\040\000\000\000\041\000\000\000\042\000\043\000\000\000\044\000\
\000\000\045\000\000\000\000\000\000\000\046\000\047\000\000\000\
\048\000\000\000\054\002\000\000\000\000\009\000\010\000\011\000\
\000\000\049\000\000\000\012\000\013\000\014\000\050\000\000\000\
\000\000\000\000\000\000\051\000\052\000\053\000\054\000\000\000\
\000\000\000\000\000\000\055\000\015\000\016\000\017\000\018\000\
\019\000\020\000\021\000\000\000\000\000\000\000\000\000\022\000\
\000\000\023\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\024\000\025\000\026\000\000\000\027\000\028\000\029\000\
\030\000\031\000\000\000\000\000\032\000\033\000\000\000\000\000\
\034\000\035\000\036\000\000\000\000\000\037\000\038\000\000\000\
\039\000\040\000\000\000\041\000\000\000\042\000\043\000\000\000\
\044\000\000\000\045\000\000\000\000\000\000\000\046\000\047\000\
\000\000\048\000\000\000\000\000\000\000\009\000\010\000\011\000\
\000\000\000\000\049\000\012\000\013\000\000\000\000\000\050\000\
\000\000\000\000\000\000\000\000\051\000\052\000\053\000\054\000\
\000\000\000\000\000\000\000\000\055\000\000\000\017\000\018\000\
\019\000\020\000\021\000\000\000\000\000\000\000\000\000\022\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\024\000\025\000\026\000\000\000\027\000\028\000\029\000\
\030\000\031\000\000\000\000\000\032\000\000\000\000\000\000\000\
\034\000\035\000\036\000\000\000\000\000\000\000\038\000\000\000\
\039\000\040\000\000\000\000\000\000\000\042\000\043\000\000\000\
\044\000\000\000\000\000\000\000\000\000\000\000\046\000\047\000\
\000\000\048\000\000\000\000\000\000\000\000\000\230\000\009\000\
\010\000\011\000\000\000\000\000\233\000\012\000\013\000\050\000\
\000\000\000\000\000\000\000\000\051\000\052\000\000\000\054\000\
\000\000\000\000\000\000\000\000\055\000\000\000\000\000\000\000\
\017\000\018\000\019\000\020\000\021\000\000\000\000\000\000\000\
\000\000\022\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\024\000\025\000\026\000\000\000\027\000\
\028\000\029\000\030\000\031\000\000\000\000\000\032\000\000\000\
\000\000\000\000\034\000\035\000\036\000\000\000\000\000\000\000\
\038\000\000\000\039\000\040\000\000\000\000\000\000\000\042\000\
\043\000\000\000\044\000\000\000\000\000\000\000\000\000\000\000\
\046\000\047\000\000\000\048\000\000\000\000\000\009\000\010\000\
\011\000\000\000\000\000\000\000\012\000\013\000\000\000\000\000\
\000\000\050\000\000\000\000\000\000\000\000\000\051\000\052\000\
\000\000\054\000\000\000\006\002\000\000\000\000\055\000\017\000\
\018\000\019\000\020\000\021\000\000\000\000\000\000\000\000\000\
\022\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\024\000\025\000\026\000\000\000\027\000\028\000\
\029\000\030\000\031\000\000\000\000\000\032\000\000\000\000\000\
\000\000\034\000\035\000\036\000\000\000\000\000\000\000\038\000\
\000\000\039\000\040\000\000\000\000\000\000\000\042\000\043\000\
\000\000\044\000\000\000\000\000\000\000\000\000\000\000\046\000\
\047\000\000\000\048\000\000\000\000\000\228\002\228\002\228\002\
\000\000\000\000\000\000\228\002\228\002\000\000\000\000\000\000\
\050\000\000\000\000\000\000\000\000\000\051\000\052\000\000\000\
\054\000\000\000\228\002\000\000\000\000\055\000\228\002\228\002\
\228\002\228\002\228\002\000\000\000\000\000\000\000\000\228\002\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\228\002\228\002\228\002\000\000\228\002\228\002\228\002\
\228\002\228\002\000\000\000\000\228\002\000\000\000\000\000\000\
\228\002\228\002\228\002\000\000\000\000\000\000\228\002\000\000\
\228\002\228\002\000\000\000\000\000\000\228\002\228\002\000\000\
\228\002\000\000\000\000\000\000\000\000\000\000\228\002\228\002\
\000\000\228\002\000\000\000\000\009\000\010\000\011\000\000\000\
\000\000\000\000\012\000\013\000\000\000\000\000\000\000\228\002\
\000\000\000\000\000\000\000\000\228\002\228\002\000\000\228\002\
\000\000\000\000\000\000\000\000\228\002\017\000\018\000\019\000\
\020\000\021\000\000\000\000\000\000\000\000\000\022\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\024\000\025\000\026\000\000\000\027\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\000\000\000\000\000\000\034\000\
\035\000\036\000\000\000\000\000\000\000\038\000\000\000\039\000\
\040\000\000\000\000\000\000\000\042\000\043\000\000\000\044\000\
\000\000\000\000\000\000\000\000\000\000\046\000\047\000\000\000\
\048\000\000\000\000\000\228\002\228\002\228\002\000\000\000\000\
\000\000\228\002\228\002\000\000\000\000\000\000\050\000\000\000\
\000\000\000\000\000\000\051\000\052\000\000\000\054\000\000\000\
\000\000\000\000\000\000\055\000\228\002\228\002\228\002\228\002\
\228\002\000\000\000\000\000\000\000\000\228\002\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\228\002\
\228\002\228\002\000\000\228\002\228\002\228\002\228\002\228\002\
\000\000\000\000\228\002\000\000\000\000\000\000\228\002\228\002\
\228\002\000\000\000\000\000\000\228\002\000\000\228\002\228\002\
\000\000\000\000\000\000\228\002\228\002\000\000\228\002\000\000\
\000\000\000\000\000\000\000\000\228\002\228\002\000\000\228\002\
\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\
\000\000\013\000\000\000\094\003\000\000\228\002\067\002\000\000\
\000\000\000\000\228\002\228\002\000\000\228\002\000\000\000\000\
\095\003\000\000\228\002\017\000\018\000\243\001\000\000\243\001\
\243\001\243\001\000\000\243\001\000\000\000\000\243\001\243\001\
\000\000\000\000\000\000\000\000\000\000\000\000\024\000\025\000\
\026\000\021\002\000\000\164\000\000\000\165\000\166\000\000\000\
\243\001\032\000\000\000\000\000\000\000\000\000\167\000\096\003\
\243\001\243\001\000\000\000\000\000\000\169\000\010\000\000\000\
\243\001\000\000\042\000\000\000\013\000\000\000\066\002\000\000\
\023\002\067\002\000\000\170\000\243\001\243\001\000\000\000\000\
\024\002\000\000\000\000\095\003\000\000\000\000\017\000\018\000\
\171\000\000\000\000\000\000\000\050\000\000\000\000\000\025\002\
\000\000\051\000\000\000\000\000\054\000\172\000\000\000\000\000\
\000\000\024\000\025\000\026\000\021\002\000\000\164\000\000\000\
\165\000\166\000\000\000\000\000\032\000\000\000\000\000\000\000\
\000\000\167\000\096\003\000\000\000\000\000\000\000\000\000\000\
\169\000\010\000\000\000\000\000\000\000\042\000\000\000\013\000\
\000\000\185\003\000\000\023\002\000\000\000\000\170\000\000\000\
\000\000\000\000\000\000\024\002\000\000\000\000\186\003\000\000\
\000\000\017\000\018\000\171\000\000\000\000\000\000\000\050\000\
\000\000\000\000\025\002\000\000\051\000\000\000\000\000\054\000\
\172\000\000\000\000\000\000\000\024\000\025\000\026\000\021\002\
\000\000\164\000\000\000\165\000\166\000\000\000\000\000\032\000\
\000\000\000\000\000\000\000\000\167\000\212\001\000\000\000\000\
\000\000\000\000\000\000\169\000\010\000\000\000\000\000\000\000\
\042\000\000\000\013\000\000\000\146\005\000\000\023\002\000\000\
\000\000\170\000\000\000\000\000\000\000\000\000\024\002\000\000\
\000\000\095\003\000\000\000\000\017\000\018\000\171\000\000\000\
\000\000\000\000\050\000\000\000\000\000\025\002\000\000\051\000\
\000\000\000\000\054\000\172\000\000\000\000\000\000\000\024\000\
\025\000\026\000\021\002\000\000\164\000\000\000\165\000\166\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\096\003\000\000\000\000\000\000\010\000\000\000\169\000\000\000\
\000\000\000\000\013\000\042\000\000\000\000\000\000\000\000\000\
\000\000\023\002\000\000\000\000\170\000\000\000\000\000\000\000\
\000\000\024\002\000\000\000\000\017\000\018\000\000\000\000\000\
\000\000\171\000\000\000\000\000\000\000\050\000\000\000\000\000\
\025\002\000\000\051\000\000\000\000\000\054\000\172\000\024\000\
\025\000\026\000\021\002\000\000\164\000\000\000\165\000\166\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\011\003\000\000\000\000\000\000\010\000\000\000\169\000\000\000\
\012\003\000\000\013\000\042\000\000\000\000\000\000\000\000\000\
\000\000\023\002\000\000\000\000\170\000\000\000\000\000\000\000\
\000\000\024\002\000\000\000\000\017\000\018\000\000\000\000\000\
\000\000\171\000\000\000\000\000\000\000\050\000\000\000\000\000\
\025\002\000\000\051\000\000\000\000\000\054\000\172\000\024\000\
\025\000\026\000\021\002\000\000\164\000\000\000\165\000\166\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\212\001\000\000\000\000\000\000\010\000\000\000\169\000\000\000\
\069\005\000\000\013\000\042\000\000\000\000\000\000\000\000\000\
\000\000\023\002\000\000\000\000\170\000\000\000\000\000\000\000\
\000\000\024\002\000\000\000\000\017\000\018\000\000\000\000\000\
\000\000\171\000\000\000\000\000\000\000\050\000\000\000\000\000\
\025\002\000\000\051\000\000\000\000\000\054\000\172\000\024\000\
\025\000\026\000\021\002\000\000\164\000\000\000\165\000\166\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\022\002\000\000\000\000\000\000\010\000\000\000\169\000\000\000\
\000\000\000\000\013\000\042\000\000\000\000\000\000\000\000\000\
\000\000\023\002\000\000\000\000\170\000\000\000\000\000\000\000\
\000\000\024\002\000\000\000\000\017\000\018\000\000\000\000\000\
\000\000\171\000\000\000\000\000\000\000\050\000\000\000\000\000\
\025\002\000\000\051\000\000\000\000\000\054\000\172\000\024\000\
\025\000\026\000\021\002\000\000\164\000\000\000\165\000\166\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\212\001\000\000\000\000\000\000\228\002\000\000\169\000\000\000\
\000\000\000\000\228\002\042\000\000\000\000\000\000\000\000\000\
\000\000\023\002\000\000\000\000\170\000\000\000\000\000\000\000\
\000\000\024\002\000\000\000\000\228\002\228\002\000\000\000\000\
\000\000\171\000\000\000\000\000\000\000\050\000\000\000\000\000\
\025\002\000\000\051\000\000\000\000\000\054\000\172\000\228\002\
\228\002\228\002\228\002\000\000\228\002\000\000\228\002\228\002\
\000\000\000\000\228\002\000\000\000\000\000\000\000\000\228\002\
\228\002\000\000\000\000\000\000\010\000\000\000\228\002\000\000\
\000\000\000\000\013\000\228\002\000\000\000\000\000\000\000\000\
\000\000\228\002\000\000\000\000\228\002\000\000\000\000\000\000\
\000\000\228\002\162\000\000\000\017\000\018\000\000\000\000\000\
\000\000\228\002\000\000\000\000\000\000\228\002\000\000\000\000\
\228\002\000\000\228\002\000\000\000\000\228\002\228\002\024\000\
\025\000\026\000\000\000\163\000\164\000\000\000\165\000\166\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\168\000\000\000\000\000\000\000\000\000\000\000\169\000\000\000\
\000\000\000\000\010\000\042\000\000\000\000\000\223\001\000\000\
\013\000\000\000\000\000\000\000\170\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\230\000\000\000\000\000\000\000\
\162\000\171\000\017\000\018\000\000\000\050\000\000\000\000\000\
\000\000\000\000\051\000\000\000\000\000\054\000\172\000\000\000\
\000\000\000\000\000\000\000\000\000\000\024\000\025\000\026\000\
\000\000\163\000\164\000\000\000\165\000\166\000\000\000\000\000\
\032\000\000\000\000\000\000\000\000\000\167\000\168\000\000\000\
\000\000\000\000\000\000\000\000\169\000\228\002\000\000\228\002\
\000\000\042\000\000\000\228\002\000\000\000\000\000\000\000\000\
\000\000\000\000\170\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\228\002\000\000\228\002\228\002\171\000\
\000\000\000\000\000\000\050\000\000\000\000\000\000\000\000\000\
\051\000\000\000\000\000\054\000\172\000\000\000\000\000\000\000\
\228\002\228\002\228\002\000\000\228\002\228\002\000\000\228\002\
\228\002\000\000\000\000\228\002\000\000\000\000\000\000\000\000\
\228\002\228\002\000\000\000\000\000\000\228\002\000\000\228\002\
\000\000\000\000\000\000\228\002\228\002\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\228\002\000\000\000\000\
\000\000\000\000\000\000\228\002\000\000\228\002\228\002\000\000\
\000\000\000\000\228\002\000\000\000\000\000\000\228\002\000\000\
\000\000\000\000\000\000\228\002\000\000\000\000\228\002\228\002\
\228\002\228\002\228\002\000\000\228\002\228\002\000\000\228\002\
\228\002\000\000\000\000\228\002\000\000\000\000\000\000\000\000\
\228\002\228\002\000\000\000\000\000\000\000\000\000\000\228\002\
\000\000\000\000\000\000\010\000\228\002\000\000\000\000\000\000\
\000\000\013\000\000\000\000\000\000\000\228\002\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\228\002\000\000\
\000\000\162\000\228\002\017\000\018\000\000\000\228\002\000\000\
\000\000\000\000\000\000\228\002\000\000\000\000\228\002\228\002\
\000\000\000\000\000\000\000\000\000\000\000\000\024\000\025\000\
\026\000\000\000\163\000\164\000\000\000\165\000\166\000\000\000\
\000\000\032\000\000\000\000\000\000\000\000\000\167\000\168\000\
\000\000\000\000\000\000\228\002\000\000\169\000\000\000\000\000\
\000\000\228\002\042\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\170\000\000\000\000\000\000\000\000\000\
\000\000\228\002\000\000\228\002\228\002\000\000\000\000\000\000\
\171\000\000\000\000\000\000\000\050\000\000\000\000\000\000\000\
\000\000\051\000\000\000\000\000\054\000\172\000\228\002\228\002\
\228\002\000\000\228\002\228\002\000\000\228\002\228\002\000\000\
\000\000\228\002\000\000\000\000\000\000\000\000\228\002\228\002\
\000\000\000\000\000\000\161\002\000\000\228\002\000\000\000\000\
\000\000\161\002\228\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\228\002\000\000\000\000\000\000\000\000\
\000\000\161\002\000\000\161\002\161\002\000\000\000\000\000\000\
\228\002\000\000\000\000\000\000\228\002\000\000\000\000\000\000\
\000\000\228\002\000\000\000\000\228\002\228\002\161\002\161\002\
\161\002\000\000\161\002\161\002\000\000\161\002\161\002\000\000\
\000\000\161\002\000\000\000\000\000\000\000\000\161\002\161\002\
\000\000\000\000\000\000\142\002\000\000\161\002\000\000\000\000\
\000\000\142\002\161\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\161\002\000\000\000\000\000\000\000\000\
\000\000\142\002\000\000\142\002\142\002\000\000\000\000\000\000\
\161\002\000\000\000\000\000\000\161\002\000\000\000\000\000\000\
\000\000\161\002\000\000\000\000\161\002\161\002\142\002\142\002\
\142\002\000\000\142\002\142\002\000\000\142\002\142\002\000\000\
\000\000\142\002\000\000\000\000\000\000\000\000\142\002\142\002\
\000\000\000\000\000\000\010\000\000\000\142\002\000\000\000\000\
\000\000\013\000\142\002\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\142\002\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\017\000\018\000\000\000\000\000\000\000\
\142\002\000\000\000\000\000\000\142\002\000\000\000\000\000\000\
\000\000\142\002\000\000\000\000\142\002\142\002\024\000\025\000\
\026\000\000\000\000\000\164\000\000\000\165\000\166\000\000\000\
\000\000\032\000\000\000\000\000\000\000\000\000\167\000\212\001\
\000\000\000\000\000\000\000\000\000\000\169\000\010\000\011\000\
\000\000\000\000\042\000\012\000\013\000\000\000\000\000\000\000\
\000\000\000\000\000\000\170\000\000\000\000\000\124\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\017\000\018\000\
\171\000\000\000\000\000\000\000\050\000\000\000\000\000\000\000\
\000\000\051\000\000\000\000\000\054\000\172\000\000\000\000\000\
\000\000\024\000\025\000\026\000\125\001\000\000\028\000\029\000\
\030\000\031\000\000\000\000\000\032\000\000\000\000\000\000\000\
\000\000\167\000\192\000\000\000\000\000\010\000\011\000\000\000\
\000\000\000\000\012\000\013\000\000\000\042\000\043\000\000\000\
\000\000\000\000\000\000\126\001\000\000\000\000\000\000\000\000\
\000\000\048\000\000\000\127\001\000\000\017\000\018\000\000\000\
\000\000\000\000\000\000\128\001\129\001\000\000\000\000\050\000\
\000\000\000\000\130\001\000\000\051\000\000\000\000\000\054\000\
\024\000\025\000\026\000\125\001\000\000\028\000\029\000\030\000\
\031\000\000\000\000\000\032\000\000\000\000\000\000\000\000\000\
\167\000\192\000\000\000\000\000\010\000\011\000\000\000\000\000\
\000\000\012\000\013\000\000\000\042\000\043\000\000\000\000\000\
\000\000\000\000\126\001\000\000\000\000\000\000\000\000\000\000\
\048\000\000\000\127\001\000\000\017\000\018\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\050\000\000\000\
\000\000\130\001\000\000\051\000\000\000\000\000\054\000\024\000\
\025\000\026\000\000\000\000\000\028\000\029\000\030\000\031\000\
\000\000\000\000\032\000\000\000\000\000\000\000\000\000\167\000\
\192\000\000\000\000\000\010\000\011\000\000\000\000\000\000\000\
\012\000\013\000\000\000\042\000\043\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\048\000\
\000\000\000\000\000\000\017\000\018\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\050\000\000\000\000\000\
\000\000\000\000\051\000\000\000\000\000\054\000\024\000\025\000\
\026\000\000\000\000\000\028\000\029\000\030\000\031\000\000\000\
\000\000\032\000\000\000\000\000\000\000\000\000\219\000\192\000\
\000\000\000\000\228\002\228\002\000\000\000\000\000\000\228\002\
\228\002\000\000\042\000\043\000\000\000\000\000\000\000\000\000\
\000\000\000\000\144\004\000\000\000\000\000\000\048\000\000\000\
\000\000\200\000\228\002\228\002\137\000\000\000\138\000\139\000\
\032\000\145\004\140\000\000\000\050\000\141\000\142\000\000\000\
\201\000\051\000\000\000\000\000\054\000\228\002\228\002\228\002\
\000\000\000\000\228\002\228\002\228\002\228\002\000\000\143\000\
\228\002\000\000\000\000\000\000\000\000\228\002\228\002\144\000\
\144\003\000\000\137\000\000\000\138\000\139\000\032\000\146\000\
\140\000\228\002\228\002\141\000\146\004\000\000\000\000\000\000\
\000\000\144\004\183\005\147\000\148\000\228\002\000\000\000\000\
\200\000\000\000\000\000\000\000\000\000\143\000\000\000\000\000\
\000\000\000\000\000\000\228\002\147\004\144\000\145\000\201\000\
\228\002\000\000\000\000\228\002\000\000\146\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\203\000\000\000\
\000\000\148\004\148\000\000\000\000\000\000\000\000\000\000\000\
\000\000\137\000\000\000\138\000\139\000\032\000\000\000\140\000\
\000\000\000\000\141\000\146\004\000\000\000\000\000\000\000\000\
\211\003\087\001\088\001\000\000\000\000\000\000\000\000\000\000\
\000\000\089\001\000\000\000\000\143\000\000\000\212\003\090\001\
\091\001\213\003\092\001\000\000\144\000\145\000\000\000\000\000\
\000\000\000\000\000\000\093\001\146\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\094\001\203\000\000\000\000\000\
\148\004\148\000\095\001\096\001\097\001\098\001\099\001\035\001\
\036\001\037\001\000\000\000\000\000\000\000\000\225\001\000\000\
\039\001\000\000\000\000\000\000\000\000\000\000\100\001\041\001\
\000\000\000\000\000\000\185\000\000\000\000\000\000\000\000\000\
\101\001\102\001\042\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\043\001\103\001\104\001\105\001\106\001\
\107\001\044\001\045\001\046\001\047\001\048\001\000\000\000\000\
\214\003\000\000\000\000\000\000\000\000\000\000\109\001\000\000\
\000\000\000\000\000\000\000\000\000\000\049\001\000\000\000\000\
\000\000\087\001\088\001\000\000\000\000\000\000\000\000\016\002\
\228\001\089\001\017\002\000\000\000\000\000\000\000\000\090\001\
\091\001\000\000\092\001\053\001\054\001\018\002\231\001\057\001\
\232\001\000\000\000\000\093\001\000\000\000\000\000\000\000\000\
\000\000\087\001\088\001\060\001\094\001\061\001\000\000\000\000\
\000\000\089\001\095\001\096\001\097\001\098\001\099\001\090\001\
\091\001\000\000\092\001\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\093\001\000\000\000\000\100\001\000\000\
\000\000\000\000\000\000\185\000\094\001\000\000\000\000\000\000\
\101\001\102\001\095\001\096\001\097\001\098\001\099\001\000\000\
\000\000\000\000\000\000\000\000\103\001\104\001\105\001\106\001\
\107\001\000\000\000\000\000\000\000\000\000\000\100\001\087\001\
\088\001\108\001\000\000\185\000\000\000\000\000\109\001\089\001\
\101\001\102\001\000\000\000\000\000\000\090\001\091\001\000\000\
\092\001\000\000\000\000\000\000\103\001\104\001\105\001\106\001\
\107\001\093\001\000\000\000\000\000\000\016\004\000\000\087\001\
\088\001\000\000\094\001\000\000\000\000\000\000\109\001\089\001\
\095\001\096\001\097\001\098\001\099\001\090\001\091\001\000\000\
\092\001\000\000\000\000\000\000\000\000\000\000\000\000\114\004\
\000\000\093\001\000\000\000\000\100\001\000\000\000\000\000\000\
\000\000\185\000\094\001\000\000\000\000\000\000\101\001\102\001\
\095\001\096\001\097\001\098\001\099\001\000\000\000\000\000\000\
\000\000\000\000\103\001\104\001\105\001\106\001\107\001\000\000\
\000\000\000\000\000\000\063\004\100\001\087\001\088\001\000\000\
\000\000\185\000\000\000\000\000\109\001\089\001\101\001\102\001\
\000\000\000\000\000\000\090\001\091\001\000\000\092\001\000\000\
\000\000\000\000\103\001\104\001\105\001\106\001\107\001\093\001\
\000\000\000\000\000\000\000\000\000\000\087\001\088\001\000\000\
\094\001\000\000\000\000\000\000\109\001\089\001\095\001\096\001\
\097\001\098\001\099\001\090\001\091\001\000\000\126\004\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\093\001\
\000\000\000\000\100\001\000\000\000\000\000\000\000\000\185\000\
\094\001\000\000\000\000\000\000\101\001\102\001\095\001\096\001\
\097\001\098\001\099\001\000\000\000\000\000\000\000\000\000\000\
\103\001\104\001\105\001\106\001\107\001\000\000\000\000\000\000\
\000\000\000\000\100\001\234\000\234\000\000\000\000\000\185\000\
\000\000\000\000\109\001\234\000\101\001\102\001\000\000\000\000\
\000\000\234\000\234\000\000\000\000\000\000\000\000\000\000\000\
\103\001\104\001\105\001\106\001\107\001\234\000\000\000\000\000\
\000\000\000\000\000\000\087\001\088\001\000\000\234\000\000\000\
\000\000\000\000\109\001\089\001\234\000\234\000\234\000\234\000\
\234\000\090\001\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\093\001\000\000\000\000\
\234\000\000\000\000\000\000\000\000\000\234\000\094\001\000\000\
\000\000\000\000\234\000\234\000\095\001\096\001\097\001\098\001\
\099\001\000\000\000\000\000\000\000\000\000\000\234\000\234\000\
\234\000\234\000\234\000\000\000\000\000\000\000\000\000\234\000\
\100\001\087\001\088\001\000\000\000\000\185\000\000\000\000\000\
\234\000\089\001\101\001\102\001\000\000\000\000\000\000\090\001\
\000\000\000\000\000\000\000\000\000\000\000\000\103\001\104\001\
\105\001\106\001\107\001\093\001\000\000\000\000\000\000\000\000\
\000\000\000\000\082\005\000\000\094\001\000\000\000\000\000\000\
\109\001\000\000\095\001\096\001\097\001\098\001\099\001\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\087\001\088\001\
\000\000\000\000\000\000\000\000\000\000\000\000\100\001\000\000\
\000\000\000\000\000\000\185\000\090\001\000\000\000\000\000\000\
\101\001\102\001\000\000\000\000\000\000\000\000\000\000\000\000\
\093\001\000\000\000\000\000\000\103\001\104\001\105\001\106\001\
\107\001\094\001\000\000\000\000\000\000\000\000\000\000\095\001\
\096\001\097\001\098\001\099\001\000\000\000\000\109\001\000\000\
\000\000\000\000\000\000\000\000\137\000\000\000\138\000\139\000\
\032\000\000\000\140\000\100\001\000\000\141\000\142\000\000\000\
\185\000\000\000\000\000\000\000\000\000\101\001\102\001\192\001\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\143\000\
\000\000\000\000\104\001\105\001\106\001\107\001\000\000\144\000\
\145\000\000\000\000\000\000\000\000\000\000\000\000\000\146\000\
\000\000\000\000\000\000\109\001\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\147\000\148\000"

let yycheck = "\003\000\
\004\000\094\000\006\000\002\000\146\000\002\000\062\001\015\000\
\131\001\163\000\137\000\014\002\143\000\164\000\033\001\010\000\
\137\000\186\002\192\001\029\000\158\000\013\003\139\000\009\002\
\209\000\009\000\178\001\213\000\012\000\097\003\127\003\031\000\
\036\000\171\000\143\001\019\000\020\000\021\000\022\000\086\002\
\011\000\055\003\243\002\027\000\186\002\012\002\212\000\014\002\
\166\004\001\000\034\000\003\000\004\000\002\000\038\000\209\000\
\012\004\028\000\033\000\043\000\044\000\232\000\037\000\234\000\
\003\000\004\000\111\001\002\000\052\000\007\000\000\000\055\000\
\059\000\000\000\147\004\000\000\002\000\048\000\012\002\132\000\
\014\002\134\000\073\004\031\001\098\000\138\004\139\004\095\000\
\003\000\002\000\140\001\188\004\001\000\210\000\066\004\017\001\
\110\000\049\000\002\000\098\000\002\000\098\000\085\004\067\001\
\197\000\001\002\002\002\059\000\065\001\000\000\015\001\110\000\
\083\000\110\000\085\000\086\000\064\001\000\001\037\001\015\002\
\248\003\000\001\052\001\007\001\004\001\067\001\130\000\122\000\
\008\001\151\004\140\000\010\001\096\001\090\001\000\001\015\001\
\023\004\154\004\018\001\005\000\049\000\183\001\000\001\185\001\
\000\001\137\000\065\001\000\001\007\001\098\000\145\000\134\004\
\000\001\117\001\096\001\000\001\000\001\114\001\172\003\000\001\
\000\001\110\000\067\001\098\000\036\004\000\001\150\000\074\002\
\000\001\017\001\010\001\078\002\098\000\000\001\096\001\110\000\
\128\000\018\005\130\000\008\001\132\000\094\003\134\000\069\001\
\110\000\098\000\000\001\067\001\192\000\128\000\174\000\130\000\
\196\000\132\000\098\000\134\000\098\000\110\000\212\003\213\003\
\000\001\000\001\174\004\187\000\000\001\046\005\110\000\211\000\
\110\000\067\001\185\000\186\000\065\001\096\001\008\002\130\000\
\000\001\188\000\000\001\210\004\065\001\065\001\000\001\076\002\
\162\000\132\002\067\001\165\000\166\000\124\001\114\001\215\000\
\142\001\065\001\217\004\115\001\014\001\093\001\096\001\009\000\
\178\000\179\000\012\000\009\005\227\004\111\001\007\005\218\000\
\096\001\019\000\020\000\021\000\022\000\139\003\094\001\096\001\
\017\005\027\000\111\001\117\001\000\001\096\001\214\000\079\001\
\136\004\094\001\111\001\111\001\038\000\096\001\208\000\067\001\
\061\002\043\000\044\000\190\001\117\001\094\005\004\001\111\001\
\094\001\118\001\052\000\120\001\045\005\055\000\024\001\000\001\
\004\001\067\001\065\001\066\001\008\001\093\001\093\001\000\000\
\000\001\097\001\097\001\015\001\096\001\022\001\018\001\190\004\
\032\001\214\000\159\002\222\001\000\002\224\001\014\001\093\001\
\096\001\017\001\003\001\097\001\191\001\065\001\096\001\000\001\
\022\001\183\005\208\001\038\001\000\001\162\001\000\001\075\001\
\067\001\064\005\078\001\206\001\219\004\004\001\030\001\031\001\
\111\001\008\001\000\001\133\002\134\002\102\005\069\005\058\001\
\015\001\000\001\000\001\018\001\074\001\000\001\081\001\067\001\
\026\001\093\001\250\002\083\001\117\005\097\001\074\001\010\001\
\108\001\080\001\036\002\000\001\112\001\000\001\005\002\103\004\
\064\001\107\001\068\001\015\001\166\002\170\001\128\001\172\001\
\173\005\174\001\032\002\021\002\069\004\094\001\071\004\255\004\
\026\002\081\001\030\001\145\001\154\005\119\003\092\001\026\001\
\096\001\055\003\010\005\084\004\067\001\183\002\067\001\115\001\
\051\003\093\002\145\001\077\002\145\001\000\001\000\001\165\004\
\000\001\067\001\125\001\126\001\093\001\129\005\129\001\115\005\
\131\001\047\004\094\001\147\001\094\001\022\001\066\001\000\001\
\000\001\000\001\027\001\000\001\018\001\111\001\027\003\093\001\
\063\005\010\001\000\001\010\001\000\001\000\001\096\001\093\001\
\176\001\096\001\073\005\094\001\017\001\000\001\097\001\183\001\
\003\001\185\001\178\001\181\003\145\001\244\003\008\001\128\002\
\000\001\000\001\043\005\096\001\018\001\037\001\017\001\089\002\
\108\001\193\001\145\001\111\001\065\003\035\001\008\001\207\001\
\028\005\037\001\170\001\145\001\172\001\015\001\174\001\190\003\
\191\003\008\001\036\001\211\001\136\002\243\004\128\002\170\001\
\145\001\172\001\000\001\174\001\030\001\221\001\060\001\126\005\
\150\002\145\001\093\001\145\001\066\001\000\001\096\001\239\004\
\096\001\233\001\146\003\185\003\000\001\000\001\172\003\010\001\
\190\003\191\003\203\004\112\003\054\001\094\001\032\001\094\001\
\097\001\097\001\097\001\096\001\252\001\253\001\000\001\124\003\
\066\001\001\002\002\002\094\001\012\002\097\001\014\002\132\003\
\094\001\163\002\104\001\000\001\094\001\096\001\000\001\015\002\
\008\001\111\001\177\005\022\001\020\002\047\002\212\003\213\003\
\096\001\096\001\028\004\000\001\008\001\015\001\018\001\014\001\
\000\002\191\004\034\002\015\001\246\001\247\001\248\001\094\001\
\194\002\242\002\108\001\210\002\254\001\111\001\066\001\067\001\
\195\002\196\002\030\001\188\003\232\002\027\001\006\001\008\001\
\094\001\018\001\092\001\059\002\066\001\052\002\008\001\027\001\
\064\002\065\001\066\001\094\001\074\001\098\005\097\001\097\002\
\242\002\023\004\028\002\094\001\096\001\023\003\112\001\000\001\
\100\002\067\001\098\002\099\002\209\003\016\001\066\001\018\001\
\018\001\022\001\036\001\093\001\246\002\067\001\000\001\018\001\
\099\001\100\001\018\001\013\003\054\002\022\001\094\001\022\001\
\093\001\174\002\027\001\061\002\096\001\096\002\096\001\019\001\
\008\001\096\001\117\001\014\001\022\001\137\002\138\002\015\001\
\093\001\027\001\000\001\073\004\153\005\093\002\126\002\081\002\
\108\001\030\001\042\004\111\001\096\001\014\004\030\001\096\001\
\014\001\019\002\040\005\047\001\042\005\094\001\094\001\117\001\
\090\003\018\001\157\002\000\000\094\001\014\001\018\001\151\002\
\097\003\061\001\018\001\056\001\087\003\088\003\089\003\092\001\
\018\001\069\001\188\002\071\001\094\001\066\001\035\004\066\001\
\067\001\115\003\066\001\053\002\093\001\096\001\094\001\183\002\
\097\001\022\001\099\001\100\001\099\001\100\001\004\001\097\003\
\066\002\067\002\063\003\093\001\066\001\067\001\201\002\097\001\
\022\001\099\001\100\001\027\001\117\001\096\001\023\001\076\003\
\235\003\220\004\237\003\238\003\027\001\113\001\174\002\108\001\
\003\001\027\001\111\001\117\001\108\001\233\002\234\002\111\001\
\081\001\022\001\096\001\174\002\000\001\094\001\222\002\096\001\
\224\002\027\001\226\002\227\002\096\001\027\001\094\001\165\004\
\096\001\164\003\008\001\255\002\066\001\220\004\096\001\019\001\
\190\004\015\001\023\001\188\003\067\001\067\001\026\001\092\001\
\012\003\136\003\250\002\153\003\027\001\207\002\254\002\008\001\
\030\001\211\002\149\003\019\001\210\004\066\001\015\001\192\005\
\096\001\090\001\096\001\047\001\048\001\219\004\220\004\015\003\
\017\001\059\002\188\003\027\001\003\001\030\001\096\001\008\001\
\054\001\061\001\164\002\000\001\065\001\231\003\066\001\002\001\
\032\003\069\001\192\005\071\001\066\001\000\001\096\001\110\001\
\004\001\003\001\096\001\114\001\008\001\019\001\036\001\047\003\
\048\003\003\003\014\001\015\001\068\001\243\004\018\001\193\002\
\019\001\066\001\058\003\074\003\060\003\074\003\008\001\026\001\
\084\003\096\001\067\001\067\003\068\003\014\004\081\003\071\003\
\092\003\047\001\048\001\095\003\014\001\113\001\108\001\217\002\
\119\003\111\001\014\001\068\001\047\001\048\001\067\001\061\001\
\096\001\027\001\229\004\014\001\065\001\066\001\063\001\069\001\
\067\001\071\001\061\001\108\001\014\004\013\005\111\001\067\001\
\027\001\068\001\069\001\097\001\071\001\067\001\068\001\000\000\
\000\001\063\005\064\005\014\001\004\001\065\001\029\004\000\000\
\008\001\003\001\068\001\073\005\014\001\125\003\014\001\015\001\
\136\003\035\001\018\001\131\003\096\001\144\003\066\001\067\001\
\117\001\027\001\083\004\113\001\051\004\098\001\181\003\081\001\
\003\001\093\001\146\003\000\001\065\001\066\001\113\001\004\001\
\152\003\161\003\060\001\008\001\065\001\010\001\081\001\117\001\
\066\001\014\001\015\001\163\003\055\004\018\001\166\003\066\001\
\015\001\083\004\114\001\018\001\183\003\027\001\027\001\175\003\
\126\005\098\001\022\001\067\001\092\005\000\000\069\004\191\003\
\082\004\205\003\206\003\012\001\069\004\103\004\014\001\081\001\
\104\005\045\001\046\001\112\001\094\004\197\003\104\001\219\003\
\181\005\182\005\111\001\027\001\008\001\111\001\031\001\113\001\
\096\001\065\001\210\003\155\001\094\003\067\001\067\001\215\003\
\236\003\171\003\186\003\101\003\067\001\074\001\066\001\013\001\
\049\001\050\001\051\001\177\005\000\001\229\003\065\001\093\001\
\003\001\085\001\065\001\097\001\092\001\218\005\028\001\029\001\
\093\001\094\001\066\001\096\001\097\001\076\001\010\004\072\001\
\160\005\161\005\102\001\041\001\077\001\207\003\026\001\111\001\
\004\001\001\004\000\000\029\004\008\001\086\001\115\001\014\001\
\099\001\027\001\005\000\011\004\007\000\040\001\018\001\061\001\
\067\001\227\003\064\001\091\005\111\001\222\004\103\001\069\001\
\024\004\025\004\194\005\114\001\023\000\075\001\004\001\000\001\
\032\004\243\003\008\001\065\001\082\001\048\004\038\004\096\001\
\065\001\015\001\042\004\035\001\018\001\096\001\000\001\022\001\
\216\005\067\001\019\001\056\001\222\004\027\001\111\001\060\001\
\010\001\026\001\027\001\059\004\065\001\069\004\230\005\067\001\
\110\001\000\000\117\001\092\001\060\001\239\004\074\001\014\001\
\065\001\090\001\066\001\080\001\065\001\077\004\047\001\048\001\
\065\001\111\001\102\004\028\005\027\001\105\004\111\001\112\001\
\226\003\089\004\094\001\066\001\061\001\067\001\232\003\065\001\
\234\003\114\001\065\001\068\001\069\001\096\000\071\001\090\004\
\124\004\125\004\111\001\065\001\246\003\065\001\000\000\000\001\
\104\001\022\001\028\005\115\004\031\001\085\004\111\001\111\001\
\144\004\027\001\111\001\066\001\013\001\092\001\111\001\112\001\
\128\004\099\001\130\004\131\004\132\004\157\004\049\001\050\001\
\051\001\026\001\027\001\028\001\029\001\111\001\137\000\088\005\
\113\001\112\001\065\001\142\000\143\000\149\004\000\001\171\004\
\041\001\111\001\056\001\111\001\027\001\065\001\022\001\068\001\
\058\005\067\001\077\001\065\001\188\004\065\001\134\004\162\000\
\163\000\071\005\165\000\166\000\061\001\168\000\088\005\064\001\
\026\001\065\001\067\001\068\001\069\001\000\001\000\001\178\000\
\179\000\004\001\075\001\187\004\065\001\008\001\004\001\010\001\
\111\001\082\001\008\001\014\001\067\001\031\001\065\001\018\001\
\014\001\015\001\066\001\111\001\018\001\094\001\206\004\096\001\
\027\001\098\001\099\001\111\001\220\004\208\000\209\000\049\001\
\050\001\051\001\213\000\037\001\240\004\110\001\104\004\111\001\
\113\001\225\004\108\004\065\001\117\001\102\001\000\005\027\001\
\035\001\003\005\234\004\005\005\004\001\004\001\238\004\027\001\
\008\001\008\001\229\004\077\001\111\001\022\001\200\004\015\001\
\016\005\217\004\018\001\018\001\252\004\067\001\065\001\074\001\
\065\001\060\001\000\001\227\004\065\001\066\001\004\001\066\001\
\008\005\147\004\008\001\072\001\010\001\013\005\027\001\067\001\
\014\001\111\001\093\001\094\001\044\005\096\001\097\001\067\001\
\004\001\086\001\000\000\027\005\008\001\027\001\168\004\092\001\
\032\005\066\001\000\001\015\001\000\001\096\001\018\001\065\001\
\115\001\022\001\035\001\067\001\111\001\104\001\111\001\062\005\
\114\001\062\005\111\001\112\001\111\001\053\005\067\001\000\001\
\075\001\052\001\078\005\059\005\086\005\087\005\026\001\172\005\
\090\005\065\005\003\001\060\001\054\001\095\005\056\001\037\001\
\065\001\066\001\212\004\067\001\074\001\077\005\013\001\065\001\
\066\001\026\001\075\001\083\005\067\001\111\001\018\001\067\001\
\000\001\081\001\110\005\110\001\092\005\028\001\029\001\093\001\
\094\001\072\001\096\001\097\001\100\005\069\005\085\001\040\001\
\104\005\131\005\041\001\019\001\101\001\109\005\000\000\086\001\
\250\004\000\001\026\001\027\001\111\001\115\001\111\001\022\001\
\000\001\121\005\092\001\013\001\027\001\111\001\061\001\000\001\
\111\001\064\001\150\005\090\001\014\005\067\001\069\001\047\001\
\048\001\137\005\028\001\029\001\075\001\023\001\112\001\163\005\
\026\005\171\005\026\001\082\001\143\001\061\001\037\001\041\001\
\000\001\026\001\036\001\114\001\068\001\069\001\023\001\071\001\
\160\005\161\005\004\001\098\001\099\001\056\001\008\001\096\001\
\168\005\051\005\190\005\061\001\033\001\015\001\064\001\110\001\
\018\001\203\005\204\005\069\001\000\001\176\001\067\001\065\001\
\184\005\075\001\014\001\187\005\183\001\037\001\185\001\211\005\
\082\001\193\005\194\005\056\001\191\001\000\001\066\001\060\001\
\085\001\113\001\000\001\064\001\065\001\066\001\026\001\065\001\
\098\001\099\001\000\001\206\001\207\001\213\005\234\005\227\003\
\216\005\212\001\076\001\080\001\110\001\221\005\022\001\026\001\
\224\005\067\001\000\000\097\001\026\001\229\005\230\005\243\003\
\232\005\233\005\066\001\093\001\026\001\099\001\100\001\027\001\
\072\001\097\001\000\001\066\001\027\001\054\001\128\005\056\001\
\000\001\072\001\111\001\246\001\247\001\248\001\086\001\117\001\
\065\001\066\001\004\001\254\001\018\001\033\001\008\001\086\001\
\146\005\014\001\148\005\019\001\017\001\015\001\097\001\000\000\
\018\001\012\002\026\001\014\002\158\005\022\001\027\001\065\001\
\019\002\027\001\021\002\022\002\056\001\022\001\000\001\026\002\
\060\001\028\002\076\001\095\001\064\001\065\001\066\001\047\001\
\048\001\036\002\111\001\181\005\182\005\000\001\111\001\040\001\
\096\001\019\001\188\005\016\001\080\001\061\001\095\001\010\001\
\026\001\066\001\053\002\054\002\068\001\069\001\027\001\071\001\
\111\001\067\001\061\002\205\005\066\001\110\001\111\001\066\002\
\067\002\003\001\212\005\000\001\074\001\047\001\048\001\067\001\
\218\005\076\002\077\002\111\001\222\005\010\001\081\002\075\001\
\111\001\227\005\228\005\061\001\004\001\096\001\082\001\110\001\
\008\001\085\001\068\001\069\001\041\002\071\001\065\001\015\001\
\045\002\113\001\018\001\065\001\111\001\112\001\000\001\001\001\
\002\001\003\001\000\001\027\001\065\001\066\001\008\001\009\001\
\010\001\111\001\008\001\013\001\014\001\014\001\016\001\017\001\
\018\001\019\001\020\001\021\001\000\000\128\002\024\001\025\001\
\026\001\027\001\028\001\029\001\066\001\067\001\068\001\113\001\
\095\001\111\001\036\001\037\001\065\001\066\001\040\001\041\001\
\042\001\043\001\094\001\067\001\008\001\047\001\048\001\110\001\
\111\001\066\001\067\001\000\001\159\002\067\001\068\001\000\001\
\014\001\164\002\036\001\061\001\062\001\097\001\064\001\024\002\
\025\002\067\001\068\001\069\001\074\001\071\001\019\001\014\001\
\074\001\075\001\019\001\022\001\183\002\026\001\111\001\186\002\
\082\001\026\001\084\001\092\001\022\001\027\001\193\002\000\001\
\195\002\196\002\097\001\093\001\094\001\097\001\096\001\097\001\
\098\001\099\001\047\001\048\001\207\002\096\001\047\001\105\001\
\211\002\107\001\019\001\000\001\110\001\065\001\217\002\113\001\
\061\001\026\001\000\001\117\001\061\001\003\001\000\000\068\001\
\069\001\111\001\071\001\068\001\069\001\105\001\071\001\013\001\
\014\001\094\001\111\001\094\001\066\001\094\001\047\001\242\002\
\243\002\096\001\117\001\027\001\026\001\027\001\028\001\029\001\
\117\001\020\001\046\001\014\001\061\001\065\001\022\001\063\001\
\003\003\081\001\040\001\041\001\069\001\065\001\071\001\000\001\
\011\003\014\001\013\003\004\001\113\001\014\001\022\001\008\001\
\113\001\010\001\002\001\074\001\023\003\014\001\015\001\061\001\
\027\003\018\001\064\001\076\000\066\001\067\001\068\001\069\001\
\117\001\096\001\027\001\074\001\102\001\075\001\054\001\055\001\
\056\001\057\001\015\001\000\000\082\001\066\001\094\001\065\001\
\113\001\065\001\066\001\092\001\074\001\102\001\096\001\065\001\
\094\001\094\001\096\001\108\000\098\001\099\001\065\003\065\001\
\008\001\014\001\000\001\027\001\088\001\027\001\027\001\030\001\
\110\001\065\001\067\001\113\001\065\001\126\000\014\001\117\001\
\094\001\074\001\111\001\003\001\133\000\019\001\000\000\090\003\
\014\001\088\001\049\001\094\003\026\001\096\003\097\003\111\001\
\065\001\006\001\101\003\110\001\093\001\094\001\074\001\096\001\
\097\001\111\001\065\001\066\001\027\001\112\003\097\001\096\001\
\115\003\047\001\048\001\103\001\027\001\014\001\096\001\065\001\
\096\001\124\003\115\001\040\001\000\001\090\001\021\001\061\001\
\004\001\132\003\065\001\027\001\008\001\136\003\010\001\069\001\
\139\003\071\001\014\001\015\001\065\001\063\001\063\001\016\001\
\103\001\013\001\149\003\063\001\014\001\108\001\003\001\027\001\
\111\001\054\001\055\001\056\001\057\001\014\001\161\003\066\001\
\028\001\029\001\065\001\027\001\065\001\066\001\215\000\096\001\
\171\003\074\001\102\001\054\001\096\001\041\001\074\001\008\001\
\022\001\000\000\096\001\113\001\016\001\096\001\185\003\186\003\
\076\001\188\003\076\001\190\003\191\003\027\001\096\001\067\001\
\007\000\061\001\074\001\027\001\014\001\020\001\074\001\090\001\
\000\001\069\001\114\001\096\001\207\003\074\001\209\003\075\001\
\023\000\096\001\111\001\065\001\114\001\028\000\082\001\014\001\
\093\001\093\001\094\001\019\001\096\001\097\001\000\001\226\003\
\227\003\003\001\026\001\074\001\231\003\232\003\098\001\234\003\
\021\001\014\001\014\001\013\001\014\001\014\001\014\001\115\001\
\243\003\027\001\110\001\246\003\019\001\113\001\090\001\047\001\
\026\001\027\001\028\001\029\001\001\000\002\000\003\000\004\000\
\005\000\006\000\007\000\114\001\014\001\061\001\040\001\041\001\
\027\001\093\001\014\001\014\004\068\001\069\001\022\001\071\001\
\015\001\014\001\000\000\014\001\023\004\097\001\000\000\000\000\
\111\001\098\001\098\001\061\001\094\001\111\001\064\001\008\001\
\035\004\082\001\068\001\069\001\065\001\094\001\036\001\092\001\
\036\001\075\001\094\001\000\001\047\004\044\001\045\001\046\001\
\082\001\096\001\074\001\008\001\055\004\054\001\065\001\022\001\
\013\001\113\001\065\001\065\001\094\001\054\001\096\001\066\004\
\098\001\099\001\069\004\093\001\071\004\026\001\073\004\028\001\
\029\001\072\001\073\001\146\000\110\001\065\001\065\001\113\001\
\083\004\084\004\085\004\117\001\041\001\065\001\085\001\086\001\
\087\001\088\001\065\001\162\000\163\000\164\000\165\000\166\000\
\065\001\168\000\147\001\013\001\103\004\104\004\128\000\102\001\
\061\001\108\004\028\004\178\000\179\000\222\004\067\001\068\001\
\069\001\090\004\028\001\029\001\086\004\142\001\075\001\128\005\
\088\005\056\005\171\001\199\003\009\003\082\001\056\001\041\001\
\058\001\059\001\060\001\134\004\062\001\096\002\164\001\065\001\
\066\001\208\000\209\000\130\001\255\001\098\001\213\000\146\004\
\147\004\097\002\207\003\061\001\061\002\210\002\064\001\166\000\
\098\004\110\001\099\000\069\001\113\001\102\003\192\005\188\004\
\031\004\075\001\092\001\018\005\207\001\168\004\255\255\000\000\
\082\001\099\001\198\004\174\004\007\000\188\002\255\255\255\255\
\011\000\000\001\255\255\255\255\003\001\111\001\112\001\255\255\
\098\001\099\001\255\255\190\004\191\004\255\255\013\001\255\255\
\255\255\028\000\017\001\255\255\110\001\200\004\255\255\022\001\
\203\004\255\255\255\255\026\001\027\001\028\001\029\001\210\004\
\255\255\212\004\255\255\255\255\255\255\048\000\217\004\255\255\
\219\004\220\004\041\001\222\004\255\255\255\255\255\255\255\255\
\227\004\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\239\004\052\001\061\001\255\255\
\255\255\064\001\255\255\066\001\067\001\068\001\069\001\250\004\
\083\000\255\255\085\000\086\000\075\001\255\255\069\001\255\255\
\255\255\072\001\255\255\082\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\014\005\255\255\255\255\255\255\094\001\
\255\255\096\001\000\001\098\001\099\001\255\255\004\001\026\005\
\255\255\028\005\008\001\255\255\010\001\255\255\079\002\110\001\
\014\001\000\001\113\001\084\002\018\001\040\005\117\001\042\005\
\111\001\255\255\255\255\255\255\255\255\027\001\255\255\255\255\
\051\005\255\255\255\255\255\255\019\001\124\001\255\255\000\000\
\255\255\255\255\255\255\026\001\063\005\064\005\255\255\255\255\
\255\255\255\255\069\005\255\255\255\255\255\255\073\005\162\000\
\163\000\255\255\165\000\166\000\255\255\168\000\127\002\255\255\
\047\001\048\001\255\255\255\255\255\255\088\005\255\255\178\000\
\179\000\255\255\255\255\255\255\074\001\164\001\061\001\255\255\
\255\255\188\000\255\255\255\255\255\255\255\255\069\001\255\255\
\071\001\255\255\255\255\255\255\255\255\255\255\255\255\093\001\
\094\001\162\002\096\001\097\001\255\255\208\000\209\000\255\255\
\255\255\255\255\255\255\126\005\255\255\128\005\129\005\218\000\
\255\255\255\255\255\255\255\255\255\255\115\001\255\255\255\255\
\255\255\208\001\255\255\255\255\255\255\212\001\255\255\146\005\
\255\255\148\005\113\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\158\005\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\001\
\255\255\255\255\003\001\255\255\255\255\255\255\177\005\246\001\
\247\001\248\001\181\005\182\005\013\001\255\255\255\255\254\001\
\255\255\188\005\000\001\255\255\255\255\192\005\005\002\255\255\
\255\255\026\001\027\001\028\001\029\001\255\255\013\002\255\255\
\255\255\000\000\205\005\038\001\253\002\019\001\021\002\022\002\
\041\001\212\005\255\255\026\002\026\001\028\002\255\255\218\005\
\255\255\255\255\255\255\222\005\255\255\036\002\255\255\058\001\
\227\005\228\005\041\002\255\255\061\001\255\255\045\002\255\255\
\255\255\047\001\255\255\068\001\069\001\255\255\255\255\054\002\
\000\000\255\255\075\001\255\255\255\255\255\255\061\002\061\001\
\006\001\082\001\008\001\255\255\255\255\255\255\068\001\069\001\
\255\255\071\001\255\255\255\255\053\003\255\255\077\002\096\001\
\255\255\098\001\081\002\255\255\255\255\255\255\255\255\064\003\
\255\255\066\003\255\255\255\255\111\001\110\001\255\255\255\255\
\113\001\096\002\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\125\001\126\001\255\255\255\255\129\001\255\255\
\131\001\255\255\056\001\113\001\058\001\059\001\060\001\255\255\
\062\001\255\255\255\255\065\001\066\001\255\255\103\003\000\001\
\255\255\128\002\003\001\255\255\255\255\255\255\255\255\008\001\
\255\255\010\001\255\255\255\255\013\001\014\001\255\255\016\001\
\017\001\018\001\019\001\020\001\021\001\126\003\092\001\024\001\
\025\001\026\001\131\003\028\001\029\001\099\001\255\255\255\255\
\255\255\160\002\255\255\255\255\037\001\255\255\255\255\040\001\
\041\001\111\001\112\001\255\255\255\255\255\255\047\001\048\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\000\000\255\255\255\255\061\001\255\255\255\255\064\001\
\255\255\212\001\255\255\068\001\069\001\255\255\071\001\255\255\
\255\255\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\207\002\082\001\187\003\210\002\211\002\255\255\255\255\192\003\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\246\001\247\001\248\001\255\255\255\255\
\105\001\255\255\107\001\254\001\255\255\110\001\255\255\255\255\
\113\001\255\255\255\255\242\002\117\001\255\255\255\255\255\255\
\255\255\255\255\013\002\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\021\002\022\002\003\003\255\255\239\003\026\002\
\255\255\028\002\255\255\255\255\011\003\255\255\013\003\255\255\
\255\255\000\001\000\001\255\255\255\255\255\255\255\255\255\255\
\023\003\255\255\255\255\255\255\255\255\255\255\013\001\255\255\
\255\255\255\255\000\000\054\002\255\255\019\001\255\255\255\255\
\255\255\255\255\061\002\026\001\026\001\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\052\003\255\255\032\004\
\000\001\255\255\041\001\255\255\004\001\038\004\081\002\255\255\
\008\001\047\001\010\001\255\255\255\255\255\255\014\001\255\255\
\255\255\255\255\018\001\255\255\255\255\096\002\061\001\061\001\
\255\255\064\001\255\255\027\001\255\255\255\255\069\001\069\001\
\255\255\071\001\255\255\090\003\075\001\255\255\255\255\255\255\
\255\255\096\003\097\003\082\001\255\255\255\255\255\255\007\000\
\255\255\255\255\255\255\011\000\255\255\128\002\255\255\094\001\
\255\255\255\255\255\255\098\001\115\003\255\255\255\255\118\003\
\255\255\255\255\099\004\067\001\028\000\255\255\255\255\110\001\
\255\255\255\255\074\001\113\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\048\000\255\255\255\255\255\255\255\255\093\001\094\001\255\255\
\096\001\097\001\153\003\255\255\133\004\255\255\135\004\255\255\
\137\004\255\255\255\255\140\004\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\115\001\171\003\255\255\255\255\255\255\
\255\255\255\255\155\004\083\000\255\255\085\000\086\000\255\255\
\255\255\000\001\255\255\186\003\207\002\188\003\255\255\255\255\
\211\002\255\255\255\255\172\004\173\004\255\255\013\001\255\255\
\056\001\178\004\058\001\059\001\060\001\255\255\062\001\255\255\
\207\003\065\001\066\001\026\001\255\255\028\001\029\001\255\255\
\255\255\255\255\255\255\000\000\255\255\255\255\255\255\242\002\
\080\001\255\255\041\001\083\001\227\003\206\004\255\255\255\255\
\231\003\137\000\255\255\091\001\092\001\255\255\255\255\255\255\
\003\003\255\255\255\255\099\001\243\003\255\255\061\001\255\255\
\011\003\255\255\013\003\255\255\067\001\068\001\069\001\111\001\
\112\001\255\255\162\000\163\000\075\001\165\000\166\000\255\255\
\168\000\255\255\255\255\082\001\007\000\255\255\255\255\014\004\
\255\255\255\255\178\000\179\000\255\255\016\000\255\255\255\255\
\255\255\255\255\255\255\098\001\188\000\255\255\029\004\255\255\
\255\255\255\255\000\001\255\255\255\255\003\001\255\255\110\001\
\255\255\018\005\113\001\255\255\255\255\255\255\255\255\013\001\
\208\000\209\000\255\255\017\001\051\004\255\255\255\255\032\005\
\022\001\255\255\218\000\255\255\026\001\027\001\028\001\029\001\
\000\000\255\255\255\255\255\255\255\255\046\005\255\255\255\255\
\049\005\255\255\255\255\041\001\255\255\096\003\097\003\255\255\
\255\255\255\255\255\255\000\001\083\004\255\255\085\004\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\255\255\255\255\064\001\255\255\066\001\067\001\068\001\069\001\
\103\004\100\000\255\255\255\255\085\005\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\
\094\001\255\255\096\001\255\255\098\001\099\001\038\001\134\004\
\255\255\255\255\255\255\056\001\255\255\058\001\059\001\060\001\
\110\001\062\001\096\000\113\001\065\001\066\001\255\255\117\001\
\171\003\255\255\058\001\132\005\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\083\001\162\000\
\163\000\188\003\165\000\166\000\255\255\168\000\091\001\092\001\
\255\255\255\255\255\255\255\255\255\255\255\255\099\001\178\000\
\179\000\255\255\255\255\255\255\207\003\255\255\167\005\168\005\
\255\255\110\001\111\001\112\001\007\000\255\255\175\005\000\001\
\255\255\200\004\255\255\255\255\255\255\255\255\255\255\111\001\
\227\003\255\255\255\255\255\255\255\255\208\000\209\000\013\001\
\255\255\255\255\217\004\000\001\255\255\125\001\126\001\222\004\
\243\003\129\001\255\255\131\001\227\004\255\255\028\001\029\001\
\013\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\239\004\255\255\255\255\041\001\255\255\026\001\255\255\028\001\
\029\001\226\005\255\255\014\004\255\255\255\255\255\255\056\001\
\255\255\058\001\059\001\060\001\041\001\062\001\255\255\061\001\
\065\001\066\001\064\001\255\255\000\000\255\255\255\255\069\001\
\176\001\255\255\255\255\255\255\255\255\075\001\255\255\183\001\
\061\001\185\001\083\001\064\001\082\001\028\005\255\255\068\001\
\069\001\255\255\091\001\092\001\255\255\255\255\075\001\255\255\
\255\255\255\255\099\001\255\255\098\001\082\001\255\255\255\255\
\255\255\255\255\255\255\255\255\212\001\255\255\111\001\112\001\
\110\001\094\001\255\255\255\255\255\255\098\001\099\001\255\255\
\083\004\255\255\255\255\255\255\255\255\255\255\069\005\090\004\
\071\005\110\001\255\255\255\255\113\001\013\001\255\255\255\255\
\255\255\255\255\255\255\255\255\103\004\255\255\246\001\247\001\
\248\001\088\005\255\255\086\001\028\001\029\001\254\001\162\000\
\163\000\255\255\165\000\166\000\255\255\168\000\255\255\255\255\
\103\005\041\001\255\255\255\255\255\255\255\255\255\255\178\000\
\179\000\255\255\255\255\000\000\111\001\021\002\022\002\255\255\
\255\255\255\255\026\002\255\255\028\002\061\001\006\001\000\001\
\064\001\255\255\003\001\255\255\255\255\069\001\255\255\255\255\
\255\255\255\255\255\255\075\001\013\001\208\000\209\000\255\255\
\255\255\255\255\082\001\255\255\255\255\255\255\054\002\255\255\
\255\255\026\001\027\001\028\001\029\001\061\002\255\255\255\255\
\159\005\255\255\098\001\099\001\255\255\255\255\255\255\255\255\
\041\001\255\255\255\255\255\255\255\255\255\255\110\001\255\255\
\056\001\081\002\058\001\059\001\060\001\200\004\062\001\255\255\
\255\255\065\001\066\001\255\255\061\001\255\255\255\255\064\001\
\096\002\143\001\067\001\068\001\069\001\255\255\255\255\255\255\
\255\255\255\255\075\001\222\004\255\255\015\001\255\255\255\255\
\255\255\082\001\229\004\255\255\092\001\255\255\255\255\255\255\
\255\255\212\001\255\255\099\001\239\004\094\001\255\255\096\001\
\128\002\098\001\099\001\255\255\255\255\255\255\255\255\111\001\
\112\001\043\001\044\001\045\001\046\001\110\001\255\255\255\255\
\113\001\255\255\192\001\255\255\117\001\255\255\255\255\255\255\
\255\255\255\255\245\001\246\001\247\001\248\001\204\001\255\255\
\255\255\067\001\255\255\254\001\255\255\000\001\072\001\073\001\
\255\255\028\005\255\255\255\255\000\001\255\255\255\255\003\001\
\255\255\255\255\255\255\085\001\086\001\087\001\088\001\183\002\
\000\000\013\001\021\002\022\002\255\255\255\255\255\255\026\002\
\255\255\028\002\255\255\255\255\102\001\255\255\026\001\027\001\
\028\001\029\001\255\255\255\255\111\001\040\002\255\255\207\002\
\255\255\255\255\255\255\211\002\255\255\041\001\255\255\255\255\
\255\255\255\255\255\255\054\002\255\255\056\001\255\255\058\001\
\059\001\060\001\061\002\062\001\255\255\088\005\065\001\066\001\
\255\255\061\001\255\255\255\255\064\001\255\255\255\255\067\001\
\068\001\069\001\242\002\255\255\103\005\255\255\081\002\075\001\
\083\001\255\255\255\255\000\000\255\255\255\255\082\001\255\255\
\091\001\092\001\255\255\003\003\255\255\255\255\255\255\255\255\
\099\001\255\255\094\001\011\003\096\001\013\003\098\001\099\001\
\255\255\006\001\255\255\000\001\111\001\112\001\255\255\255\255\
\255\255\255\255\110\001\255\255\255\255\113\001\076\002\255\255\
\013\001\117\001\255\255\255\255\255\255\128\002\255\255\255\255\
\255\255\255\255\255\255\255\255\159\005\026\001\255\255\028\001\
\029\001\212\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\041\001\255\255\255\255\255\255\
\255\255\255\255\255\255\056\001\255\255\058\001\059\001\060\001\
\000\000\062\001\255\255\255\255\065\001\066\001\255\255\255\255\
\061\001\255\255\255\255\246\001\247\001\248\001\255\255\068\001\
\069\001\255\255\255\255\254\001\255\001\255\255\075\001\255\255\
\096\003\097\003\255\255\255\255\255\255\082\001\255\255\092\001\
\255\255\255\255\255\255\000\001\255\255\255\255\099\001\255\255\
\255\255\159\002\021\002\022\002\207\002\098\001\255\255\026\002\
\211\002\028\002\111\001\112\001\255\255\255\255\255\255\255\255\
\255\255\110\001\255\255\255\255\113\001\255\255\255\255\255\255\
\136\003\255\255\255\255\255\255\255\255\141\003\255\255\255\255\
\030\000\031\000\255\255\054\002\255\255\255\255\255\255\242\002\
\255\255\255\255\061\002\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\056\001\255\255\058\001\059\001\060\001\
\003\003\062\001\255\255\171\003\065\001\066\001\081\002\255\255\
\011\003\255\255\013\003\255\255\255\255\255\255\255\255\255\255\
\000\001\255\255\255\255\003\001\188\003\255\255\083\001\255\255\
\255\255\255\255\255\255\255\255\255\255\013\001\091\001\092\001\
\255\255\087\000\088\000\255\255\255\255\255\255\099\001\207\003\
\255\255\255\255\026\001\255\255\028\001\029\001\255\255\255\255\
\255\255\255\255\111\001\112\001\255\255\128\002\255\255\255\255\
\255\255\041\001\255\255\227\003\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\027\003\255\255\255\255\
\255\255\255\255\255\255\243\003\000\000\061\001\255\255\255\255\
\255\255\255\255\255\255\000\001\255\255\069\001\003\001\255\255\
\255\255\255\255\255\255\075\001\255\255\096\003\097\003\255\255\
\013\001\055\003\082\001\255\255\255\255\255\255\014\004\255\255\
\255\255\255\255\255\255\065\003\255\255\026\001\027\001\028\001\
\029\001\255\255\098\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\041\001\255\255\110\001\255\255\
\255\255\113\001\255\255\134\003\207\002\045\004\255\255\255\255\
\211\002\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\255\255\255\255\064\001\255\255\255\255\067\001\068\001\
\069\001\255\255\112\003\255\255\255\255\069\004\075\001\006\001\
\000\001\008\001\255\255\255\255\255\255\082\001\124\003\242\002\
\171\003\255\255\255\255\083\004\255\255\013\001\132\003\255\255\
\255\255\094\001\090\004\096\001\255\255\098\001\099\001\255\255\
\003\003\188\003\026\001\255\255\028\001\029\001\255\255\103\004\
\011\003\110\001\013\003\255\255\113\001\255\255\255\255\255\255\
\117\001\041\001\255\255\255\255\207\003\255\255\255\255\255\255\
\255\255\056\001\255\255\058\001\059\001\060\001\172\003\062\001\
\255\255\255\255\065\001\066\001\255\255\061\001\255\255\255\255\
\227\003\255\255\255\255\185\003\255\255\069\001\255\255\255\255\
\255\255\255\255\255\255\075\001\083\001\255\255\255\255\255\255\
\243\003\255\255\082\001\255\255\091\001\092\001\000\000\255\255\
\255\255\255\255\255\255\209\003\099\001\255\255\212\003\213\003\
\255\255\255\255\098\001\255\255\255\255\255\255\255\255\255\255\
\111\001\112\001\255\255\014\004\255\255\255\255\110\001\255\255\
\255\255\113\001\255\255\255\255\255\255\096\003\097\003\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\200\004\087\001\088\001\089\001\090\001\091\001\092\001\093\001\
\094\001\095\001\096\001\097\001\098\001\099\001\100\001\101\001\
\102\001\103\001\104\001\105\001\106\001\107\001\222\004\109\001\
\255\255\255\255\255\255\255\255\255\255\229\004\255\255\255\255\
\255\255\023\004\255\255\255\255\255\255\123\001\255\255\239\004\
\255\255\255\255\255\255\255\255\000\001\035\004\002\001\003\001\
\083\004\135\001\255\255\255\255\008\001\255\255\255\255\255\255\
\255\255\013\001\255\255\255\255\255\255\017\001\018\001\019\001\
\171\003\255\255\255\255\255\255\103\004\255\255\026\001\027\001\
\028\001\029\001\255\255\255\255\066\004\255\255\255\255\255\255\
\036\001\188\003\255\255\255\255\028\005\041\001\255\255\255\255\
\255\255\255\255\255\255\047\001\048\001\255\255\255\255\255\255\
\255\255\000\000\255\255\255\255\207\003\255\255\255\255\255\255\
\255\255\061\001\255\255\255\255\064\001\255\255\255\255\067\001\
\068\001\069\001\255\255\071\001\255\255\255\255\255\255\075\001\
\227\003\255\255\255\255\255\255\255\255\255\255\082\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\243\003\093\001\094\001\255\255\096\001\097\001\098\001\099\001\
\088\005\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\110\001\255\255\255\255\113\001\255\255\255\255\
\255\255\117\001\255\255\014\004\255\255\200\004\255\255\255\255\
\255\255\255\255\056\001\255\255\058\001\059\001\060\001\165\004\
\062\001\255\255\255\255\065\001\066\001\255\255\255\255\255\255\
\174\004\255\255\255\255\222\004\255\255\179\004\180\004\255\255\
\255\255\255\255\255\255\255\255\255\255\083\001\255\255\255\255\
\190\004\255\255\255\255\033\002\239\004\091\001\092\001\255\255\
\255\255\255\255\255\255\255\255\042\002\099\001\000\001\255\255\
\046\002\003\001\255\255\049\002\255\255\255\255\008\001\255\255\
\010\001\111\001\112\001\013\001\014\001\219\004\255\255\017\001\
\083\004\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\000\000\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\028\005\255\255\037\001\103\004\243\004\040\001\041\001\
\255\255\255\255\255\255\255\255\255\255\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\098\002\099\002\255\255\255\255\
\255\255\255\255\255\255\061\001\255\255\255\255\064\001\255\255\
\255\255\255\255\068\001\069\001\255\255\071\001\255\255\255\255\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\136\002\093\001\094\001\088\005\096\001\097\001\
\098\001\099\001\255\255\255\255\255\255\255\255\255\255\105\001\
\255\255\107\001\056\005\255\255\110\001\255\255\255\255\113\001\
\255\255\063\005\255\255\117\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\073\005\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\056\001\200\004\058\001\059\001\
\060\001\000\001\062\001\255\255\003\001\065\001\066\001\255\255\
\255\255\008\001\255\255\010\001\255\255\000\000\013\001\014\001\
\255\255\255\255\017\001\222\004\019\001\020\001\021\001\083\001\
\255\255\024\001\025\001\026\001\255\255\028\001\029\001\091\001\
\092\001\255\255\255\255\255\255\239\004\255\255\037\001\099\001\
\126\005\040\001\041\001\129\005\255\255\255\255\255\255\255\255\
\047\001\048\001\232\002\111\001\112\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\255\255\
\255\255\064\001\255\255\255\255\255\255\068\001\069\001\255\255\
\071\001\255\255\255\255\074\001\075\001\255\255\255\255\255\255\
\255\255\028\005\255\255\082\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\177\005\018\003\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\255\255\255\255\255\255\
\255\255\255\255\105\001\255\255\107\001\255\255\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\117\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\054\003\255\255\255\255\255\255\255\255\255\255\255\255\000\000\
\255\255\255\255\255\255\255\255\255\255\088\005\255\255\255\255\
\255\255\000\001\001\001\002\001\003\001\255\255\255\255\006\001\
\007\001\008\001\009\001\010\001\011\001\012\001\013\001\014\001\
\015\001\016\001\017\001\018\001\019\001\020\001\021\001\022\001\
\255\255\024\001\025\001\026\001\027\001\028\001\029\001\030\001\
\031\001\255\255\255\255\255\255\255\255\036\001\037\001\255\255\
\110\003\040\001\041\001\042\001\043\001\044\001\045\001\046\001\
\047\001\048\001\049\001\050\001\051\001\052\001\255\255\054\001\
\055\001\056\001\057\001\255\255\255\255\060\001\061\001\062\001\
\063\001\064\001\065\001\066\001\067\001\068\001\069\001\255\255\
\071\001\072\001\073\001\074\001\075\001\255\255\077\001\078\001\
\255\255\255\255\255\255\082\001\083\001\084\001\085\001\086\001\
\087\001\088\001\089\001\255\255\091\001\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\100\001\255\255\102\001\
\103\001\255\255\105\001\106\001\107\001\108\001\000\000\110\001\
\111\001\255\255\113\001\255\255\255\255\255\255\117\001\255\255\
\255\255\255\255\255\255\255\255\255\255\000\001\001\001\002\001\
\003\001\004\001\255\255\006\001\007\001\008\001\009\001\010\001\
\011\001\012\001\013\001\014\001\015\001\016\001\017\001\018\001\
\019\001\020\001\021\001\255\255\218\003\024\001\025\001\026\001\
\027\001\028\001\029\001\030\001\031\001\255\255\255\255\255\255\
\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\
\043\001\044\001\045\001\046\001\047\001\048\001\049\001\050\001\
\051\001\052\001\255\255\054\001\055\001\056\001\057\001\255\255\
\255\255\060\001\061\001\062\001\255\255\064\001\065\001\066\001\
\067\001\068\001\069\001\255\255\071\001\072\001\073\001\074\001\
\075\001\255\255\077\001\078\001\255\255\255\255\255\255\082\001\
\083\001\084\001\085\001\086\001\087\001\088\001\089\001\255\255\
\091\001\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\100\001\255\255\102\001\103\001\000\000\105\001\106\001\
\107\001\108\001\255\255\110\001\111\001\255\255\113\001\255\255\
\255\255\255\255\117\001\255\255\255\255\255\255\255\255\000\001\
\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\
\009\001\010\001\255\255\255\255\013\001\014\001\015\001\016\001\
\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\
\041\001\042\001\043\001\044\001\045\001\046\001\047\001\048\001\
\255\255\255\255\255\255\255\255\114\004\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\061\001\062\001\255\255\064\001\
\126\004\255\255\067\001\068\001\069\001\255\255\071\001\072\001\
\073\001\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\084\001\085\001\086\001\087\001\088\001\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\000\000\255\255\102\001\255\255\255\255\
\105\001\255\255\107\001\255\255\255\255\110\001\255\255\255\255\
\113\001\175\004\176\004\177\004\117\001\255\255\000\001\001\001\
\002\001\003\001\255\255\255\255\006\001\007\001\008\001\009\001\
\010\001\011\001\012\001\013\001\014\001\015\001\016\001\017\001\
\018\001\019\001\020\001\021\001\022\001\255\255\024\001\025\001\
\026\001\027\001\028\001\029\001\030\001\031\001\255\255\255\255\
\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\
\042\001\043\001\044\001\045\001\046\001\047\001\048\001\049\001\
\050\001\051\001\052\001\255\255\054\001\055\001\056\001\057\001\
\255\255\255\255\060\001\061\001\062\001\255\255\064\001\065\001\
\066\001\067\001\068\001\069\001\255\255\071\001\072\001\073\001\
\074\001\075\001\255\255\077\001\078\001\255\255\255\255\255\255\
\082\001\083\001\084\001\085\001\086\001\087\001\088\001\089\001\
\255\255\091\001\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\099\001\100\001\000\000\102\001\103\001\255\255\105\001\
\106\001\107\001\108\001\255\255\110\001\111\001\255\255\113\001\
\255\255\255\255\255\255\117\001\255\255\000\001\001\001\002\001\
\003\001\004\001\255\255\006\001\007\001\008\001\009\001\010\001\
\011\001\012\001\013\001\014\001\015\001\016\001\017\001\018\001\
\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\
\027\001\028\001\029\001\030\001\031\001\255\255\255\255\255\255\
\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\
\043\001\044\001\045\001\046\001\047\001\048\001\049\001\050\001\
\051\001\052\001\255\255\054\001\055\001\056\001\057\001\255\255\
\255\255\060\001\061\001\062\001\255\255\064\001\065\001\066\001\
\067\001\068\001\069\001\255\255\071\001\072\001\073\001\074\001\
\075\001\255\255\077\001\078\001\255\255\255\255\255\255\082\001\
\083\001\084\001\085\001\086\001\087\001\088\001\089\001\255\255\
\091\001\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\100\001\000\000\102\001\103\001\255\255\105\001\106\001\
\107\001\108\001\255\255\110\001\111\001\255\255\113\001\255\255\
\255\255\255\255\117\001\000\001\001\001\002\001\003\001\255\255\
\255\255\006\001\007\001\008\001\009\001\010\001\011\001\012\001\
\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\
\021\001\022\001\255\255\024\001\025\001\026\001\027\001\028\001\
\029\001\030\001\031\001\255\255\255\255\255\255\255\255\036\001\
\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\
\045\001\046\001\047\001\048\001\049\001\050\001\051\001\052\001\
\255\255\054\001\055\001\056\001\057\001\255\255\255\255\060\001\
\061\001\062\001\255\255\064\001\065\001\066\001\067\001\068\001\
\069\001\255\255\071\001\072\001\073\001\074\001\075\001\255\255\
\077\001\078\001\255\255\255\255\255\255\082\001\083\001\084\001\
\085\001\086\001\087\001\088\001\089\001\255\255\091\001\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\100\001\
\000\000\102\001\103\001\255\255\105\001\106\001\107\001\108\001\
\255\255\110\001\111\001\255\255\113\001\255\255\255\255\255\255\
\117\001\255\255\255\255\000\001\001\001\002\001\003\001\255\255\
\255\255\006\001\007\001\008\001\009\001\010\001\011\001\012\001\
\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\
\021\001\022\001\255\255\024\001\025\001\026\001\027\001\028\001\
\029\001\030\001\031\001\255\255\255\255\255\255\255\255\036\001\
\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\
\045\001\046\001\047\001\048\001\049\001\050\001\051\001\052\001\
\255\255\054\001\055\001\056\001\057\001\255\255\255\255\060\001\
\061\001\062\001\255\255\064\001\065\001\066\001\067\001\068\001\
\069\001\255\255\071\001\072\001\073\001\074\001\075\001\255\255\
\077\001\078\001\255\255\255\255\255\255\082\001\083\001\084\001\
\085\001\086\001\087\001\088\001\089\001\255\255\091\001\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\100\001\
\000\000\102\001\103\001\255\255\105\001\106\001\107\001\108\001\
\255\255\110\001\111\001\255\255\113\001\255\255\255\255\255\255\
\117\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\
\006\001\007\001\008\001\009\001\010\001\011\001\012\001\013\001\
\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\
\022\001\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\030\001\031\001\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\
\046\001\047\001\048\001\049\001\050\001\051\001\052\001\255\255\
\054\001\055\001\056\001\057\001\255\255\255\255\060\001\061\001\
\062\001\255\255\064\001\065\001\066\001\067\001\068\001\069\001\
\255\255\071\001\072\001\073\001\074\001\075\001\255\255\077\001\
\078\001\255\255\255\255\255\255\082\001\083\001\084\001\085\001\
\086\001\087\001\088\001\089\001\255\255\091\001\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\100\001\000\000\
\102\001\103\001\255\255\105\001\106\001\107\001\108\001\255\255\
\110\001\111\001\255\255\113\001\255\255\255\255\255\255\117\001\
\000\001\001\001\002\001\003\001\004\001\255\255\006\001\007\001\
\008\001\009\001\010\001\011\001\012\001\013\001\014\001\015\001\
\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\
\024\001\025\001\026\001\027\001\028\001\029\001\030\001\031\001\
\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\
\040\001\041\001\042\001\043\001\044\001\045\001\046\001\047\001\
\048\001\049\001\050\001\051\001\052\001\255\255\054\001\055\001\
\056\001\057\001\255\255\255\255\060\001\061\001\062\001\255\255\
\064\001\065\001\066\001\067\001\068\001\069\001\255\255\071\001\
\072\001\073\001\074\001\075\001\255\255\077\001\078\001\255\255\
\255\255\255\255\082\001\083\001\084\001\085\001\086\001\087\001\
\088\001\089\001\255\255\091\001\255\255\093\001\094\001\255\255\
\096\001\097\001\098\001\255\255\255\255\000\000\102\001\103\001\
\255\255\105\001\106\001\107\001\108\001\255\255\110\001\111\001\
\255\255\113\001\255\255\255\255\255\255\117\001\255\255\255\255\
\000\001\001\001\002\001\003\001\004\001\255\255\006\001\007\001\
\008\001\009\001\010\001\011\001\012\001\013\001\014\001\015\001\
\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\
\024\001\025\001\026\001\027\001\028\001\029\001\030\001\031\001\
\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\
\040\001\041\001\042\001\043\001\044\001\045\001\046\001\047\001\
\048\001\049\001\050\001\051\001\052\001\255\255\054\001\055\001\
\056\001\057\001\255\255\255\255\060\001\061\001\062\001\255\255\
\064\001\065\001\066\001\067\001\068\001\069\001\255\255\071\001\
\072\001\073\001\074\001\075\001\255\255\077\001\078\001\255\255\
\255\255\255\255\082\001\083\001\084\001\085\001\086\001\087\001\
\088\001\089\001\255\255\091\001\255\255\093\001\094\001\255\255\
\096\001\097\001\098\001\000\000\255\255\255\255\102\001\103\001\
\255\255\105\001\106\001\107\001\108\001\255\255\110\001\111\001\
\255\255\113\001\255\255\255\255\255\255\117\001\255\255\000\001\
\001\001\002\001\003\001\004\001\255\255\006\001\007\001\008\001\
\009\001\010\001\011\001\012\001\013\001\014\001\015\001\016\001\
\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\027\001\028\001\029\001\030\001\031\001\255\255\
\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\
\041\001\042\001\043\001\044\001\045\001\046\001\047\001\048\001\
\049\001\050\001\051\001\052\001\255\255\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\061\001\062\001\255\255\064\001\
\065\001\066\001\067\001\068\001\069\001\255\255\071\001\072\001\
\073\001\074\001\075\001\255\255\077\001\078\001\255\255\255\255\
\255\255\082\001\083\001\084\001\085\001\086\001\087\001\088\001\
\089\001\255\255\091\001\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\000\000\255\255\255\255\102\001\103\001\255\255\
\105\001\106\001\107\001\108\001\255\255\110\001\111\001\255\255\
\113\001\255\255\255\255\255\255\117\001\000\001\001\001\002\001\
\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\
\255\255\255\255\013\001\014\001\015\001\016\001\017\001\018\001\
\019\001\020\001\021\001\022\001\255\255\024\001\025\001\026\001\
\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\
\043\001\044\001\045\001\046\001\047\001\048\001\255\255\255\255\
\255\255\052\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\061\001\062\001\255\255\064\001\255\255\255\255\
\067\001\068\001\069\001\255\255\071\001\072\001\073\001\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\083\001\084\001\085\001\086\001\087\001\088\001\255\255\255\255\
\091\001\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\100\001\000\000\102\001\255\255\255\255\105\001\106\001\
\107\001\255\255\255\255\110\001\255\255\255\255\113\001\255\255\
\255\255\255\255\117\001\000\001\001\001\002\001\003\001\255\255\
\255\255\255\255\255\255\008\001\009\001\010\001\255\255\255\255\
\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\
\021\001\022\001\255\255\024\001\025\001\026\001\027\001\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\
\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\
\045\001\046\001\047\001\048\001\255\255\255\255\255\255\052\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\062\001\255\255\064\001\255\255\255\255\067\001\068\001\
\069\001\255\255\071\001\072\001\073\001\074\001\075\001\255\255\
\255\255\255\255\255\255\255\255\255\255\082\001\083\001\084\001\
\085\001\086\001\087\001\088\001\255\255\255\255\091\001\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\100\001\
\000\000\102\001\255\255\255\255\105\001\106\001\107\001\255\255\
\255\255\110\001\255\255\255\255\113\001\255\255\255\255\255\255\
\117\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\
\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\
\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\
\046\001\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\062\001\255\255\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\071\001\072\001\073\001\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\084\001\085\001\
\086\001\087\001\088\001\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\255\255\000\000\255\255\
\102\001\255\255\255\255\105\001\255\255\107\001\255\255\255\255\
\110\001\255\255\255\255\113\001\255\255\255\255\255\255\117\001\
\255\255\255\255\000\001\001\001\002\001\003\001\255\255\255\255\
\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\
\014\001\015\001\016\001\017\001\255\255\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\
\046\001\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\062\001\255\255\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\071\001\072\001\073\001\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\084\001\085\001\
\086\001\087\001\088\001\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\000\000\255\255\
\102\001\255\255\255\255\105\001\255\255\107\001\255\255\255\255\
\110\001\255\255\255\255\113\001\255\255\255\255\255\255\117\001\
\000\001\001\001\002\001\003\001\255\255\255\255\255\255\255\255\
\008\001\009\001\010\001\255\255\255\255\013\001\014\001\015\001\
\016\001\017\001\018\001\019\001\020\001\021\001\255\255\255\255\
\024\001\025\001\026\001\027\001\028\001\029\001\255\255\255\255\
\255\255\255\255\255\255\255\255\036\001\037\001\255\255\255\255\
\040\001\041\001\042\001\043\001\044\001\045\001\046\001\047\001\
\048\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\061\001\062\001\255\255\
\064\001\255\255\255\255\067\001\068\001\069\001\255\255\071\001\
\072\001\073\001\074\001\075\001\255\255\255\255\255\255\255\255\
\255\255\255\255\082\001\255\255\084\001\085\001\086\001\087\001\
\088\001\255\255\255\255\255\255\255\255\093\001\094\001\255\255\
\096\001\097\001\098\001\255\255\000\000\255\255\102\001\255\255\
\255\255\105\001\255\255\107\001\255\255\255\255\110\001\255\255\
\255\255\113\001\255\255\255\255\255\255\117\001\000\001\001\001\
\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\
\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\
\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\
\042\001\043\001\044\001\045\001\046\001\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\062\001\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\071\001\072\001\073\001\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\084\001\085\001\086\001\087\001\088\001\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\255\255\000\000\255\255\102\001\255\255\255\255\105\001\
\255\255\107\001\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\117\001\255\255\255\255\000\001\001\001\
\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\
\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\
\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\
\042\001\043\001\044\001\045\001\046\001\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\062\001\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\071\001\072\001\073\001\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\084\001\085\001\086\001\087\001\088\001\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\000\000\255\255\255\255\102\001\255\255\255\255\105\001\
\255\255\107\001\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\117\001\000\001\001\001\002\001\003\001\
\255\255\255\255\255\255\255\255\008\001\009\001\010\001\255\255\
\255\255\013\001\014\001\015\001\016\001\017\001\018\001\019\001\
\020\001\021\001\255\255\255\255\024\001\025\001\026\001\027\001\
\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\
\036\001\037\001\255\255\255\255\040\001\041\001\042\001\043\001\
\044\001\045\001\046\001\047\001\048\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\061\001\062\001\255\255\064\001\255\255\255\255\067\001\
\068\001\069\001\255\255\071\001\072\001\073\001\074\001\075\001\
\255\255\255\255\255\255\255\255\255\255\255\255\082\001\255\255\
\084\001\085\001\086\001\087\001\088\001\255\255\255\255\255\255\
\255\255\093\001\094\001\255\255\096\001\097\001\098\001\000\000\
\255\255\255\255\102\001\255\255\255\255\105\001\255\255\107\001\
\255\255\255\255\110\001\255\255\255\255\113\001\255\255\255\255\
\255\255\117\001\000\001\001\001\002\001\003\001\255\255\255\255\
\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\
\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\
\255\255\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\062\001\255\255\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\071\001\072\001\073\001\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\084\001\085\001\
\086\001\087\001\088\001\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\000\000\255\255\
\102\001\255\255\255\255\105\001\255\255\107\001\255\255\255\255\
\110\001\255\255\255\255\113\001\255\255\255\255\255\255\117\001\
\255\255\000\001\001\001\002\001\003\001\255\255\255\255\255\255\
\255\255\008\001\009\001\010\001\255\255\255\255\013\001\014\001\
\015\001\016\001\017\001\018\001\019\001\020\001\021\001\255\255\
\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\
\255\255\040\001\041\001\042\001\043\001\044\001\045\001\255\255\
\047\001\048\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\062\001\
\255\255\064\001\255\255\255\255\067\001\068\001\069\001\255\255\
\071\001\072\001\073\001\074\001\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\255\255\084\001\085\001\086\001\
\087\001\088\001\255\255\255\255\255\255\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\000\000\255\255\102\001\
\255\255\255\255\105\001\255\255\107\001\255\255\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\117\001\000\001\
\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\
\009\001\010\001\255\255\255\255\013\001\014\001\015\001\016\001\
\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\
\041\001\042\001\043\001\044\001\045\001\255\255\047\001\048\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\061\001\062\001\255\255\064\001\
\255\255\255\255\067\001\068\001\069\001\255\255\071\001\072\001\
\073\001\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\084\001\085\001\086\001\087\001\088\001\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\000\000\255\255\102\001\255\255\255\255\
\105\001\255\255\107\001\255\255\255\255\110\001\255\255\255\255\
\113\001\255\255\255\255\255\255\117\001\255\255\000\001\001\001\
\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\
\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\
\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\
\042\001\043\001\044\001\045\001\255\255\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\062\001\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\071\001\072\001\073\001\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\084\001\085\001\086\001\087\001\088\001\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\099\001\000\000\255\255\102\001\255\255\255\255\105\001\
\255\255\107\001\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\117\001\255\255\000\001\001\001\002\001\
\003\001\255\255\255\255\255\255\255\255\255\255\009\001\010\001\
\255\255\255\255\013\001\014\001\015\001\016\001\017\001\018\001\
\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\
\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\
\043\001\044\001\045\001\046\001\047\001\048\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\061\001\062\001\255\255\064\001\255\255\255\255\
\067\001\068\001\069\001\255\255\071\001\072\001\073\001\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\255\255\084\001\085\001\086\001\087\001\088\001\255\255\255\255\
\255\255\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\000\000\255\255\102\001\255\255\255\255\105\001\255\255\
\107\001\255\255\255\255\110\001\255\255\255\255\113\001\255\255\
\255\255\255\255\117\001\000\001\001\001\002\001\003\001\255\255\
\255\255\255\255\255\255\255\255\009\001\010\001\255\255\255\255\
\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\
\021\001\255\255\255\255\024\001\025\001\026\001\027\001\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\
\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\
\045\001\046\001\047\001\048\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\062\001\255\255\064\001\255\255\255\255\067\001\068\001\
\069\001\255\255\071\001\072\001\073\001\074\001\075\001\255\255\
\255\255\255\255\255\255\255\255\255\255\082\001\255\255\084\001\
\085\001\086\001\087\001\088\001\255\255\255\255\255\255\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\000\000\
\255\255\102\001\255\255\255\255\105\001\255\255\107\001\255\255\
\255\255\110\001\255\255\255\255\113\001\255\255\255\255\255\255\
\117\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\
\255\255\255\255\255\255\009\001\010\001\255\255\255\255\013\001\
\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\043\001\044\001\045\001\
\046\001\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\062\001\255\255\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\071\001\072\001\073\001\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\084\001\085\001\
\086\001\087\001\088\001\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\000\000\255\255\
\102\001\255\255\255\255\105\001\255\255\107\001\255\255\255\255\
\110\001\255\255\255\255\113\001\255\255\255\255\255\255\117\001\
\255\255\000\001\001\001\002\001\003\001\255\255\255\255\255\255\
\255\255\008\001\009\001\010\001\255\255\255\255\013\001\014\001\
\015\001\016\001\017\001\018\001\019\001\020\001\021\001\255\255\
\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\
\255\255\040\001\041\001\042\001\043\001\044\001\255\255\255\255\
\047\001\048\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\062\001\
\255\255\064\001\255\255\255\255\067\001\068\001\069\001\255\255\
\071\001\072\001\073\001\074\001\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\255\255\084\001\255\255\086\001\
\087\001\088\001\255\255\255\255\255\255\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\000\000\255\255\255\255\
\255\255\255\255\105\001\255\255\107\001\255\255\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\117\001\000\001\
\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\
\009\001\010\001\255\255\255\255\013\001\014\001\015\001\016\001\
\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\
\041\001\042\001\043\001\044\001\255\255\255\255\047\001\048\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\061\001\062\001\255\255\064\001\
\255\255\255\255\067\001\068\001\069\001\255\255\071\001\072\001\
\073\001\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\084\001\255\255\086\001\087\001\088\001\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\000\000\255\255\255\255\255\255\255\255\
\105\001\255\255\107\001\255\255\255\255\110\001\255\255\255\255\
\113\001\255\255\255\255\255\255\117\001\255\255\000\001\001\001\
\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\
\010\001\255\255\255\255\013\001\014\001\015\001\016\001\017\001\
\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\
\042\001\043\001\044\001\255\255\255\255\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\062\001\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\071\001\072\001\073\001\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\084\001\255\255\086\001\087\001\088\001\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\099\001\000\000\255\255\255\255\255\255\255\255\105\001\
\255\255\107\001\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\117\001\255\255\000\001\001\001\002\001\
\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\
\255\255\255\255\013\001\014\001\015\001\016\001\017\001\018\001\
\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\
\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\
\043\001\044\001\255\255\255\255\047\001\048\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\061\001\062\001\255\255\064\001\255\255\255\255\
\067\001\068\001\069\001\255\255\071\001\072\001\073\001\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\255\255\084\001\255\255\086\001\087\001\088\001\255\255\255\255\
\255\255\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\000\000\255\255\255\255\255\255\255\255\105\001\255\255\
\107\001\255\255\255\255\110\001\255\255\255\255\113\001\255\255\
\255\255\255\255\117\001\000\001\001\001\002\001\003\001\255\255\
\255\255\255\255\255\255\008\001\009\001\010\001\255\255\255\255\
\013\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\
\021\001\255\255\255\255\024\001\025\001\026\001\027\001\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\
\037\001\255\255\255\255\040\001\041\001\042\001\043\001\044\001\
\255\255\255\255\047\001\048\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\062\001\255\255\064\001\255\255\255\255\067\001\068\001\
\069\001\255\255\071\001\072\001\073\001\074\001\075\001\255\255\
\255\255\255\255\255\255\255\255\255\255\082\001\255\255\084\001\
\255\255\086\001\087\001\088\001\255\255\255\255\255\255\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\000\000\
\255\255\255\255\255\255\255\255\105\001\255\255\107\001\255\255\
\255\255\110\001\255\255\255\255\113\001\255\255\255\255\255\255\
\117\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\
\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\
\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\043\001\044\001\255\255\
\255\255\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\062\001\255\255\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\071\001\072\001\073\001\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\084\001\255\255\
\086\001\087\001\088\001\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\000\000\255\255\
\255\255\255\255\255\255\105\001\255\255\107\001\255\255\255\255\
\110\001\255\255\255\255\113\001\255\255\255\255\255\255\117\001\
\255\255\000\001\001\001\002\001\003\001\255\255\255\255\255\255\
\255\255\008\001\009\001\010\001\255\255\255\255\013\001\014\001\
\015\001\016\001\017\001\018\001\019\001\020\001\021\001\255\255\
\255\255\024\001\025\001\026\001\027\001\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\036\001\037\001\255\255\
\255\255\040\001\041\001\042\001\043\001\044\001\045\001\046\001\
\047\001\048\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\062\001\
\255\255\255\255\255\255\255\255\067\001\068\001\069\001\255\255\
\071\001\255\255\255\255\074\001\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\255\255\084\001\085\001\255\255\
\255\255\088\001\255\255\255\255\255\255\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\000\000\255\255\102\001\
\255\255\255\255\105\001\255\255\107\001\255\255\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\117\001\000\001\
\001\001\002\001\003\001\255\255\255\255\255\255\255\255\008\001\
\009\001\010\001\255\255\255\255\013\001\014\001\255\255\016\001\
\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\027\001\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\036\001\037\001\255\255\255\255\040\001\
\041\001\042\001\255\255\255\255\255\255\255\255\047\001\048\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\061\001\062\001\255\255\064\001\
\255\255\255\255\255\255\068\001\069\001\255\255\071\001\255\255\
\255\255\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\084\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\000\000\255\255\255\255\255\255\255\255\
\105\001\255\255\107\001\255\255\255\255\110\001\255\255\255\255\
\113\001\255\255\255\255\255\255\117\001\255\255\000\001\001\001\
\002\001\003\001\255\255\255\255\255\255\255\255\008\001\009\001\
\010\001\255\255\255\255\013\001\014\001\255\255\016\001\017\001\
\018\001\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\037\001\255\255\255\255\040\001\041\001\
\042\001\255\255\255\255\255\255\255\255\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\062\001\255\255\064\001\255\255\
\255\255\255\255\068\001\069\001\255\255\071\001\255\255\255\255\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\084\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\099\001\000\000\255\255\255\255\255\255\255\255\105\001\
\255\255\107\001\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\117\001\255\255\000\001\001\001\002\001\
\003\001\255\255\255\255\255\255\255\255\008\001\009\001\010\001\
\255\255\255\255\013\001\014\001\255\255\016\001\017\001\018\001\
\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\
\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\036\001\037\001\255\255\255\255\040\001\041\001\042\001\
\255\255\255\255\255\255\255\255\047\001\048\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\061\001\062\001\255\255\064\001\255\255\255\255\
\255\255\068\001\069\001\255\255\071\001\255\255\255\255\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\255\255\084\001\255\255\255\255\000\000\255\255\255\255\255\255\
\255\255\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\255\255\255\255\255\255\255\255\255\255\105\001\255\255\
\107\001\255\255\255\255\110\001\255\255\255\255\113\001\255\255\
\255\255\255\255\117\001\000\001\001\001\002\001\003\001\255\255\
\255\255\255\255\255\255\008\001\009\001\010\001\255\255\255\255\
\013\001\014\001\255\255\016\001\017\001\018\001\019\001\020\001\
\021\001\255\255\255\255\024\001\025\001\026\001\027\001\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\
\037\001\255\255\255\255\040\001\041\001\042\001\255\255\255\255\
\255\255\255\255\047\001\048\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\062\001\255\255\064\001\255\255\255\255\255\255\068\001\
\069\001\255\255\071\001\255\255\255\255\074\001\075\001\255\255\
\255\255\255\255\255\255\000\000\255\255\082\001\255\255\084\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\255\255\
\255\255\255\255\255\255\255\255\105\001\255\255\107\001\255\255\
\255\255\110\001\255\255\255\255\113\001\255\255\255\255\255\255\
\117\001\255\255\000\001\001\001\002\001\003\001\255\255\255\255\
\255\255\255\255\008\001\009\001\010\001\255\255\255\255\013\001\
\014\001\255\255\016\001\017\001\018\001\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\037\001\
\255\255\255\255\040\001\041\001\042\001\255\255\255\255\255\255\
\255\255\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\062\001\255\255\064\001\255\255\255\255\000\000\068\001\069\001\
\255\255\071\001\255\255\255\255\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\084\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\255\255\255\255\
\255\255\255\255\255\255\105\001\000\001\107\001\255\255\003\001\
\110\001\255\255\255\255\113\001\008\001\009\001\010\001\117\001\
\255\255\013\001\014\001\255\255\016\001\017\001\018\001\019\001\
\020\001\021\001\255\255\255\255\024\001\025\001\026\001\255\255\
\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\037\001\255\255\255\255\040\001\041\001\255\255\255\255\
\255\255\255\255\255\255\047\001\048\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\061\001\255\255\255\255\064\001\255\255\255\255\000\000\
\068\001\069\001\255\255\071\001\255\255\255\255\074\001\075\001\
\255\255\255\255\255\255\255\255\255\255\255\255\082\001\255\255\
\084\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\093\001\094\001\255\255\096\001\097\001\098\001\099\001\
\255\255\255\255\255\255\255\255\255\255\105\001\255\255\107\001\
\255\255\255\255\110\001\000\001\255\255\113\001\003\001\255\255\
\255\255\117\001\255\255\008\001\009\001\010\001\255\255\255\255\
\013\001\014\001\255\255\016\001\017\001\018\001\019\001\020\001\
\021\001\255\255\255\255\024\001\025\001\026\001\255\255\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\037\001\255\255\255\255\040\001\041\001\255\255\255\255\255\255\
\255\255\255\255\047\001\048\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\000\000\255\255\064\001\255\255\255\255\255\255\068\001\
\069\001\255\255\071\001\255\255\255\255\074\001\075\001\255\255\
\255\255\255\255\255\255\255\255\255\255\082\001\255\255\084\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\255\255\
\255\255\255\255\255\255\255\255\105\001\000\001\107\001\255\255\
\003\001\110\001\255\255\255\255\113\001\008\001\255\255\010\001\
\117\001\255\255\013\001\014\001\255\255\016\001\017\001\018\001\
\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\
\255\255\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\037\001\255\255\255\255\040\001\041\001\255\255\
\255\255\255\255\255\255\255\255\047\001\048\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\
\255\255\255\255\061\001\255\255\255\255\064\001\255\255\255\255\
\255\255\068\001\069\001\255\255\071\001\255\255\255\255\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\255\255\255\255\255\255\255\255\255\255\105\001\000\001\
\107\001\255\255\003\001\110\001\255\255\255\255\113\001\008\001\
\255\255\010\001\117\001\255\255\013\001\014\001\255\255\016\001\
\017\001\018\001\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\255\255\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\037\001\255\255\255\255\040\001\
\041\001\255\255\255\255\255\255\255\255\255\255\047\001\048\001\
\255\255\255\255\255\255\000\000\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\061\001\255\255\255\255\064\001\
\255\255\255\255\255\255\068\001\069\001\255\255\071\001\255\255\
\255\255\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\255\255\255\255\255\255\255\255\255\255\
\105\001\000\001\107\001\255\255\003\001\110\001\255\255\255\255\
\113\001\008\001\255\255\010\001\117\001\255\255\013\001\014\001\
\255\255\016\001\017\001\018\001\019\001\020\001\021\001\255\255\
\255\255\024\001\025\001\026\001\255\255\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\037\001\255\255\
\255\255\040\001\041\001\255\255\255\255\255\255\255\255\255\255\
\047\001\048\001\255\255\255\255\255\255\000\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\255\255\
\255\255\064\001\255\255\255\255\255\255\068\001\069\001\255\255\
\071\001\255\255\255\255\074\001\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\255\255\000\001\255\255\
\255\255\003\001\105\001\255\255\107\001\255\255\008\001\110\001\
\010\001\255\255\113\001\013\001\014\001\255\255\117\001\017\001\
\255\255\019\001\020\001\021\001\255\255\255\255\024\001\025\001\
\026\001\255\255\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\037\001\255\255\255\255\040\001\041\001\
\255\255\255\255\255\255\255\255\255\255\047\001\048\001\255\255\
\255\255\255\255\000\000\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\255\255\255\255\064\001\255\255\
\255\255\255\255\068\001\069\001\255\255\071\001\255\255\255\255\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\099\001\255\255\000\001\255\255\255\255\003\001\105\001\
\255\255\107\001\255\255\008\001\110\001\010\001\255\255\113\001\
\013\001\014\001\255\255\117\001\017\001\255\255\019\001\020\001\
\021\001\255\255\255\255\024\001\025\001\026\001\255\255\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\037\001\255\255\255\255\040\001\041\001\255\255\255\255\255\255\
\255\255\255\255\047\001\048\001\255\255\255\255\255\255\000\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\061\001\255\255\255\255\064\001\255\255\255\255\255\255\068\001\
\069\001\255\255\071\001\255\255\255\255\074\001\075\001\255\255\
\255\255\255\255\255\255\255\255\255\255\082\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\255\255\
\255\255\255\255\255\255\255\255\105\001\000\001\107\001\255\255\
\003\001\110\001\255\255\255\255\113\001\008\001\255\255\010\001\
\117\001\255\255\013\001\014\001\255\255\255\255\017\001\255\255\
\019\001\020\001\021\001\255\255\255\255\024\001\025\001\026\001\
\255\255\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\037\001\255\255\255\255\040\001\041\001\255\255\
\255\255\255\255\255\255\255\255\047\001\048\001\255\255\255\255\
\255\255\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\061\001\255\255\255\255\064\001\255\255\255\255\
\255\255\068\001\069\001\255\255\071\001\255\255\255\255\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\255\255\000\001\255\255\255\255\003\001\105\001\255\255\
\107\001\255\255\008\001\110\001\010\001\255\255\113\001\013\001\
\014\001\255\255\117\001\017\001\255\255\019\001\020\001\021\001\
\255\255\255\255\024\001\025\001\026\001\255\255\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\037\001\
\255\255\255\255\040\001\041\001\255\255\255\255\255\255\255\255\
\255\255\047\001\048\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\255\255\000\000\064\001\255\255\255\255\255\255\068\001\069\001\
\255\255\071\001\000\000\255\255\074\001\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\255\255\000\001\
\255\255\255\255\003\001\105\001\255\255\107\001\255\255\008\001\
\110\001\010\001\255\255\113\001\013\001\014\001\255\255\117\001\
\017\001\255\255\019\001\020\001\021\001\255\255\255\255\024\001\
\025\001\026\001\255\255\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\037\001\255\255\255\255\040\001\
\041\001\255\255\255\255\255\255\255\255\255\255\047\001\048\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\061\001\255\255\255\255\064\001\
\255\255\255\255\255\255\068\001\069\001\255\255\071\001\255\255\
\255\255\074\001\075\001\255\255\000\000\255\255\255\255\255\255\
\255\255\082\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\255\255\255\255\255\255\255\255\255\255\
\105\001\000\001\107\001\255\255\003\001\110\001\255\255\255\255\
\113\001\008\001\255\255\010\001\117\001\255\255\013\001\014\001\
\255\255\255\255\017\001\255\255\019\001\020\001\021\001\255\255\
\255\255\024\001\025\001\026\001\255\255\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\037\001\255\255\
\255\255\040\001\041\001\255\255\255\255\255\255\255\255\255\255\
\047\001\048\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\255\255\
\255\255\064\001\255\255\255\255\255\255\068\001\069\001\255\255\
\071\001\255\255\255\255\074\001\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\000\000\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\093\001\094\001\
\255\255\096\001\255\255\098\001\099\001\255\255\255\255\255\255\
\255\255\255\255\105\001\255\255\107\001\255\255\255\255\110\001\
\255\255\000\001\113\001\002\001\003\001\004\001\117\001\255\255\
\255\255\008\001\000\001\255\255\255\255\255\255\013\001\255\255\
\255\255\255\255\017\001\018\001\019\001\255\255\255\255\013\001\
\255\255\255\255\255\255\026\001\027\001\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\026\001\036\001\028\001\029\001\
\255\255\255\255\041\001\255\255\255\255\255\255\255\255\255\255\
\047\001\048\001\056\001\041\001\058\001\059\001\060\001\255\255\
\062\001\255\255\255\255\065\001\066\001\255\255\061\001\255\255\
\255\255\064\001\065\001\255\255\067\001\068\001\069\001\061\001\
\071\001\000\000\064\001\074\001\075\001\255\255\068\001\069\001\
\255\255\255\255\255\255\082\001\255\255\075\001\092\001\255\255\
\255\255\255\255\255\255\255\255\082\001\099\001\093\001\094\001\
\255\255\096\001\097\001\098\001\099\001\255\255\255\255\102\001\
\094\001\111\001\112\001\255\255\098\001\099\001\255\255\110\001\
\111\001\255\255\113\001\255\255\000\001\255\255\117\001\003\001\
\110\001\255\255\255\255\113\001\008\001\255\255\010\001\255\255\
\255\255\013\001\014\001\255\255\255\255\017\001\255\255\019\001\
\020\001\021\001\255\255\255\255\024\001\255\255\026\001\255\255\
\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\037\001\255\255\255\255\040\001\041\001\255\255\255\255\
\255\255\255\255\255\255\047\001\048\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\000\000\255\255\
\255\255\061\001\255\255\255\255\064\001\255\255\255\255\255\255\
\068\001\069\001\255\255\071\001\255\255\255\255\074\001\075\001\
\255\255\255\255\255\255\255\255\255\255\255\255\082\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\093\001\094\001\255\255\096\001\097\001\098\001\099\001\
\255\255\255\255\255\255\255\255\255\255\105\001\255\255\107\001\
\255\255\255\255\110\001\255\255\000\001\113\001\002\001\003\001\
\004\001\117\001\255\255\255\255\008\001\255\255\255\255\255\255\
\255\255\013\001\255\255\255\255\255\255\017\001\018\001\019\001\
\255\255\255\255\255\255\255\255\255\255\255\255\026\001\027\001\
\028\001\029\001\255\255\255\255\255\255\255\255\255\255\255\255\
\036\001\255\255\255\255\255\255\255\255\041\001\255\255\255\255\
\255\255\255\255\255\255\047\001\048\001\000\000\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\061\001\255\255\255\255\064\001\255\255\255\255\067\001\
\068\001\069\001\255\255\071\001\255\255\255\255\074\001\075\001\
\255\255\255\255\255\255\255\255\255\255\255\255\082\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\093\001\094\001\255\255\096\001\097\001\098\001\099\001\
\255\255\000\001\255\255\002\001\003\001\004\001\255\255\255\255\
\255\255\008\001\110\001\255\255\255\255\113\001\013\001\255\255\
\255\255\117\001\017\001\018\001\019\001\255\255\255\255\255\255\
\255\255\255\255\255\255\026\001\027\001\028\001\029\001\255\255\
\255\255\255\255\255\255\255\255\255\255\036\001\255\255\255\255\
\255\255\255\255\041\001\255\255\255\255\255\255\255\255\255\255\
\047\001\048\001\000\000\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\255\255\
\255\255\064\001\255\255\255\255\067\001\068\001\069\001\255\255\
\071\001\255\255\255\255\074\001\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\093\001\094\001\
\255\255\096\001\097\001\098\001\255\255\255\255\000\001\102\001\
\002\001\003\001\004\001\255\255\255\255\255\255\008\001\110\001\
\255\255\255\255\113\001\013\001\255\255\255\255\117\001\017\001\
\018\001\019\001\255\255\255\255\255\255\255\255\255\255\255\255\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\255\255\255\255\255\255\255\255\041\001\
\255\255\255\255\255\255\255\255\255\255\047\001\048\001\000\000\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\255\255\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\071\001\255\255\255\255\
\074\001\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\255\255\255\255\255\255\102\001\000\001\255\255\002\001\
\003\001\004\001\255\255\255\255\110\001\008\001\255\255\113\001\
\255\255\255\255\013\001\117\001\255\255\255\255\017\001\018\001\
\019\001\255\255\255\255\255\255\255\255\255\255\255\255\026\001\
\027\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\036\001\255\255\255\255\255\255\255\255\041\001\255\255\
\255\255\255\255\255\255\255\255\047\001\048\001\000\000\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\061\001\255\255\255\255\064\001\255\255\255\255\
\067\001\068\001\069\001\255\255\071\001\255\255\255\255\074\001\
\075\001\255\255\255\255\255\255\255\255\255\255\255\255\082\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\255\255\000\001\255\255\002\001\003\001\004\001\255\255\
\255\255\255\255\008\001\110\001\255\255\255\255\113\001\013\001\
\255\255\255\255\117\001\017\001\018\001\019\001\255\255\255\255\
\255\255\255\255\255\255\255\255\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\036\001\255\255\
\255\255\255\255\255\255\041\001\255\255\255\255\255\255\255\255\
\255\255\047\001\048\001\000\000\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\255\255\255\255\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\071\001\255\255\255\255\255\255\075\001\255\255\255\255\
\255\255\255\255\255\255\255\255\082\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\093\001\
\094\001\255\255\096\001\097\001\098\001\099\001\255\255\000\001\
\255\255\002\001\003\001\004\001\255\255\255\255\000\000\008\001\
\110\001\255\255\255\255\113\001\013\001\255\255\255\255\117\001\
\017\001\018\001\019\001\255\255\255\255\255\255\255\255\255\255\
\255\255\026\001\027\001\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\036\001\255\255\255\255\255\255\255\255\
\041\001\255\255\255\255\255\255\255\255\255\255\047\001\048\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\000\000\255\255\255\255\255\255\061\001\255\255\255\255\064\001\
\255\255\255\255\067\001\068\001\069\001\255\255\071\001\255\255\
\255\255\255\255\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\093\001\094\001\255\255\096\001\
\097\001\098\001\099\001\255\255\255\255\255\255\000\001\255\255\
\002\001\003\001\004\001\255\255\255\255\110\001\008\001\255\255\
\113\001\255\255\255\255\013\001\117\001\255\255\255\255\017\001\
\018\001\019\001\255\255\255\255\255\255\255\255\255\255\255\255\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\036\001\255\255\255\255\255\255\255\255\041\001\
\255\255\255\255\255\255\255\255\255\255\047\001\048\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\255\255\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\000\000\071\001\255\255\255\255\
\255\255\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\093\001\094\001\255\255\096\001\097\001\
\098\001\099\001\255\255\000\001\255\255\002\001\003\001\004\001\
\255\255\255\255\255\255\008\001\110\001\255\255\255\255\113\001\
\013\001\255\255\255\255\117\001\017\001\018\001\019\001\255\255\
\255\255\255\255\255\255\255\255\255\255\026\001\027\001\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\255\255\036\001\
\255\255\255\255\255\255\255\255\041\001\255\255\255\255\255\255\
\255\255\255\255\047\001\048\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\000\001\255\255\
\061\001\003\001\255\255\064\001\255\255\255\255\067\001\068\001\
\069\001\255\255\071\001\013\001\255\255\255\255\075\001\255\255\
\255\255\019\001\255\255\255\255\000\000\082\001\255\255\255\255\
\026\001\027\001\028\001\029\001\255\255\255\255\255\255\255\255\
\093\001\094\001\255\255\096\001\097\001\098\001\099\001\041\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\000\001\110\001\255\255\003\001\113\001\255\255\255\255\255\255\
\117\001\255\255\255\255\061\001\255\255\013\001\064\001\255\255\
\255\255\255\255\068\001\069\001\255\255\255\255\255\255\255\255\
\255\255\075\001\026\001\027\001\028\001\029\001\255\255\255\255\
\082\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\041\001\255\255\255\255\094\001\255\255\096\001\255\255\
\098\001\099\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\110\001\061\001\255\255\113\001\
\064\001\255\255\255\255\117\001\068\001\069\001\255\255\255\255\
\255\255\255\255\255\255\075\001\255\255\255\255\255\255\000\000\
\255\255\255\255\082\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\094\001\255\255\
\096\001\255\255\098\001\099\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\110\001\255\255\
\255\255\113\001\255\255\255\255\000\001\117\001\255\255\003\001\
\255\255\005\001\006\001\007\001\008\001\255\255\255\255\011\001\
\012\001\013\001\255\255\255\255\255\255\255\255\255\255\019\001\
\255\255\255\255\255\255\255\255\255\255\255\255\026\001\255\255\
\028\001\029\001\030\001\031\001\032\001\033\001\034\001\255\255\
\036\001\255\255\255\255\039\001\255\255\041\001\255\255\255\255\
\255\255\255\255\255\255\047\001\048\001\049\001\050\001\051\001\
\052\001\053\001\054\001\055\001\056\001\057\001\255\255\255\255\
\060\001\061\001\255\255\255\255\064\001\065\001\066\001\255\255\
\068\001\069\001\070\001\071\001\072\001\073\001\255\255\075\001\
\076\001\077\001\078\001\000\000\080\001\255\255\082\001\083\001\
\255\255\255\255\086\001\087\001\255\255\089\001\255\255\091\001\
\255\255\093\001\094\001\095\001\255\255\097\001\098\001\099\001\
\255\255\255\255\255\255\103\001\255\255\255\255\106\001\255\255\
\108\001\109\001\110\001\111\001\112\001\113\001\255\255\255\255\
\116\001\005\001\006\001\007\001\255\255\255\255\255\255\011\001\
\012\001\013\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\028\001\029\001\030\001\031\001\032\001\033\001\034\001\255\255\
\255\255\255\255\255\255\039\001\255\255\041\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\
\255\255\053\001\054\001\055\001\056\001\057\001\255\255\255\255\
\060\001\061\001\255\255\255\255\064\001\065\001\066\001\255\255\
\255\255\069\001\070\001\255\255\072\001\073\001\255\255\075\001\
\255\255\077\001\078\001\255\255\080\001\000\000\082\001\255\255\
\255\255\255\255\086\001\087\001\255\255\089\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\098\001\099\001\
\255\255\255\255\255\255\103\001\255\255\255\255\255\255\255\255\
\108\001\109\001\110\001\111\001\005\001\006\001\007\001\255\255\
\116\001\255\255\011\001\012\001\013\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\028\001\029\001\030\001\031\001\032\001\
\033\001\034\001\255\255\255\255\255\255\255\255\039\001\255\255\
\041\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\061\001\255\255\255\255\064\001\
\065\001\066\001\255\255\255\255\069\001\070\001\255\255\072\001\
\073\001\255\255\075\001\255\255\077\001\078\001\255\255\080\001\
\255\255\082\001\255\255\255\255\255\255\086\001\087\001\000\000\
\089\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\099\001\255\255\255\255\255\255\103\001\255\255\
\255\255\255\255\255\255\108\001\109\001\110\001\111\001\255\255\
\255\255\255\255\255\255\116\001\255\255\255\255\255\255\255\255\
\005\001\006\001\007\001\255\255\255\255\255\255\011\001\012\001\
\013\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\028\001\
\029\001\030\001\031\001\032\001\033\001\034\001\255\255\255\255\
\255\255\255\255\039\001\255\255\041\001\255\255\255\255\255\255\
\255\255\255\255\255\255\000\000\049\001\050\001\051\001\255\255\
\053\001\054\001\055\001\056\001\057\001\255\255\255\255\060\001\
\061\001\255\255\255\255\064\001\065\001\066\001\255\255\255\255\
\069\001\070\001\255\255\072\001\073\001\255\255\075\001\255\255\
\077\001\078\001\255\255\080\001\255\255\082\001\255\255\255\255\
\255\255\086\001\087\001\255\255\089\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\099\001\255\255\
\255\255\255\255\103\001\255\255\255\255\255\255\000\000\108\001\
\109\001\110\001\111\001\255\255\255\255\000\001\255\255\116\001\
\255\255\004\001\255\255\006\001\255\255\008\001\255\255\010\001\
\255\255\012\001\013\001\014\001\015\001\255\255\017\001\018\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\026\001\
\027\001\028\001\029\001\030\001\031\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\041\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\049\001\050\001\
\051\001\052\001\053\001\054\001\255\255\056\001\057\001\255\255\
\255\255\060\001\061\001\255\255\255\255\064\001\065\001\066\001\
\067\001\068\001\069\001\255\255\000\000\072\001\255\255\074\001\
\075\001\255\255\077\001\255\255\255\255\255\255\255\255\082\001\
\083\001\255\255\255\255\086\001\255\255\255\255\255\255\255\255\
\091\001\255\255\093\001\094\001\255\255\096\001\097\001\098\001\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\106\001\
\255\255\108\001\255\255\110\001\111\001\112\001\255\255\000\001\
\115\001\255\255\255\255\004\001\255\255\006\001\255\255\008\001\
\255\255\010\001\255\255\012\001\255\255\014\001\015\001\000\000\
\017\001\018\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\027\001\255\255\255\255\030\001\031\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\049\001\050\001\051\001\052\001\255\255\054\001\255\255\056\001\
\057\001\255\255\255\255\060\001\255\255\255\255\255\255\255\255\
\065\001\066\001\067\001\255\255\255\255\255\255\255\255\072\001\
\255\255\074\001\000\000\000\001\077\001\255\255\003\001\004\001\
\255\255\255\255\083\001\255\255\255\255\086\001\255\255\255\255\
\013\001\014\001\091\001\255\255\093\001\094\001\019\001\096\001\
\097\001\255\255\099\001\255\255\255\255\026\001\103\001\028\001\
\029\001\106\001\255\255\108\001\255\255\255\255\111\001\112\001\
\255\255\255\255\115\001\255\255\041\001\255\255\255\255\255\255\
\255\255\255\255\047\001\048\001\000\000\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\000\001\255\255\
\061\001\003\001\004\001\064\001\255\255\255\255\067\001\068\001\
\069\001\255\255\071\001\013\001\014\001\255\255\075\001\255\255\
\255\255\019\001\255\255\255\255\255\255\082\001\255\255\255\255\
\026\001\255\255\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\094\001\255\255\096\001\255\255\098\001\099\001\041\001\
\255\255\255\255\255\255\255\255\255\255\047\001\048\001\000\000\
\255\255\110\001\255\255\255\255\113\001\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\255\255\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\071\001\255\255\255\255\
\255\255\075\001\255\255\255\255\000\001\255\255\255\255\003\001\
\082\001\255\255\255\255\255\255\008\001\255\255\255\255\255\255\
\255\255\013\001\014\001\255\255\094\001\255\255\096\001\019\001\
\098\001\099\001\022\001\255\255\255\255\255\255\026\001\255\255\
\028\001\029\001\000\000\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\255\255\056\001\041\001\058\001\059\001\
\060\001\255\255\062\001\255\255\255\255\065\001\066\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\001\
\255\255\061\001\003\001\004\001\064\001\255\255\066\001\067\001\
\068\001\069\001\255\255\255\255\013\001\014\001\255\255\075\001\
\092\001\255\255\019\001\255\255\255\255\081\001\082\001\099\001\
\255\255\026\001\255\255\028\001\029\001\255\255\000\000\255\255\
\255\255\255\255\094\001\111\001\112\001\255\255\098\001\099\001\
\041\001\255\255\255\255\255\255\255\255\255\255\047\001\048\001\
\255\255\255\255\110\001\255\255\255\255\113\001\255\255\255\255\
\255\255\255\255\000\001\255\255\061\001\003\001\004\001\064\001\
\255\255\255\255\255\255\068\001\069\001\255\255\071\001\013\001\
\014\001\255\255\075\001\255\255\255\255\019\001\255\255\255\255\
\255\255\082\001\255\255\255\255\026\001\000\000\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\094\001\255\255\096\001\
\255\255\098\001\099\001\041\001\255\255\255\255\255\255\255\255\
\255\255\047\001\048\001\255\255\000\001\110\001\255\255\003\001\
\113\001\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\255\255\013\001\064\001\255\255\255\255\255\255\068\001\069\001\
\255\255\071\001\255\255\255\255\255\255\075\001\026\001\027\001\
\028\001\029\001\255\255\255\255\082\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\041\001\255\255\255\255\
\094\001\255\255\096\001\255\255\098\001\099\001\255\255\255\255\
\255\255\000\000\255\255\255\255\255\255\255\255\255\255\000\001\
\110\001\061\001\003\001\113\001\255\255\065\001\255\255\067\001\
\068\001\069\001\000\000\255\255\013\001\255\255\074\001\075\001\
\255\255\255\255\255\255\255\255\255\255\255\255\082\001\255\255\
\255\255\026\001\027\001\028\001\029\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\096\001\255\255\098\001\099\001\
\041\001\255\255\102\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\110\001\111\001\255\255\113\001\255\255\255\255\
\255\255\255\255\000\001\255\255\061\001\003\001\255\255\255\255\
\065\001\255\255\067\001\068\001\069\001\255\255\255\255\013\001\
\255\255\074\001\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\255\255\255\255\026\001\027\001\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\096\001\
\255\255\098\001\099\001\041\001\255\255\102\001\000\000\255\255\
\255\255\255\255\255\255\255\255\255\255\110\001\111\001\255\255\
\113\001\255\255\255\255\255\255\255\255\255\255\000\001\061\001\
\255\255\003\001\255\255\065\001\255\255\067\001\068\001\069\001\
\255\255\255\255\255\255\013\001\074\001\075\001\255\255\255\255\
\255\255\019\001\255\255\255\255\082\001\255\255\255\255\255\255\
\026\001\255\255\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\096\001\255\255\098\001\099\001\040\001\041\001\
\102\001\255\255\255\255\255\255\255\255\047\001\048\001\255\255\
\110\001\111\001\255\255\113\001\255\255\000\001\255\255\255\255\
\003\001\255\255\255\255\061\001\000\000\008\001\064\001\255\255\
\255\255\255\255\013\001\069\001\255\255\071\001\000\000\255\255\
\019\001\075\001\255\255\255\255\255\255\255\255\255\255\026\001\
\082\001\028\001\029\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\094\001\255\255\041\001\255\255\
\098\001\099\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\061\001\255\255\255\255\064\001\255\255\255\255\
\067\001\068\001\069\001\255\255\255\255\255\255\255\255\074\001\
\075\001\000\001\255\255\255\255\003\001\255\255\255\255\082\001\
\255\255\008\001\000\000\255\255\255\255\255\255\013\001\255\255\
\255\255\255\255\000\001\094\001\019\001\003\001\255\255\098\001\
\099\001\255\255\008\001\026\001\255\255\028\001\029\001\013\001\
\255\255\255\255\255\255\110\001\255\255\019\001\113\001\255\255\
\255\255\255\255\041\001\255\255\026\001\255\255\028\001\029\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\041\001\000\000\255\255\061\001\255\255\
\255\255\064\001\255\255\255\255\067\001\068\001\069\001\255\255\
\255\255\255\255\255\255\074\001\075\001\255\255\255\255\061\001\
\255\255\255\255\064\001\082\001\000\000\067\001\068\001\069\001\
\255\255\255\255\255\255\255\255\074\001\075\001\255\255\094\001\
\255\255\255\255\255\255\098\001\082\001\255\255\255\255\102\001\
\255\255\255\255\255\255\255\255\255\255\255\255\000\001\110\001\
\094\001\003\001\113\001\255\255\098\001\255\255\008\001\255\255\
\102\001\255\255\255\255\013\001\255\255\255\255\255\255\255\255\
\110\001\019\001\255\255\113\001\255\255\255\255\000\000\255\255\
\026\001\255\255\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\041\001\
\255\255\255\255\056\001\255\255\058\001\059\001\060\001\255\255\
\062\001\255\255\255\255\065\001\066\001\255\255\255\255\255\255\
\255\255\255\255\255\255\061\001\255\255\075\001\064\001\255\255\
\255\255\067\001\068\001\069\001\255\255\083\001\255\255\255\255\
\074\001\075\001\255\255\255\255\000\001\091\001\092\001\003\001\
\082\001\000\000\096\001\255\255\008\001\099\001\000\001\255\255\
\255\255\013\001\255\255\255\255\094\001\255\255\255\255\019\001\
\098\001\111\001\112\001\013\001\102\001\255\255\026\001\255\255\
\028\001\029\001\255\255\255\255\110\001\255\255\255\255\113\001\
\026\001\255\255\028\001\029\001\255\255\041\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\041\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\061\001\255\255\255\255\064\001\000\000\255\255\067\001\
\068\001\069\001\255\255\061\001\255\255\255\255\074\001\075\001\
\255\255\255\255\000\001\069\001\255\255\003\001\082\001\255\255\
\255\255\075\001\008\001\255\255\255\255\255\255\255\255\013\001\
\082\001\255\255\094\001\255\255\255\255\019\001\098\001\255\255\
\255\255\255\255\102\001\255\255\026\001\255\255\028\001\029\001\
\098\001\255\255\110\001\255\255\255\255\113\001\255\255\255\255\
\255\255\255\255\255\255\041\001\110\001\255\255\255\255\113\001\
\000\000\255\255\255\255\255\255\000\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\061\001\
\255\255\013\001\064\001\255\255\255\255\067\001\068\001\069\001\
\255\255\255\255\255\255\255\255\000\001\075\001\026\001\003\001\
\028\001\029\001\255\255\255\255\082\001\255\255\255\255\255\255\
\255\255\013\001\255\255\255\255\255\255\041\001\255\255\019\001\
\094\001\255\255\255\255\255\255\098\001\099\001\026\001\255\255\
\028\001\029\001\255\255\000\000\255\255\255\255\255\255\000\000\
\110\001\061\001\255\255\113\001\255\255\041\001\255\255\255\255\
\255\255\069\001\255\255\255\255\255\255\255\255\000\001\075\001\
\255\255\003\001\255\255\255\255\255\255\255\255\082\001\255\255\
\255\255\061\001\255\255\013\001\064\001\255\255\255\255\255\255\
\068\001\069\001\255\255\255\255\255\255\255\255\098\001\075\001\
\026\001\027\001\028\001\029\001\255\255\255\255\082\001\255\255\
\255\255\255\255\110\001\255\255\088\001\113\001\000\000\041\001\
\255\255\255\255\094\001\255\255\255\255\255\255\098\001\099\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\000\001\110\001\061\001\003\001\113\001\064\001\255\255\
\255\255\008\001\068\001\069\001\255\255\255\255\013\001\255\255\
\255\255\075\001\255\255\255\255\019\001\255\255\255\255\255\255\
\082\001\255\255\255\255\026\001\255\255\028\001\029\001\255\255\
\000\000\255\255\255\255\255\255\094\001\255\255\096\001\255\255\
\098\001\099\001\041\001\255\255\255\255\255\255\255\255\255\255\
\255\255\000\000\255\255\255\255\110\001\255\255\255\255\113\001\
\255\255\255\255\255\255\255\255\255\255\000\001\061\001\255\255\
\003\001\064\001\255\255\255\255\255\255\068\001\069\001\255\255\
\255\255\255\255\013\001\255\255\075\001\255\255\255\255\255\255\
\019\001\255\255\255\255\082\001\255\255\255\255\255\255\026\001\
\255\255\028\001\029\001\255\255\255\255\255\255\255\255\094\001\
\255\255\255\255\255\255\098\001\099\001\255\255\041\001\255\255\
\255\255\255\255\255\255\255\255\000\000\255\255\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\255\255\255\255\
\000\001\255\255\061\001\003\001\255\255\064\001\255\255\255\255\
\255\255\068\001\069\001\255\255\255\255\013\001\255\255\255\255\
\075\001\255\255\255\255\019\001\255\255\255\255\255\255\082\001\
\255\255\255\255\026\001\255\255\028\001\029\001\255\255\255\255\
\255\255\255\255\255\255\094\001\255\255\255\255\000\000\098\001\
\099\001\041\001\255\255\255\255\255\255\255\255\255\255\000\000\
\255\255\255\255\255\255\110\001\255\255\255\255\113\001\255\255\
\255\255\255\255\255\255\000\001\255\255\061\001\003\001\000\001\
\064\001\255\255\255\255\255\255\068\001\069\001\255\255\255\255\
\013\001\255\255\255\255\075\001\013\001\255\255\019\001\255\255\
\255\255\255\255\082\001\255\255\255\255\026\001\255\255\028\001\
\029\001\026\001\255\255\028\001\029\001\255\255\094\001\255\255\
\255\255\000\000\098\001\099\001\041\001\255\255\255\255\255\255\
\041\001\255\255\255\255\255\255\255\255\255\255\110\001\255\255\
\255\255\113\001\255\255\255\255\255\255\255\255\000\001\255\255\
\061\001\003\001\255\255\064\001\061\001\255\255\255\255\068\001\
\069\001\255\255\255\255\013\001\069\001\255\255\075\001\255\255\
\255\255\019\001\075\001\255\255\255\255\082\001\255\255\255\255\
\026\001\082\001\028\001\029\001\255\255\255\255\255\255\255\255\
\255\255\094\001\255\255\255\255\000\000\098\001\099\001\041\001\
\255\255\098\001\255\255\255\255\255\255\255\255\255\255\255\255\
\000\001\110\001\255\255\255\255\113\001\110\001\255\255\255\255\
\113\001\255\255\255\255\061\001\255\255\013\001\064\001\255\255\
\255\255\000\001\068\001\069\001\003\001\255\255\255\255\255\255\
\255\255\075\001\026\001\255\255\028\001\029\001\013\001\255\255\
\082\001\000\000\255\255\255\255\019\001\255\255\255\255\255\255\
\255\255\041\001\255\255\026\001\094\001\028\001\029\001\255\255\
\098\001\099\001\255\255\255\255\255\255\255\255\255\255\000\000\
\255\255\255\255\041\001\255\255\110\001\061\001\255\255\113\001\
\255\255\255\255\255\255\255\255\255\255\069\001\255\255\255\255\
\255\255\255\255\255\255\075\001\000\001\255\255\061\001\003\001\
\255\255\064\001\082\001\255\255\255\255\068\001\069\001\255\255\
\255\255\013\001\255\255\255\255\075\001\255\255\255\255\019\001\
\255\255\255\255\098\001\082\001\000\000\255\255\026\001\255\255\
\028\001\029\001\255\255\255\255\255\255\255\255\110\001\094\001\
\255\255\113\001\255\255\098\001\099\001\041\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\000\001\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\008\001\000\001\
\255\255\061\001\255\255\013\001\064\001\255\255\255\255\255\255\
\068\001\069\001\255\255\255\255\013\001\255\255\000\000\075\001\
\026\001\255\255\028\001\029\001\255\255\255\255\082\001\000\000\
\255\255\026\001\255\255\028\001\029\001\255\255\255\255\041\001\
\255\255\255\255\094\001\255\255\255\255\255\255\098\001\099\001\
\041\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\000\001\110\001\061\001\255\255\113\001\064\001\255\255\
\255\255\255\255\068\001\069\001\061\001\255\255\013\001\064\001\
\255\255\075\001\255\255\068\001\069\001\255\255\255\255\255\255\
\082\001\255\255\075\001\026\001\255\255\028\001\029\001\255\255\
\255\255\082\001\255\255\255\255\094\001\255\255\255\255\255\255\
\098\001\099\001\041\001\255\255\255\255\094\001\255\255\255\255\
\255\255\098\001\099\001\255\255\110\001\000\000\255\255\113\001\
\255\255\255\255\255\255\255\255\000\001\110\001\061\001\003\001\
\113\001\064\001\255\255\255\255\255\255\068\001\069\001\255\255\
\255\255\013\001\255\255\000\000\075\001\255\255\255\255\255\255\
\255\255\255\255\255\255\082\001\255\255\255\255\026\001\255\255\
\028\001\029\001\255\255\255\255\255\255\255\255\255\255\094\001\
\255\255\000\000\255\255\098\001\099\001\041\001\255\255\255\255\
\255\255\000\001\255\255\255\255\255\255\255\255\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\255\255\013\001\255\255\
\255\255\061\001\255\255\255\255\064\001\255\255\255\255\000\001\
\255\255\069\001\003\001\026\001\255\255\028\001\029\001\075\001\
\255\255\255\255\255\255\255\255\013\001\255\255\082\001\255\255\
\255\255\255\255\041\001\255\255\255\255\255\255\255\255\255\255\
\255\255\026\001\094\001\028\001\029\001\255\255\098\001\099\001\
\255\255\255\255\255\255\255\255\255\255\255\255\061\001\040\001\
\041\001\064\001\110\001\255\255\000\001\113\001\069\001\003\001\
\000\000\255\255\255\255\255\255\075\001\255\255\255\255\255\255\
\255\255\013\001\000\000\082\001\061\001\255\255\255\255\064\001\
\255\255\255\255\255\255\068\001\069\001\255\255\026\001\094\001\
\028\001\029\001\075\001\098\001\099\001\255\255\255\255\255\255\
\255\255\082\001\255\255\255\255\040\001\041\001\255\255\110\001\
\255\255\255\255\113\001\255\255\255\255\094\001\000\001\255\255\
\255\255\098\001\099\001\255\255\255\255\255\255\008\001\000\001\
\255\255\061\001\255\255\013\001\064\001\110\001\255\255\255\255\
\068\001\069\001\255\255\255\255\013\001\255\255\255\255\075\001\
\026\001\255\255\028\001\029\001\255\255\000\000\082\001\255\255\
\255\255\026\001\255\255\028\001\029\001\255\255\255\255\041\001\
\255\255\255\255\094\001\255\255\255\255\255\255\098\001\099\001\
\041\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\110\001\061\001\255\255\255\255\064\001\255\255\
\255\255\067\001\068\001\069\001\061\001\255\255\255\255\064\001\
\255\255\075\001\067\001\068\001\069\001\255\255\255\255\000\000\
\082\001\255\255\075\001\255\255\255\255\000\001\255\255\255\255\
\003\001\082\001\255\255\255\255\094\001\255\255\255\255\255\255\
\098\001\099\001\013\001\255\255\255\255\094\001\255\255\255\255\
\255\255\098\001\099\001\000\001\110\001\255\255\003\001\026\001\
\255\255\028\001\029\001\255\255\255\255\110\001\000\000\255\255\
\013\001\255\255\255\255\255\255\255\255\040\001\041\001\255\255\
\255\255\000\001\255\255\255\255\003\001\026\001\255\255\028\001\
\029\001\255\255\255\255\255\255\255\255\255\255\013\001\255\255\
\255\255\255\255\061\001\255\255\041\001\064\001\255\255\255\255\
\255\255\255\255\069\001\026\001\255\255\028\001\029\001\255\255\
\075\001\255\255\000\000\255\255\255\255\255\255\255\255\082\001\
\061\001\255\255\041\001\064\001\255\255\255\255\255\255\068\001\
\069\001\255\255\255\255\094\001\255\255\255\255\075\001\098\001\
\099\001\255\255\255\255\255\255\255\255\082\001\061\001\255\255\
\255\255\064\001\255\255\110\001\255\255\068\001\069\001\255\255\
\255\255\094\001\255\255\255\255\075\001\098\001\099\001\000\000\
\000\001\255\255\255\255\082\001\255\255\255\255\255\255\255\255\
\008\001\110\001\000\001\255\255\255\255\013\001\255\255\094\001\
\255\255\255\255\255\255\098\001\099\001\000\000\255\255\013\001\
\255\255\255\255\026\001\255\255\028\001\029\001\000\000\110\001\
\255\255\255\255\255\255\255\255\026\001\255\255\028\001\029\001\
\255\255\041\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\041\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\061\001\255\255\255\255\
\064\001\255\255\255\255\255\255\068\001\069\001\255\255\061\001\
\255\255\255\255\064\001\075\001\255\255\000\001\068\001\069\001\
\003\001\255\255\082\001\255\255\255\255\075\001\255\255\255\255\
\255\255\255\255\013\001\255\255\082\001\255\255\094\001\255\255\
\255\255\255\255\098\001\099\001\255\255\255\255\255\255\026\001\
\094\001\028\001\029\001\255\255\098\001\099\001\110\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\041\001\255\255\
\110\001\255\255\056\001\255\255\058\001\059\001\060\001\000\001\
\062\001\255\255\255\255\065\001\066\001\255\255\255\255\255\255\
\255\255\255\255\061\001\255\255\013\001\064\001\255\255\255\255\
\255\255\255\255\069\001\255\255\255\255\083\001\255\255\255\255\
\075\001\026\001\255\255\028\001\029\001\091\001\092\001\082\001\
\255\255\255\255\255\255\255\255\255\255\099\001\000\001\255\255\
\041\001\255\255\255\255\094\001\255\255\255\255\255\255\098\001\
\099\001\111\001\112\001\013\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\110\001\061\001\255\255\255\255\064\001\
\026\001\255\255\028\001\029\001\069\001\255\255\255\255\255\255\
\255\255\255\255\075\001\255\255\255\255\255\255\255\255\041\001\
\255\255\082\001\000\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\094\001\255\255\013\001\
\255\255\098\001\099\001\061\001\255\255\255\255\064\001\255\255\
\255\255\255\255\255\255\069\001\026\001\110\001\028\001\029\001\
\255\255\075\001\255\255\255\255\255\255\255\255\255\255\255\255\
\082\001\255\255\255\255\041\001\255\255\255\255\255\255\000\001\
\255\255\255\255\255\255\255\255\094\001\255\255\255\255\255\255\
\098\001\099\001\255\255\255\255\013\001\255\255\255\255\061\001\
\255\255\255\255\064\001\255\255\110\001\000\001\255\255\069\001\
\255\255\026\001\255\255\028\001\029\001\075\001\000\001\255\255\
\255\255\255\255\013\001\255\255\082\001\255\255\255\255\255\255\
\041\001\255\255\255\255\013\001\255\255\255\255\255\255\026\001\
\094\001\028\001\029\001\255\255\098\001\099\001\255\255\255\255\
\026\001\255\255\028\001\029\001\061\001\255\255\041\001\064\001\
\110\001\255\255\255\255\255\255\069\001\255\255\255\255\041\001\
\255\255\255\255\075\001\255\255\255\255\255\255\255\255\255\255\
\255\255\082\001\061\001\255\255\255\255\064\001\255\255\255\255\
\255\255\255\255\069\001\061\001\255\255\094\001\064\001\255\255\
\075\001\098\001\099\001\069\001\255\255\255\255\255\255\082\001\
\255\255\075\001\255\255\255\255\255\255\110\001\255\255\255\255\
\082\001\255\255\255\255\094\001\255\255\255\255\255\255\098\001\
\099\001\255\255\255\255\255\255\094\001\255\255\255\255\255\255\
\098\001\099\001\000\001\110\001\255\255\255\255\255\255\005\001\
\006\001\007\001\008\001\255\255\110\001\011\001\012\001\013\001\
\014\001\255\255\255\255\255\255\255\255\019\001\255\255\255\255\
\255\255\255\255\255\255\255\255\026\001\255\255\028\001\029\001\
\030\001\031\001\032\001\033\001\034\001\255\255\255\255\255\255\
\255\255\039\001\255\255\041\001\255\255\255\255\255\255\255\255\
\255\255\047\001\048\001\049\001\050\001\051\001\052\001\053\001\
\054\001\055\001\056\001\057\001\255\255\255\255\060\001\061\001\
\255\255\255\255\064\001\065\001\066\001\067\001\255\255\069\001\
\070\001\071\001\072\001\073\001\255\255\075\001\255\255\077\001\
\078\001\255\255\080\001\255\255\082\001\083\001\255\255\255\255\
\086\001\087\001\255\255\089\001\255\255\091\001\255\255\255\255\
\094\001\095\001\255\255\255\255\098\001\099\001\255\255\255\255\
\255\255\103\001\255\255\255\255\106\001\255\255\108\001\109\001\
\110\001\111\001\112\001\113\001\255\255\255\255\116\001\000\001\
\001\001\002\001\255\255\255\255\005\001\006\001\007\001\255\255\
\009\001\255\255\011\001\012\001\255\255\255\255\015\001\016\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\027\001\255\255\255\255\030\001\031\001\032\001\
\033\001\034\001\255\255\036\001\255\255\255\255\039\001\255\255\
\255\255\042\001\043\001\044\001\045\001\046\001\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\255\255\062\001\255\255\064\001\
\065\001\066\001\255\255\255\255\255\255\070\001\255\255\072\001\
\073\001\255\255\075\001\255\255\077\001\078\001\255\255\080\001\
\255\255\255\255\255\255\084\001\085\001\086\001\087\001\088\001\
\089\001\255\255\255\255\255\255\255\255\255\255\255\255\096\001\
\255\255\255\255\255\255\100\001\255\255\102\001\103\001\255\255\
\255\255\255\255\255\255\108\001\109\001\255\255\111\001\000\001\
\001\001\002\001\255\255\116\001\005\001\006\001\007\001\255\255\
\009\001\255\255\011\001\012\001\255\255\255\255\255\255\016\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\027\001\255\255\255\255\030\001\031\001\032\001\
\033\001\034\001\255\255\036\001\255\255\255\255\039\001\255\255\
\255\255\042\001\043\001\044\001\045\001\046\001\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\255\255\062\001\255\255\064\001\
\065\001\066\001\255\255\255\255\255\255\070\001\255\255\072\001\
\073\001\255\255\075\001\255\255\077\001\078\001\255\255\080\001\
\255\255\255\255\255\255\084\001\085\001\086\001\087\001\088\001\
\089\001\255\255\255\255\255\255\255\255\255\255\255\255\096\001\
\255\255\255\255\255\255\100\001\255\255\102\001\103\001\255\255\
\255\255\255\255\255\255\108\001\109\001\255\255\111\001\000\001\
\001\001\002\001\255\255\116\001\005\001\006\001\007\001\255\255\
\009\001\255\255\011\001\012\001\255\255\255\255\255\255\016\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\027\001\255\255\255\255\030\001\031\001\032\001\
\033\001\034\001\255\255\036\001\255\255\255\255\039\001\255\255\
\255\255\042\001\043\001\044\001\045\001\046\001\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\255\255\062\001\255\255\064\001\
\065\001\066\001\255\255\255\255\255\255\070\001\255\255\072\001\
\073\001\255\255\075\001\255\255\077\001\078\001\255\255\080\001\
\255\255\255\255\255\255\084\001\085\001\086\001\087\001\088\001\
\089\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\100\001\255\255\102\001\103\001\255\255\
\255\255\255\255\000\001\108\001\109\001\255\255\111\001\005\001\
\006\001\007\001\008\001\116\001\255\255\011\001\012\001\255\255\
\255\255\255\255\255\255\255\255\255\255\019\001\255\255\255\255\
\255\255\255\255\255\255\255\255\026\001\255\255\028\001\255\255\
\030\001\031\001\032\001\033\001\034\001\255\255\255\255\255\255\
\255\255\039\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\047\001\048\001\049\001\050\001\051\001\052\001\053\001\
\054\001\055\001\056\001\057\001\255\255\255\255\060\001\061\001\
\255\255\255\255\064\001\065\001\066\001\255\255\255\255\069\001\
\070\001\071\001\072\001\073\001\255\255\255\255\255\255\077\001\
\078\001\255\255\080\001\255\255\255\255\083\001\255\255\255\255\
\086\001\087\001\255\255\089\001\255\255\091\001\255\255\255\255\
\255\255\095\001\255\255\255\255\255\255\099\001\255\255\255\255\
\255\255\103\001\255\255\255\255\106\001\255\255\108\001\109\001\
\255\255\111\001\112\001\113\001\000\001\255\255\116\001\255\255\
\255\255\005\001\006\001\007\001\255\255\255\255\255\255\011\001\
\012\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\030\001\031\001\032\001\033\001\034\001\255\255\
\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\
\255\255\053\001\054\001\055\001\056\001\057\001\255\255\255\255\
\060\001\255\255\255\255\255\255\064\001\065\001\066\001\255\255\
\255\255\255\255\070\001\255\255\072\001\073\001\255\255\255\255\
\255\255\077\001\078\001\255\255\080\001\255\255\255\255\255\255\
\255\255\255\255\086\001\087\001\000\001\089\001\255\255\255\255\
\255\255\005\001\006\001\007\001\096\001\255\255\255\255\011\001\
\012\001\255\255\255\255\103\001\255\255\255\255\255\255\255\255\
\108\001\109\001\255\255\111\001\255\255\255\255\255\255\255\255\
\116\001\255\255\030\001\031\001\032\001\033\001\034\001\255\255\
\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\
\255\255\053\001\054\001\055\001\056\001\057\001\255\255\255\255\
\060\001\255\255\255\255\255\255\064\001\065\001\066\001\255\255\
\255\255\255\255\070\001\255\255\072\001\073\001\255\255\255\255\
\255\255\077\001\078\001\255\255\080\001\255\255\255\255\255\255\
\255\255\255\255\086\001\087\001\000\001\089\001\255\255\255\255\
\255\255\005\001\006\001\007\001\096\001\255\255\255\255\011\001\
\012\001\255\255\255\255\103\001\255\255\255\255\255\255\255\255\
\108\001\109\001\255\255\111\001\255\255\255\255\255\255\255\255\
\116\001\255\255\030\001\031\001\032\001\033\001\034\001\255\255\
\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\
\255\255\053\001\054\001\055\001\056\001\057\001\255\255\255\255\
\060\001\255\255\255\255\255\255\064\001\065\001\066\001\255\255\
\255\255\255\255\070\001\255\255\072\001\073\001\255\255\255\255\
\255\255\077\001\078\001\255\255\080\001\255\255\255\255\255\255\
\255\255\255\255\086\001\087\001\000\001\089\001\255\255\255\255\
\255\255\005\001\006\001\007\001\096\001\255\255\255\255\011\001\
\012\001\255\255\255\255\103\001\255\255\255\255\255\255\255\255\
\108\001\109\001\255\255\111\001\255\255\255\255\255\255\255\255\
\116\001\255\255\030\001\031\001\032\001\033\001\034\001\255\255\
\255\255\255\255\255\255\039\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\
\255\255\053\001\054\001\055\001\056\001\057\001\255\255\255\255\
\060\001\255\255\255\255\255\255\064\001\065\001\066\001\255\255\
\255\255\255\255\070\001\255\255\072\001\073\001\255\255\255\255\
\255\255\077\001\078\001\255\255\080\001\255\255\255\255\255\255\
\255\255\255\255\086\001\087\001\255\255\089\001\255\255\255\255\
\255\255\255\255\255\255\255\255\096\001\003\001\004\001\005\001\
\255\255\255\255\255\255\103\001\255\255\011\001\255\255\013\001\
\108\001\109\001\255\255\111\001\255\255\019\001\020\001\021\001\
\116\001\255\255\024\001\025\001\026\001\255\255\028\001\029\001\
\030\001\255\255\032\001\033\001\034\001\035\001\255\255\255\255\
\255\255\039\001\040\001\041\001\255\255\255\255\255\255\255\255\
\255\255\047\001\048\001\255\255\255\255\255\255\255\255\053\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\064\001\065\001\255\255\255\255\255\255\255\255\
\070\001\071\001\255\255\255\255\255\255\075\001\076\001\255\255\
\078\001\255\255\080\001\081\001\082\001\255\255\084\001\255\255\
\255\255\255\255\255\255\255\255\090\001\255\255\255\255\255\255\
\255\255\095\001\255\255\255\255\255\255\255\255\255\255\101\001\
\000\001\255\255\104\001\105\001\004\001\107\001\108\001\109\001\
\110\001\111\001\255\255\113\001\114\001\115\001\116\001\117\001\
\255\255\017\001\255\255\019\001\255\255\255\255\022\001\255\255\
\255\255\255\255\026\001\027\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\036\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\047\001\
\048\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\061\001\255\255\255\255\
\255\255\065\001\255\255\067\001\068\001\069\001\255\255\071\001\
\255\255\255\255\074\001\255\255\255\255\255\255\255\255\000\001\
\001\001\002\001\255\255\255\255\255\255\006\001\007\001\255\255\
\009\001\255\255\255\255\012\001\092\001\093\001\015\001\016\001\
\255\255\097\001\255\255\099\001\255\255\255\255\102\001\255\255\
\255\255\255\255\027\001\028\001\255\255\030\001\031\001\111\001\
\255\255\113\001\255\255\036\001\255\255\255\255\255\255\255\255\
\255\255\042\001\043\001\044\001\045\001\046\001\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\255\255\056\001\
\057\001\255\255\255\255\060\001\255\255\062\001\255\255\255\255\
\065\001\066\001\255\255\255\255\255\255\255\255\255\255\072\001\
\073\001\255\255\075\001\255\255\077\001\255\255\255\255\255\255\
\255\255\255\255\255\255\084\001\085\001\086\001\087\001\088\001\
\089\001\255\255\255\255\255\255\255\255\255\255\255\255\096\001\
\255\255\255\255\099\001\100\001\255\255\102\001\103\001\255\255\
\255\255\255\255\255\255\108\001\255\255\255\255\111\001\112\001\
\000\001\001\001\002\001\255\255\255\255\255\255\006\001\007\001\
\255\255\009\001\255\255\255\255\012\001\255\255\255\255\255\255\
\016\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\027\001\028\001\255\255\030\001\031\001\
\255\255\255\255\255\255\255\255\036\001\255\255\255\255\255\255\
\255\255\255\255\042\001\043\001\044\001\045\001\046\001\255\255\
\255\255\049\001\050\001\051\001\255\255\053\001\054\001\255\255\
\056\001\057\001\255\255\255\255\060\001\255\255\062\001\255\255\
\255\255\065\001\066\001\255\255\255\255\255\255\255\255\255\255\
\072\001\073\001\255\255\075\001\255\255\077\001\255\255\255\255\
\255\255\255\255\255\255\255\255\084\001\085\001\086\001\087\001\
\088\001\089\001\255\255\255\255\255\255\255\255\255\255\255\255\
\096\001\255\255\255\255\099\001\100\001\255\255\102\001\103\001\
\255\255\255\255\255\255\255\255\108\001\255\255\110\001\111\001\
\112\001\000\001\001\001\002\001\255\255\255\255\255\255\006\001\
\007\001\255\255\009\001\255\255\255\255\012\001\255\255\255\255\
\255\255\016\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\027\001\028\001\255\255\030\001\
\031\001\255\255\255\255\255\255\255\255\036\001\255\255\255\255\
\255\255\255\255\255\255\042\001\043\001\044\001\045\001\046\001\
\255\255\255\255\049\001\050\001\051\001\255\255\053\001\054\001\
\255\255\056\001\057\001\255\255\255\255\060\001\255\255\062\001\
\255\255\255\255\065\001\066\001\255\255\255\255\255\255\255\255\
\255\255\072\001\073\001\255\255\075\001\255\255\077\001\255\255\
\255\255\255\255\255\255\255\255\255\255\084\001\085\001\086\001\
\087\001\088\001\089\001\255\255\255\255\255\255\255\255\255\255\
\255\255\096\001\255\255\255\255\099\001\100\001\255\255\102\001\
\103\001\255\255\255\255\255\255\255\255\108\001\255\255\110\001\
\111\001\112\001\000\001\001\001\002\001\255\255\255\255\255\255\
\006\001\007\001\255\255\009\001\255\255\255\255\012\001\255\255\
\255\255\255\255\016\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\027\001\028\001\255\255\
\030\001\031\001\255\255\255\255\255\255\255\255\036\001\255\255\
\255\255\255\255\255\255\255\255\042\001\043\001\044\001\045\001\
\046\001\255\255\255\255\049\001\050\001\051\001\255\255\053\001\
\054\001\255\255\056\001\057\001\255\255\255\255\060\001\255\255\
\062\001\255\255\255\255\065\001\066\001\255\255\255\255\255\255\
\255\255\255\255\072\001\073\001\255\255\075\001\255\255\077\001\
\255\255\255\255\255\255\255\255\255\255\255\255\084\001\085\001\
\086\001\087\001\088\001\089\001\255\255\255\255\255\255\255\255\
\255\255\255\255\096\001\255\255\255\255\099\001\100\001\255\255\
\102\001\103\001\255\255\255\255\255\255\255\255\108\001\255\255\
\110\001\111\001\112\001\000\001\001\001\002\001\255\255\255\255\
\255\255\006\001\007\001\255\255\009\001\255\255\255\255\012\001\
\255\255\255\255\255\255\016\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\027\001\028\001\
\255\255\030\001\031\001\255\255\255\255\255\255\255\255\036\001\
\255\255\255\255\255\255\255\255\255\255\042\001\043\001\044\001\
\045\001\046\001\255\255\255\255\049\001\050\001\051\001\255\255\
\053\001\054\001\255\255\056\001\057\001\255\255\255\255\060\001\
\255\255\062\001\255\255\000\001\065\001\066\001\255\255\255\255\
\255\255\006\001\255\255\072\001\073\001\255\255\075\001\012\001\
\077\001\255\255\255\255\255\255\255\255\255\255\255\255\084\001\
\085\001\086\001\087\001\088\001\089\001\255\255\255\255\028\001\
\255\255\030\001\031\001\096\001\255\255\255\255\099\001\100\001\
\255\255\102\001\103\001\255\255\255\255\255\255\255\255\108\001\
\255\255\255\255\111\001\112\001\049\001\050\001\051\001\255\255\
\053\001\054\001\255\255\056\001\057\001\255\255\255\255\060\001\
\255\255\255\255\255\255\000\001\065\001\066\001\255\255\255\255\
\255\255\006\001\255\255\072\001\255\255\255\255\255\255\012\001\
\077\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\086\001\255\255\255\255\255\255\255\255\255\255\028\001\
\255\255\030\001\031\001\255\255\255\255\255\255\099\001\255\255\
\255\255\255\255\103\001\255\255\255\255\255\255\255\255\108\001\
\255\255\255\255\111\001\112\001\049\001\050\001\051\001\255\255\
\053\001\054\001\255\255\056\001\057\001\255\255\255\255\060\001\
\255\255\255\255\255\255\000\001\065\001\066\001\255\255\255\255\
\255\255\006\001\255\255\072\001\255\255\255\255\255\255\012\001\
\077\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\086\001\255\255\255\255\255\255\255\255\255\255\028\001\
\255\255\030\001\031\001\255\255\255\255\255\255\099\001\255\255\
\255\255\255\255\103\001\255\255\255\255\255\255\255\255\108\001\
\255\255\255\255\111\001\112\001\049\001\050\001\051\001\255\255\
\053\001\054\001\255\255\056\001\057\001\255\255\255\255\060\001\
\255\255\255\255\255\255\255\255\065\001\066\001\255\255\255\255\
\255\255\255\255\255\255\072\001\255\255\255\255\255\255\255\255\
\077\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\086\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\099\001\255\255\
\255\255\255\255\103\001\255\255\255\255\255\255\255\255\108\001\
\255\255\255\255\111\001\112\001\005\001\006\001\007\001\255\255\
\255\255\255\255\011\001\012\001\013\001\014\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\028\001\029\001\030\001\031\001\032\001\
\033\001\034\001\255\255\255\255\255\255\255\255\039\001\255\255\
\041\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\061\001\255\255\255\255\064\001\
\065\001\066\001\255\255\255\255\069\001\070\001\255\255\072\001\
\073\001\255\255\075\001\255\255\077\001\078\001\255\255\080\001\
\255\255\082\001\255\255\255\255\255\255\086\001\087\001\255\255\
\089\001\255\255\091\001\255\255\255\255\005\001\006\001\007\001\
\255\255\098\001\255\255\011\001\012\001\013\001\103\001\255\255\
\255\255\255\255\255\255\108\001\109\001\110\001\111\001\255\255\
\255\255\255\255\255\255\116\001\028\001\029\001\030\001\031\001\
\032\001\033\001\034\001\255\255\255\255\255\255\255\255\039\001\
\255\255\041\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\049\001\050\001\051\001\255\255\053\001\054\001\055\001\
\056\001\057\001\255\255\255\255\060\001\061\001\255\255\255\255\
\064\001\065\001\066\001\255\255\255\255\069\001\070\001\255\255\
\072\001\073\001\255\255\075\001\255\255\077\001\078\001\255\255\
\080\001\255\255\082\001\255\255\255\255\255\255\086\001\087\001\
\255\255\089\001\255\255\255\255\255\255\005\001\006\001\007\001\
\255\255\255\255\098\001\011\001\012\001\255\255\255\255\103\001\
\255\255\255\255\255\255\255\255\108\001\109\001\110\001\111\001\
\255\255\255\255\255\255\255\255\116\001\255\255\030\001\031\001\
\032\001\033\001\034\001\255\255\255\255\255\255\255\255\039\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\049\001\050\001\051\001\255\255\053\001\054\001\055\001\
\056\001\057\001\255\255\255\255\060\001\255\255\255\255\255\255\
\064\001\065\001\066\001\255\255\255\255\255\255\070\001\255\255\
\072\001\073\001\255\255\255\255\255\255\077\001\078\001\255\255\
\080\001\255\255\255\255\255\255\255\255\255\255\086\001\087\001\
\255\255\089\001\255\255\255\255\255\255\255\255\094\001\005\001\
\006\001\007\001\255\255\255\255\010\001\011\001\012\001\103\001\
\255\255\255\255\255\255\255\255\108\001\109\001\255\255\111\001\
\255\255\255\255\255\255\255\255\116\001\255\255\255\255\255\255\
\030\001\031\001\032\001\033\001\034\001\255\255\255\255\255\255\
\255\255\039\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\049\001\050\001\051\001\255\255\053\001\
\054\001\055\001\056\001\057\001\255\255\255\255\060\001\255\255\
\255\255\255\255\064\001\065\001\066\001\255\255\255\255\255\255\
\070\001\255\255\072\001\073\001\255\255\255\255\255\255\077\001\
\078\001\255\255\080\001\255\255\255\255\255\255\255\255\255\255\
\086\001\087\001\255\255\089\001\255\255\255\255\005\001\006\001\
\007\001\255\255\255\255\255\255\011\001\012\001\255\255\255\255\
\255\255\103\001\255\255\255\255\255\255\255\255\108\001\109\001\
\255\255\111\001\255\255\026\001\255\255\255\255\116\001\030\001\
\031\001\032\001\033\001\034\001\255\255\255\255\255\255\255\255\
\039\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\049\001\050\001\051\001\255\255\053\001\054\001\
\055\001\056\001\057\001\255\255\255\255\060\001\255\255\255\255\
\255\255\064\001\065\001\066\001\255\255\255\255\255\255\070\001\
\255\255\072\001\073\001\255\255\255\255\255\255\077\001\078\001\
\255\255\080\001\255\255\255\255\255\255\255\255\255\255\086\001\
\087\001\255\255\089\001\255\255\255\255\005\001\006\001\007\001\
\255\255\255\255\255\255\011\001\012\001\255\255\255\255\255\255\
\103\001\255\255\255\255\255\255\255\255\108\001\109\001\255\255\
\111\001\255\255\026\001\255\255\255\255\116\001\030\001\031\001\
\032\001\033\001\034\001\255\255\255\255\255\255\255\255\039\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\049\001\050\001\051\001\255\255\053\001\054\001\055\001\
\056\001\057\001\255\255\255\255\060\001\255\255\255\255\255\255\
\064\001\065\001\066\001\255\255\255\255\255\255\070\001\255\255\
\072\001\073\001\255\255\255\255\255\255\077\001\078\001\255\255\
\080\001\255\255\255\255\255\255\255\255\255\255\086\001\087\001\
\255\255\089\001\255\255\255\255\005\001\006\001\007\001\255\255\
\255\255\255\255\011\001\012\001\255\255\255\255\255\255\103\001\
\255\255\255\255\255\255\255\255\108\001\109\001\255\255\111\001\
\255\255\255\255\255\255\255\255\116\001\030\001\031\001\032\001\
\033\001\034\001\255\255\255\255\255\255\255\255\039\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\255\255\255\255\255\255\064\001\
\065\001\066\001\255\255\255\255\255\255\070\001\255\255\072\001\
\073\001\255\255\255\255\255\255\077\001\078\001\255\255\080\001\
\255\255\255\255\255\255\255\255\255\255\086\001\087\001\255\255\
\089\001\255\255\255\255\005\001\006\001\007\001\255\255\255\255\
\255\255\011\001\012\001\255\255\255\255\255\255\103\001\255\255\
\255\255\255\255\255\255\108\001\109\001\255\255\111\001\255\255\
\255\255\255\255\255\255\116\001\030\001\031\001\032\001\033\001\
\034\001\255\255\255\255\255\255\255\255\039\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\049\001\
\050\001\051\001\255\255\053\001\054\001\055\001\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\064\001\065\001\
\066\001\255\255\255\255\255\255\070\001\255\255\072\001\073\001\
\255\255\255\255\255\255\077\001\078\001\255\255\080\001\255\255\
\255\255\255\255\255\255\255\255\086\001\087\001\255\255\089\001\
\255\255\255\255\255\255\006\001\255\255\255\255\255\255\255\255\
\255\255\012\001\255\255\014\001\255\255\103\001\017\001\255\255\
\255\255\255\255\108\001\109\001\255\255\111\001\255\255\255\255\
\027\001\255\255\116\001\030\001\031\001\056\001\255\255\058\001\
\059\001\060\001\255\255\062\001\255\255\255\255\065\001\066\001\
\255\255\255\255\255\255\255\255\255\255\255\255\049\001\050\001\
\051\001\052\001\255\255\054\001\255\255\056\001\057\001\255\255\
\083\001\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\091\001\092\001\255\255\255\255\255\255\072\001\006\001\255\255\
\099\001\255\255\077\001\255\255\012\001\255\255\014\001\255\255\
\083\001\017\001\255\255\086\001\111\001\112\001\255\255\255\255\
\091\001\255\255\255\255\027\001\255\255\255\255\030\001\031\001\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\106\001\
\255\255\108\001\255\255\255\255\111\001\112\001\255\255\255\255\
\255\255\049\001\050\001\051\001\052\001\255\255\054\001\255\255\
\056\001\057\001\255\255\255\255\060\001\255\255\255\255\255\255\
\255\255\065\001\066\001\255\255\255\255\255\255\255\255\255\255\
\072\001\006\001\255\255\255\255\255\255\077\001\255\255\012\001\
\255\255\014\001\255\255\083\001\255\255\255\255\086\001\255\255\
\255\255\255\255\255\255\091\001\255\255\255\255\027\001\255\255\
\255\255\030\001\031\001\099\001\255\255\255\255\255\255\103\001\
\255\255\255\255\106\001\255\255\108\001\255\255\255\255\111\001\
\112\001\255\255\255\255\255\255\049\001\050\001\051\001\052\001\
\255\255\054\001\255\255\056\001\057\001\255\255\255\255\060\001\
\255\255\255\255\255\255\255\255\065\001\066\001\255\255\255\255\
\255\255\255\255\255\255\072\001\006\001\255\255\255\255\255\255\
\077\001\255\255\012\001\255\255\014\001\255\255\083\001\255\255\
\255\255\086\001\255\255\255\255\255\255\255\255\091\001\255\255\
\255\255\027\001\255\255\255\255\030\001\031\001\099\001\255\255\
\255\255\255\255\103\001\255\255\255\255\106\001\255\255\108\001\
\255\255\255\255\111\001\112\001\255\255\255\255\255\255\049\001\
\050\001\051\001\052\001\255\255\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\006\001\255\255\072\001\255\255\
\255\255\255\255\012\001\077\001\255\255\255\255\255\255\255\255\
\255\255\083\001\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\091\001\255\255\255\255\030\001\031\001\255\255\255\255\
\255\255\099\001\255\255\255\255\255\255\103\001\255\255\255\255\
\106\001\255\255\108\001\255\255\255\255\111\001\112\001\049\001\
\050\001\051\001\052\001\255\255\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\006\001\255\255\072\001\255\255\
\074\001\255\255\012\001\077\001\255\255\255\255\255\255\255\255\
\255\255\083\001\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\091\001\255\255\255\255\030\001\031\001\255\255\255\255\
\255\255\099\001\255\255\255\255\255\255\103\001\255\255\255\255\
\106\001\255\255\108\001\255\255\255\255\111\001\112\001\049\001\
\050\001\051\001\052\001\255\255\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\006\001\255\255\072\001\255\255\
\074\001\255\255\012\001\077\001\255\255\255\255\255\255\255\255\
\255\255\083\001\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\091\001\255\255\255\255\030\001\031\001\255\255\255\255\
\255\255\099\001\255\255\255\255\255\255\103\001\255\255\255\255\
\106\001\255\255\108\001\255\255\255\255\111\001\112\001\049\001\
\050\001\051\001\052\001\255\255\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\006\001\255\255\072\001\255\255\
\255\255\255\255\012\001\077\001\255\255\255\255\255\255\255\255\
\255\255\083\001\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\091\001\255\255\255\255\030\001\031\001\255\255\255\255\
\255\255\099\001\255\255\255\255\255\255\103\001\255\255\255\255\
\106\001\255\255\108\001\255\255\255\255\111\001\112\001\049\001\
\050\001\051\001\052\001\255\255\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\006\001\255\255\072\001\255\255\
\255\255\255\255\012\001\077\001\255\255\255\255\255\255\255\255\
\255\255\083\001\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\091\001\255\255\255\255\030\001\031\001\255\255\255\255\
\255\255\099\001\255\255\255\255\255\255\103\001\255\255\255\255\
\106\001\255\255\108\001\255\255\255\255\111\001\112\001\049\001\
\050\001\051\001\052\001\255\255\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\006\001\255\255\072\001\255\255\
\255\255\255\255\012\001\077\001\255\255\255\255\255\255\255\255\
\255\255\083\001\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\091\001\028\001\255\255\030\001\031\001\255\255\255\255\
\255\255\099\001\255\255\255\255\255\255\103\001\255\255\255\255\
\106\001\255\255\108\001\255\255\255\255\111\001\112\001\049\001\
\050\001\051\001\255\255\053\001\054\001\255\255\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\255\255\255\255\255\255\072\001\255\255\
\255\255\255\255\006\001\077\001\255\255\255\255\010\001\255\255\
\012\001\255\255\255\255\255\255\086\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\094\001\255\255\255\255\255\255\
\028\001\099\001\030\001\031\001\255\255\103\001\255\255\255\255\
\255\255\255\255\108\001\255\255\255\255\111\001\112\001\255\255\
\255\255\255\255\255\255\255\255\255\255\049\001\050\001\051\001\
\255\255\053\001\054\001\255\255\056\001\057\001\255\255\255\255\
\060\001\255\255\255\255\255\255\255\255\065\001\066\001\255\255\
\255\255\255\255\255\255\255\255\072\001\006\001\255\255\008\001\
\255\255\077\001\255\255\012\001\255\255\255\255\255\255\255\255\
\255\255\255\255\086\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\028\001\255\255\030\001\031\001\099\001\
\255\255\255\255\255\255\103\001\255\255\255\255\255\255\255\255\
\108\001\255\255\255\255\111\001\112\001\255\255\255\255\255\255\
\049\001\050\001\051\001\255\255\053\001\054\001\255\255\056\001\
\057\001\255\255\255\255\060\001\255\255\255\255\255\255\255\255\
\065\001\066\001\255\255\255\255\255\255\006\001\255\255\072\001\
\255\255\255\255\255\255\012\001\077\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\086\001\255\255\255\255\
\255\255\255\255\255\255\028\001\255\255\030\001\031\001\255\255\
\255\255\255\255\099\001\255\255\255\255\255\255\103\001\255\255\
\255\255\255\255\255\255\108\001\255\255\255\255\111\001\112\001\
\049\001\050\001\051\001\255\255\053\001\054\001\255\255\056\001\
\057\001\255\255\255\255\060\001\255\255\255\255\255\255\255\255\
\065\001\066\001\255\255\255\255\255\255\255\255\255\255\072\001\
\255\255\255\255\255\255\006\001\077\001\255\255\255\255\255\255\
\255\255\012\001\255\255\255\255\255\255\086\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\095\001\255\255\
\255\255\028\001\099\001\030\001\031\001\255\255\103\001\255\255\
\255\255\255\255\255\255\108\001\255\255\255\255\111\001\112\001\
\255\255\255\255\255\255\255\255\255\255\255\255\049\001\050\001\
\051\001\255\255\053\001\054\001\255\255\056\001\057\001\255\255\
\255\255\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\255\255\255\255\255\255\006\001\255\255\072\001\255\255\255\255\
\255\255\012\001\077\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\086\001\255\255\255\255\255\255\255\255\
\255\255\028\001\255\255\030\001\031\001\255\255\255\255\255\255\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\255\255\
\255\255\108\001\255\255\255\255\111\001\112\001\049\001\050\001\
\051\001\255\255\053\001\054\001\255\255\056\001\057\001\255\255\
\255\255\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\255\255\255\255\255\255\006\001\255\255\072\001\255\255\255\255\
\255\255\012\001\077\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\086\001\255\255\255\255\255\255\255\255\
\255\255\028\001\255\255\030\001\031\001\255\255\255\255\255\255\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\255\255\
\255\255\108\001\255\255\255\255\111\001\112\001\049\001\050\001\
\051\001\255\255\053\001\054\001\255\255\056\001\057\001\255\255\
\255\255\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\255\255\255\255\255\255\006\001\255\255\072\001\255\255\255\255\
\255\255\012\001\077\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\086\001\255\255\255\255\255\255\255\255\
\255\255\028\001\255\255\030\001\031\001\255\255\255\255\255\255\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\255\255\
\255\255\108\001\255\255\255\255\111\001\112\001\049\001\050\001\
\051\001\255\255\053\001\054\001\255\255\056\001\057\001\255\255\
\255\255\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\255\255\255\255\255\255\006\001\255\255\072\001\255\255\255\255\
\255\255\012\001\077\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\086\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\030\001\031\001\255\255\255\255\255\255\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\255\255\
\255\255\108\001\255\255\255\255\111\001\112\001\049\001\050\001\
\051\001\255\255\255\255\054\001\255\255\056\001\057\001\255\255\
\255\255\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\255\255\255\255\255\255\255\255\255\255\072\001\006\001\007\001\
\255\255\255\255\077\001\011\001\012\001\255\255\255\255\255\255\
\255\255\255\255\255\255\086\001\255\255\255\255\022\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\030\001\031\001\
\099\001\255\255\255\255\255\255\103\001\255\255\255\255\255\255\
\255\255\108\001\255\255\255\255\111\001\112\001\255\255\255\255\
\255\255\049\001\050\001\051\001\052\001\255\255\054\001\055\001\
\056\001\057\001\255\255\255\255\060\001\255\255\255\255\255\255\
\255\255\065\001\066\001\255\255\255\255\006\001\007\001\255\255\
\255\255\255\255\011\001\012\001\255\255\077\001\078\001\255\255\
\255\255\255\255\255\255\083\001\255\255\255\255\255\255\255\255\
\255\255\089\001\255\255\091\001\255\255\030\001\031\001\255\255\
\255\255\255\255\255\255\099\001\100\001\255\255\255\255\103\001\
\255\255\255\255\106\001\255\255\108\001\255\255\255\255\111\001\
\049\001\050\001\051\001\052\001\255\255\054\001\055\001\056\001\
\057\001\255\255\255\255\060\001\255\255\255\255\255\255\255\255\
\065\001\066\001\255\255\255\255\006\001\007\001\255\255\255\255\
\255\255\011\001\012\001\255\255\077\001\078\001\255\255\255\255\
\255\255\255\255\083\001\255\255\255\255\255\255\255\255\255\255\
\089\001\255\255\091\001\255\255\030\001\031\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\103\001\255\255\
\255\255\106\001\255\255\108\001\255\255\255\255\111\001\049\001\
\050\001\051\001\255\255\255\255\054\001\055\001\056\001\057\001\
\255\255\255\255\060\001\255\255\255\255\255\255\255\255\065\001\
\066\001\255\255\255\255\006\001\007\001\255\255\255\255\255\255\
\011\001\012\001\255\255\077\001\078\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\089\001\
\255\255\255\255\255\255\030\001\031\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\103\001\255\255\255\255\
\255\255\255\255\108\001\255\255\255\255\111\001\049\001\050\001\
\051\001\255\255\255\255\054\001\055\001\056\001\057\001\255\255\
\255\255\060\001\255\255\255\255\255\255\255\255\065\001\066\001\
\255\255\255\255\006\001\007\001\255\255\255\255\255\255\011\001\
\012\001\255\255\077\001\078\001\255\255\255\255\255\255\255\255\
\255\255\255\255\008\001\255\255\255\255\255\255\089\001\255\255\
\255\255\015\001\030\001\031\001\056\001\255\255\058\001\059\001\
\060\001\023\001\062\001\255\255\103\001\065\001\066\001\255\255\
\030\001\108\001\255\255\255\255\111\001\049\001\050\001\051\001\
\255\255\255\255\054\001\055\001\056\001\057\001\255\255\083\001\
\060\001\255\255\255\255\255\255\255\255\065\001\066\001\091\001\
\092\001\255\255\056\001\255\255\058\001\059\001\060\001\099\001\
\062\001\077\001\078\001\065\001\066\001\255\255\255\255\255\255\
\255\255\008\001\110\001\111\001\112\001\089\001\255\255\255\255\
\015\001\255\255\255\255\255\255\255\255\083\001\255\255\255\255\
\255\255\255\255\255\255\103\001\090\001\091\001\092\001\030\001\
\108\001\255\255\255\255\111\001\255\255\099\001\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\108\001\255\255\
\255\255\111\001\112\001\255\255\255\255\255\255\255\255\255\255\
\255\255\056\001\255\255\058\001\059\001\060\001\255\255\062\001\
\255\255\255\255\065\001\066\001\255\255\255\255\255\255\255\255\
\000\001\001\001\002\001\255\255\255\255\255\255\255\255\255\255\
\255\255\009\001\255\255\255\255\083\001\255\255\014\001\015\001\
\016\001\017\001\018\001\255\255\091\001\092\001\255\255\255\255\
\255\255\255\255\255\255\027\001\099\001\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\036\001\108\001\255\255\255\255\
\111\001\112\001\042\001\043\001\044\001\045\001\046\001\000\001\
\001\001\002\001\255\255\255\255\255\255\255\255\007\001\255\255\
\009\001\255\255\255\255\255\255\255\255\255\255\062\001\016\001\
\255\255\255\255\255\255\067\001\255\255\255\255\255\255\255\255\
\072\001\073\001\027\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\036\001\084\001\085\001\086\001\087\001\
\088\001\042\001\043\001\044\001\045\001\046\001\255\255\255\255\
\096\001\255\255\255\255\255\255\255\255\255\255\102\001\255\255\
\255\255\255\255\255\255\255\255\255\255\062\001\255\255\255\255\
\255\255\001\001\002\001\255\255\255\255\255\255\255\255\072\001\
\073\001\009\001\075\001\255\255\255\255\255\255\255\255\015\001\
\016\001\255\255\018\001\084\001\085\001\086\001\087\001\088\001\
\089\001\255\255\255\255\027\001\255\255\255\255\255\255\255\255\
\255\255\001\001\002\001\100\001\036\001\102\001\255\255\255\255\
\255\255\009\001\042\001\043\001\044\001\045\001\046\001\015\001\
\016\001\255\255\018\001\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\027\001\255\255\255\255\062\001\255\255\
\255\255\255\255\255\255\067\001\036\001\255\255\255\255\255\255\
\072\001\073\001\042\001\043\001\044\001\045\001\046\001\255\255\
\255\255\255\255\255\255\255\255\084\001\085\001\086\001\087\001\
\088\001\255\255\255\255\255\255\255\255\255\255\062\001\001\001\
\002\001\097\001\255\255\067\001\255\255\255\255\102\001\009\001\
\072\001\073\001\255\255\255\255\255\255\015\001\016\001\255\255\
\018\001\255\255\255\255\255\255\084\001\085\001\086\001\087\001\
\088\001\027\001\255\255\255\255\255\255\093\001\255\255\001\001\
\002\001\255\255\036\001\255\255\255\255\255\255\102\001\009\001\
\042\001\043\001\044\001\045\001\046\001\015\001\016\001\255\255\
\018\001\255\255\255\255\255\255\255\255\255\255\255\255\025\001\
\255\255\027\001\255\255\255\255\062\001\255\255\255\255\255\255\
\255\255\067\001\036\001\255\255\255\255\255\255\072\001\073\001\
\042\001\043\001\044\001\045\001\046\001\255\255\255\255\255\255\
\255\255\255\255\084\001\085\001\086\001\087\001\088\001\255\255\
\255\255\255\255\255\255\093\001\062\001\001\001\002\001\255\255\
\255\255\067\001\255\255\255\255\102\001\009\001\072\001\073\001\
\255\255\255\255\255\255\015\001\016\001\255\255\018\001\255\255\
\255\255\255\255\084\001\085\001\086\001\087\001\088\001\027\001\
\255\255\255\255\255\255\255\255\255\255\001\001\002\001\255\255\
\036\001\255\255\255\255\255\255\102\001\009\001\042\001\043\001\
\044\001\045\001\046\001\015\001\016\001\255\255\018\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\027\001\
\255\255\255\255\062\001\255\255\255\255\255\255\255\255\067\001\
\036\001\255\255\255\255\255\255\072\001\073\001\042\001\043\001\
\044\001\045\001\046\001\255\255\255\255\255\255\255\255\255\255\
\084\001\085\001\086\001\087\001\088\001\255\255\255\255\255\255\
\255\255\255\255\062\001\001\001\002\001\255\255\255\255\067\001\
\255\255\255\255\102\001\009\001\072\001\073\001\255\255\255\255\
\255\255\015\001\016\001\255\255\255\255\255\255\255\255\255\255\
\084\001\085\001\086\001\087\001\088\001\027\001\255\255\255\255\
\255\255\255\255\255\255\001\001\002\001\255\255\036\001\255\255\
\255\255\255\255\102\001\009\001\042\001\043\001\044\001\045\001\
\046\001\015\001\255\255\255\255\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\255\255\255\255\027\001\255\255\255\255\
\062\001\255\255\255\255\255\255\255\255\067\001\036\001\255\255\
\255\255\255\255\072\001\073\001\042\001\043\001\044\001\045\001\
\046\001\255\255\255\255\255\255\255\255\255\255\084\001\085\001\
\086\001\087\001\088\001\255\255\255\255\255\255\255\255\093\001\
\062\001\001\001\002\001\255\255\255\255\067\001\255\255\255\255\
\102\001\009\001\072\001\073\001\255\255\255\255\255\255\015\001\
\255\255\255\255\255\255\255\255\255\255\255\255\084\001\085\001\
\086\001\087\001\088\001\027\001\255\255\255\255\255\255\255\255\
\255\255\255\255\096\001\255\255\036\001\255\255\255\255\255\255\
\102\001\255\255\042\001\043\001\044\001\045\001\046\001\255\255\
\255\255\255\255\255\255\255\255\255\255\255\255\001\001\002\001\
\255\255\255\255\255\255\255\255\255\255\255\255\062\001\255\255\
\255\255\255\255\255\255\067\001\015\001\255\255\255\255\255\255\
\072\001\073\001\255\255\255\255\255\255\255\255\255\255\255\255\
\027\001\255\255\255\255\255\255\084\001\085\001\086\001\087\001\
\088\001\036\001\255\255\255\255\255\255\255\255\255\255\042\001\
\043\001\044\001\045\001\046\001\255\255\255\255\102\001\255\255\
\255\255\255\255\255\255\255\255\056\001\255\255\058\001\059\001\
\060\001\255\255\062\001\062\001\255\255\065\001\066\001\255\255\
\067\001\255\255\255\255\255\255\255\255\072\001\073\001\075\001\
\255\255\255\255\255\255\255\255\255\255\255\255\255\255\083\001\
\255\255\255\255\085\001\086\001\087\001\088\001\255\255\091\001\
\092\001\255\255\255\255\255\255\255\255\255\255\255\255\099\001\
\255\255\255\255\255\255\102\001\255\255\255\255\255\255\255\255\
\255\255\255\255\255\255\111\001\112\001"

let yynames_const = "\
  AMPERAMPER\000\
  AMPERSAND\000\
  AND\000\
  AS\000\
  ASSERT\000\
  BACKQUOTE\000\
  BANG\000\
  BAR\000\
  BARBAR\000\
  BARRBRACKET\000\
  BEGIN\000\
  CLASS\000\
  COLON\000\
  COLONCOLON\000\
  COLONEQUAL\000\
  COLONGREATER\000\
  COMMA\000\
  CONSTRAINT\000\
  DO\000\
  DONE\000\
  DOT\000\
  DOTDOT\000\
  DOWNTO\000\
  ELSE\000\
  END\000\
  EOF\000\
  EQUAL\000\
  EXCEPTION\000\
  EXTERNAL\000\
  FALSE\000\
  FOR\000\
  FUN\000\
  FUNCTION\000\
  FUNCTOR\000\
  GREATER\000\
  GREATERRBRACE\000\
  GREATERRBRACKET\000\
  IF\000\
  IN\000\
  INCLUDE\000\
  INHERIT\000\
  INITIALIZER\000\
  LAZY\000\
  LBRACE\000\
  LBRACELESS\000\
  LBRACKET\000\
  LBRACKETBAR\000\
  LBRACKETLESS\000\
  LBRACKETGREATER\000\
  LBRACKETPERCENT\000\
  LBRACKETPERCENTPERCENT\000\
  LESS\000\
  LESSMINUS\000\
  LET\000\
  LPAREN\000\
  LBRACKETAT\000\
  LBRACKETATAT\000\
  LBRACKETATATAT\000\
  MATCH\000\
  METHOD\000\
  MINUS\000\
  MINUSDOT\000\
  MINUSGREATER\000\
  MODULE\000\
  MUTABLE\000\
  NEW\000\
  NONREC\000\
  OBJECT\000\
  OF\000\
  OPEN\000\
  OR\000\
  PERCENT\000\
  PLUS\000\
  PLUSDOT\000\
  PLUSEQ\000\
  PRIVATE\000\
  QUESTION\000\
  QUOTE\000\
  RBRACE\000\
  RBRACKET\000\
  REC\000\
  RPAREN\000\
  SEMI\000\
  SEMISEMI\000\
  SHARP\000\
  SIG\000\
  STAR\000\
  STRUCT\000\
  THEN\000\
  TILDE\000\
  TO\000\
  TRUE\000\
  TRY\000\
  TYPE\000\
  UNDERSCORE\000\
  VAL\000\
  VIRTUAL\000\
  WHEN\000\
  WHILE\000\
  WITH\000\
  EOL\000\
  "

let yynames_block = "\
  CHAR\000\
  FLOAT\000\
  INFIXOP0\000\
  INFIXOP1\000\
  INFIXOP2\000\
  INFIXOP3\000\
  INFIXOP4\000\
  INT\000\
  INT32\000\
  INT64\000\
  LABEL\000\
  LIDENT\000\
  NATIVEINT\000\
  OPTLABEL\000\
  PREFIXOP\000\
  SHARPOP\000\
  STRING\000\
  UIDENT\000\
  COMMENT\000\
  DOCSTRING\000\
  "

let yyact = [|
  (fun _ -> failwith "parser")
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'structure) in
    Obj.repr(
# 614 "parsing/parser.mly"
                                         ( extra_str 1 _1 )
# 6402 "parsing/parser.ml"
               : Parsetree.structure))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'signature) in
    Obj.repr(
# 617 "parsing/parser.mly"
                                         ( extra_sig 1 _1 )
# 6409 "parsing/parser.ml"
               : Parsetree.signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'top_structure) in
    Obj.repr(
# 620 "parsing/parser.mly"
                                         ( Ptop_def (extra_str 1 _1) )
# 6416 "parsing/parser.ml"
               : Parsetree.toplevel_phrase))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'toplevel_directive) in
    Obj.repr(
# 621 "parsing/parser.mly"
                                         ( _1 )
# 6423 "parsing/parser.ml"
               : Parsetree.toplevel_phrase))
; (fun __caml_parser_env ->
    Obj.repr(
# 622 "parsing/parser.mly"
                                         ( raise End_of_file )
# 6429 "parsing/parser.ml"
               : Parsetree.toplevel_phrase))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 626 "parsing/parser.mly"
      ( (text_str 1) @ [mkstrexp _1 _2] )
# 6437 "parsing/parser.ml"
               : 'top_structure))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'top_structure_tail) in
    Obj.repr(
# 628 "parsing/parser.mly"
      ( _1 )
# 6444 "parsing/parser.ml"
               : 'top_structure))
; (fun __caml_parser_env ->
    Obj.repr(
# 631 "parsing/parser.mly"
                                         ( [] )
# 6450 "parsing/parser.ml"
               : 'top_structure_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'structure_item) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'top_structure_tail) in
    Obj.repr(
# 632 "parsing/parser.mly"
                                         ( (text_str 1) @ _1 :: _2 )
# 6458 "parsing/parser.ml"
               : 'top_structure_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_body) in
    Obj.repr(
# 635 "parsing/parser.mly"
                                         ( extra_def 1 _1 )
# 6465 "parsing/parser.ml"
               : Parsetree.toplevel_phrase list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 638 "parsing/parser.mly"
                                         ( _1 )
# 6472 "parsing/parser.ml"
               : 'use_file_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'post_item_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 640 "parsing/parser.mly"
      ( (text_def 1) @ Ptop_def[mkstrexp _1 _2] :: _3 )
# 6481 "parsing/parser.ml"
               : 'use_file_body))
; (fun __caml_parser_env ->
    Obj.repr(
# 644 "parsing/parser.mly"
      ( [] )
# 6487 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    Obj.repr(
# 646 "parsing/parser.mly"
      ( text_def 1 )
# 6493 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'post_item_attributes) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 648 "parsing/parser.mly"
      (  mark_rhs_docs 2 3;
        (text_def 1) @ (text_def 2) @ Ptop_def[mkstrexp _2 _3] :: _4 )
# 6503 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'structure_item) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 651 "parsing/parser.mly"
      ( (text_def 1) @ (text_def 2) @ Ptop_def[_2] :: _3 )
# 6511 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'toplevel_directive) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 653 "parsing/parser.mly"
      (  mark_rhs_docs 2 3;
        (text_def 1) @ (text_def 2) @ _2 :: _3 )
# 6520 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'structure_item) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 656 "parsing/parser.mly"
      ( (text_def 1) @ Ptop_def[_1] :: _2 )
# 6528 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'toplevel_directive) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'use_file_tail) in
    Obj.repr(
# 658 "parsing/parser.mly"
      ( mark_rhs_docs 1 1;
        (text_def 1) @ _1 :: _2 )
# 6537 "parsing/parser.ml"
               : 'use_file_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    Obj.repr(
# 662 "parsing/parser.mly"
                  ( _1 )
# 6544 "parsing/parser.ml"
               : Parsetree.core_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 665 "parsing/parser.mly"
                 ( _1 )
# 6551 "parsing/parser.ml"
               : Parsetree.expression))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    Obj.repr(
# 668 "parsing/parser.mly"
                ( _1 )
# 6558 "parsing/parser.ml"
               : Parsetree.pattern))
; (fun __caml_parser_env ->
    Obj.repr(
# 675 "parsing/parser.mly"
      ( mkrhs "*" 2, None )
# 6564 "parsing/parser.ml"
               : 'functor_arg))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'functor_arg_name) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    Obj.repr(
# 677 "parsing/parser.mly"
      ( mkrhs _2 2, Some _4 )
# 6572 "parsing/parser.ml"
               : 'functor_arg))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 681 "parsing/parser.mly"
               ( _1 )
# 6579 "parsing/parser.ml"
               : 'functor_arg_name))
; (fun __caml_parser_env ->
    Obj.repr(
# 682 "parsing/parser.mly"
               ( "_" )
# 6585 "parsing/parser.ml"
               : 'functor_arg_name))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'functor_args) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'functor_arg) in
    Obj.repr(
# 687 "parsing/parser.mly"
      ( _2 :: _1 )
# 6593 "parsing/parser.ml"
               : 'functor_args))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'functor_arg) in
    Obj.repr(
# 689 "parsing/parser.mly"
      ( [ _1 ] )
# 6600 "parsing/parser.ml"
               : 'functor_args))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mod_longident) in
    Obj.repr(
# 694 "parsing/parser.mly"
      ( mkmod(Pmod_ident (mkrhs _1 1)) )
# 6607 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'structure) in
    Obj.repr(
# 696 "parsing/parser.mly"
      ( mkmod(Pmod_structure(extra_str 2 _2)) )
# 6614 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'structure) in
    Obj.repr(
# 698 "parsing/parser.mly"
      ( unclosed "struct" 1 "end" 3 )
# 6621 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'functor_args) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in
    Obj.repr(
# 700 "parsing/parser.mly"
      ( List.fold_left (fun acc (n, t) -> mkmod(Pmod_functor(n, t, acc)))
                       _4 _2 )
# 6630 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    Obj.repr(
# 703 "parsing/parser.mly"
      ( mkmod(Pmod_apply(_1, _3)) )
# 6638 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'module_expr) in
    Obj.repr(
# 705 "parsing/parser.mly"
      ( mkmod(Pmod_apply(_1, mkmod (Pmod_structure []))) )
# 6645 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    Obj.repr(
# 707 "parsing/parser.mly"
      ( unclosed "(" 2 ")" 4 )
# 6653 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    Obj.repr(
# 709 "parsing/parser.mly"
      ( mkmod(Pmod_constraint(_2, _4)) )
# 6661 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    Obj.repr(
# 711 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 5 )
# 6669 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    Obj.repr(
# 713 "parsing/parser.mly"
      ( _2 )
# 6676 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    Obj.repr(
# 715 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 3 )
# 6683 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
    Obj.repr(
# 717 "parsing/parser.mly"
      ( mkmod(Pmod_unpack _3) )
# 6690 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 719 "parsing/parser.mly"
      ( mkmod(Pmod_unpack(
              ghexp(Pexp_constraint(_3, ghtyp(Ptyp_package _5))))) )
# 6699 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 5 : 'expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 3 : 'package_type) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 722 "parsing/parser.mly"
      ( mkmod(Pmod_unpack(
              ghexp(Pexp_coerce(_3, Some(ghtyp(Ptyp_package _5)),
                                    ghtyp(Ptyp_package _7))))) )
# 6710 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 726 "parsing/parser.mly"
      ( mkmod(Pmod_unpack(
              ghexp(Pexp_coerce(_3, None, ghtyp(Ptyp_package _5))))) )
# 6719 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    Obj.repr(
# 729 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 5 )
# 6726 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    Obj.repr(
# 731 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 5 )
# 6733 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
    Obj.repr(
# 733 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 4 )
# 6740 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 735 "parsing/parser.mly"
      ( Mod.attr _1 _2 )
# 6748 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 737 "parsing/parser.mly"
      ( mkmod(Pmod_extension _1) )
# 6755 "parsing/parser.ml"
               : 'module_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'post_item_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'structure_tail) in
    Obj.repr(
# 742 "parsing/parser.mly"
      ( mark_rhs_docs 1 2;
        (text_str 1) @ mkstrexp _1 _2 :: _3 )
# 6765 "parsing/parser.ml"
               : 'structure))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'structure_tail) in
    Obj.repr(
# 744 "parsing/parser.mly"
                   ( _1 )
# 6772 "parsing/parser.ml"
               : 'structure))
; (fun __caml_parser_env ->
    Obj.repr(
# 747 "parsing/parser.mly"
                         ( [] )
# 6778 "parsing/parser.ml"
               : 'structure_tail))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'structure) in
    Obj.repr(
# 748 "parsing/parser.mly"
                         ( (text_str 1) @ _2 )
# 6785 "parsing/parser.ml"
               : 'structure_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'structure_item) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'structure_tail) in
    Obj.repr(
# 749 "parsing/parser.mly"
                                  ( (text_str 1) @ _1 :: _2 )
# 6793 "parsing/parser.ml"
               : 'structure_tail))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'let_bindings) in
    Obj.repr(
# 753 "parsing/parser.mly"
      ( val_of_let_bindings _1 )
# 6800 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'primitive_declaration) in
    Obj.repr(
# 755 "parsing/parser.mly"
      ( mkstr (Pstr_primitive _1) )
# 6807 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_declarations) in
    Obj.repr(
# 757 "parsing/parser.mly"
      ( mkstr(Pstr_type (List.rev _1)) )
# 6814 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'str_type_extension) in
    Obj.repr(
# 759 "parsing/parser.mly"
      ( mkstr(Pstr_typext _1) )
# 6821 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'str_exception_declaration) in
    Obj.repr(
# 761 "parsing/parser.mly"
      ( mkstr(Pstr_exception _1) )
# 6828 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_binding) in
    Obj.repr(
# 763 "parsing/parser.mly"
      ( mkstr(Pstr_module _1) )
# 6835 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_bindings) in
    Obj.repr(
# 765 "parsing/parser.mly"
      ( mkstr(Pstr_recmodule(List.rev _1)) )
# 6842 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_type_declaration) in
    Obj.repr(
# 767 "parsing/parser.mly"
      ( mkstr(Pstr_modtype _1) )
# 6849 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'open_statement) in
    Obj.repr(
# 768 "parsing/parser.mly"
                   ( mkstr(Pstr_open _1) )
# 6856 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_declarations) in
    Obj.repr(
# 770 "parsing/parser.mly"
      ( mkstr(Pstr_class (List.rev _1)) )
# 6863 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_type_declarations) in
    Obj.repr(
# 772 "parsing/parser.mly"
      ( mkstr(Pstr_class_type (List.rev _1)) )
# 6870 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'str_include_statement) in
    Obj.repr(
# 774 "parsing/parser.mly"
      ( mkstr(Pstr_include _1) )
# 6877 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 776 "parsing/parser.mly"
      ( mkstr(Pstr_extension (_1, (add_docs_attrs (symbol_docs ()) _2))) )
# 6885 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in
    Obj.repr(
# 778 "parsing/parser.mly"
      ( mark_symbol_docs ();
        mkstr(Pstr_attribute _1) )
# 6893 "parsing/parser.ml"
               : 'structure_item))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 783 "parsing/parser.mly"
      ( Incl.mk _2 ~attrs:_3
                ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 6902 "parsing/parser.ml"
               : 'str_include_statement))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in
    Obj.repr(
# 788 "parsing/parser.mly"
      ( _2 )
# 6909 "parsing/parser.ml"
               : 'module_binding_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in
    Obj.repr(
# 790 "parsing/parser.mly"
      ( mkmod(Pmod_constraint(_4, _2)) )
# 6917 "parsing/parser.ml"
               : 'module_binding_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'functor_arg) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_binding_body) in
    Obj.repr(
# 792 "parsing/parser.mly"
      ( mkmod(Pmod_functor(fst _1, snd _1, _2)) )
# 6925 "parsing/parser.ml"
               : 'module_binding_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_binding_body) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 796 "parsing/parser.mly"
      ( Mb.mk (mkrhs _2 2) _3 ~attrs:_4
              ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 6935 "parsing/parser.ml"
               : 'module_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_binding) in
    Obj.repr(
# 800 "parsing/parser.mly"
                                                  ( [_1] )
# 6942 "parsing/parser.ml"
               : 'rec_module_bindings))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rec_module_bindings) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_module_binding) in
    Obj.repr(
# 801 "parsing/parser.mly"
                                                  ( _2 :: _1 )
# 6950 "parsing/parser.ml"
               : 'rec_module_bindings))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_binding_body) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 805 "parsing/parser.mly"
      ( Mb.mk (mkrhs _3 3) _4 ~attrs:_5
              ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 6960 "parsing/parser.ml"
               : 'rec_module_binding))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_binding_body) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 810 "parsing/parser.mly"
      ( Mb.mk (mkrhs _2 2) _3 ~attrs:_4 ~loc:(symbol_rloc ())
               ~text:(symbol_text ()) ~docs:(symbol_docs ()) )
# 6970 "parsing/parser.ml"
               : 'and_module_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mty_longident) in
    Obj.repr(
# 818 "parsing/parser.mly"
      ( mkmty(Pmty_ident (mkrhs _1 1)) )
# 6977 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'signature) in
    Obj.repr(
# 820 "parsing/parser.mly"
      ( mkmty(Pmty_signature (extra_sig 2 _2)) )
# 6984 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'signature) in
    Obj.repr(
# 822 "parsing/parser.mly"
      ( unclosed "sig" 1 "end" 3 )
# 6991 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'functor_args) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in
    Obj.repr(
# 825 "parsing/parser.mly"
      ( List.fold_left (fun acc (n, t) -> mkmty(Pmty_functor(n, t, acc)))
                       _4 _2 )
# 7000 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'with_constraints) in
    Obj.repr(
# 828 "parsing/parser.mly"
      ( mkmty(Pmty_with(_1, List.rev _3)) )
# 7008 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'module_expr) in
    Obj.repr(
# 830 "parsing/parser.mly"
      ( mkmty(Pmty_typeof _4) )
# 7015 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    Obj.repr(
# 834 "parsing/parser.mly"
      ( _2 )
# 7022 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    Obj.repr(
# 836 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 3 )
# 7029 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 838 "parsing/parser.mly"
      ( mkmty(Pmty_extension _1) )
# 7036 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 840 "parsing/parser.mly"
      ( Mty.attr _1 _2 )
# 7044 "parsing/parser.ml"
               : 'module_type))
; (fun __caml_parser_env ->
    Obj.repr(
# 843 "parsing/parser.mly"
                         ( [] )
# 7050 "parsing/parser.ml"
               : 'signature))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'signature) in
    Obj.repr(
# 844 "parsing/parser.mly"
                         ( (text_sig 1) @ _2 )
# 7057 "parsing/parser.ml"
               : 'signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'signature_item) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'signature) in
    Obj.repr(
# 845 "parsing/parser.mly"
                             ( (text_sig 1) @ _1 :: _2 )
# 7065 "parsing/parser.ml"
               : 'signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'value_description) in
    Obj.repr(
# 849 "parsing/parser.mly"
      ( mksig(Psig_value _1) )
# 7072 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'primitive_declaration) in
    Obj.repr(
# 851 "parsing/parser.mly"
      ( mksig(Psig_value _1) )
# 7079 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_declarations) in
    Obj.repr(
# 853 "parsing/parser.mly"
      ( mksig(Psig_type (List.rev _1)) )
# 7086 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_type_extension) in
    Obj.repr(
# 855 "parsing/parser.mly"
      ( mksig(Psig_typext _1) )
# 7093 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_exception_declaration) in
    Obj.repr(
# 857 "parsing/parser.mly"
      ( mksig(Psig_exception _1) )
# 7100 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_declaration) in
    Obj.repr(
# 859 "parsing/parser.mly"
      ( mksig(Psig_module _1) )
# 7107 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_alias) in
    Obj.repr(
# 861 "parsing/parser.mly"
      ( mksig(Psig_module _1) )
# 7114 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_declarations) in
    Obj.repr(
# 863 "parsing/parser.mly"
      ( mksig(Psig_recmodule (List.rev _1)) )
# 7121 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'module_type_declaration) in
    Obj.repr(
# 865 "parsing/parser.mly"
      ( mksig(Psig_modtype _1) )
# 7128 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'open_statement) in
    Obj.repr(
# 867 "parsing/parser.mly"
      ( mksig(Psig_open _1) )
# 7135 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_include_statement) in
    Obj.repr(
# 869 "parsing/parser.mly"
      ( mksig(Psig_include _1) )
# 7142 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_descriptions) in
    Obj.repr(
# 871 "parsing/parser.mly"
      ( mksig(Psig_class (List.rev _1)) )
# 7149 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_type_declarations) in
    Obj.repr(
# 873 "parsing/parser.mly"
      ( mksig(Psig_class_type (List.rev _1)) )
# 7156 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 875 "parsing/parser.mly"
      ( mksig(Psig_extension (_1, (add_docs_attrs (symbol_docs ()) _2))) )
# 7164 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in
    Obj.repr(
# 877 "parsing/parser.mly"
      ( mark_symbol_docs ();
        mksig(Psig_attribute _1) )
# 7172 "parsing/parser.ml"
               : 'signature_item))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'override_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 882 "parsing/parser.mly"
      ( Opn.mk (mkrhs _3 3) ~override:_2 ~attrs:_4
          ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 7182 "parsing/parser.ml"
               : 'open_statement))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 887 "parsing/parser.mly"
      ( Incl.mk _2 ~attrs:_3
                ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 7191 "parsing/parser.ml"
               : 'sig_include_statement))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in
    Obj.repr(
# 892 "parsing/parser.mly"
      ( _2 )
# 7198 "parsing/parser.ml"
               : 'module_declaration_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'module_type) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'module_declaration_body) in
    Obj.repr(
# 894 "parsing/parser.mly"
      ( mkmty(Pmty_functor(mkrhs _2 2, Some _4, _6)) )
# 7207 "parsing/parser.ml"
               : 'module_declaration_body))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'module_declaration_body) in
    Obj.repr(
# 896 "parsing/parser.mly"
      ( mkmty(Pmty_functor(mkrhs "*" 1, None, _3)) )
# 7214 "parsing/parser.ml"
               : 'module_declaration_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_declaration_body) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 900 "parsing/parser.mly"
      ( Md.mk (mkrhs _2 2) _3 ~attrs:_4
          ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 7224 "parsing/parser.ml"
               : 'module_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'mod_longident) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 905 "parsing/parser.mly"
      ( Md.mk (mkrhs _2 2)
          (Mty.alias ~loc:(rhs_loc 4) (mkrhs _4 4)) ~attrs:_5
             ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 7235 "parsing/parser.ml"
               : 'module_alias))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'rec_module_declaration) in
    Obj.repr(
# 910 "parsing/parser.mly"
                                                    ( [_1] )
# 7242 "parsing/parser.ml"
               : 'rec_module_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'rec_module_declarations) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_module_declaration) in
    Obj.repr(
# 911 "parsing/parser.mly"
                                                    ( _2 :: _1 )
# 7250 "parsing/parser.ml"
               : 'rec_module_declarations))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 915 "parsing/parser.mly"
      ( Md.mk (mkrhs _3 3) _5 ~attrs:_6
              ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 7260 "parsing/parser.ml"
               : 'rec_module_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 920 "parsing/parser.mly"
      ( Md.mk (mkrhs _2 2) _4 ~attrs:_5 ~loc:(symbol_rloc())
              ~text:(symbol_text()) ~docs:(symbol_docs()) )
# 7270 "parsing/parser.ml"
               : 'and_module_declaration))
; (fun __caml_parser_env ->
    Obj.repr(
# 924 "parsing/parser.mly"
                              ( None )
# 7276 "parsing/parser.ml"
               : 'module_type_declaration_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'module_type) in
    Obj.repr(
# 925 "parsing/parser.mly"
                              ( Some _2 )
# 7283 "parsing/parser.ml"
               : 'module_type_declaration_body))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'ident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'module_type_declaration_body) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 929 "parsing/parser.mly"
      ( Mtd.mk (mkrhs _3 3) ?typ:_4 ~attrs:_5
          ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 7293 "parsing/parser.ml"
               : 'module_type_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_declaration) in
    Obj.repr(
# 935 "parsing/parser.mly"
                                                ( [_1] )
# 7300 "parsing/parser.ml"
               : 'class_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_declarations) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_class_declaration) in
    Obj.repr(
# 936 "parsing/parser.mly"
                                                ( _2 :: _1 )
# 7308 "parsing/parser.ml"
               : 'class_declarations))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'virtual_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'class_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'class_fun_binding) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 941 "parsing/parser.mly"
      ( Ci.mk (mkrhs _4 4) _5 ~virt:_2 ~params:_3 ~attrs:_6
              ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 7320 "parsing/parser.ml"
               : 'class_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'virtual_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'class_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'class_fun_binding) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 947 "parsing/parser.mly"
      ( Ci.mk (mkrhs _4 4) _5 ~virt:_2 ~params:_3
         ~attrs:_6 ~loc:(symbol_rloc ())
         ~text:(symbol_text ()) ~docs:(symbol_docs ()) )
# 7333 "parsing/parser.ml"
               : 'and_class_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_expr) in
    Obj.repr(
# 953 "parsing/parser.mly"
      ( _2 )
# 7340 "parsing/parser.ml"
               : 'class_fun_binding))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'class_type) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'class_expr) in
    Obj.repr(
# 955 "parsing/parser.mly"
      ( mkclass(Pcl_constraint(_4, _2)) )
# 7348 "parsing/parser.ml"
               : 'class_fun_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_fun_binding) in
    Obj.repr(
# 957 "parsing/parser.mly"
      ( let (l,o,p) = _1 in mkclass(Pcl_fun(l, o, p, _2)) )
# 7356 "parsing/parser.ml"
               : 'class_fun_binding))
; (fun __caml_parser_env ->
    Obj.repr(
# 960 "parsing/parser.mly"
                                                ( [] )
# 7362 "parsing/parser.ml"
               : 'class_type_parameters))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'type_parameter_list) in
    Obj.repr(
# 961 "parsing/parser.mly"
                                                ( List.rev _2 )
# 7369 "parsing/parser.ml"
               : 'class_type_parameters))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'labeled_simple_pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'class_expr) in
    Obj.repr(
# 965 "parsing/parser.mly"
      ( let (l,o,p) = _1 in mkclass(Pcl_fun(l, o, p, _3)) )
# 7377 "parsing/parser.ml"
               : 'class_fun_def))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_fun_def) in
    Obj.repr(
# 967 "parsing/parser.mly"
      ( let (l,o,p) = _1 in mkclass(Pcl_fun(l, o, p, _2)) )
# 7385 "parsing/parser.ml"
               : 'class_fun_def))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_simple_expr) in
    Obj.repr(
# 971 "parsing/parser.mly"
      ( _1 )
# 7392 "parsing/parser.ml"
               : 'class_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_fun_def) in
    Obj.repr(
# 973 "parsing/parser.mly"
      ( _2 )
# 7399 "parsing/parser.ml"
               : 'class_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_simple_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_labeled_expr_list) in
    Obj.repr(
# 975 "parsing/parser.mly"
      ( mkclass(Pcl_apply(_1, List.rev _2)) )
# 7407 "parsing/parser.ml"
               : 'class_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'let_bindings) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'class_expr) in
    Obj.repr(
# 977 "parsing/parser.mly"
      ( class_of_let_bindings _1 _3 )
# 7415 "parsing/parser.ml"
               : 'class_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 979 "parsing/parser.mly"
      ( Cl.attr _1 _2 )
# 7423 "parsing/parser.ml"
               : 'class_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 981 "parsing/parser.mly"
      ( mkclass(Pcl_extension _1) )
# 7430 "parsing/parser.ml"
               : 'class_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in
    Obj.repr(
# 985 "parsing/parser.mly"
      ( mkclass(Pcl_constr(mkloc _4 (rhs_loc 4), List.rev _2)) )
# 7438 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in
    Obj.repr(
# 987 "parsing/parser.mly"
      ( mkclass(Pcl_constr(mkrhs _1 1, [])) )
# 7445 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_structure) in
    Obj.repr(
# 989 "parsing/parser.mly"
      ( mkclass(Pcl_structure _2) )
# 7452 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_structure) in
    Obj.repr(
# 991 "parsing/parser.mly"
      ( unclosed "object" 1 "end" 3 )
# 7459 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'class_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'class_type) in
    Obj.repr(
# 993 "parsing/parser.mly"
      ( mkclass(Pcl_constraint(_2, _4)) )
# 7467 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'class_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'class_type) in
    Obj.repr(
# 995 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 5 )
# 7475 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_expr) in
    Obj.repr(
# 997 "parsing/parser.mly"
      ( _2 )
# 7482 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_expr) in
    Obj.repr(
# 999 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 3 )
# 7489 "parsing/parser.ml"
               : 'class_simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_self_pattern) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_fields) in
    Obj.repr(
# 1003 "parsing/parser.mly"
       ( Cstr.mk _1 (extra_cstr 2 (List.rev _2)) )
# 7497 "parsing/parser.ml"
               : 'class_structure))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    Obj.repr(
# 1007 "parsing/parser.mly"
      ( reloc_pat _2 )
# 7504 "parsing/parser.ml"
               : 'class_self_pattern))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    Obj.repr(
# 1009 "parsing/parser.mly"
      ( mkpat(Ppat_constraint(_2, _4)) )
# 7512 "parsing/parser.ml"
               : 'class_self_pattern))
; (fun __caml_parser_env ->
    Obj.repr(
# 1011 "parsing/parser.mly"
      ( ghpat(Ppat_any) )
# 7518 "parsing/parser.ml"
               : 'class_self_pattern))
; (fun __caml_parser_env ->
    Obj.repr(
# 1015 "parsing/parser.mly"
      ( [] )
# 7524 "parsing/parser.ml"
               : 'class_fields))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_fields) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_field) in
    Obj.repr(
# 1017 "parsing/parser.mly"
      ( _2 :: (text_cstr 2) @ _1 )
# 7532 "parsing/parser.ml"
               : 'class_fields))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'override_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'class_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'parent_binder) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1021 "parsing/parser.mly"
      ( mkcf (Pcf_inherit (_2, _3, _4)) ~attrs:_5 ~docs:(symbol_docs ()) )
# 7542 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'value) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1023 "parsing/parser.mly"
      ( mkcf (Pcf_val _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7550 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'method_) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1025 "parsing/parser.mly"
      ( mkcf (Pcf_method _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7558 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'constrain_field) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1027 "parsing/parser.mly"
      ( mkcf (Pcf_constraint _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7566 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1029 "parsing/parser.mly"
      ( mkcf (Pcf_initializer _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7574 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1031 "parsing/parser.mly"
      ( mkcf (Pcf_extension _1) ~attrs:_2 ~docs:(symbol_docs ()) )
# 7582 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in
    Obj.repr(
# 1033 "parsing/parser.mly"
      ( mark_symbol_docs ();
        mkcf (Pcf_attribute _1) )
# 7590 "parsing/parser.ml"
               : 'class_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 1038 "parsing/parser.mly"
          ( Some _2 )
# 7597 "parsing/parser.ml"
               : 'parent_binder))
; (fun __caml_parser_env ->
    Obj.repr(
# 1040 "parsing/parser.mly"
          ( None )
# 7603 "parsing/parser.ml"
               : 'parent_binder))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'override_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1045 "parsing/parser.mly"
      ( if _1 = Override then syntax_error ();
        mkloc _4 (rhs_loc 4), Mutable, Cfk_virtual _6 )
# 7613 "parsing/parser.ml"
               : 'value))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'mutable_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1048 "parsing/parser.mly"
      ( mkrhs _3 3, _2, Cfk_virtual _5 )
# 7622 "parsing/parser.ml"
               : 'value))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'override_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'mutable_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1050 "parsing/parser.mly"
      ( mkrhs _3 3, _2, Cfk_concrete (_1, _5) )
# 7632 "parsing/parser.ml"
               : 'value))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'override_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'mutable_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'label) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'type_constraint) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1052 "parsing/parser.mly"
      (
       let e = mkexp_constraint _6 _4 in
       mkrhs _3 3, _2, Cfk_concrete (_1, e)
      )
# 7646 "parsing/parser.ml"
               : 'value))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'override_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'poly_type) in
    Obj.repr(
# 1060 "parsing/parser.mly"
      ( if _1 = Override then syntax_error ();
        mkloc _4 (rhs_loc 4), Private, Cfk_virtual _6 )
# 7656 "parsing/parser.ml"
               : 'method_))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'override_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'private_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'poly_type) in
    Obj.repr(
# 1063 "parsing/parser.mly"
      ( if _1 = Override then syntax_error ();
        mkloc _4 (rhs_loc 4), _3, Cfk_virtual _6 )
# 7667 "parsing/parser.ml"
               : 'method_))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'override_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'private_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'label) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'strict_binding) in
    Obj.repr(
# 1066 "parsing/parser.mly"
      ( mkloc _3 (rhs_loc 3), _2,
        Cfk_concrete (_1, ghexp(Pexp_poly (_4, None))) )
# 7678 "parsing/parser.ml"
               : 'method_))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'override_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'private_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'poly_type) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1069 "parsing/parser.mly"
      ( mkloc _3 (rhs_loc 3), _2,
        Cfk_concrete (_1, ghexp(Pexp_poly(_7, Some _5))) )
# 7690 "parsing/parser.ml"
               : 'method_))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 9 : 'override_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 8 : 'private_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 7 : 'label) in
    let _6 = (Parsing.peek_val __caml_parser_env 4 : 'lident_list) in
    let _8 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _10 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1073 "parsing/parser.mly"
      ( let exp, poly = wrap_type_annotation _6 _8 _10 in
        mkloc _3 (rhs_loc 3), _2,
        Cfk_concrete (_1, ghexp(Pexp_poly(exp, Some poly))) )
# 7704 "parsing/parser.ml"
               : 'method_))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_signature) in
    Obj.repr(
# 1082 "parsing/parser.mly"
      ( _1 )
# 7711 "parsing/parser.ml"
               : 'class_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type_or_tuple_no_attr) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'class_type) in
    Obj.repr(
# 1085 "parsing/parser.mly"
      ( mkcty(Pcty_arrow("?" ^ _2 , mkoption _4, _6)) )
# 7720 "parsing/parser.ml"
               : 'class_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type_or_tuple_no_attr) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'class_type) in
    Obj.repr(
# 1087 "parsing/parser.mly"
      ( mkcty(Pcty_arrow("?" ^ _1, mkoption _2, _4)) )
# 7729 "parsing/parser.ml"
               : 'class_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type_or_tuple_no_attr) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'class_type) in
    Obj.repr(
# 1089 "parsing/parser.mly"
      ( mkcty(Pcty_arrow(_1, _3, _5)) )
# 7738 "parsing/parser.ml"
               : 'class_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type_or_tuple_no_attr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'class_type) in
    Obj.repr(
# 1091 "parsing/parser.mly"
      ( mkcty(Pcty_arrow("", _1, _3)) )
# 7746 "parsing/parser.ml"
               : 'class_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'clty_longident) in
    Obj.repr(
# 1095 "parsing/parser.mly"
      ( mkcty(Pcty_constr (mkloc _4 (rhs_loc 4), List.rev _2)) )
# 7754 "parsing/parser.ml"
               : 'class_signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'clty_longident) in
    Obj.repr(
# 1097 "parsing/parser.mly"
      ( mkcty(Pcty_constr (mkrhs _1 1, [])) )
# 7761 "parsing/parser.ml"
               : 'class_signature))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_sig_body) in
    Obj.repr(
# 1099 "parsing/parser.mly"
      ( mkcty(Pcty_signature _2) )
# 7768 "parsing/parser.ml"
               : 'class_signature))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_sig_body) in
    Obj.repr(
# 1101 "parsing/parser.mly"
      ( unclosed "object" 1 "end" 3 )
# 7775 "parsing/parser.ml"
               : 'class_signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 1103 "parsing/parser.mly"
      ( Cty.attr _1 _2 )
# 7783 "parsing/parser.ml"
               : 'class_signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 1105 "parsing/parser.mly"
      ( mkcty(Pcty_extension _1) )
# 7790 "parsing/parser.ml"
               : 'class_signature))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_self_type) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_sig_fields) in
    Obj.repr(
# 1109 "parsing/parser.mly"
      ( Csig.mk _1 (extra_csig 2 (List.rev _2)) )
# 7798 "parsing/parser.ml"
               : 'class_sig_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    Obj.repr(
# 1113 "parsing/parser.mly"
      ( _2 )
# 7805 "parsing/parser.ml"
               : 'class_self_type))
; (fun __caml_parser_env ->
    Obj.repr(
# 1115 "parsing/parser.mly"
      ( mktyp(Ptyp_any) )
# 7811 "parsing/parser.ml"
               : 'class_self_type))
; (fun __caml_parser_env ->
    Obj.repr(
# 1118 "parsing/parser.mly"
                                                ( [] )
# 7817 "parsing/parser.ml"
               : 'class_sig_fields))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_sig_fields) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_sig_field) in
    Obj.repr(
# 1119 "parsing/parser.mly"
                                       ( _2 :: (text_csig 2) @ _1 )
# 7825 "parsing/parser.ml"
               : 'class_sig_fields))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1123 "parsing/parser.mly"
      ( mkctf (Pctf_inherit _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7833 "parsing/parser.ml"
               : 'class_sig_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'value_type) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1125 "parsing/parser.mly"
      ( mkctf (Pctf_val _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7841 "parsing/parser.ml"
               : 'class_sig_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'private_virtual_flags) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'poly_type) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1127 "parsing/parser.mly"
      (
       let (p, v) = _2 in
       mkctf (Pctf_method (_3, p, v, _5)) ~attrs:_6 ~docs:(symbol_docs ())
      )
# 7854 "parsing/parser.ml"
               : 'class_sig_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'constrain_field) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1132 "parsing/parser.mly"
      ( mkctf (Pctf_constraint _2) ~attrs:_3 ~docs:(symbol_docs ()) )
# 7862 "parsing/parser.ml"
               : 'class_sig_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'item_extension) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1134 "parsing/parser.mly"
      ( mkctf (Pctf_extension _1) ~attrs:_2 ~docs:(symbol_docs ()) )
# 7870 "parsing/parser.ml"
               : 'class_sig_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'floating_attribute) in
    Obj.repr(
# 1136 "parsing/parser.mly"
      ( mark_symbol_docs ();
        mkctf(Pctf_attribute _1) )
# 7878 "parsing/parser.ml"
               : 'class_sig_field))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'mutable_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1141 "parsing/parser.mly"
      ( _3, _2, Virtual, _5 )
# 7887 "parsing/parser.ml"
               : 'value_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'virtual_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1143 "parsing/parser.mly"
      ( _3, Mutable, _2, _5 )
# 7896 "parsing/parser.ml"
               : 'value_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1145 "parsing/parser.mly"
      ( _1, Immutable, Concrete, _3 )
# 7904 "parsing/parser.ml"
               : 'value_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1148 "parsing/parser.mly"
                                           ( _1, _3, symbol_rloc() )
# 7912 "parsing/parser.ml"
               : 'constrain))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1151 "parsing/parser.mly"
                                           ( _1, _3 )
# 7920 "parsing/parser.ml"
               : 'constrain_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_description) in
    Obj.repr(
# 1154 "parsing/parser.mly"
                                                ( [_1] )
# 7927 "parsing/parser.ml"
               : 'class_descriptions))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_descriptions) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_class_description) in
    Obj.repr(
# 1155 "parsing/parser.mly"
                                                ( _2 :: _1 )
# 7935 "parsing/parser.ml"
               : 'class_descriptions))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'virtual_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'class_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _6 = (Parsing.peek_val __caml_parser_env 1 : 'class_type) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1160 "parsing/parser.mly"
      ( Ci.mk (mkrhs _4 4) _6 ~virt:_2 ~params:_3 ~attrs:_7
              ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 7947 "parsing/parser.ml"
               : 'class_description))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'virtual_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'class_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _6 = (Parsing.peek_val __caml_parser_env 1 : 'class_type) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1166 "parsing/parser.mly"
      ( Ci.mk (mkrhs _4 4) _6 ~virt:_2 ~params:_3
              ~attrs:_7 ~loc:(symbol_rloc ())
              ~text:(symbol_text ()) ~docs:(symbol_docs ()) )
# 7960 "parsing/parser.ml"
               : 'and_class_description))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'class_type_declaration) in
    Obj.repr(
# 1171 "parsing/parser.mly"
                                                        ( [_1] )
# 7967 "parsing/parser.ml"
               : 'class_type_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'class_type_declarations) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_class_type_declaration) in
    Obj.repr(
# 1172 "parsing/parser.mly"
                                                        ( _2 :: _1 )
# 7975 "parsing/parser.ml"
               : 'class_type_declarations))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 5 : 'virtual_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 4 : 'class_type_parameters) in
    let _5 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in
    let _8 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1177 "parsing/parser.mly"
      ( Ci.mk (mkrhs _5 5) _7 ~virt:_3 ~params:_4 ~attrs:_8
              ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 7987 "parsing/parser.ml"
               : 'class_type_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'virtual_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'class_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _6 = (Parsing.peek_val __caml_parser_env 1 : 'class_signature) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1183 "parsing/parser.mly"
      ( Ci.mk (mkrhs _4 4) _6 ~virt:_2 ~params:_3
         ~attrs:_7 ~loc:(symbol_rloc ())
         ~text:(symbol_text ()) ~docs:(symbol_docs ()) )
# 8000 "parsing/parser.ml"
               : 'and_class_type_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1191 "parsing/parser.mly"
                                  ( _1 )
# 8007 "parsing/parser.ml"
               : 'seq_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
    Obj.repr(
# 1192 "parsing/parser.mly"
                                  ( reloc_exp _1 )
# 8014 "parsing/parser.ml"
               : 'seq_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1193 "parsing/parser.mly"
                                  ( mkexp(Pexp_sequence(_1, _3)) )
# 8022 "parsing/parser.ml"
               : 'seq_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label_let_pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'opt_default) in
    Obj.repr(
# 1197 "parsing/parser.mly"
      ( ("?" ^ fst _3, _4, snd _3) )
# 8030 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_var) in
    Obj.repr(
# 1199 "parsing/parser.mly"
      ( ("?" ^ fst _2, None, snd _2) )
# 8037 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'let_pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'opt_default) in
    Obj.repr(
# 1201 "parsing/parser.mly"
      ( ("?" ^ _1, _4, _3) )
# 8046 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_var) in
    Obj.repr(
# 1203 "parsing/parser.mly"
      ( ("?" ^ _1, None, _2) )
# 8054 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'label_let_pattern) in
    Obj.repr(
# 1205 "parsing/parser.mly"
      ( (fst _3, None, snd _3) )
# 8061 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_var) in
    Obj.repr(
# 1207 "parsing/parser.mly"
      ( (fst _2, None, snd _2) )
# 8068 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in
    Obj.repr(
# 1209 "parsing/parser.mly"
      ( (_1, None, _2) )
# 8076 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in
    Obj.repr(
# 1211 "parsing/parser.mly"
      ( ("", None, _1) )
# 8083 "parsing/parser.ml"
               : 'labeled_simple_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 1214 "parsing/parser.mly"
                      ( mkpat(Ppat_var (mkrhs _1 1)) )
# 8090 "parsing/parser.ml"
               : 'pattern_var))
; (fun __caml_parser_env ->
    Obj.repr(
# 1215 "parsing/parser.mly"
                      ( mkpat Ppat_any )
# 8096 "parsing/parser.ml"
               : 'pattern_var))
; (fun __caml_parser_env ->
    Obj.repr(
# 1218 "parsing/parser.mly"
                                        ( None )
# 8102 "parsing/parser.ml"
               : 'opt_default))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1219 "parsing/parser.mly"
                                        ( Some _2 )
# 8109 "parsing/parser.ml"
               : 'opt_default))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_var) in
    Obj.repr(
# 1223 "parsing/parser.mly"
      ( _1 )
# 8116 "parsing/parser.ml"
               : 'label_let_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label_var) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1225 "parsing/parser.mly"
      ( let (lab, pat) = _1 in (lab, mkpat(Ppat_constraint(pat, _3))) )
# 8124 "parsing/parser.ml"
               : 'label_let_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 1228 "parsing/parser.mly"
              ( (_1, mkpat(Ppat_var (mkrhs _1 1))) )
# 8131 "parsing/parser.ml"
               : 'label_var))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1232 "parsing/parser.mly"
      ( _1 )
# 8138 "parsing/parser.ml"
               : 'let_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1234 "parsing/parser.mly"
      ( mkpat(Ppat_constraint(_1, _3)) )
# 8146 "parsing/parser.ml"
               : 'let_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1238 "parsing/parser.mly"
      ( _1 )
# 8153 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_labeled_expr_list) in
    Obj.repr(
# 1240 "parsing/parser.mly"
      ( mkexp(Pexp_apply(_1, List.rev _2)) )
# 8161 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'let_bindings) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1242 "parsing/parser.mly"
      ( expr_of_let_bindings _1 _3 )
# 8169 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'module_binding_body) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1244 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_letmodule(mkrhs _4 4, _5, _7)) _3 )
# 8179 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'override_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1246 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_open(_3, mkrhs _5 5, _7)) _4 )
# 8189 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_bar) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'match_cases) in
    Obj.repr(
# 1248 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_function(List.rev _4)) _2 )
# 8198 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in
    Obj.repr(
# 1250 "parsing/parser.mly"
      ( let (l,o,p) = _3 in
        mkexp_attrs (Pexp_fun(l, o, p, _4)) _2 )
# 8208 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'ext_attributes) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in
    Obj.repr(
# 1253 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_newtype(_5, _7)) _2 )
# 8217 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_bar) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'match_cases) in
    Obj.repr(
# 1255 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_match(_3, List.rev _6)) _2 )
# 8227 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_bar) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'match_cases) in
    Obj.repr(
# 1257 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_try(_3, List.rev _6)) _2 )
# 8237 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    Obj.repr(
# 1259 "parsing/parser.mly"
      ( syntax_error() )
# 8245 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr_comma_list) in
    Obj.repr(
# 1261 "parsing/parser.mly"
      ( mkexp(Pexp_tuple(List.rev _1)) )
# 8252 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1263 "parsing/parser.mly"
      ( mkexp(Pexp_construct(mkrhs _1 1, Some _2)) )
# 8260 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1265 "parsing/parser.mly"
      ( mkexp(Pexp_variant(_1, Some _2)) )
# 8268 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'seq_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1267 "parsing/parser.mly"
      ( mkexp_attrs(Pexp_ifthenelse(_3, _5, Some _7)) _2 )
# 8278 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1269 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_ifthenelse(_3, _5, None)) _2 )
# 8287 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1271 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_while(_3, _5)) _2 )
# 8296 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 8 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 7 : 'pattern) in
    let _5 = (Parsing.peek_val __caml_parser_env 5 : 'seq_expr) in
    let _6 = (Parsing.peek_val __caml_parser_env 4 : 'direction_flag) in
    let _7 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in
    let _9 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1274 "parsing/parser.mly"
      ( mkexp_attrs(Pexp_for(_3, _5, _7, _6, _9)) _2 )
# 8308 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1276 "parsing/parser.mly"
      ( mkexp_cons (rhs_loc 2) (ghexp(Pexp_tuple[_1;_3])) (symbol_rloc()) )
# 8316 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _5 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
    Obj.repr(
# 1278 "parsing/parser.mly"
      ( mkexp_cons (rhs_loc 2) (ghexp(Pexp_tuple[_5;_7])) (symbol_rloc()) )
# 8324 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1280 "parsing/parser.mly"
      ( mkinfix _1 _2 _3 )
# 8333 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1282 "parsing/parser.mly"
      ( mkinfix _1 _2 _3 )
# 8342 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1284 "parsing/parser.mly"
      ( mkinfix _1 _2 _3 )
# 8351 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1286 "parsing/parser.mly"
      ( mkinfix _1 _2 _3 )
# 8360 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1288 "parsing/parser.mly"
      ( mkinfix _1 _2 _3 )
# 8369 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1290 "parsing/parser.mly"
      ( mkinfix _1 "+" _3 )
# 8377 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1292 "parsing/parser.mly"
      ( mkinfix _1 "+." _3 )
# 8385 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1294 "parsing/parser.mly"
      ( mkinfix _1 "+=" _3 )
# 8393 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1296 "parsing/parser.mly"
      ( mkinfix _1 "-" _3 )
# 8401 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1298 "parsing/parser.mly"
      ( mkinfix _1 "-." _3 )
# 8409 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1300 "parsing/parser.mly"
      ( mkinfix _1 "*" _3 )
# 8417 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1302 "parsing/parser.mly"
      ( mkinfix _1 "%" _3 )
# 8425 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1304 "parsing/parser.mly"
      ( mkinfix _1 "=" _3 )
# 8433 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1306 "parsing/parser.mly"
      ( mkinfix _1 "<" _3 )
# 8441 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1308 "parsing/parser.mly"
      ( mkinfix _1 ">" _3 )
# 8449 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1310 "parsing/parser.mly"
      ( mkinfix _1 "or" _3 )
# 8457 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1312 "parsing/parser.mly"
      ( mkinfix _1 "||" _3 )
# 8465 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1314 "parsing/parser.mly"
      ( mkinfix _1 "&" _3 )
# 8473 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1316 "parsing/parser.mly"
      ( mkinfix _1 "&&" _3 )
# 8481 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1318 "parsing/parser.mly"
      ( mkinfix _1 ":=" _3 )
# 8489 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'subtractive) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1320 "parsing/parser.mly"
      ( mkuminus _1 _2 )
# 8497 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'additive) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1322 "parsing/parser.mly"
      ( mkuplus _1 _2 )
# 8505 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label_longident) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1324 "parsing/parser.mly"
      ( mkexp(Pexp_setfield(_1, mkrhs _3 3, _5)) )
# 8514 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1326 "parsing/parser.mly"
      ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "set")),
                         ["",_1; "",_4; "",_7])) )
# 8524 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'seq_expr) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1329 "parsing/parser.mly"
      ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "String" "set")),
                         ["",_1; "",_4; "",_7])) )
# 8534 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1332 "parsing/parser.mly"
      ( bigarray_set _1 _4 _7 )
# 8543 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1334 "parsing/parser.mly"
      ( mkexp(Pexp_setinstvar(mkrhs _1 1, _3)) )
# 8551 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1336 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_assert _3) _2 )
# 8559 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1338 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_lazy _3) _2 )
# 8567 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_structure) in
    Obj.repr(
# 1340 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_object _3) _2 )
# 8575 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'class_structure) in
    Obj.repr(
# 1342 "parsing/parser.mly"
      ( unclosed "object" 1 "end" 4 )
# 8583 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 1344 "parsing/parser.mly"
      ( Exp.attr _1 _2 )
# 8591 "parsing/parser.ml"
               : 'expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'val_longident) in
    Obj.repr(
# 1348 "parsing/parser.mly"
      ( mkexp(Pexp_ident (mkrhs _1 1)) )
# 8598 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constant) in
    Obj.repr(
# 1350 "parsing/parser.mly"
      ( mkexp(Pexp_constant _1) )
# 8605 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constr_longident) in
    Obj.repr(
# 1352 "parsing/parser.mly"
      ( mkexp(Pexp_construct(mkrhs _1 1, None)) )
# 8612 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in
    Obj.repr(
# 1354 "parsing/parser.mly"
      ( mkexp(Pexp_variant(_1, None)) )
# 8619 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1356 "parsing/parser.mly"
      ( reloc_exp _2 )
# 8626 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1358 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 3 )
# 8633 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1360 "parsing/parser.mly"
      ( wrap_exp_attrs (reloc_exp _3) _2 (* check location *) )
# 8641 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in
    Obj.repr(
# 1362 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_construct (mkloc (Lident "()") (symbol_rloc ()),
                               None)) _2 )
# 8649 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1365 "parsing/parser.mly"
      ( unclosed "begin" 1 "end" 3 )
# 8657 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'type_constraint) in
    Obj.repr(
# 1367 "parsing/parser.mly"
      ( mkexp_constraint _2 _3 )
# 8665 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'label_longident) in
    Obj.repr(
# 1369 "parsing/parser.mly"
      ( mkexp(Pexp_field(_1, mkrhs _3 3)) )
# 8673 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1371 "parsing/parser.mly"
      ( mkexp(Pexp_open(Fresh, mkrhs _1 1, _4)) )
# 8681 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1373 "parsing/parser.mly"
      ( unclosed "(" 3 ")" 5 )
# 8689 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1375 "parsing/parser.mly"
      ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "Array" "get")),
                         ["",_1; "",_4])) )
# 8698 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1378 "parsing/parser.mly"
      ( unclosed "(" 3 ")" 5 )
# 8706 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1380 "parsing/parser.mly"
      ( mkexp(Pexp_apply(ghexp(Pexp_ident(array_function "String" "get")),
                         ["",_1; "",_4])) )
# 8715 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'seq_expr) in
    Obj.repr(
# 1383 "parsing/parser.mly"
      ( unclosed "[" 3 "]" 5 )
# 8723 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
    Obj.repr(
# 1385 "parsing/parser.mly"
      ( bigarray_get _1 _4 )
# 8731 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_expr) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'expr_comma_list) in
    Obj.repr(
# 1387 "parsing/parser.mly"
      ( unclosed "{" 3 "}" 5 )
# 8739 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in
    Obj.repr(
# 1389 "parsing/parser.mly"
      ( let (exten, fields) = _2 in mkexp (Pexp_record(fields, exten)) )
# 8746 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in
    Obj.repr(
# 1391 "parsing/parser.mly"
      ( unclosed "{" 1 "}" 3 )
# 8753 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in
    Obj.repr(
# 1393 "parsing/parser.mly"
      ( let (exten, fields) = _4 in
        let rec_exp = mkexp(Pexp_record(fields, exten)) in
        mkexp(Pexp_open(Fresh, mkrhs _1 1, rec_exp)) )
# 8763 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'record_expr) in
    Obj.repr(
# 1397 "parsing/parser.mly"
      ( unclosed "{" 3 "}" 5 )
# 8771 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1399 "parsing/parser.mly"
      ( mkexp (Pexp_array(List.rev _2)) )
# 8779 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1401 "parsing/parser.mly"
      ( unclosed "[|" 1 "|]" 4 )
# 8787 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    Obj.repr(
# 1403 "parsing/parser.mly"
      ( mkexp (Pexp_array []) )
# 8793 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1405 "parsing/parser.mly"
      ( mkexp(Pexp_open(Fresh, mkrhs _1 1, mkexp(Pexp_array(List.rev _4)))) )
# 8802 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1407 "parsing/parser.mly"
      ( unclosed "[|" 3 "|]" 6 )
# 8811 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1409 "parsing/parser.mly"
      ( reloc_exp (mktailexp (rhs_loc 4) (List.rev _2)) )
# 8819 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1411 "parsing/parser.mly"
      ( unclosed "[" 1 "]" 4 )
# 8827 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1413 "parsing/parser.mly"
      ( let list_exp = reloc_exp (mktailexp (rhs_loc 6) (List.rev _4)) in
        mkexp(Pexp_open(Fresh, mkrhs _1 1, list_exp)) )
# 8837 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1416 "parsing/parser.mly"
      ( unclosed "[" 3 "]" 6 )
# 8846 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1418 "parsing/parser.mly"
      ( mkexp(Pexp_apply(mkoperator _1 1, ["",_2])) )
# 8854 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1420 "parsing/parser.mly"
      ( mkexp(Pexp_apply(mkoperator "!" 1, ["",_2])) )
# 8861 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in
    Obj.repr(
# 1422 "parsing/parser.mly"
      ( mkexp_attrs (Pexp_new(mkrhs _3 3)) _2 )
# 8869 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'field_expr_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1424 "parsing/parser.mly"
      ( mkexp (Pexp_override(List.rev _2)) )
# 8877 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'field_expr_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1426 "parsing/parser.mly"
      ( unclosed "{<" 1 ">}" 4 )
# 8885 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    Obj.repr(
# 1428 "parsing/parser.mly"
      ( mkexp (Pexp_override []))
# 8891 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'field_expr_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1430 "parsing/parser.mly"
      ( mkexp(Pexp_open(Fresh, mkrhs _1 1, mkexp (Pexp_override(List.rev _4)))))
# 8900 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 5 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'field_expr_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1432 "parsing/parser.mly"
      ( unclosed "{<" 3 ">}" 6 )
# 8909 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'label) in
    Obj.repr(
# 1434 "parsing/parser.mly"
      ( mkexp(Pexp_send(_1, _3)) )
# 8917 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1436 "parsing/parser.mly"
      ( mkinfix _1 _2 _3 )
# 8926 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'module_expr) in
    Obj.repr(
# 1438 "parsing/parser.mly"
      ( mkexp (Pexp_pack _3) )
# 8933 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 1440 "parsing/parser.mly"
      ( mkexp (Pexp_constraint (ghexp (Pexp_pack _3),
                                ghtyp (Ptyp_package _5))) )
# 8942 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'module_expr) in
    Obj.repr(
# 1443 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 5 )
# 8949 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 7 : 'mod_longident) in
    let _5 = (Parsing.peek_val __caml_parser_env 3 : 'module_expr) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 1445 "parsing/parser.mly"
      ( mkexp(Pexp_open(Fresh, mkrhs _1 1,
        mkexp (Pexp_constraint (ghexp (Pexp_pack _5),
                                ghtyp (Ptyp_package _7))))) )
# 8960 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'mod_longident) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'module_expr) in
    Obj.repr(
# 1449 "parsing/parser.mly"
      ( unclosed "(" 3 ")" 7 )
# 8968 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 1451 "parsing/parser.mly"
      ( mkexp (Pexp_extension _1) )
# 8975 "parsing/parser.ml"
               : 'simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'labeled_simple_expr) in
    Obj.repr(
# 1455 "parsing/parser.mly"
      ( [_1] )
# 8982 "parsing/parser.ml"
               : 'simple_labeled_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_labeled_expr_list) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'labeled_simple_expr) in
    Obj.repr(
# 1457 "parsing/parser.mly"
      ( _2 :: _1 )
# 8990 "parsing/parser.ml"
               : 'simple_labeled_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1461 "parsing/parser.mly"
      ( ("", _1) )
# 8997 "parsing/parser.ml"
               : 'labeled_simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_expr) in
    Obj.repr(
# 1463 "parsing/parser.mly"
      ( _1 )
# 9004 "parsing/parser.ml"
               : 'labeled_simple_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1467 "parsing/parser.mly"
      ( (_1, _2) )
# 9012 "parsing/parser.ml"
               : 'label_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_ident) in
    Obj.repr(
# 1469 "parsing/parser.mly"
      ( _2 )
# 9019 "parsing/parser.ml"
               : 'label_expr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_ident) in
    Obj.repr(
# 1471 "parsing/parser.mly"
      ( ("?" ^ fst _2, snd _2) )
# 9026 "parsing/parser.ml"
               : 'label_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_expr) in
    Obj.repr(
# 1473 "parsing/parser.mly"
      ( ("?" ^ _1, _2) )
# 9034 "parsing/parser.ml"
               : 'label_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 1476 "parsing/parser.mly"
             ( (_1, mkexp(Pexp_ident(mkrhs (Lident _1) 1))) )
# 9041 "parsing/parser.ml"
               : 'label_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 1479 "parsing/parser.mly"
                                      ( [_1] )
# 9048 "parsing/parser.ml"
               : 'lident_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'lident_list) in
    Obj.repr(
# 1480 "parsing/parser.mly"
                                      ( _1 :: _2 )
# 9056 "parsing/parser.ml"
               : 'lident_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'val_ident) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'fun_binding) in
    Obj.repr(
# 1484 "parsing/parser.mly"
      ( (mkpatvar _1 1, _2) )
# 9064 "parsing/parser.ml"
               : 'let_binding_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'val_ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'typevar_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1486 "parsing/parser.mly"
      ( (ghpat(Ppat_constraint(mkpatvar _1 1,
                               ghtyp(Ptyp_poly(List.rev _3,_5)))),
         _7) )
# 9076 "parsing/parser.ml"
               : 'let_binding_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 7 : 'val_ident) in
    let _4 = (Parsing.peek_val __caml_parser_env 4 : 'lident_list) in
    let _6 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _8 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1490 "parsing/parser.mly"
      ( let exp, poly = wrap_type_annotation _4 _6 _8 in
        (ghpat(Ppat_constraint(mkpatvar _1 1, poly)), exp) )
# 9087 "parsing/parser.ml"
               : 'let_binding_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1493 "parsing/parser.mly"
      ( (_1, _3) )
# 9095 "parsing/parser.ml"
               : 'let_binding_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'simple_pattern_not_ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1495 "parsing/parser.mly"
      ( (ghpat(Ppat_constraint(_1, _3)), _5) )
# 9104 "parsing/parser.ml"
               : 'let_binding_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'let_binding) in
    Obj.repr(
# 1498 "parsing/parser.mly"
                                                ( _1 )
# 9111 "parsing/parser.ml"
               : 'let_bindings))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'let_bindings) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_let_binding) in
    Obj.repr(
# 1499 "parsing/parser.mly"
                                                ( addlb _1 _2 )
# 9119 "parsing/parser.ml"
               : 'let_bindings))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'ext_attributes) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'rec_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'let_binding_body) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1503 "parsing/parser.mly"
      ( mklbs _2 _3 (mklb _4 _5) )
# 9129 "parsing/parser.ml"
               : 'let_binding))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'let_binding_body) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1507 "parsing/parser.mly"
      ( mklb _2 _3 )
# 9137 "parsing/parser.ml"
               : 'and_let_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'strict_binding) in
    Obj.repr(
# 1511 "parsing/parser.mly"
      ( _1 )
# 9144 "parsing/parser.ml"
               : 'fun_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'type_constraint) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1513 "parsing/parser.mly"
      ( mkexp_constraint _3 _1 )
# 9152 "parsing/parser.ml"
               : 'fun_binding))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1517 "parsing/parser.mly"
      ( _2 )
# 9159 "parsing/parser.ml"
               : 'strict_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'fun_binding) in
    Obj.repr(
# 1519 "parsing/parser.mly"
      ( let (l, o, p) = _1 in ghexp(Pexp_fun(l, o, p, _2)) )
# 9167 "parsing/parser.ml"
               : 'strict_binding))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'fun_binding) in
    Obj.repr(
# 1521 "parsing/parser.mly"
      ( mkexp(Pexp_newtype(_3, _5)) )
# 9175 "parsing/parser.ml"
               : 'strict_binding))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'match_case) in
    Obj.repr(
# 1524 "parsing/parser.mly"
               ( [_1] )
# 9182 "parsing/parser.ml"
               : 'match_cases))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'match_cases) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'match_case) in
    Obj.repr(
# 1525 "parsing/parser.mly"
                               ( _3 :: _1 )
# 9190 "parsing/parser.ml"
               : 'match_cases))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1529 "parsing/parser.mly"
      ( Exp.case _1 _3 )
# 9198 "parsing/parser.ml"
               : 'match_case))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'seq_expr) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1531 "parsing/parser.mly"
      ( Exp.case _1 ~guard:_3 _5 )
# 9207 "parsing/parser.ml"
               : 'match_case))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 1534 "parsing/parser.mly"
                                                ( _2 )
# 9214 "parsing/parser.ml"
               : 'fun_def))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'labeled_simple_pattern) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in
    Obj.repr(
# 1537 "parsing/parser.mly"
      (
       let (l,o,p) = _1 in
       ghexp(Pexp_fun(l, o, p, _2))
      )
# 9225 "parsing/parser.ml"
               : 'fun_def))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'fun_def) in
    Obj.repr(
# 1542 "parsing/parser.mly"
      ( mkexp(Pexp_newtype(_3, _5)) )
# 9233 "parsing/parser.ml"
               : 'fun_def))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr_comma_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1545 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 9241 "parsing/parser.ml"
               : 'expr_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1546 "parsing/parser.mly"
                                                ( [_3; _1] )
# 9249 "parsing/parser.ml"
               : 'expr_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr_list) in
    Obj.repr(
# 1549 "parsing/parser.mly"
                                                ( (Some _1, _3) )
# 9257 "parsing/parser.ml"
               : 'record_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr_list) in
    Obj.repr(
# 1550 "parsing/parser.mly"
                                                ( (None, _1) )
# 9264 "parsing/parser.ml"
               : 'record_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr) in
    Obj.repr(
# 1553 "parsing/parser.mly"
              ( [_1] )
# 9271 "parsing/parser.ml"
               : 'lbl_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'lbl_expr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_expr_list) in
    Obj.repr(
# 1554 "parsing/parser.mly"
                                 ( _1 :: _3 )
# 9279 "parsing/parser.ml"
               : 'lbl_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_expr) in
    Obj.repr(
# 1555 "parsing/parser.mly"
                   ( [_1] )
# 9286 "parsing/parser.ml"
               : 'lbl_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1559 "parsing/parser.mly"
      ( (mkrhs _1 1,_3) )
# 9294 "parsing/parser.ml"
               : 'lbl_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_longident) in
    Obj.repr(
# 1561 "parsing/parser.mly"
      ( (mkrhs _1 1, exp_of_label _1 1) )
# 9301 "parsing/parser.ml"
               : 'lbl_expr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1565 "parsing/parser.mly"
      ( [mkrhs _1 1,_3] )
# 9309 "parsing/parser.ml"
               : 'field_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'field_expr_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1567 "parsing/parser.mly"
      ( (mkrhs _3 3, _5) :: _1 )
# 9318 "parsing/parser.ml"
               : 'field_expr_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1570 "parsing/parser.mly"
                                                ( [_1] )
# 9325 "parsing/parser.ml"
               : 'expr_semi_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'expr_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
    Obj.repr(
# 1571 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 9333 "parsing/parser.ml"
               : 'expr_semi_list))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1574 "parsing/parser.mly"
                                                ( (Some _2, None) )
# 9340 "parsing/parser.ml"
               : 'type_constraint))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1575 "parsing/parser.mly"
                                                ( (Some _2, Some _4) )
# 9348 "parsing/parser.ml"
               : 'type_constraint))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1576 "parsing/parser.mly"
                                                ( (None, Some _2) )
# 9355 "parsing/parser.ml"
               : 'type_constraint))
; (fun __caml_parser_env ->
    Obj.repr(
# 1577 "parsing/parser.mly"
                                                ( syntax_error() )
# 9361 "parsing/parser.ml"
               : 'type_constraint))
; (fun __caml_parser_env ->
    Obj.repr(
# 1578 "parsing/parser.mly"
                                                ( syntax_error() )
# 9367 "parsing/parser.ml"
               : 'type_constraint))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in
    Obj.repr(
# 1585 "parsing/parser.mly"
      ( _1 )
# 9374 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in
    Obj.repr(
# 1587 "parsing/parser.mly"
      ( mkpat(Ppat_alias(_1, mkrhs _3 3)) )
# 9382 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    Obj.repr(
# 1589 "parsing/parser.mly"
      ( expecting 3 "identifier" )
# 9389 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern_comma_list) in
    Obj.repr(
# 1591 "parsing/parser.mly"
      ( mkpat(Ppat_tuple(List.rev _1)) )
# 9396 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1593 "parsing/parser.mly"
      ( mkpat(Ppat_construct(mkrhs _1 1, Some _2)) )
# 9404 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1595 "parsing/parser.mly"
      ( mkpat(Ppat_variant(_1, Some _2)) )
# 9412 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1597 "parsing/parser.mly"
      ( mkpat_cons (rhs_loc 2) (ghpat(Ppat_tuple[_1;_3])) (symbol_rloc()) )
# 9420 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    Obj.repr(
# 1599 "parsing/parser.mly"
      ( expecting 3 "pattern" )
# 9427 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _5 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    Obj.repr(
# 1601 "parsing/parser.mly"
      ( mkpat_cons (rhs_loc 2) (ghpat(Ppat_tuple[_5;_7])) (symbol_rloc()) )
# 9435 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _5 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    Obj.repr(
# 1603 "parsing/parser.mly"
      ( unclosed "(" 4 ")" 8 )
# 9443 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1605 "parsing/parser.mly"
      ( mkpat(Ppat_or(_1, _3)) )
# 9451 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    Obj.repr(
# 1607 "parsing/parser.mly"
      ( expecting 3 "pattern" )
# 9458 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern) in
    Obj.repr(
# 1609 "parsing/parser.mly"
      ( mkpat(Ppat_lazy _2) )
# 9465 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1611 "parsing/parser.mly"
      ( mkpat(Ppat_exception _2) )
# 9472 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 1613 "parsing/parser.mly"
      ( Pat.attr _1 _2 )
# 9480 "parsing/parser.ml"
               : 'pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in
    Obj.repr(
# 1617 "parsing/parser.mly"
      ( mkpat(Ppat_var (mkrhs _1 1)) )
# 9487 "parsing/parser.ml"
               : 'simple_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_pattern_not_ident) in
    Obj.repr(
# 1618 "parsing/parser.mly"
                             ( _1 )
# 9494 "parsing/parser.ml"
               : 'simple_pattern))
; (fun __caml_parser_env ->
    Obj.repr(
# 1622 "parsing/parser.mly"
      ( mkpat(Ppat_any) )
# 9500 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'signed_constant) in
    Obj.repr(
# 1624 "parsing/parser.mly"
      ( mkpat(Ppat_constant _1) )
# 9507 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'signed_constant) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'signed_constant) in
    Obj.repr(
# 1626 "parsing/parser.mly"
      ( mkpat(Ppat_interval (_1, _3)) )
# 9515 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constr_longident) in
    Obj.repr(
# 1628 "parsing/parser.mly"
      ( mkpat(Ppat_construct(mkrhs _1 1, None)) )
# 9522 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in
    Obj.repr(
# 1630 "parsing/parser.mly"
      ( mkpat(Ppat_variant(_1, None)) )
# 9529 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in
    Obj.repr(
# 1632 "parsing/parser.mly"
      ( mkpat(Ppat_type (mkrhs _2 2)) )
# 9536 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_pattern_list) in
    Obj.repr(
# 1634 "parsing/parser.mly"
      ( let (fields, closed) = _2 in mkpat(Ppat_record(fields, closed)) )
# 9543 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_pattern_list) in
    Obj.repr(
# 1636 "parsing/parser.mly"
      ( unclosed "{" 1 "}" 3 )
# 9550 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1638 "parsing/parser.mly"
      ( reloc_pat (mktailpat (rhs_loc 4) (List.rev _2)) )
# 9558 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1640 "parsing/parser.mly"
      ( unclosed "[" 1 "]" 4 )
# 9566 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1642 "parsing/parser.mly"
      ( mkpat(Ppat_array(List.rev _2)) )
# 9574 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 1644 "parsing/parser.mly"
      ( mkpat(Ppat_array []) )
# 9580 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'opt_semi) in
    Obj.repr(
# 1646 "parsing/parser.mly"
      ( unclosed "[|" 1 "|]" 4 )
# 9588 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    Obj.repr(
# 1648 "parsing/parser.mly"
      ( reloc_pat _2 )
# 9595 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'pattern) in
    Obj.repr(
# 1650 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 3 )
# 9602 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    Obj.repr(
# 1652 "parsing/parser.mly"
      ( mkpat(Ppat_constraint(_2, _4)) )
# 9610 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    Obj.repr(
# 1654 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 5 )
# 9618 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    Obj.repr(
# 1656 "parsing/parser.mly"
      ( expecting 4 "type" )
# 9625 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : string) in
    Obj.repr(
# 1658 "parsing/parser.mly"
      ( mkpat(Ppat_unpack (mkrhs _3 3)) )
# 9632 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 1660 "parsing/parser.mly"
      ( mkpat(Ppat_constraint(mkpat(Ppat_unpack (mkrhs _3 3)),
                              ghtyp(Ptyp_package _5))) )
# 9641 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 1663 "parsing/parser.mly"
      ( unclosed "(" 1 ")" 6 )
# 9649 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 1665 "parsing/parser.mly"
      ( mkpat(Ppat_extension _1) )
# 9656 "parsing/parser.ml"
               : 'simple_pattern_not_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_comma_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1669 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 9664 "parsing/parser.ml"
               : 'pattern_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1670 "parsing/parser.mly"
                                                ( [_3; _1] )
# 9672 "parsing/parser.ml"
               : 'pattern_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    Obj.repr(
# 1671 "parsing/parser.mly"
                                                ( expecting 3 "pattern" )
# 9679 "parsing/parser.ml"
               : 'pattern_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1674 "parsing/parser.mly"
                                                ( [_1] )
# 9686 "parsing/parser.ml"
               : 'pattern_semi_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'pattern_semi_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1675 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 9694 "parsing/parser.ml"
               : 'pattern_semi_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_pattern) in
    Obj.repr(
# 1678 "parsing/parser.mly"
                ( [_1], Closed )
# 9701 "parsing/parser.ml"
               : 'lbl_pattern_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'lbl_pattern) in
    Obj.repr(
# 1679 "parsing/parser.mly"
                     ( [_1], Closed )
# 9708 "parsing/parser.ml"
               : 'lbl_pattern_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'lbl_pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'opt_semi) in
    Obj.repr(
# 1680 "parsing/parser.mly"
                                         ( [_1], Open )
# 9716 "parsing/parser.ml"
               : 'lbl_pattern_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'lbl_pattern) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'lbl_pattern_list) in
    Obj.repr(
# 1682 "parsing/parser.mly"
      ( let (fields, closed) = _3 in _1 :: fields, closed )
# 9724 "parsing/parser.ml"
               : 'lbl_pattern_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'label_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 1686 "parsing/parser.mly"
      ( (mkrhs _1 1,_3) )
# 9732 "parsing/parser.ml"
               : 'lbl_pattern))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_longident) in
    Obj.repr(
# 1688 "parsing/parser.mly"
      ( (mkrhs _1 1, pat_of_label _1 1) )
# 9739 "parsing/parser.ml"
               : 'lbl_pattern))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'val_ident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1695 "parsing/parser.mly"
      ( Val.mk (mkrhs _2 2) _4 ~attrs:_5
               ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 9749 "parsing/parser.ml"
               : 'value_description))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string * string option) in
    Obj.repr(
# 1702 "parsing/parser.mly"
                                                ( [fst _1] )
# 9756 "parsing/parser.ml"
               : 'primitive_declaration_body))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : string * string option) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'primitive_declaration_body) in
    Obj.repr(
# 1703 "parsing/parser.mly"
                                                ( fst _1 :: _2 )
# 9764 "parsing/parser.ml"
               : 'primitive_declaration_body))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'val_ident) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'core_type) in
    let _6 = (Parsing.peek_val __caml_parser_env 1 : 'primitive_declaration_body) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1708 "parsing/parser.mly"
      ( Val.mk (mkrhs _2 2) _4 ~prim:_6 ~attrs:_7
               ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 9775 "parsing/parser.ml"
               : 'primitive_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_declaration) in
    Obj.repr(
# 1715 "parsing/parser.mly"
                                                ( [_1] )
# 9782 "parsing/parser.ml"
               : 'type_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'type_declarations) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'and_type_declaration) in
    Obj.repr(
# 1716 "parsing/parser.mly"
                                                ( _2 :: _1 )
# 9790 "parsing/parser.ml"
               : 'type_declarations))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'nonrec_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 4 : 'optional_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'type_kind) in
    let _6 = (Parsing.peek_val __caml_parser_env 1 : 'constraints) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1722 "parsing/parser.mly"
      ( let (kind, priv, manifest) = _5 in
          Type.mk (mkrhs _4 4) ~params:_3 ~cstrs:(List.rev _6) ~kind
            ~priv ?manifest ~attrs:(add_nonrec _2 _7 2)
            ~loc:(symbol_rloc ()) ~docs:(symbol_docs ()) )
# 9805 "parsing/parser.ml"
               : 'type_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'optional_type_parameters) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'type_kind) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'constraints) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1730 "parsing/parser.mly"
      ( let (kind, priv, manifest) = _4 in
          Type.mk (mkrhs _3 3) ~params:_2 ~cstrs:(List.rev _5)
            ~kind ~priv ?manifest ~attrs:_6 ~loc:(symbol_rloc ())
            ~text:(symbol_text ()) ~docs:(symbol_docs ()) )
# 9819 "parsing/parser.ml"
               : 'and_type_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constraints) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'constrain) in
    Obj.repr(
# 1736 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 9827 "parsing/parser.ml"
               : 'constraints))
; (fun __caml_parser_env ->
    Obj.repr(
# 1737 "parsing/parser.mly"
                                                ( [] )
# 9833 "parsing/parser.ml"
               : 'constraints))
; (fun __caml_parser_env ->
    Obj.repr(
# 1741 "parsing/parser.mly"
      ( (Ptype_abstract, Public, None) )
# 9839 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1743 "parsing/parser.mly"
      ( (Ptype_abstract, Public, Some _2) )
# 9846 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1745 "parsing/parser.mly"
      ( (Ptype_abstract, Private, Some _3) )
# 9853 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declarations) in
    Obj.repr(
# 1747 "parsing/parser.mly"
      ( (Ptype_variant(List.rev _2), Public, None) )
# 9860 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declarations) in
    Obj.repr(
# 1749 "parsing/parser.mly"
      ( (Ptype_variant(List.rev _3), Private, None) )
# 9867 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    Obj.repr(
# 1751 "parsing/parser.mly"
      ( (Ptype_open, Public, None) )
# 9873 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'private_flag) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'label_declarations) in
    Obj.repr(
# 1753 "parsing/parser.mly"
      ( (Ptype_record _4, _2, None) )
# 9881 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'core_type) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'private_flag) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declarations) in
    Obj.repr(
# 1755 "parsing/parser.mly"
      ( (Ptype_variant(List.rev _5), _4, Some _2) )
# 9890 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type) in
    Obj.repr(
# 1757 "parsing/parser.mly"
      ( (Ptype_open, Public, Some _2) )
# 9897 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'core_type) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'private_flag) in
    let _6 = (Parsing.peek_val __caml_parser_env 1 : 'label_declarations) in
    Obj.repr(
# 1759 "parsing/parser.mly"
      ( (Ptype_record _6, _4, Some _2) )
# 9906 "parsing/parser.ml"
               : 'type_kind))
; (fun __caml_parser_env ->
    Obj.repr(
# 1762 "parsing/parser.mly"
                                                ( [] )
# 9912 "parsing/parser.ml"
               : 'optional_type_parameters))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_parameter) in
    Obj.repr(
# 1763 "parsing/parser.mly"
                                                ( [_1] )
# 9919 "parsing/parser.ml"
               : 'optional_type_parameters))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'optional_type_parameter_list) in
    Obj.repr(
# 1764 "parsing/parser.mly"
                                                ( List.rev _2 )
# 9926 "parsing/parser.ml"
               : 'optional_type_parameters))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'type_variance) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_variable) in
    Obj.repr(
# 1767 "parsing/parser.mly"
                                                ( _2, _1 )
# 9934 "parsing/parser.ml"
               : 'optional_type_parameter))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_parameter) in
    Obj.repr(
# 1770 "parsing/parser.mly"
                                                         ( [_1] )
# 9941 "parsing/parser.ml"
               : 'optional_type_parameter_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'optional_type_parameter_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'optional_type_parameter) in
    Obj.repr(
# 1771 "parsing/parser.mly"
                                                                  ( _3 :: _1 )
# 9949 "parsing/parser.ml"
               : 'optional_type_parameter_list))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 1774 "parsing/parser.mly"
                                                ( mktyp(Ptyp_var _2) )
# 9956 "parsing/parser.ml"
               : 'optional_type_variable))
; (fun __caml_parser_env ->
    Obj.repr(
# 1775 "parsing/parser.mly"
                                                ( mktyp(Ptyp_any) )
# 9962 "parsing/parser.ml"
               : 'optional_type_variable))
; (fun __caml_parser_env ->
    Obj.repr(
# 1780 "parsing/parser.mly"
                                                ( [] )
# 9968 "parsing/parser.ml"
               : 'type_parameters))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_parameter) in
    Obj.repr(
# 1781 "parsing/parser.mly"
                                                ( [_1] )
# 9975 "parsing/parser.ml"
               : 'type_parameters))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'type_parameter_list) in
    Obj.repr(
# 1782 "parsing/parser.mly"
                                                ( List.rev _2 )
# 9982 "parsing/parser.ml"
               : 'type_parameters))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'type_variance) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'type_variable) in
    Obj.repr(
# 1785 "parsing/parser.mly"
                                                  ( _2, _1 )
# 9990 "parsing/parser.ml"
               : 'type_parameter))
; (fun __caml_parser_env ->
    Obj.repr(
# 1788 "parsing/parser.mly"
                                                ( Invariant )
# 9996 "parsing/parser.ml"
               : 'type_variance))
; (fun __caml_parser_env ->
    Obj.repr(
# 1789 "parsing/parser.mly"
                                                ( Covariant )
# 10002 "parsing/parser.ml"
               : 'type_variance))
; (fun __caml_parser_env ->
    Obj.repr(
# 1790 "parsing/parser.mly"
                                                ( Contravariant )
# 10008 "parsing/parser.ml"
               : 'type_variance))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 1793 "parsing/parser.mly"
                                                ( mktyp(Ptyp_var _2) )
# 10015 "parsing/parser.ml"
               : 'type_variable))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_parameter) in
    Obj.repr(
# 1796 "parsing/parser.mly"
                                                ( [_1] )
# 10022 "parsing/parser.ml"
               : 'type_parameter_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'type_parameter_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'type_parameter) in
    Obj.repr(
# 1797 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10030 "parsing/parser.ml"
               : 'type_parameter_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constructor_declaration) in
    Obj.repr(
# 1800 "parsing/parser.mly"
                                                         ( [_1] )
# 10037 "parsing/parser.ml"
               : 'constructor_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_constructor_declaration) in
    Obj.repr(
# 1801 "parsing/parser.mly"
                                                         ( [_1] )
# 10044 "parsing/parser.ml"
               : 'constructor_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'constructor_declarations) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_constructor_declaration) in
    Obj.repr(
# 1802 "parsing/parser.mly"
                                                         ( _2 :: _1 )
# 10052 "parsing/parser.ml"
               : 'constructor_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1806 "parsing/parser.mly"
      (
       let args,res = _2 in
       Type.constructor (mkrhs _1 1) ~args ?res ~attrs:_3
         ~loc:(symbol_rloc()) ~info:(symbol_info ())
      )
# 10065 "parsing/parser.ml"
               : 'constructor_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1814 "parsing/parser.mly"
      (
       let args,res = _3 in
       Type.constructor (mkrhs _2 2) ~args ?res ~attrs:_4
         ~loc:(symbol_rloc()) ~info:(symbol_info ())
      )
# 10078 "parsing/parser.ml"
               : 'bar_constructor_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'sig_exception_declaration) in
    Obj.repr(
# 1821 "parsing/parser.mly"
                                                 ( _1 )
# 10085 "parsing/parser.ml"
               : 'str_exception_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'constr_ident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'constr_longident) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'attributes) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1824 "parsing/parser.mly"
      ( Te.rebind (mkrhs _2 2) (mkrhs _4 4) ~attrs:(_5 @ _6)
          ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 10096 "parsing/parser.ml"
               : 'str_exception_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'constr_ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'generalized_constructor_arguments) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'attributes) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1830 "parsing/parser.mly"
      ( let args, res = _3 in
          Te.decl (mkrhs _2 2) ~args ?res ~attrs:(_4 @ _5)
            ~loc:(symbol_rloc()) ~docs:(symbol_docs ()) )
# 10108 "parsing/parser.ml"
               : 'sig_exception_declaration))
; (fun __caml_parser_env ->
    Obj.repr(
# 1835 "parsing/parser.mly"
                                                ( ([],None) )
# 10114 "parsing/parser.ml"
               : 'generalized_constructor_arguments))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_list_no_attr) in
    Obj.repr(
# 1836 "parsing/parser.mly"
                                                ( (List.rev _2,None) )
# 10121 "parsing/parser.ml"
               : 'generalized_constructor_arguments))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_list_no_attr) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_no_attr) in
    Obj.repr(
# 1838 "parsing/parser.mly"
                                                ( (List.rev _2,Some _4) )
# 10129 "parsing/parser.ml"
               : 'generalized_constructor_arguments))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_no_attr) in
    Obj.repr(
# 1840 "parsing/parser.mly"
                                                ( ([],Some _2) )
# 10136 "parsing/parser.ml"
               : 'generalized_constructor_arguments))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_declaration) in
    Obj.repr(
# 1846 "parsing/parser.mly"
                                                ( [_1] )
# 10143 "parsing/parser.ml"
               : 'label_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'label_declaration_semi) in
    Obj.repr(
# 1847 "parsing/parser.mly"
                                                ( [_1] )
# 10150 "parsing/parser.ml"
               : 'label_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'label_declaration_semi) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'label_declarations) in
    Obj.repr(
# 1848 "parsing/parser.mly"
                                                ( _1 :: _2 )
# 10158 "parsing/parser.ml"
               : 'label_declarations))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'mutable_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'label) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'poly_type_no_attr) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1852 "parsing/parser.mly"
      (
       Type.field (mkrhs _2 2) _4 ~mut:_1 ~attrs:_5
         ~loc:(symbol_rloc()) ~info:(symbol_info ())
      )
# 10171 "parsing/parser.ml"
               : 'label_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 6 : 'mutable_flag) in
    let _2 = (Parsing.peek_val __caml_parser_env 5 : 'label) in
    let _4 = (Parsing.peek_val __caml_parser_env 3 : 'poly_type_no_attr) in
    let _5 = (Parsing.peek_val __caml_parser_env 2 : 'attributes) in
    let _7 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1859 "parsing/parser.mly"
      (
       let info =
         match rhs_info 5 with
         | Some _ as info_before_semi -> info_before_semi
         | None -> symbol_info ()
       in
       Type.field (mkrhs _2 2) _4 ~mut:_1 ~attrs:(_5 @ _7)
         ~loc:(symbol_rloc()) ~info
      )
# 10190 "parsing/parser.ml"
               : 'label_declaration_semi))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 6 : 'nonrec_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 5 : 'optional_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 4 : 'type_longident) in
    let _6 = (Parsing.peek_val __caml_parser_env 2 : 'private_flag) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'str_extension_constructors) in
    let _8 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1875 "parsing/parser.mly"
      ( if _2 <> Recursive then not_expecting 2 "nonrec flag";
        Te.mk (mkrhs _4 4) (List.rev _7) ~params:_3 ~priv:_6
          ~attrs:_8 ~docs:(symbol_docs ()) )
# 10204 "parsing/parser.ml"
               : 'str_type_extension))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 6 : 'nonrec_flag) in
    let _3 = (Parsing.peek_val __caml_parser_env 5 : 'optional_type_parameters) in
    let _4 = (Parsing.peek_val __caml_parser_env 4 : 'type_longident) in
    let _6 = (Parsing.peek_val __caml_parser_env 2 : 'private_flag) in
    let _7 = (Parsing.peek_val __caml_parser_env 1 : 'sig_extension_constructors) in
    let _8 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 1882 "parsing/parser.mly"
      ( if _2 <> Recursive then not_expecting 2 "nonrec flag";
        Te.mk (mkrhs _4 4) (List.rev _7) ~params:_3 ~priv:_6
          ~attrs:_8 ~docs:(symbol_docs ()) )
# 10218 "parsing/parser.ml"
               : 'sig_type_extension))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension_constructor_declaration) in
    Obj.repr(
# 1887 "parsing/parser.mly"
                                                          ( [_1] )
# 10225 "parsing/parser.ml"
               : 'str_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in
    Obj.repr(
# 1888 "parsing/parser.mly"
                                                          ( [_1] )
# 10232 "parsing/parser.ml"
               : 'str_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension_constructor_rebind) in
    Obj.repr(
# 1889 "parsing/parser.mly"
                                                          ( [_1] )
# 10239 "parsing/parser.ml"
               : 'str_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_rebind) in
    Obj.repr(
# 1890 "parsing/parser.mly"
                                                          ( [_1] )
# 10246 "parsing/parser.ml"
               : 'str_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'str_extension_constructors) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in
    Obj.repr(
# 1892 "parsing/parser.mly"
      ( _2 :: _1 )
# 10254 "parsing/parser.ml"
               : 'str_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'str_extension_constructors) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_rebind) in
    Obj.repr(
# 1894 "parsing/parser.mly"
      ( _2 :: _1 )
# 10262 "parsing/parser.ml"
               : 'str_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension_constructor_declaration) in
    Obj.repr(
# 1897 "parsing/parser.mly"
                                                          ( [_1] )
# 10269 "parsing/parser.ml"
               : 'sig_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in
    Obj.repr(
# 1898 "parsing/parser.mly"
                                                          ( [_1] )
# 10276 "parsing/parser.ml"
               : 'sig_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'sig_extension_constructors) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'bar_extension_constructor_declaration) in
    Obj.repr(
# 1900 "parsing/parser.mly"
      ( _2 :: _1 )
# 10284 "parsing/parser.ml"
               : 'sig_extension_constructors))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1904 "parsing/parser.mly"
      ( let args, res = _2 in
        Te.decl (mkrhs _1 1) ~args ?res ~attrs:_3
          ~loc:(symbol_rloc()) ~info:(symbol_info ()) )
# 10295 "parsing/parser.ml"
               : 'extension_constructor_declaration))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'constr_ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'generalized_constructor_arguments) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1910 "parsing/parser.mly"
      ( let args, res = _3 in
        Te.decl (mkrhs _2 2) ~args ?res ~attrs:_4
           ~loc:(symbol_rloc()) ~info:(symbol_info ()) )
# 10306 "parsing/parser.ml"
               : 'bar_extension_constructor_declaration))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'constr_ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1916 "parsing/parser.mly"
      ( Te.rebind (mkrhs _1 1) (mkrhs _3 3) ~attrs:_4
          ~loc:(symbol_rloc()) ~info:(symbol_info ()) )
# 10316 "parsing/parser.ml"
               : 'extension_constructor_rebind))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'constr_ident) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'constr_longident) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 1921 "parsing/parser.mly"
      ( Te.rebind (mkrhs _2 2) (mkrhs _4 4) ~attrs:_5
          ~loc:(symbol_rloc()) ~info:(symbol_info ()) )
# 10326 "parsing/parser.ml"
               : 'bar_extension_constructor_rebind))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'with_constraint) in
    Obj.repr(
# 1928 "parsing/parser.mly"
                                                ( [_1] )
# 10333 "parsing/parser.ml"
               : 'with_constraints))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'with_constraints) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'with_constraint) in
    Obj.repr(
# 1929 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10341 "parsing/parser.ml"
               : 'with_constraints))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'type_parameters) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'label_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'with_type_binder) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'core_type_no_attr) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'constraints) in
    Obj.repr(
# 1933 "parsing/parser.mly"
      ( Pwith_type
          (mkrhs _3 3,
           (Type.mk (mkrhs (Longident.last _3) 3)
              ~params:_2
              ~cstrs:(List.rev _6)
              ~manifest:_5
              ~priv:_4
              ~loc:(symbol_rloc()))) )
# 10359 "parsing/parser.ml"
               : 'with_constraint))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'type_parameters) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'label) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in
    Obj.repr(
# 1944 "parsing/parser.mly"
      ( Pwith_typesubst
          (Type.mk (mkrhs _3 3)
             ~params:_2
             ~manifest:_5
             ~loc:(symbol_rloc())) )
# 10372 "parsing/parser.ml"
               : 'with_constraint))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'mod_ext_longident) in
    Obj.repr(
# 1950 "parsing/parser.mly"
      ( Pwith_module (mkrhs _2 2, mkrhs _4 4) )
# 10380 "parsing/parser.ml"
               : 'with_constraint))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'mod_ext_longident) in
    Obj.repr(
# 1952 "parsing/parser.mly"
      ( Pwith_modsubst (mkrhs _2 2, mkrhs _4 4) )
# 10388 "parsing/parser.ml"
               : 'with_constraint))
; (fun __caml_parser_env ->
    Obj.repr(
# 1955 "parsing/parser.mly"
                   ( Public )
# 10394 "parsing/parser.ml"
               : 'with_type_binder))
; (fun __caml_parser_env ->
    Obj.repr(
# 1956 "parsing/parser.mly"
                   ( Private )
# 10400 "parsing/parser.ml"
               : 'with_type_binder))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 1962 "parsing/parser.mly"
                                                ( [_2] )
# 10407 "parsing/parser.ml"
               : 'typevar_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typevar_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 1963 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10415 "parsing/parser.ml"
               : 'typevar_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1967 "parsing/parser.mly"
          ( _1 )
# 10422 "parsing/parser.ml"
               : 'poly_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typevar_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 1969 "parsing/parser.mly"
          ( mktyp(Ptyp_poly(List.rev _1, _3)) )
# 10430 "parsing/parser.ml"
               : 'poly_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in
    Obj.repr(
# 1973 "parsing/parser.mly"
          ( _1 )
# 10437 "parsing/parser.ml"
               : 'poly_type_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'typevar_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in
    Obj.repr(
# 1975 "parsing/parser.mly"
          ( mktyp(Ptyp_poly(List.rev _1, _3)) )
# 10445 "parsing/parser.ml"
               : 'poly_type_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in
    Obj.repr(
# 1982 "parsing/parser.mly"
      ( _1 )
# 10452 "parsing/parser.ml"
               : 'core_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'core_type) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attribute) in
    Obj.repr(
# 1984 "parsing/parser.mly"
      ( Typ.attr _1 _2 )
# 10460 "parsing/parser.ml"
               : 'core_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in
    Obj.repr(
# 1988 "parsing/parser.mly"
      ( _1 )
# 10467 "parsing/parser.ml"
               : 'core_type_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'core_type2) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 1990 "parsing/parser.mly"
      ( mktyp(Ptyp_alias(_1, _4)) )
# 10475 "parsing/parser.ml"
               : 'core_type_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_or_tuple) in
    Obj.repr(
# 1994 "parsing/parser.mly"
      ( _1 )
# 10482 "parsing/parser.ml"
               : 'core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : string) in
    let _4 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in
    let _6 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in
    Obj.repr(
# 1996 "parsing/parser.mly"
      ( mktyp(Ptyp_arrow("?" ^ _2 , mkoption _4, _6)) )
# 10491 "parsing/parser.ml"
               : 'core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : string) in
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in
    Obj.repr(
# 1998 "parsing/parser.mly"
      ( mktyp(Ptyp_arrow("?" ^ _1 , mkoption _2, _4)) )
# 10500 "parsing/parser.ml"
               : 'core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : string) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in
    Obj.repr(
# 2000 "parsing/parser.mly"
      ( mktyp(Ptyp_arrow(_1, _3, _5)) )
# 10509 "parsing/parser.ml"
               : 'core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type2) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type2) in
    Obj.repr(
# 2002 "parsing/parser.mly"
      ( mktyp(Ptyp_arrow("", _1, _3)) )
# 10517 "parsing/parser.ml"
               : 'core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type2) in
    Obj.repr(
# 2007 "parsing/parser.mly"
      ( _1 )
# 10524 "parsing/parser.ml"
               : 'simple_core_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'core_type_comma_list) in
    Obj.repr(
# 2009 "parsing/parser.mly"
      ( match _2 with [sty] -> sty | _ -> raise Parse_error )
# 10531 "parsing/parser.ml"
               : 'simple_core_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type2) in
    Obj.repr(
# 2014 "parsing/parser.mly"
      ( _1 )
# 10538 "parsing/parser.ml"
               : 'simple_core_type_no_attr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'core_type_comma_list) in
    Obj.repr(
# 2016 "parsing/parser.mly"
      ( match _2 with [sty] -> sty | _ -> raise Parse_error )
# 10545 "parsing/parser.ml"
               : 'simple_core_type_no_attr))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 2021 "parsing/parser.mly"
      ( mktyp(Ptyp_var _2) )
# 10552 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    Obj.repr(
# 2023 "parsing/parser.mly"
      ( mktyp(Ptyp_any) )
# 10558 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in
    Obj.repr(
# 2025 "parsing/parser.mly"
      ( mktyp(Ptyp_constr(mkrhs _1 1, [])) )
# 10565 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'simple_core_type2) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in
    Obj.repr(
# 2027 "parsing/parser.mly"
      ( mktyp(Ptyp_constr(mkrhs _2 2, [_1])) )
# 10573 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'type_longident) in
    Obj.repr(
# 2029 "parsing/parser.mly"
      ( mktyp(Ptyp_constr(mkrhs _4 4, List.rev _2)) )
# 10581 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'meth_list) in
    Obj.repr(
# 2031 "parsing/parser.mly"
      ( let (f, c) = _2 in mktyp(Ptyp_object (f, c)) )
# 10588 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    Obj.repr(
# 2033 "parsing/parser.mly"
      ( mktyp(Ptyp_object ([], Closed)) )
# 10594 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in
    Obj.repr(
# 2035 "parsing/parser.mly"
      ( mktyp(Ptyp_class(mkrhs _2 2, [])) )
# 10601 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type2) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in
    Obj.repr(
# 2037 "parsing/parser.mly"
      ( mktyp(Ptyp_class(mkrhs _3 3, [_1])) )
# 10609 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'core_type_comma_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'class_longident) in
    Obj.repr(
# 2039 "parsing/parser.mly"
      ( mktyp(Ptyp_class(mkrhs _5 5, List.rev _2)) )
# 10617 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'tag_field) in
    Obj.repr(
# 2041 "parsing/parser.mly"
      ( mktyp(Ptyp_variant([_2], Closed, None)) )
# 10624 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in
    Obj.repr(
# 2047 "parsing/parser.mly"
      ( mktyp(Ptyp_variant(List.rev _3, Closed, None)) )
# 10631 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 3 : 'row_field) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in
    Obj.repr(
# 2049 "parsing/parser.mly"
      ( mktyp(Ptyp_variant(_2 :: List.rev _4, Closed, None)) )
# 10639 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'opt_bar) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in
    Obj.repr(
# 2051 "parsing/parser.mly"
      ( mktyp(Ptyp_variant(List.rev _3, Open, None)) )
# 10647 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    Obj.repr(
# 2053 "parsing/parser.mly"
      ( mktyp(Ptyp_variant([], Open, None)) )
# 10653 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'opt_bar) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'row_field_list) in
    Obj.repr(
# 2055 "parsing/parser.mly"
      ( mktyp(Ptyp_variant(List.rev _3, Closed, Some [])) )
# 10661 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 4 : 'opt_bar) in
    let _3 = (Parsing.peek_val __caml_parser_env 3 : 'row_field_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag_list) in
    Obj.repr(
# 2057 "parsing/parser.mly"
      ( mktyp(Ptyp_variant(List.rev _3, Closed, Some (List.rev _5))) )
# 10670 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'package_type) in
    Obj.repr(
# 2059 "parsing/parser.mly"
      ( mktyp(Ptyp_package _3) )
# 10677 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'extension) in
    Obj.repr(
# 2061 "parsing/parser.mly"
      ( mktyp (Ptyp_extension _1) )
# 10684 "parsing/parser.ml"
               : 'simple_core_type2))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mty_longident) in
    Obj.repr(
# 2064 "parsing/parser.mly"
                  ( (mkrhs _1 1, []) )
# 10691 "parsing/parser.ml"
               : 'package_type))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mty_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'package_type_cstrs) in
    Obj.repr(
# 2065 "parsing/parser.mly"
                                          ( (mkrhs _1 1, _3) )
# 10699 "parsing/parser.ml"
               : 'package_type))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'label_longident) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 2068 "parsing/parser.mly"
                                         ( (mkrhs _2 2, _4) )
# 10707 "parsing/parser.ml"
               : 'package_type_cstr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'package_type_cstr) in
    Obj.repr(
# 2071 "parsing/parser.mly"
                      ( [_1] )
# 10714 "parsing/parser.ml"
               : 'package_type_cstrs))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'package_type_cstr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'package_type_cstrs) in
    Obj.repr(
# 2072 "parsing/parser.mly"
                                             ( _1::_3 )
# 10722 "parsing/parser.ml"
               : 'package_type_cstrs))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'row_field) in
    Obj.repr(
# 2075 "parsing/parser.mly"
                                                ( [_1] )
# 10729 "parsing/parser.ml"
               : 'row_field_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'row_field_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'row_field) in
    Obj.repr(
# 2076 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10737 "parsing/parser.ml"
               : 'row_field_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'tag_field) in
    Obj.repr(
# 2079 "parsing/parser.mly"
                                                ( _1 )
# 10744 "parsing/parser.ml"
               : 'row_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in
    Obj.repr(
# 2080 "parsing/parser.mly"
                                                ( Rinherit _1 )
# 10751 "parsing/parser.ml"
               : 'row_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 4 : 'name_tag) in
    let _3 = (Parsing.peek_val __caml_parser_env 2 : 'opt_ampersand) in
    let _4 = (Parsing.peek_val __caml_parser_env 1 : 'amper_type_list) in
    let _5 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 2084 "parsing/parser.mly"
      ( Rtag (_1, _5, _3, List.rev _4) )
# 10761 "parsing/parser.ml"
               : 'tag_field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 2086 "parsing/parser.mly"
      ( Rtag (_1, _2, true, []) )
# 10769 "parsing/parser.ml"
               : 'tag_field))
; (fun __caml_parser_env ->
    Obj.repr(
# 2089 "parsing/parser.mly"
                                                ( true )
# 10775 "parsing/parser.ml"
               : 'opt_ampersand))
; (fun __caml_parser_env ->
    Obj.repr(
# 2090 "parsing/parser.mly"
                                                ( false )
# 10781 "parsing/parser.ml"
               : 'opt_ampersand))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in
    Obj.repr(
# 2093 "parsing/parser.mly"
                                                ( [_1] )
# 10788 "parsing/parser.ml"
               : 'amper_type_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'amper_type_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_no_attr) in
    Obj.repr(
# 2094 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10796 "parsing/parser.ml"
               : 'amper_type_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in
    Obj.repr(
# 2097 "parsing/parser.mly"
                                                ( [_1] )
# 10803 "parsing/parser.ml"
               : 'name_tag_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'name_tag_list) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'name_tag) in
    Obj.repr(
# 2098 "parsing/parser.mly"
                                                ( _2 :: _1 )
# 10811 "parsing/parser.ml"
               : 'name_tag_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in
    Obj.repr(
# 2101 "parsing/parser.mly"
                                             ( _1 )
# 10818 "parsing/parser.ml"
               : 'simple_core_type_or_tuple))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_list) in
    Obj.repr(
# 2103 "parsing/parser.mly"
      ( mktyp(Ptyp_tuple(_1 :: List.rev _3)) )
# 10826 "parsing/parser.ml"
               : 'simple_core_type_or_tuple))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_no_attr) in
    Obj.repr(
# 2107 "parsing/parser.mly"
      ( _1 )
# 10833 "parsing/parser.ml"
               : 'simple_core_type_or_tuple_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'simple_core_type_no_attr) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type_list_no_attr) in
    Obj.repr(
# 2109 "parsing/parser.mly"
      ( mktyp(Ptyp_tuple(_1 :: List.rev _3)) )
# 10841 "parsing/parser.ml"
               : 'simple_core_type_or_tuple_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 2112 "parsing/parser.mly"
                                                ( [_1] )
# 10848 "parsing/parser.ml"
               : 'core_type_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_comma_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 2113 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10856 "parsing/parser.ml"
               : 'core_type_comma_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in
    Obj.repr(
# 2116 "parsing/parser.mly"
                                             ( [_1] )
# 10863 "parsing/parser.ml"
               : 'core_type_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type) in
    Obj.repr(
# 2117 "parsing/parser.mly"
                                                ( _3 :: _1 )
# 10871 "parsing/parser.ml"
               : 'core_type_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_no_attr) in
    Obj.repr(
# 2120 "parsing/parser.mly"
                                                 ( [_1] )
# 10878 "parsing/parser.ml"
               : 'core_type_list_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'core_type_list) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'simple_core_type_no_attr) in
    Obj.repr(
# 2121 "parsing/parser.mly"
                                                 ( _3 :: _1 )
# 10886 "parsing/parser.ml"
               : 'core_type_list_no_attr))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'field) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'meth_list) in
    Obj.repr(
# 2124 "parsing/parser.mly"
                                             ( let (f, c) = _3 in (_1 :: f, c) )
# 10894 "parsing/parser.ml"
               : 'meth_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'field) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'opt_semi) in
    Obj.repr(
# 2125 "parsing/parser.mly"
                                                ( [_1], Closed )
# 10902 "parsing/parser.ml"
               : 'meth_list))
; (fun __caml_parser_env ->
    Obj.repr(
# 2126 "parsing/parser.mly"
                                                ( [], Open )
# 10908 "parsing/parser.ml"
               : 'meth_list))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'label) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'poly_type_no_attr) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 2129 "parsing/parser.mly"
                                                ( (_1, _4, _3) )
# 10917 "parsing/parser.ml"
               : 'field))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2132 "parsing/parser.mly"
                                                ( _1 )
# 10924 "parsing/parser.ml"
               : 'label))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : int) in
    Obj.repr(
# 2138 "parsing/parser.mly"
                                      ( Const_int _1 )
# 10931 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : char) in
    Obj.repr(
# 2139 "parsing/parser.mly"
                                      ( Const_char _1 )
# 10938 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string * string option) in
    Obj.repr(
# 2140 "parsing/parser.mly"
                                      ( let (s, d) = _1 in Const_string (s, d) )
# 10945 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2141 "parsing/parser.mly"
                                      ( Const_float _1 )
# 10952 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : int32) in
    Obj.repr(
# 2142 "parsing/parser.mly"
                                      ( Const_int32 _1 )
# 10959 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : int64) in
    Obj.repr(
# 2143 "parsing/parser.mly"
                                      ( Const_int64 _1 )
# 10966 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : nativeint) in
    Obj.repr(
# 2144 "parsing/parser.mly"
                                      ( Const_nativeint _1 )
# 10973 "parsing/parser.ml"
               : 'constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'constant) in
    Obj.repr(
# 2147 "parsing/parser.mly"
                                           ( _1 )
# 10980 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : int) in
    Obj.repr(
# 2148 "parsing/parser.mly"
                                           ( Const_int(- _2) )
# 10987 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2149 "parsing/parser.mly"
                                           ( Const_float("-" ^ _2) )
# 10994 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : int32) in
    Obj.repr(
# 2150 "parsing/parser.mly"
                                           ( Const_int32(Int32.neg _2) )
# 11001 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : int64) in
    Obj.repr(
# 2151 "parsing/parser.mly"
                                           ( Const_int64(Int64.neg _2) )
# 11008 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : nativeint) in
    Obj.repr(
# 2152 "parsing/parser.mly"
                                           ( Const_nativeint(Nativeint.neg _2) )
# 11015 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : int) in
    Obj.repr(
# 2153 "parsing/parser.mly"
                                           ( Const_int _2 )
# 11022 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2154 "parsing/parser.mly"
                                           ( Const_float _2 )
# 11029 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : int32) in
    Obj.repr(
# 2155 "parsing/parser.mly"
                                           ( Const_int32 _2 )
# 11036 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : int64) in
    Obj.repr(
# 2156 "parsing/parser.mly"
                                           ( Const_int64 _2 )
# 11043 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : nativeint) in
    Obj.repr(
# 2157 "parsing/parser.mly"
                                           ( Const_nativeint _2 )
# 11050 "parsing/parser.ml"
               : 'signed_constant))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2163 "parsing/parser.mly"
                                                ( _1 )
# 11057 "parsing/parser.ml"
               : 'ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2164 "parsing/parser.mly"
                                                ( _1 )
# 11064 "parsing/parser.ml"
               : 'ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2167 "parsing/parser.mly"
                                                ( _1 )
# 11071 "parsing/parser.ml"
               : 'val_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'operator) in
    Obj.repr(
# 2168 "parsing/parser.mly"
                                                ( _2 )
# 11078 "parsing/parser.ml"
               : 'val_ident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'operator) in
    Obj.repr(
# 2169 "parsing/parser.mly"
                                                ( unclosed "(" 1 ")" 3 )
# 11085 "parsing/parser.ml"
               : 'val_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2170 "parsing/parser.mly"
                                                ( expecting 2 "operator" )
# 11091 "parsing/parser.ml"
               : 'val_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2171 "parsing/parser.mly"
                                                ( expecting 3 "module-expr" )
# 11097 "parsing/parser.ml"
               : 'val_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2174 "parsing/parser.mly"
                                                ( _1 )
# 11104 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2175 "parsing/parser.mly"
                                                ( _1 )
# 11111 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2176 "parsing/parser.mly"
                                                ( _1 )
# 11118 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2177 "parsing/parser.mly"
                                                ( _1 )
# 11125 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2178 "parsing/parser.mly"
                                                ( _1 )
# 11132 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2179 "parsing/parser.mly"
                                                ( _1 )
# 11139 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2180 "parsing/parser.mly"
                                                ( _1 )
# 11146 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2181 "parsing/parser.mly"
                                                ( "!" )
# 11152 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2182 "parsing/parser.mly"
                                                ( "+" )
# 11158 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2183 "parsing/parser.mly"
                                                ( "+." )
# 11164 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2184 "parsing/parser.mly"
                                                ( "-" )
# 11170 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2185 "parsing/parser.mly"
                                                ( "-." )
# 11176 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2186 "parsing/parser.mly"
                                                ( "*" )
# 11182 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2187 "parsing/parser.mly"
                                                ( "=" )
# 11188 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2188 "parsing/parser.mly"
                                                ( "<" )
# 11194 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2189 "parsing/parser.mly"
                                                ( ">" )
# 11200 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2190 "parsing/parser.mly"
                                                ( "or" )
# 11206 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2191 "parsing/parser.mly"
                                                ( "||" )
# 11212 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2192 "parsing/parser.mly"
                                                ( "&" )
# 11218 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2193 "parsing/parser.mly"
                                                ( "&&" )
# 11224 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2194 "parsing/parser.mly"
                                                ( ":=" )
# 11230 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2195 "parsing/parser.mly"
                                                ( "+=" )
# 11236 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    Obj.repr(
# 2196 "parsing/parser.mly"
                                                ( "%" )
# 11242 "parsing/parser.ml"
               : 'operator))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2199 "parsing/parser.mly"
                                                ( _1 )
# 11249 "parsing/parser.ml"
               : 'constr_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2201 "parsing/parser.mly"
                                                ( "()" )
# 11255 "parsing/parser.ml"
               : 'constr_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2202 "parsing/parser.mly"
                                                ( "::" )
# 11261 "parsing/parser.ml"
               : 'constr_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2204 "parsing/parser.mly"
                                                ( "false" )
# 11267 "parsing/parser.ml"
               : 'constr_ident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2205 "parsing/parser.mly"
                                                ( "true" )
# 11273 "parsing/parser.ml"
               : 'constr_ident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in
    Obj.repr(
# 2209 "parsing/parser.mly"
                                                ( Lident _1 )
# 11280 "parsing/parser.ml"
               : 'val_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'val_ident) in
    Obj.repr(
# 2210 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11288 "parsing/parser.ml"
               : 'val_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'mod_longident) in
    Obj.repr(
# 2213 "parsing/parser.mly"
                                                ( _1 )
# 11295 "parsing/parser.ml"
               : 'constr_longident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2214 "parsing/parser.mly"
                                                ( Lident "[]" )
# 11301 "parsing/parser.ml"
               : 'constr_longident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2215 "parsing/parser.mly"
                                                ( Lident "()" )
# 11307 "parsing/parser.ml"
               : 'constr_longident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2216 "parsing/parser.mly"
                                                ( Lident "false" )
# 11313 "parsing/parser.ml"
               : 'constr_longident))
; (fun __caml_parser_env ->
    Obj.repr(
# 2217 "parsing/parser.mly"
                                                ( Lident "true" )
# 11319 "parsing/parser.ml"
               : 'constr_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2220 "parsing/parser.mly"
                                                ( Lident _1 )
# 11326 "parsing/parser.ml"
               : 'label_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2221 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11334 "parsing/parser.ml"
               : 'label_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2224 "parsing/parser.mly"
                                                ( Lident _1 )
# 11341 "parsing/parser.ml"
               : 'type_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2225 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11349 "parsing/parser.ml"
               : 'type_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2228 "parsing/parser.mly"
                                                ( Lident _1 )
# 11356 "parsing/parser.ml"
               : 'mod_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2229 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11364 "parsing/parser.ml"
               : 'mod_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2232 "parsing/parser.mly"
                                                ( Lident _1 )
# 11371 "parsing/parser.ml"
               : 'mod_ext_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2233 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11379 "parsing/parser.ml"
               : 'mod_ext_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : 'mod_ext_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'mod_ext_longident) in
    Obj.repr(
# 2234 "parsing/parser.mly"
                                                      ( lapply _1 _3 )
# 11387 "parsing/parser.ml"
               : 'mod_ext_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 2237 "parsing/parser.mly"
                                                ( Lident _1 )
# 11394 "parsing/parser.ml"
               : 'mty_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 2238 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11402 "parsing/parser.ml"
               : 'mty_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2241 "parsing/parser.mly"
                                                ( Lident _1 )
# 11409 "parsing/parser.ml"
               : 'clty_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_ext_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2242 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11417 "parsing/parser.ml"
               : 'clty_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2245 "parsing/parser.mly"
                                                ( Lident _1 )
# 11424 "parsing/parser.ml"
               : 'class_longident))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'mod_longident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2246 "parsing/parser.mly"
                                                ( Ldot(_1, _3) )
# 11432 "parsing/parser.ml"
               : 'class_longident))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 2252 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_none) )
# 11439 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : string * string option) in
    Obj.repr(
# 2253 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_string (fst _3)) )
# 11447 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : int) in
    Obj.repr(
# 2254 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_int _3) )
# 11455 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'val_longident) in
    Obj.repr(
# 2255 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_ident _3) )
# 11463 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ident) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'mod_longident) in
    Obj.repr(
# 2256 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_ident _3) )
# 11471 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ident) in
    Obj.repr(
# 2257 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_bool false) )
# 11478 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'ident) in
    Obj.repr(
# 2258 "parsing/parser.mly"
                                ( Ptop_dir(_2, Pdir_bool true) )
# 11485 "parsing/parser.ml"
               : 'toplevel_directive))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'ident) in
    Obj.repr(
# 2264 "parsing/parser.mly"
                                                ( _2 )
# 11492 "parsing/parser.ml"
               : 'name_tag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2267 "parsing/parser.mly"
                                                ( Nonrecursive )
# 11498 "parsing/parser.ml"
               : 'rec_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2268 "parsing/parser.mly"
                                                ( Recursive )
# 11504 "parsing/parser.ml"
               : 'rec_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2271 "parsing/parser.mly"
                                                ( Recursive )
# 11510 "parsing/parser.ml"
               : 'nonrec_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2272 "parsing/parser.mly"
                                                ( Nonrecursive )
# 11516 "parsing/parser.ml"
               : 'nonrec_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2275 "parsing/parser.mly"
                                                ( Upto )
# 11522 "parsing/parser.ml"
               : 'direction_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2276 "parsing/parser.mly"
                                                ( Downto )
# 11528 "parsing/parser.ml"
               : 'direction_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2279 "parsing/parser.mly"
                                                ( Public )
# 11534 "parsing/parser.ml"
               : 'private_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2280 "parsing/parser.mly"
                                                ( Private )
# 11540 "parsing/parser.ml"
               : 'private_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2283 "parsing/parser.mly"
                                                ( Immutable )
# 11546 "parsing/parser.ml"
               : 'mutable_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2284 "parsing/parser.mly"
                                                ( Mutable )
# 11552 "parsing/parser.ml"
               : 'mutable_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2287 "parsing/parser.mly"
                                                ( Concrete )
# 11558 "parsing/parser.ml"
               : 'virtual_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2288 "parsing/parser.mly"
                                                ( Virtual )
# 11564 "parsing/parser.ml"
               : 'virtual_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2291 "parsing/parser.mly"
                 ( Public, Concrete )
# 11570 "parsing/parser.ml"
               : 'private_virtual_flags))
; (fun __caml_parser_env ->
    Obj.repr(
# 2292 "parsing/parser.mly"
            ( Private, Concrete )
# 11576 "parsing/parser.ml"
               : 'private_virtual_flags))
; (fun __caml_parser_env ->
    Obj.repr(
# 2293 "parsing/parser.mly"
            ( Public, Virtual )
# 11582 "parsing/parser.ml"
               : 'private_virtual_flags))
; (fun __caml_parser_env ->
    Obj.repr(
# 2294 "parsing/parser.mly"
                    ( Private, Virtual )
# 11588 "parsing/parser.ml"
               : 'private_virtual_flags))
; (fun __caml_parser_env ->
    Obj.repr(
# 2295 "parsing/parser.mly"
                    ( Private, Virtual )
# 11594 "parsing/parser.ml"
               : 'private_virtual_flags))
; (fun __caml_parser_env ->
    Obj.repr(
# 2298 "parsing/parser.mly"
                                                ( Fresh )
# 11600 "parsing/parser.ml"
               : 'override_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2299 "parsing/parser.mly"
                                                ( Override )
# 11606 "parsing/parser.ml"
               : 'override_flag))
; (fun __caml_parser_env ->
    Obj.repr(
# 2302 "parsing/parser.mly"
                                                ( () )
# 11612 "parsing/parser.ml"
               : 'opt_bar))
; (fun __caml_parser_env ->
    Obj.repr(
# 2303 "parsing/parser.mly"
                                                ( () )
# 11618 "parsing/parser.ml"
               : 'opt_bar))
; (fun __caml_parser_env ->
    Obj.repr(
# 2306 "parsing/parser.mly"
                                                ( () )
# 11624 "parsing/parser.ml"
               : 'opt_semi))
; (fun __caml_parser_env ->
    Obj.repr(
# 2307 "parsing/parser.mly"
                                                ( () )
# 11630 "parsing/parser.ml"
               : 'opt_semi))
; (fun __caml_parser_env ->
    Obj.repr(
# 2310 "parsing/parser.mly"
                                                ( "-" )
# 11636 "parsing/parser.ml"
               : 'subtractive))
; (fun __caml_parser_env ->
    Obj.repr(
# 2311 "parsing/parser.mly"
                                                ( "-." )
# 11642 "parsing/parser.ml"
               : 'subtractive))
; (fun __caml_parser_env ->
    Obj.repr(
# 2314 "parsing/parser.mly"
                                                ( "+" )
# 11648 "parsing/parser.ml"
               : 'additive))
; (fun __caml_parser_env ->
    Obj.repr(
# 2315 "parsing/parser.mly"
                                                ( "+." )
# 11654 "parsing/parser.ml"
               : 'additive))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2321 "parsing/parser.mly"
           ( _1 )
# 11661 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 2322 "parsing/parser.mly"
           ( _1 )
# 11668 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2323 "parsing/parser.mly"
        ( "and" )
# 11674 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2324 "parsing/parser.mly"
       ( "as" )
# 11680 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2325 "parsing/parser.mly"
           ( "assert" )
# 11686 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2326 "parsing/parser.mly"
          ( "begin" )
# 11692 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2327 "parsing/parser.mly"
          ( "class" )
# 11698 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2328 "parsing/parser.mly"
               ( "constraint" )
# 11704 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2329 "parsing/parser.mly"
       ( "do" )
# 11710 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2330 "parsing/parser.mly"
         ( "done" )
# 11716 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2331 "parsing/parser.mly"
           ( "downto" )
# 11722 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2332 "parsing/parser.mly"
         ( "else" )
# 11728 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2333 "parsing/parser.mly"
        ( "end" )
# 11734 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2334 "parsing/parser.mly"
              ( "exception" )
# 11740 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2335 "parsing/parser.mly"
             ( "external" )
# 11746 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2336 "parsing/parser.mly"
          ( "false" )
# 11752 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2337 "parsing/parser.mly"
        ( "for" )
# 11758 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2338 "parsing/parser.mly"
        ( "fun" )
# 11764 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2339 "parsing/parser.mly"
             ( "function" )
# 11770 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2340 "parsing/parser.mly"
            ( "functor" )
# 11776 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2341 "parsing/parser.mly"
       ( "if" )
# 11782 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2342 "parsing/parser.mly"
       ( "in" )
# 11788 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2343 "parsing/parser.mly"
            ( "include" )
# 11794 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2344 "parsing/parser.mly"
            ( "inherit" )
# 11800 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2345 "parsing/parser.mly"
                ( "initializer" )
# 11806 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2346 "parsing/parser.mly"
         ( "lazy" )
# 11812 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2347 "parsing/parser.mly"
        ( "let" )
# 11818 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2348 "parsing/parser.mly"
          ( "match" )
# 11824 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2349 "parsing/parser.mly"
           ( "method" )
# 11830 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2350 "parsing/parser.mly"
           ( "module" )
# 11836 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2351 "parsing/parser.mly"
            ( "mutable" )
# 11842 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2352 "parsing/parser.mly"
        ( "new" )
# 11848 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2353 "parsing/parser.mly"
           ( "object" )
# 11854 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2354 "parsing/parser.mly"
       ( "of" )
# 11860 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2355 "parsing/parser.mly"
         ( "open" )
# 11866 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2356 "parsing/parser.mly"
       ( "or" )
# 11872 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2357 "parsing/parser.mly"
            ( "private" )
# 11878 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2358 "parsing/parser.mly"
        ( "rec" )
# 11884 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2359 "parsing/parser.mly"
        ( "sig" )
# 11890 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2360 "parsing/parser.mly"
           ( "struct" )
# 11896 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2361 "parsing/parser.mly"
         ( "then" )
# 11902 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2362 "parsing/parser.mly"
       ( "to" )
# 11908 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2363 "parsing/parser.mly"
         ( "true" )
# 11914 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2364 "parsing/parser.mly"
        ( "try" )
# 11920 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2365 "parsing/parser.mly"
         ( "type" )
# 11926 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2366 "parsing/parser.mly"
        ( "val" )
# 11932 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2367 "parsing/parser.mly"
            ( "virtual" )
# 11938 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2368 "parsing/parser.mly"
         ( "when" )
# 11944 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2369 "parsing/parser.mly"
          ( "while" )
# 11950 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    Obj.repr(
# 2370 "parsing/parser.mly"
         ( "with" )
# 11956 "parsing/parser.ml"
               : 'single_attr_id))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'single_attr_id) in
    Obj.repr(
# 2375 "parsing/parser.mly"
                   ( mkloc _1 (symbol_rloc()) )
# 11963 "parsing/parser.ml"
               : 'attr_id))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : 'single_attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attr_id) in
    Obj.repr(
# 2376 "parsing/parser.mly"
                               ( mkloc (_1 ^ "." ^ _3.txt) (symbol_rloc()))
# 11971 "parsing/parser.ml"
               : 'attr_id))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in
    Obj.repr(
# 2379 "parsing/parser.mly"
                                      ( (_2, _3) )
# 11979 "parsing/parser.ml"
               : 'attribute))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in
    Obj.repr(
# 2382 "parsing/parser.mly"
                                        ( (_2, _3) )
# 11987 "parsing/parser.ml"
               : 'post_item_attribute))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in
    Obj.repr(
# 2385 "parsing/parser.mly"
                                          ( (_2, _3) )
# 11995 "parsing/parser.ml"
               : 'floating_attribute))
; (fun __caml_parser_env ->
    Obj.repr(
# 2388 "parsing/parser.mly"
                 ( [] )
# 12001 "parsing/parser.ml"
               : 'post_item_attributes))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'post_item_attribute) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'post_item_attributes) in
    Obj.repr(
# 2389 "parsing/parser.mly"
                                             ( _1 :: _2 )
# 12009 "parsing/parser.ml"
               : 'post_item_attributes))
; (fun __caml_parser_env ->
    Obj.repr(
# 2392 "parsing/parser.mly"
               ( [] )
# 12015 "parsing/parser.ml"
               : 'attributes))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'attribute) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 2393 "parsing/parser.mly"
                         ( _1 :: _2 )
# 12023 "parsing/parser.ml"
               : 'attributes))
; (fun __caml_parser_env ->
    Obj.repr(
# 2396 "parsing/parser.mly"
                 ( None, [] )
# 12029 "parsing/parser.ml"
               : 'ext_attributes))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'attribute) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 2397 "parsing/parser.mly"
                         ( None, _1 :: _2 )
# 12037 "parsing/parser.ml"
               : 'ext_attributes))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'attributes) in
    Obj.repr(
# 2398 "parsing/parser.mly"
                               ( Some _2, _3 )
# 12045 "parsing/parser.ml"
               : 'ext_attributes))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in
    Obj.repr(
# 2401 "parsing/parser.mly"
                                           ( (_2, _3) )
# 12053 "parsing/parser.ml"
               : 'extension))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'attr_id) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'payload) in
    Obj.repr(
# 2404 "parsing/parser.mly"
                                                  ( (_2, _3) )
# 12061 "parsing/parser.ml"
               : 'item_extension))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : 'structure) in
    Obj.repr(
# 2407 "parsing/parser.mly"
              ( PStr _1 )
# 12068 "parsing/parser.ml"
               : 'payload))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'core_type) in
    Obj.repr(
# 2408 "parsing/parser.mly"
                    ( PTyp _2 )
# 12075 "parsing/parser.ml"
               : 'payload))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'pattern) in
    Obj.repr(
# 2409 "parsing/parser.mly"
                     ( PPat (_2, None) )
# 12082 "parsing/parser.ml"
               : 'payload))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 2 : 'pattern) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'seq_expr) in
    Obj.repr(
# 2410 "parsing/parser.mly"
                                   ( PPat (_2, Some _4) )
# 12090 "parsing/parser.ml"
               : 'payload))
(* Entry implementation *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
(* Entry interface *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
(* Entry toplevel_phrase *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
(* Entry use_file *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
(* Entry parse_core_type *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
(* Entry parse_expression *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
(* Entry parse_pattern *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|]
let yytables =
  { Parsing.actions=yyact;
    Parsing.transl_const=yytransl_const;
    Parsing.transl_block=yytransl_block;
    Parsing.lhs=yylhs;
    Parsing.len=yylen;
    Parsing.defred=yydefred;
    Parsing.dgoto=yydgoto;
    Parsing.sindex=yysindex;
    Parsing.rindex=yyrindex;
    Parsing.gindex=yygindex;
    Parsing.tablesize=yytablesize;
    Parsing.table=yytable;
    Parsing.check=yycheck;
    Parsing.error_function=parse_error;
    Parsing.names_const=yynames_const;
    Parsing.names_block=yynames_block }
let implementation (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 1 lexfun lexbuf : Parsetree.structure)
let interface (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 2 lexfun lexbuf : Parsetree.signature)
let toplevel_phrase (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 3 lexfun lexbuf : Parsetree.toplevel_phrase)
let use_file (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 4 lexfun lexbuf : Parsetree.toplevel_phrase list)
let parse_core_type (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 5 lexfun lexbuf : Parsetree.core_type)
let parse_expression (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 6 lexfun lexbuf : Parsetree.expression)
let parse_pattern (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 7 lexfun lexbuf : Parsetree.pattern)
;;

end
module Lexer : sig 
#1 "lexer.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* The lexical analyzer *)

val init : unit -> unit
val token: Lexing.lexbuf -> Parser.token
val skip_sharp_bang: Lexing.lexbuf -> unit

type directive_type 

(* type directive_value = *)
(*   | Dir_bool of bool  *)
(*   | Dir_float of float *)
(*   | Dir_int of int *)
(*   | Dir_string of string *)
(*   | Dir_null *)

type error =
  | Illegal_character of char
  | Illegal_escape of string
  | Unterminated_comment of Location.t
  | Unterminated_string
  | Unterminated_string_in_comment of Location.t * Location.t
  | Keyword_as_label of string
  | Literal_overflow of string
  | Unterminated_paren_in_conditional
  | Unterminated_if
  | Unterminated_else 
  | Unexpected_token_in_conditional 
  | Expect_hash_then_in_conditional
  | Illegal_semver of string
  | Unexpected_directive
  | Conditional_expr_expected_type of directive_type * directive_type
;;

exception Error of error * Location.t

open Format

val report_error: formatter -> error -> unit
 (* Deprecated.  Use Location.{error_of_exn, report_error}. *)

val in_comment : unit -> bool;;
val in_string : unit -> bool;;


val print_warnings : bool ref
val comments : unit -> (string * Location.t) list
val token_with_comments : Lexing.lexbuf -> Parser.token

(*
  [set_preprocessor init preprocessor] registers [init] as the function
to call to initialize the preprocessor when the lexer is initialized,
and [preprocessor] a function that is called when a new token is needed
by the parser, as [preprocessor lexer lexbuf] where [lexer] is the
lexing function.

When a preprocessor is configured by calling [set_preprocessor], the lexer
changes its behavior to accept backslash-newline as a token-separating blank.
*)

val set_preprocessor :
  (unit -> unit) ->
  ((Lexing.lexbuf -> Parser.token) -> Lexing.lexbuf -> Parser.token) ->
  unit


(* val replace_directive_built_in_value :  *)
(*   string ->  directive_value -> unit *)

(** Raises Not_found *)
(* val find_directive_built_in_value : *)
(*   string -> directive_value *)

(* val iter_directive_built_in_value :  *)
(*   (string -> directive_value -> unit) -> unit *)


(** semantic version predicate *)
val semver : Location.t ->   string -> string -> bool

val filter_directive_from_lexbuf : Lexing.lexbuf -> (int * int) list

val replace_directive_int : string -> int -> unit
val replace_directive_string : string -> string -> unit
val replace_directive_bool : string -> bool -> unit 
val remove_directive_built_in_value : string -> unit

(** @return false means failed to define *)
val define_key_value : string -> string -> bool
val list_variables : Format.formatter -> unit

end = struct
#1 "lexer.ml"
# 15 "parsing/lexer.mll"
 
open Lexing
open Misc
open Parser

type directive_value =
  | Dir_bool of bool 
  | Dir_float of float
  | Dir_int of int
  | Dir_string of string
  | Dir_null 

type directive_type = 
  | Dir_type_bool 
  | Dir_type_float 
  | Dir_type_int 
  | Dir_type_string 
  | Dir_type_null 

let type_of_directive x =
  match x with 
  | Dir_bool _ -> Dir_type_bool
  | Dir_float _ -> Dir_type_float
  | Dir_int _ -> Dir_type_int
  | Dir_string _ -> Dir_type_string
  | Dir_null -> Dir_type_null

let string_of_type_directive x = 
  match x with 
  | Dir_type_bool  -> "bool"
  | Dir_type_float  -> "float"
  | Dir_type_int  -> "int"
  | Dir_type_string  -> "string"
  | Dir_type_null -> "null"

type error =
  | Illegal_character of char
  | Illegal_escape of string
  | Unterminated_comment of Location.t
  | Unterminated_string
  | Unterminated_string_in_comment of Location.t * Location.t
  | Keyword_as_label of string
  | Literal_overflow of string
  | Unterminated_paren_in_conditional
  | Unterminated_if
  | Unterminated_else 
  | Unexpected_token_in_conditional 
  | Expect_hash_then_in_conditional
  | Illegal_semver of string
  | Unexpected_directive 
  | Conditional_expr_expected_type of directive_type * directive_type

;;

exception Error of error * Location.t;;

let assert_same_type  lexbuf x y = 
  let lhs = type_of_directive x in let rhs =  type_of_directive y  in
  if lhs <> rhs then 
    raise (Error(Conditional_expr_expected_type(lhs,rhs), Location.curr lexbuf))
  else y

let directive_built_in_values  =
  Hashtbl.create 51


let replace_directive_built_in_value k v = 
  Hashtbl.replace directive_built_in_values k v 

let remove_directive_built_in_value k  = 
  Hashtbl.replace directive_built_in_values k Dir_null

let replace_directive_int k v = 
  Hashtbl.replace directive_built_in_values k (Dir_int v)

let replace_directive_bool k v = 
  Hashtbl.replace directive_built_in_values k (Dir_bool v)

let replace_directive_string k v = 
  Hashtbl.replace directive_built_in_values k (Dir_string v)

let () =
  (* Note we use {!Config} instead of {!Sys} becasue 
     we want to overwrite in some cases with the 
     same stdlib
  *)
  let version = 
 
    Config.version (* so that it can be overridden*)

  in
  replace_directive_built_in_value "OCAML_VERSION" 
    (Dir_string version);
  replace_directive_built_in_value "OCAML_PATCH"
    (Dir_string 
       (match String.rindex version '+' with 
       | exception Not_found -> ""
       | i -> 
           String.sub version (i + 1)
             (String.length version - i - 1)))
  ;
  replace_directive_built_in_value "OS_TYPE" 
    (Dir_string Sys.os_type);
  replace_directive_built_in_value "BIG_ENDIAN" 
    (Dir_bool Sys.big_endian);
  replace_directive_built_in_value "WORD_SIZE" 
    (Dir_int Sys.word_size)

let find_directive_built_in_value k =
  Hashtbl.find directive_built_in_values k 

let iter_directive_built_in_value f = Hashtbl.iter f directive_built_in_values

(*
   {[
     # semver 0 "12";;
     - : int * int * int * string = (12, 0, 0, "");;
     # semver 0 "12.3";;
     - : int * int * int * string = (12, 3, 0, "");;
       semver 0 "12.3.10";;
     - : int * int * int * string = (12, 3, 10, "");;
     # semver 0 "12.3.10+x";;
     - : int * int * int * string = (12, 3, 10, "+x")
   ]}
*)    
let zero = Char.code '0' 
let dot = Char.code '.'
let semantic_version_parse str start  last_index = 
  let rec aux start  acc last_index =
    if start <= last_index then
      let c = Char.code (String.unsafe_get str start) in
      if c = dot then (acc, start + 1) (* consume [4.] instead of [4]*)
      else 
        let v =  c - zero in
        if v >=0 && v <= 9  then
          aux (start + 1) (acc * 10 + v) last_index
        else (acc , start)
    else (acc, start)
  in
  let major, major_end =  aux start 0 last_index  in
  let minor, minor_end = aux major_end 0 last_index in
  let patch, patch_end = aux minor_end 0 last_index in 
  let additional = String.sub str patch_end (last_index - patch_end  +1) in
  (major, minor, patch), additional

(** 
   {[
     semver Location.none "1.2.3" "~1.3.0" = false;;
     semver Location.none "1.2.3" "^1.3.0" = true ;;
     semver Location.none "1.2.3" ">1.3.0" = false ;;
     semver Location.none "1.2.3" ">=1.3.0" = false ;;
     semver Location.none "1.2.3" "<1.3.0" = true ;;
     semver Location.none "1.2.3" "<=1.3.0" = true ;;
   ]}
*)
let semver loc lhs str =
  let last_index = String.length str - 1 in 
  if last_index < 0 then raise (Error(Illegal_semver str, loc))
  else 
    let pred, ((major, minor,patch) as version, _) = 
      let v = String.unsafe_get str 0 in 
      match v with
      | '>' -> 
          if last_index = 0 then raise (Error(Illegal_semver str, loc)) else 
          if String.unsafe_get str 1 = '=' then 
            `Ge, semantic_version_parse str 2 last_index
          else `Gt, semantic_version_parse str 1 last_index
      | '<' 
        ->
          if last_index = 0 then raise (Error(Illegal_semver str, loc)) else 
          if String.unsafe_get str 1 = '=' then 
            `Le, semantic_version_parse str 2 last_index
          else `Lt, semantic_version_parse str 1 last_index
      | '^' 
        -> `Compatible, semantic_version_parse str 1 last_index
      | '~' ->  `Approximate, semantic_version_parse str 1 last_index
      | _ -> `Exact, semantic_version_parse str 0 last_index 
    in 
    let ((l_major, l_minor, l_patch) as lversion,_) =
      semantic_version_parse lhs 0 (String.length lhs - 1) in 
    match pred with 
    | `Ge -> lversion >= version 
    | `Gt -> lversion > version 
    | `Le -> lversion <= version
    | `Lt -> lversion < version 
    | `Approximate -> major = l_major && minor = l_minor 
    |  `Compatible -> major = l_major
    | `Exact -> lversion = version 


let pp_directive_value fmt (x : directive_value) =
  match x with
  | Dir_bool b -> Format.pp_print_bool fmt b
  | Dir_int b -> Format.pp_print_int fmt b
  | Dir_float b -> Format.pp_print_float fmt b
  | Dir_string s  -> Format.fprintf fmt "%S" s
  | Dir_null -> Format.pp_print_string fmt "null"    

let list_variables fmt = 
  iter_directive_built_in_value 
    (fun s  dir_value ->
       Format.fprintf
         fmt "@[%s@ %a@]@."
         s pp_directive_value dir_value
    )

let defined str =
  begin match  find_directive_built_in_value str with 
  |  Dir_null -> false 
  | _ ->  true
  | exception _ -> 
      try ignore @@ Sys.getenv str; true with _ ->  false 
  end

let query loc str =
  begin match find_directive_built_in_value str with
  | Dir_null -> Dir_bool false
  | v -> v
  | exception Not_found ->
      begin match Sys.getenv str with 
      | v -> 
          begin 
            try Dir_bool (bool_of_string v) with 
              _ -> 
                begin 
                  try Dir_int (int_of_string v )
                  with 
                    _ -> 
                      begin try (Dir_float (float_of_string v)) 
                      with _ -> Dir_string v
                      end
                end
          end
      | exception Not_found -> 
          Dir_bool false
      end
  end


let define_key_value key v  =
  if String.length key > 0
      && Char.uppercase (key.[0]) = key.[0] then 
    begin 
      replace_directive_built_in_value key
      begin
        (* NEED Sync up across {!lexer.mll} {!bspp.ml} and here,
           TODO: put it in {!lexer.mll}
        *)
        try Dir_bool (bool_of_string v) with 
          _ -> 
          begin 
            try Dir_int (int_of_string v )
            with 
              _ -> 
              begin try (Dir_float (float_of_string v)) 
                with _ -> Dir_string v
              end
          end
      end;
    true
    end
  else false 


let value_of_token loc (t : Parser.token)  = 
  match t with 
  | INT i -> Dir_int i 
  | STRING (s,_) -> Dir_string s 
  | FLOAT s  -> Dir_float (float_of_string s)
  | TRUE -> Dir_bool true
  | FALSE -> Dir_bool false
  | UIDENT s -> query loc s 
  | _ -> raise (Error (Unexpected_token_in_conditional, loc))


let directive_parse token_with_comments lexbuf =
  let look_ahead = ref None in
  let token () : Parser.token =
    let v = !look_ahead in
    match v with 
    | Some v -> 
        look_ahead := None ;
        v
    | None ->
       let rec skip () = 
        match token_with_comments lexbuf  with
        | COMMENT _ -> skip ()

        | DOCSTRING _ -> skip ()

        | EOL -> skip ()
        | EOF -> raise (Error (Unterminated_if, Location.curr lexbuf)) 
        | t -> t 
        in  skip ()
  in
  let push e =
    (* INVARIANT: only look at most one token *)
    assert (!look_ahead = None);
    look_ahead := Some e 
  in
  let rec
    token_op calc   ~no  lhs   =
    match token () with 
    | (LESS 
    | GREATER 
    | INFIXOP0 "<=" 
    | INFIXOP0 ">=" 
    | EQUAL
    | INFIXOP0 "<>" as op) ->
        let f =  
          match op with 
          | LESS -> (<) 
          | GREATER -> (>)
          | INFIXOP0 "<=" -> (<=)
          | EQUAL -> (=)
          | INFIXOP0 "<>" -> (<>) 
          | _ -> assert false
        in 
        let curr_loc = Location.curr lexbuf in 
        let rhs = value_of_token curr_loc (token ()) in 
        not calc ||
        f lhs (assert_same_type lexbuf lhs rhs)
    | INFIXOP0 "=~" -> 
        not calc ||
        begin match lhs with 
        | Dir_string s ->
            let curr_loc = Location.curr lexbuf in 
            let rhs = value_of_token curr_loc (token ()) in 
            begin match rhs with 
            | Dir_string rhs -> 
                semver curr_loc s rhs
            | _ -> 
                raise
                  (Error
                     ( Conditional_expr_expected_type
                         (Dir_type_string, type_of_directive lhs), Location.curr lexbuf))
            end
        | _ -> raise
                 (Error
                    ( Conditional_expr_expected_type
                        (Dir_type_string, type_of_directive lhs), Location.curr lexbuf))
        end
    | e -> no e 
  and
    parse_or calc : bool =
    parse_or_aux calc (parse_and calc)
  and  (* a || (b || (c || d))*)
    parse_or_aux calc v : bool =
    (* let l = v  in *)
    match token () with
    | BARBAR ->
        let b =   parse_or (calc && not v)  in
        v || b 
    | e -> push e ; v
  and parse_and calc = 
    parse_and_aux calc (parse_relation calc)
  and parse_and_aux calc v = (* a && (b && (c && d)) *)
    (* let l = v  in *)
    match token () with
    | AMPERAMPER ->
        let b =  parse_and (calc && v) in
        v && b
    | e -> push e ; v
  and parse_relation (calc : bool) : bool  =
    let curr_token = token () in
    let curr_loc = Location.curr lexbuf in
    match curr_token with
    | TRUE -> true 
    | FALSE -> false
    | UIDENT v ->
        let value_v = query curr_loc v in
        token_op calc 
          ~no:(fun e -> push e ;
                match value_v with 
                | Dir_bool b -> b 
                | _ -> 
                    let ty = type_of_directive value_v in
                    raise
                      (Error(Conditional_expr_expected_type (Dir_type_bool, ty),
                             curr_loc)))
          value_v
    | INT v -> 
        token_op calc
          ~no:(fun e -> 
              push e ; 
              v <> 0
              (* raise(Error(Conditional_expr_expected_type(Dir_type_bool,Dir_type_int), 
                          curr_loc)) *)
              )
          (Dir_int v)
    | FLOAT v -> 
        token_op calc
          ~no:(fun e -> 
              raise (Error(Conditional_expr_expected_type(Dir_type_bool, Dir_type_float),
                           curr_loc)))
          (Dir_float (float_of_string v))
    | STRING (v,_) -> 
        token_op calc
          ~no:(fun e ->
              raise (Error
                       (Conditional_expr_expected_type(Dir_type_bool, Dir_type_string),
                        curr_loc)))
          (Dir_string v)
    | LIDENT ("defined" | "undefined" as r) ->
        let t = token () in 
        let loc = Location.curr lexbuf in
        begin match t with
        | UIDENT s -> 
            not calc || 
            if r.[0] = 'u' then 
              not @@ defined s
            else defined s 
        | _ -> raise (Error (Unexpected_token_in_conditional, loc))
        end
    | LPAREN ->
        let v = parse_or calc in
        begin match token () with
        | RPAREN ->  v
        | _ -> raise (Error(Unterminated_paren_in_conditional, Location.curr lexbuf))
        end 

    | _ -> raise (Error (Unexpected_token_in_conditional, curr_loc))
  in
  let v = parse_or true in
  begin match token () with
  | THEN ->  v 
  | _ -> raise (Error (Expect_hash_then_in_conditional, Location.curr lexbuf))
  end


type dir_conditional =
  | Dir_if_true
  | Dir_if_false
  | Dir_out 

let string_of_dir_conditional (x : dir_conditional) =
  match x with 
  | Dir_if_true -> "Dir_if_true"
  | Dir_if_false -> "Dir_if_false"
  | Dir_out -> "Dir_out"

let is_elif (i : Parser.token ) =
  match i with
  | LIDENT "elif" -> true
  | _ -> false (* avoid polymorphic equal *)


(* The table of keywords *)

let keyword_table =
  create_hashtable 149 [
    "and", AND;
    "as", AS;
    "assert", ASSERT;
    "begin", BEGIN;
    "class", CLASS;
    "constraint", CONSTRAINT;
    "do", DO;
    "done", DONE;
    "downto", DOWNTO;
    "else", ELSE;
    "end", END;
    "exception", EXCEPTION;
    "external", EXTERNAL;
    "false", FALSE;
    "for", FOR;
    "fun", FUN;
    "function", FUNCTION;
    "functor", FUNCTOR;
    "if", IF;
    "in", IN;
    "include", INCLUDE;
    "inherit", INHERIT;
    "initializer", INITIALIZER;
    "lazy", LAZY;
    "let", LET;
    "match", MATCH;
    "method", METHOD;
    "module", MODULE;
    "mutable", MUTABLE;
    "new", NEW;
    "nonrec", NONREC;
    "object", OBJECT;
    "of", OF;
    "open", OPEN;
    "or", OR;
(*  "parser", PARSER; *)
    "private", PRIVATE;
    "rec", REC;
    "sig", SIG;
    "struct", STRUCT;
    "then", THEN;
    "to", TO;
    "true", TRUE;
    "try", TRY;
    "type", TYPE;
    "val", VAL;
    "virtual", VIRTUAL;
    "when", WHEN;
    "while", WHILE;
    "with", WITH;

    "mod", INFIXOP3("mod");
    "land", INFIXOP3("land");
    "lor", INFIXOP3("lor");
    "lxor", INFIXOP3("lxor");
    "lsl", INFIXOP4("lsl");
    "lsr", INFIXOP4("lsr");
    "asr", INFIXOP4("asr")
]

(* To buffer string literals *)

let initial_string_buffer = Bytes.create 256
let string_buff = ref initial_string_buffer
let string_index = ref 0

let reset_string_buffer () =
  string_buff := initial_string_buffer;
  string_index := 0

let store_string_char c =
  if !string_index >= Bytes.length !string_buff then begin
    let new_buff = Bytes.create (Bytes.length (!string_buff) * 2) in
    Bytes.blit !string_buff 0 new_buff 0 (Bytes.length !string_buff);
    string_buff := new_buff
  end;
  Bytes.unsafe_set !string_buff !string_index c;
  incr string_index

let store_string s =
  for i = 0 to String.length s - 1 do
    store_string_char s.[i];
  done

let store_lexeme lexbuf =
  store_string (Lexing.lexeme lexbuf)

let get_stored_string () =
  let s = Bytes.sub_string !string_buff 0 !string_index in
  string_buff := initial_string_buffer;
  s

(* To store the position of the beginning of a string and comment *)
let string_start_loc = ref Location.none;;
let comment_start_loc = ref [];;
let in_comment () = !comment_start_loc <> [];;
let is_in_string = ref false
let in_string () = !is_in_string
let print_warnings = ref true
let if_then_else = ref Dir_out
let sharp_look_ahead = ref None
let update_if_then_else v = 
  (* Format.fprintf Format.err_formatter "@[update %s \n@]@." (string_of_dir_conditional v); *)
  if_then_else := v
    
let with_comment_buffer comment lexbuf =
  let start_loc = Location.curr lexbuf  in
  comment_start_loc := [start_loc];
  reset_string_buffer ();
  let end_loc = comment lexbuf in
  let s = get_stored_string () in
  reset_string_buffer ();
  let loc = { start_loc with Location.loc_end = end_loc.Location.loc_end } in
  s, loc

(* To translate escape sequences *)

let char_for_backslash = function
  | 'n' -> '\010'
  | 'r' -> '\013'
  | 'b' -> '\008'
  | 't' -> '\009'
  | c   -> c

let char_for_decimal_code lexbuf i =
  let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
           10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
                (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48) in
  if (c < 0 || c > 255) then
    if in_comment ()
    then 'x'
    else raise (Error(Illegal_escape (Lexing.lexeme lexbuf),
                      Location.curr lexbuf))
  else Char.chr c

let char_for_hexadecimal_code lexbuf i =
  let d1 = Char.code (Lexing.lexeme_char lexbuf i) in
  let val1 = if d1 >= 97 then d1 - 87
             else if d1 >= 65 then d1 - 55
             else d1 - 48
  in
  let d2 = Char.code (Lexing.lexeme_char lexbuf (i+1)) in
  let val2 = if d2 >= 97 then d2 - 87
             else if d2 >= 65 then d2 - 55
             else d2 - 48
  in
  Char.chr (val1 * 16 + val2)

(* To convert integer literals, allowing max_int + 1 (PR#4210) *)

let cvt_int_literal s =
  - int_of_string ("-" ^ s)
let cvt_int32_literal s =
  Int32.neg (Int32.of_string ("-" ^ String.sub s 0 (String.length s - 1)))
let cvt_int64_literal s =
  Int64.neg (Int64.of_string ("-" ^ String.sub s 0 (String.length s - 1)))
let cvt_nativeint_literal s =
  Nativeint.neg (Nativeint.of_string ("-" ^ String.sub s 0
                                                       (String.length s - 1)))

(* Remove underscores from float literals *)

let remove_underscores s =
  let l = String.length s in
  let b = Bytes.create l in
  let rec remove src dst =
    if src >= l then
      if dst >= l then s else Bytes.sub_string b 0 dst
    else
      match s.[src] with
        '_' -> remove (src + 1) dst
      |  c  -> Bytes.set b dst c; remove (src + 1) (dst + 1)
  in remove 0 0

(* recover the name from a LABEL or OPTLABEL token *)

let get_label_name lexbuf =
  let s = Lexing.lexeme lexbuf in
  let name = String.sub s 1 (String.length s - 2) in
  if Hashtbl.mem keyword_table name then
    raise (Error(Keyword_as_label name, Location.curr lexbuf));
  name
;;

(* Update the current location with file name and line number. *)

let update_loc lexbuf file line absolute chars =
  let pos = lexbuf.lex_curr_p in
  let new_file = match file with
                 | None -> pos.pos_fname
                 | Some s -> s
  in
  lexbuf.lex_curr_p <- { pos with
    pos_fname = new_file;
    pos_lnum = if absolute then line else pos.pos_lnum + line;
    pos_bol = pos.pos_cnum - chars;
  }
;;

let preprocessor = ref None

let escaped_newlines = ref false

(* Warn about Latin-1 characters used in idents *)

let warn_latin1 lexbuf =
  Location.prerr_warning (Location.curr lexbuf)
    (Warnings.Deprecated "ISO-Latin1 characters in identifiers")
;;

let comment_list = ref []

let add_comment com =
  comment_list := com :: !comment_list

let add_docstring_comment ds =

  let com = (Docstrings.docstring_body ds, Docstrings.docstring_loc ds) in
    add_comment com


let comments () = List.rev !comment_list

(* Error report *)

open Format

let report_error ppf = function
  | Illegal_character c ->
      fprintf ppf "Illegal character (%s)" (Char.escaped c)
  | Illegal_escape s ->
      fprintf ppf "Illegal backslash escape in string or character (%s)" s
  | Unterminated_comment _ ->
      fprintf ppf "Comment not terminated"
  | Unterminated_string ->
      fprintf ppf "String literal not terminated"
  | Unterminated_string_in_comment (_, loc) ->
      fprintf ppf "This comment contains an unterminated string literal@.\
                   %aString literal begins here"
              Location.print_error loc
  | Keyword_as_label kwd ->
      fprintf ppf "`%s' is a keyword, it cannot be used as label name" kwd
  | Literal_overflow ty ->
      fprintf ppf "Integer literal exceeds the range of representable \
                   integers of type %s" ty
  | Unterminated_if -> 
      fprintf ppf "#if not terminated"
  | Unterminated_else -> 
      fprintf ppf "#else not terminated"
  | Unexpected_directive -> fprintf ppf "Unexpected directive"
  | Unexpected_token_in_conditional -> 
      fprintf ppf "Unexpected token in conditional predicate"
  | Unterminated_paren_in_conditional ->
    fprintf ppf "Unterminated parens in conditional predicate"
  | Expect_hash_then_in_conditional -> 
      fprintf ppf "Expect `then` after conditional predicate"
  | Conditional_expr_expected_type (a,b) -> 
      fprintf ppf "Conditional expression type mismatch (%s,%s)" 
        (string_of_type_directive a )
        (string_of_type_directive b )
  | Illegal_semver s -> 
      fprintf ppf "Illegal semantic version string %s" s
let () =
  Location.register_error_of_exn
    (function
      | Error (err, loc) ->
          Some (Location.error_of_printer loc report_error err)
      | _ ->
          None
    )


# 730 "parsing/lexer.ml"
let __ocaml_lex_tables = {
  Lexing.lex_base = 
   "\000\000\164\255\165\255\224\000\003\001\038\001\073\001\108\001\
    \143\001\188\255\178\001\215\001\196\255\091\000\252\001\031\002\
    \068\000\071\000\084\000\066\002\213\255\215\255\218\255\101\002\
    \196\002\231\002\089\000\255\000\005\003\236\255\082\003\115\003\
    \188\003\140\004\092\005\044\006\011\007\103\007\055\008\125\000\
    \254\255\001\000\005\000\255\255\006\000\007\000\022\009\052\009\
    \004\010\250\255\249\255\212\010\164\011\247\255\246\255\237\255\
    \238\255\239\255\093\000\118\002\091\000\110\000\231\002\007\004\
    \215\004\101\002\254\002\118\000\194\255\235\255\120\005\132\012\
    \096\000\113\000\011\000\234\255\233\255\229\255\229\004\128\000\
    \115\000\232\255\224\000\117\000\231\255\119\006\147\000\230\255\
    \146\000\225\255\148\000\224\255\217\000\132\012\223\255\171\012\
    \175\008\174\006\222\255\012\000\024\001\044\001\080\001\045\001\
    \222\255\013\000\217\012\000\013\035\013\073\013\210\255\206\255\
    \207\255\208\255\204\255\108\013\154\000\183\000\197\255\198\255\
    \199\255\199\000\182\255\184\255\191\255\143\013\187\255\189\255\
    \178\013\213\013\248\013\027\014\235\005\243\255\244\255\017\000\
    \245\255\062\002\172\007\253\255\223\000\241\000\255\255\254\255\
    \252\255\200\007\045\014\250\000\252\000\018\000\251\255\250\255\
    \249\255\128\009\030\003\003\001\248\255\092\003\004\001\247\255\
    \079\010\005\001\246\255\043\001\199\001\247\255\248\255\249\255\
    \059\001\118\014\255\255\250\255\031\011\036\004\253\255\038\001\
    \069\001\094\001\252\004\252\255\239\011\251\255\095\001\181\001\
    \252\255\238\006\254\255\255\255\111\001\112\001\253\255\074\007\
    \016\001\019\001\050\001\063\001\026\001\107\001\033\001\019\000\
    \255\255";
  Lexing.lex_backtrk = 
   "\255\255\255\255\255\255\088\000\087\000\084\000\083\000\076\000\
    \074\000\255\255\065\000\062\000\255\255\055\000\054\000\052\000\
    \050\000\046\000\044\000\079\000\255\255\255\255\255\255\035\000\
    \034\000\041\000\039\000\038\000\060\000\255\255\014\000\014\000\
    \013\000\012\000\011\000\010\000\007\000\004\000\003\000\002\000\
    \255\255\091\000\091\000\255\255\255\255\255\255\082\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\015\000\255\255\255\255\255\255\014\000\
    \014\000\014\000\015\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\026\000\026\000\
    \026\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \027\000\255\255\028\000\255\255\029\000\086\000\255\255\089\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\036\000\085\000\080\000\043\000\255\255\255\255\
    \255\255\255\255\255\255\053\000\070\000\069\000\255\255\255\255\
    \255\255\072\000\255\255\255\255\255\255\063\000\255\255\255\255\
    \081\000\075\000\078\000\077\000\255\255\255\255\255\255\012\000\
    \255\255\012\000\012\000\255\255\012\000\012\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \008\000\008\000\255\255\255\255\005\000\005\000\255\255\001\000\
    \005\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\003\000\255\255\255\255\003\000\255\255\255\255\255\255\
    \002\000\255\255\255\255\001\000\255\255\255\255\255\255\255\255\
    \255\255";
  Lexing.lex_default = 
   "\001\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\255\255\255\255\000\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\000\000\000\000\000\000\255\255\
    \255\255\255\255\255\255\072\000\255\255\000\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \000\000\255\255\255\255\000\000\255\255\255\255\255\255\255\255\
    \255\255\000\000\000\000\255\255\255\255\000\000\000\000\000\000\
    \000\000\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\000\000\000\000\255\255\077\000\
    \255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\
    \255\255\000\000\255\255\255\255\000\000\255\255\255\255\000\000\
    \255\255\000\000\255\255\000\000\255\255\255\255\000\000\255\255\
    \100\000\255\255\000\000\255\255\100\000\101\000\100\000\103\000\
    \000\000\255\255\255\255\255\255\255\255\255\255\000\000\000\000\
    \000\000\000\000\000\000\255\255\255\255\255\255\000\000\000\000\
    \000\000\255\255\000\000\000\000\000\000\255\255\000\000\000\000\
    \255\255\255\255\255\255\255\255\133\000\000\000\000\000\255\255\
    \000\000\147\000\255\255\000\000\255\255\255\255\000\000\000\000\
    \000\000\255\255\255\255\255\255\255\255\255\255\000\000\000\000\
    \000\000\255\255\255\255\255\255\000\000\255\255\255\255\000\000\
    \255\255\255\255\000\000\255\255\165\000\000\000\000\000\000\000\
    \255\255\171\000\000\000\000\000\255\255\255\255\000\000\255\255\
    \255\255\255\255\255\255\000\000\255\255\000\000\255\255\184\000\
    \000\000\255\255\000\000\000\000\255\255\255\255\000\000\255\255\
    \255\255\255\255\194\000\197\000\255\255\197\000\255\255\255\255\
    \000\000";
  Lexing.lex_trans = 
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\039\000\040\000\040\000\039\000\041\000\045\000\043\000\
    \043\000\040\000\044\000\044\000\045\000\073\000\098\000\104\000\
    \074\000\099\000\105\000\134\000\148\000\200\000\163\000\149\000\
    \039\000\008\000\029\000\024\000\006\000\004\000\023\000\027\000\
    \026\000\021\000\025\000\007\000\020\000\019\000\018\000\003\000\
    \031\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\017\000\016\000\015\000\014\000\010\000\036\000\
    \005\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\013\000\042\000\012\000\005\000\038\000\
    \022\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\028\000\011\000\009\000\037\000\114\000\
    \116\000\113\000\110\000\088\000\112\000\111\000\039\000\076\000\
    \067\000\039\000\067\000\065\000\065\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\119\000\
    \075\000\118\000\081\000\117\000\084\000\039\000\064\000\064\000\
    \064\000\064\000\064\000\064\000\064\000\064\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\087\000\089\000\090\000\091\000\092\000\123\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\120\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\121\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \002\000\003\000\091\000\092\000\003\000\003\000\003\000\122\000\
    \143\000\073\000\003\000\003\000\074\000\003\000\003\000\003\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\003\000\142\000\003\000\003\000\003\000\003\000\
    \003\000\152\000\098\000\151\000\003\000\099\000\255\255\003\000\
    \003\000\003\000\156\000\159\000\162\000\003\000\003\000\175\000\
    \003\000\003\000\003\000\193\000\194\000\134\000\098\000\104\000\
    \163\000\099\000\105\000\198\000\195\000\003\000\003\000\003\000\
    \003\000\003\000\003\000\003\000\199\000\167\000\175\000\005\000\
    \182\000\196\000\005\000\005\000\005\000\000\000\103\000\175\000\
    \005\000\005\000\177\000\005\000\005\000\005\000\000\000\000\000\
    \000\000\102\000\098\000\071\000\003\000\099\000\003\000\000\000\
    \005\000\003\000\005\000\005\000\005\000\005\000\005\000\000\000\
    \175\000\167\000\006\000\177\000\182\000\006\000\006\000\006\000\
    \102\000\000\000\101\000\006\000\006\000\196\000\006\000\006\000\
    \006\000\187\000\187\000\000\000\189\000\189\000\000\000\003\000\
    \000\000\003\000\000\000\006\000\005\000\006\000\006\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\107\000\000\000\000\000\
    \107\000\107\000\107\000\000\000\000\000\000\000\107\000\107\000\
    \000\000\107\000\131\000\107\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\005\000\000\000\005\000\000\000\107\000\006\000\
    \107\000\130\000\107\000\107\000\107\000\000\000\000\000\000\000\
    \128\000\000\000\000\000\128\000\128\000\128\000\000\000\000\000\
    \000\000\128\000\128\000\000\000\128\000\128\000\128\000\187\000\
    \000\000\000\000\188\000\000\000\000\000\006\000\000\000\006\000\
    \000\000\128\000\107\000\128\000\129\000\128\000\128\000\128\000\
    \000\000\167\000\000\000\006\000\168\000\000\000\006\000\006\000\
    \006\000\000\000\000\000\000\000\006\000\006\000\000\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \107\000\170\000\107\000\000\000\006\000\128\000\006\000\006\000\
    \006\000\006\000\006\000\000\000\000\000\000\000\000\000\000\000\
    \006\000\000\000\000\000\006\000\006\000\006\000\000\000\255\255\
    \000\000\006\000\006\000\000\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\000\000\128\000\000\000\128\000\000\000\127\000\
    \006\000\006\000\000\000\006\000\006\000\006\000\006\000\006\000\
    \255\255\000\000\000\000\000\000\000\000\006\000\000\000\000\000\
    \006\000\006\000\006\000\169\000\000\000\000\000\006\000\006\000\
    \000\000\006\000\006\000\006\000\255\255\255\255\006\000\126\000\
    \006\000\185\000\255\255\000\000\124\000\006\000\006\000\000\000\
    \006\000\006\000\006\000\006\000\006\000\000\000\000\000\255\255\
    \006\000\000\000\000\000\006\000\006\000\006\000\000\000\000\000\
    \148\000\006\000\006\000\149\000\115\000\006\000\006\000\000\000\
    \255\255\000\000\000\000\125\000\000\000\006\000\000\000\000\000\
    \000\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\107\000\000\000\150\000\107\000\107\000\
    \107\000\000\000\000\000\255\255\107\000\107\000\000\000\107\000\
    \108\000\107\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \006\000\000\000\006\000\000\000\107\000\006\000\107\000\107\000\
    \109\000\107\000\107\000\000\000\000\000\000\000\006\000\000\000\
    \000\000\006\000\006\000\106\000\000\000\000\000\000\000\006\000\
    \006\000\000\000\006\000\006\000\006\000\065\000\065\000\000\000\
    \000\000\000\000\146\000\006\000\000\000\006\000\000\000\006\000\
    \107\000\006\000\006\000\006\000\006\000\006\000\059\000\059\000\
    \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\
    \000\000\056\000\000\000\000\000\000\000\186\000\000\000\000\000\
    \000\000\000\000\000\000\058\000\000\000\000\000\107\000\000\000\
    \107\000\000\000\000\000\006\000\065\000\000\000\000\000\166\000\
    \000\000\000\000\000\000\000\000\000\000\097\000\000\000\000\000\
    \000\000\057\000\000\000\055\000\000\000\059\000\000\000\000\000\
    \000\000\000\000\000\000\058\000\000\000\000\000\000\000\000\000\
    \000\000\006\000\000\000\006\000\097\000\095\000\000\000\095\000\
    \095\000\095\000\095\000\000\000\000\000\000\000\095\000\095\000\
    \000\000\095\000\095\000\095\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\095\000\000\000\
    \095\000\095\000\095\000\095\000\095\000\000\000\000\000\000\000\
    \003\000\000\000\000\000\003\000\003\000\003\000\000\000\000\000\
    \094\000\093\000\003\000\000\000\003\000\003\000\003\000\063\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\
    \063\000\003\000\095\000\003\000\003\000\003\000\003\000\003\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\255\255\000\000\
    \095\000\068\000\095\000\000\000\000\000\003\000\000\000\000\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\157\000\157\000\
    \157\000\157\000\157\000\157\000\157\000\157\000\157\000\157\000\
    \000\000\000\000\000\000\000\000\000\000\066\000\000\000\000\000\
    \000\000\000\000\000\000\003\000\070\000\003\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \059\000\069\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\158\000\158\000\158\000\158\000\
    \158\000\158\000\158\000\158\000\158\000\158\000\000\000\058\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\056\000\000\000\
    \000\000\059\000\000\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\000\000\000\000\000\000\
    \000\000\030\000\000\000\000\000\000\000\060\000\000\000\058\000\
    \058\000\000\000\000\000\000\000\000\000\000\000\057\000\056\000\
    \055\000\000\000\061\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\062\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\030\000\000\000\000\000\060\000\000\000\000\000\
    \058\000\000\000\000\000\000\000\000\000\000\000\000\000\057\000\
    \000\000\055\000\061\000\032\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\062\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\000\000\
    \000\000\000\000\000\000\032\000\000\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\063\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\
    \063\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\000\000\000\000\
    \000\000\000\000\000\000\056\000\178\000\178\000\178\000\178\000\
    \178\000\178\000\178\000\178\000\178\000\178\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\063\000\000\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\000\000\000\000\
    \000\000\000\000\000\000\057\000\000\000\055\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\000\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\033\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\000\000\
    \000\000\000\000\000\000\033\000\000\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\064\000\
    \064\000\064\000\064\000\064\000\064\000\064\000\064\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\000\000\
    \000\000\000\000\000\000\056\000\000\000\000\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\179\000\179\000\179\000\179\000\
    \179\000\179\000\179\000\179\000\179\000\179\000\064\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\057\000\000\000\055\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\000\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\034\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\000\000\
    \000\000\000\000\000\000\034\000\000\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\070\000\
    \000\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\000\000\069\000\134\000\000\000\000\000\
    \135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\139\000\000\000\000\000\
    \000\000\000\000\137\000\141\000\000\000\140\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\000\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\035\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\138\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\000\000\
    \000\000\000\000\000\000\035\000\000\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\086\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\000\000\000\000\000\000\000\000\000\000\000\000\097\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\097\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \000\000\000\000\000\000\136\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\000\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\000\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\046\000\000\000\000\000\046\000\
    \046\000\046\000\000\000\000\000\000\000\046\000\046\000\000\000\
    \046\000\046\000\046\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\046\000\000\000\046\000\
    \046\000\046\000\046\000\046\000\000\000\191\000\000\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\046\000\052\000\190\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\000\000\046\000\
    \046\000\046\000\000\000\046\000\046\000\046\000\000\000\000\000\
    \000\000\046\000\046\000\000\000\046\000\046\000\046\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\046\000\000\000\046\000\046\000\046\000\046\000\046\000\
    \000\000\191\000\000\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\046\000\048\000\190\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\000\000\046\000\000\000\046\000\000\000\000\000\
    \000\000\000\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\000\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\145\000\000\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \144\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\000\000\144\000\000\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\035\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\000\000\000\000\000\000\000\000\035\000\000\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \102\000\098\000\000\000\000\000\099\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\102\000\
    \000\000\101\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\000\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\000\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\046\000\
    \000\000\000\000\046\000\046\000\046\000\000\000\000\000\000\000\
    \046\000\046\000\000\000\046\000\046\000\046\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \046\000\000\000\046\000\046\000\046\000\046\000\046\000\000\000\
    \000\000\000\000\000\000\047\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\050\000\000\000\
    \000\000\000\000\000\000\000\000\046\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\000\000\
    \000\000\000\000\046\000\047\000\046\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\255\255\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\160\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\160\000\160\000\160\000\160\000\160\000\160\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\160\000\160\000\160\000\160\000\160\000\160\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\000\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\048\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\049\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\000\000\
    \000\000\000\000\000\000\048\000\000\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\161\000\
    \161\000\161\000\161\000\161\000\161\000\161\000\161\000\161\000\
    \161\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \161\000\161\000\161\000\161\000\161\000\161\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \161\000\161\000\161\000\161\000\161\000\161\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\000\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\051\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\054\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\000\000\
    \000\000\000\000\000\000\051\000\000\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\180\000\
    \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
    \180\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \180\000\180\000\180\000\180\000\180\000\180\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \180\000\180\000\180\000\180\000\180\000\180\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\000\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\052\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\053\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\000\000\
    \000\000\000\000\000\000\052\000\000\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\181\000\
    \181\000\181\000\181\000\181\000\181\000\181\000\181\000\181\000\
    \181\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \181\000\181\000\181\000\181\000\181\000\181\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \181\000\181\000\181\000\181\000\181\000\181\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\000\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\000\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\080\000\093\000\080\000\000\000\
    \093\000\093\000\093\000\080\000\000\000\000\000\093\000\093\000\
    \000\000\093\000\093\000\093\000\079\000\079\000\079\000\079\000\
    \079\000\079\000\079\000\079\000\079\000\079\000\093\000\000\000\
    \093\000\093\000\093\000\093\000\093\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\095\000\000\000\095\000\095\000\
    \095\000\095\000\000\000\000\000\000\000\095\000\095\000\000\000\
    \095\000\095\000\095\000\000\000\000\000\000\000\000\000\000\000\
    \080\000\000\000\093\000\000\000\000\000\095\000\080\000\095\000\
    \095\000\095\000\095\000\095\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\080\000\000\000\000\000\000\000\080\000\000\000\
    \080\000\000\000\006\000\000\000\078\000\006\000\006\000\006\000\
    \093\000\000\000\093\000\006\000\006\000\000\000\006\000\006\000\
    \006\000\095\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\006\000\000\000\006\000\006\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\107\000\000\000\000\000\107\000\107\000\107\000\095\000\
    \000\000\095\000\107\000\107\000\000\000\107\000\107\000\107\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000\
    \000\000\000\000\107\000\000\000\107\000\107\000\107\000\107\000\
    \107\000\000\000\000\000\000\000\107\000\000\000\000\000\107\000\
    \107\000\107\000\000\000\000\000\000\000\107\000\107\000\000\000\
    \107\000\107\000\107\000\000\000\000\000\006\000\000\000\006\000\
    \000\000\000\000\000\000\000\000\000\000\107\000\107\000\107\000\
    \107\000\107\000\107\000\107\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\107\000\000\000\000\000\107\000\107\000\107\000\
    \000\000\000\000\000\000\107\000\107\000\000\000\107\000\107\000\
    \107\000\000\000\000\000\000\000\107\000\000\000\107\000\000\000\
    \000\000\107\000\000\000\107\000\255\255\107\000\107\000\107\000\
    \107\000\107\000\000\000\000\000\000\000\006\000\000\000\000\000\
    \006\000\006\000\006\000\000\000\000\000\000\000\006\000\006\000\
    \000\000\006\000\006\000\006\000\000\000\000\000\000\000\107\000\
    \000\000\107\000\000\000\000\000\000\000\000\000\006\000\107\000\
    \006\000\006\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \006\000\000\000\000\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\006\000\006\000\000\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\107\000\000\000\107\000\
    \000\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\128\000\000\000\000\000\128\000\128\000\
    \128\000\000\000\000\000\000\000\128\000\128\000\000\000\128\000\
    \128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \006\000\000\000\006\000\000\000\128\000\006\000\128\000\128\000\
    \128\000\128\000\128\000\000\000\000\000\000\000\128\000\000\000\
    \000\000\128\000\128\000\128\000\000\000\000\000\000\000\128\000\
    \128\000\000\000\128\000\128\000\128\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\006\000\000\000\006\000\000\000\128\000\
    \128\000\128\000\128\000\128\000\128\000\128\000\000\000\000\000\
    \000\000\107\000\000\000\000\000\107\000\107\000\107\000\000\000\
    \000\000\000\000\107\000\107\000\000\000\107\000\107\000\107\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\
    \128\000\000\000\107\000\128\000\107\000\107\000\107\000\107\000\
    \107\000\000\000\000\000\000\000\107\000\000\000\000\000\107\000\
    \107\000\107\000\000\000\000\000\000\000\107\000\107\000\000\000\
    \107\000\107\000\107\000\000\000\000\000\155\000\000\000\155\000\
    \000\000\128\000\000\000\128\000\155\000\107\000\107\000\107\000\
    \107\000\107\000\107\000\107\000\000\000\154\000\154\000\154\000\
    \154\000\154\000\154\000\154\000\154\000\154\000\154\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\107\000\000\000\107\000\000\000\
    \000\000\107\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \175\000\000\000\000\000\176\000\000\000\000\000\000\000\000\000\
    \000\000\155\000\000\000\000\000\000\000\000\000\000\000\155\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\174\000\107\000\
    \174\000\107\000\000\000\155\000\000\000\174\000\000\000\155\000\
    \000\000\155\000\000\000\000\000\000\000\153\000\173\000\173\000\
    \173\000\173\000\173\000\173\000\173\000\173\000\173\000\173\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\174\000\000\000\000\000\000\000\000\000\000\000\
    \174\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\174\000\000\000\000\000\000\000\
    \174\000\000\000\174\000\000\000\000\000\000\000\172\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\255\255";
  Lexing.lex_check = 
   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\000\000\041\000\000\000\000\000\041\000\042\000\
    \044\000\045\000\042\000\044\000\045\000\074\000\099\000\105\000\
    \074\000\099\000\105\000\135\000\149\000\199\000\135\000\149\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\
    \013\000\017\000\018\000\026\000\017\000\017\000\039\000\072\000\
    \058\000\039\000\058\000\060\000\060\000\058\000\058\000\058\000\
    \058\000\058\000\058\000\058\000\058\000\058\000\058\000\013\000\
    \073\000\013\000\080\000\013\000\083\000\039\000\061\000\061\000\
    \061\000\061\000\061\000\061\000\061\000\061\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \079\000\079\000\079\000\079\000\079\000\079\000\079\000\079\000\
    \079\000\079\000\086\000\088\000\088\000\090\000\090\000\116\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\013\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\117\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\003\000\092\000\092\000\003\000\003\000\003\000\121\000\
    \140\000\027\000\003\000\003\000\027\000\003\000\003\000\003\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\003\000\141\000\003\000\003\000\003\000\003\000\
    \003\000\147\000\100\000\148\000\004\000\100\000\027\000\004\000\
    \004\000\004\000\155\000\158\000\161\000\004\000\004\000\175\000\
    \004\000\004\000\004\000\192\000\193\000\163\000\101\000\103\000\
    \163\000\101\000\103\000\196\000\194\000\004\000\003\000\004\000\
    \004\000\004\000\004\000\004\000\198\000\168\000\175\000\005\000\
    \168\000\195\000\005\000\005\000\005\000\255\255\101\000\176\000\
    \005\000\005\000\176\000\005\000\005\000\005\000\255\255\255\255\
    \255\255\102\000\102\000\027\000\003\000\102\000\003\000\255\255\
    \005\000\004\000\005\000\005\000\005\000\005\000\005\000\255\255\
    \177\000\182\000\006\000\177\000\182\000\006\000\006\000\006\000\
    \102\000\255\255\102\000\006\000\006\000\197\000\006\000\006\000\
    \006\000\188\000\189\000\255\255\188\000\189\000\255\255\004\000\
    \255\255\004\000\255\255\006\000\005\000\006\000\006\000\006\000\
    \006\000\006\000\255\255\255\255\255\255\007\000\255\255\255\255\
    \007\000\007\000\007\000\255\255\255\255\255\255\007\000\007\000\
    \255\255\007\000\007\000\007\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\005\000\255\255\005\000\255\255\007\000\006\000\
    \007\000\007\000\007\000\007\000\007\000\255\255\255\255\255\255\
    \008\000\255\255\255\255\008\000\008\000\008\000\255\255\255\255\
    \255\255\008\000\008\000\255\255\008\000\008\000\008\000\183\000\
    \255\255\255\255\183\000\255\255\255\255\006\000\255\255\006\000\
    \255\255\008\000\007\000\008\000\008\000\008\000\008\000\008\000\
    \255\255\164\000\255\255\010\000\164\000\255\255\010\000\010\000\
    \010\000\255\255\255\255\255\255\010\000\010\000\255\255\010\000\
    \010\000\010\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \007\000\164\000\007\000\255\255\010\000\008\000\010\000\010\000\
    \010\000\010\000\010\000\255\255\255\255\255\255\255\255\255\255\
    \011\000\255\255\255\255\011\000\011\000\011\000\255\255\027\000\
    \255\255\011\000\011\000\255\255\011\000\011\000\011\000\255\255\
    \255\255\255\255\255\255\008\000\255\255\008\000\255\255\010\000\
    \010\000\011\000\255\255\011\000\011\000\011\000\011\000\011\000\
    \100\000\255\255\255\255\255\255\255\255\014\000\255\255\255\255\
    \014\000\014\000\014\000\164\000\255\255\255\255\014\000\014\000\
    \255\255\014\000\014\000\014\000\101\000\103\000\010\000\010\000\
    \010\000\183\000\194\000\255\255\011\000\011\000\014\000\255\255\
    \014\000\014\000\014\000\014\000\014\000\255\255\255\255\195\000\
    \015\000\255\255\255\255\015\000\015\000\015\000\255\255\255\255\
    \137\000\015\000\015\000\137\000\015\000\015\000\015\000\255\255\
    \102\000\255\255\255\255\011\000\255\255\011\000\255\255\255\255\
    \255\255\015\000\014\000\015\000\015\000\015\000\015\000\015\000\
    \255\255\255\255\255\255\019\000\255\255\137\000\019\000\019\000\
    \019\000\255\255\255\255\197\000\019\000\019\000\255\255\019\000\
    \019\000\019\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \014\000\255\255\014\000\255\255\019\000\015\000\019\000\019\000\
    \019\000\019\000\019\000\255\255\255\255\255\255\023\000\255\255\
    \255\255\023\000\023\000\023\000\255\255\255\255\255\255\023\000\
    \023\000\255\255\023\000\023\000\023\000\065\000\065\000\255\255\
    \255\255\255\255\137\000\015\000\255\255\015\000\255\255\023\000\
    \019\000\023\000\023\000\023\000\023\000\023\000\059\000\059\000\
    \059\000\059\000\059\000\059\000\059\000\059\000\059\000\059\000\
    \255\255\065\000\255\255\255\255\255\255\183\000\255\255\255\255\
    \255\255\255\255\255\255\059\000\255\255\255\255\019\000\255\255\
    \019\000\255\255\255\255\023\000\065\000\255\255\255\255\164\000\
    \255\255\255\255\255\255\255\255\255\255\024\000\255\255\255\255\
    \255\255\065\000\255\255\065\000\255\255\059\000\255\255\255\255\
    \255\255\255\255\255\255\059\000\255\255\255\255\255\255\255\255\
    \255\255\023\000\255\255\023\000\024\000\024\000\255\255\024\000\
    \024\000\024\000\024\000\255\255\255\255\255\255\024\000\024\000\
    \255\255\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
    \024\000\024\000\024\000\024\000\024\000\024\000\024\000\255\255\
    \024\000\024\000\024\000\024\000\024\000\255\255\255\255\255\255\
    \025\000\255\255\255\255\025\000\025\000\025\000\255\255\255\255\
    \025\000\025\000\025\000\255\255\025\000\025\000\025\000\062\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\025\000\024\000\025\000\025\000\025\000\025\000\025\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\137\000\255\255\
    \024\000\028\000\024\000\255\255\255\255\025\000\255\255\255\255\
    \062\000\062\000\062\000\062\000\062\000\062\000\154\000\154\000\
    \154\000\154\000\154\000\154\000\154\000\154\000\154\000\154\000\
    \255\255\255\255\255\255\255\255\255\255\066\000\255\255\255\255\
    \255\255\255\255\255\255\025\000\028\000\025\000\028\000\028\000\
    \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\
    \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\
    \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\
    \030\000\028\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\157\000\157\000\157\000\157\000\
    \157\000\157\000\157\000\157\000\157\000\157\000\255\255\030\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\030\000\255\255\
    \255\255\031\000\255\255\031\000\031\000\031\000\031\000\031\000\
    \031\000\031\000\031\000\031\000\031\000\255\255\255\255\255\255\
    \255\255\030\000\255\255\255\255\255\255\031\000\255\255\030\000\
    \031\000\255\255\255\255\255\255\255\255\255\255\030\000\031\000\
    \030\000\255\255\031\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\031\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\031\000\255\255\255\255\031\000\255\255\255\255\
    \031\000\255\255\255\255\255\255\255\255\255\255\255\255\031\000\
    \255\255\031\000\031\000\032\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\031\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\255\255\
    \255\255\255\255\255\255\032\000\255\255\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\063\000\
    \063\000\063\000\063\000\063\000\063\000\063\000\063\000\063\000\
    \063\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \063\000\063\000\063\000\063\000\063\000\063\000\255\255\255\255\
    \255\255\255\255\255\255\063\000\173\000\173\000\173\000\173\000\
    \173\000\173\000\173\000\173\000\173\000\173\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\063\000\255\255\
    \063\000\063\000\063\000\063\000\063\000\063\000\255\255\255\255\
    \255\255\255\255\255\255\063\000\255\255\063\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\255\255\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\033\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\255\255\
    \255\255\255\255\255\255\033\000\255\255\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\064\000\
    \064\000\064\000\064\000\064\000\064\000\064\000\064\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\078\000\255\255\
    \255\255\255\255\255\255\064\000\255\255\255\255\078\000\078\000\
    \078\000\078\000\078\000\078\000\178\000\178\000\178\000\178\000\
    \178\000\178\000\178\000\178\000\178\000\178\000\064\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\064\000\255\255\064\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\255\255\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\034\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\255\255\
    \255\255\255\255\255\255\034\000\255\255\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\070\000\
    \255\255\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\255\255\070\000\132\000\255\255\255\255\
    \132\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\132\000\255\255\255\255\
    \255\255\255\255\132\000\132\000\255\255\132\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\255\255\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\035\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\132\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\255\255\
    \255\255\255\255\255\255\035\000\255\255\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\085\000\
    \085\000\255\255\255\255\255\255\255\255\255\255\255\255\097\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\097\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \085\000\085\000\085\000\085\000\085\000\085\000\097\000\097\000\
    \097\000\097\000\097\000\097\000\097\000\097\000\097\000\097\000\
    \255\255\255\255\255\255\132\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\255\255\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\255\255\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\036\000\255\255\255\255\036\000\
    \036\000\036\000\255\255\255\255\255\255\036\000\036\000\255\255\
    \036\000\036\000\036\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\036\000\255\255\036\000\
    \036\000\036\000\036\000\036\000\255\255\185\000\255\255\185\000\
    \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
    \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
    \185\000\185\000\185\000\185\000\185\000\185\000\185\000\185\000\
    \185\000\036\000\036\000\185\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\255\255\036\000\
    \037\000\036\000\255\255\037\000\037\000\037\000\255\255\255\255\
    \255\255\037\000\037\000\255\255\037\000\037\000\037\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\037\000\255\255\037\000\037\000\037\000\037\000\037\000\
    \255\255\191\000\255\255\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\191\000\191\000\191\000\
    \191\000\191\000\191\000\191\000\191\000\037\000\037\000\191\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
    \037\000\037\000\255\255\037\000\255\255\037\000\255\255\255\255\
    \255\255\255\255\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\255\255\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\138\000\255\255\138\000\138\000\138\000\
    \138\000\138\000\138\000\138\000\138\000\138\000\138\000\138\000\
    \138\000\138\000\138\000\138\000\138\000\138\000\138\000\138\000\
    \138\000\138\000\138\000\138\000\138\000\138\000\138\000\145\000\
    \138\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\255\255\145\000\255\255\037\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\038\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\255\255\255\255\255\255\255\255\038\000\255\255\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \096\000\096\000\255\255\255\255\096\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\096\000\
    \255\255\096\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\255\255\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\255\255\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\046\000\
    \255\255\255\255\046\000\046\000\046\000\255\255\255\255\255\255\
    \046\000\046\000\255\255\046\000\046\000\046\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \046\000\255\255\046\000\046\000\046\000\046\000\046\000\255\255\
    \255\255\255\255\255\255\047\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\255\255\
    \255\255\255\255\255\255\255\255\046\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\255\255\
    \255\255\255\255\046\000\047\000\046\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\096\000\
    \153\000\153\000\153\000\153\000\153\000\153\000\153\000\153\000\
    \153\000\153\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\153\000\153\000\153\000\153\000\153\000\153\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\153\000\153\000\153\000\153\000\153\000\153\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\255\255\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\048\000\047\000\047\000\047\000\047\000\
    \047\000\047\000\047\000\047\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\255\255\
    \255\255\255\255\255\255\048\000\255\255\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \160\000\160\000\160\000\160\000\160\000\160\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \160\000\160\000\160\000\160\000\160\000\160\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\255\255\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\051\000\048\000\048\000\048\000\048\000\
    \048\000\048\000\048\000\048\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\255\255\
    \255\255\255\255\255\255\051\000\255\255\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\172\000\
    \172\000\172\000\172\000\172\000\172\000\172\000\172\000\172\000\
    \172\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \172\000\172\000\172\000\172\000\172\000\172\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \172\000\172\000\172\000\172\000\172\000\172\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\255\255\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\052\000\051\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\255\255\
    \255\255\255\255\255\255\052\000\255\255\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\180\000\
    \180\000\180\000\180\000\180\000\180\000\180\000\180\000\180\000\
    \180\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \180\000\180\000\180\000\180\000\180\000\180\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \180\000\180\000\180\000\180\000\180\000\180\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\255\255\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\255\255\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\052\000\071\000\093\000\071\000\255\255\
    \093\000\093\000\093\000\071\000\255\255\255\255\093\000\093\000\
    \255\255\093\000\093\000\093\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\093\000\255\255\
    \093\000\093\000\093\000\093\000\093\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\095\000\255\255\095\000\095\000\
    \095\000\095\000\255\255\255\255\255\255\095\000\095\000\255\255\
    \095\000\095\000\095\000\255\255\255\255\255\255\255\255\255\255\
    \071\000\255\255\093\000\255\255\255\255\095\000\071\000\095\000\
    \095\000\095\000\095\000\095\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\071\000\255\255\255\255\255\255\071\000\255\255\
    \071\000\255\255\106\000\255\255\071\000\106\000\106\000\106\000\
    \093\000\255\255\093\000\106\000\106\000\255\255\106\000\106\000\
    \106\000\095\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\106\000\255\255\106\000\106\000\106\000\
    \106\000\106\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\107\000\255\255\255\255\107\000\107\000\107\000\095\000\
    \255\255\095\000\107\000\107\000\255\255\107\000\107\000\107\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\106\000\
    \255\255\255\255\107\000\255\255\107\000\107\000\107\000\107\000\
    \107\000\255\255\255\255\255\255\108\000\255\255\255\255\108\000\
    \108\000\108\000\255\255\255\255\255\255\108\000\108\000\255\255\
    \108\000\108\000\108\000\255\255\255\255\106\000\255\255\106\000\
    \255\255\255\255\255\255\255\255\255\255\108\000\107\000\108\000\
    \108\000\108\000\108\000\108\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\109\000\255\255\255\255\109\000\109\000\109\000\
    \255\255\255\255\255\255\109\000\109\000\255\255\109\000\109\000\
    \109\000\255\255\255\255\255\255\107\000\255\255\107\000\255\255\
    \255\255\108\000\255\255\109\000\071\000\109\000\109\000\109\000\
    \109\000\109\000\255\255\255\255\255\255\115\000\255\255\255\255\
    \115\000\115\000\115\000\255\255\255\255\255\255\115\000\115\000\
    \255\255\115\000\115\000\115\000\255\255\255\255\255\255\108\000\
    \255\255\108\000\255\255\255\255\255\255\255\255\115\000\109\000\
    \115\000\115\000\115\000\115\000\115\000\255\255\255\255\255\255\
    \125\000\255\255\255\255\125\000\125\000\125\000\255\255\255\255\
    \255\255\125\000\125\000\255\255\125\000\125\000\125\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\109\000\255\255\109\000\
    \255\255\125\000\115\000\125\000\125\000\125\000\125\000\125\000\
    \255\255\255\255\255\255\128\000\255\255\255\255\128\000\128\000\
    \128\000\255\255\255\255\255\255\128\000\128\000\255\255\128\000\
    \128\000\128\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \115\000\255\255\115\000\255\255\128\000\125\000\128\000\128\000\
    \128\000\128\000\128\000\255\255\255\255\255\255\129\000\255\255\
    \255\255\129\000\129\000\129\000\255\255\255\255\255\255\129\000\
    \129\000\255\255\129\000\129\000\129\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\125\000\255\255\125\000\255\255\129\000\
    \128\000\129\000\129\000\129\000\129\000\129\000\255\255\255\255\
    \255\255\130\000\255\255\255\255\130\000\130\000\130\000\255\255\
    \255\255\255\255\130\000\130\000\255\255\130\000\130\000\130\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\128\000\255\255\
    \128\000\255\255\130\000\129\000\130\000\130\000\130\000\130\000\
    \130\000\255\255\255\255\255\255\131\000\255\255\255\255\131\000\
    \131\000\131\000\255\255\255\255\255\255\131\000\131\000\255\255\
    \131\000\131\000\131\000\255\255\255\255\146\000\255\255\146\000\
    \255\255\129\000\255\255\129\000\146\000\131\000\130\000\131\000\
    \131\000\131\000\131\000\131\000\255\255\146\000\146\000\146\000\
    \146\000\146\000\146\000\146\000\146\000\146\000\146\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\130\000\255\255\130\000\255\255\
    \255\255\131\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \169\000\255\255\255\255\169\000\255\255\255\255\255\255\255\255\
    \255\255\146\000\255\255\255\255\255\255\255\255\255\255\146\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\169\000\131\000\
    \169\000\131\000\255\255\146\000\255\255\169\000\255\255\146\000\
    \255\255\146\000\255\255\255\255\255\255\146\000\169\000\169\000\
    \169\000\169\000\169\000\169\000\169\000\169\000\169\000\169\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\169\000\255\255\255\255\255\255\255\255\255\255\
    \169\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\169\000\255\255\255\255\255\255\
    \169\000\255\255\169\000\255\255\255\255\255\255\169\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\169\000";
  Lexing.lex_base_code = 
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \010\000\036\000\012\000\000\000\000\000\000\000\002\000\000\000\
    \027\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \002\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000";
  Lexing.lex_backtrk_code = 
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\039\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000";
  Lexing.lex_default_code = 
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\019\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000";
  Lexing.lex_trans_code = 
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\001\000\000\000\036\000\036\000\000\000\036\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \001\000\000\000\000\000\001\000\022\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\007\000\001\000\000\000\000\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\001\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\004\000\004\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000";
  Lexing.lex_check_code = 
   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\024\000\101\000\169\000\176\000\101\000\177\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \024\000\255\255\101\000\000\000\102\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\096\000\097\000\255\255\255\255\
    \024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\
    \024\000\024\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\097\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\097\000\097\000\097\000\097\000\
    \097\000\097\000\097\000\097\000\097\000\097\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \101\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255";
  Lexing.lex_code = 
   "\255\004\255\255\005\255\255\007\255\006\255\255\003\255\000\004\
    \001\005\255\007\255\255\006\255\007\255\255\000\004\001\005\003\
    \006\002\007\255\001\255\255\000\001\255";
}

let rec token lexbuf =
  lexbuf.Lexing.lex_mem <- Array.make 8 (-1) ;   __ocaml_lex_token_rec lexbuf 0
and __ocaml_lex_token_rec lexbuf __ocaml_lex_state =
  match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 770 "parsing/lexer.mll"
                 (
      if not !escaped_newlines then
        raise (Error(Illegal_character (Lexing.lexeme_char lexbuf 0),
                     Location.curr lexbuf));
      update_loc lexbuf None 1 false 0;
      token lexbuf )
# 1980 "parsing/lexer.ml"

  | 1 ->
# 777 "parsing/lexer.mll"
      ( update_loc lexbuf None 1 false 0;
        EOL )
# 1986 "parsing/lexer.ml"

  | 2 ->
# 780 "parsing/lexer.mll"
      ( token lexbuf )
# 1991 "parsing/lexer.ml"

  | 3 ->
# 782 "parsing/lexer.mll"
      ( UNDERSCORE )
# 1996 "parsing/lexer.ml"

  | 4 ->
# 784 "parsing/lexer.mll"
      ( TILDE )
# 2001 "parsing/lexer.ml"

  | 5 ->
# 786 "parsing/lexer.mll"
      ( LABEL (get_label_name lexbuf) )
# 2006 "parsing/lexer.ml"

  | 6 ->
# 788 "parsing/lexer.mll"
      ( warn_latin1 lexbuf; LABEL (get_label_name lexbuf) )
# 2011 "parsing/lexer.ml"

  | 7 ->
# 790 "parsing/lexer.mll"
      ( QUESTION )
# 2016 "parsing/lexer.ml"

  | 8 ->
# 792 "parsing/lexer.mll"
      ( OPTLABEL (get_label_name lexbuf) )
# 2021 "parsing/lexer.ml"

  | 9 ->
# 794 "parsing/lexer.mll"
      ( warn_latin1 lexbuf; OPTLABEL (get_label_name lexbuf) )
# 2026 "parsing/lexer.ml"

  | 10 ->
# 796 "parsing/lexer.mll"
      ( let s = Lexing.lexeme lexbuf in
        try Hashtbl.find keyword_table s
        with Not_found -> LIDENT s )
# 2033 "parsing/lexer.ml"

  | 11 ->
# 800 "parsing/lexer.mll"
      ( warn_latin1 lexbuf; LIDENT (Lexing.lexeme lexbuf) )
# 2038 "parsing/lexer.ml"

  | 12 ->
# 802 "parsing/lexer.mll"
      ( UIDENT(Lexing.lexeme lexbuf) )
# 2043 "parsing/lexer.ml"

  | 13 ->
# 804 "parsing/lexer.mll"
      ( warn_latin1 lexbuf; UIDENT(Lexing.lexeme lexbuf) )
# 2048 "parsing/lexer.ml"

  | 14 ->
# 806 "parsing/lexer.mll"
      ( try
          INT (cvt_int_literal (Lexing.lexeme lexbuf))
        with Failure _ ->
          raise (Error(Literal_overflow "int", Location.curr lexbuf))
      )
# 2057 "parsing/lexer.ml"

  | 15 ->
# 812 "parsing/lexer.mll"
      ( FLOAT (remove_underscores(Lexing.lexeme lexbuf)) )
# 2062 "parsing/lexer.ml"

  | 16 ->
# 814 "parsing/lexer.mll"
      ( try
          INT32 (cvt_int32_literal (Lexing.lexeme lexbuf))
        with Failure _ ->
          raise (Error(Literal_overflow "int32", Location.curr lexbuf)) )
# 2070 "parsing/lexer.ml"

  | 17 ->
# 819 "parsing/lexer.mll"
      ( try
          INT64 (cvt_int64_literal (Lexing.lexeme lexbuf))
        with Failure _ ->
          raise (Error(Literal_overflow "int64", Location.curr lexbuf)) )
# 2078 "parsing/lexer.ml"

  | 18 ->
# 824 "parsing/lexer.mll"
      ( try
          NATIVEINT (cvt_nativeint_literal (Lexing.lexeme lexbuf))
        with Failure _ ->
          raise (Error(Literal_overflow "nativeint", Location.curr lexbuf)) )
# 2086 "parsing/lexer.ml"

  | 19 ->
# 829 "parsing/lexer.mll"
      ( reset_string_buffer();
        is_in_string := true;
        let string_start = lexbuf.lex_start_p in
        string_start_loc := Location.curr lexbuf;
        string lexbuf;
        is_in_string := false;
        lexbuf.lex_start_p <- string_start;
        STRING (get_stored_string(), None) )
# 2098 "parsing/lexer.ml"

  | 20 ->
# 838 "parsing/lexer.mll"
      ( reset_string_buffer();
        let delim = Lexing.lexeme lexbuf in
        let delim = String.sub delim 1 (String.length delim - 2) in
        is_in_string := true;
        let string_start = lexbuf.lex_start_p in
        string_start_loc := Location.curr lexbuf;
        quoted_string delim lexbuf;
        is_in_string := false;
        lexbuf.lex_start_p <- string_start;
        STRING (get_stored_string(), Some delim) )
# 2112 "parsing/lexer.ml"

  | 21 ->
# 849 "parsing/lexer.mll"
      ( update_loc lexbuf None 1 false 1;
        CHAR (Lexing.lexeme_char lexbuf 1) )
# 2118 "parsing/lexer.ml"

  | 22 ->
# 852 "parsing/lexer.mll"
      ( CHAR(Lexing.lexeme_char lexbuf 1) )
# 2123 "parsing/lexer.ml"

  | 23 ->
# 854 "parsing/lexer.mll"
      ( CHAR(char_for_backslash (Lexing.lexeme_char lexbuf 2)) )
# 2128 "parsing/lexer.ml"

  | 24 ->
# 856 "parsing/lexer.mll"
      ( CHAR(char_for_decimal_code lexbuf 2) )
# 2133 "parsing/lexer.ml"

  | 25 ->
# 858 "parsing/lexer.mll"
      ( CHAR(char_for_hexadecimal_code lexbuf 3) )
# 2138 "parsing/lexer.ml"

  | 26 ->
# 860 "parsing/lexer.mll"
      ( let l = Lexing.lexeme lexbuf in
        let esc = String.sub l 1 (String.length l - 1) in
        raise (Error(Illegal_escape esc, Location.curr lexbuf))
      )
# 2146 "parsing/lexer.ml"

  | 27 ->
# 865 "parsing/lexer.mll"
      ( let s, loc = with_comment_buffer comment lexbuf in
        COMMENT (s, loc) )
# 2152 "parsing/lexer.ml"

  | 28 ->
# 868 "parsing/lexer.mll"
      ( let s, loc = with_comment_buffer comment lexbuf in

        DOCSTRING (Docstrings.docstring s loc) 

)
# 2163 "parsing/lexer.ml"

  | 29 ->
let
# 875 "parsing/lexer.mll"
                    stars
# 2169 "parsing/lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_curr_pos in
# 876 "parsing/lexer.mll"
      ( let s, loc =
          with_comment_buffer
            (fun lexbuf ->
               store_string ("*" ^ stars);
               comment lexbuf)
            lexbuf
        in
        COMMENT (s, loc) )
# 2180 "parsing/lexer.ml"

  | 30 ->
# 885 "parsing/lexer.mll"
      ( if !print_warnings then
          Location.prerr_warning (Location.curr lexbuf) Warnings.Comment_start;
        let s, loc = with_comment_buffer comment lexbuf in
        COMMENT (s, loc) )
# 2188 "parsing/lexer.ml"

  | 31 ->
let
# 889 "parsing/lexer.mll"
                   stars
# 2194 "parsing/lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_curr_pos + -2) in
# 890 "parsing/lexer.mll"
      ( COMMENT (stars, Location.curr lexbuf) )
# 2198 "parsing/lexer.ml"

  | 32 ->
# 892 "parsing/lexer.mll"
      ( let loc = Location.curr lexbuf in
        Location.prerr_warning loc Warnings.Comment_not_end;
        lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_curr_pos - 1;
        let curpos = lexbuf.lex_curr_p in
        lexbuf.lex_curr_p <- { curpos with pos_cnum = curpos.pos_cnum - 1 };
        STAR
      )
# 2209 "parsing/lexer.ml"

  | 33 ->
let
# 899 "parsing/lexer.mll"
                                   num
# 2215 "parsing/lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_mem.(1)
and
# 900 "parsing/lexer.mll"
                                           name
# 2220 "parsing/lexer.ml"
= Lexing.sub_lexeme_opt lexbuf lexbuf.Lexing.lex_mem.(3) lexbuf.Lexing.lex_mem.(2) in
# 902 "parsing/lexer.mll"
      ( update_loc lexbuf name (int_of_string num) true 0;
        token lexbuf
      )
# 2226 "parsing/lexer.ml"

  | 34 ->
# 905 "parsing/lexer.mll"
         ( SHARP )
# 2231 "parsing/lexer.ml"

  | 35 ->
# 906 "parsing/lexer.mll"
         ( AMPERSAND )
# 2236 "parsing/lexer.ml"

  | 36 ->
# 907 "parsing/lexer.mll"
         ( AMPERAMPER )
# 2241 "parsing/lexer.ml"

  | 37 ->
# 908 "parsing/lexer.mll"
         ( BACKQUOTE )
# 2246 "parsing/lexer.ml"

  | 38 ->
# 909 "parsing/lexer.mll"
         ( QUOTE )
# 2251 "parsing/lexer.ml"

  | 39 ->
# 910 "parsing/lexer.mll"
         ( LPAREN )
# 2256 "parsing/lexer.ml"

  | 40 ->
# 911 "parsing/lexer.mll"
         ( RPAREN )
# 2261 "parsing/lexer.ml"

  | 41 ->
# 912 "parsing/lexer.mll"
         ( STAR )
# 2266 "parsing/lexer.ml"

  | 42 ->
# 913 "parsing/lexer.mll"
         ( COMMA )
# 2271 "parsing/lexer.ml"

  | 43 ->
# 914 "parsing/lexer.mll"
         ( MINUSGREATER )
# 2276 "parsing/lexer.ml"

  | 44 ->
# 915 "parsing/lexer.mll"
         ( DOT )
# 2281 "parsing/lexer.ml"

  | 45 ->
# 916 "parsing/lexer.mll"
         ( DOTDOT )
# 2286 "parsing/lexer.ml"

  | 46 ->
# 917 "parsing/lexer.mll"
         ( COLON )
# 2291 "parsing/lexer.ml"

  | 47 ->
# 918 "parsing/lexer.mll"
         ( COLONCOLON )
# 2296 "parsing/lexer.ml"

  | 48 ->
# 919 "parsing/lexer.mll"
         ( COLONEQUAL )
# 2301 "parsing/lexer.ml"

  | 49 ->
# 920 "parsing/lexer.mll"
         ( COLONGREATER )
# 2306 "parsing/lexer.ml"

  | 50 ->
# 921 "parsing/lexer.mll"
         ( SEMI )
# 2311 "parsing/lexer.ml"

  | 51 ->
# 922 "parsing/lexer.mll"
         ( SEMISEMI )
# 2316 "parsing/lexer.ml"

  | 52 ->
# 923 "parsing/lexer.mll"
         ( LESS )
# 2321 "parsing/lexer.ml"

  | 53 ->
# 924 "parsing/lexer.mll"
         ( LESSMINUS )
# 2326 "parsing/lexer.ml"

  | 54 ->
# 925 "parsing/lexer.mll"
         ( EQUAL )
# 2331 "parsing/lexer.ml"

  | 55 ->
# 926 "parsing/lexer.mll"
         ( LBRACKET )
# 2336 "parsing/lexer.ml"

  | 56 ->
# 927 "parsing/lexer.mll"
         ( LBRACKETBAR )
# 2341 "parsing/lexer.ml"

  | 57 ->
# 928 "parsing/lexer.mll"
         ( LBRACKETLESS )
# 2346 "parsing/lexer.ml"

  | 58 ->
# 929 "parsing/lexer.mll"
         ( LBRACKETGREATER )
# 2351 "parsing/lexer.ml"

  | 59 ->
# 930 "parsing/lexer.mll"
         ( RBRACKET )
# 2356 "parsing/lexer.ml"

  | 60 ->
# 931 "parsing/lexer.mll"
         ( LBRACE )
# 2361 "parsing/lexer.ml"

  | 61 ->
# 932 "parsing/lexer.mll"
         ( LBRACELESS )
# 2366 "parsing/lexer.ml"

  | 62 ->
# 933 "parsing/lexer.mll"
         ( BAR )
# 2371 "parsing/lexer.ml"

  | 63 ->
# 934 "parsing/lexer.mll"
         ( BARBAR )
# 2376 "parsing/lexer.ml"

  | 64 ->
# 935 "parsing/lexer.mll"
         ( BARRBRACKET )
# 2381 "parsing/lexer.ml"

  | 65 ->
# 936 "parsing/lexer.mll"
         ( GREATER )
# 2386 "parsing/lexer.ml"

  | 66 ->
# 937 "parsing/lexer.mll"
         ( GREATERRBRACKET )
# 2391 "parsing/lexer.ml"

  | 67 ->
# 938 "parsing/lexer.mll"
         ( RBRACE )
# 2396 "parsing/lexer.ml"

  | 68 ->
# 939 "parsing/lexer.mll"
         ( GREATERRBRACE )
# 2401 "parsing/lexer.ml"

  | 69 ->
# 940 "parsing/lexer.mll"
         ( LBRACKETAT )
# 2406 "parsing/lexer.ml"

  | 70 ->
# 941 "parsing/lexer.mll"
         ( LBRACKETPERCENT )
# 2411 "parsing/lexer.ml"

  | 71 ->
# 942 "parsing/lexer.mll"
          ( LBRACKETPERCENTPERCENT )
# 2416 "parsing/lexer.ml"

  | 72 ->
# 943 "parsing/lexer.mll"
          ( LBRACKETATAT )
# 2421 "parsing/lexer.ml"

  | 73 ->
# 944 "parsing/lexer.mll"
           ( LBRACKETATATAT )
# 2426 "parsing/lexer.ml"

  | 74 ->
# 945 "parsing/lexer.mll"
         ( BANG )
# 2431 "parsing/lexer.ml"

  | 75 ->
# 946 "parsing/lexer.mll"
         ( INFIXOP0 "!=" )
# 2436 "parsing/lexer.ml"

  | 76 ->
# 947 "parsing/lexer.mll"
         ( PLUS )
# 2441 "parsing/lexer.ml"

  | 77 ->
# 948 "parsing/lexer.mll"
         ( PLUSDOT )
# 2446 "parsing/lexer.ml"

  | 78 ->
# 949 "parsing/lexer.mll"
         ( PLUSEQ )
# 2451 "parsing/lexer.ml"

  | 79 ->
# 950 "parsing/lexer.mll"
         ( MINUS )
# 2456 "parsing/lexer.ml"

  | 80 ->
# 951 "parsing/lexer.mll"
         ( MINUSDOT )
# 2461 "parsing/lexer.ml"

  | 81 ->
# 954 "parsing/lexer.mll"
            ( PREFIXOP(Lexing.lexeme lexbuf) )
# 2466 "parsing/lexer.ml"

  | 82 ->
# 956 "parsing/lexer.mll"
            ( PREFIXOP(Lexing.lexeme lexbuf) )
# 2471 "parsing/lexer.ml"

  | 83 ->
# 958 "parsing/lexer.mll"
            ( INFIXOP0(Lexing.lexeme lexbuf) )
# 2476 "parsing/lexer.ml"

  | 84 ->
# 960 "parsing/lexer.mll"
            ( INFIXOP1(Lexing.lexeme lexbuf) )
# 2481 "parsing/lexer.ml"

  | 85 ->
# 962 "parsing/lexer.mll"
            ( INFIXOP2(Lexing.lexeme lexbuf) )
# 2486 "parsing/lexer.ml"

  | 86 ->
# 964 "parsing/lexer.mll"
            ( INFIXOP4(Lexing.lexeme lexbuf) )
# 2491 "parsing/lexer.ml"

  | 87 ->
# 965 "parsing/lexer.mll"
            ( PERCENT )
# 2496 "parsing/lexer.ml"

  | 88 ->
# 967 "parsing/lexer.mll"
            ( INFIXOP3(Lexing.lexeme lexbuf) )
# 2501 "parsing/lexer.ml"

  | 89 ->
# 969 "parsing/lexer.mll"
            ( SHARPOP(Lexing.lexeme lexbuf) )
# 2506 "parsing/lexer.ml"

  | 90 ->
# 970 "parsing/lexer.mll"
        (
      if !if_then_else <> Dir_out then
        if !if_then_else = Dir_if_true then
          raise (Error (Unterminated_if, Location.curr lexbuf))
        else raise (Error(Unterminated_else, Location.curr lexbuf))
      else 
        EOF
        
    )
# 2519 "parsing/lexer.ml"

  | 91 ->
# 980 "parsing/lexer.mll"
      ( raise (Error(Illegal_character (Lexing.lexeme_char lexbuf 0),
                     Location.curr lexbuf))
      )
# 2526 "parsing/lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; 
      __ocaml_lex_token_rec lexbuf __ocaml_lex_state

and comment lexbuf =
    __ocaml_lex_comment_rec lexbuf 132
and __ocaml_lex_comment_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 986 "parsing/lexer.mll"
      ( comment_start_loc := (Location.curr lexbuf) :: !comment_start_loc;
        store_lexeme lexbuf;
        comment lexbuf;
      )
# 2541 "parsing/lexer.ml"

  | 1 ->
# 991 "parsing/lexer.mll"
      ( match !comment_start_loc with
        | [] -> assert false
        | [_] -> comment_start_loc := []; Location.curr lexbuf
        | _ :: l -> comment_start_loc := l;
                  store_lexeme lexbuf;
                  comment lexbuf;
       )
# 2552 "parsing/lexer.ml"

  | 2 ->
# 999 "parsing/lexer.mll"
      (
        string_start_loc := Location.curr lexbuf;
        store_string_char '"';
        is_in_string := true;
        begin try string lexbuf
        with Error (Unterminated_string, str_start) ->
          match !comment_start_loc with
          | [] -> assert false
          | loc :: _ ->
            let start = List.hd (List.rev !comment_start_loc) in
            comment_start_loc := [];
            raise (Error (Unterminated_string_in_comment (start, str_start),
                          loc))
        end;
        is_in_string := false;
        store_string_char '"';
        comment lexbuf )
# 2573 "parsing/lexer.ml"

  | 3 ->
# 1017 "parsing/lexer.mll"
      (
        let delim = Lexing.lexeme lexbuf in
        let delim = String.sub delim 1 (String.length delim - 2) in
        string_start_loc := Location.curr lexbuf;
        store_lexeme lexbuf;
        is_in_string := true;
        begin try quoted_string delim lexbuf
        with Error (Unterminated_string, str_start) ->
          match !comment_start_loc with
          | [] -> assert false
          | loc :: _ ->
            let start = List.hd (List.rev !comment_start_loc) in
            comment_start_loc := [];
            raise (Error (Unterminated_string_in_comment (start, str_start),
                          loc))
        end;
        is_in_string := false;
        store_string_char '|';
        store_string delim;
        store_string_char '}';
        comment lexbuf )
# 2598 "parsing/lexer.ml"

  | 4 ->
# 1040 "parsing/lexer.mll"
      ( store_lexeme lexbuf; comment lexbuf )
# 2603 "parsing/lexer.ml"

  | 5 ->
# 1042 "parsing/lexer.mll"
      ( update_loc lexbuf None 1 false 1;
        store_lexeme lexbuf;
        comment lexbuf
      )
# 2611 "parsing/lexer.ml"

  | 6 ->
# 1047 "parsing/lexer.mll"
      ( store_lexeme lexbuf; comment lexbuf )
# 2616 "parsing/lexer.ml"

  | 7 ->
# 1049 "parsing/lexer.mll"
      ( store_lexeme lexbuf; comment lexbuf )
# 2621 "parsing/lexer.ml"

  | 8 ->
# 1051 "parsing/lexer.mll"
      ( store_lexeme lexbuf; comment lexbuf )
# 2626 "parsing/lexer.ml"

  | 9 ->
# 1053 "parsing/lexer.mll"
      ( store_lexeme lexbuf; comment lexbuf )
# 2631 "parsing/lexer.ml"

  | 10 ->
# 1055 "parsing/lexer.mll"
      ( match !comment_start_loc with
        | [] -> assert false
        | loc :: _ ->
          let start = List.hd (List.rev !comment_start_loc) in
          comment_start_loc := [];
          raise (Error (Unterminated_comment start, loc))
      )
# 2642 "parsing/lexer.ml"

  | 11 ->
# 1063 "parsing/lexer.mll"
      ( update_loc lexbuf None 1 false 0;
        store_lexeme lexbuf;
        comment lexbuf
      )
# 2650 "parsing/lexer.ml"

  | 12 ->
# 1068 "parsing/lexer.mll"
      ( store_lexeme lexbuf; comment lexbuf )
# 2655 "parsing/lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; 
      __ocaml_lex_comment_rec lexbuf __ocaml_lex_state

and string lexbuf =
  lexbuf.Lexing.lex_mem <- Array.make 2 (-1) ;   __ocaml_lex_string_rec lexbuf 164
and __ocaml_lex_string_rec lexbuf __ocaml_lex_state =
  match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 1072 "parsing/lexer.mll"
      ( () )
# 2667 "parsing/lexer.ml"

  | 1 ->
let
# 1073 "parsing/lexer.mll"
                                  space
# 2673 "parsing/lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_curr_pos in
# 1074 "parsing/lexer.mll"
      ( update_loc lexbuf None 1 false (String.length space);
        string lexbuf
      )
# 2679 "parsing/lexer.ml"

  | 2 ->
# 1078 "parsing/lexer.mll"
      ( store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
        string lexbuf )
# 2685 "parsing/lexer.ml"

  | 3 ->
# 1081 "parsing/lexer.mll"
      ( store_string_char(char_for_decimal_code lexbuf 1);
         string lexbuf )
# 2691 "parsing/lexer.ml"

  | 4 ->
# 1084 "parsing/lexer.mll"
      ( store_string_char(char_for_hexadecimal_code lexbuf 2);
         string lexbuf )
# 2697 "parsing/lexer.ml"

  | 5 ->
# 1087 "parsing/lexer.mll"
      ( if in_comment ()
        then string lexbuf
        else begin
(*  Should be an error, but we are very lax.
          raise (Error (Illegal_escape (Lexing.lexeme lexbuf),
                        Location.curr lexbuf))
*)
          let loc = Location.curr lexbuf in
          Location.prerr_warning loc Warnings.Illegal_backslash;
          store_string_char (Lexing.lexeme_char lexbuf 0);
          store_string_char (Lexing.lexeme_char lexbuf 1);
          string lexbuf
        end
      )
# 2715 "parsing/lexer.ml"

  | 6 ->
# 1102 "parsing/lexer.mll"
      ( if not (in_comment ()) then
          Location.prerr_warning (Location.curr lexbuf) Warnings.Eol_in_string;
        update_loc lexbuf None 1 false 0;
        store_lexeme lexbuf;
        string lexbuf
      )
# 2725 "parsing/lexer.ml"

  | 7 ->
# 1109 "parsing/lexer.mll"
      ( is_in_string := false;
        raise (Error (Unterminated_string, !string_start_loc)) )
# 2731 "parsing/lexer.ml"

  | 8 ->
# 1112 "parsing/lexer.mll"
      ( store_string_char(Lexing.lexeme_char lexbuf 0);
        string lexbuf )
# 2737 "parsing/lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; 
      __ocaml_lex_string_rec lexbuf __ocaml_lex_state

and quoted_string delim lexbuf =
    __ocaml_lex_quoted_string_rec delim lexbuf 183
and __ocaml_lex_quoted_string_rec delim lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 1117 "parsing/lexer.mll"
      ( update_loc lexbuf None 1 false 0;
        store_lexeme lexbuf;
        quoted_string delim lexbuf
      )
# 2752 "parsing/lexer.ml"

  | 1 ->
# 1122 "parsing/lexer.mll"
      ( is_in_string := false;
        raise (Error (Unterminated_string, !string_start_loc)) )
# 2758 "parsing/lexer.ml"

  | 2 ->
# 1125 "parsing/lexer.mll"
      (
        let edelim = Lexing.lexeme lexbuf in
        let edelim = String.sub edelim 1 (String.length edelim - 2) in
        if delim = edelim then ()
        else (store_lexeme lexbuf; quoted_string delim lexbuf)
      )
# 2768 "parsing/lexer.ml"

  | 3 ->
# 1132 "parsing/lexer.mll"
      ( store_string_char(Lexing.lexeme_char lexbuf 0);
        quoted_string delim lexbuf )
# 2774 "parsing/lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; 
      __ocaml_lex_quoted_string_rec delim lexbuf __ocaml_lex_state

and skip_sharp_bang lexbuf =
    __ocaml_lex_skip_sharp_bang_rec lexbuf 192
and __ocaml_lex_skip_sharp_bang_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 1137 "parsing/lexer.mll"
       ( update_loc lexbuf None 3 false 0 )
# 2786 "parsing/lexer.ml"

  | 1 ->
# 1139 "parsing/lexer.mll"
       ( update_loc lexbuf None 1 false 0 )
# 2791 "parsing/lexer.ml"

  | 2 ->
# 1140 "parsing/lexer.mll"
       ( () )
# 2796 "parsing/lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf; 
      __ocaml_lex_skip_sharp_bang_rec lexbuf __ocaml_lex_state

;;

# 1142 "parsing/lexer.mll"
 

  let at_bol lexbuf = 
    let pos = Lexing.lexeme_start_p lexbuf in 
    pos.pos_cnum = pos.pos_bol 

  let token_with_comments lexbuf =
    match !preprocessor with
    | None -> token lexbuf
    | Some (_init, preprocess) -> preprocess token lexbuf

  type newline_state =
    | NoLine (* There have been no blank lines yet. *)
    | NewLine
        (* There have been no blank lines, and the previous
           token was a newline. *)
    | BlankLine (* There have been blank lines. *)

  type doc_state =
    | Initial  (* There have been no docstrings yet *)

    | After of docstring list
        (* There have been docstrings, none of which were
           preceeded by a blank line *)
    | Before of docstring list * docstring list * docstring list
        (* There have been docstrings, some of which were
           preceeded by a blank line *)

  and docstring = Docstrings.docstring

  let interpret_directive lexbuf cont look_ahead = 
    let if_then_else = !if_then_else in
    begin match token_with_comments lexbuf, if_then_else with 
    |  IF, Dir_out  ->
        let rec skip_from_if_false () = 
          let token = token_with_comments lexbuf in
          if token = EOF then 
            raise (Error (Unterminated_if, Location.curr lexbuf)) else
          if token = SHARP && at_bol lexbuf then 
            begin 
              let token = token_with_comments lexbuf in
              match token with
              | END -> 
                  begin
                    update_if_then_else Dir_out;
                    cont lexbuf
                  end
              | ELSE -> 
                  begin
                    update_if_then_else Dir_if_false;
                    cont lexbuf
                  end
              | IF ->
                  raise (Error (Unexpected_directive, Location.curr lexbuf))
              | _ -> 
                  if is_elif token &&
                     directive_parse token_with_comments lexbuf then
                    begin
                      update_if_then_else Dir_if_true;
                      cont lexbuf
                    end
                  else skip_from_if_false ()                               
            end
          else skip_from_if_false () in 
        if directive_parse token_with_comments lexbuf then
          begin 
            update_if_then_else Dir_if_true (* Next state: ELSE *);
            cont lexbuf
          end
        else
          skip_from_if_false ()
    | IF,  (Dir_if_false | Dir_if_true)->
        raise (Error(Unexpected_directive, Location.curr lexbuf))
    | LIDENT "elif", (Dir_if_false | Dir_out)
      -> (* when the predicate is false, it will continue eating `elif` *)
        raise (Error(Unexpected_directive, Location.curr lexbuf))
    | (LIDENT "elif" | ELSE as token), Dir_if_true ->           
        (* looking for #end, however, it can not see #if anymore *)
        let rec skip_from_if_true else_seen = 
          let token = token_with_comments lexbuf in
          if token = EOF then 
            raise (Error (Unterminated_else, Location.curr lexbuf)) else
          if token = SHARP && at_bol lexbuf then 
            begin 
              let token = token_with_comments lexbuf in 
              match token with  
              | END -> 
                  begin
                    update_if_then_else Dir_out;
                    cont lexbuf
                  end  
              | IF ->  
                  raise (Error (Unexpected_directive, Location.curr lexbuf)) 
              | ELSE ->
                  if else_seen then 
                    raise (Error (Unexpected_directive, Location.curr lexbuf))
                  else 
                    skip_from_if_true true
              | _ ->
                  if else_seen && is_elif token then  
                    raise (Error (Unexpected_directive, Location.curr lexbuf))
                  else 
                    skip_from_if_true else_seen
            end
          else skip_from_if_true else_seen in 
        skip_from_if_true (token = ELSE)
    | ELSE, Dir_if_false 
    | ELSE, Dir_out -> 
        raise (Error(Unexpected_directive, Location.curr lexbuf))
    | END, (Dir_if_false | Dir_if_true ) -> 
        update_if_then_else  Dir_out;
        cont lexbuf
    | END,  Dir_out  -> 
        raise (Error(Unexpected_directive, Location.curr lexbuf))
    | token, (Dir_if_true | Dir_if_false | Dir_out) ->
        look_ahead token 
    end

  let token lexbuf =
    let post_pos = lexeme_end_p lexbuf in

    let attach lines docs pre_pos =
      let open Docstrings in
        match docs, lines with
        | Initial, _ -> ()
        | After a, (NoLine | NewLine) ->
            set_post_docstrings post_pos (List.rev a);
            set_pre_docstrings pre_pos a;
        | After a, BlankLine ->
            set_post_docstrings post_pos (List.rev a);
            set_pre_extra_docstrings pre_pos (List.rev a)
        | Before(a, f, b), (NoLine | NewLine) ->
            set_post_docstrings post_pos (List.rev a);
            set_post_extra_docstrings post_pos
              (List.rev_append f (List.rev b));
            set_floating_docstrings pre_pos (List.rev f);
            set_pre_extra_docstrings pre_pos (List.rev a);
            set_pre_docstrings pre_pos b
        | Before(a, f, b), BlankLine ->
            set_post_docstrings post_pos (List.rev a);
            set_post_extra_docstrings post_pos
              (List.rev_append f (List.rev b));
            set_floating_docstrings pre_pos
              (List.rev_append f (List.rev b));
            set_pre_extra_docstrings pre_pos (List.rev a)
    in

    let rec loop lines docs lexbuf : Parser.token =
      match token_with_comments lexbuf with
      | COMMENT (s, loc) ->
          add_comment (s, loc);
          let lines' =
            match lines with
            | NoLine -> NoLine
            | NewLine -> NoLine
            | BlankLine -> BlankLine
          in
          loop lines' docs lexbuf
      | EOL ->
          let lines' =
            match lines with
            | NoLine -> NewLine
            | NewLine -> BlankLine
            | BlankLine -> BlankLine
          in
          loop lines' docs lexbuf
      | SHARP when at_bol lexbuf -> 
          interpret_directive lexbuf 
            (fun lexbuf -> loop lines docs lexbuf)
            (fun token -> sharp_look_ahead := Some token; SHARP)

      | DOCSTRING doc ->
          add_docstring_comment doc;
          let docs' =
            match docs, lines with
            | Initial, (NoLine | NewLine) -> After [doc]
            | Initial, BlankLine -> Before([], [], [doc])
            | After a, (NoLine | NewLine) -> After (doc :: a)
            | After a, BlankLine -> Before (a, [], [doc])
            | Before(a, f, b), (NoLine | NewLine) -> Before(a, f, doc :: b)
            | Before(a, f, b), BlankLine -> Before(a, b @ f, [doc])
          in
          loop NoLine docs' lexbuf

      | tok ->

          attach lines docs (lexeme_start_p lexbuf);

          tok

          
    in
      match !sharp_look_ahead with
      | None -> 
           loop NoLine Initial lexbuf
      | Some token -> 
           sharp_look_ahead := None ;
           token

  let init () =
    sharp_look_ahead := None;
    update_if_then_else  Dir_out;
    is_in_string := false;
    comment_start_loc := [];
    comment_list := [];
    match !preprocessor with
    | None -> ()
    | Some (init, _preprocess) -> init ()

  let rec filter_directive pos   acc lexbuf : (int * int ) list =
    match token_with_comments lexbuf with
    | SHARP when at_bol lexbuf ->
        (* ^[start_pos]#if ... #then^[end_pos] *)
        let start_pos = Lexing.lexeme_start lexbuf in 
        interpret_directive lexbuf 
          (fun lexbuf -> 
             filter_directive 
               (Lexing.lexeme_end lexbuf)
               ((pos, start_pos) :: acc)
               lexbuf
          
          )
          (fun _token -> filter_directive pos acc lexbuf  )
    | EOF -> (pos, Lexing.lexeme_end lexbuf) :: acc
    | _ -> filter_directive pos  acc lexbuf

  let filter_directive_from_lexbuf lexbuf = 
    List.rev (filter_directive 0 [] lexbuf )

  let set_preprocessor init preprocess =
    escaped_newlines := true;
    preprocessor := Some (init, preprocess)


# 3038 "parsing/lexer.ml"

end
module Bs_conditional_initial : sig 
#1 "bs_conditional_initial.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(** This function set up built in compile time variables used in 
    conditional compilation so that 
    {[
        #if  BS then 
        #elif .. then 
        #end
    ]}
    Is understood, also make sure the playground do the same initialization. 
*)
val setup_env : unit -> unit

val standard_library : string 
end = struct
#1 "bs_conditional_initial.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


let setup_env () =

  Lexer.replace_directive_bool "BS" true;
  Lexer.replace_directive_string "BS_VERSION"  Bs_version.version
  

let standard_library =

  Config.standard_library


end
module Compenv : sig 
#1 "compenv.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*      Fabrice Le Fessant, EPI Gallium, INRIA Paris-Rocquencourt      *)
(*                                                                     *)
(*  Copyright 2013 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

val module_of_filename : Format.formatter -> string -> string -> string

val output_prefix : string -> string
val extract_output : string option -> string
val default_output : string option -> string

val print_version_and_library : string -> 'a
val print_version_string : unit -> 'a
val print_standard_library : unit -> 'a
val fatal : string -> 'a

val first_ccopts : string list ref
val first_ppx : string list ref
val first_include_dirs : string list ref
val last_include_dirs : string list ref
val implicit_modules : string list ref

(* return the list of objfiles, after OCAMLPARAM and List.rev *)
val get_objfiles : unit -> string list

type readenv_position =
  Before_args | Before_compile | Before_link

val readenv : Format.formatter -> readenv_position -> unit

(* [is_unit_name name] returns true only if [name] can be used as a
   correct module name *)
val is_unit_name : string -> bool
(* [check_unit_name ppf filename name] prints a warning in [filename]
   on [ppf] if [name] should not be used as a module name. *)
val check_unit_name : Format.formatter -> string -> string -> unit

end = struct
#1 "compenv.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*      Fabrice Le Fessant, EPI Gallium, INRIA Paris-Rocquencourt      *)
(*                                                                     *)
(*  Copyright 2013 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Clflags

let output_prefix name =
  let oname =
    match !output_name with
    | None -> name
    | Some n -> if !compile_only then (output_name := None; n) else name in
  Misc.chop_extension_if_any oname

let print_version_and_library compiler =
  Printf.printf "The OCaml %s, version " compiler;
  print_string Config.version; print_newline();
  print_string "Standard library directory: ";
  print_string Config.standard_library; print_newline();
  exit 0

let print_version_string () =
  print_string Config.version; print_newline(); exit 0

let print_standard_library () =
  print_string Config.standard_library; print_newline(); exit 0

let fatal err =
  prerr_endline err;
  exit 2

let extract_output = function
  | Some s -> s
  | None ->
      fatal "Please specify the name of the output file, using option -o"

let default_output = function
  | Some s -> s
  | None -> Config.default_executable_name

let implicit_modules = ref []
let first_include_dirs = ref []
let last_include_dirs = ref []
let first_ccopts = ref []
let last_ccopts = ref []
let first_ppx = ref []
let last_ppx = ref []
let first_objfiles = ref []
let last_objfiles = ref []

(* Check validity of module name *)
let is_unit_name name =
  try
    begin match name.[0] with
    | 'A'..'Z' -> ()
    | _ ->
       raise Exit;
    end;
    for i = 1 to String.length name - 1 do
      match name.[i] with
      | 'A'..'Z' | 'a'..'z' | '0'..'9' | '_' | '\'' -> ()
      | _ ->
         raise Exit;
    done;
    true
  with Exit -> false
;;

let check_unit_name ppf filename name =
  
  ()

(* Compute name of module from output file name *)
let module_of_filename ppf inputfile outputprefix =
  let basename = Filename.basename outputprefix in
  let name =
    try
      let pos = String.index basename '.' in
      String.sub basename 0 pos
    with Not_found -> basename
  in
  let name = String.capitalize name in
  check_unit_name ppf inputfile name;
  name
;;


type readenv_position =
  Before_args | Before_compile | Before_link

(* Syntax of OCAMLPARAM: (name=VALUE,)* _ (,name=VALUE)*
   where VALUE should not contain ',' *)
exception SyntaxError of string

let parse_args s =
  let args = Misc.split s ',' in
  let rec iter is_after args before after =
    match args with
      [] ->
      if not is_after then
        raise (SyntaxError "no '_' separator found")
      else
      (List.rev before, List.rev after)
    | "_" :: _ when is_after -> raise (SyntaxError "too many '_' separators")
    | "_" :: tail -> iter true tail before after
    | arg :: tail ->
      let binding = try
        Misc.cut_at arg '='
      with Not_found ->
        raise (SyntaxError ("missing '=' in " ^ arg))
      in
      if is_after then
        iter is_after tail before (binding :: after)
      else
        iter is_after tail (binding :: before) after
  in
  iter false args [] []

let setter ppf f name options s =
  try
    let bool = match s with
      | "0" -> false
      | "1" -> true
      | _ -> raise Not_found
    in
    List.iter (fun b -> b := f bool) options
  with Not_found ->
    Location.print_warning Location.none ppf
      (Warnings.Bad_env_variable ("OCAMLPARAM",
                                  Printf.sprintf "bad value for %s" name))

(* 'can-discard=' specifies which arguments can be discarded without warning
   because they are not understood by some versions of OCaml. *)
let can_discard = ref []

let read_OCAMLPARAM ppf position =
  try
    let s = Sys.getenv "OCAMLPARAM" in
    let (before, after) =
      try
        parse_args s
      with SyntaxError s ->
         Location.print_warning Location.none ppf
           (Warnings.Bad_env_variable ("OCAMLPARAM", s));
         [],[]
    in
    let set name options s =  setter ppf (fun b -> b) name options s in
    let clear name options s = setter ppf (fun b -> not b) name options s in
    List.iter (fun (name, v) ->
      match name with
      | "g" -> set "g" [ Clflags.debug ] v
      | "p" -> set "p" [ Clflags.gprofile ] v
      | "bin-annot" -> set "bin-annot" [ Clflags.binary_annotations ] v
      | "annot" -> set "annot" [ Clflags.annotations ] v
      | "absname" -> set "absname" [ Location.absname ] v
      | "compat-32" -> set "compat-32" [ bytecode_compatible_32 ] v
      | "noassert" -> set "noassert" [ noassert ] v
      | "noautolink" -> set "noautolink" [ no_auto_link ] v
      | "nostdlib" -> set "nostdlib" [ no_std_include ] v
      | "linkall" -> set "linkall" [ link_everything ] v
      | "nolabels" -> set "nolabels" [ classic ] v
      | "principal" -> set "principal"  [ principal ] v
      | "rectypes" -> set "rectypes" [ recursive_types ] v
      | "safe-string" -> clear "safe-string" [ unsafe_string ] v
      | "strict-sequence" -> set "strict-sequence" [ strict_sequence ] v
      | "strict-formats" -> set "strict-formats" [ strict_formats ] v
      | "thread" -> set "thread" [ use_threads ] v
      | "unsafe" -> set "unsafe" [ fast ] v
      | "verbose" -> set "verbose" [ verbose ] v
      | "nopervasives" -> set "nopervasives" [ nopervasives ] v
      | "slash" -> set "slash" [ force_slash ] v (* for ocamldep *)
      | "keep-docs" -> set "keep-docs" [ Clflags.keep_docs ] v
      | "keep-locs" -> set "keep-locs" [ Clflags.keep_locs ] v

      | "compact" -> clear "compact" [ optimize_for_speed ] v
      | "no-app-funct" -> clear "no-app-funct" [ applicative_functors ] v
      | "nodynlink" -> clear "nodynlink" [ dlcode ] v
      | "short-paths" -> clear "short-paths" [ real_paths ] v
      | "trans-mod" -> set "trans-mod" [ transparent_modules ] v

      | "pp" -> preprocessor := Some v
      | "runtime-variant" -> runtime_variant := v
      | "cc" -> c_compiler := Some v

      (* assembly sources *)
      |  "s" ->
        set "s" [ Clflags.keep_asm_file ; Clflags.keep_startup_file ] v
      |  "S" -> set "S" [ Clflags.keep_asm_file ] v
      |  "dstartup" -> set "dstartup" [ Clflags.keep_startup_file ] v

      (* warn-errors *)
      | "we" | "warn-error" -> Warnings.parse_options true v
      (* warnings *)
      |  "w"  ->               Warnings.parse_options false v
      (* warn-errors *)
      | "wwe" ->               Warnings.parse_options false v

      (* inlining *)
      | "inline" -> begin try
          inline_threshold := 8 * int_of_string v
        with _ ->
          Location.print_warning Location.none ppf
            (Warnings.Bad_env_variable ("OCAMLPARAM",
                                        "non-integer parameter for \"inline\""))
        end

      (* color output *)
      | "color" ->
          begin match parse_color_setting v with
          | None ->
            Location.print_warning Location.none ppf
              (Warnings.Bad_env_variable ("OCAMLPARAM",
               "bad value for \"color\", \
                (expected \"auto\", \"always\" or \"never\")"))
          | Some setting -> color := Some setting
          end

      | "intf-suffix" -> Config.interface_suffix := v

      | "I" -> begin
          match position with
          | Before_args -> first_include_dirs := v :: !first_include_dirs
          | Before_link | Before_compile ->
            last_include_dirs := v :: !last_include_dirs
        end

      | "cclib" ->
        begin
          match position with
          | Before_compile -> ()
          | Before_link | Before_args ->
            ccobjs := Misc.rev_split_words v @ !ccobjs
        end

      | "ccopts" ->
        begin
          match position with
          | Before_link | Before_compile ->
            last_ccopts := v :: !last_ccopts
          | Before_args ->
            first_ccopts := v :: !first_ccopts
        end

      | "ppx" ->
        begin
          match position with
          | Before_link | Before_compile ->
            last_ppx := v :: !last_ppx
          | Before_args ->
            first_ppx := v :: !first_ppx
        end


      | "cmo" | "cma" ->
        if not !native_code then
        begin
          match position with
          | Before_link | Before_compile ->
            last_objfiles := v ::! last_objfiles
          | Before_args ->
            first_objfiles := v :: !first_objfiles
        end

      | "cmx" | "cmxa" ->
        if !native_code then
        begin
          match position with
          | Before_link | Before_compile ->
            last_objfiles := v ::! last_objfiles
          | Before_args ->
            first_objfiles := v :: !first_objfiles
        end

      | "can-discard" ->
        can_discard := v ::!can_discard

      | _ ->
        if not (List.mem name !can_discard) then begin
          can_discard := name :: !can_discard;
          Printf.eprintf
            "Warning: discarding value of variable %S in OCAMLPARAM\n%!"
            name
        end
    ) (match position with
        Before_args -> before
      | Before_compile | Before_link -> after)
  with Not_found -> ()

let readenv ppf position =
  last_include_dirs := [];
  last_ccopts := [];
  last_ppx := [];
  last_objfiles := [];
  read_OCAMLPARAM ppf position;
  all_ccopts := !last_ccopts @ !first_ccopts;
  all_ppx := !last_ppx @ !first_ppx

let get_objfiles () =
  List.rev (!last_objfiles @ !objfiles @ !first_objfiles)

end
module Depend : sig 
#1 "depend.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1999 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** Module dependencies. *)

module StringSet : Set.S with type elt = string

val free_structure_names : StringSet.t ref

val open_module : StringSet.t -> Longident.t -> unit

val add_use_file : StringSet.t -> Parsetree.toplevel_phrase list -> unit

val add_signature : StringSet.t -> Parsetree.signature -> unit

val add_implementation : StringSet.t -> Parsetree.structure -> unit

end = struct
#1 "depend.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1999 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Asttypes
open Location
open Longident
open Parsetree

module StringSet = Set.Make(struct type t = string let compare = compare end)

(* Collect free module identifiers in the a.s.t. *)

let free_structure_names = ref StringSet.empty

let rec add_path bv = function
  | Lident s ->
      if not (StringSet.mem s bv)
      then free_structure_names := StringSet.add s !free_structure_names
  | Ldot(l, _s) -> add_path bv l
  | Lapply(l1, l2) -> add_path bv l1; add_path bv l2

let open_module bv lid = add_path bv lid

let add bv lid =
  match lid.txt with
    Ldot(l, _s) -> add_path bv l
  | _ -> ()

let addmodule bv lid = add_path bv lid.txt

let rec add_type bv ty =
  match ty.ptyp_desc with
    Ptyp_any -> ()
  | Ptyp_var _ -> ()
  | Ptyp_arrow(_, t1, t2) -> add_type bv t1; add_type bv t2
  | Ptyp_tuple tl -> List.iter (add_type bv) tl
  | Ptyp_constr(c, tl) -> add bv c; List.iter (add_type bv) tl
  | Ptyp_object (fl, _) -> List.iter (fun (_, _, t) -> add_type bv t) fl
  | Ptyp_class(c, tl) -> add bv c; List.iter (add_type bv) tl
  | Ptyp_alias(t, _) -> add_type bv t
  | Ptyp_variant(fl, _, _) ->
      List.iter
        (function Rtag(_,_,_,stl) -> List.iter (add_type bv) stl
          | Rinherit sty -> add_type bv sty)
        fl
  | Ptyp_poly(_, t) -> add_type bv t
  | Ptyp_package pt -> add_package_type bv pt
  | Ptyp_extension _ -> ()

and add_package_type bv (lid, l) =
  add bv lid;
  List.iter (add_type bv) (List.map (fun (_, e) -> e) l)

let add_opt add_fn bv = function
    None -> ()
  | Some x -> add_fn bv x

let add_constructor_decl bv pcd =
  List.iter (add_type bv) pcd.pcd_args; Misc.may (add_type bv) pcd.pcd_res

let add_type_declaration bv td =
  List.iter
    (fun (ty1, ty2, _) -> add_type bv ty1; add_type bv ty2)
    td.ptype_cstrs;
  add_opt add_type bv td.ptype_manifest;
  let add_tkind = function
    Ptype_abstract -> ()
  | Ptype_variant cstrs ->
      List.iter (add_constructor_decl bv) cstrs
  | Ptype_record lbls ->
      List.iter (fun pld -> add_type bv pld.pld_type) lbls
  | Ptype_open -> () in
  add_tkind td.ptype_kind

let add_extension_constructor bv ext =
  match ext.pext_kind with
      Pext_decl(args, rty) ->
        List.iter (add_type bv) args; Misc.may (add_type bv) rty
    | Pext_rebind lid -> add bv lid

let add_type_extension bv te =
  add bv te.ptyext_path;
  List.iter (add_extension_constructor bv) te.ptyext_constructors

let rec add_class_type bv cty =
  match cty.pcty_desc with
    Pcty_constr(l, tyl) ->
      add bv l; List.iter (add_type bv) tyl
  | Pcty_signature { pcsig_self = ty; pcsig_fields = fieldl } ->
      add_type bv ty;
      List.iter (add_class_type_field bv) fieldl
  | Pcty_arrow(_, ty1, cty2) ->
      add_type bv ty1; add_class_type bv cty2
  | Pcty_extension _ -> ()

and add_class_type_field bv pctf =
  match pctf.pctf_desc with
    Pctf_inherit cty -> add_class_type bv cty
  | Pctf_val(_, _, _, ty) -> add_type bv ty
  | Pctf_method(_, _, _, ty) -> add_type bv ty
  | Pctf_constraint(ty1, ty2) -> add_type bv ty1; add_type bv ty2
  | Pctf_attribute _ -> ()
  | Pctf_extension _ -> ()

let add_class_description bv infos =
  add_class_type bv infos.pci_expr

let add_class_type_declaration = add_class_description

let pattern_bv = ref StringSet.empty

let rec add_pattern bv pat =
  match pat.ppat_desc with
    Ppat_any -> ()
  | Ppat_var _ -> ()
  | Ppat_alias(p, _) -> add_pattern bv p
  | Ppat_interval _
  | Ppat_constant _ -> ()
  | Ppat_tuple pl -> List.iter (add_pattern bv) pl
  | Ppat_construct(c, op) -> add bv c; add_opt add_pattern bv op
  | Ppat_record(pl, _) ->
      List.iter (fun (lbl, p) -> add bv lbl; add_pattern bv p) pl
  | Ppat_array pl -> List.iter (add_pattern bv) pl
  | Ppat_or(p1, p2) -> add_pattern bv p1; add_pattern bv p2
  | Ppat_constraint(p, ty) -> add_pattern bv p; add_type bv ty
  | Ppat_variant(_, op) -> add_opt add_pattern bv op
  | Ppat_type li -> add bv li
  | Ppat_lazy p -> add_pattern bv p
  | Ppat_unpack id -> pattern_bv := StringSet.add id.txt !pattern_bv
  | Ppat_exception p -> add_pattern bv p
  | Ppat_extension _ -> ()

let add_pattern bv pat =
  pattern_bv := bv;
  add_pattern bv pat;
  !pattern_bv

let rec add_expr bv exp =
  match exp.pexp_desc with
    Pexp_ident l -> add bv l
  | Pexp_constant _ -> ()
  | Pexp_let(rf, pel, e) ->
      let bv = add_bindings rf bv pel in add_expr bv e
  | Pexp_fun (_, opte, p, e) ->
      add_opt add_expr bv opte; add_expr (add_pattern bv p) e
  | Pexp_function pel ->
      add_cases bv pel
  | Pexp_apply(e, el) ->
      add_expr bv e; List.iter (fun (_,e) -> add_expr bv e) el
  | Pexp_match(e, pel) -> add_expr bv e; add_cases bv pel
  | Pexp_try(e, pel) -> add_expr bv e; add_cases bv pel
  | Pexp_tuple el -> List.iter (add_expr bv) el
  | Pexp_construct(c, opte) -> add bv c; add_opt add_expr bv opte
  | Pexp_variant(_, opte) -> add_opt add_expr bv opte
  | Pexp_record(lblel, opte) ->
      List.iter (fun (lbl, e) -> add bv lbl; add_expr bv e) lblel;
      add_opt add_expr bv opte
  | Pexp_field(e, fld) -> add_expr bv e; add bv fld
  | Pexp_setfield(e1, fld, e2) -> add_expr bv e1; add bv fld; add_expr bv e2
  | Pexp_array el -> List.iter (add_expr bv) el
  | Pexp_ifthenelse(e1, e2, opte3) ->
      add_expr bv e1; add_expr bv e2; add_opt add_expr bv opte3
  | Pexp_sequence(e1, e2) -> add_expr bv e1; add_expr bv e2
  | Pexp_while(e1, e2) -> add_expr bv e1; add_expr bv e2
  | Pexp_for( _, e1, e2, _, e3) ->
      add_expr bv e1; add_expr bv e2; add_expr bv e3
  | Pexp_coerce(e1, oty2, ty3) ->
      add_expr bv e1;
      add_opt add_type bv oty2;
      add_type bv ty3
  | Pexp_constraint(e1, ty2) ->
      add_expr bv e1;
      add_type bv ty2
  | Pexp_send(e, _m) -> add_expr bv e
  | Pexp_new li -> add bv li
  | Pexp_setinstvar(_v, e) -> add_expr bv e
  | Pexp_override sel -> List.iter (fun (_s, e) -> add_expr bv e) sel
  | Pexp_letmodule(id, m, e) ->
      add_module bv m; add_expr (StringSet.add id.txt bv) e
  | Pexp_assert (e) -> add_expr bv e
  | Pexp_lazy (e) -> add_expr bv e
  | Pexp_poly (e, t) -> add_expr bv e; add_opt add_type bv t
  | Pexp_object { pcstr_self = pat; pcstr_fields = fieldl } ->
      let bv = add_pattern bv pat in List.iter (add_class_field bv) fieldl
  | Pexp_newtype (_, e) -> add_expr bv e
  | Pexp_pack m -> add_module bv m
  | Pexp_open (_ovf, m, e) -> open_module bv m.txt; add_expr bv e
  | Pexp_extension _ -> ()

and add_cases bv cases =
  List.iter (add_case bv) cases

and add_case bv {pc_lhs; pc_guard; pc_rhs} =
  let bv = add_pattern bv pc_lhs in
  add_opt add_expr bv pc_guard;
  add_expr bv pc_rhs

and add_bindings recf bv pel =
  let bv' = List.fold_left (fun bv x -> add_pattern bv x.pvb_pat) bv pel in
  let bv = if recf = Recursive then bv' else bv in
  List.iter (fun x -> add_expr bv x.pvb_expr) pel;
  bv'

and add_modtype bv mty =
  match mty.pmty_desc with
    Pmty_ident l -> add bv l
  | Pmty_alias l -> addmodule bv l
  | Pmty_signature s -> add_signature bv s
  | Pmty_functor(id, mty1, mty2) ->
      Misc.may (add_modtype bv) mty1;
      add_modtype (StringSet.add id.txt bv) mty2
  | Pmty_with(mty, cstrl) ->
      add_modtype bv mty;
      List.iter
        (function
          | Pwith_type (_, td) -> add_type_declaration bv td
          | Pwith_module (_, lid) -> addmodule bv lid
          | Pwith_typesubst td -> add_type_declaration bv td
          | Pwith_modsubst (_, lid) -> addmodule bv lid
        )
        cstrl
  | Pmty_typeof m -> add_module bv m
  | Pmty_extension _ -> ()

and add_signature bv = function
    [] -> ()
  | item :: rem -> add_signature (add_sig_item bv item) rem

and add_sig_item bv item =
  match item.psig_desc with
    Psig_value vd ->
      add_type bv vd.pval_type; bv
  | Psig_type dcls ->
      List.iter (add_type_declaration bv) dcls; bv
  | Psig_typext te ->
      add_type_extension bv te; bv
  | Psig_exception pext ->
      add_extension_constructor bv pext; bv
  | Psig_module pmd ->
      add_modtype bv pmd.pmd_type; StringSet.add pmd.pmd_name.txt bv
  | Psig_recmodule decls ->
      let bv' =
        List.fold_right StringSet.add
                        (List.map (fun pmd -> pmd.pmd_name.txt) decls) bv
      in
      List.iter (fun pmd -> add_modtype bv' pmd.pmd_type) decls;
      bv'
  | Psig_modtype x ->
      begin match x.pmtd_type with
        None -> ()
      | Some mty -> add_modtype bv mty
      end;
      bv
  | Psig_open od ->
      open_module bv od.popen_lid.txt; bv
  | Psig_include incl ->
      add_modtype bv incl.pincl_mod; bv
  | Psig_class cdl ->
      List.iter (add_class_description bv) cdl; bv
  | Psig_class_type cdtl ->
      List.iter (add_class_type_declaration bv) cdtl; bv
  | Psig_attribute _ | Psig_extension _ ->
      bv

and add_module bv modl =
  match modl.pmod_desc with
    Pmod_ident l -> addmodule bv l
  | Pmod_structure s -> ignore (add_structure bv s)
  | Pmod_functor(id, mty, modl) ->
      Misc.may (add_modtype bv) mty;
      add_module (StringSet.add id.txt bv) modl
  | Pmod_apply(mod1, mod2) ->
      add_module bv mod1; add_module bv mod2
  | Pmod_constraint(modl, mty) ->
      add_module bv modl; add_modtype bv mty
  | Pmod_unpack(e) ->
      add_expr bv e
  | Pmod_extension _ ->
      ()

and add_structure bv item_list =
  List.fold_left add_struct_item bv item_list

and add_struct_item bv item =
  match item.pstr_desc with
    Pstr_eval (e, _attrs) ->
      add_expr bv e; bv
  | Pstr_value(rf, pel) ->
      let bv = add_bindings rf bv pel in bv
  | Pstr_primitive vd ->
      add_type bv vd.pval_type; bv
  | Pstr_type dcls ->
      List.iter (add_type_declaration bv) dcls; bv
  | Pstr_typext te ->
      add_type_extension bv te;
      bv
  | Pstr_exception pext ->
      add_extension_constructor bv pext; bv
  | Pstr_module x ->
      add_module bv x.pmb_expr; StringSet.add x.pmb_name.txt bv
  | Pstr_recmodule bindings ->
      let bv' =
        List.fold_right StringSet.add
          (List.map (fun x -> x.pmb_name.txt) bindings) bv in
      List.iter
        (fun x -> add_module bv' x.pmb_expr)
        bindings;
      bv'
  | Pstr_modtype x ->
      begin match x.pmtd_type with
        None -> ()
      | Some mty -> add_modtype bv mty
      end;
      bv
  | Pstr_open od ->
      open_module bv od.popen_lid.txt; bv
  | Pstr_class cdl ->
      List.iter (add_class_declaration bv) cdl; bv
  | Pstr_class_type cdtl ->
      List.iter (add_class_type_declaration bv) cdtl; bv
  | Pstr_include incl ->
      add_module bv incl.pincl_mod; bv
  | Pstr_attribute _ | Pstr_extension _ ->
      bv

and add_use_file bv top_phrs =
  ignore (List.fold_left add_top_phrase bv top_phrs)

and add_implementation bv l =
  ignore (add_structure bv l)

and add_top_phrase bv = function
  | Ptop_def str -> add_structure bv str
  | Ptop_dir (_, _) -> bv

and add_class_expr bv ce =
  match ce.pcl_desc with
    Pcl_constr(l, tyl) ->
      add bv l; List.iter (add_type bv) tyl
  | Pcl_structure { pcstr_self = pat; pcstr_fields = fieldl } ->
      let bv = add_pattern bv pat in List.iter (add_class_field bv) fieldl
  | Pcl_fun(_, opte, pat, ce) ->
      add_opt add_expr bv opte;
      let bv = add_pattern bv pat in add_class_expr bv ce
  | Pcl_apply(ce, exprl) ->
      add_class_expr bv ce; List.iter (fun (_,e) -> add_expr bv e) exprl
  | Pcl_let(rf, pel, ce) ->
      let bv = add_bindings rf bv pel in add_class_expr bv ce
  | Pcl_constraint(ce, ct) ->
      add_class_expr bv ce; add_class_type bv ct
  | Pcl_extension _ -> ()

and add_class_field bv pcf =
  match pcf.pcf_desc with
    Pcf_inherit(_, ce, _) -> add_class_expr bv ce
  | Pcf_val(_, _, Cfk_concrete (_, e))
  | Pcf_method(_, _, Cfk_concrete (_, e)) -> add_expr bv e
  | Pcf_val(_, _, Cfk_virtual ty)
  | Pcf_method(_, _, Cfk_virtual ty) -> add_type bv ty
  | Pcf_constraint(ty1, ty2) -> add_type bv ty1; add_type bv ty2
  | Pcf_initializer e -> add_expr bv e
  | Pcf_attribute _ | Pcf_extension _ -> ()

and add_class_declaration bv decl =
  add_class_expr bv decl.pci_expr

end
module Parse : sig 
#1 "parse.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Entry points in the parser *)

val implementation : Lexing.lexbuf -> Parsetree.structure
val interface : Lexing.lexbuf -> Parsetree.signature
val toplevel_phrase : Lexing.lexbuf -> Parsetree.toplevel_phrase
val use_file : Lexing.lexbuf -> Parsetree.toplevel_phrase list
val core_type : Lexing.lexbuf -> Parsetree.core_type
val expression : Lexing.lexbuf -> Parsetree.expression
val pattern : Lexing.lexbuf -> Parsetree.pattern

end = struct
#1 "parse.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Entry points in the parser *)

(* Skip tokens to the end of the phrase *)

let rec skip_phrase lexbuf =
  try
    match Lexer.token lexbuf with
      Parser.SEMISEMI | Parser.EOF -> ()
    | _ -> skip_phrase lexbuf
  with
    | Lexer.Error (Lexer.Unterminated_comment _, _)
    | Lexer.Error (Lexer.Unterminated_string, _)
    | Lexer.Error (Lexer.Unterminated_string_in_comment _, _)
    | Lexer.Error (Lexer.Illegal_character _, _) -> skip_phrase lexbuf
;;

let maybe_skip_phrase lexbuf =
  if Parsing.is_current_lookahead Parser.SEMISEMI
  || Parsing.is_current_lookahead Parser.EOF
  then ()
  else skip_phrase lexbuf

let wrap parsing_fun lexbuf =
  try
    Docstrings.init ();
    Lexer.init ();
    let ast = parsing_fun Lexer.token lexbuf in
    Parsing.clear_parser();
    Docstrings.warn_bad_docstrings ();
    ast
  with
  | Lexer.Error(Lexer.Illegal_character _, _) as err
    when !Location.input_name = "//toplevel//"->
      skip_phrase lexbuf;
      raise err
  | Syntaxerr.Error _ as err
    when !Location.input_name = "//toplevel//" ->
      maybe_skip_phrase lexbuf;
      raise err
  | Parsing.Parse_error | Syntaxerr.Escape_error ->
      let loc = Location.curr lexbuf in
      if !Location.input_name = "//toplevel//"
      then maybe_skip_phrase lexbuf;
      raise(Syntaxerr.Error(Syntaxerr.Other loc))

let implementation = wrap Parser.implementation
and interface = wrap Parser.interface
and toplevel_phrase = wrap Parser.toplevel_phrase
and use_file = wrap Parser.use_file
and core_type = wrap Parser.parse_core_type
and expression = wrap Parser.parse_expression
and pattern = wrap Parser.parse_pattern

end
module Ast_mapper : sig 
#1 "ast_mapper.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2012 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** The interface of a -ppx rewriter

  A -ppx rewriter is a program that accepts a serialized abstract syntax
  tree and outputs another, possibly modified, abstract syntax tree.
  This module encapsulates the interface between the compiler and
  the -ppx rewriters, handling such details as the serialization format,
  forwarding of command-line flags, and storing state.

  {!mapper} allows to implement AST rewriting using open recursion.
  A typical mapper would be based on {!default_mapper}, a deep
  identity mapper, and will fall back on it for handling the syntax it
  does not modify. For example:

  {[
open Asttypes
open Parsetree
open Ast_mapper

let test_mapper argv =
  { default_mapper with
    expr = fun mapper expr ->
      match expr with
      | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
        Ast_helper.Exp.constant (Const_int 42)
      | other -> default_mapper.expr mapper other; }

let () =
  register "ppx_test" test_mapper]}

  This -ppx rewriter, which replaces [[%test]] in expressions with
  the constant [42], can be compiled using
  [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

  *)

open Parsetree

(** {2 A generic Parsetree mapper} *)

type mapper = {
  attribute: mapper -> attribute -> attribute;
  attributes: mapper -> attribute list -> attribute list;
  case: mapper -> case -> case;
  cases: mapper -> case list -> case list;
  class_declaration: mapper -> class_declaration -> class_declaration;
  class_description: mapper -> class_description -> class_description;
  class_expr: mapper -> class_expr -> class_expr;
  class_field: mapper -> class_field -> class_field;
  class_signature: mapper -> class_signature -> class_signature;
  class_structure: mapper -> class_structure -> class_structure;
  class_type: mapper -> class_type -> class_type;
  class_type_declaration: mapper -> class_type_declaration
                          -> class_type_declaration;
  class_type_field: mapper -> class_type_field -> class_type_field;
  constructor_declaration: mapper -> constructor_declaration
                           -> constructor_declaration;
  expr: mapper -> expression -> expression;
  extension: mapper -> extension -> extension;
  extension_constructor: mapper -> extension_constructor
                         -> extension_constructor;
  include_declaration: mapper -> include_declaration -> include_declaration;
  include_description: mapper -> include_description -> include_description;
  label_declaration: mapper -> label_declaration -> label_declaration;
  location: mapper -> Location.t -> Location.t;
  module_binding: mapper -> module_binding -> module_binding;
  module_declaration: mapper -> module_declaration -> module_declaration;
  module_expr: mapper -> module_expr -> module_expr;
  module_type: mapper -> module_type -> module_type;
  module_type_declaration: mapper -> module_type_declaration
                           -> module_type_declaration;
  open_description: mapper -> open_description -> open_description;
  pat: mapper -> pattern -> pattern;
  payload: mapper -> payload -> payload;
  signature: mapper -> signature -> signature;
  signature_item: mapper -> signature_item -> signature_item;
  structure: mapper -> structure -> structure;
  structure_item: mapper -> structure_item -> structure_item;
  typ: mapper -> core_type -> core_type;
  type_declaration: mapper -> type_declaration -> type_declaration;
  type_extension: mapper -> type_extension -> type_extension;
  type_kind: mapper -> type_kind -> type_kind;
  value_binding: mapper -> value_binding -> value_binding;
  value_description: mapper -> value_description -> value_description;
  with_constraint: mapper -> with_constraint -> with_constraint;
}
(** A mapper record implements one "method" per syntactic category,
    using an open recursion style: each method takes as its first
    argument the mapper to be applied to children in the syntax
    tree. *)

val default_mapper: mapper
(** A default mapper, which implements a "deep identity" mapping. *)

(** {2 Apply mappers to compilation units} *)

val tool_name: unit -> string
(** Can be used within a ppx preprocessor to know which tool is
    calling it ["ocamlc"], ["ocamlopt"], ["ocamldoc"], ["ocamldep"],
    ["ocaml"], ...  Some global variables that reflect command-line
    options are automatically synchronized between the calling tool
    and the ppx preprocessor: [Clflags.include_dirs],
    [Config.load_path], [Clflags.open_modules], [Clflags.for_package],
    [Clflags.debug]. *)


val apply: source:string -> target:string -> mapper -> unit
(** Apply a mapper (parametrized by the unit name) to a dumped
    parsetree found in the [source] file and put the result in the
    [target] file. The [structure] or [signature] field of the mapper
    is applied to the implementation or interface.  *)

val run_main: (string list -> mapper) -> unit
(** Entry point to call to implement a standalone -ppx rewriter from a
    mapper, parametrized by the command line arguments.  The current
    unit name can be obtained from [Location.input_name].  This
    function implements proper error reporting for uncaught
    exceptions. *)

(** {2 Registration API} *)

val register_function: (string -> (string list -> mapper) -> unit) ref

val register: string -> (string list -> mapper) -> unit
(** Apply the [register_function].  The default behavior is to run the
    mapper immediately, taking arguments from the process command
    line.  This is to support a scenario where a mapper is linked as a
    stand-alone executable.

    It is possible to overwrite the [register_function] to define
    "-ppx drivers", which combine several mappers in a single process.
    Typically, a driver starts by defining [register_function] to a
    custom implementation, then lets ppx rewriters (linked statically
    or dynamically) register themselves, and then run all or some of
    them.  It is also possible to have -ppx drivers apply rewriters to
    only specific parts of an AST.

    The first argument to [register] is a symbolic name to be used by
    the ppx driver.  *)


(** {2 Convenience functions to write mappers} *)

val map_opt: ('a -> 'b) -> 'a option -> 'b option

val extension_of_error: Location.error -> extension
(** Encode an error into an 'ocaml.error' extension node which can be
    inserted in a generated Parsetree.  The compiler will be
    responsible for reporting the error. *)

val attribute_of_warning: Location.t -> string -> attribute
(** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
    inserted in a generated Parsetree.  The compiler will be
    responsible for reporting the warning. *)

(** {2 Helper functions to call external mappers} *)

val add_ppx_context_str: tool_name:string -> Parsetree.structure -> Parsetree.structure
(** Extract information from the current environment and encode it
    into an attribute which is prepended to the list of structure
    items in order to pass the information to an external
    processor. *)

val add_ppx_context_sig: tool_name:string -> Parsetree.signature -> Parsetree.signature
(** Same as [add_ppx_context_str], but for signatures. *)

val drop_ppx_context_str: restore:bool -> Parsetree.structure -> Parsetree.structure
(** Drop the ocaml.ppx.context attribute from a structure.  If
    [restore] is true, also restore the associated data in the current
    process. *)

val drop_ppx_context_sig: restore:bool -> Parsetree.signature -> Parsetree.signature
(** Same as [drop_ppx_context_str], but for signatures. *)

(** {2 Cookies} *)

(** Cookies are used to pass information from a ppx processor to
    a further invocation of itself, when called from the OCaml
    toplevel (or other tools that support cookies). *)

val set_cookie: string -> Parsetree.expression -> unit
val get_cookie: string -> Parsetree.expression option

end = struct
#1 "ast_mapper.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2012 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* A generic Parsetree mapping class *)

(*
[@@@ocaml.warning "+9"]
  (* Ensure that record patterns don't miss any field. *)
*)


open Asttypes
open Parsetree
open Ast_helper
open Location

type mapper = {
  attribute: mapper -> attribute -> attribute;
  attributes: mapper -> attribute list -> attribute list;
  case: mapper -> case -> case;
  cases: mapper -> case list -> case list;
  class_declaration: mapper -> class_declaration -> class_declaration;
  class_description: mapper -> class_description -> class_description;
  class_expr: mapper -> class_expr -> class_expr;
  class_field: mapper -> class_field -> class_field;
  class_signature: mapper -> class_signature -> class_signature;
  class_structure: mapper -> class_structure -> class_structure;
  class_type: mapper -> class_type -> class_type;
  class_type_declaration: mapper -> class_type_declaration
                          -> class_type_declaration;
  class_type_field: mapper -> class_type_field -> class_type_field;
  constructor_declaration: mapper -> constructor_declaration
                           -> constructor_declaration;
  expr: mapper -> expression -> expression;
  extension: mapper -> extension -> extension;
  extension_constructor: mapper -> extension_constructor
                         -> extension_constructor;
  include_declaration: mapper -> include_declaration -> include_declaration;
  include_description: mapper -> include_description -> include_description;
  label_declaration: mapper -> label_declaration -> label_declaration;
  location: mapper -> Location.t -> Location.t;
  module_binding: mapper -> module_binding -> module_binding;
  module_declaration: mapper -> module_declaration -> module_declaration;
  module_expr: mapper -> module_expr -> module_expr;
  module_type: mapper -> module_type -> module_type;
  module_type_declaration: mapper -> module_type_declaration
                           -> module_type_declaration;
  open_description: mapper -> open_description -> open_description;
  pat: mapper -> pattern -> pattern;
  payload: mapper -> payload -> payload;
  signature: mapper -> signature -> signature;
  signature_item: mapper -> signature_item -> signature_item;
  structure: mapper -> structure -> structure;
  structure_item: mapper -> structure_item -> structure_item;
  typ: mapper -> core_type -> core_type;
  type_declaration: mapper -> type_declaration -> type_declaration;
  type_extension: mapper -> type_extension -> type_extension;
  type_kind: mapper -> type_kind -> type_kind;
  value_binding: mapper -> value_binding -> value_binding;
  value_description: mapper -> value_description -> value_description;
  with_constraint: mapper -> with_constraint -> with_constraint;
}

let map_fst f (x, y) = (f x, y)
let map_snd f (x, y) = (x, f y)
let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
let map_opt f = function None -> None | Some x -> Some (f x)

let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

module T = struct
  (* Type expressions for the core language *)

  let row_field sub = function
    | Rtag (l, attrs, b, tl) ->
        Rtag (l, sub.attributes sub attrs, b, List.map (sub.typ sub) tl)
    | Rinherit t -> Rinherit (sub.typ sub t)

  let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
    let open Typ in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Ptyp_any -> any ~loc ~attrs ()
    | Ptyp_var s -> var ~loc ~attrs s
    | Ptyp_arrow (lab, t1, t2) ->
        arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
    | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
    | Ptyp_constr (lid, tl) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
    | Ptyp_object (l, o) ->
        let f (s, a, t) = (s, sub.attributes sub a, sub.typ sub t) in
        object_ ~loc ~attrs (List.map f l) o
    | Ptyp_class (lid, tl) ->
        class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
    | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
    | Ptyp_variant (rl, b, ll) ->
        variant ~loc ~attrs (List.map (row_field sub) rl) b ll
    | Ptyp_poly (sl, t) -> poly ~loc ~attrs sl (sub.typ sub t)
    | Ptyp_package (lid, l) ->
        package ~loc ~attrs (map_loc sub lid)
          (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
    | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_type_declaration sub
      {ptype_name; ptype_params; ptype_cstrs;
       ptype_kind;
       ptype_private;
       ptype_manifest;
       ptype_attributes;
       ptype_loc} =
    Type.mk (map_loc sub ptype_name)
      ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
      ~priv:ptype_private
      ~cstrs:(List.map
                (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                ptype_cstrs)
      ~kind:(sub.type_kind sub ptype_kind)
      ?manifest:(map_opt (sub.typ sub) ptype_manifest)
      ~loc:(sub.location sub ptype_loc)
      ~attrs:(sub.attributes sub ptype_attributes)

  let map_type_kind sub = function
    | Ptype_abstract -> Ptype_abstract
    | Ptype_variant l ->
        Ptype_variant (List.map (sub.constructor_declaration sub) l)
    | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
    | Ptype_open -> Ptype_open

  let map_type_extension sub
      {ptyext_path; ptyext_params;
       ptyext_constructors;
       ptyext_private;
       ptyext_attributes} =
    Te.mk
      (map_loc sub ptyext_path)
      (List.map (sub.extension_constructor sub) ptyext_constructors)
      ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
      ~priv:ptyext_private
      ~attrs:(sub.attributes sub ptyext_attributes)

  let map_extension_constructor_kind sub = function
      Pext_decl(ctl, cto) ->
        Pext_decl(List.map (sub.typ sub) ctl, map_opt (sub.typ sub) cto)
    | Pext_rebind li ->
        Pext_rebind (map_loc sub li)

  let map_extension_constructor sub
      {pext_name;
       pext_kind;
       pext_loc;
       pext_attributes} =
    Te.constructor
      (map_loc sub pext_name)
      (map_extension_constructor_kind sub pext_kind)
      ~loc:(sub.location sub pext_loc)
      ~attrs:(sub.attributes sub pext_attributes)

end

module CT = struct
  (* Type expressions for the class language *)

  let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
    let open Cty in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pcty_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
    | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
    | Pcty_arrow (lab, t, ct) ->
        arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
    | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
    =
    let open Ctf in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
    | Pctf_val (s, m, v, t) -> val_ ~loc ~attrs s m v (sub.typ sub t)
    | Pctf_method (s, p, v, t) -> method_ ~loc ~attrs s p v (sub.typ sub t)
    | Pctf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
    | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
    | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_signature sub {pcsig_self; pcsig_fields} =
    Csig.mk
      (sub.typ sub pcsig_self)
      (List.map (sub.class_type_field sub) pcsig_fields)
end

module MT = struct
  (* Type expressions for the module language *)

  let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
    let open Mty in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
    | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
    | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
    | Pmty_functor (s, mt1, mt2) ->
        functor_ ~loc ~attrs (map_loc sub s)
          (Misc.may_map (sub.module_type sub) mt1)
          (sub.module_type sub mt2)
    | Pmty_with (mt, l) ->
        with_ ~loc ~attrs (sub.module_type sub mt)
          (List.map (sub.with_constraint sub) l)
    | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
    | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_with_constraint sub = function
    | Pwith_type (lid, d) ->
        Pwith_type (map_loc sub lid, sub.type_declaration sub d)
    | Pwith_module (lid, lid2) ->
        Pwith_module (map_loc sub lid, map_loc sub lid2)
    | Pwith_typesubst d -> Pwith_typesubst (sub.type_declaration sub d)
    | Pwith_modsubst (s, lid) ->
        Pwith_modsubst (map_loc sub s, map_loc sub lid)

  let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
    let open Sig in
    let loc = sub.location sub loc in
    match desc with
    | Psig_value vd -> value ~loc (sub.value_description sub vd)
    | Psig_type l -> type_ ~loc (List.map (sub.type_declaration sub) l)
    | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
    | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
    | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
    | Psig_recmodule l ->
        rec_module ~loc (List.map (sub.module_declaration sub) l)
    | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
    | Psig_open x -> open_ ~loc (sub.open_description sub x)
    | Psig_include x -> include_ ~loc (sub.include_description sub x)
    | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
    | Psig_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
    | Psig_extension (x, attrs) ->
        extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
    | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
end


module M = struct
  (* Value expressions for the module language *)

  let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
    let open Mod in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
    | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
    | Pmod_functor (arg, arg_ty, body) ->
        functor_ ~loc ~attrs (map_loc sub arg)
          (Misc.may_map (sub.module_type sub) arg_ty)
          (sub.module_expr sub body)
    | Pmod_apply (m1, m2) ->
        apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
    | Pmod_constraint (m, mty) ->
        constraint_ ~loc ~attrs (sub.module_expr sub m)
                    (sub.module_type sub mty)
    | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
    | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
    let open Str in
    let loc = sub.location sub loc in
    match desc with
    | Pstr_eval (x, attrs) ->
        eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
    | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
    | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
    | Pstr_type l -> type_ ~loc (List.map (sub.type_declaration sub) l)
    | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
    | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
    | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
    | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
    | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
    | Pstr_open x -> open_ ~loc (sub.open_description sub x)
    | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
    | Pstr_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
    | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
    | Pstr_extension (x, attrs) ->
        extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
    | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
end

module E = struct
  (* Value expressions for the core language *)

  let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
    let open Exp in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
    | Pexp_constant x -> constant ~loc ~attrs x
    | Pexp_let (r, vbs, e) ->
        let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.expr sub e)
    | Pexp_fun (lab, def, p, e) ->
        fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
          (sub.expr sub e)
    | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
    | Pexp_apply (e, l) ->
        apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
    | Pexp_match (e, pel) ->
        match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
    | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
    | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
    | Pexp_construct (lid, arg) ->
        construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
    | Pexp_variant (lab, eo) ->
        variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
    | Pexp_record (l, eo) ->
        record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
          (map_opt (sub.expr sub) eo)
    | Pexp_field (e, lid) ->
        field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
    | Pexp_setfield (e1, lid, e2) ->
        setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
          (sub.expr sub e2)
    | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
    | Pexp_ifthenelse (e1, e2, e3) ->
        ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
          (map_opt (sub.expr sub) e3)
    | Pexp_sequence (e1, e2) ->
        sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
    | Pexp_while (e1, e2) ->
        while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
    | Pexp_for (p, e1, e2, d, e3) ->
        for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
          (sub.expr sub e3)
    | Pexp_coerce (e, t1, t2) ->
        coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
          (sub.typ sub t2)
    | Pexp_constraint (e, t) ->
        constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
    | Pexp_send (e, s) -> send ~loc ~attrs (sub.expr sub e) s
    | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
    | Pexp_setinstvar (s, e) ->
        setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
    | Pexp_override sel ->
        override ~loc ~attrs
          (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
    | Pexp_letmodule (s, me, e) ->
        letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
          (sub.expr sub e)
    | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
    | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
    | Pexp_poly (e, t) ->
        poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
    | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
    | Pexp_newtype (s, e) -> newtype ~loc ~attrs s (sub.expr sub e)
    | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
    | Pexp_open (ovf, lid, e) ->
        open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
    | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
end

module P = struct
  (* Patterns *)

  let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
    let open Pat in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Ppat_any -> any ~loc ~attrs ()
    | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
    | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
    | Ppat_constant c -> constant ~loc ~attrs c
    | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
    | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
    | Ppat_construct (l, p) ->
        construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
    | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
    | Ppat_record (lpl, cf) ->
        record ~loc ~attrs
               (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
    | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
    | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
    | Ppat_constraint (p, t) ->
        constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
    | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
    | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
    | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
    | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
    | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
end

module CE = struct
  (* Value expressions for the class language *)

  let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
    let open Cl in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pcl_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
    | Pcl_structure s ->
        structure ~loc ~attrs (sub.class_structure sub s)
    | Pcl_fun (lab, e, p, ce) ->
        fun_ ~loc ~attrs lab
          (map_opt (sub.expr sub) e)
          (sub.pat sub p)
          (sub.class_expr sub ce)
    | Pcl_apply (ce, l) ->
        apply ~loc ~attrs (sub.class_expr sub ce)
          (List.map (map_snd (sub.expr sub)) l)
    | Pcl_let (r, vbs, ce) ->
        let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.class_expr sub ce)
    | Pcl_constraint (ce, ct) ->
        constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
    | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_kind sub = function
    | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
    | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

  let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
    let open Cf in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pcf_inherit (o, ce, s) -> inherit_ ~loc ~attrs o (sub.class_expr sub ce) s
    | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
    | Pcf_method (s, p, k) ->
        method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
    | Pcf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
    | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
    | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
    | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_structure sub {pcstr_self; pcstr_fields} =
    {
      pcstr_self = sub.pat sub pcstr_self;
      pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
    }

  let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                         pci_loc; pci_attributes} =
    Ci.mk
     ~virt:pci_virt
     ~params:(List.map (map_fst (sub.typ sub)) pl)
      (map_loc sub pci_name)
      (f pci_expr)
      ~loc:(sub.location sub pci_loc)
      ~attrs:(sub.attributes sub pci_attributes)
end

(* Now, a generic AST mapper, to be extended to cover all kinds and
   cases of the OCaml grammar.  The default behavior of the mapper is
   the identity. *)

let default_mapper =
  {
    structure = (fun this l -> List.map (this.structure_item this) l);
    structure_item = M.map_structure_item;
    module_expr = M.map;
    signature = (fun this l -> List.map (this.signature_item this) l);
    signature_item = MT.map_signature_item;
    module_type = MT.map;
    with_constraint = MT.map_with_constraint;
    class_declaration =
      (fun this -> CE.class_infos this (this.class_expr this));
    class_expr = CE.map;
    class_field = CE.map_field;
    class_structure = CE.map_structure;
    class_type = CT.map;
    class_type_field = CT.map_field;
    class_signature = CT.map_signature;
    class_type_declaration =
      (fun this -> CE.class_infos this (this.class_type this));
    class_description =
      (fun this -> CE.class_infos this (this.class_type this));
    type_declaration = T.map_type_declaration;
    type_kind = T.map_type_kind;
    typ = T.map;
    type_extension = T.map_type_extension;
    extension_constructor = T.map_extension_constructor;
    value_description =
      (fun this {pval_name; pval_type; pval_prim; pval_loc;
                 pval_attributes} ->
        Val.mk
          (map_loc this pval_name)
          (this.typ this pval_type)
          ~attrs:(this.attributes this pval_attributes)
          ~loc:(this.location this pval_loc)
          ~prim:pval_prim
      );

    pat = P.map;
    expr = E.map;

    module_declaration =
      (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
         Md.mk
           (map_loc this pmd_name)
           (this.module_type this pmd_type)
           ~attrs:(this.attributes this pmd_attributes)
           ~loc:(this.location this pmd_loc)
      );

    module_type_declaration =
      (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
         Mtd.mk
           (map_loc this pmtd_name)
           ?typ:(map_opt (this.module_type this) pmtd_type)
           ~attrs:(this.attributes this pmtd_attributes)
           ~loc:(this.location this pmtd_loc)
      );

    module_binding =
      (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
         Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
           ~attrs:(this.attributes this pmb_attributes)
           ~loc:(this.location this pmb_loc)
      );


    open_description =
      (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
         Opn.mk (map_loc this popen_lid)
           ~override:popen_override
           ~loc:(this.location this popen_loc)
           ~attrs:(this.attributes this popen_attributes)
      );


    include_description =
      (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
         Incl.mk (this.module_type this pincl_mod)
           ~loc:(this.location this pincl_loc)
           ~attrs:(this.attributes this pincl_attributes)
      );

    include_declaration =
      (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
         Incl.mk (this.module_expr this pincl_mod)
           ~loc:(this.location this pincl_loc)
           ~attrs:(this.attributes this pincl_attributes)
      );


    value_binding =
      (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
         Vb.mk
           (this.pat this pvb_pat)
           (this.expr this pvb_expr)
           ~loc:(this.location this pvb_loc)
           ~attrs:(this.attributes this pvb_attributes)
      );


    constructor_declaration =
      (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
        Type.constructor
          (map_loc this pcd_name)
          ~args:(List.map (this.typ this) pcd_args)
          ?res:(map_opt (this.typ this) pcd_res)
          ~loc:(this.location this pcd_loc)
          ~attrs:(this.attributes this pcd_attributes)
      );

    label_declaration =
      (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
         Type.field
           (map_loc this pld_name)
           (this.typ this pld_type)
           ~mut:pld_mutable
           ~loc:(this.location this pld_loc)
           ~attrs:(this.attributes this pld_attributes)
      );

    cases = (fun this l -> List.map (this.case this) l);
    case =
      (fun this {pc_lhs; pc_guard; pc_rhs} ->
         {
           pc_lhs = this.pat this pc_lhs;
           pc_guard = map_opt (this.expr this) pc_guard;
           pc_rhs = this.expr this pc_rhs;
         }
      );



    location = (fun this l -> l);

    extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
    attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
    attributes = (fun this l -> List.map (this.attribute this) l);
    payload =
      (fun this -> function
         | PStr x -> PStr (this.structure this x)
         | PTyp x -> PTyp (this.typ this x)
         | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
      );
  }

let rec extension_of_error {loc; msg; if_highlight; sub} =
  { loc; txt = "ocaml.error" },
  PStr ([Str.eval (Exp.constant (Const_string (msg, None)));
         Str.eval (Exp.constant (Const_string (if_highlight, None)))] @
        (List.map (fun ext -> Str.extension (extension_of_error ext)) sub))

let attribute_of_warning loc s =
  { loc; txt = "ocaml.ppwarning" },
  PStr ([Str.eval ~loc (Exp.constant (Const_string (s, None)))])

module StringMap = Map.Make(struct
    type t = string
    let compare = compare
end)

let cookies = ref StringMap.empty

let get_cookie k =
  try Some (StringMap.find k !cookies)
  with Not_found -> None

let set_cookie k v =
  cookies := StringMap.add k v !cookies

let tool_name_ref = ref "_none_"

let tool_name () = !tool_name_ref


module PpxContext = struct
  open Longident
  open Asttypes
  open Ast_helper

  let lid name = { txt = Lident name; loc = Location.none }

  let make_string x = Exp.constant (Const_string (x, None))

  let make_bool x =
    if x
    then Exp.construct (lid "true") None
    else Exp.construct (lid "false") None

  let rec make_list f lst =
    match lst with
    | x :: rest ->
      Exp.construct (lid "::") (Some (Exp.tuple [f x; make_list f rest]))
    | [] ->
      Exp.construct (lid "[]") None

  let make_pair f1 f2 (x1, x2) =
    Exp.tuple [f1 x1; f2 x2]

  let make_option f opt =
    match opt with
    | Some x -> Exp.construct (lid "Some") (Some (f x))
    | None   -> Exp.construct (lid "None") None

  let get_cookies () =
    lid "cookies",
    make_list (make_pair make_string (fun x -> x))
      (StringMap.bindings !cookies)

  let mk fields =
    { txt = "ocaml.ppx.context"; loc = Location.none },
    Parsetree.PStr [Str.eval (Exp.record fields None)]

  let make ~tool_name () =
    let fields =
      [
        lid "tool_name",    make_string tool_name;
        lid "include_dirs", make_list make_string !Clflags.include_dirs;
        lid "load_path",    make_list make_string !Config.load_path;
        lid "open_modules", make_list make_string !Clflags.open_modules;
        lid "for_package",  make_option make_string !Clflags.for_package;
        lid "debug",        make_bool !Clflags.debug;
        get_cookies ()
      ]
    in
    mk fields

  let get_fields = function
    | PStr [{pstr_desc = Pstr_eval
                 ({ pexp_desc = Pexp_record (fields, None) }, [])}] ->
        fields
    | _ ->
        raise_errorf "Internal error: invalid [@@@ocaml.ppx.context] syntax"

  let restore fields =
    let field name payload =
      let rec get_string = function
        | { pexp_desc = Pexp_constant (Const_string (str, None)) } -> str
        | _ ->
            raise_errorf
              "Internal error: invalid [@@@ocaml.ppx.context { %s }] string syntax"
              name
      and get_bool pexp =
        match pexp with
        | {pexp_desc = Pexp_construct ({txt = Longident.Lident "true"}, None)} ->
            true
        | {pexp_desc = Pexp_construct ({txt = Longident.Lident "false"}, None)} ->
            false
        | _ ->
            raise_errorf
              "Internal error: invalid [@@@ocaml.ppx.context { %s }] bool syntax"
              name
      and get_list elem = function
        | {pexp_desc =
             Pexp_construct ({txt = Longident.Lident "::"},
                             Some {pexp_desc = Pexp_tuple [exp; rest]}) } ->
            elem exp :: get_list elem rest
        | {pexp_desc =
             Pexp_construct ({txt = Longident.Lident "[]"}, None)} ->
            []
        | _ ->
            raise_errorf
              "Internal error: invalid [@@@ocaml.ppx.context { %s }] list syntax"
              name
      and get_pair f1 f2 = function
        | {pexp_desc = Pexp_tuple [e1; e2]} ->
            (f1 e1, f2 e2)
        | _ ->
            raise_errorf
              "Internal error: invalid [@@@ocaml.ppx.context { %s }] pair syntax"
              name
      and get_option elem = function
        | { pexp_desc =
              Pexp_construct ({ txt = Longident.Lident "Some" }, Some exp) } ->
            Some (elem exp)
        | { pexp_desc =
              Pexp_construct ({ txt = Longident.Lident "None" }, None) } ->
            None
        | _ ->
            raise_errorf
              "Internal error: invalid [@@@ocaml.ppx.context { %s }] option syntax"
              name
      in
      match name with
      | "tool_name" ->
          tool_name_ref := get_string payload
      | "include_dirs" ->
          Clflags.include_dirs := get_list get_string payload
      | "load_path" ->
          Config.load_path := get_list get_string payload
      | "open_modules" ->
          Clflags.open_modules := get_list get_string payload
      | "for_package" ->
          Clflags.for_package := get_option get_string payload
      | "debug" ->
          Clflags.debug := get_bool payload
      | "cookies" ->
          let l = get_list (get_pair get_string (fun x -> x)) payload in
          cookies :=
            List.fold_left
              (fun s (k, v) -> StringMap.add k v s) StringMap.empty
              l
      | _ ->
          ()
    in
    List.iter (function ({txt=Lident name}, x) -> field name x | _ -> ()) fields

  let update_cookies fields =
    let fields =
      List.filter
        (function ({txt=Lident "cookies"}, _) -> false | _ -> true)
        fields
    in
    fields @ [get_cookies ()]
end

let ppx_context = PpxContext.make


let apply_lazy ~source ~target mapper =
  let ic = open_in_bin source in
  let magic =
    really_input_string ic (String.length Config.ast_impl_magic_number)
  in
  if magic <> Config.ast_impl_magic_number
  && magic <> Config.ast_intf_magic_number then
    failwith "Ast_mapper: OCaml version mismatch or malformed input";
  Location.input_name := input_value ic;
  let ast = input_value ic in
  close_in ic;

  let implem ast =
    try
      let fields, ast =
        match ast with
        | {pstr_desc = Pstr_attribute ({txt = "ocaml.ppx.context"}, x)} :: l ->
            PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let mapper = mapper () in
      let ast = mapper.structure mapper ast in
      let fields = PpxContext.update_cookies fields in
      Str.attribute (PpxContext.mk fields) :: ast
    with exn ->
      match error_of_exn exn with
      | Some error ->
          [{pstr_desc = Pstr_extension (extension_of_error error, []);
            pstr_loc  = Location.none}]
      | None -> raise exn
  in
  let iface ast =
    try
      let fields, ast =
        match ast with
        | {psig_desc = Psig_attribute ({txt = "ocaml.ppx.context"}, x)} :: l ->
            PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let mapper = mapper () in
      let ast = mapper.signature mapper ast in
      let fields = PpxContext.update_cookies fields in
      Sig.attribute (PpxContext.mk fields) :: ast
    with exn ->
      match error_of_exn exn with
      | Some error ->
          [{psig_desc = Psig_extension (extension_of_error error, []);
            psig_loc  = Location.none}]
      | None -> raise exn
  in
  let ast =
    if magic = Config.ast_impl_magic_number
    then Obj.magic (implem (Obj.magic ast))
    else Obj.magic (iface (Obj.magic ast))
  in
  let oc = open_out_bin target in
  output_string oc magic;
  output_value oc !Location.input_name;
  output_value oc ast;
  close_out oc

let drop_ppx_context_str ~restore = function
  | {pstr_desc = Pstr_attribute({Location.txt = "ocaml.ppx.context"}, a)}
    :: items ->
      if restore then
        PpxContext.restore (PpxContext.get_fields a);
      items
  | items -> items

let drop_ppx_context_sig ~restore = function
  | {psig_desc = Psig_attribute({Location.txt = "ocaml.ppx.context"}, a)}
    :: items ->
      if restore then
        PpxContext.restore (PpxContext.get_fields a);
      items
  | items -> items

let add_ppx_context_str ~tool_name ast =
  Ast_helper.Str.attribute (ppx_context ~tool_name ()) :: ast

let add_ppx_context_sig ~tool_name ast =
  Ast_helper.Sig.attribute (ppx_context ~tool_name ()) :: ast


let apply ~source ~target mapper =
  apply_lazy ~source ~target (fun () -> mapper)

let run_main mapper =
  try
    let a = Sys.argv in
    let n = Array.length a in
    if n > 2 then
      let mapper () =
        try mapper (Array.to_list (Array.sub a 1 (n - 3)))
        with exn ->
          (* PR #6463 *)
          let f _ _ = raise exn in
          {default_mapper with structure = f; signature = f}
      in
      apply_lazy ~source:a.(n - 2) ~target:a.(n - 1) mapper
    else begin
      Printf.eprintf "Usage: %s [extra_args] <infile> <outfile>\n%!"
                     Sys.executable_name;
      exit 2
    end
  with exn ->
    prerr_endline (Printexc.to_string exn);
    exit 2

let register_function = ref (fun _name f -> run_main f)
let register name f = !register_function name f

end
module Ccomp : sig 
#1 "ccomp.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Compiling C files and building C libraries *)

val command: string -> int
val run_command: string -> unit
val compile_file: string -> int
val create_archive: string -> string list -> int
val expand_libname: string -> string
val quote_files: string list -> string
val quote_optfile: string option -> string
(*val make_link_options: string list -> string*)

type link_mode =
  | Exe
  | Dll
  | MainDll
  | Partial

val call_linker: link_mode -> string -> string list -> string -> bool

end = struct
#1 "ccomp.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* Compiling C files and building C libraries *)

let command cmdline =
  if !Clflags.verbose then begin
    prerr_string "+ ";
    prerr_string cmdline;
    prerr_newline()
  end;
  Sys.command cmdline

let run_command cmdline = ignore(command cmdline)

(* Build @responsefile to work around Windows limitations on
   command-line length *)
let build_diversion lst =
  let (responsefile, oc) = Filename.open_temp_file "camlresp" "" in
  List.iter (fun f -> Printf.fprintf oc "%s\n" f) lst;
  close_out oc;
  at_exit (fun () -> Misc.remove_file responsefile);
  "@" ^ responsefile

let quote_files lst =
  let lst = List.filter (fun f -> f <> "") lst in
  let quoted = List.map Filename.quote lst in
  let s = String.concat " " quoted in
  if String.length s >= 4096 && Sys.os_type = "Win32"
  then build_diversion quoted
  else s

let quote_prefixed pr lst =
  let lst = List.filter (fun f -> f <> "") lst in
  let lst = List.map (fun f -> pr ^ f) lst in
  quote_files lst

let quote_optfile = function
  | None -> ""
  | Some f -> Filename.quote f

let compile_file name =
  command
    (Printf.sprintf
       "%s -c %s %s %s %s %s"
       (match !Clflags.c_compiler with
        | Some cc -> cc
        | None ->
            if !Clflags.native_code
            then Config.native_c_compiler
            else Config.bytecomp_c_compiler)
       (if !Clflags.debug then "-g" else "")
       (String.concat " " (List.rev !Clflags.all_ccopts))
       (quote_prefixed "-I" (List.rev !Clflags.include_dirs))
       (Clflags.std_include_flag "-I")
       (Filename.quote name))

let create_archive archive file_list =
  Misc.remove_file archive;
  let quoted_archive = Filename.quote archive in
  match Config.ccomp_type with
    "msvc" ->
      command(Printf.sprintf "link /lib /nologo /out:%s %s"
                             quoted_archive (quote_files file_list))
  | _ ->
      assert(String.length Config.ar > 0);
      let r1 =
        command(Printf.sprintf "%s rc %s %s"
                Config.ar quoted_archive (quote_files file_list)) in
      if r1 <> 0 || String.length Config.ranlib = 0
      then r1
      else command(Config.ranlib ^ " " ^ quoted_archive)

let expand_libname name =
  if String.length name < 2 || String.sub name 0 2 <> "-l"
  then name
  else begin
    let libname =
      "lib" ^ String.sub name 2 (String.length name - 2) ^ Config.ext_lib in
    try
      Misc.find_in_path !Config.load_path libname
    with Not_found ->
      libname
  end

type link_mode =
  | Exe
  | Dll
  | MainDll
  | Partial

let remove_Wl cclibs =
  cclibs |> List.map (fun cclib ->
    (* -Wl,-foo,bar -> -foo bar *)
    if String.length cclib >= 4 && "-Wl," = String.sub cclib 0 4 then
      String.map (function ',' -> ' ' | c -> c)
                 (String.sub cclib 4 (String.length cclib - 4))
    else cclib)

let call_linker mode output_name files extra =
  let cmd =
    if mode = Partial then
      Printf.sprintf "%s%s %s %s %s"
        Config.native_pack_linker
        (Filename.quote output_name)
        (quote_prefixed "-L" !Config.load_path)
        (quote_files (remove_Wl files))
        extra
    else
      Printf.sprintf "%s -o %s %s %s %s %s %s %s"
        (match !Clflags.c_compiler, mode with
        | Some cc, _ -> cc
        | None, Exe -> Config.mkexe
        | None, Dll -> Config.mkdll
        | None, MainDll -> Config.mkmaindll
        | None, Partial -> assert false
        )
        (Filename.quote output_name)
        (if !Clflags.gprofile then Config.cc_profile else "")
        ""  (*(Clflags.std_include_flag "-I")*)
        (quote_prefixed "-L" !Config.load_path)
        (String.concat " " (List.rev !Clflags.all_ccopts))
        (quote_files files)
        extra
  in
  command cmd = 0

end
module Pparse : sig 
#1 "pparse.mli"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*        Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt     *)
(*                                                                     *)
(*  Copyright 2002 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Format

type error =
  | CannotRun of string
  | WrongMagic of string

exception Error of error

val preprocess : string -> string
val remove_preprocessed : string -> unit
val file : formatter -> tool_name:string -> string -> (Lexing.lexbuf -> 'a) -> string -> 'a
val apply_rewriters: ?restore:bool -> tool_name:string -> string -> 'a -> 'a
  (** If [restore = true] (the default), cookies set by external rewriters will be
      kept for later calls. *)

val apply_rewriters_str: ?restore:bool -> tool_name:string -> Parsetree.structure -> Parsetree.structure
val apply_rewriters_sig: ?restore:bool -> tool_name:string -> Parsetree.signature -> Parsetree.signature


val report_error : formatter -> error -> unit


val parse_implementation: formatter -> tool_name:string -> string -> Parsetree.structure
val parse_interface: formatter -> tool_name:string -> string -> Parsetree.signature

(* [call_external_preprocessor sourcefile pp] *)
val call_external_preprocessor : string -> string -> string
val open_and_check_magic : string -> string -> in_channel * bool
val read_ast : string -> string -> 'a

end = struct
#1 "pparse.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*        Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt     *)
(*                                                                     *)
(*  Copyright 2002 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Format

type error =
  | CannotRun of string
  | WrongMagic of string

exception Error of error

(* Optionally preprocess a source file *)

let call_external_preprocessor sourcefile pp =
      let tmpfile = Filename.temp_file "ocamlpp" "" in
      let comm = Printf.sprintf "%s %s > %s"
                                pp (Filename.quote sourcefile) tmpfile
      in
      if Ccomp.command comm <> 0 then begin
        Misc.remove_file tmpfile;
        raise (Error (CannotRun comm));
      end;
      tmpfile

let preprocess sourcefile =
  match !Clflags.preprocessor with
    None -> sourcefile
  | Some pp -> call_external_preprocessor sourcefile pp


let remove_preprocessed inputfile =
  match !Clflags.preprocessor with
    None -> ()
  | Some _ -> Misc.remove_file inputfile


(* Note: some of the functions here should go to Ast_mapper instead,
   which would encapsulate the "binary AST" protocol. *)

let write_ast magic ast =
  let fn = Filename.temp_file "camlppx" "" in
  let oc = open_out_bin fn in
  output_string oc magic;
  output_value oc !Location.input_name;
  output_value oc ast;
  close_out oc;
  fn

let apply_rewriter magic fn_in ppx =
  let fn_out = Filename.temp_file "camlppx" "" in
  let comm =
    Printf.sprintf "%s %s %s" ppx (Filename.quote fn_in) (Filename.quote fn_out)
  in
  let ok = Ccomp.command comm = 0 in
  Misc.remove_file fn_in;
  if not ok then begin
    Misc.remove_file fn_out;
    raise (Error (CannotRun comm));
  end;
  if not (Sys.file_exists fn_out) then
    raise (Error (WrongMagic comm));
  (* check magic before passing to the next ppx *)
  let ic = open_in_bin fn_out in
  let buffer =
    try really_input_string ic (String.length magic) with End_of_file -> "" in
  close_in ic;
  if buffer <> magic then begin
    Misc.remove_file fn_out;
    raise (Error (WrongMagic comm));
  end;
  fn_out

let read_ast magic fn =
  let ic = open_in_bin fn in
  try
    let buffer = really_input_string ic (String.length magic) in
    assert(buffer = magic); (* already checked by apply_rewriter *)
    Location.input_name := input_value ic;
    let ast = input_value ic in
    close_in ic;
    Misc.remove_file fn;
    ast
  with exn ->
    close_in ic;
    Misc.remove_file fn;
    raise exn

let rewrite magic ast ppxs =
  read_ast magic
    (List.fold_left (apply_rewriter magic) (write_ast magic ast)
       (List.rev ppxs))

let apply_rewriters_str ?(restore = true) ~tool_name ast =
  match !Clflags.all_ppx with
  | [] -> ast
  | ppxs ->
      let ast = Ast_mapper.add_ppx_context_str ~tool_name ast in
      let ast = rewrite Config.ast_impl_magic_number ast ppxs in
      Ast_mapper.drop_ppx_context_str ~restore ast

let apply_rewriters_sig ?(restore = true) ~tool_name ast =
  match !Clflags.all_ppx with
  | [] -> ast
  | ppxs ->
      let ast = Ast_mapper.add_ppx_context_sig ~tool_name ast in
      let ast = rewrite Config.ast_intf_magic_number ast ppxs in
      Ast_mapper.drop_ppx_context_sig ~restore ast

let apply_rewriters ?restore ~tool_name magic ast =
  if magic = Config.ast_impl_magic_number then
    Obj.magic (apply_rewriters_str ?restore ~tool_name (Obj.magic ast))
  else if magic = Config.ast_intf_magic_number then
    Obj.magic (apply_rewriters_sig ?restore ~tool_name (Obj.magic ast))
  else
    assert false

(* Parse a file or get a dumped syntax tree from it *)

exception Outdated_version

let open_and_check_magic inputfile ast_magic =
  let ic = open_in_bin inputfile in
  let is_ast_file =
    try
      let buffer = really_input_string ic (String.length ast_magic) in
      if buffer = ast_magic then true
      else if String.sub buffer 0 9 = String.sub ast_magic 0 9 then
        raise Outdated_version
      else false
    with
      Outdated_version ->
        Misc.fatal_error "OCaml and preprocessor have incompatible versions"
    | _ -> false
  in
  (ic, is_ast_file)

let file ppf ~tool_name inputfile parse_fun ast_magic =
  let (ic, is_ast_file) = open_and_check_magic inputfile ast_magic in
  let ast =
    try
      if is_ast_file then begin
        if !Clflags.fast then
          (* FIXME make this a proper warning *)
          fprintf ppf "@[Warning: %s@]@."
            "option -unsafe used with a preprocessor returning a syntax tree";
        Location.input_name := input_value ic;
        input_value ic
      end else begin
        seek_in ic 0;
        Location.input_name := inputfile;
        let lexbuf = Lexing.from_channel ic in
        Location.init lexbuf inputfile;
        parse_fun lexbuf
      end
    with x -> close_in ic; raise x
  in
  close_in ic;
  apply_rewriters ~restore:false ~tool_name ast_magic ast


let report_error ppf = function
  | CannotRun cmd ->
      fprintf ppf "Error while running external preprocessor@.\
                   Command line: %s@." cmd
  | WrongMagic cmd ->
      fprintf ppf "External preprocessor does not produce a valid file@.\
                   Command line: %s@." cmd

let () =
  Location.register_error_of_exn
    (function
      | Error err -> Some (Location.error_of_printer_file report_error err)
      | _ -> None
    )

let parse_all ~tool_name parse_fun magic ppf sourcefile =
  Location.input_name := sourcefile;
  let inputfile = preprocess sourcefile in
  let ast =
    try file ppf ~tool_name inputfile parse_fun magic
    with exn ->
      remove_preprocessed inputfile;
      raise exn
  in
  remove_preprocessed inputfile;
  ast

let parse_implementation ppf ~tool_name sourcefile =
  parse_all ~tool_name Parse.implementation
    Config.ast_impl_magic_number ppf sourcefile
let parse_interface ppf ~tool_name sourcefile =
  parse_all ~tool_name Parse.interface
    Config.ast_intf_magic_number ppf sourcefile

end
module Ext_bytes : sig 
#1 "ext_bytes.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)







(** Port the {!Bytes.escaped} from trunk to make it not locale sensitive *)

val escaped : bytes -> bytes

end = struct
#1 "ext_bytes.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)








external char_code: char -> int = "%identity"
external char_chr: int -> char = "%identity"

let escaped s =
  let n = Pervasives.ref 0 in
  for i = 0 to Bytes.length s - 1 do
    n := !n +
      (match Bytes.unsafe_get s i with
       | '"' | '\\' | '\n' | '\t' | '\r' | '\b' -> 2
       | ' ' .. '~' -> 1
       | _ -> 4)
  done;
  if !n = Bytes.length s then Bytes.copy s else begin
    let s' = Bytes.create !n in
    n := 0;
    for i = 0 to Bytes.length s - 1 do
      begin match Bytes.unsafe_get s i with
      | ('"' | '\\') as c ->
          Bytes.unsafe_set s' !n '\\'; incr n; Bytes.unsafe_set s' !n c
      | '\n' ->
          Bytes.unsafe_set s' !n '\\'; incr n; Bytes.unsafe_set s' !n 'n'
      | '\t' ->
          Bytes.unsafe_set s' !n '\\'; incr n; Bytes.unsafe_set s' !n 't'
      | '\r' ->
          Bytes.unsafe_set s' !n '\\'; incr n; Bytes.unsafe_set s' !n 'r'
      | '\b' ->
          Bytes.unsafe_set s' !n '\\'; incr n; Bytes.unsafe_set s' !n 'b'
      | (' ' .. '~') as c -> Bytes.unsafe_set s' !n c
      | c ->
          let a = char_code c in
          Bytes.unsafe_set s' !n '\\';
          incr n;
          Bytes.unsafe_set s' !n (char_chr (48 + a / 100));
          incr n;
          Bytes.unsafe_set s' !n (char_chr (48 + (a / 10) mod 10));
          incr n;
          Bytes.unsafe_set s' !n (char_chr (48 + a mod 10));
      end;
      incr n
    done;
    s'
  end

end
module Ext_char : sig 
#1 "ext_char.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)






(** Extension to Standard char module, avoid locale sensitivity *)

val escaped : char -> string


val valid_hex : char -> bool

val is_lower_case : char -> bool

val uppercase_ascii : char -> char

val lowercase_ascii : char -> char
end = struct
#1 "ext_char.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)





(** {!Char.escaped} is locale sensitive in 4.02.3, fixed in the trunk,
    backport it here
 *)

module Unsafe = struct 
    external bytes_unsafe_set : string -> int -> char -> unit
                           = "%string_unsafe_set"
    external string_create: int -> string = "caml_create_string"
    external unsafe_chr: int -> char = "%identity"
end 
let escaped ch = 
  let open Unsafe in 
  match ch with 
  | '\'' -> "\\'"
  | '\\' -> "\\\\"
  | '\n' -> "\\n"
  | '\t' -> "\\t"
  | '\r' -> "\\r"
  | '\b' -> "\\b"
  | ' ' .. '~' as c ->
      let s = string_create 1 in
      bytes_unsafe_set s 0 c;
      s
  | c ->
      let n = Char.code c in
      let s = string_create 4 in
      bytes_unsafe_set s 0 '\\';
      bytes_unsafe_set s 1 (unsafe_chr (48 + n / 100));
      bytes_unsafe_set s 2 (unsafe_chr (48 + (n / 10) mod 10));
      bytes_unsafe_set s 3 (unsafe_chr (48 + n mod 10));
      s


let valid_hex x = 
    match x with 
    | '0' .. '9'
    | 'a' .. 'f'
    | 'A' .. 'F' -> true
    | _ -> false 



let is_lower_case c =
  (c >= 'a' && c <= 'z')
  || (c >= '\224' && c <= '\246')
  || (c >= '\248' && c <= '\254')    
let uppercase_ascii =

    Char.uppercase
      

let lowercase_ascii = 

    Char.lowercase
      

end
module Ext_string : sig 
#1 "ext_string.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)








(** Extension to the standard library [String] module, fixed some bugs like
    avoiding locale sensitivity *) 

(** default is false *)    
val split_by : ?keep_empty:bool -> (char -> bool) -> string -> string list


(** remove whitespace letters ('\t', '\n', ' ') on both side*)
val trim : string -> string 


(** default is false *)
val split : ?keep_empty:bool -> string -> char -> string list

(** split by space chars for quick scripting *)
val quick_split_by_ws : string -> string list 



val starts_with : string -> string -> bool

(**
   return [-1] when not found, the returned index is useful 
   see [ends_with_then_chop]
*)
val ends_with_index : string -> string -> int

val ends_with : string -> string -> bool

(**
  [ends_with_then_chop name ext]
  @example:
   {[
     ends_with_then_chop "a.cmj" ".cmj"
     "a"
   ]}
   This is useful in controlled or file case sensitve system
*)
val ends_with_then_chop : string -> string -> string option


val escaped : string -> string

(**
  [for_all_from  s start p]
  if [start] is negative, it raises,
  if [start] is too large, it returns true
*)
val for_all_from:
  string -> 
  int -> 
  (char -> bool) -> 
  bool 

val for_all : 
  string -> 
  (char -> bool) -> 
  bool

val is_empty : string -> bool

val repeat : int -> string -> string 

val equal : string -> string -> bool

(**
  [find ~start ~sub s]
  returns [-1] if not found
*)
val find : ?start:int -> sub:string -> string -> int

val contain_substring : string -> string -> bool 

val non_overlap_count : sub:string -> string -> int 

val rfind : sub:string -> string -> int

(** [tail_from s 1]
  return a substring from offset 1 (inclusive)
*)
val tail_from : string -> int -> string


(** returns negative number if not found *)
val rindex_neg : string -> char -> int 

val rindex_opt : string -> char -> int option

type check_result = 
    | Good | Invalid_module_name | Suffix_mismatch

val is_valid_source_name :
   string -> check_result





val no_char : string -> char -> int -> int -> bool 


val no_slash : string -> bool 

(** return negative means no slash, otherwise [i] means the place for first slash *)
val no_slash_idx : string -> int 

(** if no conversion happens, reference equality holds *)
val replace_slash_backward : string -> string 

(** if no conversion happens, reference equality holds *)
val replace_backward_slash : string -> string 

val empty : string 


external compare : string -> string -> int = "caml_string_length_based_compare" "noalloc";;
  
val single_space : string

val concat3 : string -> string -> string -> string 
val concat4 : string -> string -> string -> string -> string 
val concat5 : string -> string -> string -> string -> string -> string  
val inter2 : string -> string -> string
val inter3 : string -> string -> string -> string 
val inter4 : string -> string -> string -> string -> string
val concat_array : string -> string array -> string 

val single_colon : string 

val parent_dir_lit : string
val current_dir_lit : string

val capitalize_ascii : string -> string

val uncapitalize_ascii : string -> string

val lowercase_ascii : string -> string 
end = struct
#1 "ext_string.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)







(*
   {[ split " test_unsafe_obj_ffi_ppx.cmi" ~keep_empty:false ' ']}
*)
let split_by ?(keep_empty=false) is_delim str =
  let len = String.length str in
  let rec loop acc last_pos pos =
    if pos = -1 then
      if last_pos = 0 && not keep_empty then

        acc
      else 
        String.sub str 0 last_pos :: acc
    else
    if is_delim str.[pos] then
      let new_len = (last_pos - pos - 1) in
      if new_len <> 0 || keep_empty then 
        let v = String.sub str (pos + 1) new_len in
        loop ( v :: acc)
          pos (pos - 1)
      else loop acc pos (pos - 1)
    else loop acc last_pos (pos - 1)
  in
  loop [] len (len - 1)

let trim s = 
  let i = ref 0  in
  let j = String.length s in 
  while !i < j &&  
        let u = String.unsafe_get s !i in 
        u = '\t' || u = '\n' || u = ' ' 
  do 
    incr i;
  done;
  let k = ref (j - 1)  in 
  while !k >= !i && 
        let u = String.unsafe_get s !k in 
        u = '\t' || u = '\n' || u = ' ' do 
    decr k ;
  done;
  String.sub s !i (!k - !i + 1)

let split ?keep_empty  str on = 
  if str = "" then [] else 
    split_by ?keep_empty (fun x -> (x : char) = on) str  ;;

let quick_split_by_ws str : string list = 
  split_by ~keep_empty:false (fun x -> x = '\t' || x = '\n' || x = ' ') str

let starts_with s beg = 
  let beg_len = String.length beg in
  let s_len = String.length s in
  beg_len <=  s_len &&
  (let i = ref 0 in
   while !i <  beg_len 
         && String.unsafe_get s !i =
            String.unsafe_get beg !i do 
     incr i 
   done;
   !i = beg_len
  )

let rec ends_aux s end_ j k = 
  if k < 0 then (j + 1)
  else if String.unsafe_get s j = String.unsafe_get end_ k then 
    ends_aux s end_ (j - 1) (k - 1)
  else  -1   

(** return an index which is minus when [s] does not 
    end with [beg]
*)
let ends_with_index s end_ = 
  let s_finish = String.length s - 1 in
  let s_beg = String.length end_ - 1 in
  if s_beg > s_finish then -1
  else
    ends_aux s end_ s_finish s_beg

let ends_with s end_ = ends_with_index s end_ >= 0 

let ends_with_then_chop s beg = 
  let i =  ends_with_index s beg in 
  if i >= 0 then Some (String.sub s 0 i) 
  else None

let check_suffix_case = ends_with 
let check_suffix_case_then_chop = ends_with_then_chop

let check_any_suffix_case s suffixes = 
  List.exists (fun x -> check_suffix_case s x) suffixes

let check_any_suffix_case_then_chop s suffixes = 
  let rec aux suffixes = 
    match suffixes with 
    | [] -> None 
    | x::xs -> 
      let id = ends_with_index s x in 
      if id >= 0 then Some (String.sub s 0 id)
      else aux xs in 
  aux suffixes    



(**  In OCaml 4.02.3, {!String.escaped} is locale senstive, 
     this version try to make it not locale senstive, this bug is fixed
     in the compiler trunk     
*)
let escaped s =
  let rec needs_escape i =
    if i >= String.length s then false else
      match String.unsafe_get s i with
      | '"' | '\\' | '\n' | '\t' | '\r' | '\b' -> true
      | ' ' .. '~' -> needs_escape (i+1)
      | _ -> true
  in
  if needs_escape 0 then
    Bytes.unsafe_to_string (Ext_bytes.escaped (Bytes.unsafe_of_string s))
  else
    s

(* it is unsafe to expose such API as unsafe since 
   user can provide bad input range 

*)
let rec unsafe_for_all_range s ~start ~finish p =     
  start > finish ||
  p (String.unsafe_get s start) && 
  unsafe_for_all_range s ~start:(start + 1) ~finish p

let for_all_from s start  p = 
  let len = String.length s in 
  if start < 0  then invalid_arg "Ext_string.for_all_from"
  else unsafe_for_all_range s ~start ~finish:(len - 1) p 


let for_all s (p : char -> bool)  =   
  unsafe_for_all_range s ~start:0  ~finish:(String.length s - 1) p 

let is_empty s = String.length s = 0


let repeat n s  =
  let len = String.length s in
  let res = Bytes.create(n * len) in
  for i = 0 to pred n do
    String.blit s 0 res (i * len) len
  done;
  Bytes.to_string res

let equal (x : string) y  = x = y



let unsafe_is_sub ~sub i s j ~len =
  let rec check k =
    if k = len
    then true
    else 
      String.unsafe_get sub (i+k) = 
      String.unsafe_get s (j+k) && check (k+1)
  in
  j+len <= String.length s && check 0


exception Local_exit 
let find ?(start=0) ~sub s =
  let n = String.length sub in
  let s_len = String.length s in 
  let i = ref start in  
  try
    while !i + n <= s_len do
      if unsafe_is_sub ~sub 0 s !i ~len:n then
        raise_notrace Local_exit;
      incr i
    done;
    -1
  with Local_exit ->
    !i

let contain_substring s sub = 
  find s ~sub >= 0 

(** TODO: optimize 
    avoid nonterminating when string is empty 
*)
let non_overlap_count ~sub s = 
  let sub_len = String.length sub in 
  let rec aux  acc off = 
    let i = find ~start:off ~sub s  in 
    if i < 0 then acc 
    else aux (acc + 1) (i + sub_len) in
  if String.length sub = 0 then invalid_arg "Ext_string.non_overlap_count"
  else aux 0 0  


let rfind ~sub s =
  let n = String.length sub in
  let i = ref (String.length s - n) in
  let module M = struct exception Exit end in 
  try
    while !i >= 0 do
      if unsafe_is_sub ~sub 0 s !i ~len:n then 
        raise_notrace Local_exit;
      decr i
    done;
    -1
  with Local_exit ->
    !i

let tail_from s x = 
  let len = String.length s  in 
  if  x > len then invalid_arg ("Ext_string.tail_from " ^s ^ " : "^ string_of_int x )
  else String.sub s x (len - x)

let equal (x : string) y  = x = y

let rec rindex_rec s i c =
  if i < 0 then i else
  if String.unsafe_get s i = c then i else rindex_rec s (i - 1) c;;

let rec rindex_rec_opt s i c =
  if i < 0 then None else
  if String.unsafe_get s i = c then Some i else rindex_rec_opt s (i - 1) c;;

let rindex_neg s c = 
  rindex_rec s (String.length s - 1) c;;

let rindex_opt s c = 
  rindex_rec_opt s (String.length s - 1) c;;

let is_valid_module_file (s : string) = 
  let len = String.length s in 
  len > 0 &&
  match String.unsafe_get s 0 with 
  | 'A' .. 'Z'
  | 'a' .. 'z' -> 
    unsafe_for_all_range s ~start:1 ~finish:(len - 1)
      (fun x -> 
         match x with 
         | 'A'..'Z' | 'a'..'z' | '0'..'9' | '_' | '\'' -> true
         | _ -> false )
  | _ -> false 




type check_result = 
  | Good 
  | Invalid_module_name 
  | Suffix_mismatch
  (** 
     TODO: move to another module 
     Make {!Ext_filename} not stateful
  *)
let is_valid_source_name name : check_result =
  match check_any_suffix_case_then_chop name [
      ".ml"; 
      ".re";
      ".mli"; 
      ".rei"
    ] with 
  | None -> Suffix_mismatch
  | Some x -> 
    if is_valid_module_file  x then
      Good
    else Invalid_module_name  

(** TODO: can be improved to return a positive integer instead *)
let rec unsafe_no_char x ch i  last_idx = 
  i > last_idx  || 
  (String.unsafe_get x i <> ch && unsafe_no_char x ch (i + 1)  last_idx)

let rec unsafe_no_char_idx x ch i last_idx = 
  if i > last_idx  then -1 
  else 
  if String.unsafe_get x i <> ch then 
    unsafe_no_char_idx x ch (i + 1)  last_idx
  else i

let no_char x ch i len  : bool =
  let str_len = String.length x in 
  if i < 0 || i >= str_len || len >= str_len then invalid_arg "Ext_string.no_char"   
  else unsafe_no_char x ch i len 


let no_slash x = 
  unsafe_no_char x '/' 0 (String.length x - 1)

let no_slash_idx x = 
  unsafe_no_char_idx x '/' 0 (String.length x - 1)

let replace_slash_backward (x : string ) = 
  let len = String.length x in 
  if unsafe_no_char x '/' 0  (len - 1) then x 
  else 
    String.map (function 
        | '/' -> '\\'
        | x -> x ) x 

let replace_backward_slash (x : string)=
  let len = String.length x in
  if unsafe_no_char x '\\' 0  (len -1) then x 
  else  
    String.map (function 
        |'\\'-> '/'
        | x -> x) x

let empty = ""

    
external compare : string -> string -> int = "caml_string_length_based_compare" "noalloc";;

let single_space = " "
let single_colon = ":"

let concat_array sep (s : string array) =   
  let s_len = Array.length s in 
  match s_len with 
  | 0 -> empty 
  | 1 -> Array.unsafe_get s 0
  | _ ->     
    let sep_len = String.length sep in 
    let len = ref 0 in 
    for i = 0 to  s_len - 1 do 
      len := !len + String.length (Array.unsafe_get s i)
    done;
    let target = 
      Bytes.create 
        (!len + (s_len - 1) * sep_len ) in    
    let hd = (Array.unsafe_get s 0) in     
    let hd_len = String.length hd in 
    String.unsafe_blit hd  0  target 0 hd_len;   
    let current_offset = ref hd_len in     
    for i = 1 to s_len - 1 do 
      String.unsafe_blit sep 0 target  !current_offset sep_len;
      let cur = Array.unsafe_get s i in 
      let cur_len = String.length cur in     
      let new_off_set = (!current_offset + sep_len ) in
      String.unsafe_blit cur 0 target new_off_set cur_len; 
      current_offset := 
        new_off_set + cur_len ; 
    done;
    Bytes.unsafe_to_string target   

let concat3 a b c = 
  let a_len = String.length a in 
  let b_len = String.length b in 
  let c_len = String.length c in 
  let len = a_len + b_len + c_len in 
  let target = Bytes.create len in 
  String.unsafe_blit a 0 target 0 a_len ; 
  String.unsafe_blit b 0 target a_len b_len;
  String.unsafe_blit c 0 target (a_len + b_len) c_len;
  Bytes.unsafe_to_string target

let concat4 a b c d =
  let a_len = String.length a in 
  let b_len = String.length b in 
  let c_len = String.length c in 
  let d_len = String.length d in 
  let len = a_len + b_len + c_len + d_len in 

  let target = Bytes.create len in 
  String.unsafe_blit a 0 target 0 a_len ; 
  String.unsafe_blit b 0 target a_len b_len;
  String.unsafe_blit c 0 target (a_len + b_len) c_len;
  String.unsafe_blit d 0 target (a_len + b_len + c_len) d_len;
  Bytes.unsafe_to_string target


let concat5 a b c d e =
  let a_len = String.length a in 
  let b_len = String.length b in 
  let c_len = String.length c in 
  let d_len = String.length d in 
  let e_len = String.length e in 
  let len = a_len + b_len + c_len + d_len + e_len in 

  let target = Bytes.create len in 
  String.unsafe_blit a 0 target 0 a_len ; 
  String.unsafe_blit b 0 target a_len b_len;
  String.unsafe_blit c 0 target (a_len + b_len) c_len;
  String.unsafe_blit d 0 target (a_len + b_len + c_len) d_len;
  String.unsafe_blit e 0 target (a_len + b_len + c_len + d_len) e_len;
  Bytes.unsafe_to_string target



let inter2 a b = 
  concat3 a single_space b 


let inter3 a b c = 
  concat5 a  single_space  b  single_space  c 





let inter4 a b c d =
  concat_array single_space [| a; b ; c; d|]


let parent_dir_lit = ".."    
let current_dir_lit = "."


(* reference {!Bytes.unppercase} *)
let capitalize_ascii (s : string) : string = 
  if String.length s = 0 then s 
  else 
    begin
      let c = String.unsafe_get s 0 in 
      if (c >= 'a' && c <= 'z')
      || (c >= '\224' && c <= '\246')
      || (c >= '\248' && c <= '\254') then 
        let uc = Char.unsafe_chr (Char.code c - 32) in 
        let bytes = Bytes.of_string s in
        Bytes.unsafe_set bytes 0 uc;
        Bytes.unsafe_to_string bytes 
      else s 
    end

let uncapitalize_ascii =

    String.uncapitalize
      





let lowercase_ascii (s : string) = 
    Bytes.unsafe_to_string 
      (Bytes.map Ext_char.lowercase_ascii (Bytes.unsafe_of_string s))





end
module Ext_list : sig 
#1 "ext_list.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val map : 'a list -> ('a -> 'b) ->  'b list 

val mapi :
  'a list -> 
  (int -> 'a -> 'b) -> 
  'b list 
  
val map_snd : ('a * 'b) list -> ('b -> 'c) -> ('a * 'c) list 

(** [map_last f xs ]
    will pass [true] to [f] for the last element, 
    [false] otherwise. 
    For empty list, it returns empty
*)
val map_last : 
    'a list -> 
    (bool -> 'a -> 'b) -> 'b list

(** [last l]
    return the last element
    raise if the list is empty
*)
val last : 'a list -> 'a

val append : 
  'a list -> 
  'a list -> 
  'a list 

val append_one :  
  'a list -> 
  'a -> 
  'a list

val map_append :  
  'b list -> 
  'a list -> 
  ('b -> 'a) -> 
  'a list

val fold_right : 
  'a list -> 'b -> 
  ('a -> 'b -> 'b) -> 'b

val fold_right2 : 
  'a list -> 
  'b list -> 
  'c -> 
  ('a -> 'b -> 'c -> 'c) ->  'c

val map2 : 
  'a list ->
  'b list ->
  ('a -> 'b -> 'c) ->
  'c list

val fold_left_with_offset : 
  'a list -> 
  'acc -> 
  int -> 
  ('a -> 'acc ->  int ->  'acc) ->   
  'acc 


(** @unused *)
val filter_map : 
  'a list -> 
  ('a -> 'b option) -> 
  'b list  

(** [exclude p l] is the opposite of [filter p l] *)
val exclude : 
  'a list -> 
  ('a -> bool) -> 
  'a list 

(** [excludes p l]
    return a tuple [excluded,newl]
    where [exluded] is true indicates that at least one  
    element is removed,[newl] is the new list where all [p x] for [x] is false

*)
val exclude_with_val : 
  'a list -> 
  ('a -> bool) -> 
  bool * 'a list 


val same_length : 'a list -> 'b list -> bool

val init : int -> (int -> 'a) -> 'a list

(** [split_at n l]
    will split [l] into two lists [a,b], [a] will be of length [n], 
    otherwise, it will raise
*)
val split_at : 
  'a list -> 
  int -> 
  'a list * 'a list


(** [split_at_last l]
    It is equivalent to [split_at (List.length l - 1) l ]
*)
val split_at_last : 'a list -> 'a list * 'a

val filter_mapi : 
  'a list -> 
  ('a -> int ->  'b option) -> 
  'b list

val filter_map2 : 
  'a list -> 
  'b list -> 
  ('a -> 'b -> 'c option) -> 
  'c list


val length_compare : 'a list -> int -> [`Gt | `Eq | `Lt ]

val length_ge : 'a list -> int -> bool

(**

   {[length xs = length ys + n ]}
   input n should be positive 
   TODO: input checking
*)

val length_larger_than_n : 
  'a list -> 
  'a list -> 
   int -> 
   bool


(**
   [rev_map_append f l1 l2]
   [map f l1] and reverse it to append [l2]
   This weird semantics is due to it is the most efficient operation
   we can do
*)
val rev_map_append : 
  'a list -> 
  'b list -> 
  ('a -> 'b) -> 
  'b list


val flat_map : 
  'a list -> 
  ('a -> 'b list) -> 
  'b list

val flat_map_append : 
  'a list -> 
  'b list  ->
  ('a -> 'b list) -> 
  'b list


(**
    [stable_group eq lst]
    Example:
    Input:
   {[
     stable_group (=) [1;2;3;4;3]
   ]}
    Output:
   {[
     [[1];[2];[4];[3;3]]
   ]}
    TODO: this is O(n^2) behavior 
    which could be improved later
*)
val stable_group : 
  'a list -> 
  ('a -> 'a -> bool) -> 
  'a list list 

(** [drop n list]
    raise when [n] is negative
    raise when list's length is less than [n]
*)
val drop : 
  'a list -> 
  int -> 
  'a list 

(** [find_first_not p lst ]
    if all elements in [lst] pass, return [None] 
    otherwise return the first element [e] as [Some e] which
    fails the predicate
*)
val find_first_not : 
  'a list -> 
  ('a -> bool) -> 
  'a option 

(** [find_opt f l] returns [None] if all return [None],  
    otherwise returns the first one. 
*)

val find_opt : 
  'a list -> 
  ('a -> 'b option) -> 
  'b option 


val rev_iter : 
  'a list -> 
  ('a -> unit) -> 
  unit 

val iter:   
   'a list ->  
   ('a -> unit) -> 
   unit
   
val for_all:  
    'a list -> 
    ('a -> bool) -> 
    bool
val for_all_snd:    
    ('a * 'b) list -> 
    ('b -> bool) -> 
    bool

(** [for_all2_no_exn p xs ys]
    return [true] if all satisfied,
    [false] otherwise or length not equal
*)
val for_all2_no_exn : 
  'a list -> 
  'b list -> 
  ('a -> 'b -> bool) -> 
  bool



(** [f] is applied follow the list order *)
val split_map : 
  'a list -> 
  ('a -> 'b * 'c) -> 
  'b list * 'c list       

(** [fn] is applied from left to right *)
val reduce_from_left : 
  'a list -> 
  ('a -> 'a -> 'a) ->
  'a

val sort_via_array :
  'a list -> 
  ('a -> 'a -> int) -> 
  'a list  




(** [assoc_by_string default key lst]
    if  [key] is found in the list  return that val,
    other unbox the [default], 
    otherwise [assert false ]
*)
val assoc_by_string : 
  (string * 'a) list -> 
  string -> 
  'a  option ->   
  'a  

val assoc_by_int : 
  (int * 'a) list -> 
  int -> 
  'a  option ->   
  'a   


val nth_opt : 'a list -> int -> 'a option  

val iter_snd : ('a * 'b) list -> ('b -> unit) -> unit 

val iter_fst : ('a * 'b) list -> ('a -> unit) -> unit 

val exists : 'a list -> ('a -> bool) -> bool 
val exists_snd : ('a * 'b) list -> ('b -> bool) -> bool

val concat_append:
    'a list list -> 
    'a list -> 
    'a list

val fold_left2:
    'a list -> 
    'b list -> 
    'c -> 
    ('a -> 'b -> 'c -> 'c)
    -> 'c 

val fold_left:    
    'a list -> 
    'b -> 
    ('a -> 'b -> 'b) -> 
    'b

val singleton_exn:     
    'a list -> 'a
end = struct
#1 "ext_list.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)




let rec map l f =
  match l with
  | [] ->
    []
  | [x1] ->
    let y1 = f x1 in
    [y1]
  | [x1; x2] ->
    let y1 = f x1 in
    let y2 = f x2 in
    [y1; y2]
  | [x1; x2; x3] ->
    let y1 = f x1 in
    let y2 = f x2 in
    let y3 = f x3 in
    [y1; y2; y3]
  | [x1; x2; x3; x4] ->
    let y1 = f x1 in
    let y2 = f x2 in
    let y3 = f x3 in
    let y4 = f x4 in
    [y1; y2; y3; y4]
  | x1::x2::x3::x4::x5::tail ->
    let y1 = f x1 in
    let y2 = f x2 in
    let y3 = f x3 in
    let y4 = f x4 in
    let y5 = f x5 in
    y1::y2::y3::y4::y5::(map tail f)


let rec map_snd l f =
  match l with
  | [] ->
    []
  | [ v1,x1 ] ->
    let y1 = f x1 in
    [v1,y1]
  | [v1, x1; v2, x2] ->
    let y1 = f x1 in
    let y2 = f x2 in
    [v1, y1; v2, y2]
  | [ v1, x1; v2, x2; v3, x3] ->
    let y1 = f x1 in
    let y2 = f x2 in
    let y3 = f x3 in
    [v1, y1; v2, y2; v3, y3]
  | [ v1, x1; v2, x2; v3, x3; v4, x4] ->
    let y1 = f x1 in
    let y2 = f x2 in
    let y3 = f x3 in
    let y4 = f x4 in
    [v1, y1; v2, y2; v3, y3; v4, y4]
  | (v1, x1) ::(v2, x2) :: (v3, x3)::(v4, x4) :: (v5, x5) ::tail ->
    let y1 = f x1 in
    let y2 = f x2 in
    let y3 = f x3 in
    let y4 = f x4 in
    let y5 = f x5 in
    (v1, y1)::(v2, y2) :: (v3, y3) :: (v4, y4) :: (v5, y5) :: (map_snd tail f)


let rec map_last l f=
  match l with
  | [] ->
    []
  | [x1] ->
    let y1 = f true x1 in
    [y1]
  | [x1; x2] ->
    let y1 = f false x1 in
    let y2 = f true x2 in
    [y1; y2]
  | [x1; x2; x3] ->
    let y1 = f false x1 in
    let y2 = f false x2 in
    let y3 = f true x3 in
    [y1; y2; y3]
  | [x1; x2; x3; x4] ->
    let y1 = f false x1 in
    let y2 = f false x2 in
    let y3 = f false x3 in
    let y4 = f true x4 in
    [y1; y2; y3; y4]
  | x1::x2::x3::x4::tail ->
    (* make sure that tail is not empty *)    
    let y1 = f false x1 in
    let y2 = f false x2 in
    let y3 = f false x3 in
    let y4 = f false x4 in
    y1::y2::y3::y4::(map_last tail f)

let rec mapi_aux lst i f = 
  match lst with
    [] -> []
  | a::l -> 
    let r = f i a in r :: mapi_aux l (i + 1) f 

let mapi lst f = mapi_aux lst 0 f

let rec last xs =
  match xs with 
  | [x] -> x 
  | _ :: tl -> last tl 
  | [] -> invalid_arg "Ext_list.last"    



let rec append_aux l1 l2 = 
  match l1 with
  | [] -> l2
  | [a0] -> a0::l2
  | [a0;a1] -> a0::a1::l2
  | [a0;a1;a2] -> a0::a1::a2::l2
  | [a0;a1;a2;a3] -> a0::a1::a2::a3::l2
  | [a0;a1;a2;a3;a4] -> a0::a1::a2::a3::a4::l2
  | a0::a1::a2::a3::a4::rest -> a0::a1::a2::a3::a4::append_aux rest l2

let append l1 l2 =   
  match l2 with 
  | [] -> l1 
  | _ -> append_aux l1 l2  

let append_one l1 x = append_aux l1 [x]  

let rec map_append l1 l2 f =   
  match l1 with
  | [] -> l2
  | [a0] -> f a0::l2
  | [a0;a1] -> 
    let b0 = f a0 in 
    let b1 = f a1 in 
    b0::b1::l2
  | [a0;a1;a2] -> 
    let b0 = f a0 in 
    let b1 = f a1 in  
    let b2 = f a2 in 
    b0::b1::b2::l2
  | [a0;a1;a2;a3] -> 
    let b0 = f a0 in 
    let b1 = f a1 in 
    let b2 = f a2 in 
    let b3 = f a3 in 
    b0::b1::b2::b3::l2
  | [a0;a1;a2;a3;a4] -> 
    let b0 = f a0 in 
    let b1 = f a1 in 
    let b2 = f a2 in 
    let b3 = f a3 in 
    let b4 = f a4 in 
    b0::b1::b2::b3::b4::l2

  | a0::a1::a2::a3::a4::rest ->
    let b0 = f a0 in 
    let b1 = f a1 in 
    let b2 = f a2 in 
    let b3 = f a3 in 
    let b4 = f a4 in 
    b0::b1::b2::b3::b4::map_append rest l2 f



let rec fold_right l acc f  = 
  match l with  
  | [] -> acc 
  | [a0] -> f a0 acc 
  | [a0;a1] -> f a0 (f a1 acc)
  | [a0;a1;a2] -> f a0 (f a1 (f a2 acc))
  | [a0;a1;a2;a3] -> f a0 (f a1 (f a2 (f a3 acc))) 
  | [a0;a1;a2;a3;a4] -> 
    f a0 (f a1 (f a2 (f a3 (f a4 acc))))
  | a0::a1::a2::a3::a4::rest -> 
    f a0 (f a1 (f a2 (f a3 (f a4 (fold_right rest acc f )))))  

let rec fold_right2 l r acc f = 
  match l,r  with  
  | [],[] -> acc 
  | [a0],[b0] -> f a0 b0 acc 
  | [a0;a1],[b0;b1] -> f a0 b0 (f a1 b1 acc)
  | [a0;a1;a2],[b0;b1;b2] -> f a0 b0 (f a1 b1 (f a2 b2 acc))
  | [a0;a1;a2;a3],[b0;b1;b2;b3] ->
    f a0 b0 (f a1 b1 (f a2 b2 (f a3 b3 acc))) 
  | [a0;a1;a2;a3;a4], [b0;b1;b2;b3;b4] -> 
    f a0 b0 (f a1 b1 (f a2 b2 (f a3 b3 (f a4 b4 acc))))
  | a0::a1::a2::a3::a4::arest, b0::b1::b2::b3::b4::brest -> 
    f a0 b0 (f a1 b1 (f a2 b2 (f a3 b3 (f a4 b4 (fold_right2 arest brest acc f )))))  
  | _, _ -> invalid_arg "Ext_list.fold_right2"

let rec map2  l r f = 
  match l,r  with  
  | [],[] -> []
  | [a0],[b0] -> [f a0 b0]
  | [a0;a1],[b0;b1] -> 
    let c0 = f a0 b0 in 
    let c1 = f a1 b1 in 
    [c0; c1]
  | [a0;a1;a2],[b0;b1;b2] -> 
    let c0 = f a0 b0 in 
    let c1 = f a1 b1 in 
    let c2 = f a2 b2 in 
    [c0;c1;c2]
  | [a0;a1;a2;a3],[b0;b1;b2;b3] ->
    let c0 = f a0 b0 in 
    let c1 = f a1 b1 in 
    let c2 = f a2 b2 in 
    let c3 = f a3 b3 in 
    [c0;c1;c2;c3]
  | [a0;a1;a2;a3;a4], [b0;b1;b2;b3;b4] -> 
    let c0 = f a0 b0 in 
    let c1 = f a1 b1 in 
    let c2 = f a2 b2 in 
    let c3 = f a3 b3 in 
    let c4 = f a4 b4 in 
    [c0;c1;c2;c3;c4]
  | a0::a1::a2::a3::a4::arest, b0::b1::b2::b3::b4::brest -> 
    let c0 = f a0 b0 in 
    let c1 = f a1 b1 in 
    let c2 = f a2 b2 in 
    let c3 = f a3 b3 in 
    let c4 = f a4 b4 in 
    c0::c1::c2::c3::c4::map2 arest brest f
  | _, _ -> invalid_arg "Ext_list.map2"

let rec fold_left_with_offset l accu i f =
  match l with
  | [] -> accu
  | a::l -> 
    fold_left_with_offset 
    l     
    (f  a accu  i)  
    (i + 1)
    f  


let rec filter_map xs (f: 'a -> 'b option)= 
  match xs with 
  | [] -> []
  | y :: ys -> 
    begin match f y with 
      | None -> filter_map ys f 
      | Some z -> z :: filter_map ys f 
    end

let rec exclude xs p =   
  match xs with 
  | [] ->  []
  | x::xs -> 
    if p x then exclude xs p
    else x:: exclude xs p

let rec exclude_with_val l p =
  match l with 
  | [] ->  false, l
  | a0::xs -> 
    if p a0 then true, exclude xs p
    else 
      match xs with 
      | [] -> false, l 
      | a1::rest -> 
        if p a1 then 
          true, a0:: exclude rest p
        else 
          let st,rest = exclude_with_val rest p in 
          if st then 
            st, a0::a1::rest
          else st, l 



let rec same_length xs ys = 
  match xs, ys with 
  | [], [] -> true
  | _::xs, _::ys -> same_length xs ys 
  | _, _ -> false 


let init n f = 
  match n with 
  | 0 -> []
  | 1 -> 
    let a0 = f 0 in  
    [a0]
  | 2 -> 
    let a0 = f 0 in 
    let a1 = f 1 in 
    [a0; a1]
  | 3 -> 
    let a0 = f 0 in 
    let a1 = f 1 in 
    let a2 = f 2 in 
    [a0; a1; a2]
  | 4 -> 
    let a0 = f 0 in 
    let a1 = f 1 in 
    let a2 = f 2 in 
    let a3 = f 3 in 
    [a0; a1; a2; a3]
  | 5 -> 
    let a0 = f 0 in 
    let a1 = f 1 in 
    let a2 = f 2 in 
    let a3 = f 3 in 
    let a4 = f 4 in  
    [a0; a1; a2; a3; a4]
  | _ ->
    Array.to_list (Array.init n f)

let rec small_split_at n acc l = 
  if n <= 0 then List.rev acc , l 
  else 
    match l with 
    | x::xs -> small_split_at (n - 1) (x ::acc) xs 
    | _ -> invalid_arg "Ext_list.split_at"

let split_at l n = 
  small_split_at n [] l 

let rec split_at_last_aux acc x = 
  match x with 
  | [] -> invalid_arg "Ext_list.split_at_last"
  | [ x] -> List.rev acc, x
  | y0::ys -> split_at_last_aux (y0::acc) ys   

let split_at_last (x : 'a list) = 
  match x with 
  | [] -> invalid_arg "Ext_list.split_at_last"
  | [a0] -> 
    [], a0
  | [a0;a1] -> 
    [a0], a1  
  | [a0;a1;a2] -> 
    [a0;a1], a2 
  | [a0;a1;a2;a3] -> 
    [a0;a1;a2], a3 
  | [a0;a1;a2;a3;a4] ->
    [a0;a1;a2;a3], a4 
  | a0::a1::a2::a3::a4::rest  ->  
    let rev, last = split_at_last_aux [] rest
    in 
    a0::a1::a2::a3::a4::  rev , last

(**
   can not do loop unroll due to state combination
*)  
let  filter_mapi xs f  = 
  let rec aux i xs = 
    match xs with 
    | [] -> []
    | y :: ys -> 
      begin match f y i with 
        | None -> aux (i + 1) ys
        | Some z -> z :: aux (i + 1) ys
      end in
  aux 0 xs 

let rec filter_map2  xs ys (f: 'a -> 'b -> 'c option) = 
  match xs,ys with 
  | [],[] -> []
  | u::us, v :: vs -> 
    begin match f u v with 
      | None -> filter_map2 us vs f (* idea: rec f us vs instead? *)
      | Some z -> z :: filter_map2  us vs f
    end
  | _ -> invalid_arg "Ext_list.filter_map2"


let rec rev_map_append l1 l2 f =
  match l1 with
  | [] -> l2
  | a :: l -> rev_map_append l (f a :: l2) f


let rec rev_append l1 l2 =
  match l1 with
    [] -> l2
  | a :: l -> rev_append l   (a :: l2)

(** It is not worth loop unrolling, 
    it is already tail-call, and we need to be careful 
    about evaluation order when unroll
*)
let rec flat_map_aux f acc append lx =
  match lx with
  | [] -> rev_append acc  append
  | a0::rest -> flat_map_aux f (rev_append (f a0)  acc ) append rest 

let flat_map lx f  =
  flat_map_aux f [] [] lx

let flat_map_append lx append f =
  flat_map_aux f [] append lx  


let rec length_compare l n = 
  if n < 0 then `Gt 
  else 
    begin match l with 
      | _ ::xs -> length_compare xs (n - 1)
      | [] ->  
        if n = 0 then `Eq 
        else `Lt 
    end

let rec length_ge l n =   
  if n > 0 then
    match l with 
    | _ :: tl -> length_ge tl (n - 1)
    | [] -> false
  else true
(**

   {[length xs = length ys + n ]}
*)
let rec length_larger_than_n xs ys n =
  match xs, ys with 
  | _, [] -> length_compare xs n = `Eq   
  | _::xs, _::ys -> 
    length_larger_than_n xs ys n
  | [], _ -> false 




let rec group (eq : 'a -> 'a -> bool) lst =
  match lst with 
  | [] -> []
  | x::xs -> 
    aux eq x (group eq xs )

and aux eq (x : 'a)  (xss : 'a list list) : 'a list list = 
  match xss with 
  | [] -> [[x]]
  | (y0::_ as y)::ys -> (* cannot be empty *) 
    if eq x y0 then
      (x::y) :: ys 
    else
      y :: aux eq x ys                                 
  | _ :: _ -> assert false    

let stable_group lst eq =  group eq lst |> List.rev  

let rec drop h n = 
  if n < 0 then invalid_arg "Ext_list.drop"
  else
  if n = 0 then h 
  else 
    match h with 
    | [] ->
      invalid_arg "Ext_list.drop"
    | _ :: tl ->   
      drop tl (n - 1)

let rec find_first_not  xs p = 
  match xs with 
  | [] -> None
  | a::l -> 
    if p a 
    then find_first_not l p 
    else Some a 


let rec rev_iter l f = 
  match l with
  | [] -> ()    
  | [x1] ->
    f x1 
  | [x1; x2] ->
    f x2 ; f x1 
  | [x1; x2; x3] ->
    f x3 ; f x2 ; f x1 
  | [x1; x2; x3; x4] ->
    f x4; f x3; f x2; f x1 
  | x1::x2::x3::x4::x5::tail ->
    rev_iter tail f;
    f x5; f x4 ; f x3; f x2 ; f x1

let rec iter l f = 
  match l with
  | [] -> ()    
  | [x1] ->
    f x1 
  | [x1; x2] ->
    f x1 ; f x2
  | [x1; x2; x3] ->
    f x1 ; f x2 ; f x3
  | [x1; x2; x3; x4] ->
    f x1; f x2; f x3; f x4
  | x1::x2::x3::x4::x5::tail ->
    f x1; f x2 ; f x3; f x4 ; f x5;
    iter tail f 


let rec for_all lst p = 
  match lst with 
    [] -> true
  | a::l -> p a && for_all l p

let rec for_all_snd lst p = 
  match lst with 
    [] -> true
  | (_,a)::l -> p a && for_all_snd l p


let rec for_all2_no_exn  l1 l2 p = 
  match (l1, l2) with
  | ([], []) -> true
  | (a1::l1, a2::l2) -> p a1 a2 && for_all2_no_exn l1 l2 p
  | (_, _) -> false


let rec find_opt xs p = 
  match xs with 
  | [] -> None
  | x :: l -> 
    match  p x with 
    | Some _ as v  ->  v
    | None -> find_opt l p



let rec split_map l f = 
  match l with
  | [] ->
    [],[]
  | [x1] ->
    let a0,b0 = f x1 in
    [a0],[b0]
  | [x1; x2] ->
    let a1,b1 = f x1 in
    let a2,b2 = f x2 in
    [a1;a2],[b1;b2]
  | [x1; x2; x3] ->
    let a1,b1 = f x1 in
    let a2,b2 = f x2 in
    let a3,b3 = f x3 in
    [a1;a2;a3], [b1;b2;b3]
  | [x1; x2; x3; x4] ->
    let a1,b1 = f x1 in
    let a2,b2 = f x2 in
    let a3,b3 = f x3 in
    let a4,b4 = f x4 in
    [a1;a2;a3;a4], [b1;b2;b3;b4] 
  | x1::x2::x3::x4::x5::tail ->
    let a1,b1 = f x1 in
    let a2,b2 = f x2 in
    let a3,b3 = f x3 in
    let a4,b4 = f x4 in
    let a5,b5 = f x5 in
    let ass,bss = split_map tail f in 
    a1::a2::a3::a4::a5::ass,
    b1::b2::b3::b4::b5::bss


let reduce_from_left lst fn = 
  match lst with 
  | first :: rest ->  List.fold_left fn first rest 
  | _ -> invalid_arg "Ext_list.reduce_from_left"


let sort_via_array lst cmp =
  let arr = Array.of_list lst  in
  Array.sort cmp arr;
  Array.to_list arr




let rec assoc_by_string lst (k : string) def  = 
  match lst with 
  | [] -> 
    begin match def with 
      | None -> assert false 
      | Some x -> x end
  | (k1,v1)::rest -> 
    if Ext_string.equal k1 k then v1 else 
      assoc_by_string  rest k def 

let rec assoc_by_int lst (k : int) def = 
  match lst with 
  | [] -> 
    begin match def with
      | None -> assert false 
      | Some x -> x end
  | (k1,v1)::rest -> 
    if k1 = k then v1 else 
      assoc_by_int rest k def 


let rec nth_aux l n =
  match l with
  | [] -> None
  | a::l -> if n = 0 then Some a else nth_aux l (n-1)

let nth_opt l n =
  if n < 0 then None 
  else
    nth_aux l n

let rec iter_snd lst f =     
  match lst with
  | [] -> ()
  | (_,x)::xs -> 
    f x ; 
    iter_snd xs f 
    
let rec iter_fst lst f =     
  match lst with
  | [] -> ()
  | (x,_)::xs -> 
    f x ; 
    iter_fst xs f 

let rec exists l p =     
  match l with 
    [] -> false  
  | x :: xs -> p x || exists xs p

let rec exists_snd l p = 
  match l with 
    [] -> false
  | (_, a)::l -> p a || exists_snd l p 

let rec concat_append 
  (xss : 'a list list)  
  (xs : 'a list) : 'a list = 
  match xss with 
  | [] -> xs 
  | l::r -> append l (concat_append r xs)

let rec fold_left l accu f =
  match l with
    [] -> accu
  | a::l -> fold_left l (f a accu) f 

let rec fold_left2 l1 l2 accu f =
  match (l1, l2) with
    ([], []) -> accu
  | (a1::l1, a2::l2) -> fold_left2  l1 l2 (f a1 a2 accu) f 
  | (_, _) -> invalid_arg "List.fold_left2"

let singleton_exn xs = match xs with [x] -> x | _ -> assert false
end
module Ext_pervasives : sig 
#1 "ext_pervasives.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)








(** Extension to standard library [Pervavives] module, safe to open 
  *)

external reraise: exn -> 'a = "%reraise"

val finally : 'a -> ('a -> 'c) -> ('a -> 'b) -> 'b

val try_it : (unit -> 'a) ->  unit 

val with_file_as_chan : string -> (out_channel -> 'a) -> 'a

val with_file_as_pp : string -> (Format.formatter -> 'a) -> 'a

val is_pos_pow : Int32.t -> int

val failwithf : loc:string -> ('a, unit, string, 'b) format4 -> 'a

val invalid_argf : ('a, unit, string, 'b) format4 -> 'a

val bad_argf : ('a, unit, string, 'b) format4 -> 'a



val dump : 'a -> string 
val pp_any : Format.formatter -> 'a -> unit 
external id : 'a -> 'a = "%identity"

(** Copied from {!Btype.hash_variant}:
    need sync up and add test case
 *)
val hash_variant : string -> int

val todo : string -> 'a
end = struct
#1 "ext_pervasives.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)






external reraise: exn -> 'a = "%reraise"

let finally v action f   = 
  match f v with
  | exception e -> 
      action v ;
      reraise e 
  | e ->  action v ; e 

let try_it f  =   
  try ignore (f ()) with _ -> ()

let with_file_as_chan filename f = 
  finally (open_out_bin filename) close_out f 

let with_file_as_pp filename f = 
  finally (open_out_bin filename) close_out
    (fun chan -> 
      let fmt = Format.formatter_of_out_channel chan in
      let v = f  fmt in
      Format.pp_print_flush fmt ();
      v
    ) 


let  is_pos_pow n = 
  let module M = struct exception E end in 
  let rec aux c (n : Int32.t) = 
    if n <= 0l then -2 
    else if n = 1l then c 
    else if Int32.logand n 1l =  0l then   
      aux (c + 1) (Int32.shift_right n 1 )
    else raise M.E in 
  try aux 0 n  with M.E -> -1

let failwithf ~loc fmt = Format.ksprintf (fun s -> failwith (loc ^ s))
    fmt
    
let invalid_argf fmt = Format.ksprintf invalid_arg fmt

let bad_argf fmt = Format.ksprintf (fun x -> raise (Arg.Bad x ) ) fmt


let rec dump r =
  if Obj.is_int r then
    string_of_int (Obj.magic r : int)
  else (* Block. *)
    let rec get_fields acc = function
      | 0 -> acc
      | n -> let n = n-1 in get_fields (Obj.field r n :: acc) n
    in
    let rec is_list r =
      if Obj.is_int r then
        r = Obj.repr 0 (* [] *)
      else
        let s = Obj.size r and t = Obj.tag r in
        t = 0 && s = 2 && is_list (Obj.field r 1) (* h :: t *)
    in
    let rec get_list r =
      if Obj.is_int r then
        []
      else
        let h = Obj.field r 0 and t = get_list (Obj.field r 1) in
        h :: t
    in
    let opaque name =
      (* XXX In future, print the address of value 'r'.  Not possible
       * in pure OCaml at the moment.  *)
      "<" ^ name ^ ">"
    in
    let s = Obj.size r and t = Obj.tag r in
    (* From the tag, determine the type of block. *)
    match t with
    | _ when is_list r ->
      let fields = get_list r in
      "[" ^ String.concat "; " (Ext_list.map fields dump) ^ "]"
    | 0 ->
      let fields = get_fields [] s in
      "(" ^ String.concat ", " (Ext_list.map fields dump) ^ ")"
    | x when x = Obj.lazy_tag ->
      (* Note that [lazy_tag .. forward_tag] are < no_scan_tag.  Not
         * clear if very large constructed values could have the same
         * tag. XXX *)
      opaque "lazy"
    | x when x = Obj.closure_tag ->
      opaque "closure"
    | x when x = Obj.object_tag ->
      let fields = get_fields [] s in
      let _clasz, id, slots =
        match fields with
        | h::h'::t -> h, h', t
        | _ -> assert false
      in
      (* No information on decoding the class (first field).  So just print
         * out the ID and the slots. *)
      "Object #" ^ dump id ^ " (" ^ String.concat ", " (Ext_list.map slots dump) ^ ")"
    | x when x = Obj.infix_tag ->
      opaque "infix"
    | x when x = Obj.forward_tag ->
      opaque "forward"
    | x when x < Obj.no_scan_tag ->
      let fields = get_fields [] s in
      "Tag" ^ string_of_int t ^
      " (" ^ String.concat ", " (Ext_list.map fields dump) ^ ")"
    | x when x = Obj.string_tag ->
      "\"" ^ String.escaped (Obj.magic r : string) ^ "\""
    | x when x = Obj.double_tag ->
      string_of_float (Obj.magic r : float)
    | x when x = Obj.abstract_tag ->
      opaque "abstract"
    | x when x = Obj.custom_tag ->
      opaque "custom"
    | x when x = Obj.custom_tag ->
      opaque "final"
    | x when x = Obj.double_array_tag ->
      "[|"^
      String.concat ";"
        (Array.to_list (Array.map string_of_float (Obj.magic r : float array))) ^
      "|]"
    | _ ->
      opaque (Printf.sprintf "unknown: tag %d size %d" t s)

let dump v = dump (Obj.repr v)

let pp_any fmt v = 
  Format.fprintf fmt "@[%s@]"
  (dump v )
external id : 'a -> 'a = "%identity"


let hash_variant s =
  let accu = ref 0 in
  for i = 0 to String.length s - 1 do
    accu := 223 * !accu + Char.code s.[i]
  done;
  (* reduce to 31 bits *)
  accu := !accu land (1 lsl 31 - 1);
  (* make it signed for 64 bits architectures *)
  if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu

let todo loc = 
  failwith (loc ^ " Not supported yet")
end
module Ast_compatible : sig 
#1 "ast_compatible.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type poly_var_label = string 
type arg_label = string 
type label = 
  | Nolabel
  | Labelled of string
  | Optional of string
val convert: arg_label -> label




val no_label: arg_label

type loc = Location.t 
type attrs = Parsetree.attribute list 
open Parsetree


val const_exp_string:
  ?loc:Location.t -> 
  ?attrs:attrs ->    
  ?delimiter:string -> 
  string -> 
  expression

val const_exp_int:
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  int -> 
  expression 

val const_exp_int_list_as_array:  
  int list -> 
  expression 

val const_exp_string_list_as_array:  
  string list -> 
  expression 

  
val apply_simple:
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  expression ->   
  expression list -> 
  expression 

val app1:
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  expression ->   
  expression -> 
  expression 

val app2:
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  expression ->   
  expression -> 
  expression -> 
  expression 

val app3:
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  expression ->   
  expression -> 
  expression -> 
  expression ->   
  expression 

(** Note this function would slightly 
  change its semantics depending on compiler versions
  for newer version: it means always label
  for older version: it could be optional (which we should avoid)
*)  
val apply_labels:  
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  expression ->   
  (string * expression) list -> 
  (* [(label,e)] [label] is strictly interpreted as label *)
  expression 

val fun_ :  
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  pattern -> 
  expression -> 
  expression

val is_arg_label_simple : 
  arg_label -> bool   

val arrow :
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  core_type -> 
  core_type ->
  core_type

val label_arrow :
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  string -> 
  core_type -> 
  core_type ->
  core_type

val opt_arrow:
  ?loc:Location.t -> 
  ?attrs:attrs -> 
  string -> 
  core_type -> 
  core_type ->
  core_type

val object_: 
  ?loc:loc -> 
  ?attrs:attrs ->
  (string * attributes * core_type) list -> 
  (*FIXME shall we use [string loc] instead?*)
  Asttypes.closed_flag ->
  core_type  

val rec_type_str:  
  ?loc:loc -> 
  type_declaration list -> 
  structure_item

val nonrec_type_str:  
  ?loc:loc -> 
  type_declaration list -> 
  structure_item

val rec_type_str:  
  ?loc:loc -> 
  type_declaration list -> 
  structure_item

val nonrec_type_sig:  
  ?loc:loc -> 
  type_declaration list -> 
  signature_item 

val rec_type_sig:  
  ?loc:loc -> 
  type_declaration list -> 
  signature_item

val mk_fn_type:  
  (arg_label * core_type * attributes * loc) list -> 
  core_type -> 
  core_type

type object_field = 
   
  string * attributes * core_type
val object_field : string ->  attributes -> core_type -> object_field  
  

val hash_label : poly_var_label -> int 
val label_of_name : poly_var_label -> string 
end = struct
#1 "ast_compatible.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type loc = Location.t 
type attrs = Parsetree.attribute list 
open Parsetree
let default_loc = Location.none

 
type poly_var_label = string 
type arg_label = string
type label = 
  | Nolabel
  | Labelled of string
  | Optional of string
let no_label : arg_label = ""
let is_arg_label_simple s = (s : arg_label) = no_label  

let is_optional_label l =
  String.length l > 0 && l.[0] = '?'

(** for
       [x:t] -> "x"
       [?x:t] -> "?x"
*)  
let convert l : label =
  if l = "" then Nolabel else
  if is_optional_label l
  then Optional (String.sub l 1 (String.length l - 1))
  else Labelled l  


let arrow ?(loc=default_loc) ?(attrs = []) a b  =
  Ast_helper.Typ.arrow ~loc ~attrs no_label a b  

let apply_simple
 ?(loc = default_loc) 
 ?(attrs = [])
  fn args : expression = 
  { pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = 
      Pexp_apply(
        fn, 
        (Ext_list.map args (fun x -> no_label, x) ) ) }

let app1        
  ?(loc = default_loc)
  ?(attrs = [])
  fn arg1 : expression = 
  { pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = 
      Pexp_apply(
        fn, 
        [no_label, arg1]
        ) }

let app2
  ?(loc = default_loc)
  ?(attrs = [])
  fn arg1 arg2 : expression = 
  { pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = 
      Pexp_apply(
        fn, 
        [
          no_label, arg1;
          no_label, arg2 ]
        ) }

let app3
  ?(loc = default_loc)
  ?(attrs = [])
  fn arg1 arg2 arg3 : expression = 
  { pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = 
      Pexp_apply(
        fn, 
        [
          no_label, arg1;
          no_label, arg2;
          no_label, arg3
        ]
        ) }

let fun_         
  ?(loc = default_loc) 
  ?(attrs = [])
  pat
  exp = 
  {
    pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = Pexp_fun(no_label,None, pat, exp)
  }


 

let const_exp_string 
  ?(loc = default_loc)
  ?(attrs = [])
  ?delimiter
  (s : string) : expression = 
  {
    pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = Pexp_constant(Const_string(s,delimiter))
  }


let const_exp_int 
  ?(loc = default_loc)
  ?(attrs = [])
  (s : int) : expression = 
  {
    pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = Pexp_constant(Const_int s)
  }




let apply_labels
 ?(loc = default_loc) 
 ?(attrs = [])
  fn args : expression = 
  { pexp_loc = loc; 
    pexp_attributes = attrs;
    pexp_desc = 
      Pexp_apply(
        fn, 
        args ) }

let object_ = Ast_helper.Typ.object_


 

let label_arrow ?(loc=default_loc) ?(attrs=[]) s a b : core_type = 
  {
      ptyp_desc = Ptyp_arrow(

      s
      
      ,
      a,
      b);
      ptyp_loc = loc;
      ptyp_attributes = attrs
  }

let opt_arrow ?(loc=default_loc) ?(attrs=[]) s a b : core_type = 
  {
      ptyp_desc = Ptyp_arrow( 

        "?" ^ s
        
        ,
        a,
        b);
      ptyp_loc = loc;
      ptyp_attributes = attrs
  }    

let rec_type_str ?(loc=default_loc)  tds : structure_item = 
  {
    pstr_loc = loc;
    pstr_desc = Pstr_type ( 
      
      tds)
  }

let nonrec_type_str ?(loc=default_loc)  tds : structure_item = 
  {
    pstr_loc = loc;
    pstr_desc = Pstr_type ( 
      
      tds)
  }  

let rec_type_sig ?(loc=default_loc)  tds : signature_item = 
  {
    psig_loc = loc;
    psig_desc = Psig_type ( 
      
      tds)
  }

(* FIXME: need address migration of `[@nonrec]` attributes in older ocaml *)  
let nonrec_type_sig ?(loc=default_loc)  tds : signature_item = 
  {
    psig_loc = loc;
    psig_desc = Psig_type ( 
      
      tds)
  }  


let const_exp_int_list_as_array xs = 
  Ast_helper.Exp.array 
  (Ext_list.map  xs (fun x -> const_exp_int x ))  

let const_exp_string_list_as_array xs =   
  Ast_helper.Exp.array 
  (Ext_list.map xs (fun x -> const_exp_string x ) )  


 let mk_fn_type 
  (new_arg_types_ty : (arg_label * core_type * attributes * loc) list)
  (result : core_type) : core_type = 
  Ext_list.fold_right new_arg_types_ty result (fun (label, ty, attrs, loc) acc -> 
    {
      ptyp_desc = Ptyp_arrow(label,ty,acc);
      ptyp_loc = loc; 
      ptyp_attributes = attrs
    }
  )

type object_field = 
   
  string * attributes * core_type
  

let object_field   l attrs ty = 
 (l,attrs,ty)  



let hash_label : poly_var_label -> int = Ext_pervasives.hash_variant 
external label_of_name : poly_var_label -> string = "%identity"

end
module Ext_utf8 : sig 
#1 "ext_utf8.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type byte =
  | Single of int
  | Cont of int
  | Leading of int * int
  | Invalid


val classify : char -> byte 

val follow : 
    string -> 
    int -> 
    int -> 
    int ->
    int * int 


(** 
  return [-1] if failed 
*)
val next :  string -> remaining:int -> int -> int 


exception Invalid_utf8 of string 
 
 
val decode_utf8_string : string -> int list
end = struct
#1 "ext_utf8.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type byte =
  | Single of int
  | Cont of int
  | Leading of int * int
  | Invalid

(** [classify chr] returns the {!byte} corresponding to [chr] *)
let classify chr =
  let c = int_of_char chr in
  (* Classify byte according to leftmost 0 bit *)
  if c land 0b1000_0000 = 0 then Single c else
    (* c 0b0____*)
  if c land 0b0100_0000 = 0 then Cont (c land 0b0011_1111) else
    (* c 0b10___*)
  if c land 0b0010_0000 = 0 then Leading (1, c land 0b0001_1111) else
    (* c 0b110__*)
  if c land 0b0001_0000 = 0 then Leading (2, c land 0b0000_1111) else
    (* c 0b1110_ *)
  if c land 0b0000_1000 = 0 then Leading (3, c land 0b0000_0111) else
    (* c 0b1111_0___*)
  if c land 0b0000_0100 = 0 then Leading (4, c land 0b0000_0011) else
    (* c 0b1111_10__*)
  if c land 0b0000_0010 = 0 then Leading (5, c land 0b0000_0001)
  (* c 0b1111_110__ *)
  else Invalid

exception Invalid_utf8 of string 

(* when the first char is [Leading],
  TODO: need more error checking 
  when out of bond
 *)
let rec follow s n (c : int) offset = 
  if n = 0 then (c, offset)
  else 
    begin match classify s.[offset+1] with
      | Cont cc -> follow s (n-1) ((c lsl 6) lor (cc land 0x3f)) (offset+1)
      | _ -> raise (Invalid_utf8 "Continuation byte expected")
    end


let rec next s ~remaining  offset = 
  if remaining = 0 then offset 
  else 
    begin match classify s.[offset+1] with
      | Cont cc -> next s ~remaining:(remaining-1) (offset+1)
      | _ ->  -1 
      | exception _ ->  -1 (* it can happen when out of bound *)
    end




let decode_utf8_string s =
  let lst = ref [] in
  let add elem = lst := elem :: !lst in
  let rec  decode_utf8_cont s i s_len =
    if i = s_len  then ()
    else 
      begin 
        match classify s.[i] with
        | Single c -> 
          add c; decode_utf8_cont s (i+1) s_len
        | Cont _ -> raise (Invalid_utf8 "Unexpected continuation byte")
        | Leading (n, c) ->
          let (c', i') = follow s n c i in add c';
          decode_utf8_cont s (i' + 1) s_len
        | Invalid -> raise (Invalid_utf8 "Invalid byte")
      end
  in decode_utf8_cont s 0 (String.length s); 
  List.rev !lst


(** To decode {j||j} we need verify in the ast so that we have better error 
    location, then we do the decode later
*)  

let verify s loc = 
  assert false
end
module Ext_js_regex : sig 
#1 "ext_js_regex.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(* This is a module that checks if js regex is valid or not *)

val js_regex_checker : string -> bool
end = struct
#1 "ext_js_regex.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


let check_from_end al =
  let rec aux l seen =
    match l with
    | [] -> false
    | (e::r) ->
      if e < 0 || e > 255 then false
      else (let c = Char.chr e in
            if c = '/' then true
            else (if List.exists (fun x -> x = c) seen then false (* flag should not be repeated *)
                  else (if c = 'i' || c = 'g' || c = 'm' || c = 'y' || c ='u' then aux r (c::seen) 
                        else false)))
  in aux al []

let js_regex_checker s =
  match Ext_utf8.decode_utf8_string s with 
  | [] -> false 
  | 47 (* [Char.code '/' = 47 ]*)::tail -> 
    check_from_end (List.rev tail)       
  | _ :: _ -> false 
  | exception Ext_utf8.Invalid_utf8 _ -> false 

end
module Map_gen
= struct
#1 "map_gen.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1996 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the GNU Library General Public License, with    *)
(*  the special exception on linking described in file ../LICENSE.     *)
(*                                                                     *)
(***********************************************************************)
(** adapted from stdlib *)

type ('key,'a) t =
  | Empty
  | Node of ('key,'a) t * 'key * 'a * ('key,'a) t * int

type ('key,'a) enumeration =
  | End
  | More of 'key * 'a * ('key,'a) t * ('key, 'a) enumeration

let rec cardinal_aux acc  = function
  | Empty -> acc 
  | Node (l,_,_,r, _) -> 
    cardinal_aux  (cardinal_aux (acc + 1)  r ) l 

let cardinal s = cardinal_aux 0 s 

let rec bindings_aux accu = function
  | Empty -> accu
  | Node(l, v, d, r, _) -> bindings_aux ((v, d) :: bindings_aux accu r) l

let bindings s =
  bindings_aux [] s

let rec keys_aux accu = function
    Empty -> accu
  | Node(l, v, _, r, _) -> keys_aux (v :: keys_aux accu r) l

let keys s = keys_aux [] s



let rec cons_enum m e =
  match m with
    Empty -> e
  | Node(l, v, d, r, _) -> cons_enum l (More(v, d, r, e))


let height = function
  | Empty -> 0
  | Node(_,_,_,_,h) -> h

let create l x d r =
  let hl = height l and hr = height r in
  Node(l, x, d, r, (if hl >= hr then hl + 1 else hr + 1))

let singleton x d = Node(Empty, x, d, Empty, 1)

let bal l x d r =
  let hl = match l with Empty -> 0 | Node(_,_,_,_,h) -> h in
  let hr = match r with Empty -> 0 | Node(_,_,_,_,h) -> h in
  if hl > hr + 2 then begin
    match l with
      Empty -> invalid_arg "Map.bal"
    | Node(ll, lv, ld, lr, _) ->
      if height ll >= height lr then
        create ll lv ld (create lr x d r)
      else begin
        match lr with
          Empty -> invalid_arg "Map.bal"
        | Node(lrl, lrv, lrd, lrr, _)->
          create (create ll lv ld lrl) lrv lrd (create lrr x d r)
      end
  end else if hr > hl + 2 then begin
    match r with
      Empty -> invalid_arg "Map.bal"
    | Node(rl, rv, rd, rr, _) ->
      if height rr >= height rl then
        create (create l x d rl) rv rd rr
      else begin
        match rl with
          Empty -> invalid_arg "Map.bal"
        | Node(rll, rlv, rld, rlr, _) ->
          create (create l x d rll) rlv rld (create rlr rv rd rr)
      end
  end else
    Node(l, x, d, r, (if hl >= hr then hl + 1 else hr + 1))

let empty = Empty

let is_empty = function Empty -> true | _ -> false

let rec min_binding_exn = function
    Empty -> raise Not_found
  | Node(Empty, x, d, r, _) -> (x, d)
  | Node(l, x, d, r, _) -> min_binding_exn l

let choose = min_binding_exn

let rec max_binding_exn = function
    Empty -> raise Not_found
  | Node(l, x, d, Empty, _) -> (x, d)
  | Node(l, x, d, r, _) -> max_binding_exn r

let rec remove_min_binding = function
    Empty -> invalid_arg "Map.remove_min_elt"
  | Node(Empty, x, d, r, _) -> r
  | Node(l, x, d, r, _) -> bal (remove_min_binding l) x d r

let merge t1 t2 =
  match (t1, t2) with
    (Empty, t) -> t
  | (t, Empty) -> t
  | (_, _) ->
    let (x, d) = min_binding_exn t2 in
    bal t1 x d (remove_min_binding t2)


let rec iter f = function
    Empty -> ()
  | Node(l, v, d, r, _) ->
    iter f l; f v d; iter f r

let rec map f = function
    Empty ->
    Empty
  | Node(l, v, d, r, h) ->
    let l' = map f l in
    let d' = f d in
    let r' = map f r in
    Node(l', v, d', r', h)

let rec mapi f = function
    Empty ->
    Empty
  | Node(l, v, d, r, h) ->
    let l' = mapi f l in
    let d' = f v d in
    let r' = mapi f r in
    Node(l', v, d', r', h)

let rec fold f m accu =
  match m with
    Empty -> accu
  | Node(l, v, d, r, _) ->
    fold f r (f v d (fold f l accu))

let rec for_all p = function
    Empty -> true
  | Node(l, v, d, r, _) -> p v d && for_all p l && for_all p r

let rec exists p = function
    Empty -> false
  | Node(l, v, d, r, _) -> p v d || exists p l || exists p r

(* Beware: those two functions assume that the added k is *strictly*
   smaller (or bigger) than all the present keys in the tree; it
   does not test for equality with the current min (or max) key.

   Indeed, they are only used during the "join" operation which
   respects this precondition.
*)

let rec add_min_binding k v = function
  | Empty -> singleton k v
  | Node (l, x, d, r, h) ->
    bal (add_min_binding k v l) x d r

let rec add_max_binding k v = function
  | Empty -> singleton k v
  | Node (l, x, d, r, h) ->
    bal l x d (add_max_binding k v r)

(* Same as create and bal, but no assumptions are made on the
   relative heights of l and r. *)

let rec join l v d r =
  match (l, r) with
    (Empty, _) -> add_min_binding v d r
  | (_, Empty) -> add_max_binding v d l
  | (Node(ll, lv, ld, lr, lh), Node(rl, rv, rd, rr, rh)) ->
    if lh > rh + 2 then bal ll lv ld (join lr v d r) else
    if rh > lh + 2 then bal (join l v d rl) rv rd rr else
      create l v d r

(* Merge two trees l and r into one.
   All elements of l must precede the elements of r.
   No assumption on the heights of l and r. *)

let concat t1 t2 =
  match (t1, t2) with
    (Empty, t) -> t
  | (t, Empty) -> t
  | (_, _) ->
    let (x, d) = min_binding_exn t2 in
    join t1 x d (remove_min_binding t2)

let concat_or_join t1 v d t2 =
  match d with
  | Some d -> join t1 v d t2
  | None -> concat t1 t2

let rec filter p = function
    Empty -> Empty
  | Node(l, v, d, r, _) ->
    (* call [p] in the expected left-to-right order *)
    let l' = filter p l in
    let pvd = p v d in
    let r' = filter p r in
    if pvd then join l' v d r' else concat l' r'

let rec partition p = function
    Empty -> (Empty, Empty)
  | Node(l, v, d, r, _) ->
    (* call [p] in the expected left-to-right order *)
    let (lt, lf) = partition p l in
    let pvd = p v d in
    let (rt, rf) = partition p r in
    if pvd
    then (join lt v d rt, concat lf rf)
    else (concat lt rt, join lf v d rf)

let compare compare_key cmp_val m1 m2 =
  let rec compare_aux e1  e2 =
    match (e1, e2) with
      (End, End) -> 0
    | (End, _)  -> -1
    | (_, End) -> 1
    | (More(v1, d1, r1, e1), More(v2, d2, r2, e2)) ->
      let c = compare_key v1 v2 in
      if c <> 0 then c else
        let c = cmp_val d1 d2 in
        if c <> 0 then c else
          compare_aux (cons_enum r1 e1) (cons_enum r2 e2)
  in compare_aux (cons_enum m1 End) (cons_enum m2 End)

let equal compare_key cmp m1 m2 =
  let rec equal_aux e1 e2 =
    match (e1, e2) with
      (End, End) -> true
    | (End, _)  -> false
    | (_, End) -> false
    | (More(v1, d1, r1, e1), More(v2, d2, r2, e2)) ->
      compare_key v1 v2 = 0 && cmp d1 d2 &&
      equal_aux (cons_enum r1 e1) (cons_enum r2 e2)
  in equal_aux (cons_enum m1 End) (cons_enum m2 End)



    
module type S =
  sig
    type key
    type +'a t
    val empty: 'a t
    val is_empty: 'a t -> bool
    val mem: key -> 'a t -> bool

    val add: key -> 'a -> 'a t -> 'a t
    (** [add x y m] 
        If [x] was already bound in [m], its previous binding disappears. *)
    val adjust: key -> (unit -> 'a)  -> ('a ->  'a) -> 'a t -> 'a t 
    (** [adjust k v f map] if not exist [add k v], otherwise 
        [add k v (f old)]
    *)
    val singleton: key -> 'a -> 'a t

    val remove: key -> 'a t -> 'a t
    (** [remove x m] returns a map containing the same bindings as
       [m], except for [x] which is unbound in the returned map. *)

    val merge:
         (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
    (** [merge f m1 m2] computes a map whose keys is a subset of keys of [m1]
        and of [m2]. The presence of each such binding, and the corresponding
        value, is determined with the function [f].
        @since 3.12.0
     *)

     val disjoint_merge : 'a t -> 'a t -> 'a t
     (* merge two maps, will raise if they have the same key *)
    val compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int
    (** Total ordering between maps.  The first argument is a total ordering
        used to compare data associated with equal keys in the two maps. *)

    val equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

    val iter: (key -> 'a -> unit) -> 'a t -> unit
    (** [iter f m] applies [f] to all bindings in map [m].
        The bindings are passed to [f] in increasing order. *)

    val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
    (** [fold f m a] computes [(f kN dN ... (f k1 d1 a)...)],
       where [k1 ... kN] are the keys of all bindings in [m]
       (in increasing order) *)

    val for_all: (key -> 'a -> bool) -> 'a t -> bool
    (** [for_all p m] checks if all the bindings of the map.
        order unspecified
     *)

    val exists: (key -> 'a -> bool) -> 'a t -> bool
    (** [exists p m] checks if at least one binding of the map
        satisfy the predicate [p]. 
        order unspecified
     *)

    val filter: (key -> 'a -> bool) -> 'a t -> 'a t
    (** [filter p m] returns the map with all the bindings in [m]
        that satisfy predicate [p].
        order unspecified
     *)

    val partition: (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
    (** [partition p m] returns a pair of maps [(m1, m2)], where
        [m1] contains all the bindings of [s] that satisfy the
        predicate [p], and [m2] is the map with all the bindings of
        [s] that do not satisfy [p].
     *)

    val cardinal: 'a t -> int
    (** Return the number of bindings of a map. *)

    val bindings: 'a t -> (key * 'a) list
    (** Return the list of all bindings of the given map.
       The returned list is sorted in increasing order with respect
       to the ordering *)
    val keys : 'a t -> key list 
    (* Increasing order *)

    val min_binding_exn: 'a t -> (key * 'a)
    (** raise [Not_found] if the map is empty. *)

    val max_binding_exn: 'a t -> (key * 'a)
    (** Same as {!Map.S.min_binding} *)

    val choose: 'a t -> (key * 'a)
    (** Return one binding of the given map, or raise [Not_found] if
       the map is empty. Which binding is chosen is unspecified,
       but equal bindings will be chosen for equal maps.
     *)

    val split: key -> 'a t -> 'a t * 'a option * 'a t
    (** [split x m] returns a triple [(l, data, r)], where
          [l] is the map with all the bindings of [m] whose key
        is strictly less than [x];
          [r] is the map with all the bindings of [m] whose key
        is strictly greater than [x];
          [data] is [None] if [m] contains no binding for [x],
          or [Some v] if [m] binds [v] to [x].
        @since 3.12.0
     *)

    val find_exn: key -> 'a t -> 'a
    (** [find x m] returns the current binding of [x] in [m],
       or raises [Not_found] if no such binding exists. *)
    val find_opt: key -> 'a t -> 'a option
    val find_default: key  -> 'a t -> 'a  -> 'a 
    val map: ('a -> 'b) -> 'a t -> 'b t
    (** [map f m] returns a map with same domain as [m], where the
       associated value [a] of all bindings of [m] has been
       replaced by the result of the application of [f] to [a].
       The bindings are passed to [f] in increasing order
       with respect to the ordering over the type of the keys. *)

    val mapi: (key -> 'a -> 'b) -> 'a t -> 'b t
    (** Same as {!Map.S.map}, but the function receives as arguments both the
       key and the associated value for each binding of the map. *)

    val of_list : (key * 'a) list -> 'a t 
    val of_array : (key * 'a ) array -> 'a t 
    val add_list : (key * 'b) list -> 'b t -> 'b t

  end

end
module String_map : sig 
#1 "string_map.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


include Map_gen.S with type key = string

end = struct
#1 "string_map.ml"

# 2 "ext/map.cppo.ml"
(* we don't create [map_poly], since some operations require raise an exception which carries [key] *)


  
# 10
  type key = string 
  let compare_key = Ext_string.compare

# 22
type 'a t = (key,'a) Map_gen.t
exception Duplicate_key of key 

let empty = Map_gen.empty 
let is_empty = Map_gen.is_empty
let iter = Map_gen.iter
let fold = Map_gen.fold
let for_all = Map_gen.for_all 
let exists = Map_gen.exists 
let singleton = Map_gen.singleton 
let cardinal = Map_gen.cardinal
let bindings = Map_gen.bindings
let keys = Map_gen.keys
let choose = Map_gen.choose 
let partition = Map_gen.partition 
let filter = Map_gen.filter 
let map = Map_gen.map 
let mapi = Map_gen.mapi
let bal = Map_gen.bal 
let height = Map_gen.height 
let max_binding_exn = Map_gen.max_binding_exn
let min_binding_exn = Map_gen.min_binding_exn


let rec add x data (tree : _ Map_gen.t as 'a) : 'a = match tree with 
  | Empty ->
    Node(Empty, x, data, Empty, 1)
  | Node(l, v, d, r, h) ->
    let c = compare_key x v in
    if c = 0 then
      Node(l, x, data, r, h)
    else if c < 0 then
      bal (add x data l) v d r
    else
      bal l v d (add x data r)


let rec adjust x data replace (tree : _ Map_gen.t as 'a) : 'a = 
  match tree with 
  | Empty ->
    Node(Empty, x, data (), Empty, 1)
  | Node(l, v, d, r, h) ->
    let c = compare_key x v in
    if c = 0 then
      Node(l, x, replace  d , r, h)
    else if c < 0 then
      bal (adjust x data replace l) v d r
    else
      bal l v d (adjust x data replace r)


let rec find_exn x (tree : _ Map_gen.t )  = match tree with 
  | Empty ->
    raise Not_found
  | Node(l, v, d, r, _) ->
    let c = compare_key x v in
    if c = 0 then d
    else find_exn x (if c < 0 then l else r)

let rec find_opt x (tree : _ Map_gen.t )  = match tree with 
  | Empty -> None 
  | Node(l, v, d, r, _) ->
    let c = compare_key x v in
    if c = 0 then Some d
    else find_opt x (if c < 0 then l else r)

let rec find_default x (tree : _ Map_gen.t ) default     = match tree with 
  | Empty -> default  
  | Node(l, v, d, r, _) ->
    let c = compare_key x v in
    if c = 0 then  d
    else find_default x   (if c < 0 then l else r) default

let rec mem x (tree : _ Map_gen.t )   = match tree with 
  | Empty ->
    false
  | Node(l, v, d, r, _) ->
    let c = compare_key x v in
    c = 0 || mem x (if c < 0 then l else r)

let rec remove x (tree : _ Map_gen.t as 'a) : 'a = match tree with 
  | Empty ->
    Empty
  | Node(l, v, d, r, h) ->
    let c = compare_key x v in
    if c = 0 then
      Map_gen.merge l r
    else if c < 0 then
      bal (remove x l) v d r
    else
      bal l v d (remove x r)


let rec split x (tree : _ Map_gen.t as 'a) : 'a * _ option * 'a  = match tree with 
  | Empty ->
    (Empty, None, Empty)
  | Node(l, v, d, r, _) ->
    let c = compare_key x v in
    if c = 0 then (l, Some d, r)
    else if c < 0 then
      let (ll, pres, rl) = split x l in (ll, pres, Map_gen.join rl v d r)
    else
      let (lr, pres, rr) = split x r in (Map_gen.join l v d lr, pres, rr)

let rec merge f (s1 : _ Map_gen.t) (s2  : _ Map_gen.t) : _ Map_gen.t =
  match (s1, s2) with
  | (Empty, Empty) -> Empty
  | (Node (l1, v1, d1, r1, h1), _) when h1 >= height s2 ->
    let (l2, d2, r2) = split v1 s2 in
    Map_gen.concat_or_join (merge f l1 l2) v1 (f v1 (Some d1) d2) (merge f r1 r2)
  | (_, Node (l2, v2, d2, r2, h2)) ->
    let (l1, d1, r1) = split v2 s1 in
    Map_gen.concat_or_join (merge f l1 l2) v2 (f v2 d1 (Some d2)) (merge f r1 r2)
  | _ ->
    assert false

let rec disjoint_merge  (s1 : _ Map_gen.t) (s2  : _ Map_gen.t) : _ Map_gen.t =
  match (s1, s2) with
  | (Empty, Empty) -> Empty
  | (Node (l1, v1, d1, r1, h1), _) when h1 >= height s2 ->
    begin match split v1 s2 with 
    | l2, None, r2 -> 
      Map_gen.join (disjoint_merge  l1 l2) v1 d1 (disjoint_merge r1 r2)
    | _, Some _, _ ->
      raise (Duplicate_key  v1)
    end        
  | (_, Node (l2, v2, d2, r2, h2)) ->
    begin match  split v2 s1 with 
    | (l1, None, r1) -> 
      Map_gen.join (disjoint_merge  l1 l2) v2 d2 (disjoint_merge  r1 r2)
    | (_, Some _, _) -> 
      raise (Duplicate_key v2)
    end
  | _ ->
    assert false



let compare cmp m1 m2 = Map_gen.compare compare_key cmp m1 m2

let equal cmp m1 m2 = Map_gen.equal compare_key cmp m1 m2 

let add_list (xs : _ list ) init = 
  List.fold_left (fun acc (k,v) -> add k v acc) init xs 

let of_list xs = add_list xs empty

let of_array xs = 
  Array.fold_left (fun acc (k,v) -> add k v acc) empty xs

end
module Ast_payload : sig 
#1 "ast_payload.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



(** A utility module used when destructuring parsetree attributes, used for 
    compiling FFI attributes and built-in ppx  *)

type t = Parsetree.payload
type lid = string Asttypes.loc
type label_expr = lid  * Parsetree.expression
type action = 
   lid * Parsetree.expression option

val is_single_string : t -> (string * string option) option
val is_single_string_as_ast : 
  t -> 
  Parsetree.expression option 

val is_single_int : t -> int option 

type rtn = Not_String_Lteral | JS_Regex_Check_Failed | Correct of Parsetree.expression
val as_string_exp : check_js_regex: bool -> t -> rtn
val as_core_type : Location.t -> t -> Parsetree.core_type    
(* val as_empty_structure :  t -> bool  *)
val as_ident : t -> Longident.t Asttypes.loc option
val raw_string_payload : Location.t -> string -> t 
val assert_strings :
  Location.t -> t -> string list  

(** if only [abstract] happens  [true]
    if [abstract] does not appear [false]
    if [abstract] happens with other, raise exception
*)  
val isAbstract : action list -> bool   
(** as a record or empty 
    it will accept 

    {[ [@@@bs.config ]]}
    or 
    {[ [@@@bs.config no_export ] ]}
    or 
    {[ [@@@bs.config { property  .. } ]]}    
    Note that we only 
    {[
      { flat_property}
    ]}
    below  is not allowed 
    {[
      {M.flat_property}
    ]}
*)

val ident_or_record_as_config : 
  Location.t ->
  t -> action list 

val assert_bool_lit : Parsetree.expression -> bool

val empty : t 

val table_dispatch : 
  (Parsetree.expression option  -> 'a) String_map.t -> action -> 'a

end = struct
#1 "ast_payload.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Parsetree.payload

let is_single_string (x : t ) = 
  match x with  (** TODO also need detect empty phrase case *)
  | PStr [ {
      pstr_desc =  
        Pstr_eval (
          {pexp_desc = 
             Pexp_constant 

               (Const_string (name,dec))
               
              ;
           _},_);
      _}] -> Some (name,dec)
  | _  -> None

let is_single_string_as_ast (x : t ) 
  : Parsetree.expression option = 
  match x with  (** TODO also need detect empty phrase case *)
  | PStr [ {
      pstr_desc =  
        Pstr_eval (
          {pexp_desc = 
             Pexp_constant 

               (Const_string (name,dec))
               
              ;
           _} as e ,_);
      _}] -> Some e
  | _  -> None

  
(** TODO also need detect empty phrase case *)  

let is_single_int (x : t ) : int option = 
  match x with  
  | PStr [ {
      pstr_desc =  
        Pstr_eval (
          {pexp_desc = 
             Pexp_constant 
               (Const_int name);
           _},_);
      _}] -> Some name
  | _  -> None

type rtn = Not_String_Lteral | JS_Regex_Check_Failed | Correct of Parsetree.expression

let as_string_exp ~check_js_regex (x : t ) = 
  match x with  (** TODO also need detect empty phrase case *)
  | PStr [ {
      pstr_desc =  
        Pstr_eval (
          {pexp_desc = 
             Pexp_constant 

               (Const_string (str,_))
               
               ;
           _} as e ,_);
      _}] -> if check_js_regex then (if Ext_js_regex.js_regex_checker str then Correct e else JS_Regex_Check_Failed) else Correct e
  | _  -> Not_String_Lteral

let as_core_type loc x =
  match  x with
  | Parsetree.PTyp x -> x
  | _ -> Location.raise_errorf ~loc "except a core type"

let as_ident (x : t ) =
  match x with
  | PStr [
      {pstr_desc =
         Pstr_eval (
           {
             pexp_desc =
               Pexp_ident ident 

           } , _)
      }
    ] -> Some ident
  | _ -> None
open Ast_helper

let raw_string_payload loc (s : string) : t =
  PStr [ Str.eval ~loc (Ast_compatible.const_exp_string ~loc s) ]


type lid = string Asttypes.loc
type label_expr = lid  * Parsetree.expression

type action = 
  lid * Parsetree.expression option 
(** None means punning is hit 
    {[ { x } ]}
    otherwise it comes with a payload 
    {[ { x = exp }]}
*)

let  isAbstract (xs : action list) = 
  match xs with 
  | [{loc; txt = "abstract"}, None]  -> 
    true 
  | [{loc; txt = "abstract"}, Some _ ]
    -> 
      Location.raise_errorf ~loc "invalid config for abstract"
  | xs -> 
    List.iter (function (({loc; txt} : lid),_) ->  
      match txt with 
      | "abstract" -> 
        Location.raise_errorf ~loc 
          "bs.deriving abstract does not work with any other deriving"
      | _ -> ()
    ) xs ;
    false


let ident_or_record_as_config     
    loc
    (x : Parsetree.payload) 
  : ( string Location.loc * Parsetree.expression option) list 
  = 
  match  x with 
  | PStr 
      [ {pstr_desc = Pstr_eval
             ({pexp_desc = Pexp_record (label_exprs, with_obj) ; pexp_loc = loc}, _); 
         _
        }]
    -> 
    begin match with_obj with
      | None ->
        Ext_list.map label_exprs
          (fun ((x,y) : (Longident.t Asttypes.loc * _) ) -> 
             match (x,y) with 
             | ({txt = Lident name; loc} ) , 
               ({Parsetree.pexp_desc = Pexp_ident{txt = Lident name2}} )
               when name2 = name -> 
               ({Asttypes.txt = name ; loc}, None)
             | ({txt = Lident name; loc} ), y 
               -> 
               ({Asttypes.txt = name ; loc}, Some y)
             | _ -> 
               Location.raise_errorf ~loc "Qualified label is not allood"
          )

      | Some _ -> 
        Location.raise_errorf ~loc "with is not supported"
    end
  | PStr [
      {pstr_desc =
         Pstr_eval (
           {
             pexp_desc =
               Pexp_ident ({loc = lloc; txt = Lident txt});

           } , _)
      }
    ] -> [ {Asttypes.txt ; loc = lloc}, None] 
  | PStr [] -> []
  | _ -> 
    Location.raise_errorf ~loc "this is not a valid record config"



let assert_strings loc (x : t) : string list
  = 
  let module M = struct exception Not_str end  in 
  match x with 
  | PStr [ {pstr_desc =  
              Pstr_eval (
                {pexp_desc = 
                   Pexp_tuple strs;
                 _},_);
            pstr_loc = loc ;            
            _}] ->
    (try 
        Ext_list.map strs (fun e ->
           match (e : Parsetree.expression) with
           | {pexp_desc = Pexp_constant (
              
              Const_string
              
               (name,_)); _} -> 
             name
           | _ -> raise M.Not_str)
     with M.Not_str ->
       Location.raise_errorf ~loc "expect string tuple list"
    )
  | PStr [ {
      pstr_desc =  
        Pstr_eval (
          {pexp_desc = 
             Pexp_constant 
               
               (Const_string (name,_));
               
           _},_);
      _}] ->  [name] 
  | PStr [] ->  []

  | PStr _                
  | PTyp _ | PPat _ ->
    Location.raise_errorf ~loc "expect string tuple list"
let assert_bool_lit  (e : Parsetree.expression) = 
  match e.pexp_desc with
  | Pexp_construct ({txt = Lident "true" }, None)
    -> true
  | Pexp_construct ({txt = Lident "false" }, None)
    -> false 
  | _ ->
    Location.raise_errorf ~loc:e.pexp_loc "expect `true` or `false` in this field"


let empty : t = Parsetree.PStr []



let table_dispatch table (action : action)
  = 
  match action with 
  | {txt =  name; loc  }, y -> 
    begin match String_map.find_exn name table with 
      | fn -> fn y
      | exception _ -> Location.raise_errorf ~loc "%s is not supported" name
    end

end
module Ast_literal : sig 
#1 "ast_literal.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type 'a  lit = ?loc: Location.t -> unit -> 'a

val predef_option : Longident.t 
val predef_some : Longident.t 
val predef_none : Longident.t 

module Lid : sig
  type t = Longident.t 
  val val_unit : t 
  val type_unit : t 
  val type_int : t 
  val js_fn : t 
  val js_meth : t 
  val js_meth_callback : t 
  val js_obj : t 

  val ignore_id : t 
  val js_null : t 
  val js_undefined : t
  val js_null_undefined : t 
  val js_re_id : t 
  val js_internal : t 
end

type expression_lit = Parsetree.expression lit 
type core_type_lit = Parsetree.core_type lit 
type pattern_lit = Parsetree.pattern lit 

val val_unit : expression_lit

val type_unit : core_type_lit
val type_exn : core_type_lit
val type_string : core_type_lit
val type_int : core_type_lit 
val type_any : core_type_lit

val pat_unit : pattern_lit

end = struct
#1 "ast_literal.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

open Ast_helper


let predef_prefix_ident : Longident.t = Lident "*predef*"

let predef_option : Longident.t =
  Ldot (predef_prefix_ident, "option")

let predef_some : Longident.t =   
  Ldot (predef_prefix_ident, "Some")

let predef_none : Longident.t = 
  Ldot (predef_prefix_ident, "None")


module Lid = struct 
  type t = Longident.t 
  let val_unit : t = Lident "()"
  let type_unit : t = Lident "unit"
  let type_string : t = Lident "string"
  let type_int : t = Lident "int" (* use *predef* *)
  let type_exn : t = Lident "exn" (* use *predef* *)
  (* TODO should be renamed in to {!Js.fn} *)
  (* TODO should be moved into {!Js.t} Later *)
  let js_internal : t = Ldot (Lident "Js", "Internal")
  let js_fn : t = 
      Ldot (js_internal,  "fn")
  let js_meth : t = 
      Ldot (js_internal , "meth")
  let js_meth_callback : t = 
      Ldot (js_internal, "meth_callback")
  let js_obj : t = Ldot (Lident "Js", "t") 
  let ignore_id : t = Ldot (Lident "Pervasives", "ignore")
  let js_null  : t = Ldot (Lident "Js", "null")
  let js_undefined : t = Ldot (Lident "Js", "undefined")
  let js_null_undefined : t = Ldot (Lident "Js", "null_undefined")
  let js_re_id : t = Ldot (Ldot (Lident "Js", "Re"), "t")
end

module No_loc = struct 
  let loc = Location.none
  let val_unit = 
    Ast_helper.Exp.construct {txt = Lid.val_unit; loc }  None

  let type_unit =   
    Ast_helper.Typ.mk  (Ptyp_constr ({ txt = Lid.type_unit; loc}, []))
  let type_exn =   
    Ast_helper.Typ.mk  (Ptyp_constr ({ txt = Lid.type_unit; loc}, []))

  let type_int = 
    Ast_helper.Typ.mk (Ptyp_constr ({txt = Lid.type_int; loc}, []))  
  let type_string =   
    Ast_helper.Typ.mk  (Ptyp_constr ({ txt = Lid.type_string; loc}, []))

  let type_any = Ast_helper.Typ.any ()
  let pat_unit = Pat.construct {txt = Lid.val_unit; loc} None
end 

type 'a  lit = ?loc: Location.t -> unit -> 'a
type expression_lit = Parsetree.expression lit 
type core_type_lit = Parsetree.core_type lit 
type pattern_lit = Parsetree.pattern lit 

let val_unit ?loc () = 
  match loc with 
  | None -> No_loc.val_unit
  | Some loc -> Ast_helper.Exp.construct {txt = Lid.val_unit; loc}  None


let type_unit ?loc () = 
  match loc with
  | None ->     
    No_loc.type_unit
  | Some loc -> 
    Ast_helper.Typ.mk ~loc  (Ptyp_constr ({ txt = Lid.type_unit; loc}, []))

let type_exn ?loc () = 
  match loc with
  | None ->     
    No_loc.type_exn
  | Some loc -> 
    Ast_helper.Typ.mk ~loc  (Ptyp_constr ({ txt = Lid.type_exn; loc}, []))


let type_string ?loc () = 
  match loc with 
  | None -> No_loc.type_string 
  | Some loc ->     
    Ast_helper.Typ.mk ~loc  (Ptyp_constr ({ txt = Lid.type_string; loc}, []))

let type_int ?loc () = 
  match loc with 
  | None -> No_loc.type_int
  | Some loc ->     
    Ast_helper.Typ.mk ~loc  (Ptyp_constr ({ txt = Lid.type_int; loc}, []))

let type_any ?loc () = 
  match loc with 
  | None -> No_loc.type_any
  | Some loc -> Ast_helper.Typ.any ~loc ()

let pat_unit ?loc () = 
  match loc with 
  | None -> No_loc.pat_unit
  | Some loc -> 
    Pat.construct ~loc {txt = Lid.val_unit; loc} None

end
module Ast_comb : sig 
#1 "ast_comb.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


(* val exp_apply_no_label : 
  ?loc:Location.t ->
  ?attrs:Parsetree.attributes ->
  Parsetree.expression -> Parsetree.expression list -> Parsetree.expression *)

(* val fun_no_label : 
  ?loc:Location.t ->
  ?attrs:Parsetree.attributes ->
  Parsetree.pattern -> Parsetree.expression -> Parsetree.expression *)

(* val arrow_no_label : 
  ?loc:Location.t ->
  ?attrs:Parsetree.attributes ->
  Parsetree.core_type -> Parsetree.core_type -> Parsetree.core_type *)

(* note we first declare its type is [unit], 
   then [ignore] it, [ignore] is necessary since 
   the js value  maybe not be of type [unit] and 
   we can use [unit] value (though very little chance) 
   sometimes
*)
val discard_exp_as_unit : 
  Location.t -> Parsetree.expression -> Parsetree.expression


val tuple_type_pair : 
  ?loc:Ast_helper.loc ->
  [< `Make | `Run ] ->
  int -> Parsetree.core_type * Parsetree.core_type list * Parsetree.core_type

val to_js_type :
  Location.t -> Parsetree.core_type -> Parsetree.core_type



val to_undefined_type :
  Location.t -> Parsetree.core_type -> Parsetree.core_type  

val to_js_re_type : Location.t -> Parsetree.core_type

val single_non_rec_value : 
  Ast_helper.str -> 
  Parsetree.expression -> 
  Parsetree.structure_item

val single_non_rec_val :   
  Ast_helper.str -> 
  Parsetree.core_type -> 
  Parsetree.signature_item
end = struct
#1 "ast_comb.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


open Ast_helper 



(* let fun_no_label ?loc ?attrs  pat body = 
  Ast_compatible.fun_ ?loc ?attrs  pat body *)


let discard_exp_as_unit loc e = 
  Ast_compatible.apply_simple ~loc     
    (Exp.ident ~loc {txt = Ast_literal.Lid.ignore_id; loc})
    [Exp.constraint_ ~loc e 
       (Ast_literal.type_unit ~loc ())]


let tuple_type_pair ?loc kind arity = 
  let prefix  = "a" in
  if arity = 0 then 
    let ty = Typ.var ?loc ( prefix ^ "0") in 
    match kind with 
    | `Run -> ty,  [], ty 
    | `Make -> 
      (Ast_compatible.arrow ?loc
         (Ast_literal.type_unit ?loc ())
         ty ,
       [], ty)
  else
    let number = arity + 1 in
    let tys = Ext_list.init number (fun i -> 
        Typ.var ?loc (prefix ^ string_of_int (number - i - 1))
      )  in
    match tys with 
    | result :: rest -> 
      Ext_list.reduce_from_left tys (fun r arg -> Ast_compatible.arrow ?loc arg r) , 
      List.rev rest , result
    | [] -> assert false
    
    

let js_obj_type_id  = 
  Ast_literal.Lid.js_obj 

let re_id  = 
  Ast_literal.Lid.js_re_id 

let to_js_type loc  x  = 
  Typ.constr ~loc {txt = js_obj_type_id; loc} [x]

let to_js_re_type loc  =
  Typ.constr ~loc { txt = re_id ; loc} []
    
let to_undefined_type loc x =
  Typ.constr ~loc
    {txt = Ast_literal.Lid.js_undefined ; loc}
    [x]  

let single_non_rec_value  name exp = 
  Str.value Nonrecursive 
    [Vb.mk (Pat.var name) exp]

let single_non_rec_val name ty = 
  Sig.value 
    (Val.mk name ty)
end
module Bs_syntaxerr : sig 
#1 "bs_syntaxerr.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type error 
  = Unsupported_predicates
  | Conflict_bs_bs_this_bs_meth  
  | Duplicated_bs_deriving
  | Conflict_attributes

  | Duplicated_bs_as 
  | Expect_int_literal
  | Expect_string_literal
  | Expect_int_or_string_or_json_literal
  | Unhandled_poly_type
  | Unregistered of string 
  | Invalid_underscore_type_in_external
  | Invalid_bs_string_type 
  | Invalid_bs_int_type 
  | Invalid_bs_unwrap_type
  | Conflict_ffi_attribute of string
  | Not_supported_in_bs_deriving
  | Canot_infer_arity_by_syntax
  | Illegal_attribute
  | Inconsistent_arity of int * int 
  (* we still rqeuire users to have explicit annotation to avoid
     {[ (((int -> int) -> int) -> int )]}
  *)
  | Not_supported_directive_in_bs_return
  | Expect_opt_in_bs_return_to_opt
  | Label_in_uncurried_bs_attribute

  | Bs_this_simple_pattern


val err : Location.t -> error -> 'a

end = struct
#1 "bs_syntaxerr.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



type error 
  = Unsupported_predicates
  | Conflict_bs_bs_this_bs_meth  
  | Duplicated_bs_deriving
  | Conflict_attributes

  | Duplicated_bs_as 
  | Expect_int_literal
  | Expect_string_literal
  | Expect_int_or_string_or_json_literal
  | Unhandled_poly_type
  | Unregistered of string 
  | Invalid_underscore_type_in_external
  | Invalid_bs_string_type 
  | Invalid_bs_int_type 
  | Invalid_bs_unwrap_type
  | Conflict_ffi_attribute of string
  | Not_supported_in_bs_deriving
  | Canot_infer_arity_by_syntax
  | Illegal_attribute
  | Inconsistent_arity of int * int 
  (* we still rqeuire users to have explicit annotation to avoid
     {[ (((int -> int) -> int) -> int )]}
  *)
  | Not_supported_directive_in_bs_return
  | Expect_opt_in_bs_return_to_opt
  | Label_in_uncurried_bs_attribute

  | Bs_this_simple_pattern

let pp_error fmt err =
  Format.pp_print_string fmt @@ match err with
  | Label_in_uncurried_bs_attribute 
    -> "label is not allowed here, it is due to `bs.` attribute indicate uncurried calling convention which does not support label argument yet"
  | Expect_opt_in_bs_return_to_opt
      ->
        "bs.return directive *_to_opt expect return type to be \n\
         syntax wise `_ option` for safety"

  | Not_supported_directive_in_bs_return
    ->
    "Not supported return directive"                
  | Illegal_attribute ->
    "Illegal attributes"
  | Canot_infer_arity_by_syntax
    ->   "Can not infer the arity by syntax, either [@bs.uncurry n] or \n\
              write it in arrow syntax "
  | Inconsistent_arity (arity,n)
      -> Printf.sprintf "Inconsistent arity %d vs %d" arity n 
  | Not_supported_in_bs_deriving
    ->
    "not supported in deriving"
  | Unsupported_predicates 
    ->
     "unsupported predicates"
  | Conflict_bs_bs_this_bs_meth -> 
     "[@bs.this], [@bs], [@bs.meth] can not be applied at the same time"
  | Duplicated_bs_deriving
    -> "duplicated bs.deriving attribute"
  | Conflict_attributes
    -> "conflicting attributes " 
  | Expect_string_literal
    -> "expect string literal "
  | Duplicated_bs_as 
    -> 
    "duplicated bs.as "
  | Expect_int_literal 
    -> 
    "expect int literal "
  | Expect_int_or_string_or_json_literal
    ->
    "expect int or string literal or json literal ({json||json}) "
  | Unhandled_poly_type 
    -> 
    "Unhandled poly type"
  | Unregistered str 
    -> "Unregistered " ^ str 
  | Invalid_underscore_type_in_external
    ->
    "_ is not allowed in combination with external optional type"
  | Invalid_bs_string_type
    -> 
    "Not a valid type for [@bs.string]"
  | Invalid_bs_int_type 
    -> 
    "Not a valid type for [@bs.int]"
  | Invalid_bs_unwrap_type
    ->
    "Not a valid type for [@bs.unwrap]. Type must be an inline variant (closed), and\n\
     each constructor must have an argument."
  | Conflict_ffi_attribute str
    ->
    "Conflicting FFI attributes found: " ^ str
  | Bs_this_simple_pattern
    -> 
    "[@bs.this] expect its pattern variable to be simple form"

type exn +=  Error of Location.t * error


let () = 
  Location.register_error_of_exn (function
    | Error(loc,err) -> 
      Some (Location.error_of_printer loc pp_error err)
    | _ -> None
    )

let err loc error = raise (Error(loc, error))

end
module Ast_core_type : sig 
#1 "ast_core_type.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Parsetree.core_type




val lift_option_type : t -> t
val is_any : t -> bool
val replace_result : t -> t -> t

(* val opt_arrow: Location.t -> string -> t -> t -> t *)

val is_unit : t -> bool
val is_array : t -> bool


(** return a function type
    [from_labels ~loc tyvars labels]
    example output:
    {[x:'a0 -> y:'a1 -> < x :'a0 ;y :'a1  > Js.t]}
*)
val from_labels :
  loc:Location.t -> int ->  string Asttypes.loc list -> t

val make_obj :
  loc:Location.t ->
  (string * Parsetree.attributes * t) list ->
  t

val is_user_option : t -> bool

val is_user_bool : t -> bool

val is_user_int : t -> bool



(**
  returns 0 when it can not tell arity from the syntax
*)
val get_uncurry_arity : t -> [`Arity of int | `Not_function ]


(** fails when Ptyp_poly *)
val list_of_arrow :
  t ->
  t *  (Ast_compatible.arg_label * t * Parsetree.attributes * Location.t) list

val is_arity_one : t -> bool

end = struct
#1 "ast_core_type.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Parsetree.core_type









let lift_option_type ({ptyp_loc} as ty:t) : t =
  {ptyp_desc =
     Ptyp_constr(
       {txt = Ast_literal.predef_option;
        loc = ptyp_loc}
        , [ty]);
        ptyp_loc = ptyp_loc;
      ptyp_attributes = []
    }

let is_any (ty : t) =
  ty.ptyp_desc = Ptyp_any

open Ast_helper

let replace_result (ty : t) (result : t) : t =
  let rec aux (ty : Parsetree.core_type) =
    match ty with
    | { ptyp_desc =
          Ptyp_arrow (label,t1,t2)
      } -> { ty with ptyp_desc = Ptyp_arrow(label,t1, aux t2)}
    | {ptyp_desc = Ptyp_poly(fs,ty)}
      ->  {ty with ptyp_desc = Ptyp_poly(fs, aux ty)}
    | _ -> result in
  aux ty

let is_unit (ty : t ) =
  match ty.ptyp_desc with
  | Ptyp_constr({txt =Lident "unit"}, []) -> true
  | _ -> false

let is_array (ty : t) =
  match ty.ptyp_desc with
  | Ptyp_constr({txt =Lident "array"}, [_]) -> true
  | _ -> false

let is_user_option (ty : t) =
  match ty.ptyp_desc with
  | Ptyp_constr(
    {txt = Lident "option" |
     (Ldot (Lident "*predef*", "option")) },
    [_]) -> true
  | _ -> false

let is_user_bool (ty : t) =
  match ty.ptyp_desc with
  | Ptyp_constr({txt = Lident "bool"},[]) -> true
  | _ -> false

let is_user_int (ty : t) =
  match ty.ptyp_desc with
  | Ptyp_constr({txt = Lident "int"},[]) -> true
  | _ -> false





(* Note that OCaml type checker will not allow arbitrary
   name as type variables, for example:
   {[
     '_x'_
   ]}
   will be recognized as a invalid program
*)
let from_labels ~loc arity labels
  : t =
  let tyvars =
    ((Ext_list.init arity (fun i ->
         Typ.var ~loc ("a" ^ string_of_int i)))) in
  let result_type =
    Ast_comb.to_js_type loc
      (Ast_compatible.object_ ~loc
         (Ext_list.map2 labels tyvars (fun x y -> x.Asttypes.txt ,[], y)) Closed)
  in
  Ext_list.fold_right2 labels tyvars  result_type
    (fun label (* {loc ; txt = label }*)
      tyvar acc -> 
      Ast_compatible.label_arrow ~loc:label.loc label.txt tyvar acc) 


let make_obj ~loc xs =
  Ast_comb.to_js_type loc
    (Ast_compatible.object_  ~loc xs Closed)



(**

{[ 'a . 'a -> 'b ]}
OCaml does not support such syntax yet
{[ 'a -> ('a. 'a -> 'b) ]}

*)
let rec get_uncurry_arity_aux  (ty : t) acc =
    match ty.ptyp_desc with
    | Ptyp_arrow(_, _ , new_ty) ->
      get_uncurry_arity_aux new_ty (succ acc)
    | Ptyp_poly (_,ty) ->
      get_uncurry_arity_aux ty acc
    | _ -> acc

(**
   {[ unit -> 'b ]} return arity 0
   {[ unit -> 'a1 -> a2']} arity 2
   {[ 'a1 -> 'a2 -> ... 'aN -> 'b ]} return arity N
*)
let get_uncurry_arity (ty : t ) =
  match ty.ptyp_desc  with
  | Ptyp_arrow(arg_label, {ptyp_desc = (Ptyp_constr ({txt = Lident "unit"}, []))},
     rest  ) when Ast_compatible.is_arg_label_simple arg_label -> 
     begin match rest with 
     | {ptyp_desc = Ptyp_arrow _ } ->  
      `Arity (get_uncurry_arity_aux rest 1 )
    | _ -> `Arity 0 
    end
  | Ptyp_arrow(_,_,rest ) ->
    `Arity(get_uncurry_arity_aux rest 1)
  | _ -> `Not_function

let get_curry_arity  ty =
  get_uncurry_arity_aux ty 0

let is_arity_one ty = get_curry_arity ty =  1

let list_of_arrow (ty : t) =
  let rec aux (ty : t) acc =
    match ty.ptyp_desc with
    | Ptyp_arrow(label,t1,t2) ->
      aux t2 ((label,t1,ty.ptyp_attributes,ty.ptyp_loc) ::acc)
    | Ptyp_poly(_, ty) -> (* should not happen? *)
      Bs_syntaxerr.err ty.ptyp_loc Unhandled_poly_type
    | return_type -> ty, List.rev acc
  in aux ty []


(* type arg_label =
  | Nolabel (* it will be ignored , side effect will be recorded *)
  | Labelled of string
  | Optional of string
  

let label_name l : arg_label =
  if l = "" then Nolabel else
  if is_optional_label l
  then Optional (String.sub l 1 (String.length l - 1))
  else Labelled l   *)
end
module Ast_utf8_string : sig 
#1 "ast_utf8_string.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type error 


type exn += Error of int  (* offset *) * error 

val pp_error :  Format.formatter -> error -> unit  


  
(* module Interp : sig *)
(*   val check_and_transform : int -> string -> int -> cxt -> unit *)
(*   val transform_test : string -> segments *)
(* end *)
val transform_test : string -> string 

val transform : Location.t -> string -> string      


end = struct
#1 "ast_utf8_string.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



type error = 
  | Invalid_code_point 
  | Unterminated_backslash
  | Invalid_escape_code of char 
  | Invalid_hex_escape
  | Invalid_unicode_escape

let pp_error fmt err = 
  Format.pp_print_string fmt @@  match err with 
  | Invalid_code_point -> "Invalid code point"
  | Unterminated_backslash -> "\\ ended unexpectedly"
  | Invalid_escape_code c -> "Invalid escape code: " ^ String.make 1 c 
  | Invalid_hex_escape -> 
    "Invalid \\x escape"
  | Invalid_unicode_escape -> "Invalid \\u escape"



type exn += Error of int  (* offset *) * error 




let error ~loc error = 
  raise (Error (loc, error))

(** Note the [loc] really should be the utf8-offset, it has nothing to do with our 
    escaping mechanism
*)
(* we can not just print new line in ES5 
   seems we don't need 
   escape "\b" "\f" 
   we need escape "\n" "\r" since 
   ocaml multiple-line allows [\n]
   visual input while es5 string 
   does not*)

let rec check_and_transform (loc : int ) buf s byte_offset s_len =
  if byte_offset = s_len then ()
  else 
    let current_char = s.[byte_offset] in 
    match Ext_utf8.classify current_char with 
    | Single 92 (* '\\' *) -> 
      escape_code (loc + 1) buf s (byte_offset+1) s_len
    | Single 34 ->
      Buffer.add_string buf "\\\"";
      check_and_transform (loc + 1) buf s (byte_offset + 1) s_len
    | Single 39 -> 
      Buffer.add_string buf "\\'";
      check_and_transform (loc + 1) buf s (byte_offset + 1) s_len 
    | Single 10 ->          
      Buffer.add_string buf "\\n";
      check_and_transform (loc + 1) buf s (byte_offset + 1) s_len 
    | Single 13 -> 
      Buffer.add_string buf "\\r";
      check_and_transform (loc + 1) buf s (byte_offset + 1) s_len 
    | Single _ -> 
      Buffer.add_char buf current_char;
      check_and_transform (loc + 1) buf s (byte_offset + 1) s_len 

    | Invalid 
    | Cont _ -> error ~loc Invalid_code_point
    | Leading (n,_) -> 
      let i' = Ext_utf8.next s ~remaining:n  byte_offset in
      if i' < 0 then 
        error ~loc Invalid_code_point
      else 
        begin 
          for k = byte_offset to i' do 
            Buffer.add_char buf s.[k]; 
          done;   
          check_and_transform (loc + 1 ) buf s (i' + 1) s_len 
        end
(* we share the same escape sequence with js *)        
and escape_code loc buf s offset s_len = 
  if offset >= s_len then 
    error ~loc Unterminated_backslash
  else
    Buffer.add_char buf '\\'; 
  let cur_char = s.[offset] in
  match cur_char with 
  | '\\'
  | 'b' 
  | 't' 
  | 'n' 
  | 'v'
  | 'f'
  | 'r' 
  | '0' 
  | '$'
    -> 
    begin 
      Buffer.add_char buf cur_char ;
      check_and_transform (loc + 1) buf s (offset + 1) s_len 
    end 
  | 'u' -> 
    begin 
      Buffer.add_char buf cur_char;
      unicode (loc + 1) buf s (offset + 1) s_len 
    end 
  | 'x' -> begin 
      Buffer.add_char buf cur_char ; 
      two_hex (loc + 1) buf s (offset + 1) s_len 
    end 
  | _ -> error ~loc (Invalid_escape_code cur_char)
and two_hex loc buf s offset s_len = 
  if offset + 1 >= s_len then 
    error ~loc Invalid_hex_escape;
  (*Location.raise_errorf ~loc "\\x need at least two chars";*)
  let a, b = s.[offset], s.[offset + 1] in 
  if Ext_char.valid_hex a && Ext_char.valid_hex b then 
    begin 
      Buffer.add_char buf a ; 
      Buffer.add_char buf b ; 
      check_and_transform (loc + 2) buf s (offset + 2) s_len 
    end
  else
    error ~loc Invalid_hex_escape
(*Location.raise_errorf ~loc "%c%c is not a valid hex code" a b*)

and unicode loc buf s offset s_len = 
  if offset + 3 >= s_len then 
    error ~loc Invalid_unicode_escape
  (*Location.raise_errorf ~loc "\\u need at least four chars"*)
  ;
  let a0,a1,a2,a3 = s.[offset], s.[offset+1], s.[offset+2], s.[offset+3] in
  if 
    Ext_char.valid_hex a0 &&
    Ext_char.valid_hex a1 &&
    Ext_char.valid_hex a2 &&
    Ext_char.valid_hex a3 then 
    begin 
      Buffer.add_char buf a0;
      Buffer.add_char buf a1;
      Buffer.add_char buf a2;
      Buffer.add_char buf a3;  
      check_and_transform (loc + 4) buf s  (offset + 4) s_len 
    end 
  else
    error ~loc Invalid_unicode_escape 
(*Location.raise_errorf ~loc "%c%c%c%c is not a valid unicode point"
  a0 a1 a2 a3 *)
(* http://www.2ality.com/2015/01/es6-strings.html
   console.log('\uD83D\uDE80'); (* ES6*)
   console.log('\u{1F680}');
*)   









let transform_test s =
  let s_len = String.length s in 
  let buf = Buffer.create (s_len * 2) in
  check_and_transform 0 buf s 0 s_len;
  Buffer.contents buf

let transform loc s = 
  let s_len = String.length s in 
  let buf = Buffer.create (s_len * 2) in
  try
    check_and_transform 0 buf s 0 s_len;
    Buffer.contents buf 
  with
    Error (offset, error)
    ->  Location.raise_errorf ~loc "Offset: %d, %a" offset pp_error error



end
module Bs_loc : sig 
#1 "bs_loc.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Location.t = {
  loc_start : Lexing.position;
  loc_end : Lexing.position ; 
  loc_ghost : bool
} 

val is_ghost : t -> bool
val merge : t -> t -> t 
val none : t 


end = struct
#1 "bs_loc.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type t = Location.t = {
  loc_start : Lexing.position;
  loc_end : Lexing.position ; 
  loc_ghost : bool
} 

let is_ghost x = x.loc_ghost

let merge (l: t) (r : t) = 
  if is_ghost l then r 
  else if is_ghost r then l 
  else match l,r with 
  | {loc_start ; }, {loc_end; _} (* TODO: improve*)
    -> 
    {loc_start ;loc_end; loc_ghost = false}

let none = Location.none

end
module Ast_utf8_string_interp : sig 
#1 "ast_utf8_string_interp.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



 type kind =
  | String
  | Var of int * int (* int records its border length *)

type error = private
  | Invalid_code_point
  | Unterminated_backslash
  | Invalid_escape_code of char
  | Invalid_hex_escape
  | Invalid_unicode_escape
  | Unterminated_variable
  | Unmatched_paren
  | Invalid_syntax_of_var of string 

(** Note the position is about code point *)
type pos = { lnum : int ; offset : int ; byte_bol : int }

type segment = {
  start : pos;
  finish : pos ;
  kind : kind;
  content : string ;
} 

type segments = segment list  

type cxt = {
  mutable segment_start : pos ;
  buf : Buffer.t ;
  s_len : int ;
  mutable segments : segments;
  mutable pos_bol : int; (* record the abs position of current beginning line *)
  mutable byte_bol : int ; 
  mutable pos_lnum : int ; (* record the line number *)
}

type exn += Error of pos *  pos * error 

val empty_segment : segment -> bool

val transform_test : string -> segment list



val transform : 
  Parsetree.expression -> 
  string -> 
  string -> 
  Parsetree.expression

val is_unicode_string :   
  string -> 
  bool

val is_unescaped :   
  string -> 
  bool
end = struct
#1 "ast_utf8_string_interp.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type error = 
  | Invalid_code_point
  | Unterminated_backslash
  | Invalid_escape_code of char
  | Invalid_hex_escape
  | Invalid_unicode_escape
  | Unterminated_variable
  | Unmatched_paren
  | Invalid_syntax_of_var of string 

type kind =
  | String
  | Var of int * int 
(* [Var (loffset, roffset)] 
  For parens it used to be (2,-1)
  for non-parens it used to be (1,0)
*)

(** Note the position is about code point *)
type pos = { 
  lnum : int ; 
  offset : int ;
  byte_bol : int (* Note it actually needs to be in sync with OCaml's lexing semantics *)
}


type segment = {
  start : pos;
  finish : pos ;
  kind : kind;
  content : string ;
} 

type segments = segment list 


type cxt = {
  mutable segment_start : pos ;
  buf : Buffer.t ;
  s_len : int ;
  mutable segments : segments;
  mutable pos_bol : int; (* record the abs position of current beginning line *)
  mutable byte_bol : int ; 
  mutable pos_lnum : int ; (* record the line number *)
}


type exn += Error of pos *  pos * error 

let pp_error fmt err = 
  Format.pp_print_string fmt @@  match err with 
  | Invalid_code_point -> "Invalid code point"
  | Unterminated_backslash -> "\\ ended unexpectedly"
  | Invalid_escape_code c -> "Invalid escape code: " ^ String.make 1 c 
  | Invalid_hex_escape -> 
    "Invalid \\x escape"
  | Invalid_unicode_escape -> "Invalid \\u escape"
  | Unterminated_variable -> "$ unterminated"
  | Unmatched_paren -> "Unmatched paren"
  | Invalid_syntax_of_var s -> "`" ^s ^ "' is not a valid syntax of interpolated identifer"
let valid_lead_identifier_char x = 
  match x with
  | 'a'..'z' | '_' -> true
  | _ -> false

let valid_identifier_char x = 
  match x with
  | 'a'..'z' 
  | 'A'..'Z'
  | '0'..'9'
  | '_' | '\''-> true
  | _ -> false
(** Invariant: [valid_lead_identifier] has to be [valid_identifier] *)

let valid_identifier s =
  let s_len = String.length s in 
  if s_len = 0 then false 
  else
    valid_lead_identifier_char s.[0] &&
    Ext_string.for_all_from s 1  valid_identifier_char

      
let is_space x = 
  match x with
  | ' ' | '\n' | '\t' -> true
  | _ -> false



(**
   FIXME: multiple line offset 
   if there is no line offset. Note {|{j||} border will never trigger a new line
*)
let update_position border 
    ({lnum ; offset;byte_bol } : pos)
    (pos : Lexing.position)= 
  if lnum = 0 then 
    {pos with pos_cnum = pos.pos_cnum + border + offset  }
    (** When no newline, the column number is [border + offset] *)
  else 
    {
      pos with 
      pos_lnum = pos.pos_lnum + lnum ;
      pos_bol = pos.pos_cnum + border + byte_bol;
      pos_cnum = pos.pos_cnum + border + byte_bol + offset;
      (** when newline, the column number is [offset] *)
    }  
let update border
    (start : pos) 
    (finish : pos) (loc : Location.t) : Location.t = 
  let start_pos = loc.loc_start in 
  { loc  with 
    loc_start = 
      update_position  border start start_pos;
    loc_end = 
      update_position border finish start_pos
  }


(** Note [Var] kind can not be mpty  *)
let empty_segment {content } =
  Ext_string.is_empty content



let update_newline ~byte_bol loc  cxt = 
  cxt.pos_lnum <- cxt.pos_lnum + 1 ; 
  cxt.pos_bol <- loc;
  cxt.byte_bol <- byte_bol  

let pos_error cxt ~loc error = 
  raise (Error 
           (cxt.segment_start,
            { lnum = cxt.pos_lnum ; offset = loc - cxt.pos_bol ; byte_bol = cxt.byte_bol}, error))

let add_var_segment cxt loc loffset roffset = 
  let content =  Buffer.contents cxt.buf in
  Buffer.clear cxt.buf ;
  let next_loc = {
    lnum = cxt.pos_lnum ; offset = loc - cxt.pos_bol ; 
    byte_bol = cxt.byte_bol } in
  if valid_identifier content then 
    begin 
      cxt.segments <- 
        { start = cxt.segment_start; 
          finish =  next_loc ;
          kind = Var (loffset, roffset); 
          content} :: cxt.segments ;
      cxt.segment_start <- next_loc
    end
  else pos_error cxt ~loc (Invalid_syntax_of_var content)

let add_str_segment cxt loc   =
  let content =  Buffer.contents cxt.buf in
  Buffer.clear cxt.buf ;
  let next_loc = {
    lnum = cxt.pos_lnum ; offset = loc - cxt.pos_bol ; 
    byte_bol = cxt.byte_bol } in
  cxt.segments <- 
    { start = cxt.segment_start; 
      finish =  next_loc ;
      kind = String; 
      content} :: cxt.segments ;
  cxt.segment_start <- next_loc


  


let rec check_and_transform (loc : int )  s byte_offset ({s_len; buf} as cxt : cxt) =
  if byte_offset = s_len then
    add_str_segment cxt loc 
  else 
    let current_char = s.[byte_offset] in 
    match Ext_utf8.classify current_char with 
    | Single 92 (* '\\' *) -> 
      escape_code (loc + 1)  s (byte_offset+1) cxt
    | Single 34 ->
      Buffer.add_string buf "\\\"";
      check_and_transform (loc + 1)  s (byte_offset + 1) cxt
    | Single 39 -> 
      Buffer.add_string buf "\\'";
      check_and_transform (loc + 1)  s (byte_offset + 1) cxt
    | Single 10 ->          

      Buffer.add_string buf "\\n";
      let loc = loc + 1 in 
      let byte_offset = byte_offset + 1 in 
      update_newline ~byte_bol:byte_offset loc cxt ; (* Note variable could not have new-line *)
      check_and_transform loc  s byte_offset cxt
    | Single 13 -> 
      Buffer.add_string buf "\\r";
      check_and_transform (loc + 1)  s (byte_offset + 1) cxt
    | Single 36 -> (* $ *)
      add_str_segment cxt loc  ; 
      let offset = byte_offset + 1 in
      if offset >= s_len then
        pos_error ~loc cxt  Unterminated_variable
      else
        let cur_char = s.[offset] in
        if cur_char = '(' then
          expect_var_paren  (loc + 2)  s (offset + 1) cxt
        else
          expect_simple_var (loc + 1)  s offset cxt
    | Single _ -> 
      Buffer.add_char buf current_char;
      check_and_transform (loc + 1)  s (byte_offset + 1) cxt

    | Invalid 
    | Cont _ -> pos_error ~loc cxt Invalid_code_point
    | Leading (n,_) -> 
      let i' = Ext_utf8.next s ~remaining:n  byte_offset in
      if i' < 0 then 
        pos_error cxt ~loc Invalid_code_point
      else 
        begin 
          for k = byte_offset to i' do 
            Buffer.add_char buf s.[k]; 
          done;   
          check_and_transform (loc + 1 )  s (i' + 1) cxt
        end
(**Lets keep identifier simple, so that we could generating a function easier in the future
   for example
   let f = [%fn{| $x + $y = $x_add_y |}]
*)
and expect_simple_var  loc  s offset ({buf; s_len} as cxt) =
  let v = ref offset in
  (* prerr_endline @@ Ext_pervasives.dump (s, has_paren, (is_space s.[!v]), !v); *)
  if not (offset < s_len  && valid_lead_identifier_char s.[offset]) then 
    pos_error cxt ~loc (Invalid_syntax_of_var Ext_string.empty)
  else 
    begin 
      while !v < s_len && valid_identifier_char s.[!v]  do (* TODO*)
        let cur_char = s.[!v] in
        Buffer.add_char buf cur_char;
        incr v ;
      done;
      let added_length = !v - offset in
      let loc = added_length + loc in 
      add_var_segment cxt loc 1 0 ; 
      check_and_transform loc  s (added_length + offset) cxt
    end
and expect_var_paren  loc  s offset ({buf; s_len} as cxt) =
  let v = ref offset in
  (* prerr_endline @@ Ext_pervasives.dump (s, has_paren, (is_space s.[!v]), !v); *)
  while !v < s_len &&  s.[!v] <> ')' do 
    let cur_char = s.[!v] in
    Buffer.add_char buf cur_char;
    incr v ;
  done;
  let added_length = !v - offset in
  let loc = added_length +  1 + loc  in
  if !v < s_len && s.[!v] = ')' then
    begin 
      add_var_segment cxt loc 2 (-1) ; 
      check_and_transform loc  s (added_length + 1 + offset) cxt 
    end
  else
    pos_error cxt ~loc Unmatched_paren





(* we share the same escape sequence with js *)        
and escape_code loc  s offset ({ buf; s_len} as cxt) = 
  if offset >= s_len then 
    pos_error cxt ~loc Unterminated_backslash
  else
    Buffer.add_char buf '\\'; 
  let cur_char = s.[offset] in
  match cur_char with 
  | '\\'
  | 'b' 
  | 't' 
  | 'n' 
  | 'v'
  | 'f'
  | 'r' 
  | '0' 
  | '$'
    -> 
    begin 
      Buffer.add_char buf cur_char ;
      check_and_transform (loc + 1)  s (offset + 1) cxt
    end 
  | 'u' -> 
    begin 
      Buffer.add_char buf cur_char;
      unicode (loc + 1) s (offset + 1) cxt
    end 
  | 'x' -> begin 
      Buffer.add_char buf cur_char ; 
      two_hex (loc + 1)  s (offset + 1) cxt
    end 
  | _ -> pos_error cxt ~loc (Invalid_escape_code cur_char)
and two_hex loc  s offset ({buf ; s_len} as cxt) = 
  if offset + 1 >= s_len then 
    pos_error cxt ~loc Invalid_hex_escape;
  let a, b = s.[offset], s.[offset + 1] in 
  if Ext_char.valid_hex a && Ext_char.valid_hex b then 
    begin 
      Buffer.add_char buf a ; 
      Buffer.add_char buf b ; 
      check_and_transform (loc + 2)  s (offset + 2) cxt
    end
  else
    pos_error cxt ~loc Invalid_hex_escape


and unicode loc  s offset ({buf ; s_len} as cxt) = 
  if offset + 3 >= s_len then 
    pos_error cxt ~loc Invalid_unicode_escape
  ;
  let a0,a1,a2,a3 = s.[offset], s.[offset+1], s.[offset+2], s.[offset+3] in
  if 
    Ext_char.valid_hex a0 &&
    Ext_char.valid_hex a1 &&
    Ext_char.valid_hex a2 &&
    Ext_char.valid_hex a3 then 
    begin 
      Buffer.add_char buf a0;
      Buffer.add_char buf a1;
      Buffer.add_char buf a2;
      Buffer.add_char buf a3;  
      check_and_transform (loc + 4) s  (offset + 4) cxt
    end 
  else
    pos_error cxt ~loc Invalid_unicode_escape 
let transform_test s =
  let s_len = String.length s in
  let buf = Buffer.create (s_len * 2) in
  let cxt = 
    { segment_start = {lnum = 0; offset = 0; byte_bol = 0}; 
      buf ;
      s_len;
      segments = [];
      pos_lnum = 0;          
      byte_bol = 0;
      pos_bol = 0;

    } in 
  check_and_transform 0 s 0 cxt;
  List.rev cxt.segments


(** TODO: test empty var $() $ failure, 
    Allow identifers x.A.y *)    

open Ast_helper     

(** Longident.parse "Pervasives.^" *)
let concat_ident  : Longident.t = 
  Ldot (Lident "Pervasives", "^") (* FIXME: remove deps on `Pervasives` *)
   (* JS string concatMany *)
    (* Ldot (Ldot (Lident "Js", "String"), "concat") *)

(* Longident.parse "Js.String.make"     *)
let to_string_ident : Longident.t = 
    Ldot (Ldot (Lident "Js", "String"), "make")


let escaped_j_delimiter =  "*j" (* not user level syntax allowed *)
let unescaped_j_delimiter = "j"
let unescaped_js_delimiter = "js"

let escaped = Some escaped_j_delimiter 

let concat_exp 
  (a : Parsetree.expression)
  (b : Parsetree.expression) : Parsetree.expression = 
  let loc = Bs_loc.merge a.pexp_loc b.pexp_loc in 
  Ast_compatible.apply_simple ~loc 
  (Exp.ident { txt =concat_ident; loc})
    [a ;
     b]

let border = String.length "{j|"

let aux loc (segment : segment) =  
  match segment with 
  | {start ; finish; kind ; content} 
    ->     
    begin match kind with 
      | String ->         
        let loc = update border start finish  loc  in 
        Ast_compatible.const_exp_string
          content ?delimiter:escaped ~loc
      | Var (soffset, foffset) ->
        let loc = {
          loc with 
          loc_start = update_position  (soffset + border) start loc.loc_start ;
          loc_end = update_position (foffset + border) finish loc.loc_start
        } in 
        Ast_compatible.apply_simple ~loc 
          (Exp.ident ~loc {loc ; txt = to_string_ident })
          [
            Exp.ident ~loc {loc ; txt = Lident content}
          ]
    end 


let transform_interp loc s = 
  let s_len = String.length s in 
  let buf = Buffer.create (s_len * 2 ) in 
  try 
    let cxt : cxt = 
      { segment_start = {lnum = 0; offset = 0; byte_bol = 0}; 
        buf ;
        s_len;
        segments = [];
        pos_lnum = 0;          
        byte_bol = 0;
        pos_bol = 0;

      } in 

    check_and_transform 0 s 0 cxt; 
    let rev_segments =  cxt.segments in 
    match rev_segments with 
    | [] -> 
      Ast_compatible.const_exp_string ~loc ""  ?delimiter:escaped
    | [ segment] -> 
      aux loc segment 
    | a::rest -> 
      List.fold_left (fun (acc : Parsetree.expression)
       (x : segment) ->
          concat_exp (aux loc x) acc )
        (aux loc a) rest
  with 
    Error (start,pos, error) 
    -> 
    Location.raise_errorf ~loc:(update border start pos loc )
      "%a"  pp_error error 


let transform (e : Parsetree.expression) s delim : Parsetree.expression = 
    if Ext_string.equal delim unescaped_js_delimiter then
        let js_str = Ast_utf8_string.transform e.pexp_loc s in
        { e with pexp_desc =
                       Pexp_constant (
            
            Const_string 
                                     
                         (js_str, escaped))}
    else if Ext_string.equal delim unescaped_j_delimiter then
            transform_interp e.pexp_loc s
    else e

let is_unicode_string opt = Ext_string.equal opt escaped_j_delimiter    

let is_unescaped s = 
  Ext_string.equal s unescaped_j_delimiter
  || Ext_string.equal s unescaped_js_delimiter
end
module Bs_ast_iterator : sig 
#1 "bs_ast_iterator.mli"
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*                      Nicolas Ojeda Bar, LexiFi                         *)
(*                                                                        *)
(*   Copyright 2012 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(** {!iterator} allows to implement AST inspection using open recursion.  A
    typical mapper would be based on {!default_iterator}, a trivial iterator,
    and will fall back on it for handling the syntax it does not modify. *)

open Parsetree

(** {2 A generic Parsetree iterator} *)

type iterator = {
  attribute: iterator -> attribute -> unit;
  attributes: iterator -> attribute list -> unit;
  case: iterator -> case -> unit;
  cases: iterator -> case list -> unit;
  class_declaration: iterator -> class_declaration -> unit;
  class_description: iterator -> class_description -> unit;
  class_expr: iterator -> class_expr -> unit;
  class_field: iterator -> class_field -> unit;
  class_signature: iterator -> class_signature -> unit;
  class_structure: iterator -> class_structure -> unit;
  class_type: iterator -> class_type -> unit;
  class_type_declaration: iterator -> class_type_declaration -> unit;
  class_type_field: iterator -> class_type_field -> unit;
  constructor_declaration: iterator -> constructor_declaration -> unit;
  expr: iterator -> expression -> unit;
  extension: iterator -> extension -> unit;
  extension_constructor: iterator -> extension_constructor -> unit;
  include_declaration: iterator -> include_declaration -> unit;
  include_description: iterator -> include_description -> unit;
  label_declaration: iterator -> label_declaration -> unit;
  location: iterator -> Location.t -> unit;
  module_binding: iterator -> module_binding -> unit;
  module_declaration: iterator -> module_declaration -> unit;
  module_expr: iterator -> module_expr -> unit;
  module_type: iterator -> module_type -> unit;
  module_type_declaration: iterator -> module_type_declaration -> unit;
  open_description: iterator -> open_description -> unit;
  pat: iterator -> pattern -> unit;
  payload: iterator -> payload -> unit;
  signature: iterator -> signature -> unit;
  signature_item: iterator -> signature_item -> unit;
  structure: iterator -> structure -> unit;
  structure_item: iterator -> structure_item -> unit;
  typ: iterator -> core_type -> unit;
  type_declaration: iterator -> type_declaration -> unit;
  type_extension: iterator -> type_extension -> unit;
  type_kind: iterator -> type_kind -> unit;
  value_binding: iterator -> value_binding -> unit;
  value_description: iterator -> value_description -> unit;
  with_constraint: iterator -> with_constraint -> unit;
}
(** A [iterator] record implements one "method" per syntactic category,
    using an open recursion style: each method takes as its first
    argument the iterator to be applied to children in the syntax
    tree. *)

val default_iterator: iterator
(** A default iterator, which implements a "do not do anything" mapping. *)

end = struct
#1 "bs_ast_iterator.ml"
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*                      Nicolas Ojeda Bar, LexiFi                         *)
(*                                                                        *)
(*   Copyright 2012 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

[@@@ocaml.warning "+9"]
(* A generic Parsetree mapping class *)
(* Back-ported from 4.04 By Hongbo ZHang, after grading to 4.04, we will remove this file  *)
(*

  (* Ensure that record patterns don't miss any field. *)
*)


open Parsetree
open Location

type iterator = {
  attribute: iterator -> attribute -> unit;
  attributes: iterator -> attribute list -> unit;
  case: iterator -> case -> unit;
  cases: iterator -> case list -> unit;
  class_declaration: iterator -> class_declaration -> unit;
  class_description: iterator -> class_description -> unit;
  class_expr: iterator -> class_expr -> unit;
  class_field: iterator -> class_field -> unit;
  class_signature: iterator -> class_signature -> unit;
  class_structure: iterator -> class_structure -> unit;
  class_type: iterator -> class_type -> unit;
  class_type_declaration: iterator -> class_type_declaration -> unit;
  class_type_field: iterator -> class_type_field -> unit;
  constructor_declaration: iterator -> constructor_declaration -> unit;
  expr: iterator -> expression -> unit;
  extension: iterator -> extension -> unit;
  extension_constructor: iterator -> extension_constructor -> unit;
  include_declaration: iterator -> include_declaration -> unit;
  include_description: iterator -> include_description -> unit;
  label_declaration: iterator -> label_declaration -> unit;
  location: iterator -> Location.t -> unit;
  module_binding: iterator -> module_binding -> unit;
  module_declaration: iterator -> module_declaration -> unit;
  module_expr: iterator -> module_expr -> unit;
  module_type: iterator -> module_type -> unit;
  module_type_declaration: iterator -> module_type_declaration -> unit;
  open_description: iterator -> open_description -> unit;
  pat: iterator -> pattern -> unit;
  payload: iterator -> payload -> unit;
  signature: iterator -> signature -> unit;
  signature_item: iterator -> signature_item -> unit;
  structure: iterator -> structure -> unit;
  structure_item: iterator -> structure_item -> unit;
  typ: iterator -> core_type -> unit;
  type_declaration: iterator -> type_declaration -> unit;
  type_extension: iterator -> type_extension -> unit;
  type_kind: iterator -> type_kind -> unit;
  value_binding: iterator -> value_binding -> unit;
  value_description: iterator -> value_description -> unit;
  with_constraint: iterator -> with_constraint -> unit;
}
(** A [iterator] record implements one "method" per syntactic category,
    using an open recursion style: each method takes as its first
    argument the iterator to be applied to children in the syntax
    tree. *)

let iter_fst f (x, _) = f x
let iter_snd f (_, y) = f y
let iter_tuple f1 f2 (x, y) = f1 x; f2 y
let iter_tuple3 f1 f2 f3 (x, y, z) = f1 x; f2 y; f3 z
let iter_opt f = function None -> () | Some x -> f x

let iter_loc sub {loc; txt = _} = sub.location sub loc

module T = struct
  (* Type expressions for the core language *)

  let row_field sub = function
    | Rtag (_, attrs, _, tl) ->
        sub.attributes sub attrs; List.iter (sub.typ sub) tl
    | Rinherit t -> sub.typ sub t

  let iter sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Ptyp_any
    | Ptyp_var _ -> ()
    | Ptyp_arrow (_lab, t1, t2) ->
        sub.typ sub t1; sub.typ sub t2
    | Ptyp_tuple tyl -> List.iter (sub.typ sub) tyl
    | Ptyp_constr (lid, tl) ->
        iter_loc sub lid; List.iter (sub.typ sub) tl
    | Ptyp_object (l, _o) ->
        let f (_, a, t) = sub.attributes sub a; sub.typ sub t in
        List.iter f l
    | Ptyp_class (lid, tl) ->
        iter_loc sub lid; List.iter (sub.typ sub) tl
    | Ptyp_alias (t, _) -> sub.typ sub t
    | Ptyp_variant (rl, _b, _ll) ->
        List.iter (row_field sub) rl
    | Ptyp_poly (_, t) -> sub.typ sub t
    | Ptyp_package (lid, l) ->
        iter_loc sub lid;
        List.iter (iter_tuple (iter_loc sub) (sub.typ sub)) l
    | Ptyp_extension x -> sub.extension sub x

  let iter_type_declaration sub
      {ptype_name; ptype_params; ptype_cstrs;
       ptype_kind;
       ptype_private = _;
       ptype_manifest;
       ptype_attributes;
       ptype_loc} =
    iter_loc sub ptype_name;
    List.iter (iter_fst (sub.typ sub)) ptype_params;
    List.iter
      (iter_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
      ptype_cstrs;
    sub.type_kind sub ptype_kind;
    iter_opt (sub.typ sub) ptype_manifest;
    sub.location sub ptype_loc;
    sub.attributes sub ptype_attributes

  let iter_type_kind sub = function
    | Ptype_abstract -> ()
    | Ptype_variant l ->
        List.iter (sub.constructor_declaration sub) l
    | Ptype_record l -> List.iter (sub.label_declaration sub) l
    | Ptype_open -> ()

  let iter_constructor_arguments sub l = List.iter (sub.typ sub) l
      (*# no inline record in 4.02.3*)
  let iter_type_extension sub
      {ptyext_path; ptyext_params;
       ptyext_constructors;
       ptyext_private = _;
       ptyext_attributes} =
    iter_loc sub ptyext_path;
    List.iter (sub.extension_constructor sub) ptyext_constructors;
    List.iter (iter_fst (sub.typ sub)) ptyext_params;
    sub.attributes sub ptyext_attributes

  let iter_extension_constructor_kind sub = function
      Pext_decl(ctl, cto) ->
        iter_constructor_arguments sub ctl; iter_opt (sub.typ sub) cto
    | Pext_rebind li ->
        iter_loc sub li

  let iter_extension_constructor sub
      {pext_name;
       pext_kind;
       pext_loc;
       pext_attributes} =
    iter_loc sub pext_name;
    iter_extension_constructor_kind sub pext_kind;
    sub.location sub pext_loc;
    sub.attributes sub pext_attributes

end

module CT = struct
  (* Type expressions for the class language *)

  let iter sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pcty_constr (lid, tys) ->
        iter_loc sub lid; List.iter (sub.typ sub) tys
    | Pcty_signature x -> sub.class_signature sub x
    | Pcty_arrow (_lab, t, ct) ->
        sub.typ sub t; sub.class_type sub ct
    | Pcty_extension x -> sub.extension sub x

  let iter_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
    =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pctf_inherit ct -> sub.class_type sub ct
    | Pctf_val (_s, _m, _v, t) -> sub.typ sub t
    | Pctf_method (_s, _p, _v, t) -> sub.typ sub t
    | Pctf_constraint (t1, t2) ->
        sub.typ sub t1; sub.typ sub t2
    | Pctf_attribute x -> sub.attribute sub x
    | Pctf_extension x -> sub.extension sub x

  let iter_signature sub {pcsig_self; pcsig_fields} =
    sub.typ sub pcsig_self;
    List.iter (sub.class_type_field sub) pcsig_fields
end

module MT = struct
  (* Type expressions for the module language *)

  let iter sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pmty_ident s -> iter_loc sub s
    | Pmty_alias s -> iter_loc sub s
    | Pmty_signature sg -> sub.signature sub sg
    | Pmty_functor (s, mt1, mt2) ->
        iter_loc sub s;
        iter_opt (sub.module_type sub) mt1;
        sub.module_type sub mt2
    | Pmty_with (mt, l) ->
        sub.module_type sub mt;
        List.iter (sub.with_constraint sub) l
    | Pmty_typeof me -> sub.module_expr sub me
    | Pmty_extension x -> sub.extension sub x

  let iter_with_constraint sub = function
    | Pwith_type (lid, d) ->
        iter_loc sub lid; sub.type_declaration sub d
    | Pwith_module (lid, lid2) ->
        iter_loc sub lid; iter_loc sub lid2
    | Pwith_typesubst d -> sub.type_declaration sub d
    | Pwith_modsubst (s, lid) ->
        iter_loc sub s; iter_loc sub lid

  let iter_signature_item sub {psig_desc = desc; psig_loc = loc} =
    sub.location sub loc;
    match desc with
    | Psig_value vd -> sub.value_description sub vd
    | Psig_type ( l) -> List.iter (sub.type_declaration sub) l
    (*#2 no rec_flag in 4.02.3*)
    | Psig_typext te -> sub.type_extension sub te
    | Psig_exception ed -> sub.extension_constructor sub ed
    | Psig_module x -> sub.module_declaration sub x
    | Psig_recmodule l ->
        List.iter (sub.module_declaration sub) l
    | Psig_modtype x -> sub.module_type_declaration sub x
    | Psig_open x -> sub.open_description sub x
    | Psig_include x -> sub.include_description sub x
    | Psig_class l -> List.iter (sub.class_description sub) l
    | Psig_class_type l ->
        List.iter (sub.class_type_declaration sub) l
    | Psig_extension (x, attrs) ->
        sub.extension sub x; sub.attributes sub attrs
    | Psig_attribute x -> sub.attribute sub x
end


module M = struct
  (* Value expressions for the module language *)

  let iter sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pmod_ident x -> iter_loc sub x
    | Pmod_structure str -> sub.structure sub str
    | Pmod_functor (arg, arg_ty, body) ->
        iter_loc sub arg;
        iter_opt (sub.module_type sub) arg_ty;
        sub.module_expr sub body
    | Pmod_apply (m1, m2) ->
        sub.module_expr sub m1; sub.module_expr sub m2
    | Pmod_constraint (m, mty) ->
        sub.module_expr sub m; sub.module_type sub mty
    | Pmod_unpack e -> sub.expr sub e
    | Pmod_extension x -> sub.extension sub x

  let iter_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
    sub.location sub loc;
    match desc with
    | Pstr_eval (x, attrs) ->
        sub.expr sub x; sub.attributes sub attrs
    | Pstr_value (_r, vbs) -> List.iter (sub.value_binding sub) vbs
    | Pstr_primitive vd -> sub.value_description sub vd
    | Pstr_type ( l) -> List.iter (sub.type_declaration sub) l
    (*#3 no rec flag in 4.02.3*)
    | Pstr_typext te -> sub.type_extension sub te
    | Pstr_exception ed -> sub.extension_constructor sub ed
    | Pstr_module x -> sub.module_binding sub x
    | Pstr_recmodule l -> List.iter (sub.module_binding sub) l
    | Pstr_modtype x -> sub.module_type_declaration sub x
    | Pstr_open x -> sub.open_description sub x
    | Pstr_class l -> List.iter (sub.class_declaration sub) l
    | Pstr_class_type l ->
        List.iter (sub.class_type_declaration sub) l
    | Pstr_include x -> sub.include_declaration sub x
    | Pstr_extension (x, attrs) ->
        sub.extension sub x; sub.attributes sub attrs
    | Pstr_attribute x -> sub.attribute sub x
end

module E = struct
  (* Value expressions for the core language *)

  let iter sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pexp_ident x -> iter_loc sub x
    | Pexp_constant _ -> ()
    | Pexp_let (_r, vbs, e) ->
        List.iter (sub.value_binding sub) vbs;
        sub.expr sub e
    | Pexp_fun (_lab, def, p, e) ->
        iter_opt (sub.expr sub) def;
        sub.pat sub p;
        sub.expr sub e
    | Pexp_function pel -> sub.cases sub pel
    | Pexp_apply (e, l) ->
        sub.expr sub e; List.iter (iter_snd (sub.expr sub)) l
    | Pexp_match (e, pel) ->
        sub.expr sub e; sub.cases sub pel
    | Pexp_try (e, pel) -> sub.expr sub e; sub.cases sub pel
    | Pexp_tuple el -> List.iter (sub.expr sub) el
    | Pexp_construct (lid, arg) ->
        iter_loc sub lid; iter_opt (sub.expr sub) arg
    | Pexp_variant (_lab, eo) ->
        iter_opt (sub.expr sub) eo
    | Pexp_record (l, eo) ->
        List.iter (iter_tuple (iter_loc sub) (sub.expr sub)) l;
        iter_opt (sub.expr sub) eo
    | Pexp_field (e, lid) ->
        sub.expr sub e; iter_loc sub lid
    | Pexp_setfield (e1, lid, e2) ->
        sub.expr sub e1; iter_loc sub lid;
        sub.expr sub e2
    | Pexp_array el -> List.iter (sub.expr sub) el
    | Pexp_ifthenelse (e1, e2, e3) ->
        sub.expr sub e1; sub.expr sub e2;
        iter_opt (sub.expr sub) e3
    | Pexp_sequence (e1, e2) ->
        sub.expr sub e1; sub.expr sub e2
    | Pexp_while (e1, e2) ->
        sub.expr sub e1; sub.expr sub e2
    | Pexp_for (p, e1, e2, _d, e3) ->
        sub.pat sub p; sub.expr sub e1; sub.expr sub e2;
        sub.expr sub e3
    | Pexp_coerce (e, t1, t2) ->
        sub.expr sub e; iter_opt (sub.typ sub) t1;
        sub.typ sub t2
    | Pexp_constraint (e, t) ->
        sub.expr sub e; sub.typ sub t
    | Pexp_send (e, _s) -> sub.expr sub e
    | Pexp_new lid -> iter_loc sub lid
    | Pexp_setinstvar (s, e) ->
        iter_loc sub s; sub.expr sub e
    | Pexp_override sel ->
        List.iter (iter_tuple (iter_loc sub) (sub.expr sub)) sel
    | Pexp_letmodule (s, me, e) ->
        iter_loc sub s; sub.module_expr sub me;
        sub.expr sub e
    (* | Pexp_letexception (cd, e) -> *)
    (*     sub.extension_constructor sub cd; *)
    (*     sub.expr sub e *)
    (* no local exception *)
    | Pexp_assert e -> sub.expr sub e
    | Pexp_lazy e -> sub.expr sub e
    | Pexp_poly (e, t) ->
        sub.expr sub e; iter_opt (sub.typ sub) t
    | Pexp_object cls -> sub.class_structure sub cls
    | Pexp_newtype (_s, e) -> sub.expr sub e
    | Pexp_pack me -> sub.module_expr sub me
    | Pexp_open (_ovf, lid, e) ->
        iter_loc sub lid; sub.expr sub e
    | Pexp_extension x -> sub.extension sub x
    (* | Pexp_unreachable -> () *)
end

module P = struct
  (* Patterns *)

  let iter sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Ppat_any -> ()
    | Ppat_var s -> iter_loc sub s
    | Ppat_alias (p, s) -> sub.pat sub p; iter_loc sub s
    | Ppat_constant _ -> ()
    | Ppat_interval _ -> ()
    | Ppat_tuple pl -> List.iter (sub.pat sub) pl
    | Ppat_construct (l, p) ->
        iter_loc sub l; iter_opt (sub.pat sub) p
    | Ppat_variant (_l, p) -> iter_opt (sub.pat sub) p
    | Ppat_record (lpl, _cf) ->
        List.iter (iter_tuple (iter_loc sub) (sub.pat sub)) lpl
    | Ppat_array pl -> List.iter (sub.pat sub) pl
    | Ppat_or (p1, p2) -> sub.pat sub p1; sub.pat sub p2
    | Ppat_constraint (p, t) ->
        sub.pat sub p; sub.typ sub t
    | Ppat_type s -> iter_loc sub s
    | Ppat_lazy p -> sub.pat sub p
    | Ppat_unpack s -> iter_loc sub s
    | Ppat_exception p -> sub.pat sub p
    | Ppat_extension x -> sub.extension sub x
    (* | Ppat_open (lid, p) -> *)
    (*     iter_loc sub lid; sub.pat sub p *)

end

module CE = struct
  (* Value expressions for the class language *)

  let iter sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pcl_constr (lid, tys) ->
        iter_loc sub lid; List.iter (sub.typ sub) tys
    | Pcl_structure s ->
        sub.class_structure sub s
    | Pcl_fun (_lab, e, p, ce) ->
        iter_opt (sub.expr sub) e;
        sub.pat sub p;
        sub.class_expr sub ce
    | Pcl_apply (ce, l) ->
        sub.class_expr sub ce;
        List.iter (iter_snd (sub.expr sub)) l
    | Pcl_let (_r, vbs, ce) ->
        List.iter (sub.value_binding sub) vbs;
        sub.class_expr sub ce
    | Pcl_constraint (ce, ct) ->
        sub.class_expr sub ce; sub.class_type sub ct
    | Pcl_extension x -> sub.extension sub x

  let iter_kind sub = function
    | Cfk_concrete (_o, e) -> sub.expr sub e
    | Cfk_virtual t -> sub.typ sub t

  let iter_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
    sub.location sub loc;
    sub.attributes sub attrs;
    match desc with
    | Pcf_inherit (_o, ce, _s) -> sub.class_expr sub ce
    | Pcf_val (s, _m, k) -> iter_loc sub s; iter_kind sub k
    | Pcf_method (s, _p, k) ->
        iter_loc sub s; iter_kind sub k
    | Pcf_constraint (t1, t2) ->
        sub.typ sub t1; sub.typ sub t2
    | Pcf_initializer e -> sub.expr sub e
    | Pcf_attribute x -> sub.attribute sub x
    | Pcf_extension x -> sub.extension sub x

  let iter_structure sub {pcstr_self; pcstr_fields} =
    sub.pat sub pcstr_self;
    List.iter (sub.class_field sub) pcstr_fields

  let class_infos sub f {pci_virt = _; pci_params = pl; pci_name; pci_expr;
                         pci_loc; pci_attributes} =
    List.iter (iter_fst (sub.typ sub)) pl;
    iter_loc sub pci_name;
    f pci_expr;
    sub.location sub pci_loc;
    sub.attributes sub pci_attributes
end

(* Now, a generic AST mapper, to be extended to cover all kinds and
   cases of the OCaml grammar.  The default behavior of the mapper is
   the identity. *)

let default_iterator =
  {
    structure = (fun this l -> List.iter (this.structure_item this) l);
    structure_item = M.iter_structure_item;
    module_expr = M.iter;
    signature = (fun this l -> List.iter (this.signature_item this) l);
    signature_item = MT.iter_signature_item;
    module_type = MT.iter;
    with_constraint = MT.iter_with_constraint;
    class_declaration =
      (fun this -> CE.class_infos this (this.class_expr this));
    class_expr = CE.iter;
    class_field = CE.iter_field;
    class_structure = CE.iter_structure;
    class_type = CT.iter;
    class_type_field = CT.iter_field;
    class_signature = CT.iter_signature;
    class_type_declaration =
      (fun this -> CE.class_infos this (this.class_type this));
    class_description =
      (fun this -> CE.class_infos this (this.class_type this));
    type_declaration = T.iter_type_declaration;
    type_kind = T.iter_type_kind;
    typ = T.iter;
    type_extension = T.iter_type_extension;
    extension_constructor = T.iter_extension_constructor;
    value_description =
      (fun this {pval_name; pval_type; pval_prim = _; pval_loc;
                 pval_attributes} ->
        iter_loc this pval_name;
        this.typ this pval_type;
        this.attributes this pval_attributes;
        this.location this pval_loc
      );

    pat = P.iter;
    expr = E.iter;

    module_declaration =
      (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
         iter_loc this pmd_name;
         this.module_type this pmd_type;
         this.attributes this pmd_attributes;
         this.location this pmd_loc
      );

    module_type_declaration =
      (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
         iter_loc this pmtd_name;
         iter_opt (this.module_type this) pmtd_type;
         this.attributes this pmtd_attributes;
         this.location this pmtd_loc
      );

    module_binding =
      (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
         iter_loc this pmb_name; this.module_expr this pmb_expr;
         this.attributes this pmb_attributes;
         this.location this pmb_loc
      );


    open_description =
      (fun this {popen_lid; popen_override = _; popen_attributes; popen_loc} ->
         iter_loc this popen_lid;
         this.location this popen_loc;
         this.attributes this popen_attributes
      );


    include_description =
      (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
         this.module_type this pincl_mod;
         this.location this pincl_loc;
         this.attributes this pincl_attributes
      );

    include_declaration =
      (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
         this.module_expr this pincl_mod;
         this.location this pincl_loc;
         this.attributes this pincl_attributes
      );


    value_binding =
      (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
         this.pat this pvb_pat;
         this.expr this pvb_expr;
         this.location this pvb_loc;
         this.attributes this pvb_attributes
      );


    constructor_declaration =
      (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
         iter_loc this pcd_name;
         T.iter_constructor_arguments this pcd_args;
         iter_opt (this.typ this) pcd_res;
         this.location this pcd_loc;
         this.attributes this pcd_attributes
      );

    label_declaration =
      (fun this {pld_name; pld_type; pld_loc; pld_mutable = _; pld_attributes}->
         iter_loc this pld_name;
         this.typ this pld_type;
         this.location this pld_loc;
         this.attributes this pld_attributes
      );

    cases = (fun this l -> List.iter (this.case this) l);
    case =
      (fun this {pc_lhs; pc_guard; pc_rhs} ->
         this.pat this pc_lhs;
         iter_opt (this.expr this) pc_guard;
         this.expr this pc_rhs
      );

    location = (fun _this _l -> ());

    extension = (fun this (s, e) -> iter_loc this s; this.payload this e);
    attribute = (fun this (s, e) -> iter_loc this s; this.payload this e);
    attributes = (fun this l -> List.iter (this.attribute this) l);
    payload =
      (fun this -> function
         | PStr x -> this.structure this x
         (* | PSig x -> this.signature this x *)
         | PTyp x -> this.typ this x
         | PPat (x, g) -> this.pat this x; iter_opt (this.expr this) g
      );
  }

end
module Js_config : sig 
#1 "js_config.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)





(* val get_packages_info :
   unit -> Js_packages_info.t *)


(** set/get header *)
val no_version_header : bool ref 


(** return [package_name] and [path] 
    when in script mode: 
*)

(* val get_current_package_name_and_path : 
  Js_packages_info.module_system -> 
  Js_packages_info.info_query *)


(* val set_package_name : string -> unit  
val get_package_name : unit -> string option *)

(** cross module inline option *)
val cross_module_inline : bool ref
val set_cross_module_inline : bool -> unit
val get_cross_module_inline : unit -> bool
  
(** diagnose option *)
val diagnose : bool ref 
val get_diagnose : unit -> bool 
val set_diagnose : bool -> unit 


(** options for builtin ppx *)
val no_builtin_ppx_ml : bool ref 
val no_builtin_ppx_mli : bool ref 



val no_warn_unimplemented_external : bool ref 

(** check-div-by-zero option *)
val check_div_by_zero : bool ref 
val get_check_div_by_zero : unit -> bool 





(** Debugging utilies *)
val set_current_file : string -> unit 
val get_current_file : unit -> string
val get_module_name : unit -> string

val iset_debug_file : string -> unit
val set_debug_file : string -> unit
val get_debug_file : unit -> string

val is_same_file : unit -> bool 

val tool_name : string


val sort_imports : bool ref 
val dump_js : bool ref
val syntax_only  : bool ref
val binary_ast : bool ref


val bs_suffix : bool ref
val debug : bool ref
end = struct
#1 "js_config.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)






(* let add_npm_package_path s =
  match !packages_info  with
  | Empty ->
    Ext_pervasives.bad_argf "please set package name first using -bs-package-name ";
  | NonBrowser(name,  envs) ->
    let env, path =
      match Ext_string.split ~keep_empty:false s ':' with
      | [ package_name; path]  ->
        (match Js_packages_info.module_system_of_string package_name with
         | Some x -> x
         | None ->
           Ext_pervasives.bad_argf "invalid module system %s" package_name), path
      | [path] ->
        NodeJS, path
      | _ ->
        Ext_pervasives.bad_argf "invalid npm package path: %s" s
    in
    packages_info := NonBrowser (name,  ((env,path) :: envs)) *)
(** Browser is not set via command line only for internal use *)


let no_version_header = ref false

let cross_module_inline = ref false

let get_cross_module_inline () = !cross_module_inline
let set_cross_module_inline b =
  cross_module_inline := b


let diagnose = ref false
let get_diagnose () = !diagnose
let set_diagnose b = diagnose := b

let (//) = Filename.concat

(* let get_packages_info () = !packages_info *)

let no_builtin_ppx_ml = ref false
let no_builtin_ppx_mli = ref false


(** TODO: will flip the option when it is ready *)
let no_warn_unimplemented_external = ref false 
let current_file = ref ""
let debug_file = ref ""

let set_current_file f  = current_file := f
let get_current_file () = !current_file
let get_module_name () =
  Filename.chop_extension
    (Filename.basename (Ext_string.uncapitalize_ascii !current_file))

let iset_debug_file _ = ()
let set_debug_file  f = debug_file := f
let get_debug_file  () = !debug_file


let is_same_file () =
  !debug_file <> "" &&  !debug_file = !current_file

let tool_name = "BuckleScript"

let check_div_by_zero = ref true
let get_check_div_by_zero () = !check_div_by_zero




let sort_imports = ref true
let dump_js = ref false



let syntax_only = ref false
let binary_ast = ref false

let bs_suffix = ref false 

let debug = ref false
end
module Bs_warnings : sig 
#1 "bs_warnings.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type t =
  | Unsafe_poly_variant_type

val prerr_bs_ffi_warning : Location.t -> t -> unit


val warn_missing_primitive : Location.t -> string -> unit 

val warn_literal_overflow : Location.t -> unit 

val error_unescaped_delimiter : 
  Location.t -> string  -> unit 
end = struct
#1 "bs_warnings.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



type t =
  | Unsafe_poly_variant_type
  (* for users write code like this:
     {[ external f : [`a of int ] -> string = ""]}
     Here users forget about `[@bs.string]` or `[@bs.int]`
  *)    



let to_string t =
  match t with
  | Unsafe_poly_variant_type 
    -> 
    "Here a OCaml polymorphic variant type passed into JS, probably you forgot annotations like `[@bs.int]` or `[@bs.string]`  "

let warning_formatter = Format.err_formatter

let print_string_warning (loc : Location.t) x =   
  if loc.loc_ghost then 
    Format.fprintf warning_formatter "File %s@." 
      (Js_config.get_current_file ())
  else 
    Location.print warning_formatter loc ; 
  Format.fprintf warning_formatter "@{<error>Warning@}: %s@." x 

let prerr_bs_ffi_warning loc x =  
    Location.prerr_warning loc (Warnings.Bs_ffi_warning (to_string x))

let unimplemented_primitive = "Unimplemented primitive used:" 
type error = 
  | Uninterpreted_delimiters of string
  | Unimplemented_primitive of string 
exception  Error of Location.t * error

let pp_error fmt x =
  match x with 
  | Unimplemented_primitive str -> 
    Format.pp_print_string fmt unimplemented_primitive;
    Format.pp_print_string fmt str
  
  | Uninterpreted_delimiters str -> 
    Format.pp_print_string fmt "Uninterpreted delimiters" ;
    Format.pp_print_string fmt str



let () = 
  Location.register_error_of_exn (function 
      | Error (loc,err) -> 
        Some (Location.error_of_printer loc pp_error err)
      | _ -> None
    )




let warn_missing_primitive loc txt =      
  if not @@ !Js_config.no_warn_unimplemented_external then
    begin 
      print_string_warning loc ( unimplemented_primitive ^ txt ^ " \n" );
      Format.pp_print_flush warning_formatter ()
    end

let warn_literal_overflow loc = 
  begin 
    print_string_warning loc 
      "Integer literal exceeds the range of representable integers of type int";
    Format.pp_print_flush warning_formatter ()  
  end 

let error_unescaped_delimiter loc txt = 
  raise (Error(loc, Uninterpreted_delimiters txt))






(**
   Note the standard way of reporting error in compiler:

   val Location.register_error_of_exn : (exn -> Location.error option) -> unit 
   val Location.error_of_printer : Location.t ->
   (Format.formatter -> error -> unit) -> error -> Location.error

   Define an error type

   type error 
   exception Error of Location.t * error 

   Provide a printer to error

   {[
     let () = 
       Location.register_error_of_exn
         (function 
           | Error(loc,err) -> 
             Some (Location.error_of_printer loc pp_error err)
           | _ -> None
         )
   ]}
*)

end
module Ext_array : sig 
#1 "ext_array.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)






(** Some utilities for {!Array} operations *)
val reverse_range : 'a array -> int -> int -> unit
val reverse_in_place : 'a array -> unit
val reverse : 'a array -> 'a array 
val reverse_of_list : 'a list -> 'a array

val filter : ('a -> bool) -> 'a array -> 'a array

val filter_map : ('a -> 'b option) -> 'a array -> 'b array

val range : int -> int -> int array

val map2i : (int -> 'a -> 'b -> 'c ) -> 'a array -> 'b array -> 'c array

val to_list_f : ('a -> 'b) -> 'a array -> 'b list 
val to_list_map : ('a -> 'b option) -> 'a array -> 'b list 

val to_list_map_acc : 
  ('a -> 'b option) -> 
  'a array -> 
  'b list -> 
  'b list 

val of_list_map : 
  'a list -> 
  ('a -> 'b) -> 
  'b array 

val rfind_with_index : 'a array -> ('a -> 'b -> bool) -> 'b -> int


type 'a split = [ `No_split | `Split of 'a array * 'a array ]

val rfind_and_split : 
  'a array ->
  ('a -> 'b -> bool) ->
  'b -> 'a split

val find_and_split : 
  'a array ->
  ('a -> 'b -> bool) ->
  'b -> 'a split

val exists : ('a -> bool) -> 'a array -> bool 

val is_empty : 'a array -> bool 

val for_all2_no_exn : 
  ('a -> 'b -> bool) -> 
  'a array ->
  'b array -> 
  bool

val map :   
  'a array -> 
  ('a -> 'b) -> 
  'b array

val iter :
  'a array -> 
  ('a -> unit) -> 
  unit
end = struct
#1 "ext_array.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)





let reverse_range a i len =
  if len = 0 then ()
  else
    for k = 0 to (len-1)/2 do
      let t = Array.unsafe_get a (i+k) in
      Array.unsafe_set a (i+k) ( Array.unsafe_get a (i+len-1-k));
      Array.unsafe_set a (i+len-1-k) t;
    done


let reverse_in_place a =
  reverse_range a 0 (Array.length a)

let reverse a =
  let b_len = Array.length a in
  if b_len = 0 then [||] else  
    let b = Array.copy a in  
    for i = 0 to  b_len - 1 do
      Array.unsafe_set b i (Array.unsafe_get a (b_len - 1 -i )) 
    done;
    b  

let reverse_of_list =  function
  | [] -> [||]
  | hd::tl as l ->
    let len = List.length l in
    let a = Array.make len hd in
    let rec fill i = function
      | [] -> a
      | hd::tl -> Array.unsafe_set a (len - i - 2) hd; fill (i+1) tl in
    fill 0 tl

let filter f a =
  let arr_len = Array.length a in
  let rec aux acc i =
    if i = arr_len 
    then reverse_of_list acc 
    else
      let v = Array.unsafe_get a i in
      if f  v then 
        aux (v::acc) (i+1)
      else aux acc (i + 1) 
  in aux [] 0


let filter_map (f : _ -> _ option) a =
  let arr_len = Array.length a in
  let rec aux acc i =
    if i = arr_len 
    then reverse_of_list acc 
    else
      let v = Array.unsafe_get a i in
      match f  v with 
      | Some v -> 
        aux (v::acc) (i+1)
      | None -> 
        aux acc (i + 1) 
  in aux [] 0

let range from to_ =
  if from > to_ then invalid_arg "Ext_array.range"  
  else Array.init (to_ - from + 1) (fun i -> i + from)

let map2i f a b = 
  let len = Array.length a in 
  if len <> Array.length b then 
    invalid_arg "Ext_array.map2i"  
  else
    Array.mapi (fun i a -> f i  a ( Array.unsafe_get b i )) a 

let rec tolist_f_aux a f  i res =
  if i < 0 then res else
    let v = Array.unsafe_get a i in
    tolist_f_aux a f  (i - 1)
      (f v :: res)
       
let to_list_f f a = tolist_f_aux a f (Array.length a  - 1) []

let rec tolist_aux a f  i res =
  if i < 0 then res else
    let v = Array.unsafe_get a i in
    tolist_aux a f  (i - 1)
      (match f v with
       | Some v -> v :: res
       | None -> res) 

let to_list_map f a = 
  tolist_aux a f (Array.length a - 1) []

let to_list_map_acc f a acc = 
  tolist_aux a f (Array.length a - 1) acc


let of_list_map a f = 
  match a with 
  | [] -> [||]
  | [a0] -> 
    let b0 = f a0 in
    [|b0|]
  | [a0;a1] -> 
    let b0 = f a0 in  
    let b1 = f a1 in 
    [|b0;b1|]
  | [a0;a1;a2] -> 
    let b0 = f a0 in  
    let b1 = f a1 in 
    let b2 = f a2 in  
    [|b0;b1;b2|]
  | [a0;a1;a2;a3] -> 
    let b0 = f a0 in  
    let b1 = f a1 in 
    let b2 = f a2 in  
    let b3 = f a3 in 
    [|b0;b1;b2;b3|]
  | [a0;a1;a2;a3;a4] -> 
    let b0 = f a0 in  
    let b1 = f a1 in 
    let b2 = f a2 in  
    let b3 = f a3 in 
    let b4 = f a4 in 
    [|b0;b1;b2;b3;b4|]

  | a0::a1::a2::a3::a4::tl -> 
    let b0 = f a0 in  
    let b1 = f a1 in 
    let b2 = f a2 in  
    let b3 = f a3 in 
    let b4 = f a4 in 
    let len = List.length tl + 5 in 
    let arr = Array.make len b0  in
    Array.unsafe_set arr 1 b1 ;  
    Array.unsafe_set arr 2 b2 ;
    Array.unsafe_set arr 3 b3 ; 
    Array.unsafe_set arr 4 b4 ; 
    let rec fill i = function
      | [] -> arr 
      | hd :: tl -> 
        Array.unsafe_set arr i (f hd); 
        fill (i + 1) tl in 
    fill 5 tl

(**
   {[
     # rfind_with_index [|1;2;3|] (=) 2;;
     - : int = 1
               # rfind_with_index [|1;2;3|] (=) 1;;
     - : int = 0
               # rfind_with_index [|1;2;3|] (=) 3;;
     - : int = 2
               # rfind_with_index [|1;2;3|] (=) 4;;
     - : int = -1
   ]}
*)
let rfind_with_index arr cmp v = 
  let len = Array.length arr in 
  let rec aux i = 
    if i < 0 then i
    else if  cmp (Array.unsafe_get arr i) v then i
    else aux (i - 1) in 
  aux (len - 1)

type 'a split = [ `No_split | `Split of 'a array * 'a array ]
let rfind_and_split arr cmp v : _ split = 
  let i = rfind_with_index arr cmp v in 
  if  i < 0 then 
    `No_split 
  else 
    `Split (Array.sub arr 0 i , Array.sub arr  (i + 1 ) (Array.length arr - i - 1 ))


let find_with_index arr cmp v = 
  let len  = Array.length arr in 
  let rec aux i len = 
    if i >= len then -1 
    else if cmp (Array.unsafe_get arr i ) v then i 
    else aux (i + 1) len in 
  aux 0 len

let find_and_split arr cmp v : _ split = 
  let i = find_with_index arr cmp v in 
  if i < 0 then 
    `No_split
  else
    `Split (Array.sub arr 0 i, Array.sub arr (i + 1 ) (Array.length arr - i - 1))        

(** TODO: available since 4.03, use {!Array.exists} *)

let exists p a =
  let n = Array.length a in
  let rec loop i =
    if i = n then false
    else if p (Array.unsafe_get a i) then true
    else loop (succ i) in
  loop 0


let is_empty arr =
  Array.length arr = 0


let rec unsafe_loop index len p xs ys  = 
  if index >= len then true
  else 
    p 
      (Array.unsafe_get xs index)
      (Array.unsafe_get ys index) &&
    unsafe_loop (succ index) len p xs ys 

let for_all2_no_exn p xs ys = 
  let len_xs = Array.length xs in 
  let len_ys = Array.length ys in 
  len_xs = len_ys &&    
  unsafe_loop 0 len_xs p xs ys


let map a f =
  let open Array in 
  let l = length a in
  if l = 0 then [||] else begin
    let r = make l (f(unsafe_get a 0)) in
    for i = 1 to l - 1 do
      unsafe_set r i (f(unsafe_get a i))
    done;
    r
  end

let iter a f =
  let open Array in 
  for i = 0 to length a - 1 do f(unsafe_get a i) done

end
module Ext_util : sig 
#1 "ext_util.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


 
val power_2_above : int -> int -> int


val stats_to_string : Hashtbl.statistics -> string 
end = struct
#1 "ext_util.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(**
   {[
     (power_2_above 16 63 = 64)
       (power_2_above 16 76 = 128)
   ]}
*)
let rec power_2_above x n =
  if x >= n then x
  else if x * 2 > Sys.max_array_length then x
  else power_2_above (x * 2) n


let stats_to_string ({num_bindings; num_buckets; max_bucket_length; bucket_histogram} : Hashtbl.statistics) = 
  Printf.sprintf 
    "bindings: %d,buckets: %d, longest: %d, hist:[%s]" 
    num_bindings 
    num_buckets 
    max_bucket_length
    (String.concat "," (Array.to_list (Array.map string_of_int bucket_histogram)))
end
module Hash_set_gen
= struct
#1 "hash_set_gen.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


(* We do dynamic hashing, and resize the table and rehash the elements
   when buckets become too long. *)

type 'a t =
  { mutable size: int;                        (* number of entries *)
    mutable data: 'a list array;  (* the buckets *)
    initial_size: int;                        (* initial array size *)
  }




let create  initial_size =
  let s = Ext_util.power_2_above 16 initial_size in
  { initial_size = s; size = 0; data = Array.make s [] }

let clear h =
  h.size <- 0;
  let len = Array.length h.data in
  for i = 0 to len - 1 do
    Array.unsafe_set h.data i  []
  done

let reset h =
  h.size <- 0;
  h.data <- Array.make h.initial_size [ ]


let copy h = { h with data = Array.copy h.data }

let length h = h.size

let iter f h =
  let rec do_bucket = function
    | [ ] ->
      ()
    | k ::  rest ->
      f k ; do_bucket rest in
  let d = h.data in
  for i = 0 to Array.length d - 1 do
    do_bucket (Array.unsafe_get d i)
  done

let fold f h init =
  let rec do_bucket b accu =
    match b with
      [ ] ->
      accu
    | k ::  rest ->
      do_bucket rest (f k  accu) in
  let d = h.data in
  let accu = ref init in
  for i = 0 to Array.length d - 1 do
    accu := do_bucket (Array.unsafe_get d i) !accu
  done;
  !accu

let resize indexfun h =
  let odata = h.data in
  let osize = Array.length odata in
  let nsize = osize * 2 in
  if nsize < Sys.max_array_length then begin
    let ndata = Array.make nsize [ ] in
    h.data <- ndata;          (* so that indexfun sees the new bucket count *)
    let rec insert_bucket = function
        [ ] -> ()
      | key :: rest ->
        let nidx = indexfun h key in
        ndata.(nidx) <- key :: ndata.(nidx);
        insert_bucket rest
    in
    for i = 0 to osize - 1 do
      insert_bucket (Array.unsafe_get odata i)
    done
  end

let elements set = 
  fold  (fun k  acc ->  k :: acc) set []




let stats h =
  let mbl =
    Array.fold_left (fun m b -> max m (List.length b)) 0 h.data in
  let histo = Array.make (mbl + 1) 0 in
  Ext_array.iter h.data
    (fun b ->
       let l = List.length b in
       histo.(l) <- histo.(l) + 1)
    ;
  {Hashtbl.num_bindings = h.size;
   num_buckets = Array.length h.data;
   max_bucket_length = mbl;
   bucket_histogram = histo }

let rec small_bucket_mem eq_key key lst =
  match lst with 
  | [] -> false 
  | key1::rest -> 
    eq_key key   key1 ||
    match rest with 
    | [] -> false 
    | key2 :: rest -> 
      eq_key key   key2 ||
      match rest with 
      | [] -> false 
      | key3 :: rest -> 
        eq_key key   key3 ||
        small_bucket_mem eq_key key rest 

let rec remove_bucket eq_key key (h : _ t) buckets = 
  match buckets with 
  | [ ] ->
    [ ]
  | k :: next ->
    if  eq_key k   key
    then begin h.size <- h.size - 1; next end
    else k :: remove_bucket eq_key key h next    

module type S =
sig
  type key
  type t
  val create: int ->  t
  val clear : t -> unit
  val reset : t -> unit
  val copy: t -> t
  val remove:  t -> key -> unit
  val add :  t -> key -> unit
  val of_array : key array -> t 
  val check_add : t -> key -> bool
  val mem :  t -> key -> bool
  val iter: (key -> unit) ->  t -> unit
  val fold: (key -> 'b -> 'b) ->  t -> 'b -> 'b
  val length:  t -> int
  val stats:  t -> Hashtbl.statistics
  val elements : t -> key list 
end

end
module Hash_set_poly : sig 
#1 "hash_set_poly.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type   'a t 

val create : int -> 'a t

val clear : 'a t -> unit

val reset : 'a t -> unit

val copy : 'a t -> 'a t

val add : 'a t -> 'a  -> unit
val remove : 'a t -> 'a -> unit

val mem : 'a t -> 'a -> bool

val iter : ('a -> unit) -> 'a t -> unit

val elements : 'a t -> 'a list

val length : 'a t -> int 

val stats:  'a t -> Hashtbl.statistics

end = struct
#1 "hash_set_poly.ml"
# 1 "ext/hash_set.cppo.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
# 51 "ext/hash_set.cppo.ml"
[@@@ocaml.warning "-3"]
(* we used cppo the mixture does not work*)
external seeded_hash_param :
  int -> int -> int -> 'a -> int = "caml_hash" "noalloc"
let key_index (h :  _ Hash_set_gen.t ) (key : 'a) =
  seeded_hash_param 10 100 0 key land (Array.length h.data - 1)
let eq_key = (=)
type  'a t = 'a Hash_set_gen.t 


# 64 "ext/hash_set.cppo.ml"
let create = Hash_set_gen.create
let clear = Hash_set_gen.clear
let reset = Hash_set_gen.reset
let copy = Hash_set_gen.copy
let iter = Hash_set_gen.iter
let fold = Hash_set_gen.fold
let length = Hash_set_gen.length
let stats = Hash_set_gen.stats
let elements = Hash_set_gen.elements



let remove (h : _ Hash_set_gen.t) key =  
  let i = key_index h key in
  let h_data = h.data in
  let old_h_size = h.size in 
  let new_bucket = Hash_set_gen.remove_bucket eq_key key h (Array.unsafe_get h_data i) in
  if old_h_size <> h.size then  
    Array.unsafe_set h_data i new_bucket



let add (h : _ Hash_set_gen.t) key =
  let i = key_index h key  in 
  let h_data = h.data in 
  let old_bucket = (Array.unsafe_get h_data i) in
  if not (Hash_set_gen.small_bucket_mem eq_key key old_bucket) then 
    begin 
      Array.unsafe_set h_data i (key :: old_bucket);
      h.size <- h.size + 1 ;
      if h.size > Array.length h_data lsl 1 then Hash_set_gen.resize key_index h
    end

let of_array arr = 
  let len = Array.length arr in 
  let tbl = create len in 
  for i = 0 to len - 1  do
    add tbl (Array.unsafe_get arr i);
  done ;
  tbl 
  
    
let check_add (h : _ Hash_set_gen.t) key =
  let i = key_index h key  in 
  let h_data = h.data in  
  let old_bucket = (Array.unsafe_get h_data i) in
  if not (Hash_set_gen.small_bucket_mem eq_key key old_bucket) then 
    begin 
      Array.unsafe_set h_data i  (key :: old_bucket);
      h.size <- h.size + 1 ;
      if h.size > Array.length h_data lsl 1 then Hash_set_gen.resize key_index h;
      true 
    end
  else false 


let mem (h :  _ Hash_set_gen.t) key =
  Hash_set_gen.small_bucket_mem eq_key key (Array.unsafe_get h.data (key_index h key)) 

  

end
module Bs_ast_invariant : sig 
#1 "bs_ast_invariant.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type iterator = Bs_ast_iterator.iterator

val mark_used_bs_attribute : 
  Parsetree.attribute -> unit 

(** [warn_discarded_unused_attributes discarded]
  warn if [discarded] has unused bs attribute
*)  
val warn_discarded_unused_attributes :   
  Parsetree.attributes -> unit 
(** Ast invariant checking for detecting errors *)

val emit_external_warnings_on_structure:
  Parsetree.structure -> unit 

val emit_external_warnings_on_signature:  
  Parsetree.signature -> unit
end = struct
#1 "bs_ast_invariant.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


let is_bs_attribute txt = 
  let len = String.length txt  in
  len >= 2 &&
  (*TODO: check the stringing padding rule, this preciate may not be needed *)
  String.unsafe_get txt 0 = 'b'&& 
  String.unsafe_get txt 1 = 's' &&
  (len = 2 ||
   String.unsafe_get txt 2 = '.'
  )

let used_attributes : _ Hash_set_poly.t = Hash_set_poly.create 16 



(* only mark non-ghost used bs attribute *)
let mark_used_bs_attribute ((x,_) : Parsetree.attribute) = 
  if not x.loc.loc_ghost then
    Hash_set_poly.add used_attributes x

let dummy_unused_attribute : Warnings.t = (Bs_unused_attribute "")



let warn_unused_attribute 
  (({txt; loc} as sloc, _) : Parsetree.attribute) = 
  if is_bs_attribute txt && 
     not loc.loc_ghost &&
     not (Hash_set_poly.mem used_attributes sloc) then 
    begin    

      Location.prerr_warning loc (Bs_unused_attribute txt)
    end

let warn_discarded_unused_attributes (attrs : Parsetree.attributes) = 
  if attrs <> [] then 
    Ext_list.iter attrs warn_unused_attribute
    

type iterator = Bs_ast_iterator.iterator      
let default_iterator = Bs_ast_iterator.default_iterator

(* Note we only used Bs_ast_iterator here, we can reuse compiler-libs instead of 
   rolling our own*)
let emit_external_warnings : iterator=
  {
    default_iterator with
    attribute = (fun _ attr -> warn_unused_attribute attr);
    expr = (fun self a -> 
        match a.pexp_desc with 
        | Pexp_constant (
          
          Const_string 

          (_, Some s)) 
          when Ast_utf8_string_interp.is_unescaped s -> 
          Bs_warnings.error_unescaped_delimiter a.pexp_loc s 

        | _ -> default_iterator.expr self a 
      );
    value_description =
      (fun self v -> 
         match v with 
         | ( {
             pval_loc;
             pval_prim =
               "%identity"::_;
             pval_type
           } : Parsetree.value_description)
           when not
               (Ast_core_type.is_arity_one pval_type)
           -> 
           Location.raise_errorf
             ~loc:pval_loc
             "%%identity expect its type to be of form 'a -> 'b (arity 1)"
         | _ ->
           default_iterator.value_description self v 
      )
  }

let emit_external_warnings_on_structure  (stru : Parsetree.structure) = 
  if Warnings.is_active dummy_unused_attribute then 
    emit_external_warnings.structure emit_external_warnings stru

let emit_external_warnings_on_signature  (sigi : Parsetree.signature) = 
  if Warnings.is_active dummy_unused_attribute then 
    emit_external_warnings.signature emit_external_warnings sigi
end
module Ast_attributes : sig 
#1 "ast_attributes.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
type attr =  Parsetree.attribute
type t =  attr list

type ('a,'b) st =
  { get : 'a option ;
    set : 'b option }

val process_method_attributes_rev :
  t ->
  (bool * bool , [`Get | `No_get ]) st * t

type attr_kind = 
  | Nothing 
  | Meth_callback of attr 
  | Uncurry of attr  
  | Method of attr

val process_attributes_rev :
  t -> attr_kind * t

val process_pexp_fun_attributes_rev :
  t -> [ `Nothing | `Exn ] * t
val process_bs :
  t -> [ `Nothing | `Has] * t

val process_external : t -> bool

type derive_attr = {
  explict_nonrec : bool;
  bs_deriving : Ast_payload.action list option
}


val iter_process_bs_string_int_unwrap_uncurry :
  t -> 
  [`Nothing | `String | `Int | `Ignore | `Unwrap | `Uncurry of int option ]


val iter_process_bs_string_as :
  t -> string option

val iter_process_bs_string_as_ast :   
  t -> 
  Parsetree.expression option
  
val has_bs_optional :
  t -> bool 

val iter_process_bs_int_as :
  t -> int option


val iter_process_bs_string_or_int_as :
    t ->
    [ `Int of int
    | `Str of string
    | `Json_str of string  ] option


val process_derive_type :
  t -> derive_attr * t

val iter_process_derive_type :
  t -> derive_attr


val bs : attr
val is_bs : attr -> bool



val bs_get : attr
val bs_get_arity : attr 
val bs_set : attr
val bs_return_undefined : attr

val deprecated : string -> attr

end = struct
#1 "ast_attributes.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type attr =  Parsetree.attribute
type t =  attr list

type ('a,'b) st =
  { get : 'a option ;
    set : 'b option }


let process_method_attributes_rev (attrs : t) =
  List.fold_left (fun (st,acc) (({txt ; loc}, payload) as attr : attr) ->

      match txt  with
      | "bs.get" (* [@@bs.get{null; undefined}]*)
        ->
        let result =
          List.fold_left
            (fun
              (null, undefined)
              (({txt ; loc}, opt_expr) : Ast_payload.action) ->
              match txt with
              | "null" ->
                (match opt_expr with
                 | None -> true
                 | Some e ->
                   Ast_payload.assert_bool_lit e), undefined

              |  "undefined" ->
                null,
                (match opt_expr with
                 | None ->  true
                 | Some e ->
                   Ast_payload.assert_bool_lit e)
              | "nullable" ->
                begin match opt_expr with
                  | None -> true, true
                  | Some e ->
                    let v = Ast_payload.assert_bool_lit e in
                    v,v
                end
              | _ -> Bs_syntaxerr.err loc Unsupported_predicates
            ) (false, false)
            (Ast_payload.ident_or_record_as_config loc payload)  in

        ({st with get = Some result}, acc  )

      | "bs.set"
        ->
        let result =
          List.fold_left
            (fun st (({txt ; loc}, opt_expr) : Ast_payload.action) ->
               if txt =  "no_get" then
                 match opt_expr with
                 | None -> `No_get
                 | Some e ->
                   if Ast_payload.assert_bool_lit e then
                     `No_get
                   else `Get
               else Bs_syntaxerr.err loc Unsupported_predicates
            ) `Get (Ast_payload.ident_or_record_as_config loc payload)  in
        (* properties -- void
              [@@bs.set{only}]
        *)
        {st with set = Some result }, acc
      | _ ->
        (st, attr::acc  )
    ) ( {get = None ; set = None}, []) attrs

type attr_kind = 
  | Nothing 
  | Meth_callback of attr 
  | Uncurry of attr 
  | Method of attr

let process_attributes_rev (attrs : t) : attr_kind * t =
  List.fold_left (fun (st, acc) (({txt; loc}, _) as attr : attr) ->
      match txt, st  with
      | "bs", (Nothing | Uncurry _)
        ->
        Uncurry attr, acc (* TODO: warn unused/duplicated attribute *)
      | "bs.this", (Nothing | Meth_callback _)
        ->  Meth_callback attr, acc
      | "bs.meth",  (Nothing | Method _)
        -> Method attr, acc
      | "bs", _
      | "bs.this", _
        -> Bs_syntaxerr.err loc Conflict_bs_bs_this_bs_meth
      | _ , _ ->
        st, attr::acc
    ) ( Nothing, []) attrs

let process_pexp_fun_attributes_rev (attrs : t) =
  List.fold_left (fun (st, acc) (({txt; loc}, _) as attr : attr) ->
      match txt, st  with
      | "bs.open", (`Nothing | `Exn)
        ->
        `Exn, acc

      | _ , _ ->
        st, attr::acc
    ) ( `Nothing, []) attrs

let process_bs attrs =
  List.fold_left (fun (st, acc) (({txt; loc}, _) as attr : attr) ->
      match txt, st  with
      | "bs", _
        ->
        `Has, acc
      | _ , _ ->
        st, attr::acc
    ) ( `Nothing, []) attrs

let process_external attrs =
  List.exists (fun (({txt; }, _)  : attr) ->
      if Ext_string.starts_with txt "bs." then true
      else false
    ) attrs


type derive_attr = {
  explict_nonrec : bool;
  bs_deriving : Ast_payload.action list option
}

let process_derive_type attrs : derive_attr * t =
  List.fold_left
    (fun (st, acc)
      (({txt ; loc}, payload  as attr): attr)  ->
      match  st, txt  with
      |  {bs_deriving = None}, "bs.deriving"
        ->
        {st with
         bs_deriving = Some
             (Ast_payload.ident_or_record_as_config loc payload)}, acc
      | {bs_deriving = Some _}, "bs.deriving"
        ->
        Bs_syntaxerr.err loc Duplicated_bs_deriving

      | _ , _ ->
        let st =
          if txt = "nonrec" then
            { st with explict_nonrec = true }
          else st in
        st, attr::acc
    ) ( {explict_nonrec = false; bs_deriving = None }, []) attrs

let iter_process_derive_type attrs =
  let st = ref {explict_nonrec = false; bs_deriving = None } in
  List.iter
    (fun
      (({txt ; loc}, payload  as attr): attr)  ->
      match  txt  with
      |  "bs.deriving"
        ->
        let ost = !st in
        (match ost with
         | {bs_deriving = None } ->
           Bs_ast_invariant.mark_used_bs_attribute attr ;
           st :=
             {ost with
              bs_deriving = Some
                  (Ast_payload.ident_or_record_as_config loc payload)}
         | {bs_deriving = Some _} ->
           Bs_syntaxerr.err loc Duplicated_bs_deriving)

      | "nonrec" ->
        st :=
          { !st with explict_nonrec = true }
      (* non bs attribute, no need to mark its use *)
      | _ -> ()
    )  attrs;
  !st


(* duplicated [bs.uncurry] [bs.string] not allowed,
  it is worse in bs.uncurry since it will introduce
  inconsistency in arity
 *)  
let iter_process_bs_string_int_unwrap_uncurry (attrs : Parsetree.attributes) =
  let st = ref `Nothing in 
  let assign v (({loc;_}, _ ) as attr : attr) = 
    if !st = `Nothing then 
    begin 
      Bs_ast_invariant.mark_used_bs_attribute attr;
      st := v ;
    end  
    else Bs_syntaxerr.err loc Conflict_attributes  in 
  Ext_list.iter attrs (fun (({txt ; loc}, (payload : _ ) ) as attr)  ->
      match  txt with
      | "bs.string"
        -> assign `String attr
      | "bs.int"
        -> assign `Int attr
      | "bs.ignore"
        -> assign `Ignore attr
      | "bs.unwrap"
        -> assign `Unwrap attr
      | "bs.uncurry"
        ->
        assign (`Uncurry (Ast_payload.is_single_int payload)) attr
      | _ -> ()
    ) ;
  !st 


let iter_process_bs_string_as  (attrs : t) : string option =
  let st = ref None in
  Ext_list.iter attrs
    (fun
      (({txt ; loc}, payload ) as attr )  ->
      match  txt with
      | "bs.as"
        ->
        if !st = None then
          match Ast_payload.is_single_string payload with
          | None ->
            Bs_syntaxerr.err loc Expect_string_literal
          | Some  (v,_dec) ->            
            Bs_ast_invariant.mark_used_bs_attribute attr ;
            st:= Some v
        else
          Bs_syntaxerr.err loc Duplicated_bs_as
      | _  -> ()
    ) ;
  !st

let iter_process_bs_string_as_ast  (attrs : t) : Parsetree.expression option =
  let st = ref None in
  Ext_list.iter attrs
    (fun
      (({txt ; loc}, payload ) as attr )  ->
      match  txt with
      | "bs.as"
        ->
        if !st = None then
          match Ast_payload.is_single_string_as_ast payload with
          | None ->
            Bs_syntaxerr.err loc Expect_string_literal
          | Some _ as v ->            
            Bs_ast_invariant.mark_used_bs_attribute attr ;
            st:=  v
        else
          Bs_syntaxerr.err loc Duplicated_bs_as
      | _  -> ()
    ) ;
  !st  

let has_bs_optional  (attrs : t) : bool =
  Ext_list.exists attrs (fun
      (({txt ; }, _ ) as attr)  ->
      match  txt with
      | "bs.optional"
        ->
        Bs_ast_invariant.mark_used_bs_attribute attr ;
        true
      | _  -> false
    ) 



let iter_process_bs_int_as  attrs =
  let st = ref None in
  List.iter
    (fun
      (({txt ; loc}, payload ) as attr : attr)  ->
      match  txt with
      | "bs.as"
        ->
        if !st =  None then
          match Ast_payload.is_single_int payload with
          | None ->
            Bs_syntaxerr.err loc Expect_int_literal
          | Some  _ as v->
            Bs_ast_invariant.mark_used_bs_attribute attr ;
            st := v
        else
          Bs_syntaxerr.err loc Duplicated_bs_as
      | _  -> ()
    ) attrs; !st


let iter_process_bs_string_or_int_as (attrs : Parsetree.attributes) =
  let st = ref None in
  Ext_list.iter attrs
    (fun
      (({txt ; loc}, payload ) as attr)  ->
      match  txt with
      | "bs.as"
        ->
        if !st = None then
          (Bs_ast_invariant.mark_used_bs_attribute attr ;
           match Ast_payload.is_single_int payload with
           | None ->
             begin match Ast_payload.is_single_string payload with
               | Some (s,None) ->
                 st := Some (`Str (s))
               | Some (s, Some "json") ->
                 st := Some (`Json_str s )
               | None | Some (_, Some _) ->
                 Bs_syntaxerr.err loc Expect_int_or_string_or_json_literal

             end
           | Some   v->
             st := (Some (`Int v))
          )
        else
          Bs_syntaxerr.err loc Duplicated_bs_as
      | _ -> ()

    ) ;
  !st

let locg = Location.none
let bs : attr
  =  {txt = "bs" ; loc = locg}, Ast_payload.empty

let is_bs (attr : attr) =
  match attr with
  | {Location.txt = "bs"; _}, _ -> true
  | _ -> false


let bs_get : attr
  =  {txt = "bs.get"; loc = locg}, Ast_payload.empty

let bs_get_arity : attr
  =  {txt = "internal.arity"; loc = locg}, 
    PStr 
    [{pstr_desc =
         Pstr_eval (
          Ast_compatible.const_exp_int ~loc:locg 1
           ,
           [])
      ; pstr_loc = locg}]
  

let bs_set : attr
  =  {txt = "bs.set"; loc = locg}, Ast_payload.empty

let bs_return_undefined : attr
  =
  {txt = "bs.return"; loc = locg },
  PStr
    [
      {pstr_desc =
         Pstr_eval (
           {pexp_desc =
              Pexp_ident
                { txt = Lident "undefined_to_opt";
                  loc = locg};
            pexp_loc = locg;
            pexp_attributes = []
           },[])
      ; pstr_loc = locg}]

let deprecated s : attr =       
  {txt = "ocaml.deprecated"; loc = locg },
  PStr
    [
      {pstr_desc =
         Pstr_eval (
           Ast_compatible.const_exp_string ~loc:locg s, 
           [])
      ; pstr_loc = locg}]

end
module Ast_exp : sig 
#1 "ast_exp.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Parsetree.expression 

end = struct
#1 "ast_exp.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Parsetree.expression 

end
module Ast_external_mk : sig 
#1 "ast_external_mk.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(**
  [local_module loc ~pval_prim ~pval_type args]
  generate such code 
  {[
    let module J = struct 
       external unsafe_expr : pval_type = pval_prim 
    end in 
    J.unssafe_expr args
  ]}
*)
val local_external_apply :
   Location.t ->
  ?pval_attributes:Parsetree.attributes ->
  pval_prim:string list ->
  pval_type:Parsetree.core_type ->
  ?local_module_name:string ->
  ?local_fun_name:string ->
  Parsetree.expression list -> 
  Parsetree.expression_desc


val local_external_obj :
   Location.t ->
  ?pval_attributes:Parsetree.attributes ->
  pval_prim:string list ->
  pval_type:Parsetree.core_type ->
  ?local_module_name:string ->
  ?local_fun_name:string ->
  (string * Parsetree.expression) list ->  (* [ (label, exp )]*)  
  Parsetree.expression_desc



val local_extern_cont : 
  Location.t ->
  ?pval_attributes:Parsetree.attributes ->
  pval_prim:string list ->
  pval_type:Parsetree.core_type ->
  ?local_module_name:string ->
  ?local_fun_name:string ->
  (Parsetree.expression -> Parsetree.expression) -> Parsetree.expression_desc

end = struct
#1 "ast_external_mk.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

let local_external_apply loc 
     ?(pval_attributes=[])
     ~pval_prim
     ~pval_type 
     ?(local_module_name = "J")
     ?(local_fun_name = "unsafe_expr")
     args
  : Parsetree.expression_desc = 
  Pexp_letmodule
    ({txt = local_module_name; loc},
     {pmod_desc =
        Pmod_structure
          [{pstr_desc =
              Pstr_primitive
                {pval_name = {txt = local_fun_name; loc};
                 pval_type ;
                 pval_loc = loc;
                 pval_prim ;
                 pval_attributes };
            pstr_loc = loc;
           }];
      pmod_loc = loc;
      pmod_attributes = []},
      Ast_compatible.apply_simple 
      ({pexp_desc = Pexp_ident {txt = Ldot (Lident local_module_name, local_fun_name); 
                                      loc};
              pexp_attributes = [] ;
              pexp_loc = loc} : Parsetree.expression) args ~loc
    )

let local_external_obj loc 
     ?(pval_attributes=[])
     ~pval_prim
     ~pval_type 
     ?(local_module_name = "J")
     ?(local_fun_name = "unsafe_expr")
     args
  : Parsetree.expression_desc = 
  Pexp_letmodule
    ({txt = local_module_name; loc},
     {pmod_desc =
        Pmod_structure
          [{pstr_desc =
              Pstr_primitive
                {pval_name = {txt = local_fun_name; loc};
                 pval_type ;
                 pval_loc = loc;
                 pval_prim ;
                 pval_attributes };
            pstr_loc = loc;
           }];
      pmod_loc = loc;
      pmod_attributes = []},
      Ast_compatible.apply_labels
      ({pexp_desc = Pexp_ident {txt = Ldot (Lident local_module_name, local_fun_name); 
                                      loc};
              pexp_attributes = [] ;
              pexp_loc = loc} : Parsetree.expression) args ~loc
    )    

let local_extern_cont loc 
     ?(pval_attributes=[])
     ~pval_prim
     ~pval_type 
     ?(local_module_name = "J")
     ?(local_fun_name = "unsafe_expr")
     (cb : Parsetree.expression -> 'a) 
  : Parsetree.expression_desc = 
  Pexp_letmodule
    ({txt = local_module_name; loc},
     {pmod_desc =
        Pmod_structure
          [{pstr_desc =
              Pstr_primitive
                {pval_name = {txt = local_fun_name; loc};
                 pval_type ;
                 pval_loc = loc;
                 pval_prim ;
                 pval_attributes };
            pstr_loc = loc;
           }];
      pmod_loc = loc;
      pmod_attributes = []},
     cb {pexp_desc = Pexp_ident {txt = Ldot (Lident local_module_name, local_fun_name); 
                                 loc};
         pexp_attributes = [] ;
         pexp_loc = loc}
)

end
module Ast_pat : sig 
#1 "ast_pat.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type t = Parsetree.pattern

val is_unit_cont : yes:'a -> no:'a -> t -> 'a

(** [arity_of_fun pat e] tells the arity of 
    expression [fun pat -> e]*)
val arity_of_fun : t -> Parsetree.expression -> int


val is_single_variable_pattern_conservative : t -> bool

end = struct
#1 "ast_pat.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type t = Parsetree.pattern


let is_unit_cont ~yes ~no (p : t)  =
  match p  with
  | {ppat_desc = Ppat_construct({txt = Lident "()"}, None)}
    -> yes 
  | _ -> no


(** [arity_of_fun pat e] tells the arity of 
    expression [fun pat -> e]
*)
let arity_of_fun
    (pat : Parsetree.pattern)
    (e : Parsetree.expression) =
  let rec aux (e : Parsetree.expression)  =
    match e.pexp_desc with
    | Pexp_fun (arg_label, _, pat, e) 
      when Ast_compatible.is_arg_label_simple arg_label ->
      1 + aux e       
    | Pexp_fun _
      -> Location.raise_errorf
           ~loc:e.pexp_loc "Label is not allowed in JS object"
    | _ -> 0 in
  is_unit_cont ~yes:0 ~no:1 pat + aux e 


let rec is_single_variable_pattern_conservative  (p : t ) =
  match p.ppat_desc with 
  | Parsetree.Ppat_any 
  | Parsetree.Ppat_var _ -> true 
  | Parsetree.Ppat_alias (p,_) 
  | Parsetree.Ppat_constraint (p, _) -> 
    is_single_variable_pattern_conservative p 
  
  | _ -> false

end
module Bs_ast_mapper : sig 
#1 "bs_ast_mapper.mli"

(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2012 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(** The interface of a -ppx rewriter

  A -ppx rewriter is a program that accepts a serialized abstract syntax
  tree and outputs another, possibly modified, abstract syntax tree.
  This module encapsulates the interface between the compiler and
  the -ppx rewriters, handling such details as the serialization format,
  forwarding of command-line flags, and storing state.

  {!mapper} allows to implement AST rewriting using open recursion.
  A typical mapper would be based on {!default_mapper}, a deep
  identity mapper, and will fall back on it for handling the syntax it
  does not modify. For example:

  {[
open Asttypes
open Parsetree
open Ast_mapper

let test_mapper argv =
  { default_mapper with
    expr = fun mapper expr ->
      match expr with
      | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
        Ast_helper.Exp.constant (Const_int 42)
      | other -> default_mapper.expr mapper other; }

let () =
  register "ppx_test" test_mapper]}

  This -ppx rewriter, which replaces [[%test]] in expressions with
  the constant [42], can be compiled using
  [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

  *)

  open Parsetree

  (** {2 A generic Parsetree mapper} *)

  type mapper = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
(* XXXXX *)
    type_declaration_list: mapper -> type_declaration list -> type_declaration list;
(* XXXXX *)
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
(* XXXXX *)
    value_bindings_rec: mapper -> value_binding list -> value_binding list;
    value_bindings: mapper -> value_binding list -> value_binding list;
(* XXXXX *)
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)
  
end = struct
#1 "bs_ast_mapper.ml"
 
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2012 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

(* A generic Parsetree mapping class *)
(* Adapted for BUcklescript with more flexibilty*)

[@@@ocaml.warning "+9"]
(* Ensure that record patterns don't miss any field. *)



open Asttypes
open Parsetree
open Ast_helper
open Location

type mapper = {
  attribute: mapper -> attribute -> attribute;
  attributes: mapper -> attribute list -> attribute list;
  case: mapper -> case -> case;
  cases: mapper -> case list -> case list;
  class_declaration: mapper -> class_declaration -> class_declaration;
  class_description: mapper -> class_description -> class_description;
  class_expr: mapper -> class_expr -> class_expr;
  class_field: mapper -> class_field -> class_field;
  class_signature: mapper -> class_signature -> class_signature;
  class_structure: mapper -> class_structure -> class_structure;
  class_type: mapper -> class_type -> class_type;
  class_type_declaration: mapper -> class_type_declaration
                          -> class_type_declaration;
  class_type_field: mapper -> class_type_field -> class_type_field;
  constructor_declaration: mapper -> constructor_declaration
                           -> constructor_declaration;
  expr: mapper -> expression -> expression;
  extension: mapper -> extension -> extension;
  extension_constructor: mapper -> extension_constructor
                         -> extension_constructor;
  include_declaration: mapper -> include_declaration -> include_declaration;
  include_description: mapper -> include_description -> include_description;
  label_declaration: mapper -> label_declaration -> label_declaration;
  location: mapper -> Location.t -> Location.t;
  module_binding: mapper -> module_binding -> module_binding;
  module_declaration: mapper -> module_declaration -> module_declaration;
  module_expr: mapper -> module_expr -> module_expr;
  module_type: mapper -> module_type -> module_type;
  module_type_declaration: mapper -> module_type_declaration
                           -> module_type_declaration;
  open_description: mapper -> open_description -> open_description;
  pat: mapper -> pattern -> pattern;
  payload: mapper -> payload -> payload;
  signature: mapper -> signature -> signature;
  signature_item: mapper -> signature_item -> signature_item;
  structure: mapper -> structure -> structure;
  structure_item: mapper -> structure_item -> structure_item;
  typ: mapper -> core_type -> core_type;
  type_declaration: mapper -> type_declaration -> type_declaration;
(* XXXX *)
  type_declaration_list : mapper -> type_declaration list -> type_declaration list;
(* XXXX *)
  type_extension: mapper -> type_extension -> type_extension;
  type_kind: mapper -> type_kind -> type_kind;
  value_binding: mapper -> value_binding -> value_binding;
(* XXXX *)
  value_bindings_rec : mapper -> value_binding list -> value_binding list;
  value_bindings : mapper -> value_binding list -> value_binding list;
(* XXXXX *)
  value_description: mapper -> value_description -> value_description;
  with_constraint: mapper -> with_constraint -> with_constraint;
}

let map_fst f (x, y) = (f x, y)
let map_snd f (x, y) = (x, f y)
let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
let map_opt f = function None -> None | Some x -> Some (f x)

let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

module T = struct
  (* Type expressions for the core language *)

  let row_field sub = function
    | Rtag (l, attrs, b, tl) ->
        Rtag (l, sub.attributes sub attrs, b, List.map (sub.typ sub) tl)
    | Rinherit t -> Rinherit (sub.typ sub t)

  let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
    let open Typ in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Ptyp_any -> any ~loc ~attrs ()
    | Ptyp_var s -> var ~loc ~attrs s
    | Ptyp_arrow (lab, t1, t2) ->
        arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
    | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
    | Ptyp_constr (lid, tl) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
    | Ptyp_object (l, o) ->
        let f (s, a, t) = (s, sub.attributes sub a, sub.typ sub t) in
        object_ ~loc ~attrs (List.map f l) o
    | Ptyp_class (lid, tl) ->
        class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
    | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
    | Ptyp_variant (rl, b, ll) ->
        variant ~loc ~attrs (List.map (row_field sub) rl) b ll
    | Ptyp_poly (sl, t) -> poly ~loc ~attrs sl (sub.typ sub t)
    | Ptyp_package (lid, l) ->
        package ~loc ~attrs (map_loc sub lid)
          (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
    | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_type_declaration sub
      {ptype_name; ptype_params; ptype_cstrs;
       ptype_kind;
       ptype_private;
       ptype_manifest;
       ptype_attributes;
       ptype_loc} =
    Type.mk (map_loc sub ptype_name)
      ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
      ~priv:ptype_private
      ~cstrs:(List.map
                (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                ptype_cstrs)
      ~kind:(sub.type_kind sub ptype_kind)
      ?manifest:(map_opt (sub.typ sub) ptype_manifest)
      ~loc:(sub.location sub ptype_loc)
      ~attrs:(sub.attributes sub ptype_attributes)
(* XXXX *)
  let map_type_declaration_list sub l = List.map  (sub.type_declaration sub) l
(* XXXX *)
  let map_type_kind sub = function
    | Ptype_abstract -> Ptype_abstract
    | Ptype_variant l ->
        Ptype_variant (List.map (sub.constructor_declaration sub) l)
    | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
    | Ptype_open -> Ptype_open

  let map_type_extension sub
      {ptyext_path; ptyext_params;
       ptyext_constructors;
       ptyext_private;
       ptyext_attributes} =
    Te.mk
      (map_loc sub ptyext_path)
      (List.map (sub.extension_constructor sub) ptyext_constructors)
      ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
      ~priv:ptyext_private
      ~attrs:(sub.attributes sub ptyext_attributes)

  let map_extension_constructor_kind sub = function
      Pext_decl(ctl, cto) ->
        Pext_decl(List.map (sub.typ sub) ctl, map_opt (sub.typ sub) cto)
    | Pext_rebind li ->
        Pext_rebind (map_loc sub li)

  let map_extension_constructor sub
      {pext_name;
       pext_kind;
       pext_loc;
       pext_attributes} =
    Te.constructor
      (map_loc sub pext_name)
      (map_extension_constructor_kind sub pext_kind)
      ~loc:(sub.location sub pext_loc)
      ~attrs:(sub.attributes sub pext_attributes)

end

module CT = struct
  (* Type expressions for the class language *)

  let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
    let open Cty in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pcty_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
    | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
    | Pcty_arrow (lab, t, ct) ->
        arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
    | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
    =
    let open Ctf in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
    | Pctf_val (s, m, v, t) -> val_ ~loc ~attrs s m v (sub.typ sub t)
    | Pctf_method (s, p, v, t) -> method_ ~loc ~attrs s p v (sub.typ sub t)
    | Pctf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
    | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
    | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_signature sub {pcsig_self; pcsig_fields} =
    Csig.mk
      (sub.typ sub pcsig_self)
      (List.map (sub.class_type_field sub) pcsig_fields)
end

module MT = struct
  (* Type expressions for the module language *)

  let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
    let open Mty in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
    | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
    | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
    | Pmty_functor (s, mt1, mt2) ->
        functor_ ~loc ~attrs (map_loc sub s)
          (Misc.may_map (sub.module_type sub) mt1)
          (sub.module_type sub mt2)
    | Pmty_with (mt, l) ->
        with_ ~loc ~attrs (sub.module_type sub mt)
          (List.map (sub.with_constraint sub) l)
    | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
    | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_with_constraint sub = function
    | Pwith_type (lid, d) ->
        Pwith_type (map_loc sub lid, sub.type_declaration sub d)
    | Pwith_module (lid, lid2) ->
        Pwith_module (map_loc sub lid, map_loc sub lid2)
    | Pwith_typesubst d -> Pwith_typesubst (sub.type_declaration sub d)
    | Pwith_modsubst (s, lid) ->
        Pwith_modsubst (map_loc sub s, map_loc sub lid)

  let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
    let open Sig in
    let loc = sub.location sub loc in
    match desc with
    | Psig_value vd -> value ~loc (sub.value_description sub vd)
    | Psig_type l -> type_ ~loc (sub.type_declaration_list sub l)
    | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
    | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
    | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
    | Psig_recmodule l ->
        rec_module ~loc (List.map (sub.module_declaration sub) l)
    | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
    | Psig_open x -> open_ ~loc (sub.open_description sub x)
    | Psig_include x -> include_ ~loc (sub.include_description sub x)
    | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
    | Psig_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
    | Psig_extension (x, attrs) ->
        extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
    | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
end


module M = struct
  (* Value expressions for the module language *)

  let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
    let open Mod in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
    | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
    | Pmod_functor (arg, arg_ty, body) ->
        functor_ ~loc ~attrs (map_loc sub arg)
          (Misc.may_map (sub.module_type sub) arg_ty)
          (sub.module_expr sub body)
    | Pmod_apply (m1, m2) ->
        apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
    | Pmod_constraint (m, mty) ->
        constraint_ ~loc ~attrs (sub.module_expr sub m)
                    (sub.module_type sub mty)
    | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
    | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
    let open Str in
    let loc = sub.location sub loc in
    match desc with
    | Pstr_eval (x, attrs) ->
        eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
    | Pstr_value (r, vbs) ->
(* XXX *)
(* value ~loc r (List.map (sub.value_binding sub) vbs) *)
      value ~loc r
      ((if r = Recursive then sub.value_bindings_rec else sub.value_bindings)
       sub vbs)
(* XXX *)
    | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
    | Pstr_type l -> type_ ~loc (sub.type_declaration_list sub l)
    | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
    | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
    | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
    | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
    | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
    | Pstr_open x -> open_ ~loc (sub.open_description sub x)
    | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
    | Pstr_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
    | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
    | Pstr_extension (x, attrs) ->
        extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
    | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
end

module E = struct
  (* Value expressions for the core language *)

  let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
    let open Exp in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
    | Pexp_constant x -> constant ~loc ~attrs x
    | Pexp_let (r, vbs, e) ->
(* XXXX *)
        (* let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.expr sub e) *)
        let_ ~loc ~attrs r
        (
          (if r = Recursive then sub.value_bindings_rec else sub.value_bindings)
          sub vbs
        )
        (sub.expr sub e)
(* XXXX *)
    | Pexp_fun (lab, def, p, e) ->
        fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
          (sub.expr sub e)
    | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
    | Pexp_apply (e, l) ->
        apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
    | Pexp_match (e, pel) ->
        match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
    | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
    | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
    | Pexp_construct (lid, arg) ->
        construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
    | Pexp_variant (lab, eo) ->
        variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
    | Pexp_record (l, eo) ->
        record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
          (map_opt (sub.expr sub) eo)
    | Pexp_field (e, lid) ->
        field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
    | Pexp_setfield (e1, lid, e2) ->
        setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
          (sub.expr sub e2)
    | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
    | Pexp_ifthenelse (e1, e2, e3) ->
        ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
          (map_opt (sub.expr sub) e3)
    | Pexp_sequence (e1, e2) ->
        sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
    | Pexp_while (e1, e2) ->
        while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
    | Pexp_for (p, e1, e2, d, e3) ->
        for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
          (sub.expr sub e3)
    | Pexp_coerce (e, t1, t2) ->
        coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
          (sub.typ sub t2)
    | Pexp_constraint (e, t) ->
        constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
    | Pexp_send (e, s) -> send ~loc ~attrs (sub.expr sub e) s
    | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
    | Pexp_setinstvar (s, e) ->
        setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
    | Pexp_override sel ->
        override ~loc ~attrs
          (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
    | Pexp_letmodule (s, me, e) ->
        letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
          (sub.expr sub e)
    | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
    | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
    | Pexp_poly (e, t) ->
        poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
    | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
    | Pexp_newtype (s, e) -> newtype ~loc ~attrs s (sub.expr sub e)
    | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
    | Pexp_open (ovf, lid, e) ->
        open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
    | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
end

module P = struct
  (* Patterns *)

  let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
    let open Pat in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Ppat_any -> any ~loc ~attrs ()
    | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
    | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
    | Ppat_constant c -> constant ~loc ~attrs c
    | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
    | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
    | Ppat_construct (l, p) ->
        construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
    | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
    | Ppat_record (lpl, cf) ->
        record ~loc ~attrs
               (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
    | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
    | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
    | Ppat_constraint (p, t) ->
        constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
    | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
    | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
    | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
    | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
    | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
end

module CE = struct
  (* Value expressions for the class language *)

  let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
    let open Cl in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pcl_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
    | Pcl_structure s ->
        structure ~loc ~attrs (sub.class_structure sub s)
    | Pcl_fun (lab, e, p, ce) ->
        fun_ ~loc ~attrs lab
          (map_opt (sub.expr sub) e)
          (sub.pat sub p)
          (sub.class_expr sub ce)
    | Pcl_apply (ce, l) ->
        apply ~loc ~attrs (sub.class_expr sub ce)
          (List.map (map_snd (sub.expr sub)) l)
    | Pcl_let (r, vbs, ce) ->
(* XXXX *)
        (* let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.class_expr sub ce) *)
          let_ ~loc ~attrs r
          ((if r = Recursive then sub.value_bindings_rec else sub.value_bindings)
            sub vbs)
          (sub.class_expr sub ce)
(* XXXX *)
    | Pcl_constraint (ce, ct) ->
        constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
    | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_kind sub = function
    | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
    | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

  let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
    let open Cf in
    let loc = sub.location sub loc in
    let attrs = sub.attributes sub attrs in
    match desc with
    | Pcf_inherit (o, ce, s) -> inherit_ ~loc ~attrs o (sub.class_expr sub ce) s
    | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
    | Pcf_method (s, p, k) ->
        method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
    | Pcf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
    | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
    | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
    | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

  let map_structure sub {pcstr_self; pcstr_fields} =
    {
      pcstr_self = sub.pat sub pcstr_self;
      pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
    }

  let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                         pci_loc; pci_attributes} =
    Ci.mk
     ~virt:pci_virt
     ~params:(List.map (map_fst (sub.typ sub)) pl)
      (map_loc sub pci_name)
      (f pci_expr)
      ~loc:(sub.location sub pci_loc)
      ~attrs:(sub.attributes sub pci_attributes)
end

(* Now, a generic AST mapper, to be extended to cover all kinds and
   cases of the OCaml grammar.  The default behavior of the mapper is
   the identity. *)

let default_mapper =
  {
    structure = (fun this l -> List.map (this.structure_item this) l);
    structure_item = M.map_structure_item;
    module_expr = M.map;
    signature = (fun this l -> List.map (this.signature_item this) l);
    signature_item = MT.map_signature_item;
    module_type = MT.map;
    with_constraint = MT.map_with_constraint;
    class_declaration =
      (fun this -> CE.class_infos this (this.class_expr this));
    class_expr = CE.map;
    class_field = CE.map_field;
    class_structure = CE.map_structure;
    class_type = CT.map;
    class_type_field = CT.map_field;
    class_signature = CT.map_signature;
    class_type_declaration =
      (fun this -> CE.class_infos this (this.class_type this));
    class_description =
      (fun this -> CE.class_infos this (this.class_type this));
    type_declaration = T.map_type_declaration;
    type_declaration_list = T.map_type_declaration_list;
    type_kind = T.map_type_kind;
    typ = T.map;
    type_extension = T.map_type_extension;
    extension_constructor = T.map_extension_constructor;
    value_description =
      (fun this {pval_name; pval_type; pval_prim; pval_loc;
                 pval_attributes} ->
        Val.mk
          (map_loc this pval_name)
          (this.typ this pval_type)
          ~attrs:(this.attributes this pval_attributes)
          ~loc:(this.location this pval_loc)
          ~prim:pval_prim
      );

    pat = P.map;
    expr = E.map;

    module_declaration =
      (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
         Md.mk
           (map_loc this pmd_name)
           (this.module_type this pmd_type)
           ~attrs:(this.attributes this pmd_attributes)
           ~loc:(this.location this pmd_loc)
      );

    module_type_declaration =
      (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
         Mtd.mk
           (map_loc this pmtd_name)
           ?typ:(map_opt (this.module_type this) pmtd_type)
           ~attrs:(this.attributes this pmtd_attributes)
           ~loc:(this.location this pmtd_loc)
      );

    module_binding =
      (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
         Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
           ~attrs:(this.attributes this pmb_attributes)
           ~loc:(this.location this pmb_loc)
      );


    open_description =
      (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
         Opn.mk (map_loc this popen_lid)
           ~override:popen_override
           ~loc:(this.location this popen_loc)
           ~attrs:(this.attributes this popen_attributes)
      );


    include_description =
      (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
         Incl.mk (this.module_type this pincl_mod)
           ~loc:(this.location this pincl_loc)
           ~attrs:(this.attributes this pincl_attributes)
      );

    include_declaration =
      (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
         Incl.mk (this.module_expr this pincl_mod)
           ~loc:(this.location this pincl_loc)
           ~attrs:(this.attributes this pincl_attributes)
      );

    value_bindings = (fun this vbs ->
      match vbs with
      | [vb] -> [ this.value_binding this vb ]
      | _ -> List.map (this.value_binding this) vbs
    );
    value_bindings_rec = (fun this vbs ->
      match vbs with
      | [vb] -> [ this.value_binding this vb ]
      | _ -> List.map (this.value_binding this) vbs
    );
    value_binding =
      (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
         Vb.mk
           (this.pat this pvb_pat)
           (this.expr this pvb_expr)
           ~loc:(this.location this pvb_loc)
           ~attrs:(this.attributes this pvb_attributes)
      );


    constructor_declaration =
      (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
        Type.constructor
          (map_loc this pcd_name)
          ~args:(List.map (this.typ this) pcd_args)
          ?res:(map_opt (this.typ this) pcd_res)
          ~loc:(this.location this pcd_loc)
          ~attrs:(this.attributes this pcd_attributes)
      );

    label_declaration =
      (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
         Type.field
           (map_loc this pld_name)
           (this.typ this pld_type)
           ~mut:pld_mutable
           ~loc:(this.location this pld_loc)
           ~attrs:(this.attributes this pld_attributes)
      );

    cases = (fun this l -> List.map (this.case this) l);
    case =
      (fun this {pc_lhs; pc_guard; pc_rhs} ->
         {
           pc_lhs = this.pat this pc_lhs;
           pc_guard = map_opt (this.expr this) pc_guard;
           pc_rhs = this.expr this pc_rhs;
         }
      );



    location = (fun this l -> l);

    extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
    attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
    attributes = (fun this l -> List.map (this.attribute this) l);
    payload =
      (fun this -> function
         | PStr x -> PStr (this.structure this x)
         | PTyp x -> PTyp (this.typ this x)
         | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
      );
  }

end
module Ext_json_types
= struct
#1 "ext_json_types.ml"
(* Copyright (C) 2015-2017 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type loc = Lexing.position
type json_str = 
  { str : string ; loc : loc}

type json_flo  =
  { flo : string ; loc : loc}
type json_array =
  { content : t array ; 
    loc_start : loc ; 
    loc_end : loc ; 
  }

and json_map = 
  { map : t String_map.t ; loc :  loc }
and t = 
  | True of loc 
  | False of loc 
  | Null of loc 
  | Flo of json_flo
  | Str of json_str
  | Arr  of json_array
  | Obj of json_map
   

end
module Ext_position : sig 
#1 "ext_position.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type t = Lexing.position = {
    pos_fname : string ;
    pos_lnum : int ;
    pos_bol : int ;
    pos_cnum : int
}

(** [offset pos newpos]
    return a new position
    here [newpos] is zero based, the use case is that
    at position [pos], we get a string and Lexing from that string,
    therefore, we get a [newpos] and we need rebase it on top of 
    [pos]
*)
val offset : t -> t -> t 

val lexbuf_from_channel_with_fname:
    in_channel -> string -> 
    Lexing.lexbuf

val print : Format.formatter -> t -> unit 
end = struct
#1 "ext_position.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type t = Lexing.position = {
    pos_fname : string ;
    pos_lnum : int ;
    pos_bol : int ;
    pos_cnum : int
}

let offset (x : t) (y:t) =
  {
    x with 
    pos_lnum =
       x.pos_lnum + y.pos_lnum - 1;
    pos_cnum = 
      x.pos_cnum + y.pos_cnum;
    pos_bol = 
      if y.pos_lnum = 1 then 
        x.pos_bol
      else x.pos_cnum + y.pos_bol
  }

let print fmt (pos : t) =
  Format.fprintf fmt "(line %d, column %d)" pos.pos_lnum (pos.pos_cnum - pos.pos_bol)



let lexbuf_from_channel_with_fname ic fname = 
  let x = Lexing.from_function (fun buf n -> input ic buf 0 n) in 
  let pos : t = {
    pos_fname = fname ; 
    pos_lnum = 1; 
    pos_bol = 0;
    pos_cnum = 0 (* copied from zero_pos*)
  } in 
  x.lex_start_p <- pos;
  x.lex_curr_p <- pos ; 
  x


end
module Ext_json_parse : sig 
#1 "ext_json_parse.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type error

val report_error : Format.formatter -> error -> unit 

exception Error of Lexing.position * Lexing.position * error

val parse_json_from_string : string -> Ext_json_types.t 

val parse_json_from_chan :
  string ->  in_channel -> Ext_json_types.t 

val parse_json_from_file  : string -> Ext_json_types.t


end = struct
#1 "ext_json_parse.ml"
# 1 "ext/ext_json_parse.mll"
 
type error =
  | Illegal_character of char
  | Unterminated_string
  | Unterminated_comment
  | Illegal_escape of string
  | Unexpected_token 
  | Expect_comma_or_rbracket
  | Expect_comma_or_rbrace
  | Expect_colon
  | Expect_string_or_rbrace 
  | Expect_eof 
  (* | Trailing_comma_in_obj *)
  (* | Trailing_comma_in_array *)


let fprintf  = Format.fprintf
let report_error ppf = function
  | Illegal_character c ->
      fprintf ppf "Illegal character (%s)" (Char.escaped c)
  | Illegal_escape s ->
      fprintf ppf "Illegal backslash escape in string or character (%s)" s
  | Unterminated_string -> 
      fprintf ppf "Unterminated_string"
  | Expect_comma_or_rbracket ->
    fprintf ppf "Expect_comma_or_rbracket"
  | Expect_comma_or_rbrace -> 
    fprintf ppf "Expect_comma_or_rbrace"
  | Expect_colon -> 
    fprintf ppf "Expect_colon"
  | Expect_string_or_rbrace  -> 
    fprintf ppf "Expect_string_or_rbrace"
  | Expect_eof  -> 
    fprintf ppf "Expect_eof"
  | Unexpected_token 
    ->
    fprintf ppf "Unexpected_token"
  (* | Trailing_comma_in_obj  *)
  (*   -> fprintf ppf "Trailing_comma_in_obj" *)
  (* | Trailing_comma_in_array  *)
  (*   -> fprintf ppf "Trailing_comma_in_array" *)
  | Unterminated_comment 
    -> fprintf ppf "Unterminated_comment"
         

exception Error of Lexing.position * Lexing.position * error


let () = 
  Printexc.register_printer
    (function x -> 
     match x with 
     | Error (loc_start,loc_end,error) -> 
       Some (Format.asprintf 
          "@[%a:@ %a@ -@ %a)@]" 
          report_error  error
          Ext_position.print loc_start
          Ext_position.print loc_end
       )

     | _ -> None
    )





type token = 
  | Comma
  | Eof
  | False
  | Lbrace
  | Lbracket
  | Null
  | Colon
  | Number of string
  | Rbrace
  | Rbracket
  | String of string
  | True   
  
let error  (lexbuf : Lexing.lexbuf) e = 
  raise (Error (lexbuf.lex_start_p, lexbuf.lex_curr_p, e))


let lexeme_len (x : Lexing.lexbuf) =
  x.lex_curr_pos - x.lex_start_pos

let update_loc ({ lex_curr_p; _ } as lexbuf : Lexing.lexbuf) diff =
  lexbuf.lex_curr_p <-
    {
      lex_curr_p with
      pos_lnum = lex_curr_p.pos_lnum + 1;
      pos_bol = lex_curr_p.pos_cnum - diff;
    }

let char_for_backslash = function
  | 'n' -> '\010'
  | 'r' -> '\013'
  | 'b' -> '\008'
  | 't' -> '\009'
  | c -> c

let dec_code c1 c2 c3 =
  100 * (Char.code c1 - 48) + 10 * (Char.code c2 - 48) + (Char.code c3 - 48)

let hex_code c1 c2 =
  let d1 = Char.code c1 in
  let val1 =
    if d1 >= 97 then d1 - 87
    else if d1 >= 65 then d1 - 55
    else d1 - 48 in
  let d2 = Char.code c2 in
  let val2 =
    if d2 >= 97 then d2 - 87
    else if d2 >= 65 then d2 - 55
    else d2 - 48 in
  val1 * 16 + val2

let lf = '\010'

# 124 "ext/ext_json_parse.ml"
let __ocaml_lex_tables = {
  Lexing.lex_base =
   "\000\000\239\255\240\255\241\255\000\000\025\000\011\000\244\255\
    \245\255\246\255\247\255\248\255\249\255\000\000\000\000\000\000\
    \041\000\001\000\254\255\005\000\005\000\253\255\001\000\002\000\
    \252\255\000\000\000\000\003\000\251\255\001\000\003\000\250\255\
    \079\000\089\000\099\000\121\000\131\000\141\000\153\000\163\000\
    \001\000\253\255\254\255\023\000\255\255\006\000\246\255\189\000\
    \248\255\215\000\255\255\249\255\249\000\181\000\252\255\009\000\
    \063\000\075\000\234\000\251\255\032\001\250\255";
  Lexing.lex_backtrk =
   "\255\255\255\255\255\255\255\255\013\000\013\000\016\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\016\000\016\000\016\000\
    \016\000\016\000\255\255\000\000\012\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\013\000\255\255\013\000\255\255\013\000\255\255\
    \255\255\255\255\255\255\001\000\255\255\255\255\255\255\008\000\
    \255\255\255\255\255\255\255\255\006\000\006\000\255\255\006\000\
    \001\000\002\000\255\255\255\255\255\255\255\255";
  Lexing.lex_default =
   "\001\000\000\000\000\000\000\000\255\255\255\255\255\255\000\000\
    \000\000\000\000\000\000\000\000\000\000\255\255\255\255\255\255\
    \255\255\255\255\000\000\255\255\020\000\000\000\255\255\255\255\
    \000\000\255\255\255\255\255\255\000\000\255\255\255\255\000\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \042\000\000\000\000\000\255\255\000\000\047\000\000\000\047\000\
    \000\000\051\000\000\000\000\000\255\255\255\255\000\000\255\255\
    \255\255\255\255\255\255\000\000\255\255\000\000";
  Lexing.lex_trans =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\019\000\018\000\018\000\019\000\017\000\019\000\255\255\
    \048\000\019\000\255\255\057\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \019\000\000\000\003\000\000\000\000\000\019\000\000\000\000\000\
    \050\000\000\000\000\000\043\000\008\000\006\000\033\000\016\000\
    \004\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
    \005\000\005\000\007\000\004\000\005\000\005\000\005\000\005\000\
    \005\000\005\000\005\000\005\000\005\000\032\000\044\000\033\000\
    \056\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
    \005\000\005\000\005\000\021\000\057\000\000\000\000\000\000\000\
    \020\000\000\000\000\000\012\000\000\000\011\000\032\000\056\000\
    \000\000\025\000\049\000\000\000\000\000\032\000\014\000\024\000\
    \028\000\000\000\000\000\057\000\026\000\030\000\013\000\031\000\
    \000\000\000\000\022\000\027\000\015\000\029\000\023\000\000\000\
    \000\000\000\000\039\000\010\000\039\000\009\000\032\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\037\000\000\000\037\000\000\000\
    \035\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\036\000\036\000\255\255\
    \035\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\038\000\038\000\000\000\000\000\255\255\
    \000\000\056\000\000\000\000\000\055\000\058\000\058\000\058\000\
    \058\000\058\000\058\000\058\000\058\000\058\000\058\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\054\000\
    \000\000\054\000\000\000\000\000\000\000\000\000\054\000\000\000\
    \002\000\041\000\000\000\000\000\000\000\255\255\046\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\255\255\059\000\059\000\059\000\059\000\059\000\059\000\
    \059\000\059\000\059\000\059\000\000\000\000\000\000\000\000\000\
    \000\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\
    \060\000\060\000\060\000\054\000\000\000\000\000\000\000\000\000\
    \000\000\054\000\060\000\060\000\060\000\060\000\060\000\060\000\
    \000\000\000\000\000\000\000\000\000\000\054\000\000\000\000\000\
    \000\000\054\000\000\000\054\000\000\000\000\000\000\000\052\000\
    \061\000\061\000\061\000\061\000\061\000\061\000\061\000\061\000\
    \061\000\061\000\060\000\060\000\060\000\060\000\060\000\060\000\
    \000\000\061\000\061\000\061\000\061\000\061\000\061\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\061\000\061\000\061\000\061\000\061\000\061\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\255\255\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\255\255\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000";
  Lexing.lex_check =
   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\000\000\017\000\000\000\000\000\019\000\020\000\
    \045\000\019\000\020\000\055\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \000\000\255\255\000\000\255\255\255\255\019\000\255\255\255\255\
    \045\000\255\255\255\255\040\000\000\000\000\000\004\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\006\000\006\000\006\000\006\000\006\000\
    \006\000\006\000\006\000\006\000\006\000\004\000\043\000\005\000\
    \056\000\005\000\005\000\005\000\005\000\005\000\005\000\005\000\
    \005\000\005\000\005\000\016\000\057\000\255\255\255\255\255\255\
    \016\000\255\255\255\255\000\000\255\255\000\000\005\000\056\000\
    \255\255\014\000\045\000\255\255\255\255\004\000\000\000\023\000\
    \027\000\255\255\255\255\057\000\025\000\029\000\000\000\030\000\
    \255\255\255\255\015\000\026\000\000\000\013\000\022\000\255\255\
    \255\255\255\255\032\000\000\000\032\000\000\000\005\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\035\000\255\255\035\000\255\255\
    \034\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\036\000\036\000\036\000\036\000\036\000\
    \036\000\036\000\036\000\036\000\036\000\037\000\037\000\037\000\
    \037\000\037\000\037\000\037\000\037\000\037\000\037\000\047\000\
    \034\000\038\000\038\000\038\000\038\000\038\000\038\000\038\000\
    \038\000\038\000\038\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\255\255\255\255\047\000\
    \255\255\049\000\255\255\255\255\049\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\049\000\
    \255\255\049\000\255\255\255\255\255\255\255\255\049\000\255\255\
    \000\000\040\000\255\255\255\255\255\255\020\000\045\000\049\000\
    \049\000\049\000\049\000\049\000\049\000\049\000\049\000\049\000\
    \049\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\047\000\058\000\058\000\058\000\058\000\058\000\058\000\
    \058\000\058\000\058\000\058\000\255\255\255\255\255\255\255\255\
    \255\255\052\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \052\000\052\000\052\000\049\000\255\255\255\255\255\255\255\255\
    \255\255\049\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \255\255\255\255\255\255\255\255\255\255\049\000\255\255\255\255\
    \255\255\049\000\255\255\049\000\255\255\255\255\255\255\049\000\
    \060\000\060\000\060\000\060\000\060\000\060\000\060\000\060\000\
    \060\000\060\000\052\000\052\000\052\000\052\000\052\000\052\000\
    \255\255\060\000\060\000\060\000\060\000\060\000\060\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\060\000\060\000\060\000\060\000\060\000\060\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\047\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\049\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255";
  Lexing.lex_base_code =
   "";
  Lexing.lex_backtrk_code =
   "";
  Lexing.lex_default_code =
   "";
  Lexing.lex_trans_code =
   "";
  Lexing.lex_check_code =
   "";
  Lexing.lex_code =
   "";
}

let rec lex_json buf lexbuf =
   __ocaml_lex_lex_json_rec buf lexbuf 0
and __ocaml_lex_lex_json_rec buf lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 142 "ext/ext_json_parse.mll"
          ( lex_json buf lexbuf)
# 314 "ext/ext_json_parse.ml"

  | 1 ->
# 143 "ext/ext_json_parse.mll"
                   ( 
    update_loc lexbuf 0;
    lex_json buf  lexbuf
  )
# 322 "ext/ext_json_parse.ml"

  | 2 ->
# 147 "ext/ext_json_parse.mll"
                ( comment buf lexbuf)
# 327 "ext/ext_json_parse.ml"

  | 3 ->
# 148 "ext/ext_json_parse.mll"
         ( True)
# 332 "ext/ext_json_parse.ml"

  | 4 ->
# 149 "ext/ext_json_parse.mll"
          (False)
# 337 "ext/ext_json_parse.ml"

  | 5 ->
# 150 "ext/ext_json_parse.mll"
         (Null)
# 342 "ext/ext_json_parse.ml"

  | 6 ->
# 151 "ext/ext_json_parse.mll"
       (Lbracket)
# 347 "ext/ext_json_parse.ml"

  | 7 ->
# 152 "ext/ext_json_parse.mll"
       (Rbracket)
# 352 "ext/ext_json_parse.ml"

  | 8 ->
# 153 "ext/ext_json_parse.mll"
       (Lbrace)
# 357 "ext/ext_json_parse.ml"

  | 9 ->
# 154 "ext/ext_json_parse.mll"
       (Rbrace)
# 362 "ext/ext_json_parse.ml"

  | 10 ->
# 155 "ext/ext_json_parse.mll"
       (Comma)
# 367 "ext/ext_json_parse.ml"

  | 11 ->
# 156 "ext/ext_json_parse.mll"
        (Colon)
# 372 "ext/ext_json_parse.ml"

  | 12 ->
# 157 "ext/ext_json_parse.mll"
                      (lex_json buf lexbuf)
# 377 "ext/ext_json_parse.ml"

  | 13 ->
# 159 "ext/ext_json_parse.mll"
         ( Number (Lexing.lexeme lexbuf))
# 382 "ext/ext_json_parse.ml"

  | 14 ->
# 161 "ext/ext_json_parse.mll"
      (
  let pos = Lexing.lexeme_start_p lexbuf in
  scan_string buf pos lexbuf;
  let content = (Buffer.contents  buf) in 
  Buffer.clear buf ;
  String content 
)
# 393 "ext/ext_json_parse.ml"

  | 15 ->
# 168 "ext/ext_json_parse.mll"
       (Eof )
# 398 "ext/ext_json_parse.ml"

  | 16 ->
let
# 169 "ext/ext_json_parse.mll"
       c
# 404 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
# 169 "ext/ext_json_parse.mll"
          ( error lexbuf (Illegal_character c ))
# 408 "ext/ext_json_parse.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_lex_json_rec buf lexbuf __ocaml_lex_state

and comment buf lexbuf =
   __ocaml_lex_comment_rec buf lexbuf 40
and __ocaml_lex_comment_rec buf lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 171 "ext/ext_json_parse.mll"
              (lex_json buf lexbuf)
# 420 "ext/ext_json_parse.ml"

  | 1 ->
# 172 "ext/ext_json_parse.mll"
     (comment buf lexbuf)
# 425 "ext/ext_json_parse.ml"

  | 2 ->
# 173 "ext/ext_json_parse.mll"
       (error lexbuf Unterminated_comment)
# 430 "ext/ext_json_parse.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_comment_rec buf lexbuf __ocaml_lex_state

and scan_string buf start lexbuf =
   __ocaml_lex_scan_string_rec buf start lexbuf 45
and __ocaml_lex_scan_string_rec buf start lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 177 "ext/ext_json_parse.mll"
      ( () )
# 442 "ext/ext_json_parse.ml"

  | 1 ->
# 179 "ext/ext_json_parse.mll"
  (
        let len = lexeme_len lexbuf - 2 in
        update_loc lexbuf len;

        scan_string buf start lexbuf
      )
# 452 "ext/ext_json_parse.ml"

  | 2 ->
# 186 "ext/ext_json_parse.mll"
      (
        let len = lexeme_len lexbuf - 3 in
        update_loc lexbuf len;
        scan_string buf start lexbuf
      )
# 461 "ext/ext_json_parse.ml"

  | 3 ->
let
# 191 "ext/ext_json_parse.mll"
                                               c
# 467 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1) in
# 192 "ext/ext_json_parse.mll"
      (
        Buffer.add_char buf (char_for_backslash c);
        scan_string buf start lexbuf
      )
# 474 "ext/ext_json_parse.ml"

  | 4 ->
let
# 196 "ext/ext_json_parse.mll"
                 c1
# 480 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1)
and
# 196 "ext/ext_json_parse.mll"
                               c2
# 485 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 2)
and
# 196 "ext/ext_json_parse.mll"
                                             c3
# 490 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 3)
and
# 196 "ext/ext_json_parse.mll"
                                                    s
# 495 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_start_pos + 4) in
# 197 "ext/ext_json_parse.mll"
      (
        let v = dec_code c1 c2 c3 in
        if v > 255 then
          error lexbuf (Illegal_escape s) ;
        Buffer.add_char buf (Char.chr v);

        scan_string buf start lexbuf
      )
# 506 "ext/ext_json_parse.ml"

  | 5 ->
let
# 205 "ext/ext_json_parse.mll"
                        c1
# 512 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 2)
and
# 205 "ext/ext_json_parse.mll"
                                         c2
# 517 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 3) in
# 206 "ext/ext_json_parse.mll"
      (
        let v = hex_code c1 c2 in
        Buffer.add_char buf (Char.chr v);

        scan_string buf start lexbuf
      )
# 526 "ext/ext_json_parse.ml"

  | 6 ->
let
# 212 "ext/ext_json_parse.mll"
             c
# 532 "ext/ext_json_parse.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1) in
# 213 "ext/ext_json_parse.mll"
      (
        Buffer.add_char buf '\\';
        Buffer.add_char buf c;

        scan_string buf start lexbuf
      )
# 541 "ext/ext_json_parse.ml"

  | 7 ->
# 220 "ext/ext_json_parse.mll"
      (
        update_loc lexbuf 0;
        Buffer.add_char buf lf;

        scan_string buf start lexbuf
      )
# 551 "ext/ext_json_parse.ml"

  | 8 ->
# 227 "ext/ext_json_parse.mll"
      (
        let ofs = lexbuf.lex_start_pos in
        let len = lexbuf.lex_curr_pos - ofs in
        Buffer.add_subbytes buf lexbuf.lex_buffer ofs len;

        scan_string buf start lexbuf
      )
# 562 "ext/ext_json_parse.ml"

  | 9 ->
# 235 "ext/ext_json_parse.mll"
      (
        error lexbuf Unterminated_string
      )
# 569 "ext/ext_json_parse.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_scan_string_rec buf start lexbuf __ocaml_lex_state

;;

# 239 "ext/ext_json_parse.mll"
 






let rec parse_json lexbuf =
  let buf = Buffer.create 64 in 
  let look_ahead = ref None in
  let token () : token = 
    match !look_ahead with 
    | None ->  
      lex_json buf lexbuf 
    | Some x -> 
      look_ahead := None ;
      x 
  in
  let push e = look_ahead := Some e in 
  let rec json (lexbuf : Lexing.lexbuf) : Ext_json_types.t = 
    match token () with 
    | True -> True lexbuf.lex_start_p
    | False -> False lexbuf.lex_start_p
    | Null -> Null lexbuf.lex_start_p
    | Number s ->  Flo {flo = s; loc = lexbuf.lex_start_p}  
    | String s -> Str { str = s; loc =    lexbuf.lex_start_p}
    | Lbracket -> parse_array  lexbuf.lex_start_p lexbuf.lex_curr_p [] lexbuf
    | Lbrace -> parse_map lexbuf.lex_start_p String_map.empty lexbuf
    |  _ -> error lexbuf Unexpected_token
(** Note if we remove [trailing_comma] support 
    we should report errors (actually more work), for example 
    {[
    match token () with 
    | Rbracket ->
      if trailing_comma then
        error lexbuf Trailing_comma_in_array
      else
    ]} 
    {[
    match token () with 
    | Rbrace -> 
      if trailing_comma then
        error lexbuf Trailing_comma_in_obj
      else

    ]}   
 *)
  and parse_array   loc_start loc_finish acc lexbuf 
    : Ext_json_types.t =
    match token () with 
    | Rbracket ->
        Arr {loc_start ; content = Ext_array.reverse_of_list acc ; 
              loc_end = lexbuf.lex_curr_p }
    | x -> 
      push x ;
      let new_one = json lexbuf in 
      begin match token ()  with 
      | Comma -> 
          parse_array  loc_start loc_finish (new_one :: acc) lexbuf 
      | Rbracket 
        -> Arr {content = (Ext_array.reverse_of_list (new_one::acc));
                     loc_start ; 
                     loc_end = lexbuf.lex_curr_p }
      | _ -> 
        error lexbuf Expect_comma_or_rbracket
      end
  and parse_map loc_start  acc lexbuf : Ext_json_types.t = 
    match token () with 
    | Rbrace -> 
        Obj { map = acc ; loc = loc_start}
    | String key -> 
      begin match token () with 
      | Colon ->
        let value = json lexbuf in
        begin match token () with 
        | Rbrace -> Obj {map = String_map.add key value acc ; loc = loc_start}
        | Comma -> 
          parse_map loc_start  (String_map.add key value acc) lexbuf 
        | _ -> error lexbuf Expect_comma_or_rbrace
        end
      | _ -> error lexbuf Expect_colon
      end
    | _ -> error lexbuf Expect_string_or_rbrace
  in 
  let v = json lexbuf in 
  match token () with 
  | Eof -> v 
  | _ -> error lexbuf Expect_eof

let parse_json_from_string s = 
  parse_json (Lexing.from_string s )

let parse_json_from_chan fname in_chan = 
  let lexbuf = 
    Ext_position.lexbuf_from_channel_with_fname
    in_chan fname in 
  parse_json lexbuf 

let parse_json_from_file s = 
  let in_chan = open_in s in 
  let lexbuf = 
    Ext_position.lexbuf_from_channel_with_fname
    in_chan s in 
  match parse_json lexbuf with 
  | exception e -> close_in in_chan ; raise e
  | v  -> close_in in_chan;  v





# 688 "ext/ext_json_parse.ml"

end
module External_arg_spec : sig 
#1 "external_arg_spec.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type cst = private
  | Arg_int_lit of int 
  | Arg_string_lit of string 
  | Arg_js_null
  | Arg_js_true
  | Arg_js_false
  | Arg_js_json of string


type label = private
  | Label of string * cst option 
  | Empty of cst option
  | Optional of string 
  (* it will be ignored , side effect will be recorded *)

type attr = 
  | NullString of (int * string) list (* `a does not have any value*)
  | NonNullString of (int * string) list (* `a of int *)
  | Int of (int * int ) list (* ([`a | `b ] [@bs.int])*)
  | Arg_cst of cst
  | Fn_uncurry_arity of int (* annotated with [@bs.uncurry ] or [@bs.uncurry 2]*)
  (* maybe we can improve it as a combination of {!Asttypes.constant} and tuple *)
  | Array 
  | Extern_unit
  | Nothing
  | Ignore
  | Unwrap

type t = 
  {
    arg_type : attr;
    arg_label :label
  }

val cst_json : Location.t -> string -> cst 
val cst_int : int -> cst 
val cst_string : string -> cst 

val empty_label : label
val empty_lit : cst -> label 
val label :  string -> cst option -> label
val optional  : string -> label
val empty_kind : attr -> t

end = struct
#1 "external_arg_spec.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(** type definitions for external argument *)

type cst = 
  | Arg_int_lit of int 
  | Arg_string_lit of string 

  | Arg_js_null
  | Arg_js_true
  | Arg_js_false
  | Arg_js_json of string
type label = 
  | Label of string * cst option 
  | Empty of cst option
  | Optional of string 
  (* it will be ignored , side effect will be recorded *)

type attr = 
  | NullString of (int * string) list (* `a does not have any value*)
  | NonNullString of (int * string) list (* `a of int *)
  | Int of (int * int ) list (* ([`a | `b ] [@bs.int])*)
  | Arg_cst of cst
  | Fn_uncurry_arity of int (* annotated with [@bs.uncurry ] or [@bs.uncurry 2]*)
    (* maybe we can improve it as a combination of {!Asttypes.constant} and tuple *)
  | Array 
  | Extern_unit
  | Nothing
  | Ignore
  | Unwrap

type t = 
  {
    arg_type : attr;
    arg_label : label
  }


exception Error of Location.t * Ext_json_parse.error

let pp_invaild_json fmt err = 
  Format.fprintf fmt "@[Invalid json literal:  %a@]@." 
    Ext_json_parse.report_error err

let () = 
  Location.register_error_of_exn (function 
    | Error (loc,err) ->       
      Some (Location.error_of_printer loc pp_invaild_json err)
    | _ -> None
    )


let cst_json (loc : Location.t) s : cst  =
  match Ext_json_parse.parse_json_from_string s with 
  | True _ -> Arg_js_true
  | False _ -> Arg_js_false 
  | Null _ -> Arg_js_null 
  | _ -> Arg_js_json s 
  | exception Ext_json_parse.Error (start,finish,error_info)
    ->
    let loc1 = {
      loc with
       loc_start = 
        Ext_position.offset loc.loc_start start; 
       loc_end =   
       Ext_position.offset loc.loc_start finish;
    } in 
     raise (Error (loc1 , error_info))

let cst_int i = Arg_int_lit i 
let cst_string s = Arg_string_lit s 
let empty_label = Empty None 
let empty_lit s = Empty (Some s) 
let label s cst = Label(s,cst)
let optional s = Optional s 

let empty_kind arg_type = { arg_label = empty_label ; arg_type }

end
module Ast_polyvar : sig 
#1 "ast_polyvar.mli"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(** side effect: it will mark used attributes `bs.as`  *)
val map_row_fields_into_ints:
  Location.t -> 
  Parsetree.row_field list -> 
  (int * int ) list 

val map_constructor_declarations_into_ints:
  Parsetree.constructor_declaration list ->
  [ `Offset of int | `New  of int list ]

val map_row_fields_into_strings:
  Location.t -> 
  Parsetree.row_field list -> 
  External_arg_spec.attr


val is_enum :   
  Parsetree.row_field list -> 
  bool

val is_enum_polyvar :   
  Parsetree.type_declaration ->
  Parsetree.row_field list option 

val is_enum_constructors :   
  Parsetree.constructor_declaration list ->
  bool 
end = struct
#1 "ast_polyvar.ml"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


let map_row_fields_into_ints ptyp_loc
    (row_fields : Parsetree.row_field list) 
  = 
  let _, acc
    = 
    (List.fold_left 
       (fun (i,acc) rtag -> 
          match rtag with 
          | Parsetree.Rtag (label, attrs, true,  [])
            -> 
            begin match Ast_attributes.iter_process_bs_int_as attrs with 
              | Some i -> 
                i + 1, 
                ((Ast_compatible.hash_label label , i):: acc ) 
              | None -> 
                i + 1 , 
                ((Ast_compatible.hash_label label , i):: acc )
            end
          | _ -> 
            Bs_syntaxerr.err ptyp_loc Invalid_bs_int_type
       ) (0, []) row_fields) in 
  List.rev acc

(** Note this is okay with enums, for variants,
    the underlying representation may change due to       
    unbox
*)
let map_constructor_declarations_into_ints 
    (row_fields : Parsetree.constructor_declaration list)
  = 
  let mark = ref `nothing in 
  let _, acc
    = 
    (List.fold_left 
       (fun (i,acc) (rtag : Parsetree.constructor_declaration) -> 

          let attrs = rtag.pcd_attributes in 
          begin match Ast_attributes.iter_process_bs_int_as attrs with 
            | Some j -> 
              if j <> i then 
                (
                  if i = 0 then mark := `offset j
                  else mark := `complex
                )
              ;
              (j + 1, 
               (j:: acc ) )
            | None -> 
              i + 1 , 
              ( i:: acc )
          end

       ) (0, []) row_fields) in 
  match !mark with 
  | `nothing -> `Offset 0
  | `offset j -> `Offset j 
  | `complex -> `New (List.rev acc)



(** It also check in-consistency of cases like 
    {[ [`a  | `c of int ] ]}       
*)  
let map_row_fields_into_strings ptyp_loc 
    (row_fields : Parsetree.row_field list) : External_arg_spec.attr = 
  let case, result = 
    Ext_list.fold_right row_fields (`Nothing, []) (fun tag (nullary, acc) -> 
        match nullary, tag with 
        | (`Nothing | `Null), 
          Rtag (label, attrs, true,  [])
          -> 
          begin match Ast_attributes.iter_process_bs_string_as attrs with 
            | Some name -> 
              `Null, ((Ast_compatible.hash_label label, name) :: acc )

            | None -> 
              `Null, ((Ast_compatible.hash_label label, Ast_compatible.label_of_name label) :: acc )
          end
        | (`Nothing | `NonNull), Rtag(label, attrs, false, ([ _ ])) 
          -> 
          begin match Ast_attributes.iter_process_bs_string_as attrs with 
            | Some name -> 
              `NonNull, ((Ast_compatible.hash_label label, name) :: acc)
            | None -> 
              `NonNull, ((Ast_compatible.hash_label label, Ast_compatible.label_of_name label) :: acc)
          end
        | _ -> Bs_syntaxerr.err ptyp_loc Invalid_bs_string_type

      )  in 
  match case with 
  | `Nothing -> Bs_syntaxerr.err ptyp_loc Invalid_bs_string_type
  | `Null -> External_arg_spec.NullString result 
  | `NonNull -> NonNullString result


let is_enum row_fields = 
  List.for_all (fun (x : Parsetree.row_field) -> 
      match x with 
      | Rtag(_label,_attrs,true, []) -> true 
      | _ -> false
    ) row_fields


let is_enum_polyvar (ty : Parsetree.type_declaration) =      
  match ty.ptype_manifest with 
  | Some {ptyp_desc = Ptyp_variant(row_fields,Closed,None)}
    when is_enum row_fields ->
    Some row_fields 
  | _ -> None 

let is_enum_constructors 
    (constructors : Parsetree.constructor_declaration list) =   
  List.for_all 
    (fun (x : Parsetree.constructor_declaration) ->
       match x with 
       | {pcd_args = 
  
        []
        
        } -> true 
       | _ -> false 
    )
    constructors
end
module External_ffi_types : sig 
#1 "external_ffi_types.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type module_bind_name =
  | Phint_name of string
  (* explicit hint name *)
  | Phint_nothing

type external_module_name =
  { bundle : string ;
    module_bind_name : module_bind_name
  }

type pipe = bool
type js_call = {
  name : string;
  external_module_name : external_module_name option;
  splice : bool ;
  scopes : string list
}

type js_send = {
  name : string ;
  splice : bool ;
  pipe : pipe  ;
  js_send_scopes : string list;
} (* we know it is a js send, but what will happen if you pass an ocaml objct *)

type js_global_val = {
  name : string ;
  external_module_name : external_module_name option;
  scopes : string list
}

type js_new_val = {
  name : string ;
  external_module_name : external_module_name option;
  splice : bool ;
  scopes : string list;
}

type js_module_as_fn =
  { external_module_name : external_module_name;
    splice : bool
  }

type arg_type = External_arg_spec.attr

type arg_label = External_arg_spec.label


type obj_create = External_arg_spec.t list

type js_get =
  { js_get_name : string   ;
    js_get_scopes :  string list;
  }

type js_set =
  { js_set_name : string  ;
    js_set_scopes : string list
  }


type js_get_index =   {
  js_get_index_scopes : string list
}

type js_set_index = {
  js_set_index_scopes : string list
}



type attr  =
  | Js_global of js_global_val
  | Js_module_as_var of  external_module_name
  | Js_module_as_fn of js_module_as_fn
  | Js_module_as_class of external_module_name
  | Js_call of js_call
  | Js_send of js_send
  | Js_new of js_new_val
  | Js_set of js_set
  | Js_get of js_get
  | Js_get_index of js_get_index
  | Js_set_index of js_set_index

type return_wrapper =
  | Return_unset
  | Return_identity
  | Return_undefined_to_opt
  | Return_null_to_opt
  | Return_null_undefined_to_opt
  | Return_replaced_with_unit

type t  =
  | Ffi_bs of
      External_arg_spec.t list  *
      return_wrapper *
      attr
  | Ffi_obj_create of obj_create
  | Ffi_normal
  (* When it's normal, it is handled as normal c functional ffi call *)


val name_of_ffi : attr -> string

val check_ffi : ?loc:Location.t ->  attr -> unit

val to_string : t -> string

(** Note *)
val from_string : string -> t


end = struct
#1 "external_ffi_types.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type module_bind_name =
  | Phint_name of string
    (* explicit hint name *)

  | Phint_nothing


type external_module_name =
  { bundle : string ;
    module_bind_name : module_bind_name
  }

type pipe = bool
type js_call = {
  name : string;
  external_module_name : external_module_name option;
  splice : bool ;
  scopes : string list ;
}

type js_send = {
  name : string ;
  splice : bool ;
  pipe : pipe   ;
  js_send_scopes : string list;
} (* we know it is a js send, but what will happen if you pass an ocaml objct *)

type js_global_val = {
  name : string ;
  external_module_name : external_module_name option;
  scopes : string list ;
}

type js_new_val = {
  name : string ;
  external_module_name : external_module_name option;
  splice : bool ;
  scopes : string list;
}

type js_module_as_fn =
  { external_module_name : external_module_name;
    splice : bool ;

  }
type js_get =
  { js_get_name : string   ;
    js_get_scopes :  string list;
  }

type js_set =
  { js_set_name : string  ;
    js_set_scopes : string list
  }

type js_get_index =   {
  js_get_index_scopes : string list
}

type js_set_index = {
  js_set_index_scopes : string list
}
(** TODO: information between [arg_type] and [arg_label] are duplicated,
  design a more compact representation so that it is also easy to seralize by hand
*)
type arg_type = External_arg_spec.attr

type arg_label = External_arg_spec.label


(**TODO: maybe we can merge [arg_label] and [arg_type] *)
type obj_create = External_arg_spec.t list

type attr =
  | Js_global of js_global_val
  | Js_module_as_var of  external_module_name
  | Js_module_as_fn of js_module_as_fn
  | Js_module_as_class of external_module_name
  | Js_call of js_call
  | Js_send of js_send
  | Js_new of js_new_val
  | Js_set of js_set
  | Js_get of js_get
  | Js_get_index of js_get_index
  | Js_set_index of js_set_index

let name_of_ffi ffi =
  match ffi with
  | Js_get_index _scope -> "[@@bs.get_index ..]"
  | Js_set_index _scope -> "[@@bs.set_index ..]"
  | Js_get { js_get_name = s} -> Printf.sprintf "[@@bs.get %S]" s
  | Js_set { js_set_name = s} -> Printf.sprintf "[@@bs.set %S]" s
  | Js_call v  -> Printf.sprintf "[@@bs.val %S]" v.name
  | Js_send v  -> Printf.sprintf "[@@bs.send %S]" v.name
  | Js_module_as_fn v  -> Printf.sprintf "[@@bs.val %S]" v.external_module_name.bundle
  | Js_new v  -> Printf.sprintf "[@@bs.new %S]" v.name
  | Js_module_as_class v
    -> Printf.sprintf "[@@bs.module] %S " v.bundle
  | Js_module_as_var v
    ->
    Printf.sprintf "[@@bs.module] %S " v.bundle
  | Js_global v
    ->
    Printf.sprintf "[@@bs.val] %S " v.name

type return_wrapper =
  | Return_unset
  | Return_identity
  | Return_undefined_to_opt
  | Return_null_to_opt
  | Return_null_undefined_to_opt
  | Return_replaced_with_unit
type t  =
  | Ffi_bs of External_arg_spec.t list  *
     return_wrapper * attr
  (**  [Ffi_bs(args,return,attr) ]
       [return] means return value is unit or not,
        [true] means is [unit]
  *)
  | Ffi_obj_create of obj_create
  | Ffi_normal
  (* When it's normal, it is handled as normal c functional ffi call *)



let valid_js_char =
  let a = Array.init 256 (fun i ->
      let c = Char.chr i in
      (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c = '_' || c = '$'
    ) in
  (fun c -> Array.unsafe_get a (Char.code c))

let valid_first_js_char =
  let a = Array.init 256 (fun i ->
      let c = Char.chr i in
      (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c = '_' || c = '$'
    ) in
  (fun c -> Array.unsafe_get a (Char.code c))

(** Approximation could be improved *)
let valid_ident (s : string) =
  let len = String.length s in
  len > 0 && valid_js_char s.[0] && valid_first_js_char s.[0] &&
  (let module E = struct exception E end in
   try
     for i = 1 to len - 1 do
       if not (valid_js_char (String.unsafe_get s i)) then
         raise E.E
     done ;
     true
   with E.E -> false )

let valid_global_name ?loc txt =
  if not (valid_ident txt) then
    let v = Ext_string.split_by ~keep_empty:true (fun x -> x = '.') txt in
    List.iter
      (fun s ->
         if not (valid_ident s) then
           Location.raise_errorf ?loc "Not a valid global name %s"  txt
      ) v

(*
  We loose such check (see #2583),
  it also helps with the implementation deriving abstract [@bs.as]
*)

let valid_method_name ?loc txt =
    ()
  (* if not (valid_ident txt) then
    Location.raise_errorf ?loc "Not a valid method name %s"  txt *)



let check_external_module_name ?loc x =
  match x with
  | {bundle = ""; _ }
  | { module_bind_name = Phint_name "" } ->
    Location.raise_errorf ?loc "empty name encountered"
  | _ -> ()
let check_external_module_name_opt ?loc x =
  match x with
  | None -> ()
  | Some v -> check_external_module_name ?loc v


let check_ffi ?loc ffi =
  match ffi with
  | Js_global {name} -> valid_global_name ?loc  name
  | Js_send {name }
  | Js_set  {js_set_name = name}
  | Js_get { js_get_name = name}
    ->  valid_method_name ?loc name
  | Js_get_index  _ (* TODO: check scopes *)
  | Js_set_index _
    -> ()

  | Js_module_as_var external_module_name
  | Js_module_as_fn {external_module_name; _}
  | Js_module_as_class external_module_name
    -> check_external_module_name external_module_name
  | Js_new {external_module_name ;  name}
  | Js_call {external_module_name ;  name ; _}
    ->
    check_external_module_name_opt ?loc external_module_name ;
    valid_global_name ?loc name

let bs_prefix = "BS:"
let bs_prefix_length = String.length bs_prefix


(** TODO: Make sure each version is not prefix of each other
    Solution:
    1. fixed length
    2. non-prefix approach
*)
let bs_external = bs_prefix ^ Bs_version.version


let bs_external_length = String.length bs_external


let to_string  t =
  bs_external ^ Marshal.to_string t []


(* TODO:  better error message when version mismatch *)
let from_string s : t =
  let s_len = String.length s in
  if s_len >= bs_prefix_length &&
     String.unsafe_get s 0 = 'B' &&
     String.unsafe_get s 1 = 'S' &&
     String.unsafe_get s 2 = ':' then
    if Ext_string.starts_with s bs_external then
      Marshal.from_string s bs_external_length
    else
      Ext_pervasives.failwithf
        ~loc:__LOC__
        "Compiler version mismatch. The project might have been built with one version of BuckleScript, and then with another. Please wipe the artifacts and do a clean build."
  else Ffi_normal

end
module Bs_hash_stubs
= struct
#1 "bs_hash_stubs.ml"

 
external hash_string :  string -> int = "caml_bs_hash_string" "noalloc";;

external hash_string_int :  string -> int  -> int = "caml_bs_hash_string_and_int" "noalloc";;

external hash_string_small_int :  string -> int  -> int = "caml_bs_hash_string_and_small_int" "noalloc";;

external hash_stamp_and_name : int -> string -> int = "caml_bs_hash_stamp_and_name" "noalloc";;

external hash_small_int : int -> int = "caml_bs_hash_small_int" "noalloc";;

external hash_int :  int  -> int = "caml_bs_hash_int" "noalloc";;

external string_length_based_compare : string -> string -> int  = "caml_string_length_based_compare" "noalloc";;


external    
    int_unsafe_blit : 
    int array -> int -> int array -> int -> int -> unit = "caml_int_array_blit" "noalloc";;
    

end
module String_hash_set : sig 
#1 "string_hash_set.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


include Hash_set_gen.S with type key = string

end = struct
#1 "string_hash_set.ml"
# 1 "ext/hash_set.cppo.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
# 31 "ext/hash_set.cppo.ml"
type key = string 
let key_index (h :  _ Hash_set_gen.t ) (key : key) =
  (Bs_hash_stubs.hash_string  key) land (Array.length h.data - 1)
let eq_key = Ext_string.equal 
type  t = key  Hash_set_gen.t 


# 64 "ext/hash_set.cppo.ml"
let create = Hash_set_gen.create
let clear = Hash_set_gen.clear
let reset = Hash_set_gen.reset
let copy = Hash_set_gen.copy
let iter = Hash_set_gen.iter
let fold = Hash_set_gen.fold
let length = Hash_set_gen.length
let stats = Hash_set_gen.stats
let elements = Hash_set_gen.elements



let remove (h : _ Hash_set_gen.t) key =  
  let i = key_index h key in
  let h_data = h.data in
  let old_h_size = h.size in 
  let new_bucket = Hash_set_gen.remove_bucket eq_key key h (Array.unsafe_get h_data i) in
  if old_h_size <> h.size then  
    Array.unsafe_set h_data i new_bucket



let add (h : _ Hash_set_gen.t) key =
  let i = key_index h key  in 
  let h_data = h.data in 
  let old_bucket = (Array.unsafe_get h_data i) in
  if not (Hash_set_gen.small_bucket_mem eq_key key old_bucket) then 
    begin 
      Array.unsafe_set h_data i (key :: old_bucket);
      h.size <- h.size + 1 ;
      if h.size > Array.length h_data lsl 1 then Hash_set_gen.resize key_index h
    end

let of_array arr = 
  let len = Array.length arr in 
  let tbl = create len in 
  for i = 0 to len - 1  do
    add tbl (Array.unsafe_get arr i);
  done ;
  tbl 
  
    
let check_add (h : _ Hash_set_gen.t) key =
  let i = key_index h key  in 
  let h_data = h.data in  
  let old_bucket = (Array.unsafe_get h_data i) in
  if not (Hash_set_gen.small_bucket_mem eq_key key old_bucket) then 
    begin 
      Array.unsafe_set h_data i  (key :: old_bucket);
      h.size <- h.size + 1 ;
      if h.size > Array.length h_data lsl 1 then Hash_set_gen.resize key_index h;
      true 
    end
  else false 


let mem (h :  _ Hash_set_gen.t) key =
  Hash_set_gen.small_bucket_mem eq_key key (Array.unsafe_get h.data (key_index h key)) 

  

end
module Lam_methname : sig 
#1 "lam_methname.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



val translate : ?loc:Location.t -> string -> string

end = struct
#1 "lam_methname.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


(**
  {[
    _open -> open 
    _in -> in 
    _MAX_LENGTH -> MAX_LENGTH
    _Capital -> Capital 
    
    _open__ ->  _open
    open__ -> open 
    
    _'x -> 'x 

    _Capital__ -> _Capital 
    _MAX__ -> _MAX
    __ -> __ 
    __x -> __x 
    ___ -> _     
    ____ -> __
    _ -> _  (* error *)   
    

  ]}
  First we scan '__' from end to start, 
  If found, discard it.
  Otherwise, check if it is [_ + keyword] or followed by capital letter,
  If so, discard [_].

  Limitations: user can not have [_Capital__, _Capital__other] to 
  make it all compile to [Capital].
  Keyword is fine [open__, open__other].
  So we loose polymorphism over capital letter. 
  It is okay, otherwise, if [_Captial__] is interpreted as [Capital], then
  there is no way to express [_Capital]
*)

(* Copied from [ocaml/parsing/lexer.mll] *)
let key_words = String_hash_set.of_array [|
    "and";
    "as";
    "assert";
    "begin";
    "class";
    "constraint";
    "do";
    "done";
    "downto";
    "else";
    "end";
    "exception";
    "external";
    "false";
    "for";
    "fun";
    "function";
    "functor";
    "if";
    "in";
    "include";
    "inherit";
    "initializer";
    "lazy";
    "let";
    "match";
    "method";
    "module";
    "mutable";
    "new";
    "nonrec";
    "object";
    "of";
    "open";
    "or";
(*  "parser", PARSER; *)
    "private";
    "rec";
    "sig";
    "struct";
    "then";
    "to";
    "true";
    "try";
    "type";
    "val";
    "virtual";
    "when";
    "while";
    "with";

    "mod";
    "land";
    "lor";
    "lxor";
    "lsl";
    "lsr";
    "asr";
|]
let double_underscore = "__"

(*https://caml.inria.fr/pub/docs/manual-ocaml/lex.html
{[

  label-name	::=	 lowercase-ident 
]}
*)
let valid_start_char x =
  match x with 
  | '_' | 'a' .. 'z' -> true 
  | _ -> false 
let translate ?loc name = 
  assert (not @@ Ext_string.is_empty name);
  let i = Ext_string.rfind ~sub:double_underscore name in 
  if i < 0 then 
    let name_len = String.length name in 
    if name.[0] = '_' then  begin 
      let try_key_word = (String.sub name 1 (name_len - 1)) in 
      if name_len > 1 && 
        (not (valid_start_char try_key_word.[0])
        || String_hash_set.mem key_words try_key_word)  then 
        try_key_word
      else 
        name 
    end
    else name 
  else if i = 0 then name 
  else  String.sub name 0 i 


end
module External_process : sig 
#1 "external_process.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)





(**
  [handle_attributes_as_string
  loc pval_name.txt pval_type pval_attributes pval_prim]
  [pval_name.txt] is the name of identifier
  [pval_prim] is the name of string literal

  return value is of [pval_type, pval_prims, new_attrs]
*)
val handle_attributes_as_string :
  Bs_loc.t ->
  string  ->
  Ast_core_type.t ->
  Ast_attributes.t ->
  string   ->
  Ast_core_type.t * string list * Ast_attributes.t




(** [pval_prim_of_labels labels]
    return [pval_prims] for FFI, it is specialized for
    external object which is used in
    {[ [%obj { x = 2; y = 1} ] ]}
*)
val pval_prim_of_labels : string Asttypes.loc list -> string list


val pval_prim_of_option_labels :
  (bool * string Asttypes.loc) list ->
  bool ->
  string list

end = struct
#1 "external_process.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


[@@@ocaml.warning "+9"]
(* record pattern match complete checker*)


let variant_can_bs_unwrap_fields (row_fields : Parsetree.row_field list) : bool =
  let validity =
    List.fold_left
      begin fun st row ->
        match st, row with
        | (* we've seen no fields or only valid fields so far *)
          (`No_fields | `Valid_fields),
          (* and this field has one constructor arg that we can unwrap to *)
          Parsetree.Rtag (label, attrs, false, ([ _ ]))
          ->
          `Valid_fields
        | (* otherwise, this field or a previous field was invalid *)
          _ ->
          `Invalid_field
      end
      `No_fields
      row_fields
  in
  match validity with
  | `Valid_fields -> true
  | `No_fields
  | `Invalid_field -> false


(** Given the type of argument, process its [bs.] attribute and new type,
    The new type is currently used to reconstruct the external type
    and result type in [@@bs.obj]
    They are not the same though, for example
    {[
      external f : hi:([ `hi | `lo ] [@bs.string]) -> unit -> _ = "" [@@bs.obj]
    ]}
    The result type would be [ hi:string ]
*)
let get_arg_type
    ~nolabel 
    (is_optional : bool)
    (ptyp : Ast_core_type.t) :
  External_arg_spec.attr * Ast_core_type.t  =
  let ptyp =

    if is_optional then    
      match ptyp.ptyp_desc with 
      | Ptyp_constr (_, [ty]) -> ty  (*optional*)
      | _ -> assert false
    else 
    
      ptyp in
  if Ast_core_type.is_any ptyp then (* (_[@bs.as ])*)
    if is_optional then
      Bs_syntaxerr.err ptyp.ptyp_loc Invalid_underscore_type_in_external
    else begin
      let ptyp_attrs = ptyp.ptyp_attributes in
      let result = Ast_attributes.iter_process_bs_string_or_int_as ptyp_attrs in
      (* when ppx start dropping attributes
        we should warn, there is a trade off whether
        we should warn dropped non bs attribute or not
      *)
      Bs_ast_invariant.warn_discarded_unused_attributes ptyp_attrs;
      match result with
      |  None ->
        Bs_syntaxerr.err ptyp.ptyp_loc Invalid_underscore_type_in_external
      | Some (`Int i) ->
        Arg_cst(External_arg_spec.cst_int i), Ast_literal.type_int ~loc:ptyp.ptyp_loc ()
      | Some (`Str i)->
        Arg_cst (External_arg_spec.cst_string i), Ast_literal.type_string ~loc:ptyp.ptyp_loc ()
      | Some (`Json_str s) ->
        Arg_cst (External_arg_spec.cst_json ptyp.ptyp_loc s),
        Ast_literal.type_string ~loc:ptyp.ptyp_loc ()

    end
  else (* ([`a|`b] [@bs.string]) *)
    let ptyp_desc = ptyp.ptyp_desc in
    (match Ast_attributes.iter_process_bs_string_int_unwrap_uncurry ptyp.ptyp_attributes with
    | `String ->
      begin match ptyp_desc with
        | Ptyp_variant ( row_fields, Closed, None)
          ->
          Ast_polyvar.map_row_fields_into_strings ptyp.ptyp_loc row_fields
        | _ ->
          Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_string_type
      end
    | `Ignore ->
      Ignore
    | `Int ->
      begin match ptyp_desc with
        | Ptyp_variant ( row_fields, Closed, None) ->
          let int_lists =
            Ast_polyvar.map_row_fields_into_ints ptyp.ptyp_loc row_fields in
          Int int_lists
        | _ -> Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_int_type
      end
    | `Unwrap ->
      begin match ptyp_desc with
        | Ptyp_variant (row_fields, Closed, _)
          when variant_can_bs_unwrap_fields row_fields ->
          Unwrap
        | _ ->
          Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_unwrap_type
      end
    | `Uncurry opt_arity ->
      let real_arity =  Ast_core_type.get_uncurry_arity ptyp in
      (begin match opt_arity, real_arity with
         | Some arity, `Not_function ->
           Fn_uncurry_arity arity
         | None, `Not_function  ->
           Bs_syntaxerr.err ptyp.ptyp_loc Canot_infer_arity_by_syntax
         | None, `Arity arity  ->
           Fn_uncurry_arity arity
         | Some arity, `Arity n ->
           if n <> arity then
             Bs_syntaxerr.err ptyp.ptyp_loc (Inconsistent_arity (arity,n))
           else Fn_uncurry_arity arity
       end)
    | `Nothing ->
      begin match ptyp_desc with
        | Ptyp_constr ({txt = Lident "unit"; _}, [])
          -> if nolabel then Extern_unit else  Nothing
        | Ptyp_constr ({txt = Lident "array"; _}, [_])
          -> Array
        | Ptyp_variant _ ->
          Bs_warnings.prerr_bs_ffi_warning ptyp.ptyp_loc Unsafe_poly_variant_type;
          Nothing
        | _ ->
          Nothing
      end), ptyp



(**
   [@@bs.module "react"]
   [@@bs.module "react"]
   ---
   [@@bs.module "@" "react"]
   [@@bs.module "@" "react"]

   They should have the same module name

   TODO: we should emit an warning if we bind
   two external files to the same module name
*)
type bundle_source =
  [`Nm_payload of string (* from payload [@@bs.val "xx" ]*)
  |`Nm_external of string (* from "" in external *)
  | `Nm_val of string   (* from function name *)
  ]

let string_of_bundle_source (x : bundle_source) =
  match x with
  | `Nm_payload x
  | `Nm_external x
  | `Nm_val x -> x
type name_source =
  [ bundle_source
  | `Nm_na

  ]




type st =
  { val_name : name_source;
    external_module_name : External_ffi_types.external_module_name option;
    module_as_val : External_ffi_types.external_module_name option;
    val_send : name_source ;
    val_send_pipe : Ast_core_type.t option;
    splice : bool ; (* mutable *)
    scopes : string list ;
    set_index : bool; (* mutable *)
    get_index : bool;
    new_name : name_source ;
    call_name : name_source ;
    set_name : name_source ;
    get_name : name_source ;

    mk_obj : bool ;
    return_wrapper : External_ffi_types.return_wrapper ;

  }

let init_st =
  {
    val_name = `Nm_na;
    external_module_name = None ;
    module_as_val = None;
    val_send = `Nm_na;
    val_send_pipe = None;
    splice = false;
    scopes = [];
    set_index = false;
    get_index = false;
    new_name = `Nm_na;
    call_name = `Nm_na;
    set_name = `Nm_na ;
    get_name = `Nm_na ;
    mk_obj = false ;
    return_wrapper = Return_unset;

  }





let process_external_attributes
    no_arguments
    (prim_name_or_pval_prim: [< bundle_source ] as 'a)
    pval_prim
    (prim_attributes : Ast_attributes.t) : _ * Ast_attributes.t =

  (* shared by `[@@bs.val]`, `[@@bs.send]`,
     `[@@bs.set]`, `[@@bs.get]` , `[@@bs.new]`
     `[@@bs.send.pipe]` does not use it
  *)
  let name_from_payload_or_prim ~loc (payload : Parsetree.payload) : name_source =
    match payload with
    | PStr [] ->
      (prim_name_or_pval_prim :> name_source)
    (* It is okay to have [@@bs.val] without payload *)
    | _ ->
      begin match Ast_payload.is_single_string payload with
        | Some  (val_name, _) ->  `Nm_payload val_name
        | None ->
          Location.raise_errorf ~loc "Invalid payload"
      end

  in
  List.fold_left
    (fun (st, attrs)
      (({txt ; loc}, payload) as attr : Ast_attributes.attr)
      ->
        if Ext_string.starts_with txt "bs." then
          begin match txt with
            | "bs.val" ->
              if no_arguments then
                {st with val_name = name_from_payload_or_prim ~loc payload}
              else
                {st with call_name = name_from_payload_or_prim ~loc  payload}

            | "bs.module" ->
              begin match Ast_payload.assert_strings loc payload with
                | [bundle] ->
                  {st with external_module_name =
                             Some {bundle; module_bind_name = Phint_nothing}}
                | [bundle;bind_name] ->
                  {st with external_module_name =
                             Some {bundle; module_bind_name = Phint_name bind_name}}
                | [] ->
                  { st with
                    module_as_val =
                      Some
                        { bundle =
                            string_of_bundle_source
                              (prim_name_or_pval_prim :> bundle_source) ;
                          module_bind_name = Phint_nothing}
                  }
                | _  ->
                  Bs_syntaxerr.err loc Illegal_attribute
              end
            | "bs.scope" ->
              begin match Ast_payload.assert_strings loc payload with
                | [] ->
                  Bs_syntaxerr.err loc Illegal_attribute
                (* We need err on empty scope, so we can tell the difference
                   between unset/set
                *)
                | scopes ->  { st with scopes = scopes }
              end
            | "bs.splice" | "bs.variadic" -> {st with splice = true}
            | "bs.send" ->
              { st with val_send = name_from_payload_or_prim ~loc payload}
            | "bs.send.pipe"
              ->
              { st with val_send_pipe = Some (Ast_payload.as_core_type loc payload)}
            | "bs.set" ->
              {st with set_name = name_from_payload_or_prim ~loc  payload}
            | "bs.get" -> {st with get_name = name_from_payload_or_prim ~loc payload}

            | "bs.new" -> {st with new_name = name_from_payload_or_prim ~loc payload}
            | "bs.set_index" -> {st with set_index = true}
            | "bs.get_index"-> {st with get_index = true}
            | "bs.obj" -> {st with mk_obj = true}
            | "bs.return" ->
              let aux loc txt : External_ffi_types.return_wrapper =
                begin match txt with
                  | "undefined_to_opt" -> Return_undefined_to_opt
                  | "null_to_opt" -> Return_null_to_opt
                  | "nullable"
                  | "null_undefined_to_opt" -> Return_null_undefined_to_opt
                  | "identity" -> Return_identity
                  | _ ->
                    Bs_syntaxerr.err loc Not_supported_directive_in_bs_return
                end in
              let actions =
                Ast_payload.ident_or_record_as_config loc payload
              in
              begin match actions with
                | [ ({txt; _ },None) ] ->
                  { st with return_wrapper = aux loc txt}
                | _ ->
                  Bs_syntaxerr.err loc Not_supported_directive_in_bs_return
              end
            | _ -> (Location.prerr_warning loc (Bs_unused_attribute txt); st)
          end, attrs
        else (st , attr :: attrs)
    )
    (init_st, []) prim_attributes


let rec has_bs_uncurry (attrs : Ast_attributes.t) =
  match attrs with
  | ({txt = "bs.uncurry"; _ }, _) :: attrs ->
    true
  | _ :: attrs -> has_bs_uncurry attrs
  | [] -> false


let check_return_wrapper
    loc (wrapper : External_ffi_types.return_wrapper)
    result_type =
  match wrapper with
  | Return_identity -> wrapper
  | Return_unset  ->
    if Ast_core_type.is_unit result_type then
      Return_replaced_with_unit
    else
      wrapper
  | Return_undefined_to_opt
  | Return_null_to_opt
  | Return_null_undefined_to_opt
    ->
    if Ast_core_type.is_user_option result_type then
      wrapper
    else
      Bs_syntaxerr.err loc Expect_opt_in_bs_return_to_opt
  | Return_replaced_with_unit ->
    assert false (* Not going to happen from user input*)




(** Note that the passed [type_annotation] is already processed by visitor pattern before
*)
let handle_attributes
    (loc : Bs_loc.t)
    (pval_prim : string )
    (type_annotation : Parsetree.core_type)
    (prim_attributes : Ast_attributes.t) (prim_name : string)
  : Ast_core_type.t * string * External_ffi_types.t * Ast_attributes.t =
  (** sanity check here
      {[ int -> int -> (int -> int -> int [@bs.uncurry])]}
      It does not make sense
  *)
  if has_bs_uncurry type_annotation.ptyp_attributes then
    begin
      Location.raise_errorf
        ~loc "[@@bs.uncurry] can not be applied to the whole definition"
    end;

  let prim_name_or_pval_prim =
    if String.length prim_name = 0 then  `Nm_val pval_prim
    else  `Nm_external prim_name  (* need check name *)
  in
  let result_type, arg_types_ty =
    (* Note this assumes external type is syntatic (no abstraction)*)
    Ast_core_type.list_of_arrow type_annotation in
  if has_bs_uncurry result_type.ptyp_attributes then
    begin
      Location.raise_errorf
        ~loc:result_type.ptyp_loc
        "[@@bs.uncurry] can not be applied to tailed position"
    end ;
  let (st, left_attrs) =
    process_external_attributes
      (arg_types_ty = [])
      prim_name_or_pval_prim pval_prim prim_attributes in


  if st.mk_obj then
    begin match st with
      | {
        val_name = `Nm_na;
        external_module_name = None ;
        module_as_val = None;
        val_send = `Nm_na;
        val_send_pipe = None;
        splice = false;
        new_name = `Nm_na;
        call_name = `Nm_na;
        set_name = `Nm_na ;
        get_name = `Nm_na ;
        get_index = false ;
        return_wrapper = Return_unset ;
        set_index = false ;
        mk_obj = _;
        scopes = [];
        (* wrapper does not work with [bs.obj]
           TODO: better error message *)
      } ->
        if String.length prim_name <> 0 then
          Location.raise_errorf ~loc "[@@bs.obj] expect external names to be empty string";
        let arg_kinds, new_arg_types_ty, result_types =
          Ext_list.fold_right arg_types_ty ( [], [], [])
            (fun (label,ty,attr,loc) ( arg_labels, arg_types, result_types) ->
               let arg_label = Ast_compatible.convert label in
               let new_arg_label, new_arg_types,  output_tys =
                 match arg_label with
                 | Nolabel ->
                   let arg_type, new_ty = get_arg_type ~nolabel:true false ty in
                   begin match arg_type with
                     | Extern_unit ->
                       External_arg_spec.empty_kind arg_type, (label,new_ty,attr,loc)::arg_types, result_types
                     | _ ->
                       Location.raise_errorf ~loc "expect label, optional, or unit here"
                   end
                 | Labelled name ->
                   let arg_type, new_ty = get_arg_type ~nolabel:false false ty in
                   begin match arg_type with
                     | Ignore ->
                       External_arg_spec.empty_kind arg_type,
                       (label,new_ty,attr,loc)::arg_types, result_types
                     | Arg_cst  i  ->
                       let s = (Lam_methname.translate ~loc name) in
                       {arg_label = External_arg_spec.label s (Some i);
                        arg_type },
                       arg_types, (* ignored in [arg_types], reserved in [result_types] *)
                       ((name , [], new_ty) :: result_types)
                     | Nothing | Array ->
                       let s = (Lam_methname.translate ~loc name) in
                       {arg_label = External_arg_spec.label s None ; arg_type },
                       (label,new_ty,attr,loc)::arg_types,
                       ((name , [], new_ty) :: result_types)
                     | Int _  ->
                       let s = Lam_methname.translate ~loc name in
                       {arg_label = External_arg_spec.label s None; arg_type},
                       (label,new_ty,attr,loc)::arg_types,
                       ((name, [], Ast_literal.type_int ~loc ()) :: result_types)
                     | NullString _ ->
                       let s = Lam_methname.translate ~loc name in
                       {arg_label = External_arg_spec.label s None; arg_type},
                       (label,new_ty,attr,loc)::arg_types,
                       ((name, [], Ast_literal.type_string ~loc ()) :: result_types)
                     | Fn_uncurry_arity _ ->
                       Location.raise_errorf ~loc
                         "The combination of [@@bs.obj], [@@bs.uncurry] is not supported yet"
                     | Extern_unit -> assert false
                     | NonNullString _
                       ->
                       Location.raise_errorf ~loc
                         "bs.obj label %s does not support such arg type" name
                     | Unwrap ->
                       Location.raise_errorf ~loc
                         "bs.obj label %s does not support [@bs.unwrap] arguments" name
                   end
                 | Optional name ->
                   let arg_type, new_ty_extract = get_arg_type ~nolabel:false true ty in
                   let new_ty = 

                      Ast_core_type.lift_option_type new_ty_extract 

                   in
                   begin match arg_type with
                     | Ignore ->
                       External_arg_spec.empty_kind arg_type,
                       (label,new_ty,attr,loc)::arg_types, result_types

                     | Nothing | Array ->
                       let s = (Lam_methname.translate ~loc name) in
                       {arg_label = External_arg_spec.optional s; arg_type},
                       (label,new_ty,attr,loc)::arg_types,
                       ( (name, [], Ast_comb.to_undefined_type loc new_ty_extract) ::  result_types)
                     | Int _  ->
                       let s = Lam_methname.translate ~loc name in
                       {arg_label = External_arg_spec.optional s ; arg_type },
                       (label,new_ty,attr,loc)::arg_types,
                       ((name, [], Ast_comb.to_undefined_type loc @@ Ast_literal.type_int ~loc ()) :: result_types)
                     | NullString _  ->
                       let s = Lam_methname.translate ~loc name in
                       {arg_label = External_arg_spec.optional s ; arg_type },
                       (label,new_ty,attr,loc)::arg_types,
                       ((name, [], Ast_comb.to_undefined_type loc @@ Ast_literal.type_string ~loc ()) :: result_types)
                     | Arg_cst _
                       ->
                       Location.raise_errorf ~loc "bs.as is not supported with optional yet"
                     | Fn_uncurry_arity _ ->
                       Location.raise_errorf ~loc
                         "The combination of [@@bs.obj], [@@bs.uncurry] is not supported yet"
                     | Extern_unit   -> assert false
                     | NonNullString _
                       ->
                       Location.raise_errorf ~loc
                         "bs.obj label %s does not support such arg type" name
                     | Unwrap ->
                       Location.raise_errorf ~loc
                         "bs.obj label %s does not support [@bs.unwrap] arguments" name
                   end
               in
               (
                 new_arg_label::arg_labels,
                 new_arg_types,
                 output_tys)) in

        let result =
          if Ast_core_type.is_any  result_type then
            Ast_core_type.make_obj ~loc result_types
          else
            snd @@ get_arg_type ~nolabel:true false result_type (* result type can not be labeled *)

        in
        begin          
          Ast_compatible.mk_fn_type new_arg_types_ty result
          ,
          prim_name,
          Ffi_obj_create arg_kinds,
          left_attrs
        end

      | _ -> Location.raise_errorf ~loc "Attribute found that conflicts with [@@bs.obj]"

    end

  else
    let splice = st.splice in
    let arg_type_specs, new_arg_types_ty, arg_type_specs_length   =
      Ext_list.fold_right arg_types_ty
        (match st with
         | {val_send_pipe = Some obj; _ } ->
           let arg_type, new_ty = get_arg_type ~nolabel:true false obj in
           begin match arg_type with
             | Arg_cst _ ->
               Location.raise_errorf ~loc:obj.ptyp_loc "[@bs.as] is not supported in bs.send type "
             | _ ->
               (* more error checking *)
               [External_arg_spec.empty_kind arg_type]
               ,
               [Ast_compatible.no_label, new_ty, [], obj.ptyp_loc]
               ,0
           end

         | {val_send_pipe = None ; _ } -> [],[], 0)
        (fun (label,ty,attr,loc) (arg_type_specs, arg_types, i) ->
           let arg_label = Ast_compatible.convert label in
           let arg_label, arg_type, new_arg_types =
             match arg_label with
             | Optional s  ->

               let arg_type , new_ty = get_arg_type ~nolabel:false true ty in
               begin match arg_type with
                 | NonNullString _ ->
                   (* ?x:([`x of int ] [@bs.string]) does not make sense *)
                   Location.raise_errorf
                     ~loc
                     "[@@bs.string] does not work with optional when it has arities in label %s" s
                 | _ ->
                   External_arg_spec.optional s, arg_type,
                   let new_ty = 

                      Ast_core_type.lift_option_type new_ty 
                      
                    in
                   ((label, new_ty, attr,loc) :: arg_types) end
             | Labelled s  ->
               begin match get_arg_type ~nolabel:false false  ty with
                 | (Arg_cst ( i) as arg_type), new_ty ->
                   External_arg_spec.label s (Some i), arg_type, arg_types
                 | arg_type, new_ty ->
                   External_arg_spec.label s None, arg_type, (label, new_ty,attr,loc) :: arg_types
               end
             | Nolabel ->
               begin match get_arg_type ~nolabel:true false  ty with
                 | (Arg_cst ( i) as arg_type), new_ty ->
                   External_arg_spec.empty_lit i , arg_type,  arg_types
                 | arg_type, new_ty ->
                   External_arg_spec.empty_label, arg_type, (label, new_ty,attr,loc) :: arg_types
               end
           in
           (if i = 0 && splice  then
              match arg_type with
              | Array  -> ()
              | _ ->  Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be an array");
           ({ External_arg_spec.arg_label  ;
              arg_type
            } :: arg_type_specs,
            new_arg_types,
            if arg_type = Ignore then i
            else i + 1
           )
        )  in

    let ffi : External_ffi_types.attr  = match st with
      | {set_index = true;

         val_name = `Nm_na;
         external_module_name = None ;
         module_as_val = None;
         val_send = `Nm_na;
         val_send_pipe = None;
         splice = false;
         scopes ;
         get_index = false;
         new_name = `Nm_na;
         call_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;

         return_wrapper = _;
         mk_obj = _ ;

        }
        ->
        if String.length prim_name <> 0 then
          Location.raise_errorf ~loc "[@@bs.set_index] expect external names to be empty string";
        if arg_type_specs_length = 3 then
          Js_set_index {js_set_index_scopes = scopes}
        else
          Location.raise_errorf ~loc "Ill defined attribute [@@bs.set_index](arity of 3)"

      | {set_index = true; _}
        ->
        Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.set_index]")


      | {get_index = true;

         val_name = `Nm_na;
         external_module_name = None ;
         module_as_val = None;
         val_send = `Nm_na;
         val_send_pipe = None;

         splice = false;
         scopes ;
         new_name = `Nm_na;
         call_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         set_index = false;
         mk_obj;
         return_wrapper ;
        } ->
        if String.length prim_name <> 0 then
          Location.raise_errorf ~loc "[@@bs.get_index] expect external names to be empty string";
        if arg_type_specs_length = 2 then
          Js_get_index {js_get_index_scopes = scopes}
        else Location.raise_errorf ~loc
            "Ill defined attribute [@@bs.get_index] (arity expected 2 : while %d)" arg_type_specs_length

      | {get_index = true; _}

        ->
        Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.get_index]")




      | {module_as_val = Some external_module_name ;

         get_index = false;
         val_name ;
         new_name ;

         external_module_name = None ;
         val_send = `Nm_na;
         val_send_pipe = None;
         scopes = []; (* module as var does not need scopes *)
         splice;
         call_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         set_index = false;
         return_wrapper = _;
         mk_obj = _ ;
        } ->
        begin match arg_types_ty, new_name, val_name  with
          | [], `Nm_na,  _ -> Js_module_as_var external_module_name
          | _, `Nm_na, _ -> Js_module_as_fn {splice; external_module_name }
          | _, #bundle_source, #bundle_source ->
            Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.module].")

          | _, (`Nm_val _ | `Nm_external _) , `Nm_na
            -> Js_module_as_class external_module_name
          | _, `Nm_payload _ , `Nm_na
            ->
            Location.raise_errorf ~loc
              "Incorrect FFI attribute found: (bs.new should not carry a payload here)"
        end
      | {module_as_val = Some x; _}
        ->
        Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.module].")

      | {call_name = (`Nm_val name | `Nm_external name | `Nm_payload name) ;
         splice;
         scopes ;
         external_module_name;

         val_name = `Nm_na ;
         module_as_val = None;
         val_send = `Nm_na ;
         val_send_pipe = None;

         set_index = false;
         get_index = false;
         new_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         mk_obj = _ ;
         return_wrapper = _ ;
        } ->
        Js_call {splice; name; external_module_name; scopes }
      | {call_name = #bundle_source ; _ }
        ->
        Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.val]")


      | {val_name = (`Nm_val name | `Nm_external name | `Nm_payload name);
         external_module_name;

         call_name = `Nm_na ;
         module_as_val = None;
         val_send = `Nm_na ;
         val_send_pipe = None;
         set_index = false;
         get_index = false;
         new_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na;
         mk_obj = _;
         return_wrapper = _;
         splice = false ;
         scopes ;
        }
        ->
        Js_global { name; external_module_name; scopes}
      | {val_name = #bundle_source ; _ }
        ->
        Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.val]")

      | {splice ;
         scopes ;
         external_module_name = (Some _ as external_module_name);

         val_name = `Nm_na ;
         call_name = `Nm_na ;
         module_as_val = None;
         val_send = `Nm_na ;
         val_send_pipe = None;
         set_index = false;
         get_index = false;
         new_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         mk_obj = _ ;
         return_wrapper= _ ;
        }
        ->
        let name = string_of_bundle_source prim_name_or_pval_prim in
        if arg_type_specs_length  = 0 then
          Js_global { name; external_module_name; scopes}
        else  Js_call {splice; name; external_module_name; scopes}
      | {val_send = (`Nm_val name | `Nm_external name | `Nm_payload name);
         splice;
         scopes;
         val_send_pipe = None;
         val_name = `Nm_na  ;
         call_name = `Nm_na ;
         module_as_val = None;
         set_index = false;
         get_index = false;
         new_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         external_module_name = None ;
         mk_obj = _ ;
         return_wrapper = _ ;
        } ->

        (* PR #2162 - since when we assemble arguments the first argument in
           [@@bs.send] is ignored
        *)
        begin match arg_type_specs with
          | [] ->
            Location.raise_errorf
              ~loc "Ill defined attribute [@@bs.send] (the external needs to be a regular function call with at least one argument)"
          |  {arg_type = Arg_cst _ ; arg_label = _} :: _
            ->
            Location.raise_errorf
              ~loc "Ill defined attribute [@@bs.send] (first argument can't be const)"
          | _ :: _  ->
            Js_send {splice ; name; js_send_scopes = scopes ;  pipe = false}
        end

      | {val_send = #bundle_source; _ }
        -> Location.raise_errorf ~loc "You used a FFI attribute that can't be used with [@@bs.send]"

      | {val_send_pipe = Some typ;
         (* splice = (false as splice); *)
         val_send = `Nm_na;
         val_name = `Nm_na  ;
         call_name = `Nm_na ;
         module_as_val = None;
         set_index = false;
         get_index = false;
         new_name = `Nm_na;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         external_module_name = None ;
         mk_obj = _;
         return_wrapper = _;
         scopes;
         splice ;
        } ->
        (** can be one argument *)
        Js_send {splice  ;
                 name = string_of_bundle_source prim_name_or_pval_prim;
                 js_send_scopes = scopes;
                 pipe = true}

      | {val_send_pipe = Some _ ; _}
        -> Location.raise_errorf ~loc "conflict attributes found with [@@bs.send.pipe]"

      | {new_name = (`Nm_val name | `Nm_external name | `Nm_payload name);
         external_module_name;

         val_name = `Nm_na  ;
         call_name = `Nm_na ;
         module_as_val = None;
         set_index = false;
         get_index = false;
         val_send = `Nm_na ;
         val_send_pipe = None;
         set_name = `Nm_na ;
         get_name = `Nm_na ;
         splice ;
         scopes;
         mk_obj = _ ;
         return_wrapper = _ ;

        }
        -> Js_new {name; external_module_name; splice; scopes}
      | {new_name = #bundle_source ; _ }
        ->
        Bs_syntaxerr.err loc (Conflict_ffi_attribute "Attribute found that conflicts with [@@bs.new]")


      | {set_name = (`Nm_val name | `Nm_external name | `Nm_payload name);

         val_name = `Nm_na  ;
         call_name = `Nm_na ;
         module_as_val = None;
         set_index = false;
         get_index = false;
         val_send = `Nm_na ;
         val_send_pipe = None;
         new_name = `Nm_na ;
         get_name = `Nm_na ;
         external_module_name = None;
         splice = false;
         mk_obj = _ ;
         return_wrapper = _;
         scopes ;
        }
        ->
        if arg_type_specs_length = 2 then
          Js_set { js_set_scopes = scopes ; js_set_name = name}
        else  Location.raise_errorf ~loc "Ill defined attribute [@@bs.set] (two args required)"

      | {set_name = #bundle_source; _}
        -> Location.raise_errorf ~loc "conflict attributes found with [@@bs.set]"

      | {get_name = (`Nm_val name | `Nm_external name | `Nm_payload name);

         val_name = `Nm_na  ;
         call_name = `Nm_na ;
         module_as_val = None;
         set_index = false;
         get_index = false;
         val_send = `Nm_na ;
         val_send_pipe = None;
         new_name = `Nm_na ;
         set_name = `Nm_na ;
         external_module_name = None;
         splice = false ;
         mk_obj = _;
         return_wrapper = _;
         scopes
        }
        ->
        if arg_type_specs_length = 1 then
          Js_get { js_get_name = name; js_get_scopes = scopes }
        else
          Location.raise_errorf ~loc "Ill defined attribute [@@bs.get] (only one argument)"
      | {get_name = #bundle_source; _}
        -> Location.raise_errorf ~loc "Attribute found that conflicts with [@@bs.get]"

      | {get_name = `Nm_na;
         val_name = `Nm_na  ;
         call_name = `Nm_na ;
         module_as_val = None;
         set_index = false;
         get_index = false;
         val_send = `Nm_na ;
         val_send_pipe = None;
         new_name = `Nm_na ;
         set_name = `Nm_na ;
         external_module_name = None;
         splice = _ ;
         scopes = _;
         mk_obj = _;
         return_wrapper = _;

        }
        ->  Location.raise_errorf ~loc "Could not infer which FFI category it belongs to, maybe you forgot [%@%@bs.val]? "  in
    begin
      External_ffi_types.check_ffi ~loc ffi;
      (* result type can not be labeled *)
      (* currently we don't process attributes of
         return type, in the future we may  *)
      let  new_result_type  =  result_type in
      (* get_arg_type ~nolabel:true false result_type in *)
      let return_wrapper : External_ffi_types.return_wrapper =
        check_return_wrapper loc st.return_wrapper new_result_type
      in
      Ast_compatible.mk_fn_type new_arg_types_ty new_result_type,  
      prim_name,
      (Ffi_bs (arg_type_specs,return_wrapper ,  ffi)), left_attrs
    end

let handle_attributes_as_string
    pval_loc
    pval_prim
    (typ : Ast_core_type.t) attrs v =
  let pval_type, prim_name, ffi, processed_attrs  =
    handle_attributes pval_loc pval_prim typ attrs v  in
  pval_type, [prim_name; External_ffi_types.to_string ffi], processed_attrs



let pval_prim_of_labels (labels : string Asttypes.loc list)
   =
  let arg_kinds =
    Ext_list.fold_right labels [] 
      (fun {Asttypes.loc ; txt } arg_kinds
        ->
          let arg_label =
            External_arg_spec.label
              (Lam_methname.translate ~loc txt) None in
          {External_arg_spec.arg_type = Nothing ;
           arg_label  } :: arg_kinds
      )
      in
  let encoding =
    External_ffi_types.to_string (Ffi_obj_create arg_kinds) in
  [""; encoding]

let pval_prim_of_option_labels
(labels : (bool * string Asttypes.loc) list)
(ends_with_unit : bool)
  =
  let arg_kinds =
    Ext_list.fold_right labels
      (if ends_with_unit then
         [External_arg_spec.empty_kind Extern_unit]
       else [])
      (fun (is_option,{loc ; txt }) arg_kinds
        ->
          let label_name = (Lam_methname.translate ~loc txt) in
          let arg_label =
            if is_option then
              External_arg_spec.optional label_name
            else External_arg_spec.label label_name None
          in
          {External_arg_spec.arg_type = Nothing ;
           arg_label  } :: arg_kinds
      )      
  in
  let encoding =
    External_ffi_types.to_string (Ffi_obj_create arg_kinds) in
  [""; encoding]


end
module Literals : sig 
#1 "literals.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)






val js_array_ctor : string 
val js_type_number : string
val js_type_string : string
val js_type_object : string
val js_type_boolean : string
val js_undefined : string
val js_prop_length : string

val param : string
val partial_arg : string
val prim : string

(**temporary varaible used in {!Js_ast_util} *)
val tmp : string 

val create : string 
val runtime : string
val stdlib : string
val imul : string

val setter_suffix : string
val setter_suffix_len : int


val debugger : string
val raw_expr : string
val raw_stmt : string
val raw_function : string
val unsafe_downgrade : string
val fn_run : string
val method_run : string
val fn_method : string
val fn_mk : string

(** callback actually, not exposed to user yet *)
(* val js_fn_runmethod : string *)

val bs_deriving : string
val bs_deriving_dot : string
val bs_type : string

(** nodejs *)

val node_modules : string
val node_modules_length : int
val package_json : string
val bsconfig_json : string
val build_ninja : string

(* Name of the library file created for each external dependency. *)
val library_file : string

val suffix_a : string
val suffix_cmj : string
val suffix_cmo : string
val suffix_cma : string
val suffix_cmi : string
val suffix_cmx : string
val suffix_cmxa : string
val suffix_ml : string
val suffix_mlast : string 
val suffix_mlast_simple : string
val suffix_mliast : string
val suffix_mliast_simple : string
val suffix_mlmap : string
val suffix_mll : string
val suffix_re : string
val suffix_rei : string 

val suffix_d : string
val suffix_js : string
val suffix_bs_js : string 
(* val suffix_re_js : string *)
val suffix_gen_js : string 
val suffix_gen_tsx: string

val suffix_tsx : string
val suffix_mlastd : string
val suffix_mliastd : string

val suffix_mli : string 
val suffix_cmt : string 
val suffix_cmti : string 

val commonjs : string 
val amdjs : string 
val es6 : string 
val es6_global : string
val amdjs_global : string 
val unused_attribute : string 
val dash_nostdlib : string

val reactjs_jsx_ppx_2_exe : string 
val reactjs_jsx_ppx_3_exe : string 

val native : string
val bytecode : string
val js : string

val node_sep : string 
val node_parent : string 
val node_current : string 

end = struct
#1 "literals.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)







let js_array_ctor = "Array"
let js_type_number = "number"
let js_type_string = "string"
let js_type_object = "object" 
let js_type_boolean = "boolean"
let js_undefined = "undefined"
let js_prop_length = "length"

let prim = "prim"
let param = "param"
let partial_arg = "partial_arg"
let tmp = "tmp"

let create = "create" (* {!Caml_exceptions.create}*)

let runtime = "runtime" (* runtime directory *)

let stdlib = "stdlib"

let imul = "imul" (* signed int32 mul *)

let setter_suffix = "#="
let setter_suffix_len = String.length setter_suffix

let debugger = "debugger"
let raw_expr = "raw_expr"
let raw_stmt = "raw_stmt"
let raw_function = "raw_function"
let unsafe_downgrade = "unsafe_downgrade"
let fn_run = "fn_run"
let method_run = "method_run"

let fn_method = "fn_method"
let fn_mk = "fn_mk"
(*let js_fn_runmethod = "js_fn_runmethod"*)

let bs_deriving = "bs.deriving"
let bs_deriving_dot = "bs.deriving."
let bs_type = "bs.type"


(** nodejs *)
let node_modules = "node_modules"
let node_modules_length = String.length "node_modules"
let package_json = "package.json"
let bsconfig_json = "bsconfig.json"
let build_ninja = "build.ninja"

(* Name of the library file created for each external dependency. *)
let library_file = "lib"

let suffix_a = ".a"
let suffix_cmj = ".cmj"
let suffix_cmo = ".cmo"
let suffix_cma = ".cma"
let suffix_cmi = ".cmi"
let suffix_cmx = ".cmx"
let suffix_cmxa = ".cmxa"
let suffix_mll = ".mll"
let suffix_ml = ".ml"
let suffix_mli = ".mli"
let suffix_re = ".re"
let suffix_rei = ".rei"
let suffix_mlmap = ".mlmap"

let suffix_cmt = ".cmt" 
let suffix_cmti = ".cmti" 
let suffix_mlast = ".mlast"
let suffix_mlast_simple = ".mlast_simple"
let suffix_mliast = ".mliast"
let suffix_mliast_simple = ".mliast_simple"
let suffix_d = ".d"
let suffix_mlastd = ".mlast.d"
let suffix_mliastd = ".mliast.d"
let suffix_js = ".js"
let suffix_bs_js = ".bs.js"
(* let suffix_re_js = ".re.js" *)
let suffix_gen_js = ".gen.js"
let suffix_gen_tsx = ".gen.tsx"
let suffix_tsx = ".tsx"

let commonjs = "commonjs" 
let amdjs = "amdjs"
let es6 = "es6"
let es6_global = "es6-global"
let amdjs_global = "amdjs-global"
let unused_attribute = "Unused attribute " 
let dash_nostdlib = "-nostdlib"

let reactjs_jsx_ppx_2_exe = "reactjs_jsx_ppx_2.exe"
let reactjs_jsx_ppx_3_exe  = "reactjs_jsx_ppx_3.exe"

let native = "native"
let bytecode = "bytecode"
let js = "js"



(** Used when produce node compatible paths *)
let node_sep = "/"
let node_parent = ".."
let node_current = "."


end
module Ast_util : sig 
#1 "ast_util.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type args = (Ast_compatible.arg_label * Parsetree.expression) list
type loc = Location.t 
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
type 'a cxt = loc -> Bs_ast_mapper.mapper -> 'a

(** In general three kinds of ast generation.
    - convert a curried to type to uncurried 
    - convert a curried fun to uncurried fun
    - convert a uncuried application to normal 
*)
type uncurry_expression_gen = 
  (Parsetree.pattern ->
   Parsetree.expression ->
   Parsetree.expression_desc) cxt
type uncurry_type_gen = 
  (Ast_compatible.arg_label -> (* label for error checking *)
   Parsetree.core_type ->
   Parsetree.core_type  ->
   Parsetree.core_type) cxt

(** TODO: the interface is not reusable, it depends on too much context *)
(** syntax: {[f arg0 arg1 [@bs]]}*)
val uncurry_fn_apply : 
  (Parsetree.expression ->
  args ->
  Parsetree.expression_desc ) cxt 

(** syntax : {[f## arg0 arg1 ]}*)
val method_apply : 
  (Parsetree.expression ->
  string ->
  args ->
  Parsetree.expression_desc) cxt 

(** syntax {[f#@ arg0 arg1 ]}*)
val property_apply : 
  (Parsetree.expression ->
  string ->
  args ->
  Parsetree.expression_desc) cxt 


(** 
    [function] can only take one argument, that is the reason we did not adopt it
    syntax:
    {[ fun [@bs] pat pat1-> body ]}
    [to_uncurry_fn (fun pat -> (fun pat1 -> ...  body))]

*)
val to_uncurry_fn : uncurry_expression_gen


(** syntax: 
    {[fun [@bs.this] obj pat pat1 -> body]}    
*)
val to_method_callback : uncurry_expression_gen


(** syntax : 
    {[ int -> int -> int [@bs]]}
*)
val to_uncurry_type : uncurry_type_gen
  

(** syntax
    {[ method : int -> itn -> int ]}
*)
val to_method_type : uncurry_type_gen

(** syntax:
    {[ 'obj -> int -> int [@bs.this] ]}
*)
val to_method_callback_type : uncurry_type_gen





val record_as_js_object : 
  (label_exprs ->
   Parsetree.expression_desc) cxt 

val js_property : 
  loc ->
  Parsetree.expression -> string -> Parsetree.expression_desc

val handle_debugger : 
  loc -> Ast_payload.t -> Parsetree.expression_desc

val handle_raw : 
  check_js_regex: bool -> loc -> Ast_payload.t -> Parsetree.expression

val handle_external :
  loc -> string -> Parsetree.expression 
  
val handle_raw_structure : 
  loc -> Ast_payload.t -> Parsetree.structure_item

val ocaml_obj_as_js_object :
  (Parsetree.pattern ->
   Parsetree.class_field list ->
   Parsetree.expression_desc) cxt   


 val convertBsErrorFunction : 
   
   (Ast_helper.attrs -> Parsetree.case list -> Parsetree.expression) cxt

end = struct
#1 "ast_util.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

open Ast_helper 
type 'a cxt = Ast_helper.loc -> Bs_ast_mapper.mapper -> 'a
type loc = Location.t 
type args = (Ast_compatible.arg_label * Parsetree.expression) list
type label_exprs = (Longident.t Asttypes.loc * Parsetree.expression) list
type uncurry_expression_gen = 
  (Parsetree.pattern ->
   Parsetree.expression ->
   Parsetree.expression_desc) cxt
type uncurry_type_gen = 
  (Ast_compatible.arg_label ->
   Parsetree.core_type ->
   Parsetree.core_type  ->
   Parsetree.core_type) cxt

let uncurry_type_id = 
  Ast_literal.Lid.js_fn

let method_id  = 
  Ast_literal.Lid.js_meth

let method_call_back_id  = 
  Ast_literal.Lid.js_meth_callback

let arity_lit = "Arity_"

let mk_args loc (n : int) (tys : Parsetree.core_type list) : Parsetree.core_type = 
  Typ.variant ~loc 
    [ Rtag (

      arity_lit ^ string_of_int n
      
      ,
       [], (n = 0),  tys)] Closed None

let generic_lift txt loc args result  = 
  let xs =
    match args with 
    | [ ] -> [mk_args loc 0   [] ; result ]
    | [ x ] -> [ mk_args loc 1 [x] ; result ] 
    | _ -> 
      [mk_args loc (List.length args ) [Typ.tuple ~loc args] ; result ]
  in 
  Typ.constr ~loc {txt ; loc} xs

let lift_curry_type  loc   = 
  generic_lift   uncurry_type_id loc

let lift_method_type loc  = 
  generic_lift  method_id loc

let lift_js_method_callback loc
  = 
  generic_lift method_call_back_id loc 
(** Note that currently there is no way to consume [Js.meth_callback]
    so it is fine to encode it with a freedom, 
    but we need make it better for error message.
    - all are encoded as 
    {[ 
      type fn =  (`Args_n of _ , 'result ) Js.fn
      type method = (`Args_n of _, 'result) Js.method
      type method_callback = (`Args_n of _, 'result) Js.method_callback
    ]}
    For [method_callback], the arity is never zero, so both [method] 
    and  [fn] requires (unit -> 'a) to encode arity zero
*)



let arrow = Ast_compatible.arrow


let js_property loc obj (name : string) =
  Parsetree.Pexp_send
    ((Ast_compatible.app1 ~loc
        (Exp.ident ~loc
           {loc;
            txt = Ldot (Ast_literal.Lid.js_internal, Literals.unsafe_downgrade)})
        obj), 
         
        name

        )

(* TODO: 
   have a final checking for property arities 
     [#=], 
*)


let generic_apply  kind loc 
    (self : Bs_ast_mapper.mapper) 
    (obj : Parsetree.expression) 
    (args : args ) cb   =
  let obj = self.expr self obj in
  let args =
    Ext_list.map args (fun (label,e) ->
        if not (Ast_compatible.is_arg_label_simple label) then
          Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
        self.expr self e
      ) in
  let len = List.length args in 
  let arity, fn, args  = 
    match args with 
    | [ {pexp_desc =
           Pexp_construct ({txt = Lident "()"}, None)}]
      -> 
      0, cb loc obj, []
    | _ -> 
      len,  cb loc obj, args in
  if arity < 10 then 
    let txt = 
      match kind with 
      | `Fn | `PropertyFn ->  
        Longident.Ldot (Ast_literal.Lid.js_internal, 
                        Literals.fn_run ^ string_of_int arity)
      | `Method -> 
        Longident.Ldot(Ast_literal.Lid.js_internal,
                       Literals.method_run ^ string_of_int arity
                      ) in 
    Parsetree.Pexp_apply (Exp.ident {txt ; loc}, (Ast_compatible.no_label,fn) :: Ext_list.map args (fun x -> Ast_compatible.no_label,x))
  else 
    let fn_type, args_type, result_type = Ast_comb.tuple_type_pair ~loc `Run arity  in 
    let string_arity = string_of_int arity in
    let pval_prim, pval_type = 
      match kind with 
      | `Fn | `PropertyFn -> 
        ["#fn_run"; string_arity], 
        arrow ~loc  (lift_curry_type loc args_type result_type ) fn_type
      | `Method -> 
        ["#method_run" ; string_arity], 
        arrow ~loc  (lift_method_type loc args_type result_type) fn_type
    in
    Ast_external_mk.local_external_apply loc ~pval_prim ~pval_type 
      (  fn :: args )


let uncurry_fn_apply loc self fn args = 
  generic_apply `Fn loc self fn args (fun _ obj -> obj )

let property_apply loc self obj name (args : args) 
  =  generic_apply `PropertyFn loc self obj args 
    (fun loc obj -> Exp.mk ~loc (js_property loc obj name))

let method_apply loc self obj name args = 
  generic_apply `Method loc self obj args 
    (fun loc obj -> Exp.mk ~loc (js_property loc obj name))

let generic_to_uncurry_type  kind loc (mapper : Bs_ast_mapper.mapper) label
    (first_arg : Parsetree.core_type) 
    (typ : Parsetree.core_type)  =
  if not (Ast_compatible.is_arg_label_simple label) then
    Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;

  let rec aux acc (typ : Parsetree.core_type) = 
    (* in general, 
       we should collect [typ] in [int -> typ] before transformation, 
       however: when attributes [bs] and [bs.this] found in typ, 
       we should stop 
    *)
    match Ast_attributes.process_attributes_rev typ.ptyp_attributes with 
    | Nothing, _   -> 
      begin match typ.ptyp_desc with 
        | Ptyp_arrow (label, arg, body)
          -> 
          if not (Ast_compatible.is_arg_label_simple label) then
            Bs_syntaxerr.err typ.ptyp_loc Label_in_uncurried_bs_attribute;
          aux (mapper.typ mapper arg :: acc) body 
        | _ -> mapper.typ mapper typ, acc 
      end
    | _, _ -> mapper.typ mapper typ, acc  
  in 
  let first_arg = mapper.typ mapper first_arg in
  let result, rev_extra_args = aux  [first_arg] typ in 
  let args  = List.rev rev_extra_args in 
  let filter_args args  =  
    match args with 
    | [{Parsetree.ptyp_desc = 
          (Ptyp_constr ({txt = Lident "unit"}, []) 
          )}]
      -> []
    | _ -> args in
  match kind with 
  | `Fn ->
    let args = filter_args args in
    lift_curry_type loc args result 
  | `Method -> 
    let args = filter_args args in
    lift_method_type loc args result 

  | `Method_callback
    -> lift_js_method_callback loc args result 


let to_uncurry_type  = 
  generic_to_uncurry_type `Fn
let to_method_type  =
  generic_to_uncurry_type  `Method
let to_method_callback_type  = 
  generic_to_uncurry_type `Method_callback 

let generic_to_uncurry_exp kind loc (self : Bs_ast_mapper.mapper)  pat body 
  = 
  let rec aux acc (body : Parsetree.expression) = 
    match Ast_attributes.process_attributes_rev body.pexp_attributes with 
    | Nothing, _ -> 
      begin match body.pexp_desc with 
        | Pexp_fun (arg_label,_, arg, body)
          -> 
          if not (Ast_compatible.is_arg_label_simple arg_label)  then
            Bs_syntaxerr.err loc Label_in_uncurried_bs_attribute;
          aux (self.pat self arg :: acc) body 
        | _ -> self.expr self body, acc 
      end 
    | _, _ -> self.expr self body, acc  
  in 
  let first_arg = self.pat self pat in  
  let () = 
    match kind with 
    | `Method_callback -> 
      if not @@ Ast_pat.is_single_variable_pattern_conservative first_arg then
        Bs_syntaxerr.err first_arg.ppat_loc  Bs_this_simple_pattern
    | _ -> ()
  in 

  let result, rev_extra_args = aux [first_arg] body in 
  let body = 
    List.fold_left (fun e p -> Ast_compatible.fun_ ~loc p e )
      result rev_extra_args in
  let len = List.length rev_extra_args in 
  let arity = 
    match kind with 
    | `Fn  ->
      begin match rev_extra_args with 
        | [ p]
          ->
          Ast_pat.is_unit_cont ~yes:0 ~no:len p           

        | _ -> len 
      end
    | `Method_callback -> len  in 
  if arity < 10  then 
    let txt = 
      match kind with 
      | `Fn -> 
        Longident.Ldot ( Ast_literal.Lid.js_internal, Literals.fn_mk ^ string_of_int arity)
      | `Method_callback -> 
        Longident.Ldot (Ast_literal.Lid.js_internal,  Literals.fn_method ^ string_of_int arity) in
    Parsetree.Pexp_apply (Exp.ident {txt;loc} , [ Ast_compatible.no_label, body])

  else 
    let pval_prim =
      [ (match kind with 
            | `Fn -> "#fn_mk"
            | `Method_callback -> "#fn_method"); 
        string_of_int arity]  in
    let fn_type , args_type, result_type  = Ast_comb.tuple_type_pair ~loc `Make arity  in 
    let pval_type = arrow ~loc  fn_type (
        match kind with 
        | `Fn -> 
          lift_curry_type loc args_type result_type
        | `Method_callback -> 
          lift_js_method_callback loc args_type result_type
      ) in
    Ast_external_mk.local_extern_cont loc ~pval_prim ~pval_type 
      (fun prim -> Ast_compatible.app1 ~loc prim body) 

let to_uncurry_fn   = 
  generic_to_uncurry_exp `Fn
let to_method_callback  = 
  generic_to_uncurry_exp `Method_callback 


let handle_debugger loc (payload : Ast_payload.t) = 
  match payload with 
  | PStr [] -> 
    Parsetree.Pexp_apply
      (Exp.ident {txt = Ldot(Ast_literal.Lid.js_internal, Literals.debugger ); loc}, 
       [ Ast_compatible.no_label, Ast_literal.val_unit ~loc ()])
  | _ ->  
    Location.raise_errorf ~loc "bs.debugger does not accept payload"


let handle_raw ~check_js_regex loc payload =
  begin match Ast_payload.as_string_exp ~check_js_regex payload with
    | Not_String_Lteral ->
      Location.raise_errorf ~loc
        "bs.raw can only be applied to a string"
    | Ast_payload.JS_Regex_Check_Failed ->
      Location.raise_errorf ~loc "this is an invalid js regex"
    | Correct exp ->
      let pexp_desc = 
        Parsetree.Pexp_apply (
          Exp.ident {loc; 
                     txt = 
                       Ldot (Ast_literal.Lid.js_internal, 
                             Literals.raw_expr)},
          [Ast_compatible.no_label,exp]
        )
      in
      { exp with pexp_desc }
  end

let handle_external loc x = 
  let raw_exp : Ast_exp.t = 
    Ast_compatible.app1
    (Exp.ident ~loc 
         {loc; txt = Ldot (Ast_literal.Lid.js_internal, 
                           Literals.raw_expr)})
      ~loc 
      (Ast_compatible.const_exp_string ~loc x  ~delimiter:Ext_string.empty) in 
  let empty = (* FIXME: the empty delimiter does not make sense*)
    Exp.ident ~loc 
    {txt = Ldot (Ldot(Lident"Js", "Undefined"), "empty");loc}    
  in 
  let undefined_typeof = 
    Exp.ident {loc ; txt = Ldot(Lident "Js","undefinedToOption")} in 
  let typeof = 
    Exp.ident {loc ; txt = Ldot(Lident "Js","typeof")} in 

  Ast_compatible.app1 ~loc undefined_typeof (
    Exp.ifthenelse ~loc
    (Ast_compatible.app2 ~loc 
      (Exp.ident ~loc {loc ; txt = Ldot (Lident "Pervasives", "=")} )            
        (Ast_compatible.app1 ~loc typeof raw_exp)      
        (Ast_compatible.const_exp_string ~loc "undefined")
        )      
      empty
      (Some raw_exp)
  )


let handle_raw_structure loc payload = 
  begin match Ast_payload.as_string_exp ~check_js_regex:false payload with 
    | Correct exp 
      -> 
      let pexp_desc = 
        Parsetree.Pexp_apply(
          Exp.ident {txt = Ldot (Ast_literal.Lid.js_internal,  Literals.raw_stmt); loc},
          [ Ast_compatible.no_label,exp]) in 
      Ast_helper.Str.eval 
        { exp with pexp_desc }

    | Not_String_Lteral
      -> 
      Location.raise_errorf ~loc "bs.raw can only be applied to a string"
    | JS_Regex_Check_Failed 
      ->
      Location.raise_errorf ~loc "this is an invalid js regex"
  end


let ocaml_obj_as_js_object
    loc (mapper : Bs_ast_mapper.mapper)
    (self_pat : Parsetree.pattern)
    (clfs : Parsetree.class_field list) =
  let self_type_lit = "self_type"   in 

  (** Attention: we should avoid type variable conflict for each method  
      Since the method name is unique, there would be no conflict 
      OCaml does not allow duplicate instance variable and duplicate methods, 
      but it does allow duplicates between instance variable and method name, 
      we should enforce such rules 
      {[
        object 
          val x = 3
          method x = 3 
        end [@bs]
      ]} should not compile with a meaningful error message
  *)

  let generate_val_method_pair 
      loc (mapper : Bs_ast_mapper.mapper)
      val_name  is_mutable = 

    let result = Typ.var ~loc val_name in 
    result , 
    ((val_name , [], result ) ::
     (if is_mutable then 
        [val_name ^ Literals.setter_suffix,[],
         to_method_type loc mapper Ast_compatible.no_label result (Ast_literal.type_unit ~loc ()) ]
      else 
        []) )
  in 
  (* Note mapper is only for API compatible 
   * TODO: we should check label name to avoid conflict 
  *)  
  let self_type loc = Typ.var ~loc self_type_lit in 

  let generate_arg_type loc (mapper  : Bs_ast_mapper.mapper)
      method_name arity : Ast_core_type.t = 
    let result = Typ.var ~loc method_name in   
    if arity = 0 then
      to_method_type loc mapper Ast_compatible.no_label (Ast_literal.type_unit ~loc ()) result 

    else
      let tyvars =
        Ext_list.init arity (fun i -> Typ.var ~loc (method_name ^ string_of_int i))
      in
      begin match tyvars with
        | x :: rest ->
          let method_rest =
            Ext_list.fold_right rest result (fun v acc -> Ast_compatible.arrow ~loc  v acc)
          in         
          to_method_type loc mapper Ast_compatible.no_label x method_rest
        | _ -> assert false
      end in          

  let generate_method_type
      loc
      (mapper : Bs_ast_mapper.mapper)
      ?alias_type method_name arity =
    let result = Typ.var ~loc method_name in   

    let self_type =
      let v = self_type loc  in
      match alias_type with 
      | None -> v 
      | Some ty -> Typ.alias ~loc ty self_type_lit
    in  
    if arity = 0 then
      to_method_callback_type loc mapper  Ast_compatible.no_label self_type result      
    else
      let tyvars =
        Ext_list.init arity (fun i -> Typ.var ~loc (method_name ^ string_of_int i))
      in
      begin match tyvars with
        | x :: rest ->
          let method_rest =
            Ext_list.fold_right rest result (fun v acc -> Ast_compatible.arrow ~loc  v acc)
          in         
          (to_method_callback_type loc mapper  Ast_compatible.no_label self_type
             (Ast_compatible.arrow ~loc  x method_rest))
        | _ -> assert false
      end in          


  (** we need calculate the real object type 
      and exposed object type, in some cases there are equivalent

      for public object type its [@bs.meth] it does not depend on itself
      while for label argument it is [@bs.this] which depends internal object
  *)
  let internal_label_attr_types, public_label_attr_types  = 
    Ext_list.fold_right clfs ([], []) 
      (fun ({pcf_loc  = loc} as x  : Parsetree.class_field) 
        (label_attr_types, public_label_attr_types) ->
        match x.pcf_desc with
        | Pcf_method (
            label,
            public_flag,
            Cfk_concrete
              (Fresh, e))
          ->
          begin match e.pexp_desc with
            | Pexp_poly
                (({pexp_desc = Pexp_fun (arg_label, _, pat, e)} ),
                 None) 
              when Ast_compatible.is_arg_label_simple arg_label
              ->  
              let arity = Ast_pat.arity_of_fun pat e in
              let method_type =
                generate_arg_type x.pcf_loc mapper label.txt arity in 
              ((label.Asttypes.txt, [], method_type) :: label_attr_types),
              (if public_flag = Public then
                 (label.Asttypes.txt, [], method_type) :: public_label_attr_types
               else 
                 public_label_attr_types)

            | Pexp_poly( _, Some _)
              ->
              Location.raise_errorf ~loc "polymorphic type annotation not supported yet"
            | Pexp_poly (_, None) ->
              Location.raise_errorf ~loc
                "Unsupported syntax, expect syntax like `method x () = x ` "
            | _ ->
              Location.raise_errorf ~loc "Unsupported syntax in js object"               
          end
        | Pcf_val (label, mutable_flag, Cfk_concrete(Fresh, val_exp)) ->
          let  label_type, label_attr  = 
            generate_val_method_pair x.pcf_loc mapper label.txt  
              (mutable_flag = Mutable )
          in
          (Ext_list.append label_attr  label_attr_types, public_label_attr_types)
        | Pcf_val (label, mutable_flag, Cfk_concrete(Override, val_exp)) -> 
          Location.raise_errorf ~loc "override flag not support currently"
        | Pcf_val (label, mutable_flag, Cfk_virtual _) -> 
          Location.raise_errorf ~loc "virtual flag not support currently"

        | Pcf_method (_, _, Cfk_concrete(Override, _) ) -> 
          Location.raise_errorf ~loc "override flag not supported"

        | Pcf_method (_, _, Cfk_virtual _ )
          ->
          Location.raise_errorf ~loc "virtural method not supported"

        | Pcf_inherit _ 
        | Pcf_initializer _
        | Pcf_attribute _
        | Pcf_extension _
        | Pcf_constraint _ ->
          Location.raise_errorf ~loc "Only method support currently"
      ) in
  let internal_obj_type = Ast_core_type.make_obj ~loc internal_label_attr_types in
  let public_obj_type = Ast_core_type.make_obj ~loc public_label_attr_types in
  let (labels,  label_types, exprs, _) =
    Ext_list.fold_right clfs  ([], [], [], false)
      (fun (x  : Parsetree.class_field)
        (labels,
         label_types,
         exprs, aliased ) ->
        match x.pcf_desc with
        | Pcf_method (
            label,
            _public_flag,
            Cfk_concrete
              (Fresh, e))
          ->
          begin match e.pexp_desc with
            | Pexp_poly
                (({pexp_desc = Pexp_fun (arg_label, None, pat, e)} as f),
                 None)
              when Ast_compatible.is_arg_label_simple arg_label   
              ->  
              let arity = Ast_pat.arity_of_fun pat e in
              let alias_type = 
                if aliased then None 
                else Some internal_obj_type in
              let  label_type =
                generate_method_type ?alias_type
                  x.pcf_loc mapper label.txt arity in 
              (label::labels,
               label_type::label_types,
               {f with
                pexp_desc =
                  let f = Ast_pat.is_unit_cont pat ~yes:e ~no:f in                       
                  to_method_callback loc mapper self_pat f
               } :: exprs, 
               true
              )
            | Pexp_poly( _, Some _)
              ->
              Location.raise_errorf ~loc
                "polymorphic type annotation not supported yet"

            | Pexp_poly (_, None) ->
              Location.raise_errorf
                ~loc "Unsupported syntax, expect syntax like `method x () = x ` "
            | _ ->
              Location.raise_errorf ~loc "Unsupported syntax in js object"               
          end
        | Pcf_val (label, mutable_flag, Cfk_concrete(Fresh, val_exp)) ->
          let  label_type, label_attr  = 
            generate_val_method_pair x.pcf_loc mapper label.txt  
              (mutable_flag = Mutable )
          in
          (label::labels,
           label_type :: label_types, 
           (mapper.expr mapper val_exp :: exprs), 
           aliased 
          )

        | Pcf_val (label, mutable_flag, Cfk_concrete(Override, val_exp)) -> 
          Location.raise_errorf ~loc "override flag not support currently"
        | Pcf_val (label, mutable_flag, Cfk_virtual _) -> 
          Location.raise_errorf ~loc "virtual flag not support currently"

        | Pcf_method (_, _, Cfk_concrete(Override, _) ) -> 
          Location.raise_errorf ~loc "override flag not supported"

        | Pcf_method (_, _, Cfk_virtual _ )
          ->
          Location.raise_errorf ~loc "virtural method not supported"


        | Pcf_inherit _ 
        | Pcf_initializer _
        | Pcf_attribute _
        | Pcf_extension _
        | Pcf_constraint _ ->
          Location.raise_errorf ~loc "Only method support currently"
      )  in
  let pval_type =
    Ext_list.fold_right2  labels label_types public_obj_type
      (fun label label_type acc ->
         Ast_compatible.label_arrow
           ~loc:label.Asttypes.loc
           label.Asttypes.txt
           label_type acc           
      ) in
  Ast_external_mk.local_extern_cont
    loc
    ~pval_prim:(External_process.pval_prim_of_labels labels)
    (fun e ->
       Ast_compatible.apply_labels ~loc e
         (Ext_list.map2 labels exprs (fun l expr -> l.txt, expr) ) )
    ~pval_type


let record_as_js_object 
    loc 
    (self : Bs_ast_mapper.mapper)
    (label_exprs : label_exprs)
  : Parsetree.expression_desc = 

  let labels,args, arity =
    Ext_list.fold_right label_exprs ([],[],0) (fun ({txt ; loc}, e) (labels,args,i) -> 
        match txt with
        | Lident x ->
          ({Asttypes.loc = loc ; txt = x} :: labels, (x, self.expr self e) :: args, i + 1)
        | Ldot _ | Lapply _ ->  
          Location.raise_errorf ~loc "invalid js label ")  in
  Ast_external_mk.local_external_obj loc 
    ~pval_prim:(External_process.pval_prim_of_labels labels)
    ~pval_type:(Ast_core_type.from_labels ~loc arity labels) 
    args 



let isCamlExceptionOrOpenVariant : Longident.t = 
  Ldot (Ldot (Lident "Js","Exn"), "isCamlExceptionOrOpenVariant")

  
let obj_magic : Longident.t = 
  Ldot (Lident "Obj", "magic")


let rec checkCases (cases : Parsetree.case list) = 
  List.iter check_case cases 
and check_case case = 
  check_pat case.pc_lhs 
and check_pat (pat : Parsetree.pattern) = 
  match pat.ppat_desc with 
  | Ppat_construct _ -> ()
  | Ppat_or (l,r) -> 
    check_pat l; check_pat r 
  | _ ->  Location.raise_errorf ~loc:pat.ppat_loc "Unsupported pattern in `bs.open`" 

let convertBsErrorFunction loc  (self : Bs_ast_mapper.mapper) attrs (cases : Parsetree.case list ) =
  let txt  = "match" in 
  let txt_expr = Exp.ident ~loc {txt = Lident txt; loc} in 
  let none = Exp.construct ~loc {txt = Ast_literal.predef_none ; loc} None in
  let () = checkCases cases in  
  let cases = self.cases self cases in 
  Ast_compatible.fun_ ~attrs ~loc ( Pat.var ~loc  {txt; loc })
    (Exp.ifthenelse
    ~loc 
    (Ast_compatible.app1 ~loc (Exp.ident ~loc {txt = isCamlExceptionOrOpenVariant ; loc}) txt_expr )
    (Exp.match_ ~loc 
       (Exp.constraint_ ~loc 
          (Ast_compatible.app1  ~loc (Exp.ident ~loc {txt =  obj_magic; loc})  txt_expr)
          (Ast_literal.type_exn ~loc ())
       )
      (Ext_list.map_append cases 
        [ Exp.case  (Pat.any ~loc ()) none] 
        (fun x ->
           let pc_rhs = x.pc_rhs in 
           let  loc  = pc_rhs.pexp_loc in
           {
             x with pc_rhs = Exp.construct ~loc {txt = Ast_literal.predef_some;loc} (Some pc_rhs)
                        
           })))
    (Some none))
    
                       

end
module Ext_ref : sig 
#1 "ext_ref.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(** [non_exn_protect ref value f] assusme [f()] 
    would not raise
*)

val non_exn_protect : 'a ref -> 'a -> (unit -> 'b) -> 'b
val protect : 'a ref -> 'a -> (unit -> 'b) -> 'b

val protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c

(** [non_exn_protect2 refa refb va vb f ]
    assume [f ()] would not raise
*)
val non_exn_protect2 : 'a ref -> 'b ref -> 'a -> 'b -> (unit -> 'c) -> 'c

val protect_list : ('a ref * 'a) list -> (unit -> 'b) -> 'b

end = struct
#1 "ext_ref.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

let non_exn_protect r v body = 
  let old = !r in
  r := v;
  let res = body() in
  r := old;
  res

let protect r v body =
  let old = !r in
  try
    r := v;
    let res = body() in
    r := old;
    res
  with x ->
    r := old;
    raise x

let non_exn_protect2 r1 r2 v1 v2 body = 
  let old1 = !r1 in
  let old2 = !r2 in  
  r1 := v1;
  r2 := v2;
  let res = body() in
  r1 := old1;
  r2 := old2;
  res

let protect2 r1 r2 v1 v2 body =
  let old1 = !r1 in
  let old2 = !r2 in  
  try
    r1 := v1;
    r2 := v2;
    let res = body() in
    r1 := old1;
    r2 := old2;
    res
  with x ->
    r1 := old1;
    r2 := old2;
    raise x

let protect_list rvs body = 
  let olds =  Ext_list.map  rvs (fun (x,y) -> !x) in 
  let () = List.iter (fun (x,y) -> x:=y) rvs in 
  try 
    let res = body () in 
    List.iter2 (fun (x,_) old -> x := old) rvs olds;
    res 
  with e -> 
    List.iter2 (fun (x,_) old -> x := old) rvs olds;
    raise e 

end
module Ast_core_type_class_type : sig 
#1 "ast_core_type_class_type.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



val handle_class_type_fields :  
  Bs_ast_mapper.mapper ->
  Parsetree.class_type_field list -> 
  Parsetree.class_type_field list 

val handle_core_type :
  Bs_ast_mapper.mapper ->
  Parsetree.core_type ->  
  bool ref ->
  Parsetree.core_type
end = struct
#1 "ast_core_type_class_type.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
open Ast_helper

let process_getter_setter 
    ~not_getter_setter
    ~(get : Parsetree.core_type -> _ -> Parsetree.attributes -> _) ~set
    loc name
    (attrs : Ast_attributes.t)
    (ty : Parsetree.core_type) (acc : _ list)  =
  match Ast_attributes.process_method_attributes_rev attrs with 
  | {get = None; set = None}, _  ->  not_getter_setter ty :: acc 
  | st , pctf_attributes
    -> 
    let get_acc = 
      match st.set with 
      | Some `No_get -> acc 
      | None 
      | Some `Get -> 
        let lift txt = 
          Typ.constr ~loc {txt ; loc} [ty] in
        let (null,undefined) =                
          match st with 
          | {get = Some (null, undefined) } -> (null, undefined)
          | {get = None} -> (false, false ) in 
        let ty = 
          match (null,undefined) with 
          | false, false -> ty
          | true, false -> lift Ast_literal.Lid.js_null
          | false, true -> lift Ast_literal.Lid.js_undefined
          | true , true -> lift Ast_literal.Lid.js_null_undefined in
        get ty name pctf_attributes
        :: acc  
    in 
    if st.set = None then get_acc 
    else
      set ty 

      (name ^ Literals.setter_suffix)

      pctf_attributes         
      :: get_acc 


let handle_class_type_field self
    ({pctf_loc = loc } as ctf : Parsetree.class_type_field)
    acc =
  match ctf.pctf_desc with 
  | Pctf_method 
      (name, private_flag, virtual_flag, ty) 
    ->
    let not_getter_setter (ty : Parsetree.core_type) =
      let ty = 
        match ty.ptyp_desc with 
        | Ptyp_arrow (label, args, body) 
          ->
          Ast_util.to_method_type
            ty.ptyp_loc  self label args body

        | Ptyp_poly (strs, {ptyp_desc = Ptyp_arrow (label, args, body);
                            ptyp_loc})
          ->
          {ty with ptyp_desc = 
                     Ptyp_poly(strs,             
                               Ast_util.to_method_type
                                 ptyp_loc  self label args body  )}
        | _ -> 
          self.typ self ty
      in 
      {ctf with 
       pctf_desc = 
         Pctf_method (name , private_flag, virtual_flag, ty)}
    in
    let get ty name pctf_attributes =
      {ctf with 
       pctf_desc =  
         Pctf_method (name , 
                      private_flag, 
                      virtual_flag, 
                      self.typ self ty
                     );
       pctf_attributes} in
    let set ty name pctf_attributes =
      {ctf with 
       pctf_desc =
         Pctf_method (name, 
                      private_flag,
                      virtual_flag,
                      Ast_util.to_method_type
                        loc self Ast_compatible.no_label ty
                        (Ast_literal.type_unit ~loc ())
                     );
       pctf_attributes} in
    process_getter_setter ~not_getter_setter ~get ~set loc name ctf.pctf_attributes ty acc     

  | Pctf_inherit _ 
  | Pctf_val _ 
  | Pctf_constraint _
  | Pctf_attribute _ 
  | Pctf_extension _  -> 
    Bs_ast_mapper.default_mapper.class_type_field self ctf :: acc 
      

(*
  Attributes are very hard to attribute
  (since ptyp_attributes could happen in so many places), 
  and write ppx extensions correctly, 
  we can only use it locally
*)

let handle_core_type 
    ~(super : Bs_ast_mapper.mapper) 
    ~(self : Bs_ast_mapper.mapper)
    (ty : Parsetree.core_type) 
    record_as_js_object
  = 
  match ty with
  | {ptyp_desc = Ptyp_extension({txt = ("bs.obj"|"obj")}, PTyp ty)}
    -> 
    Ext_ref.non_exn_protect record_as_js_object true 
      (fun _ -> self.typ self ty )
  | {ptyp_attributes ;
     ptyp_desc = Ptyp_arrow (label, args, body);
     (* let it go without regard label names, 
        it will report error later when the label is not empty
     *)     
     ptyp_loc = loc
    } ->
    begin match  Ast_attributes.process_attributes_rev ptyp_attributes with 
      | Uncurry _, ptyp_attributes ->
        Ast_util.to_uncurry_type loc self label args body 
      | Meth_callback _, ptyp_attributes ->
        Ast_util.to_method_callback_type loc self label args body
      | Method _, ptyp_attributes ->
        Ast_util.to_method_type loc self label args body
      | Nothing , _ -> 
        Bs_ast_mapper.default_mapper.typ self ty
    end
  | {
    ptyp_desc =  Ptyp_object ( methods, closed_flag) ;
    ptyp_loc = loc 
  } -> 
    let (+>) attr (typ : Parsetree.core_type) =
      {typ with ptyp_attributes = attr :: typ.ptyp_attributes} in           
    let new_methods =
      Ext_list.fold_right  methods []  (fun  meth_ acc ->
        match meth_ with 
        
          (label, ptyp_attrs, core_type) -> 
          let get ty name attrs =
            let attrs, core_type =
              match Ast_attributes.process_attributes_rev attrs with
              | Nothing, attrs -> attrs, ty (* #1678 *)
              | Uncurry attr , attrs ->
                attrs, attr +> ty
              | Method _, _
                -> Location.raise_errorf ~loc "bs.get/set conflicts with bs.meth"
              | Meth_callback attr, attrs ->
                attrs, attr +> ty 
            in 
            Ast_compatible.object_field name  attrs (self.typ self core_type) in
          let set ty name attrs =
            let attrs, core_type =
              match Ast_attributes.process_attributes_rev attrs with
              | Nothing, attrs -> attrs, ty
              | Uncurry attr, attrs ->
                attrs, attr +> ty 
              | Method _, _
                -> Location.raise_errorf ~loc "bs.get/set conflicts with bs.meth"
              | Meth_callback attr, attrs ->
                attrs, attr +> ty
            in               
            Ast_compatible.object_field name attrs (Ast_util.to_method_type loc self Ast_compatible.no_label core_type 
              (Ast_literal.type_unit ~loc ())) in
          let not_getter_setter ty =
            let attrs, core_type =
              match Ast_attributes.process_attributes_rev ptyp_attrs with
              | Nothing, attrs -> attrs, ty
              | Uncurry attr, attrs ->
                attrs, attr +> ty 
              | Method attr, attrs -> 
                attrs, attr +> ty 
              | Meth_callback attr, attrs ->
                attrs, attr +> ty  in            
            Ast_compatible.object_field label attrs (self.typ self core_type) in
          process_getter_setter ~not_getter_setter ~get ~set
            loc label ptyp_attrs core_type acc
        )in      
    let inner_type =
      { ty
        with ptyp_desc = Ptyp_object(new_methods, closed_flag);
      } in 
    if !record_as_js_object then 
      Ast_comb.to_js_type loc inner_type          
    else inner_type
  | _ -> super.typ self ty
    
let handle_class_type_fields self fields = 
  Ext_list.fold_right fields []
  (handle_class_type_field self)
  
  
let handle_core_type self typ record_as_js_object =
  handle_core_type 
  ~super:Bs_ast_mapper.default_mapper
  ~self typ record_as_js_object
end
module Ast_signature : sig 
#1 "ast_signature.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type item = Parsetree.signature_item
type t = item list 


val fuseAll : ?loc:Ast_helper.loc ->  t -> item
end = struct
#1 "ast_signature.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type item = Parsetree.signature_item
type t = item list 

open Ast_helper

let fuseAll ?(loc=Location.none)  (t : t) : item = 
  Sig.include_ ~loc (Incl.mk ~loc (Mty.signature ~loc t))
  
end
module Ast_structure : sig 
#1 "ast_structure.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


type item = Parsetree.structure_item

type t = item list 


val fuseAll: ?loc:Ast_helper.loc ->  t -> item

(* val fuse_with_constraint:
  ?loc:Ast_helper.loc ->
  Parsetree.type_declaration list ->
  t   ->
  Ast_signature.t -> 
  item *)

val constraint_ : ?loc:Ast_helper.loc -> t -> Ast_signature.t -> item

val dummy_item : Location.t -> item 
end = struct
#1 "ast_structure.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type item = Parsetree.structure_item

type t = item list 

open Ast_helper


let fuseAll ?(loc=Location.none)  (t : t) : item = 
  Str.include_ ~loc 
    (Incl.mk ~loc (Mod.structure ~loc t ))
    
(* let fuse_with_constraint
    ?(loc=Location.none) 
    (item : Parsetree.type_declaration list ) (t : t) (coercion) = 
  Str.include_ ~loc 
    (Incl.mk ~loc 
       (Mod.constraint_
         (Mod.structure ~loc 
         ({pstr_loc = loc; pstr_desc = Pstr_type item} :: t) )
         (
           Mty.signature ~loc 
           ({psig_loc = loc; psig_desc = Psig_type item} :: coercion)
         )
         )
    )      *)
let constraint_ ?(loc=Location.none) (stru : t) (sign : Ast_signature.t) = 
  Str.include_ ~loc
    (Incl.mk ~loc 
       (Mod.constraint_ ~loc (Mod.structure ~loc stru) (Mty.signature ~loc sign)))

let dummy_item  loc : item =        
  Str.eval ~loc (Ast_literal.val_unit ~loc ())
end
module Ast_derive : sig 
#1 "ast_derive.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type tdcls = Parsetree.type_declaration list 

type gen = {
  structure_gen : tdcls -> bool -> Ast_structure.t ;
  signature_gen : tdcls -> bool -> Ast_signature.t ; 
  expression_gen : (Parsetree.core_type -> Parsetree.expression) option ; 
}

(**
   [register name cb]
   example: [register "accessors" cb]
*)
val register : 
  string -> 
  (Parsetree.expression option -> gen) -> 
  unit

(* val gen_structure: 
  tdcls  ->
  Ast_payload.action list ->
  bool -> 
  Ast_structure.t *)

val gen_signature: 
  tdcls ->
  Ast_payload.action list -> 
  bool -> 
  Ast_signature.t


val gen_expression : 
  string Asttypes.loc -> 
  Parsetree.core_type -> 
  Parsetree.expression



val gen_structure_signature :  
  Location.t -> 
  Parsetree.type_declaration list ->
  Ast_payload.action -> 
  bool -> 
  Parsetree.structure_item
end = struct
#1 "ast_derive.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type tdcls = Parsetree.type_declaration list

type gen = {
  structure_gen : tdcls -> bool -> Ast_structure.t ;
  signature_gen : tdcls -> bool -> Ast_signature.t ; 
  expression_gen : (Parsetree.core_type -> Parsetree.expression) option ; 
}

(* the first argument is [config] payload
   {[
     { x = {uu} }
   ]}
*)
type derive_table  = 
  (Parsetree.expression option -> gen) String_map.t

let derive_table : derive_table ref = ref String_map.empty

let register key value = 
  derive_table := String_map.add key value !derive_table 



(* let gen_structure 
    (tdcls : tdcls)
    (actions :  Ast_payload.action list ) 
    (explict_nonrec : bool )
  : Ast_structure.t = 
  Ext_list.flat_map
    (fun action -> 
       (Ast_payload.table_dispatch !derive_table action).structure_gen 
         tdcls explict_nonrec) actions *)

let gen_signature
    tdcls
    (actions :  Ast_payload.action list ) 
    (explict_nonrec : bool )
  : Ast_signature.t = 
  Ext_list.flat_map actions
    (fun action -> 
       (Ast_payload.table_dispatch !derive_table action).signature_gen
         tdcls explict_nonrec) 

(** used for cases like [%sexp] *)         
let gen_expression ({Asttypes.txt ; loc}) typ =
  let txt = Ext_string.tail_from txt (String.length Literals.bs_deriving_dot) in 
  match (Ast_payload.table_dispatch !derive_table 
           ({txt ; loc}, None)).expression_gen with 
  | None ->
    Bs_syntaxerr.err loc (Unregistered txt)

  | Some f -> f typ

open Ast_helper  
let gen_structure_signature 
    loc
    (tdcls : tdcls)   
    (action : Ast_payload.action)
    (explicit_nonrec : bool) = 
  let derive_table = !derive_table in  
  let u = 
    Ast_payload.table_dispatch derive_table action in  

  let a = u.structure_gen tdcls explicit_nonrec in
  let b = u.signature_gen tdcls explicit_nonrec in
  Str.include_ ~loc  
    (Incl.mk ~loc 
       (Mod.constraint_ ~loc
          (Mod.structure ~loc a)
          (Mty.signature ~loc b )
       )
    )
end
module Ast_derive_util : sig 
#1 "ast_derive_util.mli"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

(** Given a type declaration, extaract the type expression, mostly 
  used in code gen later
 *)
 val core_type_of_type_declaration :
  Parsetree.type_declaration -> Parsetree.core_type

val new_type_of_type_declaration : 
  Parsetree.type_declaration -> 
  string -> 
  Parsetree.core_type * Parsetree.type_declaration


val mk_fun :
  loc:Location.t ->
  Parsetree.core_type ->
  string -> Parsetree.expression -> Parsetree.expression
val destruct_label_declarations :
  loc:Location.t ->
  string ->
  Parsetree.label_declaration list ->
  (Parsetree.core_type * Parsetree.expression) list * string list

val notApplicable:   
  Location.t ->
  string -> 
  unit 

val invalid_config : Parsetree.expression -> 'a   
end = struct
#1 "ast_derive_util.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

open Ast_helper

let core_type_of_type_declaration 
    (tdcl : Parsetree.type_declaration) = 
  match tdcl with 
  | {ptype_name = {txt ; loc};
     ptype_params ;
    } -> 
    Typ.constr 
      {txt = Lident txt ; loc}
      (Ext_list.map ptype_params  fst)

let new_type_of_type_declaration 
    (tdcl : Parsetree.type_declaration) newName = 
  match tdcl with 
  | {ptype_name = { loc};
     ptype_params ;
    } -> 
    (Typ.constr 
      {txt = Lident newName ; loc}
      (Ext_list.map ptype_params fst ),
      { Parsetree.ptype_params = tdcl.ptype_params;
        ptype_name = {txt = newName;loc};
        ptype_kind = Ptype_abstract; 
        ptype_attributes = [];
        ptype_loc = tdcl.ptype_loc;
        ptype_cstrs = []; ptype_private = Public; ptype_manifest = None}
    )
      

let mk_fun ~loc (typ : Parsetree.core_type) 
    (value : string) body
  : Parsetree.expression = 
  Ast_compatible.fun_
    (Pat.constraint_ (Pat.var {txt = value ; loc}) typ)
    body

let destruct_label_declarations ~loc
    (arg_name : string)
    (labels : Parsetree.label_declaration list) : 
  (Parsetree.core_type * Parsetree.expression) list * string list 
  =
  Ext_list.fold_right labels ([], [])
    (fun {pld_name = {txt}; pld_type} 
      (core_type_exps, labels) -> 
      ((pld_type, 
        Exp.field (Exp.ident {txt = Lident arg_name ; loc}) 
          {txt = Lident txt ; loc}) :: core_type_exps),
      txt :: labels 
    ) 

let notApplicable 
  loc derivingName = 
  Location.prerr_warning 
    loc
    (Warnings.Bs_derive_warning ( derivingName ^ " not applicable to this type"))
    
let invalid_config (config : Parsetree.expression) = 
  Location.raise_errorf ~loc:config.pexp_loc "such configuration is not supported"
    
end
module Ast_derive_js_mapper : sig 
#1 "ast_derive_js_mapper.mli"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



val init : unit -> unit
end = struct
#1 "ast_derive_js_mapper.ml"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

open Ast_helper
module U = Ast_derive_util
type tdcls = Parsetree.type_declaration list 

let js_field (o : Parsetree.expression) m = 
  Ast_compatible.app2
    (Exp.ident {txt = Lident "##"; loc = o.pexp_loc})
    o
    (Exp.ident m)




let handle_config (config : Parsetree.expression option) = 
  match config with 
  | Some config -> 
    (match config.pexp_desc with 
     | Pexp_record (
         [ 
           {txt = Lident "newType"}, 
           {pexp_desc = 
              (Pexp_construct 
                 (
                   {txt =
                      Lident ("true" 
                             | "false" 
                               as x)}, None)
              | Pexp_ident {txt = Lident ("newType" as x)}
              )
           }
         ],None)
       ->  not (x = "false")
     | Pexp_ident {txt = Lident ("newType")} 
       -> true
     | _ -> U.invalid_config config)
  | None -> false
let noloc = Location.none
(* [eraseType] will be instrumented, be careful about the name conflict*)  
let eraseTypeLit = "jsMapperEraseType"
let eraseTypeExp = Exp.ident {loc = noloc; txt = Lident eraseTypeLit}
let eraseType x = 
  Ast_compatible.app1 eraseTypeExp  x
let eraseTypeStr = 
  let any = Typ.any () in 
  Str.primitive 
    (Val.mk ~prim:["%identity"] {loc = noloc; txt = eraseTypeLit}
       (Ast_compatible.arrow any any)
    )

let app2 = Ast_compatible.app2
let app3 = Ast_compatible.app3

let (<=~) a b =   
  app2 (Exp.ident {loc = noloc; txt = Lident "<="}) a b 
let (-~) a b =   
  app2 (Exp.ident {loc = noloc; txt = Ldot(Lident "Pervasives","-")})
    a b 
let (+~) a b =   
  app2 (Exp.ident {loc = noloc; txt = Ldot(Lident "Pervasives","+")})
    a b 
let (&&~) a b =   
  app2 (Exp.ident {loc = noloc; txt = Ldot(Lident "Pervasives","&&")})
    a b 
let (->~) a b = Ast_compatible.arrow a b 
let jsMapperRt =     
  Longident.Ldot (Lident "Js", "MapperRt")

let search upper polyvar array = 
  app3
    (Exp.ident ({loc = noloc; 
                 txt = Longident.Ldot (jsMapperRt,"binarySearch") })
    )                                 
    upper
    (eraseType polyvar)
    array

let revSearch len constantArray exp =   
  app3 
    (Exp.ident 
       {loc= noloc; 
        txt = Longident.Ldot (jsMapperRt, "revSearch")})
    len
    constantArray
    exp

let revSearchAssert  len constantArray exp =   
  app3 
    (Exp.ident 
       {loc= noloc; 
        txt = Longident.Ldot (jsMapperRt, "revSearchAssert")})
    len
    constantArray
    exp

let toInt exp array =     
  app2
    (Exp.ident 
       { loc=noloc; 
         txt = Longident.Ldot (jsMapperRt, "toInt")})
    (eraseType exp)
    array
let fromInt len array exp = 
  app3
    (Exp.ident 
       {loc = noloc; 
        txt = Longident.Ldot (jsMapperRt,"fromInt")})
    len
    array
    exp

let fromIntAssert len array exp = 
  app3
    (Exp.ident 
       {loc = noloc; 
        txt = Longident.Ldot (jsMapperRt,"fromIntAssert")})
    len
    array
    exp


let assertExp e = 
  Exp.extension 
    ({Asttypes.loc = noloc; txt = "assert"},
     (PStr 
        [Str.eval e ]
     )
    )
let derivingName = "jsConverter"

(* let notApplicable loc = 
   Location.prerr_warning 
    loc
    (Warnings.Bs_derive_warning ( derivingName ^ " not applicable to this type")) *)

let init () =      
  Ast_derive.register
    derivingName
    (fun ( x : Parsetree.expression option) -> 
       let createType = handle_config x in 

       {
         structure_gen = (fun (tdcls : tdcls) _ -> 
             let handle_tdcl (tdcl: Parsetree.type_declaration) =
               let core_type = U.core_type_of_type_declaration tdcl
               in 
               let name = tdcl.ptype_name.txt in 
               let toJs = name ^ "ToJs" in 
               let fromJs = name ^ "FromJs" in 
               let constantArray = "jsMapperConstantArray" in 
               let loc = tdcl.ptype_loc in 
               let patToJs = {Asttypes.loc; txt = toJs} in 
               let patFromJs = {Asttypes.loc; txt = fromJs} in 
               let param = "param" in 

               let ident_param = {Asttypes.txt = Longident.Lident param; loc} in 
               let pat_param = {Asttypes.loc; txt = param} in 
               let exp_param = Exp.ident ident_param in 
               let newType,newTdcl =
                 U.new_type_of_type_declaration tdcl ("abs_" ^ name) in 
               let newTypeStr = Ast_compatible.rec_type_str [newTdcl] in   
               let toJsBody body = 
                 Ast_comb.single_non_rec_value patToJs
                   (Ast_compatible.fun_ (Pat.constraint_ (Pat.var pat_param) core_type) 
                      body )
               in 
               let (+>) a ty = 
                 Exp.constraint_ (eraseType a) ty in 
               let (+:) a ty =                  
                 eraseType (Exp.constraint_ a ty) in 
               let coerceResultToNewType e =
                 if createType then 
                   e +> newType
                 else e  in                  
               match tdcl.ptype_kind with  
               | Ptype_record label_declarations -> 
                 let exp = 
                   coerceResultToNewType
                     (Exp.extension 
                        (
                          {Asttypes.loc; txt = "bs.obj"},
                          (PStr
                             [Str.eval  
                                (Exp.record
                                   (Ext_list.map label_declarations
                                      (fun {pld_name = {loc; txt } }  -> 
                                         let label = 
                                           {Asttypes.loc; txt = Longident.Lident txt } in 
                                         label,Exp.field exp_param label) ) None)]))) in 
                 let toJs = 
                   toJsBody exp
                 in 
                 let obj_exp = 
                   Exp.record
                     (Ext_list.map label_declarations
                        (fun {pld_name = {loc; txt } } -> 
                           let label = 
                             {Asttypes.loc; txt = Longident.Lident txt } in 
                           label,
                           js_field exp_param  label) ) None in 
                 let fromJs = 
                   Ast_comb.single_non_rec_value patFromJs
                     (Ast_compatible.fun_ (Pat.var pat_param)
                        (if createType then                                             
                           (Exp.let_ Nonrecursive
                              [Vb.mk 
                                 (Pat.var pat_param) 
                                 (exp_param +: newType)]
                              (Exp.constraint_ obj_exp core_type) )
                         else 
                           (Exp.constraint_ obj_exp core_type) ))
                 in
                 let rest = 
                   [
                     toJs;
                     fromJs
                   ] in 
                 if createType then eraseTypeStr:: newTypeStr :: rest else rest 
               | Ptype_abstract -> 
                 (match Ast_polyvar.is_enum_polyvar tdcl with 
                  | Some row_fields ->               
                    let expConstantArray =   
                      Exp.ident {loc; txt = Longident.Lident constantArray} in 
                    let result :  _ list = 
                      Ext_list.map row_fields (fun tag -> 
                          match tag with 
                          | Rtag (label, attrs, _, []) -> 
                            (Ast_compatible.hash_label label,
                             match Ast_attributes.iter_process_bs_string_as_ast attrs with 
                             | Some name -> 
                               name
                             | None -> 
                               Ast_compatible.const_exp_string(Ast_compatible.label_of_name label)
                            )
                          | _ -> assert false (* checked by [is_enum_polyvar] *)
                        ) in 
                    let result_len = List.length result in 
                    let exp_len = Ast_compatible.const_exp_int result_len in 
                    let v = [
                      eraseTypeStr;
                      Ast_comb.single_non_rec_value 
                        {loc; txt = constantArray}
                        (Exp.array
                           (Ext_list.map (List.sort (fun (a,_) (b,_) -> compare (a:int) b) result)
                              (fun (i,str) -> 
                                 Exp.tuple 
                                   [
                                     Ast_compatible.const_exp_int i;
                                     str
                                   ]
                              ) ));
                      (
                        toJsBody
                          (coerceResultToNewType 
                             (search
                                exp_len
                                exp_param
                                expConstantArray 
                             ))
                      );
                      Ast_comb.single_non_rec_value
                        patFromJs
                        (Ast_compatible.fun_
                           (Pat.var pat_param)
                           (if createType then 
                              revSearchAssert
                                exp_len
                                expConstantArray
                                (exp_param +: newType)
                              +>
                              core_type
                            else 
                              revSearch                                      
                                exp_len
                                expConstantArray
                                exp_param                                      
                              +>
                              Ast_core_type.lift_option_type core_type
                           )
                        )
                    ] in 
                    if createType then 
                      newTypeStr :: v 
                    else v 
                  | None -> 
                    U.notApplicable 
                      tdcl.Parsetree.ptype_loc 
                      derivingName;
                    []
                 )

               | Ptype_variant ctors -> 
                 if Ast_polyvar.is_enum_constructors ctors then 
                   let xs = Ast_polyvar.map_constructor_declarations_into_ints ctors in 
                   match xs with 
                   | `New xs ->
                     let constantArrayExp = Exp.ident {loc; txt = Lident constantArray} in
                     let exp_len = Ast_compatible.const_exp_int (List.length ctors) in
                     let v = [
                       eraseTypeStr;
                       Ast_comb.single_non_rec_value 
                         {loc; txt = constantArray}
                         (Ast_compatible.const_exp_int_list_as_array xs)
                       ;
                       toJsBody                        
                         (
                           coerceResultToNewType @@
                           toInt
                             exp_param
                             constantArrayExp
                         )                       
                       ;
                       Ast_comb.single_non_rec_value
                         patFromJs
                         (Ast_compatible.fun_
                            (Pat.var pat_param)
                            (
                              if createType then 
                                fromIntAssert
                                  exp_len
                                  constantArrayExp
                                  (exp_param +: newType)
                                +>
                                core_type
                              else 
                                fromInt                                 
                                  exp_len
                                  constantArrayExp
                                  exp_param
                                +>
                                Ast_core_type.lift_option_type core_type

                            )
                         )
                     ] in 
                     if createType then newTypeStr :: v else v 
                   | `Offset offset  ->                      
                     let v = 
                       [  eraseTypeStr;
                          toJsBody (
                            coerceResultToNewType
                              (eraseType exp_param +~ Ast_compatible.const_exp_int offset)
                          )
                          ;
                          let len = List.length ctors in 
                          let range_low = Ast_compatible.const_exp_int (offset + 0) in 
                          let range_upper = Ast_compatible.const_exp_int (offset + len - 1) in 

                          Ast_comb.single_non_rec_value
                            {loc ; txt = fromJs}
                            (Ast_compatible.fun_
                               (Pat.var pat_param)
                               (if createType then 
                                  (Exp.let_ Nonrecursive
                                     [Vb.mk
                                        (Pat.var pat_param)
                                        (exp_param +: newType)
                                     ]
                                     (
                                       Exp.sequence
                                         (assertExp 
                                            ((exp_param <=~ range_upper) &&~ (range_low <=~ exp_param))
                                         )
                                         (exp_param  -~ Ast_compatible.const_exp_int offset))
                                  )
                                  +>
                                  core_type
                                else
                                  Exp.ifthenelse
                                    ( (exp_param <=~ range_upper) &&~ (range_low <=~ exp_param))
                                    (Exp.construct {loc; txt = Ast_literal.predef_some} 
                                       ( Some (exp_param -~ Ast_compatible.const_exp_int offset)))
                                    (Some (Exp.construct {loc; txt = Ast_literal.predef_none} None))
                                  +>
                                  Ast_core_type.lift_option_type core_type
                               )
                            )
                       ] in 
                     if createType then newTypeStr :: v else v 
                 else 
                   begin 
                     U.notApplicable 
                       tdcl.Parsetree.ptype_loc 
                       derivingName;
                     []  
                   end
               | Ptype_open -> 
                 U.notApplicable tdcl.Parsetree.ptype_loc 
                   derivingName;
                 [] in 
             Ext_list.flat_map tdcls handle_tdcl
           );
         signature_gen = 
           (fun (tdcls : tdcls) _ -> 
              let handle_tdcl tdcl =
                let core_type = U.core_type_of_type_declaration tdcl 
                in 
                let name = tdcl.ptype_name.txt in 
                let toJs = name ^ "ToJs" in 
                let fromJs = name ^ "FromJs" in 
                let loc = tdcl.ptype_loc in 
                let patToJs = {Asttypes.loc; txt = toJs} in 
                let patFromJs = {Asttypes.loc; txt = fromJs} in 
                let toJsType result = 
                  Ast_comb.single_non_rec_val patToJs (Ast_compatible.arrow core_type result) in
                let newType,newTdcl =
                  U.new_type_of_type_declaration tdcl ("abs_" ^ name) in 
                let newTypeStr = Ast_compatible.rec_type_sig [newTdcl] in                     
                let (+?) v rest = if createType then v :: rest else rest in 
                match tdcl.ptype_kind with  
                | Ptype_record label_declarations ->            

                  let objType flag =                     
                    Ast_comb.to_js_type loc @@  
                    Ast_compatible.object_
                      (Ext_list.map label_declarations
                         (fun {pld_name = {loc; txt }; pld_type } -> 
                            txt, [], pld_type)) 
                      flag in                   
                  newTypeStr +? 
                  [
                    toJsType (if createType then newType else  objType Closed);
                    Ast_comb.single_non_rec_val patFromJs 
                      ( (if createType then  newType else objType Open)->~ core_type)
                  ] 

                | Ptype_abstract ->   
                  (match Ast_polyvar.is_enum_polyvar tdcl with 
                   | Some _ ->                     
                     let ty1 =  
                       if createType then newType else 
                         (Ast_literal.type_string ()) in 
                     let ty2 = 
                       if createType then core_type
                       else Ast_core_type.lift_option_type core_type in 
                     newTypeStr +? 
                     [
                       toJsType ty1;
                       Ast_comb.single_non_rec_val     
                         patFromJs
                         (ty1 ->~ ty2)
                     ] 

                   | None -> 
                     U.notApplicable tdcl.Parsetree.ptype_loc 
                       derivingName;
                     [])

                | Ptype_variant ctors 
                  -> 
                  if Ast_polyvar.is_enum_constructors ctors then 
                    let ty1 = 
                      if createType then newType 
                      else Ast_literal.type_int() in 
                    let ty2 = 
                      if createType then core_type
                      else Ast_core_type.lift_option_type core_type in 
                    newTypeStr +? 
                    [
                      toJsType ty1;
                      Ast_comb.single_non_rec_val
                        patFromJs
                        (ty1 ->~ ty2)
                    ] 

                  else 
                    begin
                      U.notApplicable tdcl.Parsetree.ptype_loc 
                        derivingName;
                      []
                    end
                | Ptype_open -> 
                  U.notApplicable tdcl.Parsetree.ptype_loc 
                    derivingName;
                  [] in 
              Ext_list.flat_map tdcls handle_tdcl

           );
         expression_gen = None 
       } 
    )
  ;

end
module Ast_derive_projector : sig 
#1 "ast_derive_projector.mli"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)



val init : unit -> unit

end = struct
#1 "ast_derive_projector.ml"
open Ast_helper

let invalid_config (config : Parsetree.expression) = 
  Location.raise_errorf ~loc:config.pexp_loc "such configuration is not supported"



type tdcls = Parsetree.type_declaration list 

(* #if OCAML_VERSION =~ ">4.03.0" then 
let constructor_arguments_length (xs : Parsetree.constructor_arguments) = 
  match xs with 
  | Pcstr_tuple xs -> List.length xs 
  | Pcstr_record xs -> List.length xs (* inline record FIXME*) 
#else
let constructor_arguments_length = List.length 
#end *)
let derivingName = "accessors" 
let init () =
  
  Ast_derive.register
    derivingName
    (fun (x : Parsetree.expression option) ->
       (match x with 
        | Some config -> invalid_config config
        | None -> ());
       {structure_gen = 
          begin fun (tdcls : tdcls) _explict_nonrec ->
            let handle_tdcl tdcl = 
              let core_type = Ast_derive_util.core_type_of_type_declaration tdcl in 
              match tdcl.ptype_kind with 
              | Ptype_record label_declarations 
                ->                  
                Ext_list.map label_declarations (
                  fun ({pld_name = {loc; txt = pld_label} as pld_name} : Parsetree.label_declaration) -> 
                    let txt = "param" in
                    Ast_comb.single_non_rec_value pld_name
                      (Ast_compatible.fun_
                         (Pat.constraint_ (Pat.var {txt ; loc}) core_type )
                         (Exp.field (Exp.ident {txt = Lident txt ; loc}) 
                            {txt = Longident.Lident pld_label ; loc}) )
                )
              | Ptype_variant constructor_declarations 
                ->                 
                Ext_list.map constructor_declarations
                  (fun
                    ( {pcd_name = {loc ; txt = con_name} ; pcd_args ; pcd_loc }:
                        Parsetree.constructor_declaration)
                    -> (* TODO: add type annotations *)
                        
                      let little_con_name = Ext_string.uncapitalize_ascii con_name  in
                      let arity = List.length pcd_args in 
                      Ast_comb.single_non_rec_value {loc ; txt = little_con_name}
                        (
                          if arity = 0 then (*TODO: add a prefix, better inter-op with FFI *)
                            (Exp.constraint_
                               (Exp.construct {loc ; txt = Longident.Lident con_name } None)
                               core_type
                            )
                          else 
                            begin 
                              let vars = 
                                Ext_list.init  arity (fun x -> "param_" ^ string_of_int x ) in 
                              let exp = 
                                Exp.constraint_
                                  ( 
                                    Exp.construct {loc ; txt = Longident.Lident con_name} @@ 
                                    Some
                                      ( 
                                        if  arity = 1 then 
                                          Exp.ident { loc ; txt = Longident.Lident (List.hd vars )}
                                        else 
                                          Exp.tuple (Ext_list.map vars 
                                                       (fun x -> Exp.ident {loc ; txt = Longident.Lident x})                                                       
                                                    ) )) core_type
                              in 
                              Ext_list.fold_right vars exp (fun var b -> 
                                  Ast_compatible.fun_  (Pat.var {loc ; txt = var}) b 
                                ) 

                            end)
                  )
              | Ptype_abstract | Ptype_open ->
                Ast_derive_util.notApplicable tdcl.ptype_loc derivingName ; 
               []
              (* Location.raise_errorf "projector only works with record" *)
            in Ext_list.flat_map tdcls handle_tdcl


          end;
        signature_gen = 
          begin fun (tdcls : Parsetree.type_declaration list) _explict_nonrec -> 
            let handle_tdcl tdcl = 
              let core_type = Ast_derive_util.core_type_of_type_declaration tdcl in 
              match tdcl.ptype_kind with 
              | Ptype_record label_declarations 
                ->                 
                Ext_list.map label_declarations 
                  (fun 
                    ({pld_name ;
                      pld_type
                     } : 
                       Parsetree.label_declaration) -> 
                    Ast_comb.single_non_rec_val pld_name (Ast_compatible.arrow core_type pld_type )
                  )
              | Ptype_variant constructor_declarations 
                ->                 
                Ext_list.map constructor_declarations
                  (fun  ({pcd_name = {loc ; txt = con_name} ; pcd_args ; pcd_loc }:
                           Parsetree.constructor_declaration)
                    -> 
                        
                      Ast_comb.single_non_rec_val {loc ; txt = (Ext_string.uncapitalize_ascii con_name)}
                        (Ext_list.fold_right pcd_args core_type
                           (fun x acc -> Ast_compatible.arrow x acc)
                           ))
              | Ptype_open | Ptype_abstract -> 
              Ast_derive_util.notApplicable tdcl.ptype_loc derivingName ; 
              [] 
            in 
            Ext_list.flat_map tdcls handle_tdcl 
          end;
        expression_gen = None
       }
    )


end
module Ast_tuple_pattern_flatten : sig 
#1 "ast_tuple_pattern_flatten.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val map_open_tuple:
  Parsetree.expression ->
  (Parsetree.expression list ->
    Parsetree.attributes ->
   Parsetree.expression) ->
  Parsetree.expression option


val handle_value_bindings :
  Bs_ast_mapper.mapper ->
  Parsetree.value_binding list ->
  Parsetree.value_binding list

end = struct
#1 "ast_tuple_pattern_flatten.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

type loc = Location.t

type exp = Parsetree.expression

type pat = Parsetree.pattern


type whole =
  | Let_open of
      (Asttypes.override_flag * Longident.t Asttypes.loc * loc *
       Parsetree.attributes)

type wholes = whole list

let rec is_simple_pattern (p : Parsetree.pattern) =
  match p.ppat_desc with
  | Ppat_any -> true
  | Ppat_var _ -> true
  | Ppat_constraint(p,_) -> is_simple_pattern p
  | _ -> false

type destruct_output =
  exp list
  
(**
   destruct such pattern
   {[ A.B.let open C in (a,b)]}
*)
let rec destruct_open_tuple
    (e : Parsetree.expression)
    (acc : whole list)
  : (wholes * destruct_output * _) option =
  match e.pexp_desc with
  | Pexp_open (flag, lid, cont)
    ->
    destruct_open_tuple
      cont
      (Let_open (flag, lid, e.pexp_loc, e.pexp_attributes) :: acc)
  | Pexp_tuple es -> Some (acc, es, e.pexp_attributes)
  | _ -> None

let map_open_tuple
    (e : Parsetree.expression)
    (f : Parsetree.expression list -> _ -> Parsetree.expression) =
  match destruct_open_tuple e [] with
  | None ->  None (** not an open tuple *)
  | Some (qualifiers, es, attrs ) ->
    Some (List.fold_left (fun x hole  ->
        match hole with
        | Let_open (flag, lid,loc,attrs) ->
          {Parsetree.
            pexp_desc = Pexp_open (flag,lid,x);
            pexp_attributes = attrs;
            pexp_loc = loc
          }
      ) (f es attrs) qualifiers)
(*
  [let (a,b) = M.N.(c,d) ]
  =>
  [ let a = M.N.c
    and b = M.N.d ]
*)
let flattern_tuple_pattern_vb
    (self : Bs_ast_mapper.mapper)
    ({pvb_loc } as vb :  Parsetree.value_binding)
    acc : Parsetree.value_binding list =
  let pvb_pat = self.pat self vb.pvb_pat in
  let pvb_expr = self.expr self vb.pvb_expr in
  let pvb_attributes = self.attributes self vb.pvb_attributes in
  match pvb_pat.ppat_desc with
  | Ppat_tuple xs when List.for_all is_simple_pattern xs ->
    begin match destruct_open_tuple pvb_expr []  with
      | Some (wholes, es, tuple_attributes)
        when
          List.for_all is_simple_pattern xs &&
          Ext_list.same_length es xs
        ->
        Bs_ast_invariant.warn_discarded_unused_attributes tuple_attributes ; (* will be dropped*)
        Ext_list.fold_right2 xs es acc (fun pat exp acc->
             {Parsetree.
               pvb_pat =
                 pat;
               pvb_expr =
                 ( match wholes with
                   | [] -> exp
                   | _ ->
                     List.fold_left (fun x  whole ->
                         match whole with
                         | Let_open (flag,lid,loc,attrs) ->
                           {Parsetree.
                             pexp_desc = Pexp_open(flag,lid,x);
                             pexp_attributes = attrs;
                             pexp_loc = loc
                           }
                       ) exp wholes) ;
               pvb_attributes;
               pvb_loc ;
             } :: acc
           ) 
      | _ ->
        {pvb_pat ;
         pvb_expr ;
         pvb_loc ;
         pvb_attributes} :: acc
    end
  | _ ->
    {pvb_pat ;
     pvb_expr ;
     pvb_loc ;
     pvb_attributes} :: acc


let handle_value_bindings  =
  fun self (vbs : Parsetree.value_binding list) ->
    (* Bs_ast_mapper.default_mapper.value_bindings self  vbs   *)
    List.fold_right (fun vb acc ->
        flattern_tuple_pattern_vb self vb acc
      ) vbs []

end
module Ast_exp_apply : sig 
#1 "ast_exp_apply.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val handle_exp_apply :
  Parsetree.expression ->
  Bs_ast_mapper.mapper ->
  Parsetree.expression ->
  (Ast_compatible.arg_label * Parsetree.expression) list ->
  Parsetree.expression

end = struct
#1 "ast_exp_apply.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

open Ast_helper
type exp = Parsetree.expression

let rec no_need_bound (exp : exp) =
  match exp.pexp_desc with
  | Pexp_ident { txt = Lident _} -> true
  | Pexp_constraint(e,_) -> no_need_bound e
  | _ -> false

let ocaml_obj_id = "__ocaml_internal_obj"

let bound (e : exp) (cb : exp -> _) =
  if no_need_bound e then cb e
  else
    let loc = e.pexp_loc in
    Exp.let_ ~loc Nonrecursive
      [ Vb.mk ~loc (Pat.var ~loc {txt = ocaml_obj_id; loc}) e ]
      (cb (Exp.ident ~loc {txt = Lident ocaml_obj_id; loc}))

let handle_exp_apply
    (e  : exp)
    (self : Bs_ast_mapper.mapper)
    (fn : exp)
    (args : (Ast_compatible.arg_label * Parsetree.expression) list)
  =
  let loc = e.pexp_loc in
  begin match fn.pexp_desc with
    | Pexp_apply (
        {pexp_desc =
           Pexp_ident  {txt = Lident "##"  ; loc} ; _},
        [

          ("", obj) ;
          ("", {pexp_desc = Pexp_ident {txt = Lident name;_ } ; _} )
          
        ]
        )
      ->  (* f##paint 1 2 *)
      {e with pexp_desc = Ast_util.method_apply loc self obj name args }
    | Pexp_apply (
        {pexp_desc =
           Pexp_ident  {txt = Lident "#@"  ; loc} ; _},
        [

          ("", obj) ;
          ("", {pexp_desc = Pexp_ident {txt = Lident name;_ } ; _} )
          
        ])
      ->  (* f#@paint 1 2 *)
      {e with pexp_desc = Ast_util.property_apply loc self obj name args  }
    | Pexp_ident {txt = Lident "|."} ->
      (*
        a |. f
        a |. f b c [@bs]  --> f a b c [@bs]
      *)
      begin match args with
        | [ 

          "", obj_arg ;
          "", fn
            
          ] ->
          let new_obj_arg = self.expr self obj_arg in
          begin match fn with
            | {pexp_desc = Pexp_apply (fn, args); pexp_loc; pexp_attributes} ->
              let fn = self.expr self fn in
              let args = Ext_list.map  args (fun (lab,exp) -> lab, self.expr self exp ) in
              Bs_ast_invariant.warn_discarded_unused_attributes pexp_attributes;
              { pexp_desc = Pexp_apply(fn, (Ast_compatible.no_label, new_obj_arg) :: args);
                pexp_attributes = [];
                pexp_loc = pexp_loc}
            | {pexp_desc = Pexp_construct(ctor,None); pexp_loc; pexp_attributes} -> 
              {fn with pexp_desc = Pexp_construct(ctor, Some new_obj_arg)}
            | _ ->
              let try_dispatch_by_tuple =
                Ast_tuple_pattern_flatten.map_open_tuple fn (fun xs tuple_attrs ->
                    bound new_obj_arg @@  fun bounded_obj_arg ->
                    {
                      pexp_desc =
                        Pexp_tuple (
                          Ext_list.map xs (fun (fn : Parsetree.expression) ->
                              match fn with
                              | {pexp_desc = Pexp_apply (fn,args); pexp_loc; pexp_attributes }
                                ->
                                let fn = self.expr self fn in
                                let args = Ext_list.map  args (fun (lab,exp) -> lab, self.expr self exp ) in
                                Bs_ast_invariant.warn_discarded_unused_attributes pexp_attributes;
                                { Parsetree.pexp_desc = Pexp_apply(fn, (Ast_compatible.no_label, bounded_obj_arg) :: args);
                                  pexp_attributes = [];
                                  pexp_loc = pexp_loc}
                              | {pexp_desc = Pexp_construct(ctor,None); pexp_loc; pexp_attributes}    
                                -> 
                                {fn with pexp_desc = Pexp_construct(ctor, Some bounded_obj_arg)}
                              | _ ->
                                Ast_compatible.app1 ~loc:fn.pexp_loc
                                  (self.expr self fn )
                                   bounded_obj_arg
                            ));
                      pexp_attributes = tuple_attrs;
                      pexp_loc = fn.pexp_loc;
                    }
                  ) in
              begin match try_dispatch_by_tuple  with
                | Some x -> x
                | None ->
                  Ast_compatible.app1 ~loc (self.expr self fn) new_obj_arg
              end
          end
        | _ ->
          Location.raise_errorf ~loc
            "invalid |. syntax "
      end

    | Pexp_ident  {txt = Lident "##" ; loc}
      ->
      begin match args with
        | [

           ("", obj) ;
           ("", {pexp_desc = Pexp_apply(
                {pexp_desc = Pexp_ident {txt = Lident name;_ } ; _},
                args
              ); pexp_attributes = attrs }
           (* we should warn when we discard attributes *)
           )
           
          ] -> (* f##(paint 1 2 ) *)
          (* gpr#1063 foo##(bar##baz) we should rewrite (bar##baz)
             first  before pattern match.
             currently the pattern match is written in a top down style.
             Another corner case: f##(g a b [@bs])
          *)
          Bs_ast_invariant.warn_discarded_unused_attributes attrs ;
          {e with pexp_desc = Ast_util.method_apply loc self obj name args}
        | [

          ("", obj) ;
           ("",
            {pexp_desc = Pexp_ident {txt = Lident name;_ } ; _}
           )  (* f##paint  *)
           
          ] ->
          { e with pexp_desc =
                     Ast_util.js_property loc (self.expr self obj) name
          }

        | _ ->
          Location.raise_errorf ~loc
            "Js object ## expect syntax like obj##(paint (a,b)) "
      end
    (* we can not use [:=] for precedece cases
       like {[i @@ x##length := 3 ]}
       is parsed as {[ (i @@ x##length) := 3]}
       since we allow user to create Js objects in OCaml, it can be of
       ref type
       {[
         let u = object (self)
           val x = ref 3
           method setX x = self##x := 32
           method getX () = !self##x
         end
       ]}
    *)
    | Pexp_ident {txt = Lident "#=" } ->
      begin match args with
        | [

          "",
           {pexp_desc =
              Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident "##"}},
                          ["", obj;
                           "", {pexp_desc = Pexp_ident {txt = Lident name}}
                          ]
                         )};
           "", arg
           
          ] ->
          Exp.constraint_ ~loc
            { e with
              pexp_desc =
                Ast_util.method_apply loc self obj
                  (name ^ Literals.setter_suffix) [Ast_compatible.no_label, arg ]  }
            (Ast_literal.type_unit ~loc ())
        | _ -> Bs_ast_mapper.default_mapper.expr self e
      end
    | _ ->
      begin match
          Ext_list.exclude_with_val
            e.pexp_attributes 
            Ast_attributes.is_bs with
      | false, _ -> Bs_ast_mapper.default_mapper.expr self e
      | true, pexp_attributes ->
        {e with pexp_desc = Ast_util.uncurry_fn_apply loc self fn args ;
                pexp_attributes }
      end
  end

end
module Ast_exp_extension : sig 
#1 "ast_exp_extension.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val handle_extension :
  bool ref ->
  Parsetree.expression ->
  Bs_ast_mapper.mapper ->
  Parsetree.extension ->
  Parsetree.expression


type t = { args : string list ; block :  string }

val fromString : string -> t 
  
end = struct
#1 "ast_exp_extension.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
open Ast_helper


let rec unroll_function_aux 
  (acc : string list)
  (body : Parsetree.expression) : string list * string =
  match body.pexp_desc with
  | Pexp_constant(
    
    Const_string
    
    (block,_)) -> acc, block
  | Pexp_fun(arg_label,_,pat,cont)
    when Ast_compatible.is_arg_label_simple arg_label -> 
    (match pat.ppat_desc with 
    | Ppat_var s -> 
      unroll_function_aux (s.txt::acc) cont
    | Ppat_any -> 
      unroll_function_aux ("_"::acc) cont
    | Ppat_constraint _ -> 
      Location.raise_errorf ~loc:body.pexp_loc  
      "type annotation around bs.raw arguments is invalid, please put in this form: let f : t1 -> t2 = fun%%raw param1 param2 -> .."
    | _ -> 
      Location.raise_errorf ~loc:body.pexp_loc  
      "bs.raw can only be applied to a string or a special function form "
    )
  | _ -> 
    Location.raise_errorf ~loc:body.pexp_loc  
    "bs.raw can only be applied to a string or a special function form "

type t = { args : string list ; block :  string }

let toString (x : t) = 
  Bs_version.version ^ Marshal.to_string x []

(* exception handling*)
let fromString (x : string) : t = 
  if Ext_string.starts_with x Bs_version.version then 
    Marshal.from_string x (String.length Bs_version.version)
  else 
     Ext_pervasives.failwithf
        ~loc:__LOC__
        "Compiler version mismatch. The project might have been built with one version of BuckleScript, and then with another. Please wipe the artifacts and do a clean build."

let handle_extension record_as_js_object e (self : Bs_ast_mapper.mapper)
    (({txt ; loc} as lid , payload) : Parsetree.extension) = 
  begin match txt with
    | "bs.raw" | "raw" -> 
      begin match payload with 
      | PStr [
        {pstr_desc = Pstr_eval({pexp_desc = Pexp_fun(arg_label,_,pat,body)},_)}]
        when Ast_compatible.is_arg_label_simple arg_label
         -> 
         begin match pat.ppat_desc, body.pexp_desc with 
         | Ppat_construct ({txt = Lident "()"}, None), Pexp_constant(
          
           Const_string
           
           (block,_))
           -> 
            Ast_compatible.app1 ~loc 
            (Exp.ident ~loc {txt = Ldot (Ast_literal.Lid.js_internal, Literals.raw_function);loc})            
            (Ast_compatible.const_exp_string ~loc ( toString {args = [] ; block } ) )
         | ppat_desc, _ -> 
            let txt = 
              match ppat_desc with 
              | Ppat_var {txt} -> txt 
              | Ppat_any -> "_"
              | _ -> 
                Location.raise_errorf ~loc "bs.raw can only be applied to a string or a special function form "
            in 
            let acc, block = unroll_function_aux [txt] body in 
            Ast_compatible.app1 ~loc 
              (Exp.ident ~loc {txt = Ldot (Ast_literal.Lid.js_internal, Literals.raw_function);loc})
              (Ast_compatible.const_exp_string ~loc (toString {args = List.rev acc ; block }))
         end 
      | _ ->   Ast_util.handle_raw ~check_js_regex:false loc payload
      end
    | "bs.re" | "re" ->
      Exp.constraint_ ~loc
        (Ast_util.handle_raw ~check_js_regex:true loc payload)
        (Ast_comb.to_js_re_type loc)
    | "bs.external" | "external" ->
      begin match Ast_payload.as_ident payload with 
        | Some {txt = Lident x}
          -> Ast_util.handle_external loc x
        (* do we need support [%external gg.xx ] 

           {[ Js.Undefined.to_opt (if Js.typeof x == "undefined" then x else Js.Undefined.empty ) ]}
        *)

        | None | Some _ -> 
          Location.raise_errorf ~loc 
            "external expects a single identifier"
      end
    | "bs.time"| "time" ->
      (
        match payload with 
        | PStr [{pstr_desc = Pstr_eval (e,_)}] -> 
          let locString = 
            if loc.loc_ghost then 
              "GHOST LOC"
            else 
              let loc_start = loc.loc_start in 
              let (file, lnum, __) = Location.get_pos_info loc_start in                  
              Printf.sprintf "%s %d"
                file lnum in   
          let e = self.expr self e in 
          Exp.sequence ~loc
            (Ast_compatible.app1 ~loc     
               (Exp.ident ~loc {loc; 
                                txt = 
                                  Ldot (Ldot (Lident "Js", "Console"), "timeStart")   
                               })
               (Ast_compatible.const_exp_string ~loc locString)
            )     
            ( Exp.let_ ~loc Nonrecursive
                [Vb.mk ~loc (Pat.var ~loc {loc; txt = "timed"}) e ;
                ]
                (Exp.sequence ~loc
                   (Ast_compatible.app1 ~loc     
                      (Exp.ident ~loc {loc; 
                                       txt = 
                                         Ldot (Ldot (Lident "Js", "Console"), "timeEnd")   
                                      })
                      (Ast_compatible.const_exp_string ~loc locString)
                   )    
                   (Exp.ident ~loc {loc; txt = Lident "timed"})
                )
            )
        | _ -> 
          Location.raise_errorf 
            ~loc "expect a boolean expression in the payload"
      )
    | "bs.assert" | "assert" ->
      (
        match payload with 
        | PStr [ {pstr_desc = Pstr_eval( e,_)}] -> 

          let locString = 
            if loc.loc_ghost then 
              "ASSERT FAILURE"
            else 
              let loc_start = loc.loc_start in 
              let (file, lnum, cnum) = Location.get_pos_info loc_start in
              let enum = 
                loc.Location.loc_end.Lexing.pos_cnum -
                loc_start.Lexing.pos_cnum + cnum in
              Printf.sprintf "File %S, line %d, characters %d-%d"
                file lnum cnum enum in   
          let raiseWithString  locString =      
              Ast_compatible.app1 ~loc 
               (Exp.ident ~loc {loc; txt = 
                                       Ldot(Ldot (Lident "Js","Exn"),"raiseError")})               
                (Ast_compatible.const_exp_string locString)               
          in 
          (match e.pexp_desc with
           | Pexp_construct({txt = Lident "false"},None) -> 
             (* The backend will convert [assert false] into a nop later *)
             if !Clflags.no_assert_false  then 
               Exp.assert_ ~loc 
                 (Exp.construct ~loc {txt = Lident "false";loc} None)
             else 
               (raiseWithString locString)
           | Pexp_constant (
    
    Const_string
              
              (r, _)) -> 
             if !Clflags.noassert then 
               Exp.assert_ ~loc (Exp.construct ~loc {txt = Lident "true"; loc} None)
               (* Need special handling to make it type check*)
             else   
               raiseWithString r
           | _ ->    
             let e = self.expr self  e in 
             if !Clflags.noassert then 
               (* pass down so that it still type check, but the backend will
                  make it a nop
               *)
               Exp.assert_ ~loc e
             else 
               Exp.ifthenelse ~loc
                 (Ast_compatible.app1 ~loc
                    (Exp.ident {loc ; txt = Ldot(Lident "Pervasives","not")})
                    e
                 )
                 (raiseWithString locString)
                 None
          )
        | _ -> 
          Location.raise_errorf 
            ~loc "expect a boolean expression in the payload"
      )
    | "bs.node" | "node" ->
      let strip s =
        match s with 
        | "_module" -> "module" 
        | x -> x  in 
      begin match Ast_payload.as_ident payload with
        | Some {txt = Lident
                    ( "__filename"
                    | "__dirname"
                    | "_module"
                    | "require" as name); loc}
          ->
          let exp =
            Ast_util.handle_external loc (strip name)  in
          let typ =
            Ast_core_type.lift_option_type  
            @@                 
            if name = "_module" then
              Typ.constr ~loc
                { txt = Ldot (Lident "Node", "node_module") ;
                  loc} []   
            else if name = "require" then
              (Typ.constr ~loc
                 { txt = Ldot (Lident "Node", "node_require") ;
                   loc} [] )  
            else
              Ast_literal.type_string ~loc () in                  
          Exp.constraint_ ~loc exp typ                
        | Some _ | None ->
          begin match payload with 
            | PTyp _ -> 
              Location.raise_errorf 
                ~loc "Illegal payload, expect an expression payload instead of type payload"              
            | PPat _ ->
              Location.raise_errorf 
                ~loc "Illegal payload, expect an expression payload instead of pattern  payload"        
            | _ -> 
              Location.raise_errorf 
                ~loc "Illegal payload"
          end

      end             
    | "bs.debugger"|"debugger" ->
      {e with pexp_desc = Ast_util.handle_debugger loc payload}
    | "bs.obj" | "obj" ->
      begin match payload with 
        | PStr [{pstr_desc = Pstr_eval (e,_)}]
          -> 
          Ext_ref.non_exn_protect record_as_js_object true
            (fun () -> self.expr self e ) 
        | _ -> Location.raise_errorf ~loc "Expect an expression here"
      end
    | _ ->
      match payload with
      | PTyp typ when Ext_string.starts_with txt Literals.bs_deriving_dot ->
        self.expr self (Ast_derive.gen_expression lid typ)
      | _ ->  
        e (* For an unknown extension, we don't really need to process further*)
        (* Exp.extension ~loc ~attrs:e.pexp_attributes (
            self.extension self extension) *)
        (* Bs_ast_mapper.default_mapper.expr self e   *)
  end 

end
module Ast_primitive : sig 
#1 "ast_primitive.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val handlePrimitiveInSig:
  Bs_ast_mapper.mapper ->
  Parsetree.value_description ->
  Parsetree.signature_item ->
  Parsetree.signature_item

val handlePrimitiveInStru:
  Bs_ast_mapper.mapper ->
  Parsetree.value_description ->
  Parsetree.structure_item ->
  Parsetree.structure_item
  

end = struct
#1 "ast_primitive.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


let handlePrimitiveInSig
    (self : Bs_ast_mapper.mapper)
    ({pval_attributes;
      pval_type;
      pval_loc;
      pval_prim;
      pval_name ;
     } as prim : Parsetree.value_description)
    (sigi : Parsetree.signature_item)
  : Parsetree.signature_item
  =
  let pval_type = self.typ self pval_type in
  let pval_attributes = self.attributes self pval_attributes in
  let pval_type, pval_prim, pval_attributes =
    match pval_prim with
    | [ v ] ->
      External_process.handle_attributes_as_string
        pval_loc
        pval_name.txt
        pval_type
        pval_attributes v
    | _ ->
      Location.raise_errorf
        ~loc:pval_loc
        "only a single string is allowed in bs external" in
  {sigi with
   psig_desc =
     Psig_value
       {prim with
        pval_type ;
        pval_prim ;
        pval_attributes
       }}

let handlePrimitiveInStru
    (self : Bs_ast_mapper.mapper)
    ({pval_attributes;
      pval_prim;
      pval_type;
      pval_name;
      pval_loc} as prim : Parsetree.value_description)
    (str : Parsetree.structure_item)
    : Parsetree.structure_item =
  let pval_type = self.typ self pval_type in
  let pval_attributes = self.attributes self pval_attributes in
  let pval_type, pval_prim, pval_attributes =
    match pval_prim with
    | [ v] ->
      External_process.handle_attributes_as_string
        pval_loc
        pval_name.txt
        pval_type pval_attributes v

    | _ -> Location.raise_errorf
             ~loc:pval_loc "only a single string is allowed in bs external" in
  {str with
   pstr_desc =
     Pstr_primitive
       {prim with
        pval_type ;
        pval_prim;
        pval_attributes
       }}

end
module Ast_derive_abstract : sig 
#1 "ast_derive_abstract.mli"
(* Copyright (C) 2017 Authors of BuckleScript
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

val handleTdclsInStr : 
  Parsetree.type_declaration list -> Parsetree.structure

val handleTdclsInSig:  
  Parsetree.type_declaration list -> Parsetree.signature
end = struct
#1 "ast_derive_abstract.ml"
(* Copyright (C) 2017 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


let derivingName = "abstract"
module U = Ast_derive_util
open Ast_helper
type tdcls = Parsetree.type_declaration list

let handle_config (config : Parsetree.expression option) =
  match config with
  | Some config ->
    U.invalid_config config
  | None -> ()



let get_optional_attrs =
  [ 
    Ast_attributes.bs_get; 
    Ast_attributes.bs_return_undefined
    ]
(** For this attributes, its type was wrapped as an option,
   so we can still reuse existing frame work
*)  

let get_attrs = [ Ast_attributes.bs_get_arity]
let set_attrs = [Ast_attributes.bs_set]

let deprecated name = 
  Ast_attributes.deprecated  
    ("use " ^ name ^ "Get instead")


let handleTdcl (tdcl : Parsetree.type_declaration) =
  let core_type = U.core_type_of_type_declaration tdcl in
  let loc = tdcl.ptype_loc in
  let type_name = tdcl.ptype_name.txt in
  let newTdcl = {
    tdcl with
    ptype_kind = Ptype_abstract;
    ptype_attributes = [];
    (* avoid non-terminating*)
  } in
  match tdcl.ptype_kind with
  | Ptype_record label_declarations ->
    let is_private = tdcl.ptype_private = Private in
    let has_optional_field =
      List.exists (fun ({pld_type; pld_attributes} : Parsetree.label_declaration) ->
          Ast_attributes.has_bs_optional pld_attributes
        ) label_declarations in
    let setter_accessor, makeType, labels =
      Ext_list.fold_right
        label_declarations
        ([],
         (if has_optional_field then
            Ast_compatible.arrow ~loc  (Ast_literal.type_unit ()) core_type
          else  core_type),
         [])
        (fun
          ({pld_name =
              {txt = label_name; loc = label_loc} as pld_name;
            pld_type;
            pld_mutable;
            pld_attributes;
            pld_loc
           }:
             Parsetree.label_declaration) (acc, maker, labels) ->
          let prim_as_name, newLabel =
            match Ast_attributes.iter_process_bs_string_as pld_attributes with
            | None ->
              label_name, pld_name
            | Some new_name ->
              new_name, {pld_name with txt = new_name}
          in
          let prim = [prim_as_name] in 
          let is_optional = Ast_attributes.has_bs_optional pld_attributes in
          
          let maker, acc =
            if is_optional then
              let optional_type = Ast_core_type.lift_option_type pld_type in
              (Ast_compatible.opt_arrow ~loc:pld_loc label_name 

                  optional_type
              

                maker,
              let aux b pld_name = 
                (Val.mk ~loc:pld_loc
                 (if b then pld_name else 
                  {pld_name with txt = pld_name.txt ^ "Get"})
                ~attrs:(if b then deprecated (pld_name.Asttypes.txt) :: get_optional_attrs  
                        else get_optional_attrs) ~prim
                (Ast_compatible.arrow ~loc  core_type optional_type)
                ) in 
               aux true pld_name :: aux false pld_name  :: acc )
            else
              Ast_compatible.label_arrow ~loc:pld_loc label_name pld_type maker,
              (
                let aux b pld_name = 
                Val.mk ~loc:pld_loc 
                  (if b then pld_name else 
                    {pld_name with txt = pld_name.txt ^ "Get"}
                  ) ~attrs:(if b then deprecated pld_name.Asttypes.txt :: get_attrs else get_attrs)
              ~prim:(
                ["" ; (* Not needed actually*)
                External_ffi_types.to_string 
                (Ffi_bs (
                  [{arg_type = Nothing; arg_label = External_arg_spec.empty_label}],
                  Return_identity,
                  Js_get {js_get_name = prim_as_name; js_get_scopes = []}
                  ))] )
               (Ast_compatible.arrow ~loc  core_type pld_type)
               in 
               aux true pld_name ::aux false pld_name :: acc )
          in
          let is_current_field_mutable = pld_mutable = Mutable in
          let acc =
            if is_current_field_mutable then
              let setter_type =
                (Ast_compatible.arrow core_type
                   (Ast_compatible.arrow
                      pld_type (* setter *)
                      (Ast_literal.type_unit ()))) in
              Val.mk ~loc:pld_loc
                {loc = label_loc; txt = label_name ^ "Set"}
                (* setter *)
                ~attrs:set_attrs
                ~prim setter_type
              :: acc
            else acc in
          acc,
          maker,
          (is_optional, newLabel)::labels
        ) 
    in
    newTdcl,
    (if is_private then
       setter_accessor
     else
       let myPrims =
        External_process.pval_prim_of_option_labels
          labels
          has_optional_field
        in
       let myMaker =
         Val.mk  ~loc
           {loc; txt = type_name}
           ~prim:myPrims makeType in
       (myMaker :: setter_accessor))

  | Ptype_abstract
  | Ptype_variant _
  | Ptype_open ->
    (* Looks obvious that it does not make sense to warn *)
    (* U.notApplicable tdcl.ptype_loc derivingName;  *)
    tdcl, []

let handleTdclsInStr tdcls =
  let tdcls, code =
    Ext_list.fold_right tdcls ([],[]) (fun tdcl (tdcls, sts)  ->
        match handleTdcl tdcl with
          ntdcl, value_descriptions ->
          ntdcl::tdcls,
          Ext_list.map_append value_descriptions sts (fun x -> Str.primitive x) 
      ) in
Ast_compatible.rec_type_str tdcls :: code
(* still need perform transformation for non-abstract type*)

let handleTdclsInSig tdcls =
  let tdcls, code =
    Ext_list.fold_right tdcls ([],[]) (fun tdcl (tdcls, sts)  ->
        match handleTdcl tdcl with
          ntdcl, value_descriptions ->
          ntdcl::tdcls,
          Ext_list.map_append value_descriptions sts (fun x -> Sig.value x) 
      ) in
  Ast_compatible.rec_type_sig tdcls :: code

end
module Ast_tdcls : sig 
#1 "ast_tdcls.mli"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val handleTdclsInSigi :
  Bs_ast_mapper.mapper ->
  Parsetree.signature_item ->
  Parsetree.type_declaration list -> Ast_signature.item


val handleTdclsInStru :
  Bs_ast_mapper.mapper ->
  Parsetree.structure_item ->
  Parsetree.type_declaration list -> Ast_structure.item

end = struct
#1 "ast_tdcls.ml"
(* Copyright (C) 2018 Authors of BuckleScript
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

open Ast_helper

(**
   [newTdcls tdcls newAttrs]
   functional update attributes of last declaration *)
let newTdcls
    (tdcls : Parsetree.type_declaration list)
    (newAttrs : Parsetree.attributes)
  : Parsetree.type_declaration list
  =
  match tdcls with
  | [ x ] ->
    [{ x with Parsetree.ptype_attributes = newAttrs}]
  | _ ->
    Ext_list.map_last tdcls
      (fun last x ->
         if last then
           { x with
             Parsetree.ptype_attributes = newAttrs}
         else x )
      


let handleTdclsInSigi
    (self : Bs_ast_mapper.mapper)
    (sigi : Parsetree.signature_item)
    (tdcls : Parsetree.type_declaration list)
  : Ast_signature.item =
  begin match Ast_attributes.process_derive_type
                (Ext_list.last tdcls).ptype_attributes  with
  | {bs_deriving = Some actions; explict_nonrec}, newAttrs
    ->
    let loc = sigi.psig_loc in
    let originalTdclsNewAttrs = newTdcls tdcls newAttrs in (* remove the processed attr*)
    let newTdclsNewAttrs = self.type_declaration_list self originalTdclsNewAttrs in
    if Ast_payload.isAbstract actions then
      let  codes = Ast_derive_abstract.handleTdclsInSig originalTdclsNewAttrs in
      Ast_signature.fuseAll ~loc
        (
          Sig.include_ ~loc
            (Incl.mk ~loc
               (Mty.typeof_ ~loc
                  (Mod.constraint_ ~loc
                     (Mod.structure ~loc [
                         Ast_compatible.rec_type_str ~loc newTdclsNewAttrs
                         ] )
                     (Mty.signature ~loc [])) ) )
          :: (* include module type of struct [processed_code for checking like invariance ]end *)
          self.signature self  codes
        )
    else
      Ast_signature.fuseAll ~loc
        ( 
          Ast_compatible.rec_type_sig ~loc newTdclsNewAttrs
        ::
         self.signature
           self
           (Ast_derive.gen_signature tdcls actions explict_nonrec))
  | {bs_deriving = None }, _  ->
    Bs_ast_mapper.default_mapper.signature_item self sigi

  end


let handleTdclsInStru
    (self : Bs_ast_mapper.mapper)
    (str : Parsetree.structure_item)
    (tdcls : Parsetree.type_declaration list)
  : Ast_structure.item =
  begin match
      Ast_attributes.process_derive_type
        ((Ext_list.last tdcls).ptype_attributes) with
  | {bs_deriving = Some actions;
     explict_nonrec
    }, newAttrs ->
    let loc = str.pstr_loc in
    let originalTdclsNewAttrs = newTdcls tdcls newAttrs in
    let newStr : Parsetree.structure_item =
      Ast_compatible.rec_type_str ~loc (self.type_declaration_list self originalTdclsNewAttrs)
    in
    if Ast_payload.isAbstract actions then
      let codes = Ast_derive_abstract.handleTdclsInStr originalTdclsNewAttrs in
      (* use [tdcls2] avoid nonterminating *)
      Ast_structure.fuseAll ~loc
        (
          Ast_structure.constraint_ ~loc [newStr] []
          :: (* [include struct end : sig end] for error checking *)
          self.structure self codes)
    else
      Ast_structure.fuseAll ~loc
        (newStr ::
         self.structure self
           (
             List.map
               (fun action ->
                  Ast_derive.gen_structure_signature
                    loc
                    tdcls action explict_nonrec
               )    actions
           ))
  | {bs_deriving = None }, _  ->
    Bs_ast_mapper.default_mapper.structure_item self str
  end



end
module Ppx_entry : sig 
#1 "ppx_entry.mli"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)




val rewrite_signature :   
  (Parsetree.signature -> Parsetree.signature) ref

val rewrite_implementation : 
  (Parsetree.structure -> Parsetree.structure) ref





(* object 
    for setter : we can push more into [Lsend] and enclose it with a unit type

    for getter :

    (* Invariant: we expect the typechecker & lambda emitter  
       will not do agressive inlining
       Worst things could happen
    {[
      let x = y## case 3  in 
      x 2
    ]}
       in normal case, it should be compiled into Lambda
    {[
      let x = Lsend(y,case, [3]) in 
      Lapp(x,2)
    ]}

       worst:
    {[ Lsend(y, case, [3,2])
    ]}               
       for setter(include case setter), this could 
       be prevented by type system, for getter.

       solution: we can prevent this by rewrite into 
    {[
      Fn.run1  (!x# case) v 
      ]}
       *)

      *)

end = struct
#1 "ppx_entry.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * In addition to the permissions granted to you by the LGPL, you may combine
 * or link a "work that uses the Library" with a publicly distributed version
 * of this file to produce a combined library or application, then distribute
 * that combined work under the terms of your choosing, with no requirement
 * to comply with the obligations normally placed on you by section 4 of the
 * LGPL version 3 (or the corresponding section of a later version of the LGPL
 * should you choose to use a later version).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)






(* When we design a ppx, we should keep it simple, and also think about
   how it would work with other tools like merlin and ocamldep  *)

(**
   1. extension point
   {[
     [%bs.raw{| blabla |}]
   ]}
   will be desugared into
   {[
     let module Js =
     struct unsafe_js : string -> 'a end
     in Js.unsafe_js {| blabla |}
   ]}
   The major benefit is to better error reporting (with locations).
   Otherwise

   {[

     let f u = Js.unsafe_js u
     let _ = f (1 + 2)
   ]}
   And if it is inlined some where
*)



open Ast_helper




let record_as_js_object = ref false (* otherwise has an attribute *)
let no_export = ref false

let () =
  Ast_derive_projector.init ();
  Ast_derive_js_mapper.init ()

let reset () =
  record_as_js_object := false ;
  no_export  :=  false


let rec unsafe_mapper : Bs_ast_mapper.mapper =
  { Bs_ast_mapper.default_mapper with
    expr = (fun self e ->
        match e.pexp_desc with
        (** Its output should not be rewritten anymore *)
        | Pexp_extension extension ->
          Ast_exp_extension.handle_extension record_as_js_object e self extension
        | Pexp_constant (
            
            Const_string 
            
            (s, (Some delim)))
          ->
            Ast_utf8_string_interp.transform e s delim
        (** End rewriting *)
        | Pexp_function cases ->
          (* {[ function [@bs.exn]
                | Not_found -> 0
                | Invalid_argument -> 1
              ]}*)
          begin match
              Ast_attributes.process_pexp_fun_attributes_rev e.pexp_attributes
            with
            | `Nothing, _ ->
              Bs_ast_mapper.default_mapper.expr self  e
            | `Exn, pexp_attributes ->
              Ast_util.convertBsErrorFunction e.pexp_loc self  pexp_attributes cases
          end
        | Pexp_fun (arg_label, _, pat , body)
          when Ast_compatible.is_arg_label_simple arg_label
          ->
          begin match Ast_attributes.process_attributes_rev e.pexp_attributes with
            | Nothing, _
              -> Bs_ast_mapper.default_mapper.expr self e
            | Uncurry _, pexp_attributes
              ->
              {e with
               pexp_desc = Ast_util.to_uncurry_fn e.pexp_loc self pat body  ;
               pexp_attributes}
            | Method _ , _
              ->  Location.raise_errorf ~loc:e.pexp_loc "bs.meth is not supported in function expression"
            | Meth_callback _, pexp_attributes
              ->
              {e with pexp_desc = Ast_util.to_method_callback e.pexp_loc  self pat body ;
                      pexp_attributes }
          end
        | Pexp_apply (fn, args  ) ->
          Ast_exp_apply.handle_exp_apply e self fn args
        | Pexp_record (label_exprs, opt_exp)  ->
          if !record_as_js_object then
            (match opt_exp with
             | None ->
               { e with
                 pexp_desc =
                   Ast_util.record_as_js_object e.pexp_loc self label_exprs;
               }
             | Some e ->
               Location.raise_errorf
                 ~loc:e.pexp_loc "`with` construct is not supported in bs.obj ")
          else
            (* could be supported using `Object.assign`?
               type
               {[
                 external update : 'a Js.t -> 'b Js.t -> 'a Js.t = ""
                 constraint 'b :> 'a
               ]}
            *)
            Bs_ast_mapper.default_mapper.expr  self e
        | Pexp_object {pcstr_self;  pcstr_fields} ->
          begin match Ast_attributes.process_bs e.pexp_attributes with
            | `Has, pexp_attributes
              ->
              {e with
               pexp_desc =
                 Ast_util.ocaml_obj_as_js_object
                   e.pexp_loc self pcstr_self pcstr_fields;
               pexp_attributes
              }
            | `Nothing , _ ->
              Bs_ast_mapper.default_mapper.expr  self e
          end
        | _ ->  Bs_ast_mapper.default_mapper.expr self e
      );
    typ = (fun self typ ->
        Ast_core_type_class_type.handle_core_type self typ record_as_js_object);
    class_type =
      (fun self ({pcty_attributes; pcty_loc} as ctd) ->
         match Ast_attributes.process_bs pcty_attributes with
         | `Nothing,  _ ->
           Bs_ast_mapper.default_mapper.class_type self ctd
         | `Has, pcty_attributes ->
             (match ctd.pcty_desc with
             | Pcty_signature ({pcsig_self; pcsig_fields })
               ->
               let pcsig_self = self.typ self pcsig_self in
               {ctd with
                pcty_desc = Pcty_signature {
                    pcsig_self ;
                    pcsig_fields = Ast_core_type_class_type.handle_class_type_fields self pcsig_fields
                  };
                pcty_attributes
               }               

             | Pcty_constr _
             | Pcty_extension _
             | Pcty_arrow _ ->
               Location.raise_errorf ~loc:pcty_loc "invalid or unused attribute `bs`")
               (* {[class x : int -> object
                    end [@bs]
                  ]}
                  Actually this is not going to happpen as below is an invalid syntax
                  {[class type x = int -> object
                      end[@bs]]}
               *)
      );
    signature_item =  begin fun
      (self : Bs_ast_mapper.mapper)
      (sigi : Parsetree.signature_item) ->
      match sigi.psig_desc with
      | Psig_type (
          
           (_ :: _ as tdcls)) ->  (*FIXME: check recursive handling*)
          Ast_tdcls.handleTdclsInSigi self sigi tdcls
      | Psig_value prim
        when Ast_attributes.process_external prim.pval_attributes
        ->
          Ast_primitive.handlePrimitiveInSig self prim sigi
      | _ -> Bs_ast_mapper.default_mapper.signature_item self sigi
    end;
    pat = begin fun self (pat : Parsetree.pattern) ->
      match pat with
      | { ppat_desc = Ppat_constant(
            
            Const_string 
                    
         (_, Some "j")); ppat_loc = loc} ->
        Location.raise_errorf ~loc  "Unicode string is not allowed in pattern match"
      | _  -> Bs_ast_mapper.default_mapper.pat self pat

    end;
    value_bindings = Ast_tuple_pattern_flatten.handle_value_bindings;
    structure_item = begin fun self (str : Parsetree.structure_item) ->
      begin match str.pstr_desc with
        | Pstr_extension ( ({txt = ("bs.raw"| "raw") ; loc}, payload), _attrs)
          ->
          Ast_util.handle_raw_structure loc payload
        | Pstr_extension (({txt = ("bs.debugger.chrome" | "debugger.chrome") ;loc}, payload),_)
          ->          
          if !Js_config.debug then 
            let open Ast_helper in 
            Str.eval ~loc (Ast_compatible.app1 ~loc 
            (Exp.ident ~loc {txt = Ldot(Ldot (Lident"Belt","Debug"), "setupChromeDebugger");loc} )
             (Ast_literal.val_unit ~loc ())
             )
          else Ast_structure.dummy_item loc
        | Pstr_type (
          
          (_ :: _ as tdcls )) (* [ {ptype_attributes} as tdcl ] *)->
          Ast_tdcls.handleTdclsInStru self str tdcls
        | Pstr_primitive prim
          when Ast_attributes.process_external prim.pval_attributes
          ->
          Ast_primitive.handlePrimitiveInStru self prim str
        | _ -> Bs_ast_mapper.default_mapper.structure_item self str
      end
    end
  }




(** global configurations below *)
let common_actions_table :
  (string *  (Parsetree.expression option -> unit)) list =
  [
  ]


let structural_config_table  =
  String_map.of_list
    (( "no_export" ,
       (fun x ->
          no_export := (
            match x with
            |Some e -> Ast_payload.assert_bool_lit e
            | None -> true)
       ))
     :: common_actions_table)

let signature_config_table :
  (Parsetree.expression option -> unit) String_map.t=
  String_map.of_list common_actions_table


let rewrite_signature :
  (Parsetree.signature  -> Parsetree.signature) ref =
  ref (fun  x ->
      let result =
        match (x : Parsetree.signature) with
        | {psig_desc = Psig_attribute ({txt = "bs.config"; loc}, payload); _} :: rest
          ->
          begin
            Ast_payload.ident_or_record_as_config loc payload
            |> List.iter (Ast_payload.table_dispatch signature_config_table) ;
            unsafe_mapper.signature unsafe_mapper rest
          end
        | _ ->
          unsafe_mapper.signature  unsafe_mapper x in
      reset ();
      (* Keep this check, since the check is not inexpensive*)
      Bs_ast_invariant.emit_external_warnings_on_signature result;
      result
    )

let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref =
  ref (fun (x : Parsetree.structure) ->
      let result =
        match x with
        | {pstr_desc = Pstr_attribute ({txt = "bs.config"; loc}, payload); _} :: rest
          ->
          begin
            Ext_list.iter (Ast_payload.ident_or_record_as_config loc payload)
              (Ast_payload.table_dispatch structural_config_table) ;
            let rest = unsafe_mapper.structure unsafe_mapper rest in
            if !no_export then
              [Str.include_ ~loc
                 (Incl.mk ~loc
                    (Mod.constraint_ ~loc
                       (Mod.structure ~loc rest  )
                       (Mty.signature ~loc [])
                    ))]
            else rest
          end
        | _ ->
          unsafe_mapper.structure  unsafe_mapper x  in
      reset ();
      (* Keep this check since it is not inexpensive*)
      Bs_ast_invariant.emit_external_warnings_on_structure result;
      result
    )


end
module Ocamldep
= struct
#1 "ocamldep.ml"
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         *)
(*                                                                     *)
(*  Copyright 1999 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Compenv
open Parsetree

let ppf = Format.err_formatter
(* Print the dependencies *)

type file_kind = ML | MLI;;

let load_path = ref ([] : (string * string array) list)
let ml_synonyms = ref [".ml"]
let mli_synonyms = ref [".mli"]
let native_only = ref false
let error_occurred = ref false
let raw_dependencies = ref false
let sort_files = ref false
let all_dependencies = ref false
let one_line = ref false
let files = ref []

let cmx_suffix = 

    ".cmj"

(* Fix path to use '/' as directory separator instead of '\'.
   Only under Windows. *)

let fix_slash s =
  if Sys.os_type = "Unix" then s else begin
    String.map (function '\\' -> '/' | c -> c) s
  end

(* Since we reinitialize load_path after reading OCAMLCOMP,
  we must use a cache instead of calling Sys.readdir too often. *)
module StringMap = Map.Make(String)
let dirs = ref StringMap.empty
let readdir dir =
  try
    StringMap.find dir !dirs
  with Not_found ->
    let contents =
      try
        Sys.readdir dir
      with Sys_error msg ->
        Format.fprintf Format.err_formatter "@[Bad -I option: %s@]@." msg;
        error_occurred := true;
        [||]
    in
    dirs := StringMap.add dir contents !dirs;
    contents

let add_to_list li s =
  li := s :: !li

let add_to_load_path dir =
  try
    let dir = Misc.expand_directory Config.standard_library dir in
    let contents = readdir dir in
    add_to_list load_path (dir, contents)
  with Sys_error msg ->
    Format.fprintf Format.err_formatter "@[Bad -I option: %s@]@." msg;
    error_occurred := true

let add_to_synonym_list synonyms suffix =
  if (String.length suffix) > 1 && suffix.[0] = '.' then
    add_to_list synonyms suffix
  else begin
    Format.fprintf Format.err_formatter "@[Bad suffix: '%s'@]@." suffix;
    error_occurred := true
  end

(* Find file 'name' (capitalized) in search path *)
let find_file name =
  let uname = String.uncapitalize name in
  let rec find_in_array a pos =
    if pos >= Array.length a then None else begin
      let s = a.(pos) in
      if s = name || s = uname then Some s else find_in_array a (pos + 1)
    end in
  let rec find_in_path = function
    [] -> raise Not_found
  | (dir, contents) :: rem ->
      match find_in_array contents 0 with
        Some truename ->
          if dir = "." then truename else Filename.concat dir truename
      | None -> find_in_path rem in
  find_in_path !load_path

let rec find_file_in_list = function
  [] -> raise Not_found
| x :: rem -> try find_file x with Not_found -> find_file_in_list rem


let find_dependency target_kind modname (byt_deps, opt_deps) =
  try
    let candidates = List.map ((^) modname) !mli_synonyms in
    let filename = find_file_in_list candidates in
    let basename = Filename.chop_extension filename in
    let cmi_file = basename ^ ".cmi" in
    let ml_exists =
      List.exists (fun ext -> Sys.file_exists (basename ^ ext)) !ml_synonyms in
    let new_opt_dep =
      if !all_dependencies then
        match target_kind with
        | MLI -> [ cmi_file ]
        | ML  ->
          cmi_file :: (if ml_exists then [ basename ^ cmx_suffix] else [])
      else
        (* this is a make-specific hack that makes .cmx to be a 'proxy'
           target that would force the dependency on .cmi via transitivity *)
        if ml_exists
        then [ basename ^ cmx_suffix ]
        else [ cmi_file ]
    in
    ( cmi_file :: byt_deps, new_opt_dep @ opt_deps)
  with Not_found ->
  try
    (* "just .ml" case *)
    let candidates = List.map ((^) modname) !ml_synonyms in
    let filename = find_file_in_list candidates in
    let basename = Filename.chop_extension filename in
    let bytenames =
      if !all_dependencies then
        match target_kind with
        | MLI -> [basename ^ ".cmi"]
        | ML  -> [basename ^ ".cmi";]
      else
        (* again, make-specific hack *)
        [basename ^ (if !native_only then cmx_suffix else ".cmo")] in
    let optnames =
      if !all_dependencies
      then match target_kind with
        | MLI -> [basename ^ ".cmi"]
        | ML  -> [basename ^ ".cmi"; basename ^ cmx_suffix]
      else [ basename ^ cmx_suffix ]
    in
    (bytenames @ byt_deps, optnames @  opt_deps)
  with Not_found ->
    (byt_deps, opt_deps)

let (depends_on, escaped_eol) = (":", " \\\n    ")

let print_filename s =
  let s = if !Clflags.force_slash then fix_slash s else s in
  if not (String.contains s ' ') then begin
    print_string s;
  end else begin
    let rec count n i =
      if i >= String.length s then n
      else if s.[i] = ' ' then count (n+1) (i+1)
      else count n (i+1)
    in
    let spaces = count 0 0 in
    let result = Bytes.create (String.length s + spaces) in
    let rec loop i j =
      if i >= String.length s then ()
      else if s.[i] = ' ' then begin
        Bytes.set result j '\\';
        Bytes.set result (j+1) ' ';
        loop (i+1) (j+2);
      end else begin
        Bytes.set result j s.[i];
        loop (i+1) (j+1);
      end
    in
    loop 0 0;
    print_bytes result;
  end
;;

let print_dependencies target_files deps =
  let rec print_items pos = function
    [] -> print_string "\n"
  | dep :: rem ->
    if !one_line || (pos + 1 + String.length dep <= 77) then begin
        if pos <> 0 then print_string " "; print_filename dep;
        print_items (pos + String.length dep + 1) rem
      end else begin
        print_string escaped_eol; print_filename dep;
        print_items (String.length dep + 4) rem
      end in
  print_items 0 (target_files @ [depends_on] @ deps)

let print_raw_dependencies source_file deps =
  print_filename source_file; print_string depends_on;
  Depend.StringSet.iter
    (fun dep ->
      if (String.length dep > 0)
          && (match dep.[0] with 'A'..'Z' -> true | _ -> false) then begin
            print_char ' ';
            print_string dep
          end)
    deps;
  print_char '\n'


(* Process one file *)

let report_err exn =
  error_occurred := true;
  match exn with
    | Sys_error msg ->
        Format.fprintf Format.err_formatter "@[I/O error:@ %s@]@." msg
    | x ->
        match Location.error_of_exn x with
        | Some err ->
            Format.fprintf Format.err_formatter "@[%a@]@."
              Location.report_error err
        | None -> raise x

let tool_name = "ocamldep"

let read_parse_and_extract parse_function extract_function magic source_file =
  Depend.free_structure_names := Depend.StringSet.empty;
  try
    let input_file = Pparse.preprocess source_file in
    begin try
      let ast =
        Pparse.file ~tool_name Format.err_formatter
		    input_file parse_function magic
      in
      let bound_vars = Depend.StringSet.empty in
      List.iter (fun modname ->
	Depend.open_module bound_vars (Longident.Lident modname)
      ) !Clflags.open_modules;
      extract_function bound_vars ast;
      Pparse.remove_preprocessed input_file;
      !Depend.free_structure_names
    with x ->
      Pparse.remove_preprocessed input_file;
      raise x
    end
  with x ->
    report_err x;
    Depend.StringSet.empty

let ml_file_dependencies source_file =
  let parse_use_file_as_impl lexbuf =
    let f x =
      match x with
      | Ptop_def s -> s
      | Ptop_dir _ -> []
    in
    List.flatten (List.map f (Parse.use_file lexbuf))

    |> !Ppx_entry.rewrite_implementation

  in
  let extracted_deps =
    read_parse_and_extract parse_use_file_as_impl Depend.add_implementation
                           Config.ast_impl_magic_number source_file
  in
  if !sort_files then
    files := (source_file, ML, !Depend.free_structure_names) :: !files
  else
    if !raw_dependencies then begin
      print_raw_dependencies source_file extracted_deps
    end else begin
      let basename = Filename.chop_extension source_file in
      let byte_targets = [ basename ^ ".cmo" ] in
      let native_targets =
        if !all_dependencies
        then [ basename ^ cmx_suffix; basename ^ ".o" ]
        else [ basename ^ cmx_suffix ] in
      let init_deps = if !all_dependencies then [source_file] else [] in
      let cmi_name = basename ^ ".cmi" in
      let init_deps, extra_targets =
        if List.exists (fun ext -> Sys.file_exists (basename ^ ext))
                       !mli_synonyms
        then (cmi_name :: init_deps, cmi_name :: init_deps), []
        else (init_deps, init_deps),
             (if !all_dependencies then [cmi_name] else [])
      in
      let (byt_deps, native_deps) =
        Depend.StringSet.fold (find_dependency ML)
          extracted_deps init_deps in

      print_dependencies (native_targets @ extra_targets) native_deps;
    end

let mli_file_dependencies source_file =
  let extracted_deps =
    read_parse_and_extract 

      (fun lexbuf -> !Ppx_entry.rewrite_signature (Parse.interface lexbuf) )

      Depend.add_signature
      Config.ast_intf_magic_number source_file
  in
  if !sort_files then
    files := (source_file, MLI, extracted_deps) :: !files
  else
    if !raw_dependencies then begin
      print_raw_dependencies source_file extracted_deps
    end else begin
      let basename = Filename.chop_extension source_file in
      let (byt_deps, _opt_deps) =
        Depend.StringSet.fold (find_dependency MLI)
          extracted_deps ([], []) in
      print_dependencies [basename ^ ".cmi"] byt_deps
    end

let file_dependencies_as kind source_file =
  Compenv.readenv ppf Before_compile;
  load_path := [];
  List.iter add_to_load_path (
      (!Compenv.last_include_dirs @
       !Clflags.include_dirs @
       !Compenv.first_include_dirs
      ));
  Location.input_name := source_file;
  try
    if Sys.file_exists source_file then begin
      match kind with
      | ML -> ml_file_dependencies source_file
      | MLI -> mli_file_dependencies source_file
    end
  with x -> report_err x

let file_dependencies source_file =
  if List.exists (Filename.check_suffix source_file) !ml_synonyms then
    file_dependencies_as ML source_file
  else if List.exists (Filename.check_suffix source_file) !mli_synonyms then
    file_dependencies_as MLI source_file
  else ()

let sort_files_by_dependencies files =
  let h = Hashtbl.create 31 in
  let worklist = ref [] in

(* Init Hashtbl with all defined modules *)
  let files = List.map (fun (file, file_kind, deps) ->
    let modname =
      String.capitalize (Filename.chop_extension (Filename.basename file))
    in
    let key = (modname, file_kind) in
    let new_deps = ref [] in
    Hashtbl.add h key (file, new_deps);
    worklist := key :: !worklist;
    (modname, file_kind, deps, new_deps)
  ) files in

(* Keep only dependencies to defined modules *)
  List.iter (fun (modname, file_kind, deps, new_deps) ->
    let add_dep modname kind =
      new_deps := (modname, kind) :: !new_deps;
    in
    Depend.StringSet.iter (fun modname ->
      match file_kind with
          ML -> (* ML depends both on ML and MLI *)
            if Hashtbl.mem h (modname, MLI) then add_dep modname MLI;
            if Hashtbl.mem h (modname, ML) then add_dep modname ML
        | MLI -> (* MLI depends on MLI if exists, or ML otherwise *)
          if Hashtbl.mem h (modname, MLI) then add_dep modname MLI
          else if Hashtbl.mem h (modname, ML) then add_dep modname ML
    ) deps;
    if file_kind = ML then (* add dep from .ml to .mli *)
      if Hashtbl.mem h (modname, MLI) then add_dep modname MLI
  ) files;

(* Print and remove all files with no remaining dependency. Iterate
   until all files have been removed (worklist is empty) or
   no file was removed during a turn (cycle). *)
  let printed = ref true in
  while !printed && !worklist <> [] do
    let files = !worklist in
    worklist := [];
    printed := false;
    List.iter (fun key ->
      let (file, deps) = Hashtbl.find h key in
      let set = !deps in
      deps := [];
      List.iter (fun key ->
        if Hashtbl.mem h key then deps := key :: !deps
      ) set;
      if !deps = [] then begin
        printed := true;
        Printf.printf "%s " file;
        Hashtbl.remove h key;
      end else
        worklist := key :: !worklist
    ) files
  done;

  if !worklist <> [] then begin
    Format.fprintf Format.err_formatter
      "@[Warning: cycle in dependencies. End of list is not sorted.@]@.";
    Hashtbl.iter (fun _ (file, deps) ->
      Format.fprintf Format.err_formatter "\t@[%s: " file;
      List.iter (fun (modname, kind) ->
        Format.fprintf Format.err_formatter "%s.%s " modname
          (if kind=ML then "ml" else "mli");
      ) !deps;
      Format.fprintf Format.err_formatter "@]@.";
      Printf.printf "%s " file) h;
  end;
  Printf.printf "\n%!";
  ()


(* Entry point *)

let usage = "Usage: ocamldep [options] <source files>\nOptions are:"

let print_version () =
  Format.printf "ocamldep, version %s@." Sys.ocaml_version;
  exit 0;
;;

let print_version_num () =
  Format.printf "%s@." Sys.ocaml_version;
  exit 0;
;;


let _ =

  native_only := true;
  Bs_conditional_initial.setup_env ();
  one_line := true;

  Clflags.classic := false;
 
  (if not !Clflags.no_implicit_current_dir then
    add_to_list first_include_dirs Filename.current_dir_name);

  Compenv.readenv ppf Before_args;
  Arg.parse [
     "-absname", Arg.Set Location.absname,
        " Show absolute filenames in error messages";
     "-all", Arg.Set all_dependencies,
        " Generate dependencies on all files";
     "-I", Arg.String (add_to_list Clflags.include_dirs),
        "<dir>  Add <dir> to the list of include directories";
     "-impl", Arg.String (file_dependencies_as ML),
        "<f>  Process <f> as a .ml file";
     "-intf", Arg.String (file_dependencies_as MLI),
        "<f>  Process <f> as a .mli file";
     "-ml-synonym", Arg.String(add_to_synonym_list ml_synonyms),
        "<e>  Consider <e> as a synonym of the .ml extension";
     "-mli-synonym", Arg.String(add_to_synonym_list mli_synonyms),
        "<e>  Consider <e> as a synonym of the .mli extension";
     "-modules", Arg.Set raw_dependencies,
        " Print module dependencies in raw form (not suitable for make)";
     "-native", Arg.Set native_only,
        " Generate dependencies for native-code only (no .cmo files)";
     "-one-line", Arg.Set one_line,
        " Output one line per file, regardless of the length";
     "-open", Arg.String (add_to_list Clflags.open_modules),
        "<module>  Opens the module <module> before typing";
     "-pp", Arg.String(fun s -> Clflags.preprocessor := Some s),
         "<cmd>  Pipe sources through preprocessor <cmd>";
     "-ppx", Arg.String (add_to_list first_ppx),
         "<cmd>  Pipe abstract syntax trees through preprocessor <cmd>";
     "-slash", Arg.Set Clflags.force_slash,
         " (Windows) Use forward slash / instead of backslash \\ in file paths";
     "-sort", Arg.Set sort_files,
        " Sort files according to their dependencies";
     "-version", Arg.Unit print_version,
         " Print version and exit";
     "-vnum", Arg.Unit print_version_num,
         " Print version number and exit";
    ] file_dependencies usage;
  Compenv.readenv ppf Before_link;
  if !sort_files then sort_files_by_dependencies !files;
  exit (if !error_occurred then 2 else 0)

end
