Commits

camlspotter  committed eee6450

json-wheel-1.0.6 original

  • Participants
  • Tags v1.0.6-original

Comments (0)

Files changed (47)

+Version 1.0.6, 2009-01-15:
+   failing on non-finite float values (nan, inf, -inf), or properly
+   (de)serializing them using the Javascript notation 
+   (NaN, Infinity, -Infinity) if allow_nan is true.
+
+Version 1.0.5, 2009-01-13: added option for non object/array serialization.
+
+Version 1.0.4, 2007-03-17: 
+  * faster conversion to string
+  * jsoncat utility is now compiled and installed
+
+Version 1.0.3, 2007-03-06: better indentation by the pretty-printer
+
+Version 1.0.2, 2007-02-16: faster output of JSON strings
+
+Version 1.0.1, 2006-12-04: fixes incorrect META file
+
+Version 1.0.0, 2006-12-03: first public release
+Copyright (c) 2006 Wink Technologies, Inc.
+Copyright (c) 2006, 2009 Martin Jambon
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+name = "json-wheel"
+version = "1.0.6"
+description = "JSON data format"
+requires = "netstring"
+archive(byte)    = "jsonwheel.cma"
+archive(native)  = "jsonwheel.cmxa"

File META.template

+description = "JSON data format"
+requires = "netstring"
+archive(byte)    = "jsonwheel.cma"
+archive(native)  = "jsonwheel.cmxa"
+VERSION = 1.0.6
+export VERSION
+
+RESULT = jsonwheel
+NAME = json-wheel
+ONAME = json_wheel
+SOURCES = \
+  json_type.mli json_type.ml \
+  json_parser.mli json_parser.mly \
+  json_lexer.mll \
+  json_io.mli json_io.ml \
+  json_compat.ml
+
+PACKS = netstring
+
+STDBIN = $(shell dirname `which ocamlfind`)
+ifndef PREFIX
+  PREFIX = $(shell dirname $(STDBIN))
+endif
+export PREFIX
+
+ifndef BINDIR
+  BINDIR = $(PREFIX)/bin
+endif
+export BINDIR
+
+BYTERESULT = $(RESULT).cma json_*.cmo
+OPTRESULT = $(RESULT).cmxa $(RESULT).a json_*.cmx json_*.o
+
+
+.PHONY: default all opt install uninstall html archive test
+
+default: bcl ncl jsoncat
+
+all: bcl
+opt: ncl jsoncat
+
+
+install:
+	$(MAKE) META
+	ocamlfind install $(NAME) META json_*.cmi \
+		json_type.mli json_io.mli json_compat.ml \
+		`test -f $(RESULT).cma && echo $(BYTERESULT)` \
+		`test -f $(RESULT).cmxa && echo $(OPTRESULT)`
+	if test -f jsoncat$(EXE); \
+		then install -m 0755 jsoncat$(EXE) $(BINDIR)/ ; \
+		else : ; fi
+uninstall:
+	ocamlfind remove $(NAME)
+	rm -f $(BINDIR)/jsoncat$(EXE)
+
+version.ml: Makefile
+	echo 'let version = "$(VERSION)"' > version.ml
+jsoncat: version.ml jsoncat.ml
+	$(MAKE) ncl
+	ocamlfind ocamlopt -o jsoncat -package $(PACKS) -linkpkg \
+		$(RESULT).cmxa version.ml jsoncat.ml
+
+test: jsoncat
+	./jsoncat -test
+	cmp sample-compact.json sample-compact2.json
+	cmp sample-indented.json sample-indented2.json
+	rm sample-compact.json sample-compact2.json \
+		sample-indented.json sample-indented2.json
+check:
+	@echo "-------------------- Standard mode --------------------"
+	./check.sh
+	@echo "--------------------- Big int mode --------------------"
+	./check.sh -b
+	@echo "Some of the tests are known to produce an ERROR, see README."
+
+
+META: META.template Makefile
+	echo 'name = "$(NAME)"' > META
+	echo 'version = "$(VERSION)"' >> META
+	cat META.template >> META
+
+html:
+	ocamldoc -d html -html json_type.mli json_io.mli json_compat.ml
+
+archive: META html
+		rm -rf /tmp/$(NAME) /tmp/$(NAME)-$(VERSION) && \
+	 	cp -r . /tmp/$(NAME) && \
+		cd /tmp/$(NAME) && \
+			$(MAKE) clean && \
+			rm -f *~ $(NAME)*.tar* && \
+		cd /tmp && cp -r $(NAME) $(NAME)-$(VERSION) && \
+		tar czf $(NAME).tar.gz $(NAME) && \
+		tar cjf $(NAME).tar.bz2 $(NAME) && \
+		tar czf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) && \
+		tar cjf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION)
+	mv /tmp/$(NAME).tar.gz /tmp/$(NAME).tar.bz2 .
+	mv /tmp/$(NAME)-$(VERSION).tar.gz /tmp/$(NAME)-$(VERSION).tar.bz2 .
+	cp $(NAME).tar.gz $(NAME).tar.bz2 $$WWW/
+	cp $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION).tar.bz2 $$WWW/
+	cp LICENSE $$WWW/$(NAME)-license.txt
+	echo 'let $(ONAME)_version = "$(VERSION)"' \
+		> $$WWW/$(NAME)-version.ml
+	cp Changes $$WWW/$(NAME)-changes.txt
+	mkdir -p $$WWW/$(NAME)-doc
+	cp html/* $$WWW/$(NAME)-doc
+
+
+TRASH = jsoncat jsoncat.o jsoncat.cm* version.* \
+  sample-compact.json sample-compact2.json \
+  sample-indented.json sample-indented2.json
+
+OCAMLMAKEFILE = OCamlMakefile
+include $(OCAMLMAKEFILE)

File OCamlMakefile

+###########################################################################
+#                              OCamlMakefile
+#                  Copyright (C) 1999-2004  Markus Mottl
+#
+#                             For updates see:
+#                http://www.ocaml.info/home/ocaml_sources.html
+#
+#        $Id: OCamlMakefile,v 1.72 2005/12/09 15:30:50 mottl Exp $
+#
+###########################################################################
+
+# Modified by damien for .glade.ml compilation
+
+# Set these variables to the names of the sources to be processed and
+# the result variable. Order matters during linkage!
+
+ifndef SOURCES
+  SOURCES := foo.ml
+endif
+export SOURCES
+
+ifndef RES_CLIB_SUF
+  RES_CLIB_SUF := _stubs
+endif
+export RES_CLIB_SUF
+
+ifndef RESULT
+  RESULT := foo
+endif
+export RESULT
+
+export LIB_PACK_NAME
+
+ifndef DOC_FILES
+  DOC_FILES := $(filter %.mli, $(SOURCES))
+endif
+export DOC_FILES
+
+export BCSUFFIX
+export NCSUFFIX
+
+ifndef TOPSUFFIX
+  TOPSUFFIX := .top
+endif
+export TOPSUFFIX
+
+# Eventually set include- and library-paths, libraries to link,
+# additional compilation-, link- and ocamlyacc-flags
+# Path- and library information needs not be written with "-I" and such...
+# Define THREADS if you need it, otherwise leave it unset (same for
+# USE_CAMLP4)!
+
+export THREADS
+export VMTHREADS
+export ANNOTATE
+export USE_CAMLP4
+
+export INCDIRS
+export LIBDIRS
+export EXTLIBDIRS
+export RESULTDEPS
+export OCAML_DEFAULT_DIRS
+
+export LIBS
+export CLIBS
+
+export OCAMLFLAGS
+export OCAMLNCFLAGS
+export OCAMLBCFLAGS
+
+export OCAMLLDFLAGS
+export OCAMLNLDFLAGS
+export OCAMLBLDFLAGS
+
+ifndef OCAMLCPFLAGS
+  OCAMLCPFLAGS := a
+endif
+
+export OCAMLCPFLAGS
+
+export PPFLAGS
+
+export YFLAGS
+export IDLFLAGS
+
+export OCAMLDOCFLAGS
+
+export OCAMLFIND_INSTFLAGS
+
+export DVIPSFLAGS
+
+export STATIC
+
+# Add a list of optional trash files that should be deleted by "make clean"
+export TRASH
+
+####################  variables depending on your OCaml-installation
+
+ifdef MINGW
+  export MINGW
+  WIN32   := 1
+  CFLAGS_WIN32 := -mno-cygwin
+endif
+ifdef MSVC
+  export MSVC
+  WIN32   := 1
+  ifndef STATIC
+    CPPFLAGS_WIN32 := -DCAML_DLL
+  endif
+  CFLAGS_WIN32 += -nologo
+  EXT_OBJ := obj
+  EXT_LIB := lib
+  ifeq ($(CC),gcc)
+    # work around GNU Make default value
+    ifdef THREADS
+      CC := cl -MT
+    else
+      CC := cl
+    endif
+  endif
+  ifeq ($(CXX),g++)
+    # work around GNU Make default value
+    CXX := $(CC)
+  endif
+  CFLAG_O := -Fo
+endif
+ifdef WIN32
+  EXT_CXX := cpp
+  EXE     := .exe
+endif
+
+ifndef EXT_OBJ
+  EXT_OBJ := o
+endif
+ifndef EXT_LIB
+  EXT_LIB := a
+endif
+ifndef EXT_CXX
+  EXT_CXX := cc
+endif
+ifndef EXE
+  EXE := # empty
+endif
+ifndef CFLAG_O
+  CFLAG_O := -o # do not delete this comment (preserves trailing whitespace)!
+endif
+
+export CC
+export CXX
+export CFLAGS
+export CXXFLAGS
+export LDFLAGS
+export CPPFLAGS
+
+ifndef RPATH_FLAG
+  RPATH_FLAG := -R
+endif
+export RPATH_FLAG
+
+ifndef MSVC
+ifndef PIC_CFLAGS
+  PIC_CFLAGS := -fPIC
+endif
+ifndef PIC_CPPFLAGS
+  PIC_CPPFLAGS := -DPIC
+endif
+endif
+
+export PIC_CFLAGS
+export PIC_CPPFLAGS
+
+BCRESULT  := $(addsuffix $(BCSUFFIX), $(RESULT))
+NCRESULT  := $(addsuffix $(NCSUFFIX), $(RESULT))
+TOPRESULT := $(addsuffix $(TOPSUFFIX), $(RESULT))
+
+ifndef OCAMLFIND
+  OCAMLFIND := ocamlfind
+endif
+export OCAMLFIND
+
+ifndef OCAMLC
+  OCAMLC := ocamlc
+endif
+export OCAMLC
+
+ifndef OCAMLOPT
+  OCAMLOPT := ocamlopt
+endif
+export OCAMLOPT
+
+ifndef OCAMLMKTOP
+  OCAMLMKTOP := ocamlmktop
+endif
+export OCAMLMKTOP
+
+ifndef OCAMLCP
+  OCAMLCP := ocamlcp
+endif
+export OCAMLCP
+
+ifndef OCAMLDEP
+  OCAMLDEP := ocamldep
+endif
+export OCAMLDEP
+
+ifndef OCAMLLEX
+  OCAMLLEX := ocamllex
+endif
+export OCAMLLEX
+
+ifndef OCAMLYACC
+  OCAMLYACC := ocamlyacc
+endif
+export OCAMLYACC
+
+ifndef OCAMLMKLIB
+  OCAMLMKLIB := ocamlmklib
+endif
+export OCAMLMKLIB
+
+ifndef OCAML_GLADECC
+  OCAML_GLADECC := lablgladecc2
+endif
+export OCAML_GLADECC
+
+ifndef OCAML_GLADECC_FLAGS
+  OCAML_GLADECC_FLAGS :=
+endif
+export OCAML_GLADECC_FLAGS
+
+ifndef CAMELEON_REPORT
+  CAMELEON_REPORT := report
+endif
+export CAMELEON_REPORT
+
+ifndef CAMELEON_REPORT_FLAGS
+  CAMELEON_REPORT_FLAGS :=
+endif
+export CAMELEON_REPORT_FLAGS
+
+ifndef CAMELEON_ZOGGY
+  CAMELEON_ZOGGY := camlp4o pa_zog.cma pr_o.cmo
+endif
+export CAMELEON_ZOGGY
+
+ifndef CAMELEON_ZOGGY_FLAGS
+  CAMELEON_ZOGGY_FLAGS :=
+endif
+export CAMELEON_ZOGGY_FLAGS
+
+ifndef OXRIDL
+  OXRIDL := oxridl
+endif
+export OXRIDL
+
+ifndef CAMLIDL
+  CAMLIDL := camlidl
+endif
+export CAMLIDL
+
+ifndef CAMLIDLDLL
+  CAMLIDLDLL := camlidldll
+endif
+export CAMLIDLDLL
+
+ifndef NOIDLHEADER
+  MAYBE_IDL_HEADER := -header
+endif
+export NOIDLHEADER
+
+export NO_CUSTOM
+
+ifndef CAMLP4
+  CAMLP4 := camlp4
+endif
+export CAMLP4
+
+ifndef REAL_OCAMLFIND
+  ifdef PACKS
+    ifndef CREATE_LIB
+      ifdef THREADS
+	PACKS += threads
+      endif
+    endif
+    empty :=
+    space := $(empty) $(empty)
+    comma := ,
+    ifdef PREDS
+      PRE_OCAML_FIND_PREDICATES := $(subst $(space),$(comma),$(PREDS))
+      PRE_OCAML_FIND_PACKAGES := $(subst $(space),$(comma),$(PACKS))
+      OCAML_FIND_PREDICATES := -predicates $(PRE_OCAML_FIND_PREDICATES)
+  #    OCAML_DEP_PREDICATES := -syntax $(PRE_OCAML_FIND_PREDICATES)
+      OCAML_FIND_PACKAGES := $(OCAML_FIND_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
+      OCAML_DEP_PACKAGES := $(OCAML_DEP_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
+    else
+      OCAML_FIND_PACKAGES := -package $(subst $(space),$(comma),$(PACKS))
+      OCAML_DEP_PACKAGES :=
+    endif
+    OCAML_FIND_LINKPKG := -linkpkg
+    REAL_OCAMLFIND := $(OCAMLFIND)
+  endif
+endif
+
+export OCAML_FIND_PACKAGES
+export OCAML_DEP_PACKAGES
+export OCAML_FIND_LINKPKG
+export REAL_OCAMLFIND
+
+ifndef OCAMLDOC
+  OCAMLDOC := ocamldoc
+endif
+export OCAMLDOC
+
+ifndef LATEX
+  LATEX := latex
+endif
+export LATEX
+
+ifndef DVIPS
+  DVIPS := dvips
+endif
+export DVIPS
+
+ifndef PS2PDF
+  PS2PDF := ps2pdf
+endif
+export PS2PDF
+
+ifndef OCAMLMAKEFILE
+  OCAMLMAKEFILE := OCamlMakefile
+endif
+export OCAMLMAKEFILE
+
+ifndef OCAMLLIBPATH
+  OCAMLLIBPATH := \
+    $(shell $(OCAMLC) 2>/dev/null -where || echo /usr/local/lib/ocaml)
+endif
+export OCAMLLIBPATH
+
+ifndef OCAML_LIB_INSTALL
+  OCAML_LIB_INSTALL := $(OCAMLLIBPATH)/contrib
+endif
+export OCAML_LIB_INSTALL
+
+###########################################################################
+
+####################  change following sections only if
+####################    you know what you are doing!
+
+# delete target files when a build command fails
+.PHONY: .DELETE_ON_ERROR
+.DELETE_ON_ERROR:
+
+# for pedants using "--warn-undefined-variables"
+export MAYBE_IDL
+export REAL_RESULT
+export CAMLIDLFLAGS
+export THREAD_FLAG
+export RES_CLIB
+export MAKEDLL
+export ANNOT_FLAG
+export C_OXRIDL
+export SUBPROJS
+export CFLAGS_WIN32
+export CPPFLAGS_WIN32
+
+INCFLAGS :=
+
+SHELL := /bin/sh
+
+MLDEPDIR := ._d
+BCDIDIR  := ._bcdi
+NCDIDIR  := ._ncdi
+
+FILTER_EXTNS := %.mli %.ml %.mll %.mly %.idl %.oxridl %.c %.$(EXT_CXX) %.rep %.zog %.glade
+
+FILTERED     := $(filter $(FILTER_EXTNS), $(SOURCES))
+SOURCE_DIRS  := $(filter-out ./, $(sort $(dir $(FILTERED))))
+
+FILTERED_REP := $(filter %.rep, $(FILTERED))
+DEP_REP      := $(FILTERED_REP:%.rep=$(MLDEPDIR)/%.d)
+AUTO_REP     := $(FILTERED_REP:.rep=.ml)
+
+FILTERED_ZOG := $(filter %.zog, $(FILTERED))
+DEP_ZOG      := $(FILTERED_ZOG:%.zog=$(MLDEPDIR)/%.d)
+AUTO_ZOG     := $(FILTERED_ZOG:.zog=.ml)
+
+FILTERED_GLADE := $(filter %.glade, $(FILTERED))
+DEP_GLADE      := $(FILTERED_GLADE:%.glade=$(MLDEPDIR)/%.d)
+AUTO_GLADE     := $(FILTERED_GLADE:.glade=.ml)
+
+FILTERED_ML  := $(filter %.ml, $(FILTERED))
+DEP_ML       := $(FILTERED_ML:%.ml=$(MLDEPDIR)/%.d)
+
+FILTERED_MLI := $(filter %.mli, $(FILTERED))
+DEP_MLI      := $(FILTERED_MLI:.mli=.di)
+
+FILTERED_MLL := $(filter %.mll, $(FILTERED))
+DEP_MLL      := $(FILTERED_MLL:%.mll=$(MLDEPDIR)/%.d)
+AUTO_MLL     := $(FILTERED_MLL:.mll=.ml)
+
+FILTERED_MLY := $(filter %.mly, $(FILTERED))
+DEP_MLY      := $(FILTERED_MLY:%.mly=$(MLDEPDIR)/%.d) $(FILTERED_MLY:.mly=.di)
+AUTO_MLY     := $(FILTERED_MLY:.mly=.mli) $(FILTERED_MLY:.mly=.ml)
+
+FILTERED_IDL := $(filter %.idl, $(FILTERED))
+DEP_IDL      := $(FILTERED_IDL:%.idl=$(MLDEPDIR)/%.d) $(FILTERED_IDL:.idl=.di)
+C_IDL        := $(FILTERED_IDL:%.idl=%_stubs.c)
+ifndef NOIDLHEADER
+ C_IDL += $(FILTERED_IDL:.idl=.h)
+endif
+OBJ_C_IDL    := $(FILTERED_IDL:%.idl=%_stubs.$(EXT_OBJ))
+AUTO_IDL     := $(FILTERED_IDL:.idl=.mli) $(FILTERED_IDL:.idl=.ml) $(C_IDL)
+
+FILTERED_OXRIDL := $(filter %.oxridl, $(FILTERED))
+DEP_OXRIDL      := $(FILTERED_OXRIDL:%.oxridl=$(MLDEPDIR)/%.d) $(FILTERED_OXRIDL:.oxridl=.di)
+AUTO_OXRIDL     := $(FILTERED_OXRIDL:.oxridl=.mli) $(FILTERED_OXRIDL:.oxridl=.ml) $(C_OXRIDL)
+
+FILTERED_C_CXX := $(filter %.c %.$(EXT_CXX), $(FILTERED))
+OBJ_C_CXX      := $(FILTERED_C_CXX:.c=.$(EXT_OBJ))
+OBJ_C_CXX      := $(OBJ_C_CXX:.$(EXT_CXX)=.$(EXT_OBJ))
+
+PRE_TARGETS  += $(AUTO_MLL) $(AUTO_MLY) $(AUTO_IDL) $(AUTO_OXRIDL) $(AUTO_ZOG) $(AUTO_REP) $(AUTO_GLADE)
+
+ALL_DEPS     := $(DEP_ML) $(DEP_MLI) $(DEP_MLL) $(DEP_MLY) $(DEP_IDL) $(DEP_OXRIDL) $(DEP_ZOG) $(DEP_REP) $(DEP_GLADE)
+
+MLDEPS       := $(filter %.d, $(ALL_DEPS))
+MLIDEPS      := $(filter %.di, $(ALL_DEPS))
+BCDEPIS      := $(MLIDEPS:%.di=$(BCDIDIR)/%.di)
+NCDEPIS      := $(MLIDEPS:%.di=$(NCDIDIR)/%.di)
+
+ALLML        := $(filter %.mli %.ml %.mll %.mly %.idl %.oxridl %.rep %.zog %.glade, $(FILTERED))
+
+IMPLO_INTF   := $(ALLML:%.mli=%.mli.__)
+IMPLO_INTF   := $(foreach file, $(IMPLO_INTF), \
+                  $(basename $(file)).cmi $(basename $(file)).cmo)
+IMPLO_INTF   := $(filter-out %.mli.cmo, $(IMPLO_INTF))
+IMPLO_INTF   := $(IMPLO_INTF:%.mli.cmi=%.cmi)
+
+IMPLX_INTF   := $(IMPLO_INTF:.cmo=.cmx)
+
+INTF         := $(filter %.cmi, $(IMPLO_INTF))
+IMPL_CMO     := $(filter %.cmo, $(IMPLO_INTF))
+IMPL_CMX     := $(IMPL_CMO:.cmo=.cmx)
+IMPL_ASM     := $(IMPL_CMO:.cmo=.asm)
+IMPL_S       := $(IMPL_CMO:.cmo=.s)
+
+OBJ_LINK     := $(OBJ_C_IDL) $(OBJ_C_CXX)
+OBJ_FILES    := $(IMPL_CMO:.cmo=.$(EXT_OBJ)) $(OBJ_LINK)
+
+EXECS        := $(addsuffix $(EXE), \
+                            $(sort $(TOPRESULT) $(BCRESULT) $(NCRESULT)))
+ifdef WIN32
+  EXECS      += $(BCRESULT).dll $(NCRESULT).dll
+endif
+
+CLIB_BASE    := $(RESULT)$(RES_CLIB_SUF)
+ifneq ($(strip $(OBJ_LINK)),)
+  RES_CLIB     := lib$(CLIB_BASE).$(EXT_LIB)
+endif
+
+ifdef WIN32
+DLLSONAME := $(CLIB_BASE).dll
+else
+DLLSONAME := dll$(CLIB_BASE).so
+endif
+
+NONEXECS     := $(INTF) $(IMPL_CMO) $(IMPL_CMX) $(IMPL_ASM) $(IMPL_S) \
+		$(OBJ_FILES) $(PRE_TARGETS) $(BCRESULT).cma $(NCRESULT).cmxa \
+		$(NCRESULT).$(EXT_LIB) $(BCRESULT).cmi $(BCRESULT).cmo \
+		$(NCRESULT).cmi $(NCRESULT).cmx $(NCRESULT).o \
+		$(RES_CLIB) $(IMPL_CMO:.cmo=.annot) \
+		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx $(LIB_PACK_NAME).o
+
+ifndef STATIC
+  NONEXECS += $(DLLSONAME)
+endif
+
+ifndef LIBINSTALL_FILES
+  LIBINSTALL_FILES := $(RESULT).mli $(RESULT).cmi $(RESULT).cma \
+		      $(RESULT).cmxa $(RESULT).$(EXT_LIB) $(RES_CLIB)
+  ifndef STATIC
+    ifneq ($(strip $(OBJ_LINK)),)
+      LIBINSTALL_FILES += $(DLLSONAME)
+    endif
+  endif
+endif
+
+export LIBINSTALL_FILES
+
+ifdef WIN32
+  # some extra stuff is created while linking DLLs
+  NONEXECS   += $(BCRESULT).$(EXT_LIB) $(BCRESULT).exp $(NCRESULT).exp $(CLIB_BASE).exp $(CLIB_BASE).lib
+endif
+
+TARGETS      := $(EXECS) $(NONEXECS)
+
+# If there are IDL-files
+ifneq ($(strip $(FILTERED_IDL)),)
+  MAYBE_IDL := -cclib -lcamlidl
+endif
+
+ifdef USE_CAMLP4
+  CAMLP4PATH := \
+    $(shell $(CAMLP4) -where 2>/dev/null || echo /usr/local/lib/camlp4)
+  INCFLAGS := -I $(CAMLP4PATH)
+  CINCFLAGS := -I$(CAMLP4PATH)
+endif
+
+DINCFLAGS := $(INCFLAGS) $(SOURCE_DIRS:%=-I %) $(OCAML_DEFAULT_DIRS:%=-I %)
+INCFLAGS := $(DINCFLAGS) $(INCDIRS:%=-I %)
+CINCFLAGS += $(SOURCE_DIRS:%=-I%) $(INCDIRS:%=-I%) $(OCAML_DEFAULT_DIRS:%=-I%)
+
+ifndef MSVC
+CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \
+             $(EXTLIBDIRS:%=-L%) $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%) \
+             $(OCAML_DEFAULT_DIRS:%=-L%)
+endif
+
+ifndef PROFILING
+  INTF_OCAMLC := $(OCAMLC)
+else
+  ifndef THREADS
+    INTF_OCAMLC := $(OCAMLCP) -p $(OCAMLCPFLAGS)
+  else
+    # OCaml does not support profiling byte code
+    # with threads (yet), therefore we force an error.
+    ifndef REAL_OCAMLC
+      $(error Profiling of multithreaded byte code not yet supported by OCaml)
+    endif
+    INTF_OCAMLC := $(OCAMLC)
+  endif
+endif
+
+ifndef MSVC
+COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \
+		  $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \
+		  $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%) \
+		  $(OCAML_DEFAULT_DIRS:%=-ccopt -L%)
+else
+COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \
+		  $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \
+		  $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) "
+endif
+
+CLIBS_OPTS := $(CLIBS:%=-cclib -l%)
+ifdef MSVC
+  ifndef STATIC
+  # MSVC libraries do not have 'lib' prefix
+  CLIBS_OPTS := $(CLIBS:%=-cclib %.lib)
+  endif
+endif
+
+ifneq ($(strip $(OBJ_LINK)),)
+  ifdef CREATE_LIB
+    OBJS_LIBS := -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL)
+  else
+    OBJS_LIBS := $(OBJ_LINK) $(CLIBS_OPTS) $(MAYBE_IDL)
+  endif
+else
+  OBJS_LIBS := $(CLIBS_OPTS) $(MAYBE_IDL)
+endif
+
+# If we have to make byte-code
+ifndef REAL_OCAMLC
+  BYTE_OCAML := y
+
+  # EXTRADEPS is added dependencies we have to insert for all
+  # executable files we generate.  Ideally it should be all of the
+  # libraries we use, but it's hard to find the ones that get searched on
+  # the path since I don't know the paths built into the compiler, so
+  # just include the ones with slashes in their names.
+  EXTRADEPS := $(addsuffix .cma,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
+  SPECIAL_OCAMLFLAGS := $(OCAMLBCFLAGS)
+
+  REAL_OCAMLC := $(INTF_OCAMLC)
+
+  REAL_IMPL := $(IMPL_CMO)
+  REAL_IMPL_INTF := $(IMPLO_INTF)
+  IMPL_SUF := .cmo
+
+  DEPFLAGS  :=
+  MAKE_DEPS := $(MLDEPS) $(BCDEPIS)
+
+  ifdef CREATE_LIB
+    override CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
+    override CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
+    ifndef STATIC
+      ifneq ($(strip $(OBJ_LINK)),)
+	MAKEDLL := $(DLLSONAME)
+	ALL_LDFLAGS := -dllib $(DLLSONAME)
+      endif
+    endif
+  endif
+
+  ifndef NO_CUSTOM
+    ifneq "$(strip $(OBJ_LINK) $(THREADS) $(MAYBE_IDL) $(CLIBS))" ""
+      ALL_LDFLAGS += -custom
+    endif
+  endif
+
+  ALL_LDFLAGS += $(INCFLAGS) $(OCAMLLDFLAGS) $(OCAMLBLDFLAGS) \
+                 $(COMMON_LDFLAGS) $(LIBS:%=%.cma)
+  CAMLIDLDLLFLAGS :=
+
+  ifdef THREADS
+    ifdef VMTHREADS
+      THREAD_FLAG := -vmthread
+    else
+      THREAD_FLAG := -thread
+    endif
+    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
+    ifndef CREATE_LIB
+      ifndef REAL_OCAMLFIND
+        ALL_LDFLAGS := unix.cma threads.cma $(ALL_LDFLAGS)
+      endif
+    endif
+  endif
+
+# we have to make native-code
+else
+  EXTRADEPS := $(addsuffix .cmxa,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
+  ifndef PROFILING
+    SPECIAL_OCAMLFLAGS := $(OCAMLNCFLAGS)
+    PLDFLAGS :=
+  else
+    SPECIAL_OCAMLFLAGS := -p $(OCAMLNCFLAGS)
+    PLDFLAGS := -p
+  endif
+
+  REAL_IMPL := $(IMPL_CMX)
+  REAL_IMPL_INTF := $(IMPLX_INTF)
+  IMPL_SUF := .cmx
+
+  override CPPFLAGS := -DNATIVE_CODE $(CPPFLAGS)
+
+  DEPFLAGS  := -native
+  MAKE_DEPS := $(MLDEPS) $(NCDEPIS)
+
+  ALL_LDFLAGS := $(PLDFLAGS) $(INCFLAGS) $(OCAMLLDFLAGS) \
+                 $(OCAMLNLDFLAGS) $(COMMON_LDFLAGS)
+  CAMLIDLDLLFLAGS := -opt
+
+  ifndef CREATE_LIB
+    ALL_LDFLAGS += $(LIBS:%=%.cmxa)
+  else
+    override CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
+    override CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
+  endif
+
+  ifdef THREADS
+    THREAD_FLAG := -thread
+    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
+    ifndef CREATE_LIB
+      ifndef REAL_OCAMLFIND
+        ALL_LDFLAGS := unix.cmxa threads.cmxa $(ALL_LDFLAGS)
+      endif
+    endif
+  endif
+endif
+
+export MAKE_DEPS
+
+ifdef ANNOTATE
+  ANNOT_FLAG := -dtypes
+else
+endif
+
+ALL_OCAMLCFLAGS := $(THREAD_FLAG) $(ANNOT_FLAG) $(OCAMLFLAGS) \
+                   $(INCFLAGS) $(SPECIAL_OCAMLFLAGS)
+
+ifdef make_deps
+  -include $(MAKE_DEPS)
+  PRE_TARGETS :=
+endif
+
+###########################################################################
+# USER RULES
+
+# Call "OCamlMakefile QUIET=" to get rid of all of the @'s.
+QUIET=@
+
+# generates byte-code (default)
+byte-code:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
+				REAL_RESULT="$(BCRESULT)" make_deps=yes
+bc:	byte-code
+
+byte-code-nolink:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
+				REAL_RESULT="$(BCRESULT)" make_deps=yes
+bcnl:	byte-code-nolink
+
+top:			$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(TOPRESULT) \
+				REAL_RESULT="$(BCRESULT)" make_deps=yes
+
+# generates native-code
+
+native-code:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
+				REAL_RESULT="$(NCRESULT)" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				make_deps=yes
+nc:	native-code
+
+native-code-nolink:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
+				REAL_RESULT="$(NCRESULT)" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				make_deps=yes
+ncnl:	native-code-nolink
+
+# generates byte-code libraries
+byte-code-library:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(BCRESULT).cma \
+				REAL_RESULT="$(BCRESULT)" \
+				CREATE_LIB=yes \
+				make_deps=yes
+bcl:	byte-code-library
+
+# generates native-code libraries
+native-code-library:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(NCRESULT).cmxa \
+				REAL_RESULT="$(NCRESULT)" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				CREATE_LIB=yes \
+				make_deps=yes
+ncl:	native-code-library
+
+ifdef WIN32
+# generates byte-code dll
+byte-code-dll:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(BCRESULT).dll \
+				REAL_RESULT="$(BCRESULT)" \
+				make_deps=yes
+bcd:	byte-code-dll
+
+# generates native-code dll
+native-code-dll:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(NCRESULT).dll \
+				REAL_RESULT="$(NCRESULT)" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				make_deps=yes
+ncd:	native-code-dll
+endif
+
+# generates byte-code with debugging information
+debug-code:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
+				REAL_RESULT="$(BCRESULT)" make_deps=yes \
+				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
+				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
+dc:	debug-code
+
+debug-code-nolink:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
+				REAL_RESULT="$(BCRESULT)" make_deps=yes \
+				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
+				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
+dcnl:	debug-code-nolink
+
+# generates byte-code libraries with debugging information
+debug-code-library:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(BCRESULT).cma \
+				REAL_RESULT="$(BCRESULT)" make_deps=yes \
+				CREATE_LIB=yes \
+				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
+				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
+dcl:	debug-code-library
+
+# generates byte-code for profiling
+profiling-byte-code:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
+				REAL_RESULT="$(BCRESULT)" PROFILING="y" \
+				make_deps=yes
+pbc:	profiling-byte-code
+
+# generates native-code
+
+profiling-native-code:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
+				REAL_RESULT="$(NCRESULT)" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				PROFILING="y" \
+				make_deps=yes
+pnc:	profiling-native-code
+
+# generates byte-code libraries
+profiling-byte-code-library:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(BCRESULT).cma \
+				REAL_RESULT="$(BCRESULT)" PROFILING="y" \
+				CREATE_LIB=yes \
+				make_deps=yes
+pbcl:	profiling-byte-code-library
+
+# generates native-code libraries
+profiling-native-code-library:	$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(RES_CLIB) $(NCRESULT).cmxa \
+				REAL_RESULT="$(NCRESULT)" PROFILING="y" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				CREATE_LIB=yes \
+				make_deps=yes
+pncl:	profiling-native-code-library
+
+# packs byte-code objects
+pack-byte-code:			$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT).cmo \
+				REAL_RESULT="$(BCRESULT)" \
+				PACK_LIB=yes make_deps=yes
+pabc:	pack-byte-code
+
+# packs native-code objects
+pack-native-code:		$(PRE_TARGETS)
+			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+				$(NCRESULT).cmx $(NCRESULT).o \
+				REAL_RESULT="$(NCRESULT)" \
+				REAL_OCAMLC="$(OCAMLOPT)" \
+				PACK_LIB=yes make_deps=yes
+panc:	pack-native-code
+
+# generates HTML-documentation
+htdoc:	doc/$(RESULT)/html
+
+# generates Latex-documentation
+ladoc:	doc/$(RESULT)/latex
+
+# generates PostScript-documentation
+psdoc:	doc/$(RESULT)/latex/doc.ps
+
+# generates PDF-documentation
+pdfdoc:	doc/$(RESULT)/latex/doc.pdf
+
+# generates all supported forms of documentation
+doc: htdoc ladoc psdoc pdfdoc
+
+###########################################################################
+# LOW LEVEL RULES
+
+$(REAL_RESULT):		$(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS) $(RESULTDEPS)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) \
+				$(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
+				$(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
+				$(REAL_IMPL)
+
+nolink:			$(REAL_IMPL_INTF) $(OBJ_LINK)
+
+ifdef WIN32
+$(REAL_RESULT).dll:	$(REAL_IMPL_INTF) $(OBJ_LINK)
+			$(CAMLIDLDLL) $(CAMLIDLDLLFLAGS) $(OBJ_LINK) $(CLIBS) \
+				-o $@ $(REAL_IMPL)
+endif
+
+%$(TOPSUFFIX):		$(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
+			$(REAL_OCAMLFIND) $(OCAMLMKTOP) \
+				$(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
+				$(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
+				$(REAL_IMPL)
+
+.SUFFIXES:		.mli .ml .cmi .cmo .cmx .cma .cmxa .$(EXT_OBJ) \
+                        .mly .di .d .$(EXT_LIB) .idl %.oxridl .c .$(EXT_CXX) .h .so \
+                        .rep .zog .glade
+
+ifndef STATIC
+ifdef MINGW
+$(DLLSONAME):		$(OBJ_LINK)
+			$(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
+			-Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
+			 $(OCAMLLIBPATH)/ocamlrun.a \
+			-Wl,--export-all-symbols \
+			-Wl,--no-whole-archive
+else
+ifdef MSVC
+$(DLLSONAME):		$(OBJ_LINK)
+			link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
+			 $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \
+			 $(OCAMLLIBPATH)/ocamlrun.lib
+
+else
+$(DLLSONAME):		$(OBJ_LINK)
+			$(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \
+				-o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \
+				$(OCAMLMKLIB_FLAGS)
+endif
+endif
+endif
+
+ifndef LIB_PACK_NAME
+$(RESULT).cma:		$(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) \
+				$(OBJS_LIBS) -o $@ $(OCAMLBLDFLAGS) $(REAL_IMPL)
+
+$(RESULT).cmxa $(RESULT).$(EXT_LIB):	$(REAL_IMPL_INTF) $(EXTRADEPS) $(RESULTDEPS)
+			$(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) \
+				$(OCAMLNLDFLAGS) -o $@ $(REAL_IMPL)
+else
+ifdef BYTE_OCAML
+$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo: $(REAL_IMPL_INTF)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(REAL_IMPL)
+else
+$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx: $(REAL_IMPL_INTF)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmx $(REAL_IMPL)
+endif
+
+$(RESULT).cma:		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) \
+				$(OBJS_LIBS) -o $@ $(OCAMLBLDFLAGS) $(LIB_PACK_NAME).cmo
+
+$(RESULT).cmxa $(RESULT).$(EXT_LIB):	$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx $(EXTRADEPS) $(RESULTDEPS)
+			$(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) \
+				$(OCAMLNLDFLAGS) -o $@ $(LIB_PACK_NAME).cmx
+endif
+
+$(RES_CLIB): 		$(OBJ_LINK)
+ifndef MSVC
+  ifneq ($(strip $(OBJ_LINK)),)
+		      $(AR) rcs $@ $(OBJ_LINK)
+  endif
+else
+  ifneq ($(strip $(OBJ_LINK)),)
+			lib -nologo -debugtype:cv -out:$(RES_CLIB) $(OBJ_LINK)
+  endif
+endif
+
+.mli.cmi: $(EXTRADEPS)
+			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+			if [ -z "$$pp" ]; then \
+			  echo $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c $(THREAD_FLAG) $(ANNOT_FLAG) \
+				$(OCAMLFLAGS) $(INCFLAGS) $<; \
+			  $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c $(THREAD_FLAG) $(ANNOT_FLAG) \
+				$(OCAMLFLAGS) $(INCFLAGS) $<; \
+			else \
+			    echo $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c -pp \"$$pp $(PPFLAGS)\" $(THREAD_FLAG) $(ANNOT_FLAG) \
+				$(OCAMLFLAGS) $(INCFLAGS) $<; \
+			    $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c -pp "$$pp $(PPFLAGS)" $(THREAD_FLAG) $(ANNOT_FLAG) \
+				$(OCAMLFLAGS) $(INCFLAGS) $<; \
+			fi
+
+.ml.cmi .ml.$(EXT_OBJ) .ml.cmx .ml.cmo: $(EXTRADEPS)
+			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+			if [ -z "$$pp" ]; then \
+			  echo $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c $(ALL_OCAMLCFLAGS) $<; \
+			  $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c $(ALL_OCAMLCFLAGS) $<; \
+			else \
+			  echo $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c -pp \"$$pp $(PPFLAGS)\" $(ALL_OCAMLCFLAGS) $<; \
+			  $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
+				-c -pp "$$pp $(PPFLAGS)" $(ALL_OCAMLCFLAGS) $<; \
+			fi
+
+ifdef PACK_LIB
+$(REAL_RESULT).cmo $(REAL_RESULT).cmx $(REAL_RESULT).o: $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
+			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack $(ALL_LDFLAGS) \
+				$(OBJS_LIBS) -o $@ $(REAL_IMPL)
+endif
+
+.PRECIOUS:		%.ml
+%.ml:			%.mll
+			$(OCAMLLEX) $<
+
+.PRECIOUS:              %.ml %.mli
+%.ml %.mli:             %.mly
+			$(OCAMLYACC) $(YFLAGS) $<
+			$(QUIET)pp=`sed -n -e 's/.*(\*pp \([^*]*\) \*).*/\1/p;q' $<`; \
+			if [ ! -z "$$pp" ]; then \
+			  mv $*.ml $*.ml.temporary; \
+			  echo "(*pp $$pp $(PPFLAGS)*)" > $*.ml; \
+			  cat $*.ml.temporary >> $*.ml; \
+			  rm $*.ml.temporary; \
+			  mv $*.mli $*.mli.temporary; \
+			  echo "(*pp $$pp $(PPFLAGS)*)" > $*.mli; \
+			  cat $*.mli.temporary >> $*.mli; \
+			  rm $*.mli.temporary; \
+			fi
+
+
+.PRECIOUS:		%.ml
+%.ml:			%.rep
+			$(CAMELEON_REPORT) $(CAMELEON_REPORT_FLAGS) -gen $<
+
+.PRECIOUS:		%.ml
+%.ml:			%.zog
+			$(CAMELEON_ZOGGY)  $(CAMELEON_ZOGGY_FLAGS) -impl $< > $@
+
+.PRECIOUS:		%.ml
+%.ml:			%.glade
+			$(OCAML_GLADECC)  $(OCAML_GLADECC_FLAGS) $< > $@
+
+.PRECIOUS:		%.ml %.mli
+%.ml %.mli:		%.oxridl
+			$(OXRIDL) $<
+
+.PRECIOUS:		%.ml %.mli %_stubs.c %.h
+%.ml %.mli %_stubs.c %.h:		%.idl
+			$(CAMLIDL) $(MAYBE_IDL_HEADER) $(IDLFLAGS) \
+				$(CAMLIDLFLAGS) $<
+			$(QUIET)if [ $(NOIDLHEADER) ]; then touch $*.h; fi
+
+.c.$(EXT_OBJ):
+			$(OCAMLC) -c -cc "$(CC)" -ccopt "$(CFLAGS) \
+				$(CPPFLAGS) $(CPPFLAGS_WIN32) \
+				$(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $< 
+
+.$(EXT_CXX).$(EXT_OBJ):
+			$(CXX) -c $(CXXFLAGS) $(CINCFLAGS) $(CPPFLAGS) \
+				-I'$(OCAMLLIBPATH)' \
+				$< $(CFLAG_O)$@
+
+$(MLDEPDIR)/%.d:	%.ml
+			$(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
+			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+			if [ -z "$$pp" ]; then \
+			  echo $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
+				$(DINCFLAGS) $< \> $@; \
+			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
+				$(DINCFLAGS) $< > $@; \
+			else \
+			  echo $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
+				-pp \"$$pp $(PPFLAGS)\" $(DINCFLAGS) $< \> $@; \
+			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
+				-pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
+			fi
+
+$(BCDIDIR)/%.di $(NCDIDIR)/%.di:	%.mli
+			$(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
+			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+			if [ -z "$$pp" ]; then \
+			  echo $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(DINCFLAGS) $< \> $@; \
+			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(DINCFLAGS) $< > $@; \
+			else \
+			  echo $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \
+			    -pp \"$$pp $(PPFLAGS)\" $(DINCFLAGS) $< \> $@; \
+			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \
+			    -pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
+			fi
+
+doc/$(RESULT)/html: $(DOC_FILES)
+	rm -rf $@
+	mkdir -p $@
+	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+	if [ -z "$$pp" ]; then \
+	  echo $(OCAMLDOC) -html -d $@ $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
+	  $(OCAMLDOC) -html -d $@ $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
+	else \
+	  echo $(OCAMLDOC) -pp \"$$pp $(PPFLAGS)\" -html -d $@ $(OCAMLDOCFLAGS) \
+	  	$(INCFLAGS) $(DOC_FILES); \
+	  $(OCAMLDOC) -pp "$$pp $(PPFLAGS)" -html -d $@ $(OCAMLDOCFLAGS) \
+	  	$(INCFLAGS) $(DOC_FILES); \
+	fi
+
+doc/$(RESULT)/latex: $(DOC_FILES)
+	rm -rf $@
+	mkdir -p $@
+	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
+	if [ -z "$$pp" ]; then \
+	  echo $(OCAMLDOC) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) \
+	  	$(DOC_FILES) -o $@/doc.tex; \
+	  $(OCAMLDOC) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES) \
+	  	-o $@/doc.tex; \
+	else \
+	  echo $(OCAMLDOC) -pp \"$$pp $(PPFLAGS)\" -latex $(OCAMLDOCFLAGS) \
+	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
+	  $(OCAMLDOC) -pp "$$pp $(PPFLAGS)" -latex $(OCAMLDOCFLAGS) \
+	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
+	fi
+
+doc/$(RESULT)/latex/doc.ps: doc/$(RESULT)/latex
+	cd doc/$(RESULT)/latex && \
+	  $(LATEX) doc.tex && \
+	  $(LATEX) doc.tex && \
+	  $(DVIPS) $(DVIPSFLAGS) doc.dvi -o $(@F)
+
+doc/$(RESULT)/latex/doc.pdf: doc/$(RESULT)/latex/doc.ps
+	cd doc/$(RESULT)/latex && $(PS2PDF) $(<F)
+
+define make_subproj
+.PHONY:
+subproj_$(1):
+	$$(eval $$(call PROJ_$(1)))
+	$(QUIET)if [ "$(SUBTARGET)" != "all" ]; then \
+	  $(MAKE) -f $(OCAMLMAKEFILE) $(SUBTARGET); \
+	fi
+endef
+
+$(foreach subproj,$(SUBPROJS),$(eval $(call make_subproj,$(subproj))))
+
+.PHONY:
+subprojs: $(SUBPROJS:%=subproj_%)
+
+###########################################################################
+# (UN)INSTALL RULES FOR LIBRARIES
+
+.PHONY: libinstall
+libinstall:	all
+	$(QUIET)printf "\nInstalling library with ocamlfind\n"
+	$(OCAMLFIND) install $(OCAMLFIND_INSTFLAGS) $(RESULT) META $(LIBINSTALL_FILES)
+	$(QUIET)printf "\nInstallation successful.\n"
+
+.PHONY: libuninstall
+libuninstall:
+	$(QUIET)printf "\nUninstalling library with ocamlfind\n"
+	$(OCAMLFIND) remove $(OCAMLFIND_INSTFLAGS) $(RESULT)
+	$(QUIET)printf "\nUninstallation successful.\n"
+
+.PHONY: rawinstall
+rawinstall:	all
+	$(QUIET)printf "\nInstalling library to: $(OCAML_LIB_INSTALL)\n"
+	-install -d $(OCAML_LIB_INSTALL)
+	for i in $(LIBINSTALL_FILES); do \
+	  if [ -f $$i ]; then \
+	    install -c -m 0644 $$i $(OCAML_LIB_INSTALL); \
+	  fi; \
+	done
+	$(QUIET)printf "\nInstallation successful.\n"
+
+.PHONY: rawuninstall
+rawuninstall:
+	$(QUIET)printf "\nUninstalling library from: $(OCAML_LIB_INSTALL)\n"
+	cd $(OCAML_LIB_INSTALL) && rm $(notdir $(LIBINSTALL_FILES))
+	$(QUIET)printf "\nUninstallation successful.\n"
+
+###########################################################################
+# MAINTAINANCE RULES
+
+.PHONY:	clean
+clean::
+	rm -f $(TARGETS) $(TRASH)
+	rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
+
+.PHONY:	cleanup
+cleanup::
+	rm -f $(NONEXECS) $(TRASH)
+	rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
+
+.PHONY: clean-doc
+clean-doc::
+	rm -rf doc
+
+.PHONY: nobackup
+nobackup:
+	rm -f *.bak *~ *.dup
+This is an OCaml library which reads and writes data in the JSON format
+(JavaScript Object Notation).
+This format can be used as a light-weight replacement for XML.
+Visit http://www.json.org for more information about JSON.
+
+The documentation for this library is located at
+  http://martin.jambon.free.fr/json-wheel/
+
+
+Installation
+============
+
+Requirements:
+- OCaml
+- GNU make
+- the findlib library manager (ocamlfind command)
+- the netstring library
+
+From the source directory, do:
+
+  make
+  make install
+
+If you want to remove the package do:
+
+  make uninstall
+
+
+Standard compliance
+===================
+
+The JSON parser, in the default mode, conforms to the specifications 
+of RFC 4627, with only some limitations due to the implementation 
+of the corresponding OCaml types:
+
+* ints that are too large to be represented with the OCaml int type
+  cause an error. The limit depends whether it is a 32-bit or 64-bit
+  platform (see min_int and max_int).
+
+* floats may be represented with reduced precision as they must fit
+  into the 8 bytes of the "double" format.
+
+* The size of OCaml strings is limited to about 16MB on 32-bit
+  platforms, and much more on 64-bit platforms (see Sys.max_string_length).
+
+
+RFC 4627: http://www.ietf.org/rfc/rfc4627.txt?number=4627
+
+
+The UTF-8 encoding is supported, however no attempt is made at
+checking whether strings are actually valid UTF-8 or not. Therefore, other
+ASCII-compatible encodings such as the ISO 8859 series are supported
+as well.
+
+
+Tests
+=====
+
+Json.org provides a test suite. You can download the file (test.zip),
+unzip it in the parent directory, and run "make test".
+Look for ERROR messages, which indicate that a file that should fail
+actually passes or that a file that should pass fails the test.
+
+../test/fail18.json doesn't pass: this is only because an int which is
+too large for the OCaml int type on a 32-bit platform.
+
+../test/fail18.json passes: it is marked as "should fail" because is
+has a high number of nesting. Although the standard allows such
+restrictions, there are not mandatory at all. Our parser does not have
+such a restriction.
+#!/bin/sh
+
+# Requires the suite test from http://www.json.org/JSON_checker/
+# The JSON files should be unzipped in the parent directory, resulting
+# in a test directory that contains pass*.json and fail*.json.
+
+dir=../test
+if ! test -x ./jsoncat; then 
+    echo "./jsoncat is missing!"; 
+    exit 1
+fi
+
+for file in $dir/fail*.json; do
+    if ./jsoncat $* $file > /dev/null ; then
+	echo "ERROR: $file shouldn't pass!"
+    else
+	echo "OK: $file doesn't pass, as expected."
+    fi
+done
+
+for file in $dir/pass*.json; do
+    if ./jsoncat $* $file > /dev/null ; then
+	echo "OK: $file passes."
+    else
+	echo "ERROR: $file should pass!"
+    fi
+done

File html/Json_compat.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="previous" href="Json_io.html">
+<link rel="Up" href="index.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_compat</title>
+</head>
+<body>
+<div class="navbar"><a href="Json_io.html">Previous</a>
+&nbsp;<a href="index.html">Up</a>
+&nbsp;</div>
+<center><h1>Module <a href="type_Json_compat.html">Json_compat</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Json_compat: <code class="code">sig</code> <a href="Json_compat.html">..</a> <code class="code">end</code></pre>Pseudo-compatibility with other JSON implementation.
+  Do not use this module in new programs.<br>
+<hr width="100%">
+<pre><span class="keyword">type</span> <a name="TYPEjsontype"></a><code class="type"></code>jsontype = <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a></code> </pre>
+
+<pre><span class="keyword">val</span> <a name="VALserialize"></a><a href="code_VALJson_compat.serialize.html">serialize</a> : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> string</code></pre><div class="info">
+<span class="warning">Deprecated.</span>Use <a href="Json_io.html#VALstring_of_json"><code class="code">Json_io.string_of_json</code></a> instead.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALdeserialize"></a><a href="code_VALJson_compat.deserialize.html">deserialize</a> : <code class="type">string -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<span class="warning">Deprecated.</span>Use <a href="Json_io.html#VALjson_of_string"><code class="code">Json_io.json_of_string</code></a> instead.<br>
+</div>
+</body></html>

File html/Json_io.Compact.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="next" href="Json_io.Fast.html">
+<link rel="Up" href="Json_io.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_io.Compact</title>
+</head>
+<body>
+<div class="navbar">&nbsp;<a href="Json_io.html">Up</a>
+&nbsp;<a href="Json_io.Fast.html">Next</a>
+</div>
+<center><h1>Module <a href="type_Json_io.Compact.html">Json_io.Compact</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Compact: <code class="code">sig</code> <a href="Json_io.Compact.html">..</a> <code class="code">end</code></pre>Conversion of JSON data to compact text.<br>
+<hr width="100%">
+<pre><span class="keyword">val</span> <a name="VALprint"></a>print : <code class="type">?allow_nan:bool -> ?recursive:bool -> Format.formatter -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> unit</code></pre><div class="info">
+Generic printing function without superfluous space. 
+    See the standard <code class="code">Format</code> module
+    for how to create and use formatters. 
+<p>
+
+    In general, <a href="Json_io.html#VALstring_of_json"><code class="code">Json_io.string_of_json</code></a> and 
+    <a href="Json_io.html#VALsave_json"><code class="code">Json_io.save_json</code></a> are more convenient.<br>
+</div>
+</body></html>

File html/Json_io.Fast.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="previous" href="Json_io.Compact.html">
+<link rel="next" href="Json_io.Pretty.html">
+<link rel="Up" href="Json_io.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_io.Fast</title>
+</head>
+<body>
+<div class="navbar"><a href="Json_io.Compact.html">Previous</a>
+&nbsp;<a href="Json_io.html">Up</a>
+&nbsp;<a href="Json_io.Pretty.html">Next</a>
+</div>
+<center><h1>Module <a href="type_Json_io.Fast.html">Json_io.Fast</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Fast: <code class="code">sig</code> <a href="Json_io.Fast.html">..</a> <code class="code">end</code></pre>Conversion of JSON data to compact text, optimized for speed.<br>
+<hr width="100%">
+<pre><span class="keyword">val</span> <a name="VALprint"></a>print : <code class="type">?allow_nan:bool -> ?recursive:bool -> Buffer.t -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> unit</code></pre><div class="info">
+This function is faster than the one provided by the
+    <a href="Json_io.Compact.html"><code class="code">Json_io.Compact</code></a> submodule but it is less generic and is subject to
+    the 16MB size limit of strings on 32-bit architectures.<br>
+</div>
+</body></html>

File html/Json_io.Pretty.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="previous" href="Json_io.Fast.html">
+<link rel="Up" href="Json_io.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_io.Pretty</title>
+</head>
+<body>
+<div class="navbar"><a href="Json_io.Fast.html">Previous</a>
+&nbsp;<a href="Json_io.html">Up</a>
+&nbsp;</div>
+<center><h1>Module <a href="type_Json_io.Pretty.html">Json_io.Pretty</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Pretty: <code class="code">sig</code> <a href="Json_io.Pretty.html">..</a> <code class="code">end</code></pre>Conversion of JSON data to indented text.<br>
+<hr width="100%">
+<pre><span class="keyword">val</span> <a name="VALprint"></a>print : <code class="type">?allow_nan:bool -> ?recursive:bool -> Format.formatter -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> unit</code></pre><div class="info">
+Generic pretty-printing function. 
+    See the standard <code class="code">Format</code> module
+    for how to create and use formatters.
+<p>
+
+    In general, <a href="Json_io.html#VALstring_of_json"><code class="code">Json_io.string_of_json</code></a> and 
+    <a href="Json_io.html#VALsave_json"><code class="code">Json_io.save_json</code></a> are more convenient.<br>
+</div>
+</body></html>

File html/Json_io.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="previous" href="Json_type.html">
+<link rel="next" href="Json_compat.html">
+<link rel="Up" href="index.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_io</title>
+</head>
+<body>
+<div class="navbar"><a href="Json_type.html">Previous</a>
+&nbsp;<a href="index.html">Up</a>
+&nbsp;<a href="Json_compat.html">Next</a>
+</div>
+<center><h1>Module <a href="type_Json_io.html">Json_io</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Json_io: <code class="code">sig</code> <a href="Json_io.html">..</a> <code class="code">end</code></pre>Input and output functions for the JSON format 
+  as defined by <a href="http://www.json.org/">http://www.json.org/</a><br>
+<hr width="100%">
+<pre><span class="keyword">val</span> <a name="VALjson_of_string"></a>json_of_string : <code class="type">?allow_comments:bool -><br>       ?allow_nan:bool -><br>       ?big_int_mode:bool -> ?recursive:bool -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<code class="code">json_of_string s</code> reads the given JSON string.
+<p>
+
+  If <code class="code">allow_comments</code> is <code class="code">true</code>, then C++ style comments are allowed, i.e.
+  <code class="code">/* blabla possibly on several lines */</code> or 
+  <code class="code">// blabla until the end of the line</code>. Comments are not part of the JSON
+  specification and are disabled by default.
+<p>
+
+  If <code class="code">allow_nan</code> is <code class="code">true</code>, then OCaml <code class="code">nan</code>, <code class="code">infinity</code> and <code class="code">neg_infinity</code> 
+  float values are represented using their Javascript counterparts
+  <code class="code">NaN</code>, <code class="code">Infinity</code> and <code class="code">-Infinity</code>.
+<p>
+
+  If <code class="code">big_int_mode</code> is <code class="code">true</code>, then JSON ints that cannot be represented
+  using OCaml's int type are represented by strings. 
+  This would happen only for ints that are out of the range defined
+  by <code class="code">min_int</code> and <code class="code">max_int</code>, i.e. [-1G, +1G[ on a 32-bit platform.
+  The default is <code class="code">false</code> and a <code class="code">Json_type.Json_error</code> exception
+  is raised if an int is too big.
+<p>
+
+  If <code class="code">recursive</code> is true, then all JSON values are accepted rather
+  than just arrays and objects as specified by the standard.
+  The default is <code class="code">false</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALload_json"></a>load_json : <code class="type">?allow_comments:bool -><br>       ?allow_nan:bool -><br>       ?big_int_mode:bool -> ?recursive:bool -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+Same as <code class="code">Json_io.json_of_string</code> but the argument is a file
+  to read from.<br>
+</div>
+<pre><span class="keyword">module</span> <a href="Json_io.Compact.html">Compact</a>: <code class="code">sig</code> <a href="Json_io.Compact.html">..</a> <code class="code">end</code></pre><div class="info">
+Conversion of JSON data to compact text.
+</div>
+<pre><span class="keyword">module</span> <a href="Json_io.Fast.html">Fast</a>: <code class="code">sig</code> <a href="Json_io.Fast.html">..</a> <code class="code">end</code></pre><div class="info">
+Conversion of JSON data to compact text, optimized for speed.
+</div>
+<pre><span class="keyword">module</span> <a href="Json_io.Pretty.html">Pretty</a>: <code class="code">sig</code> <a href="Json_io.Pretty.html">..</a> <code class="code">end</code></pre><div class="info">
+Conversion of JSON data to indented text.
+</div>
+<pre><span class="keyword">val</span> <a name="VALstring_of_json"></a>string_of_json : <code class="type">?allow_nan:bool -> ?compact:bool -> ?recursive:bool -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> string</code></pre><div class="info">
+<code class="code">string_of_json</code> converts JSON data to a string.
+<p>
+
+  By default, the output is indented. If the <code class="code">compact</code> flag is set to true,
+  the output will not contain superfluous whitespace and will
+  be produced faster.
+<p>
+
+  If <code class="code">allow_nan</code> is <code class="code">true</code>, then OCaml <code class="code">nan</code>, <code class="code">infinity</code> and <code class="code">neg_infinity</code> 
+  float values are represented using their Javascript counterparts
+  <code class="code">NaN</code>, <code class="code">Infinity</code> and <code class="code">-Infinity</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALsave_json"></a>save_json : <code class="type">?allow_nan:bool -><br>       ?compact:bool -> ?recursive:bool -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> unit</code></pre><div class="info">
+<code class="code">save_json</code> works like <a href="Json_io.html#VALstring_of_json"><code class="code">Json_io.string_of_json</code></a> but 
+  saves the results directly into the file specified by the
+  argument of type string.<br>
+</div>
+</body></html>

File html/Json_parser.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="Up" href="index.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_parser" rel="Chapter" href="Json_parser.html"><title>Json_parser</title>
+</head>
+<body>
+<div class="navbar">&nbsp;<a href="index.html">Up</a>
+&nbsp;</div>
+<center><h1>Module <a href="type_Json_parser.html">Json_parser</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Json_parser: <code class="code">sig</code> <a href="Json_parser.html">..</a> <code class="code">end</code></pre><hr width="100%">
+<br><code><span class="keyword">type</span> <a name="TYPEtoken"></a><code class="type"></code>token = </code><table class="typetable">
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">STRING</span> <span class="keyword">of</span> <code class="type">(Json_type.loc * string)</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">INT</span> <span class="keyword">of</span> <code class="type">(Json_type.loc * int)</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">FLOAT</span> <span class="keyword">of</span> <code class="type">(Json_type.loc * float)</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">BOOL</span> <span class="keyword">of</span> <code class="type">(Json_type.loc * bool)</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">OBJSTART</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">OBJEND</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">ARSTART</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">AREND</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">NULL</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">COMMA</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">COLON</span> <span class="keyword">of</span> <code class="type">Json_type.loc</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">EOF</span></code></td>
+
+</tr></table>
+
+
+<pre><span class="keyword">val</span> <a name="VALmain"></a>main : <code class="type">(Lexing.lexbuf -> <a href="Json_parser.html#TYPEtoken">token</a>) -> Lexing.lexbuf -> Json_type.t</code></pre></body></html>

File html/Json_type.Browse.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="next" href="Json_type.Build.html">
+<link rel="Up" href="Json_type.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_type.Browse</title>
+</head>
+<body>
+<div class="navbar">&nbsp;<a href="Json_type.html">Up</a>
+&nbsp;<a href="Json_type.Build.html">Next</a>
+</div>
+<center><h1>Module <a href="type_Json_type.Browse.html">Json_type.Browse</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Browse: <code class="code">sig</code> <a href="Json_type.Browse.html">..</a> <code class="code">end</code></pre>This submodule provides some simple functions for checking
+  and reading the structure of JSON data.
+<p>
+
+  Use <code class="code">open Json_type.Browse</code> when you want to convert JSON data
+  into another OCaml type.<br>
+<hr width="100%">
+<pre><span class="keyword">val</span> <a name="VALmake_table"></a>make_table : <code class="type">(string * <a href="Json_type.html#TYPEt">Json_type.t</a>) list -> (string, <a href="Json_type.html#TYPEt">Json_type.t</a>) Hashtbl.t</code></pre><div class="info">
+<code class="code">make_table</code> creates a hash table from the contents of a JSON <code class="code">Object</code>.
+  For example, if <code class="code">x</code> is a JSON <code class="code">Object</code>, then the corresponding table
+  can be created by <code class="code">let tbl = make_table (objekt x)</code>.
+<p>
+
+  Hash tables are more efficient than lists
+  if several fields must be extracted 
+  and converted into something like an OCaml record.
+<p>
+
+  The key/value pairs are added from left to right.
+  Therefore if there are several bindings for the same key, the latest
+  to appear in the list will be the first in the list
+  returned by <code class="code">Hashtbl.find_all</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALfield"></a>field : <code class="type">(string, <a href="Json_type.html#TYPEt">Json_type.t</a>) Hashtbl.t -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<code class="code">field tbl key</code> looks for a unique field <code class="code">key</code> in hash table <code class="code">tbl</code>.
+  It raises a <code class="code">Json_error</code> if <code class="code">key</code> is not found in the table
+  or if it is present multiple times.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALfieldx"></a>fieldx : <code class="type">(string, <a href="Json_type.html#TYPEt">Json_type.t</a>) Hashtbl.t -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<code class="code">fieldx tbl key</code> works like <code class="code">field tbl key</code>, but returns <code class="code">Null</code> if
+  <code class="code">key</code> is not found in the table. This function is convenient when
+  assuming that a field which is set to <code class="code">Null</code> is the same
+  as if it were not defined. 
+<p>
+
+  For instance, <code class="code">optional int (fieldx tbl "year")</code> looks in 
+  table <code class="code">tbl</code> for a field <code class="code">"year"</code>. If this field is set to <code class="code">Null</code>
+  or if it is undefined, then <code class="code">None</code> is returned, otherwise
+  an <code class="code">Int</code> is expected and returned, for example as <code class="code">Some 2006</code>.
+  If the value is of another JSON type than <code class="code">Int</code> or <code class="code">Null</code>, it causes an
+  error.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALoptfield"></a>optfield : <code class="type">(string, <a href="Json_type.html#TYPEt">Json_type.t</a>) Hashtbl.t -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a> option</code></pre><div class="info">
+<code class="code">optfield tbl key</code> queries hash table <code class="code">tbl</code> for zero or one field <code class="code">key</code>.
+  The result is returned as <code class="code">None</code> or <code class="code">Some result</code>. If there are several
+  fields with the same <code class="code">key</code>, then a <code class="code">Json_error</code> is produced.
+<p>
+
+  <code class="code">Null</code> is returned as <code class="code">Some Null</code>, not
+  as <code class="code">None</code>. For other behaviors see <a href="Json_type.Browse.html#VALfieldx"><code class="code">Json_type.Browse.fieldx</code></a>
+  and <a href="Json_type.Browse.html#VALoptfieldx"><code class="code">Json_type.Browse.optfieldx</code></a>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALoptfieldx"></a>optfieldx : <code class="type">(string, <a href="Json_type.html#TYPEt">Json_type.t</a>) Hashtbl.t -> string -> <a href="Json_type.html#TYPEt">Json_type.t</a> option</code></pre><div class="info">
+<code class="code">optfieldx</code> is the same as <code class="code">optfield</code> except that it
+  will never return <code class="code">Some Null</code>
+  but <code class="code">None</code> instead.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALdescribe"></a>describe : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> string</code></pre><div class="info">
+<code class="code">describe x</code> returns a short description of the given JSON data.
+  Its purpose is to help build error messages.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALtype_mismatch"></a>type_mismatch : <code class="type">string -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> 'a</code></pre><div class="info">
+<code class="code">type_mismatch expected x</code> raises the <code class="code">Json_error msg</code> exception,
+  where <code class="code">msg</code> is a message that describes the error as a type mismatch
+  between the element <code class="code">x</code> and what is <code class="code">expected</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALis_null"></a>is_null : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> bool</code></pre><div class="info">
+tells whether the given JSON element is null<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALis_defined"></a>is_defined : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> bool</code></pre><div class="info">
+tells whether the given JSON element is not null<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALnull"></a>null : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> unit</code></pre><div class="info">
+raises a <code class="code">Json_error</code> exception if the given JSON value is not <code class="code">Null</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALstring"></a>string : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> string</code></pre><div class="info">
+reads a JSON element as a string or raises a <code class="code">Json_error</code> exception.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALbool"></a>bool : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> bool</code></pre><div class="info">
+reads a JSON element as a bool or raises a <code class="code">Json_error</code> exception.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALnumber"></a>number : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> float</code></pre><div class="info">
+reads a JSON element as an int or a float and returns a float 
+  or raises a <code class="code">Json_error</code> exception.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALint"></a>int : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> int</code></pre><div class="info">
+reads a JSON element as an int or raises a <code class="code">Json_error</code> exception.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALfloat"></a>float : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> float</code></pre><div class="info">
+reads a JSON element as a float or raises a <code class="code">Json_error</code> exception.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALarray"></a>array : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> <a href="Json_type.html#TYPEt">Json_type.t</a> list</code></pre><div class="info">
+reads a JSON element as a JSON <code class="code">Array</code> and returns an OCaml list,
+  or raises a <code class="code">Json_error</code> exception.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALobjekt"></a>objekt : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> (string * <a href="Json_type.html#TYPEt">Json_type.t</a>) list</code></pre><div class="info">
+reads a JSON element as a JSON <code class="code">Object</code> and returns an OCaml list,
+  or raises a <code class="code">Json_error</code> exception.
+<p>
+
+  Note the unusual spelling. <code class="code">object</code> being
+  a keyword in OCaml, we use <code class="code">objekt</code>. <code class="code">Object</code> with a capital is still
+  spelled <code class="code">Object</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALlist"></a>list : <code class="type">(<a href="Json_type.html#TYPEt">Json_type.t</a> -> 'a) -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> 'a list</code></pre><div class="info">
+<code class="code">list f x</code> maps a JSON <code class="code">Array x</code> to an OCaml list, 
+  converting each element
+  of list <code class="code">x</code> using <code class="code">f</code>. A <code class="code">Json_error</code> exception is raised if 
+  the given element is not a JSON <code class="code">Array</code>. 
+<p>
+
+  For example, converting a JSON array that must contain only ints 
+  is performed using <code class="code">list int x</code>. Similarly, a list of lists of ints 
+  can be obtained using <code class="code">list (list int) x</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALoption"></a>option : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> -> <a href="Json_type.html#TYPEt">Json_type.t</a> option</code></pre><div class="info">
+<code class="code">option x</code> returns <code class="code">None</code> is <code class="code">x</code> is <code class="code">Null</code> and <code class="code">Some x</code> otherwise.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALoptional"></a>optional : <code class="type">(<a href="Json_type.html#TYPEt">Json_type.t</a> -> 'a) -> <a href="Json_type.html#TYPEt">Json_type.t</a> -> 'a option</code></pre><div class="info">
+<code class="code">optional f x</code> maps x using the given function <code class="code">f</code> and returns 
+  <code class="code">Some result</code>, unless <code class="code">x</code> is <code class="code">Null</code> in which case it returns <code class="code">None</code>.
+<p>
+
+  For example, <code class="code">optional int x</code> may return something like
+  <code class="code">Some 123</code> or <code class="code">None</code> or raise a <code class="code">Json_error</code> exception in case
+  <code class="code">x</code> is neither <code class="code">Null</code> nor an <code class="code">Int</code>.
+<p>
+
+  See also <a href="Json_type.Browse.html#VALfieldx"><code class="code">Json_type.Browse.fieldx</code></a>.<br>
+</div>
+</body></html>

File html/Json_type.Build.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="previous" href="Json_type.Browse.html">
+<link rel="Up" href="Json_type.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_type.Build</title>
+</head>
+<body>
+<div class="navbar"><a href="Json_type.Browse.html">Previous</a>
+&nbsp;<a href="Json_type.html">Up</a>
+&nbsp;</div>
+<center><h1>Module <a href="type_Json_type.Build.html">Json_type.Build</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Build: <code class="code">sig</code> <a href="Json_type.Build.html">..</a> <code class="code">end</code></pre>This submodule provides some simple functions for building
+  JSON data from other OCaml types.
+<p>
+
+  Use <code class="code">open Json_type.Build</code> when you want to convert JSON data
+  into another OCaml type.<br>
+<hr width="100%">
+<pre><span class="keyword">val</span> <a name="VALnull"></a>null : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+The <code class="code">Null</code> value<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALbool"></a>bool : <code class="type">bool -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+builds a JSON <code class="code">Bool</code><br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALint"></a>int : <code class="type">int -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+builds a JSON <code class="code">Int</code><br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALfloat"></a>float : <code class="type">float -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+builds a JSON <code class="code">Float</code><br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALstring"></a>string : <code class="type">string -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+builds a JSON <code class="code">String</code><br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALobjekt"></a>objekt : <code class="type">(string * <a href="Json_type.html#TYPEt">Json_type.t</a>) list -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+builds a JSON <code class="code">Object</code>.
+<p>
+
+	See <a href="Json_type.Browse.html#VALobjekt"><code class="code">Json_type.Browse.objekt</code></a> for an explanation about the unusual
+	spelling.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALarray"></a>array : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> list -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+builds a JSON <code class="code">Array</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALlist"></a>list : <code class="type">('a -> <a href="Json_type.html#TYPEt">Json_type.t</a>) -> 'a list -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<code class="code">list f l</code> maps OCaml list <code class="code">l</code> to a JSON list using 
+	function <code class="code">f</code> to convert the elements into JSON values.
+<p>
+
+      For example, <code class="code">list int [1; 2; 3]</code> is a shortcut for
+      <code class="code">Array [ Int 1; Int 2; Int 3 ]</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALoption"></a>option : <code class="type"><a href="Json_type.html#TYPEt">Json_type.t</a> option -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<code class="code">option x</code> returns <code class="code">Null</code> is <code class="code">x</code> is <code class="code">None</code>, or <code class="code">y</code> if 
+	<code class="code">x</code> is <code class="code">Some y</code>.<br>
+</div>
+<pre><span class="keyword">val</span> <a name="VALoptional"></a>optional : <code class="type">('a -> <a href="Json_type.html#TYPEt">Json_type.t</a>) -> 'a option -> <a href="Json_type.html#TYPEt">Json_type.t</a></code></pre><div class="info">
+<code class="code">optional f x</code> returns <code class="code">Null</code> if <code class="code">x</code> is <code class="code">None</code>, or <code class="code">f x</code>
+	otherwise.
+<p>
+
+      For example, <code class="code">list (optional int) [Some 1; Some 2; None]</code> returns
+      <code class="code">Array [ Int 1; Int 2; Null ]</code>.<br>
+</div>
+</body></html>

File html/Json_type.html

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<link rel="Start" href="index.html">
+<link rel="next" href="Json_io.html">
+<link rel="Up" href="index.html">
+<link title="Index of types" rel=Appendix href="index_types.html">
+<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
+<link title="Index of values" rel=Appendix href="index_values.html">
+<link title="Index of modules" rel=Appendix href="index_modules.html">
+<link title="Json_type" rel="Chapter" href="Json_type.html">
+<link title="Json_io" rel="Chapter" href="Json_io.html">
+<link title="Json_compat" rel="Chapter" href="Json_compat.html"><title>Json_type</title>
+</head>
+<body>
+<div class="navbar">&nbsp;<a href="index.html">Up</a>
+&nbsp;<a href="Json_io.html">Next</a>
+</div>
+<center><h1>Module <a href="type_Json_type.html">Json_type</a></h1></center>
+<br>
+<pre><span class="keyword">module</span> Json_type: <code class="code">sig</code> <a href="Json_type.html">..</a> <code class="code">end</code></pre>OCaml representation of JSON data<br>
+<hr width="100%">
+<br><code><span class="keyword">type</span> <a name="TYPEjson_type"></a><code class="type"></code>json_type = </code><table class="typetable">
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">Object</span> <span class="keyword">of</span> <code class="type">(string * <a href="Json_type.html#TYPEjson_type">json_type</a>) list</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">Array</span> <span class="keyword">of</span> <code class="type"><a href="Json_type.html#TYPEjson_type">json_type</a> list</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">String</span> <span class="keyword">of</span> <code class="type">string</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">Int</span> <span class="keyword">of</span> <code class="type">int</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >
+<code><span class="keyword">|</span></code></td>
+<td align="left" valign="top" >
+<code><span class="constructor">Float</span> <span class="keyword">of</span> <code class="type">float</code></code></td>
+
+</tr>
+<tr>
+<td align="left" valign="top" >