Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added more files

  • Loading branch information...
commit bf8d811627bfa032fded4b2a351f8649090e980a 1 parent d316233
Fabrice Le Fessant authored

Showing 39 changed files with 7,601 additions and 54 deletions. Show diff stats Hide diff stats

  1. +2 0  .gitignore
  2. +21 8 Makefile
  3. +0 2  Makefile.config
  4. +6 0 Makefile.config.in
  5. +31 0 Readme.txt
  6. +4,806 0 configure
  7. +45 0 configure.ac
  8. +3 0  docs/user-manual/Makefile
  9. +59 0 docs/user-manual/user-manual.tex
  10. +177 0 m4/ax_compare_version.m4
  11. +240 0 m4/ocaml.m4
  12. +8 0 tools/ocp-build/buildOCP.ml
  13. +3 0  tools/ocp-build/buildOCP.mli
  14. +307 0 tools/ocp-bytecode/byteActions.ml
  15. +38 0 tools/ocp-bytecode/byteArgs.ml
  16. +916 0 tools/ocp-bytecode/byteCode.ml
  17. +217 0 tools/ocp-bytecode/byteCode.mli
  18. +314 0 tools/ocp-bytecode/byteFile.ml
  19. +51 0 tools/ocp-bytecode/byteFile.mli
  20. +132 0 tools/ocp-bytecode/byteMain.ml
  21. +67 0 tools/ocp-bytecode/byteMisc.ml
  22. +22 0 tools/ocp-bytecode/ocp-bytecode.ocp
  23. +41 0 tools/ocp-bytecode/strings.ml
  24. +12 0 tools/ocp-bytecode/strings.mli
  25. +2 0  tools/ocp-complete/ocp-complete.ocp
  26. +1 2  tools/ocp-edit-mode/Makefile
  27. +2 2 tools/{ocp-complete/compCandidates.ml → ocp-edit-mode/editCandidates.ml}
  28. 0  tools/{ocp-complete/compCandidates.mli → ocp-edit-mode/editCandidates.mli}
  29. +2 0  tools/ocp-edit-mode/editConfiguration.mlp
  30. +3 3 tools/{ocp-complete/compDocumentation.ml → ocp-edit-mode/editDocumentation.ml}
  31. 0  tools/{ocp-complete/compDocumentation.mli → ocp-edit-mode/editDocumentation.mli}
  32. +12 12 tools/ocp-edit-mode/editEmacs.ml
  33. +2 0  tools/ocp-edit-mode/editMain.ml
  34. +1 1  tools/ocp-edit-mode/editOptions.ml
  35. +18 9 tools/ocp-edit-mode/ocp-edit-mode.ocp
  36. +2 0  tools/ocp-spotter/Readme.txt
  37. +11 0 tools/ocp-spotter/ocp-spotter.ocp
  38. +12 0 tools/ocp-spotter/spotfile.ml
  39. +15 15 typerex.config → typerex.config.in
2  .gitignore
@@ -81,3 +81,5 @@ ocp-subst-config.exe
81 81 ocp-build/ocp-build
82 82 ocp-build/ocp-build.run
83 83 ocp-build/primitives.ml
  84 +Makefile.config
  85 +typerex.config
29 Makefile
@@ -4,6 +4,8 @@
4 4
5 5 include Makefile.config
6 6
  7 +
  8 +
7 9 OCPBUILD=./ocp-build/ocp-build
8 10 OCPBUILD_FLAGS=
9 11
@@ -49,14 +51,17 @@ distclean: clean $(OCPBUILD)
49 51
50 52
51 53 install:
52   - cp _obuild/ocp-build/ocp-build.asm $(INSTALL_PREFIX)/bin/ocp-build
53   - cp _obuild/ocp-fix-errors/ocp-fix-errors.asm $(INSTALL_PREFIX)/bin/ocp-fix-errors
54   - cp _obuild/ocp-edit-mode/ocp-edit-mode.asm $(INSTALL_PREFIX)/bin/ocp-edit-mode
55   - cp _obuild/ocp-complete/ocp-complete.asm $(INSTALL_PREFIX)/bin/ocp-complete
56   - cp _obuild/ocp-spotter/ocp-spotter.asm $(INSTALL_PREFIX)/bin/ocp-spotter
57   -
58   -install-emacs:
59   - cp tools/ocp-fix-errors/emacs/ocp-fix-errors.el $(HOME)/.emacs.d/
  54 + mkdir -p $(TYPEREXDIR)
  55 + mkdir -p $(BINDIR)
  56 + cp _obuild/ocp-build/ocp-build.asm $(BINDIR)/ocp-build
  57 + cp _obuild/ocp-fix-errors/ocp-fix-errors.asm $(BINDIR)/ocp-fix-errors
  58 + cp _obuild/ocp-edit-mode/ocp-edit-mode.asm $(BINDIR)/ocp-edit-mode
  59 + cp _obuild/ocp-spotter/ocp-spotter.asm $(BINDIR)/ocp-spotter
  60 + rm -rf $(TYPEREXDIR)/ocp-edit-mode
  61 + cp -dpR tools/ocp-edit-mode/files $(TYPEREXDIR)/ocp-edit-mode
  62 +
  63 +#install-emacs:
  64 +# cp tools/ocp-fix-errors/emacs/ocp-fix-errors.el $(HOME)/.emacs.d/
60 65
61 66 install-manager:
62 67 sudo cp _obuild/ocaml-manager/ocaml-manager.asm /usr/bin/ocaml-manager
@@ -126,3 +131,11 @@ fabrice-upload:
126 131 git push origin fabrice-typerex
127 132 git push ocamlpro fabrice-typerex
128 133
  134 +doc:
  135 + cd docs/user-manual; $(MAKE)
  136 +
  137 +
  138 +
  139 +configure: configure.ac m4/*.m4
  140 + aclocal -I m4
  141 + autoconf
2  Makefile.config
... ... @@ -1,2 +0,0 @@
1   -INSTALL_PREFIX=/usr/local
2   -
6 Makefile.config.in
... ... @@ -0,0 +1,6 @@
  1 +
  2 +DATADIR=@datarootdir@
  3 +BINDIR=@bindir@
  4 +LIBDIR=@libdir@
  5 +MANDIR=@mandir@
  6 +TYPEREXDIR=@datarootdir@/typerex
31 Readme.txt
... ... @@ -0,0 +1,31 @@
  1 +
  2 +To build:
  3 +---------
  4 +
  5 +1/ Install the sources of OCaml 4.00 as subdirectory ocaml/ocaml/
  6 +
  7 + cd ocaml
  8 + tar zxf ~/Downloads/ocaml-4.00.0.tar.gz
  9 + mv ocaml-4.00.0 ocaml
  10 + cd ..
  11 +
  12 +2/ configure
  13 +
  14 + ./configure -prefix /usr/local
  15 +
  16 +3/ Build with ocp-build. You will need to create an ocp-build.conf file in
  17 + the top directory.
  18 +
  19 + make
  20 +
  21 +4/ Install
  22 +
  23 + make install
  24 +
  25 +5/ Build and read the documentation
  26 +
  27 + make doc
  28 + cd docs/user-manual
  29 + evince user-manual.pdf
  30 +
  31 +
4,806 configure
4,806 additions, 0 deletions not shown
45 configure.ac
... ... @@ -0,0 +1,45 @@
  1 +AC_INIT(typerex,0.1)
  2 +AC_COPYRIGHT(Copyright 2012 OcamlPro SAS)
  3 +
  4 +AC_CONFIG_MACRO_DIR([m4])
  5 +AC_PROG_CC
  6 +
  7 +AC_PROG_OCAML
  8 +if test "$OCAMLC" = "no"; then
  9 + AC_MSG_ERROR([You must install the OCaml compiler])
  10 +fi
  11 +
  12 +AC_ARG_ENABLE(version-check,
  13 + [ --disable-version-check do not check OCaml version],
  14 + [VERSION_CHECK="$enableval"],
  15 + [VERSION_CHECK="yes"])
  16 +
  17 +# Check that OCaml version is greater or equal to 3.12.1
  18 +if test "$VERSION_CHECK" = "yes" ; then
  19 + AX_COMPARE_VERSION( [$OCAMLVERSION], [lt], [3.12.1],
  20 + AC_MSG_ERROR([Your version of OCaml: $OCAMLVERSION is not supported]))
  21 +fi
  22 +
  23 +test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
  24 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  25 +
  26 +bindir="`eval echo ${bindir}`"
  27 +bindir="`eval echo ${bindir}`"
  28 +mandir="`eval echo ${mandir}`"
  29 +mandir="`eval echo ${mandir}`"
  30 +libdir="`eval echo ${libdir}`"
  31 +libdir="`eval echo ${libdir}`"
  32 +datarootdir="`eval echo ${datarootdir}`"
  33 +datarootdir="`eval echo ${datarootdir}`"
  34 +
  35 +AC_CONFIG_FILES(
  36 + Makefile.config
  37 + typerex.config
  38 +)
  39 +AC_OUTPUT
  40 +
  41 +echo
  42 +echo Executables will be installed in ${bindir}
  43 +echo Libraries will be installed in ${libdir} + typerex
  44 +echo Data files will be installed in ${datarootdir} + typerex
  45 +echo Manual pages will be installed in ${mandir}
3  docs/user-manual/Makefile
... ... @@ -0,0 +1,3 @@
  1 +pdf:
  2 + pdflatex user-manual
  3 + pdflatex user-manual
59 docs/user-manual/user-manual.tex
... ... @@ -0,0 +1,59 @@
  1 +\documentclass[12pt]{book}
  2 +
  3 +\usepackage{enumerate}
  4 +\usepackage{color}
  5 +\usepackage{a4wide}
  6 +\usepackage[colorlinks=true,linkcolor=blue] {hyperref}
  7 +\usepackage{hevea}
  8 +\usepackage{url}
  9 +
  10 +\title{TypeRex user manual}
  11 +
  12 +\author{OCamlPro}
  13 +\date{\today\\
  14 +\begin{latexonly}%
  15 +\vspace{3cm}
  16 +\end{latexonly}%
  17 +This manual presents the usage of \typerex, a development
  18 +environment and toolbox for OCaml developped by OCamlPro and Inria%
  19 +\footnote{with support from the Campus Paris Saclay fundation}.
  20 +}
  21 +\begin{document}
  22 +
  23 +\input{typerex-config.tex}
  24 +\newcommand{\typerex}{TypeRex}
  25 +\newcommand{\cmd}[1]{$\texttt{#1}$}
  26 +\begin{htmlonly}
  27 +\renewcommand{\paragraph}[1]{{\bf #1}}
  28 +\end{htmlonly}
  29 +
  30 +%\newenvironment{code}{\footnotesize\verbatim}{\endverbatim}
  31 +%\newenvironment{code}{\small\begin{verbatim}}{\end{verbatim}}
  32 +\newcommand{\verbsize}{%BEGIN LATEX
  33 +\footnotesize%
  34 +%END LATEX
  35 +%HEVEA\color{blue}
  36 +}
  37 +
  38 +%BEGIN LATEX
  39 +\maketitle
  40 +\thispagestyle{empty}
  41 +\cleardoublepage
  42 +%\thispagestyle{plain}
  43 +\input{introduction}
  44 +\newpage
  45 +\thispagestyle{empty}
  46 +\tableofcontents
  47 +%END LATEX
  48 +
  49 +%HEVEA\input{introduction}
  50 +
  51 +\chapter{TypeRex}
  52 +
  53 +\input{../../tools/ocp-edit-mode/docs/user-manual}
  54 +
  55 +\chapter{ocp-build}
  56 +
  57 +\input{../../tools/ocp-build/docs/user-manual}
  58 +
  59 +\end{document}
177 m4/ax_compare_version.m4
... ... @@ -0,0 +1,177 @@
  1 +# ===========================================================================
  2 +# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
  3 +# ===========================================================================
  4 +#
  5 +# SYNOPSIS
  6 +#
  7 +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  8 +#
  9 +# DESCRIPTION
  10 +#
  11 +# This macro compares two version strings. Due to the various number of
  12 +# minor-version numbers that can exist, and the fact that string
  13 +# comparisons are not compatible with numeric comparisons, this is not
  14 +# necessarily trivial to do in a autoconf script. This macro makes doing
  15 +# these comparisons easy.
  16 +#
  17 +# The six basic comparisons are available, as well as checking equality
  18 +# limited to a certain number of minor-version levels.
  19 +#
  20 +# The operator OP determines what type of comparison to do, and can be one
  21 +# of:
  22 +#
  23 +# eq - equal (test A == B)
  24 +# ne - not equal (test A != B)
  25 +# le - less than or equal (test A <= B)
  26 +# ge - greater than or equal (test A >= B)
  27 +# lt - less than (test A < B)
  28 +# gt - greater than (test A > B)
  29 +#
  30 +# Additionally, the eq and ne operator can have a number after it to limit
  31 +# the test to that number of minor versions.
  32 +#
  33 +# eq0 - equal up to the length of the shorter version
  34 +# ne0 - not equal up to the length of the shorter version
  35 +# eqN - equal up to N sub-version levels
  36 +# neN - not equal up to N sub-version levels
  37 +#
  38 +# When the condition is true, shell commands ACTION-IF-TRUE are run,
  39 +# otherwise shell commands ACTION-IF-FALSE are run. The environment
  40 +# variable 'ax_compare_version' is always set to either 'true' or 'false'
  41 +# as well.
  42 +#
  43 +# Examples:
  44 +#
  45 +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
  46 +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
  47 +#
  48 +# would both be true.
  49 +#
  50 +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
  51 +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
  52 +#
  53 +# would both be false.
  54 +#
  55 +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
  56 +#
  57 +# would be true because it is only comparing two minor versions.
  58 +#
  59 +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
  60 +#
  61 +# would be true because it is only comparing the lesser number of minor
  62 +# versions of the two values.
  63 +#
  64 +# Note: The characters that separate the version numbers do not matter. An
  65 +# empty string is the same as version 0. OP is evaluated by autoconf, not
  66 +# configure, so must be a string, not a variable.
  67 +#
  68 +# The author would like to acknowledge Guido Draheim whose advice about
  69 +# the m4_case and m4_ifvaln functions make this macro only include the
  70 +# portions necessary to perform the specific comparison specified by the
  71 +# OP argument in the final configure script.
  72 +#
  73 +# LICENSE
  74 +#
  75 +# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
  76 +#
  77 +# Copying and distribution of this file, with or without modification, are
  78 +# permitted in any medium without royalty provided the copyright notice
  79 +# and this notice are preserved. This file is offered as-is, without any
  80 +# warranty.
  81 +
  82 +#serial 11
  83 +
  84 +dnl #########################################################################
  85 +AC_DEFUN([AX_COMPARE_VERSION], [
  86 + AC_REQUIRE([AC_PROG_AWK])
  87 +
  88 + # Used to indicate true or false condition
  89 + ax_compare_version=false
  90 +
  91 + # Convert the two version strings to be compared into a format that
  92 + # allows a simple string comparison. The end result is that a version
  93 + # string of the form 1.12.5-r617 will be converted to the form
  94 + # 0001001200050617. In other words, each number is zero padded to four
  95 + # digits, and non digits are removed.
  96 + AS_VAR_PUSHDEF([A],[ax_compare_version_A])
  97 + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
  98 + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
  99 + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  100 + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  101 + -e 's/[[^0-9]]//g'`
  102 +
  103 + AS_VAR_PUSHDEF([B],[ax_compare_version_B])
  104 + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
  105 + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
  106 + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  107 + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  108 + -e 's/[[^0-9]]//g'`
  109 +
  110 + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
  111 + dnl # then the first line is used to determine if the condition is true.
  112 + dnl # The sed right after the echo is to remove any indented white space.
  113 + m4_case(m4_tolower($2),
  114 + [lt],[
  115 + ax_compare_version=`echo "x$A
  116 +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
  117 + ],
  118 + [gt],[
  119 + ax_compare_version=`echo "x$A
  120 +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
  121 + ],
  122 + [le],[
  123 + ax_compare_version=`echo "x$A
  124 +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
  125 + ],
  126 + [ge],[
  127 + ax_compare_version=`echo "x$A
  128 +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
  129 + ],[
  130 + dnl Split the operator from the subversion count if present.
  131 + m4_bmatch(m4_substr($2,2),
  132 + [0],[
  133 + # A count of zero means use the length of the shorter version.
  134 + # Determine the number of characters in A and B.
  135 + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
  136 + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
  137 +
  138 + # Set A to no more than B's length and B to no more than A's length.
  139 + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
  140 + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
  141 + ],
  142 + [[0-9]+],[
  143 + # A count greater than zero means use only that many subversions
  144 + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
  145 + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
  146 + ],
  147 + [.+],[
  148 + AC_WARNING(
  149 + [illegal OP numeric parameter: $2])
  150 + ],[])
  151 +
  152 + # Pad zeros at end of numbers to make same length.
  153 + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
  154 + B="$B`echo $A | sed 's/./0/g'`"
  155 + A="$ax_compare_version_tmp_A"
  156 +
  157 + # Check for equality or inequality as necessary.
  158 + m4_case(m4_tolower(m4_substr($2,0,2)),
  159 + [eq],[
  160 + test "x$A" = "x$B" && ax_compare_version=true
  161 + ],
  162 + [ne],[
  163 + test "x$A" != "x$B" && ax_compare_version=true
  164 + ],[
  165 + AC_WARNING([illegal OP parameter: $2])
  166 + ])
  167 + ])
  168 +
  169 + AS_VAR_POPDEF([A])dnl
  170 + AS_VAR_POPDEF([B])dnl
  171 +
  172 + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
  173 + if test "$ax_compare_version" = "true" ; then
  174 + m4_ifvaln([$4],[$4],[:])dnl
  175 + m4_ifvaln([$5],[else $5])dnl
  176 + fi
  177 +]) dnl AX_COMPARE_VERSION
240 m4/ocaml.m4
... ... @@ -0,0 +1,240 @@
  1 +dnl autoconf macros for OCaml
  2 +dnl
  3 +dnl Copyright © 2009 Richard W.M. Jones
  4 +dnl Copyright © 2009 Stefano Zacchiroli
  5 +dnl Copyright © 2000-2005 Olivier Andrieu
  6 +dnl Copyright © 2000-2005 Jean-Christophe Filliâtre
  7 +dnl Copyright © 2000-2005 Georges Mariano
  8 +dnl
  9 +dnl For documentation, please read the ocaml.m4 man page.
  10 +
  11 +AC_DEFUN([AC_PROG_OCAML],
  12 +[dnl
  13 + # checking for ocamlc
  14 + AC_CHECK_TOOL([OCAMLC],[ocamlc],[no])
  15 +
  16 + if test "$OCAMLC" != "no"; then
  17 + OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
  18 + AC_MSG_RESULT([OCaml version is $OCAMLVERSION])
  19 + # If OCAMLLIB is set, use it
  20 + if test "$OCAMLLIB" = ""; then
  21 + OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
  22 + else
  23 + AC_MSG_RESULT([OCAMLLIB previously set; preserving it.])
  24 + fi
  25 + AC_MSG_RESULT([OCaml library path is $OCAMLLIB])
  26 +
  27 + AC_SUBST([OCAMLVERSION])
  28 + AC_SUBST([OCAMLLIB])
  29 +
  30 + # checking for ocamlopt
  31 + AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no])
  32 + OCAMLBEST=byte
  33 + if test "$OCAMLOPT" = "no"; then
  34 + AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
  35 + else
  36 + TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
  37 + if test "$TMPVERSION" != "$OCAMLVERSION" ; then
  38 + AC_MSG_RESULT([versions differs from ocamlc; ocamlopt discarded.])
  39 + OCAMLOPT=no
  40 + else
  41 + OCAMLBEST=opt
  42 + fi
  43 + fi
  44 +
  45 + AC_SUBST([OCAMLBEST])
  46 +
  47 + # checking for ocamlc.opt
  48 + AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
  49 + if test "$OCAMLCDOTOPT" != "no"; then
  50 + TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
  51 + if test "$TMPVERSION" != "$OCAMLVERSION" ; then
  52 + AC_MSG_RESULT([versions differs from ocamlc; ocamlc.opt discarded.])
  53 + else
  54 + OCAMLC=$OCAMLCDOTOPT
  55 + fi
  56 + fi
  57 +
  58 + # checking for ocamlopt.opt
  59 + if test "$OCAMLOPT" != "no" ; then
  60 + AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
  61 + if test "$OCAMLOPTDOTOPT" != "no"; then
  62 + TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
  63 + if test "$TMPVERSION" != "$OCAMLVERSION" ; then
  64 + AC_MSG_RESULT([version differs from ocamlc; ocamlopt.opt discarded.])
  65 + else
  66 + OCAMLOPT=$OCAMLOPTDOTOPT
  67 + fi
  68 + fi
  69 + fi
  70 +
  71 + AC_SUBST([OCAMLOPT])
  72 + fi
  73 +
  74 + AC_SUBST([OCAMLC])
  75 +
  76 + # checking for ocaml toplevel
  77 + AC_CHECK_TOOL([OCAML],[ocaml],[no])
  78 +
  79 + # checking for ocamldep
  80 + AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no])
  81 +
  82 + # checking for ocamlmktop
  83 + AC_CHECK_TOOL([OCAMLMKTOP],[ocamlmktop],[no])
  84 +
  85 + # checking for ocamlmklib
  86 + AC_CHECK_TOOL([OCAMLMKLIB],[ocamlmklib],[no])
  87 +
  88 + # checking for ocamldoc
  89 + AC_CHECK_TOOL([OCAMLDOC],[ocamldoc],[no])
  90 +
  91 + # checking for ocamlbuild
  92 + AC_CHECK_TOOL([OCAMLBUILD],[ocamlbuild],[no])
  93 +])
  94 +
  95 +
  96 +AC_DEFUN([AC_PROG_OCAMLLEX],
  97 +[dnl
  98 + # checking for ocamllex
  99 + AC_CHECK_TOOL([OCAMLLEX],[ocamllex],[no])
  100 + if test "$OCAMLLEX" != "no"; then
  101 + AC_CHECK_TOOL([OCAMLLEXDOTOPT],[ocamllex.opt],[no])
  102 + if test "$OCAMLLEXDOTOPT" != "no"; then
  103 + OCAMLLEX=$OCAMLLEXDOTOPT
  104 + fi
  105 + fi
  106 + AC_SUBST([OCAMLLEX])
  107 +])
  108 +
  109 +AC_DEFUN([AC_PROG_OCAMLYACC],
  110 +[dnl
  111 + AC_CHECK_TOOL([OCAMLYACC],[ocamlyacc],[no])
  112 + AC_SUBST([OCAMLYACC])
  113 +])
  114 +
  115 +
  116 +AC_DEFUN([AC_PROG_CAMLP4],
  117 +[dnl
  118 + AC_REQUIRE([AC_PROG_OCAML])dnl
  119 +
  120 + # checking for camlp4
  121 + AC_CHECK_TOOL([CAMLP4],[camlp4],[no])
  122 + if test "$CAMLP4" != "no"; then
  123 + TMPVERSION=`$CAMLP4 -v 2>&1| sed -n -e 's|.*version *\(.*\)$|\1|p'`
  124 + if test "$TMPVERSION" != "$OCAMLVERSION" ; then
  125 + AC_MSG_RESULT([versions differs from ocamlc])
  126 + CAMLP4=no
  127 + fi
  128 + fi
  129 + AC_SUBST([CAMLP4])
  130 +
  131 + # checking for companion tools
  132 + AC_CHECK_TOOL([CAMLP4BOOT],[camlp4boot],[no])
  133 + AC_CHECK_TOOL([CAMLP4O],[camlp4o],[no])
  134 + AC_CHECK_TOOL([CAMLP4OF],[camlp4of],[no])
  135 + AC_CHECK_TOOL([CAMLP4OOF],[camlp4oof],[no])
  136 + AC_CHECK_TOOL([CAMLP4ORF],[camlp4orf],[no])
  137 + AC_CHECK_TOOL([CAMLP4PROF],[camlp4prof],[no])
  138 + AC_CHECK_TOOL([CAMLP4R],[camlp4r],[no])
  139 + AC_CHECK_TOOL([CAMLP4RF],[camlp4rf],[no])
  140 + AC_SUBST([CAMLP4BOOT])
  141 + AC_SUBST([CAMLP4O])
  142 + AC_SUBST([CAMLP4OF])
  143 + AC_SUBST([CAMLP4OOF])
  144 + AC_SUBST([CAMLP4ORF])
  145 + AC_SUBST([CAMLP4PROF])
  146 + AC_SUBST([CAMLP4R])
  147 + AC_SUBST([CAMLP4RF])
  148 +])
  149 +
  150 +
  151 +AC_DEFUN([AC_PROG_FINDLIB],
  152 +[dnl
  153 + AC_REQUIRE([AC_PROG_OCAML])dnl
  154 +
  155 + # checking for ocamlfind
  156 + AC_CHECK_TOOL([OCAMLFIND],[ocamlfind],[no])
  157 + AC_SUBST([OCAMLFIND])
  158 +])
  159 +
  160 +
  161 +dnl Thanks to Jim Meyering for working this next bit out for us.
  162 +dnl XXX We should define AS_TR_SH if it's not defined already
  163 +dnl (eg. for old autoconf).
  164 +AC_DEFUN([AC_CHECK_OCAML_PKG],
  165 +[dnl
  166 + AC_REQUIRE([AC_PROG_FINDLIB])dnl
  167 +
  168 + AC_MSG_CHECKING([for OCaml findlib package $1])
  169 +
  170 + unset found
  171 + unset pkg
  172 + found=no
  173 + for pkg in $1 $2 ; do
  174 + if $OCAMLFIND query $pkg >/dev/null 2>/dev/null; then
  175 + AC_MSG_RESULT([found])
  176 + AS_TR_SH([OCAML_PKG_$1])=$pkg
  177 + found=yes
  178 + break
  179 + fi
  180 + done
  181 + if test "$found" = "no" ; then
  182 + AC_MSG_RESULT([not found])
  183 + AS_TR_SH([OCAML_PKG_$1])=no
  184 + fi
  185 +
  186 + AC_SUBST(AS_TR_SH([OCAML_PKG_$1]))
  187 +])
  188 +
  189 +
  190 +AC_DEFUN([AC_CHECK_OCAML_MODULE],
  191 +[dnl
  192 + AC_MSG_CHECKING([for OCaml module $2])
  193 +
  194 + cat > conftest.ml <<EOF
  195 +open $3
  196 +EOF
  197 + unset found
  198 + for $1 in $$1 $4 ; do
  199 + if $OCAMLC -c -I "$$1" conftest.ml >&5 2>&5 ; then
  200 + found=yes
  201 + break
  202 + fi
  203 + done
  204 +
  205 + if test "$found" ; then
  206 + AC_MSG_RESULT([$$1])
  207 + else
  208 + AC_MSG_RESULT([not found])
  209 + $1=no
  210 + fi
  211 + AC_SUBST([$1])
  212 +])
  213 +
  214 +
  215 +dnl XXX Cross-compiling
  216 +AC_DEFUN([AC_CHECK_OCAML_WORD_SIZE],
  217 +[dnl
  218 + AC_REQUIRE([AC_PROG_OCAML])dnl
  219 + AC_MSG_CHECKING([for OCaml compiler word size])
  220 + cat > conftest.ml <<EOF
  221 + print_endline (string_of_int Sys.word_size)
  222 + EOF
  223 + OCAML_WORD_SIZE=`$OCAML conftest.ml`
  224 + AC_MSG_RESULT([$OCAML_WORD_SIZE])
  225 + AC_SUBST([OCAML_WORD_SIZE])
  226 +])
  227 +
  228 +AC_DEFUN([AC_CHECK_OCAML_OS_TYPE],
  229 +[dnl
  230 + AC_REQUIRE([AC_PROG_OCAML])dnl
  231 + AC_MSG_CHECKING([OCaml Sys.os_type])
  232 +
  233 + cat > conftest.ml <<EOF
  234 + print_string(Sys.os_type);;
  235 +EOF
  236 +
  237 + OCAML_OS_TYPE=`$OCAML conftest.ml`
  238 + AC_MSG_RESULT([$OCAML_OS_TYPE])
  239 + AC_SUBST([OCAML_OS_TYPE])
  240 +])
8 tools/ocp-build/buildOCP.ml
@@ -444,3 +444,11 @@ let find_package pj file =
444 444 ) pj.project_sorted;
445 445
446 446 !list
  447 +
  448 +let rec find_obuild f dir =
  449 + let possible_dir = Filename.concat dir "_obuild" in
  450 + if Sys.file_exists possible_dir then
  451 + f possible_dir
  452 + else
  453 + let new_dir = Filename.dirname dir in
  454 + if dir <> new_dir then find_obuild f new_dir
3  tools/ocp-build/buildOCP.mli
@@ -30,3 +30,6 @@ val find_package : project -> File.t -> package list
30 30
31 31 val save_project_state : project -> File.t -> unit
32 32 val load_project_state : File.t -> project
  33 +
  34 +val find_obuild : (string -> unit) -> string -> unit
  35 +
307 tools/ocp-bytecode/byteActions.ml
... ... @@ -0,0 +1,307 @@
  1 +
  2 +(* "Expunge" a toplevel by removing compiler modules from the global List.map.
  3 + Usage: expunge <source file> <dest file> <names of modules to keep> *)
  4 +
  5 +open Sys
  6 +open Misc
  7 +open ByteArgs
  8 +open ByteMisc
  9 +
  10 +module StringSet =
  11 + Set.Make(struct
  12 + type t = string
  13 + let compare = compare
  14 + end)
  15 +
  16 +let flush_action () =
  17 + match !current_action with
  18 + None -> ()
  19 + | Some (set, action) ->
  20 + current_action := None;
  21 + action !set
  22 +
  23 +let set_action action =
  24 + flush_action ();
  25 + current_action := Some (ref [], action)
  26 +
  27 +let get_file () =
  28 + match !current_file with
  29 + None ->
  30 + Printf.fprintf stderr "Error: first argument must be the name of the file to load\n%!";
  31 + exit 2
  32 + | Some (filename, t) -> (filename, t)
  33 +
  34 +(* from bytecomp/symtable *)
  35 +let filter_global_map p (n,s) =
  36 + let newtbl = ref Tbl.empty in
  37 + Tbl.iter
  38 + (fun id num -> if p id then newtbl := Tbl.add id num !newtbl)
  39 + s;
  40 + (n, !newtbl)
  41 +
  42 +let expunge modules =
  43 + let to_keep = ref StringSet.empty in
  44 +
  45 + let expunge_map tbl =
  46 + filter_global_map
  47 + (fun id -> StringSet.mem (Ident.name id) !to_keep)
  48 + tbl
  49 + in
  50 + let expunge_crcs tbl =
  51 + List.filter (fun (unit, crc) -> StringSet.mem unit !to_keep) tbl
  52 + in
  53 + Array.iter
  54 + (fun exn -> to_keep := StringSet.add exn !to_keep)
  55 + Runtimedef.builtin_exceptions;
  56 + List.iter (fun name ->
  57 + to_keep := StringSet.add (String.capitalize name) !to_keep
  58 + ) modules;
  59 +
  60 + let (filename, t) = get_file () in
  61 +
  62 + let (nsymbols, symbols) = expunge_map (t.ByteFile.nsymbols, t.ByteFile.symbols) in
  63 + let imports = expunge_crcs t.ByteFile.imports in
  64 +
  65 + t.ByteFile.imports <- imports;
  66 + t.ByteFile.nsymbols <- nsymbols;
  67 + t.ByteFile.symbols <- symbols
  68 +
  69 +let load_primitives input_name =
  70 + let prims = ref [] in
  71 + let ic = open_in input_name in
  72 + try
  73 + while true do
  74 + let line = input_line ic in
  75 + prims := line :: !prims
  76 + done;
  77 + assert false
  78 + with End_of_file ->
  79 + close_in ic;
  80 + Array.of_list (List.rev !prims)
  81 +
  82 +(*
  83 +
  84 +let print_primitives () =
  85 + StringSet.iter (fun s ->
  86 + Printf.fprintf stderr "%s\n" s
  87 + ) !used_prims;
  88 + Printf.fprintf stderr "%!"
  89 +
  90 +let primitive_table = ref [||]
  91 +
  92 +let keep_primitives input_name =
  93 + let t = ByteFile.load input_name in
  94 + let filter_prims prims =
  95 + Array.map (fun prim ->
  96 + if StringSet.mem prim !used_prims then
  97 + prim
  98 + else begin
  99 + Printf.fprintf stderr "Removing primitive %s\n" prim;
  100 + "caml_sys_exit"
  101 + end
  102 + ) prims
  103 + in
  104 + let new_t = { t with ByteFile.primitives = filter_prims t.ByteFile.primitives } in
  105 + ByteFile.save !target_arg new_t;
  106 + exit 0
  107 +
  108 +let load_used_primitives filename =
  109 + let t = ByteFile.load filename in
  110 + let module IterUsedPrimitives = ByteCode.IterPrimitives(struct
  111 + let unit (_,prim) = use_prim t.ByteFile.primitives.(prim) end) in
  112 + ByteCode.iter (fun _ opcode -> IterUsedPrimitives.unit opcode) t;
  113 + ()
  114 +
  115 +let load_primitives_table filename =
  116 + let t = ByteFile.load filename in
  117 + Array.iter use_prim t.ByteFile.primitives
  118 +
  119 +*)
  120 +
  121 +
  122 +let remove_primitives prim_filename =
  123 + let (filename,t) = get_file () in
  124 + let primitives = load_primitives prim_filename in
  125 + let removed_prims = ref StringSet.empty in
  126 + let remove_prim s =
  127 + if not (StringSet.mem s !removed_prims) then
  128 + removed_prims := StringSet.add s !removed_prims
  129 + in
  130 + Array.iter remove_prim primitives;
  131 +
  132 + let filter_prims prims =
  133 + Array.map (fun prim ->
  134 + if not ( StringSet.mem prim !removed_prims ) then
  135 + prim
  136 + else begin
  137 + Printf.fprintf stderr "Removing primitive %s\n" prim;
  138 + "caml_sys_exit"
  139 + end
  140 + ) prims
  141 + in
  142 + t.ByteFile.primitives <- filter_prims t.ByteFile.primitives
  143 +
  144 +
  145 +let filter_unused_primitives () =
  146 + let (filename,t) = get_file () in
  147 + let used_prims = ref StringSet.empty in
  148 + let use_prim s =
  149 + if not (StringSet.mem s !used_prims) then
  150 + used_prims := StringSet.add s !used_prims
  151 + in
  152 +
  153 + let module IterUsedPrimitives = ByteCode.IterPrimitives(struct
  154 + let unit (_,prim) = use_prim t.ByteFile.primitives.(prim) end) in
  155 + ByteCode.iter (fun _ opcode -> IterUsedPrimitives.unit opcode) t;
  156 +
  157 + let filter_prims prims =
  158 + Array.map (fun prim ->
  159 + if StringSet.mem prim !used_prims then
  160 + prim
  161 + else begin
  162 + Printf.fprintf stderr "Removing primitive %s\n" prim;
  163 + "caml_sys_exit"
  164 + end
  165 + ) prims
  166 + in
  167 + t.ByteFile.primitives <- filter_prims t.ByteFile.primitives
  168 +
  169 +
  170 +
  171 +let set_primitive_table primitive_table =
  172 + let (filename,t) = get_file () in
  173 + let prim_map = ref StringMap.empty in
  174 + Array.iteri (fun i prim ->
  175 + prim_map := StringMap.add prim i !prim_map
  176 + ) primitive_table;
  177 +
  178 + let module IterPrimitives = ByteCode.IterPrimitives(struct
  179 + let unit (pos,prim) =
  180 + let prim = t.ByteFile.primitives.(prim) in
  181 + let new_pos = StringMap.find prim !prim_map in
  182 + LittleEndian.str_uint t.ByteFile.code pos new_pos
  183 + end) in
  184 + ByteCode.iter (fun _ opcode -> IterPrimitives.unit opcode) t;
  185 + t.ByteFile.primitives <- primitive_table
  186 +
  187 +(*
  188 +
  189 +let strip_sections input_name =
  190 + Printf.fprintf stderr "Warning: beware that this will only work if the CODE section is not\n";
  191 + Printf.fprintf stderr " moved by removing other sections\n";
  192 + let raw = ByteFile.RAW.load input_name in
  193 + let rec filter_sections list =
  194 + match list with
  195 + [] -> []
  196 + | (name, content) :: tail
  197 + when List.mem name !anon_args ->
  198 + Printf.fprintf stderr "Removing section %s of size %d\n%!" name (String.length content);
  199 + filter_sections tail
  200 + | head :: tail -> head :: (filter_sections tail)
  201 + in
  202 + let new_raw = { raw with ByteFile.RAW.sections = filter_sections raw.ByteFile.RAW.sections } in
  203 + Printf.fprintf stderr "Saving to file %s\n%!" !target_arg;
  204 + ByteFile.RAW.save !target_arg new_raw;
  205 + exit 0
  206 +*)
  207 +
  208 +let set_primitives prim_filename =
  209 + set_primitive_table (load_primitives prim_filename)
  210 +
  211 +let save_primitives output_filename =
  212 + let (filename, t) = get_file () in
  213 + let oc = open_out output_filename in
  214 + Array.iter (fun prim -> Printf.fprintf oc "%s\n" prim) t.ByteFile.primitives;
  215 + close_out oc
  216 +
  217 +let print_primitives () =
  218 + let (filename, t) = get_file () in
  219 + Array.iter (fun prim -> Printf.printf "%s\n" prim) t.ByteFile.primitives;
  220 + Printf.printf "%!"
  221 +
  222 +let make_static () =
  223 + let (filename, t) = get_file () in
  224 + t.ByteFile.dll_path <- [];
  225 + t.ByteFile.dll_names <- [];
  226 + current_file := Some (filename, t)
  227 +
  228 +let list_sections () =
  229 + let (filename, t) = get_file () in
  230 + let raw = t.ByteFile.raw in
  231 + Printf.printf "File %s\n" filename;
  232 + let header_len = String.length raw.ByteFile.RAW.header in
  233 + Printf.printf "Header: %d bytes\n" header_len;
  234 + let rec iter pos sections =
  235 + match sections with
  236 + [] -> ()
  237 + | (name, content) :: tail ->
  238 + let len = String.length content in
  239 + Printf.printf "Section %s at pos %d len %d\n"
  240 + name pos len;
  241 + iter (pos+len) tail
  242 + in
  243 + iter header_len raw.ByteFile.RAW.sections;
  244 + Printf.printf "%!";
  245 + ()
  246 +
  247 +let dump () =
  248 + let (filename, t) = get_file () in
  249 + Printf.printf "File %s\n" filename;
  250 + let s = ByteFile.string_of_file t in
  251 + Printf.printf "%s\n%!" s;
  252 + ()
  253 +
  254 +module IntSet = Set.Make (struct type t = int let compare = compare end)
  255 +
  256 +let disass () =
  257 + let (filename, t) = get_file () in
  258 + Printf.printf "File %s\n" filename;
  259 +
  260 + let labels = ref IntSet.empty in
  261 + let module GetLabels = ByteCode.IterDisp(struct
  262 + let unit l = labels := IntSet.add l !labels
  263 + end) in
  264 + ByteCode.iter (fun pos opcode -> GetLabels.unit opcode) t;
  265 +
  266 +
  267 + let label_names = ref IntMap.empty in
  268 + let counter = ref 0 in
  269 + IntSet.iter (fun l ->
  270 + incr counter;
  271 + label_names := IntMap.add l !counter !label_names) !labels;
  272 +
  273 + let globals = ref IntMap.empty in
  274 + Tbl.iter (fun name pos ->
  275 + globals := IntMap.add pos (Ident.name name) !globals
  276 + ) t.ByteFile.symbols;
  277 +
  278 + let module Printer = ByteCode.Printer(struct
  279 + module Disp = struct
  280 + let to_string t = Printf.sprintf "L%d" (IntMap.find t !label_names)
  281 + end
  282 +
  283 + module Global = struct
  284 + let to_string t = try
  285 + IntMap.find t !globals
  286 + with Not_found -> string_of_int t
  287 + end
  288 +
  289 + module Primitive = struct
  290 + let to_string (_, prim) =
  291 + t.ByteFile.primitives.(prim)
  292 +
  293 + end
  294 + end) in
  295 +
  296 + let label_name l =
  297 + try
  298 + Printf.sprintf "L%d" (IntMap.find l !label_names)
  299 + with Not_found ->
  300 + ""
  301 + in
  302 +
  303 + ByteCode.iter (fun pos opcode ->
  304 + Printf.printf "%s\t%d\t%s\n"
  305 + (label_name pos) pos (Printer.string_of_opcode opcode)
  306 + ) t;
  307 + Printf.printf "%!";
38 tools/ocp-bytecode/byteArgs.ml
... ... @@ -0,0 +1,38 @@
  1 +
  2 +(* "Expunge" a toplevel by removing compiler modules from the global List.map.
  3 + Usage: expunge <source file> <dest file> <names of modules to keep> *)
  4 +
  5 +open Sys
  6 +open Misc
  7 +
  8 +(*
  9 +let target_arg = ref "a.out"
  10 +let anon_args = ref ([] : string list)
  11 +
  12 +type action =
  13 + Dump
  14 + | Expunge of string
  15 + | KeepPrimitives of string
  16 + | StripSections of string
  17 + | ListSections of string
  18 + | Disass
  19 + | PrintPrims of string
  20 + | PrintUsedPrims of string
  21 + | SetPrimitiveTable of string
  22 + | PrintLoadedPrims
  23 +(* | DumpSection of string *)
  24 +
  25 +let main_action = ref (None : (string * action) option)
  26 +
  27 +let set_main_action name action =
  28 + match !main_action with
  29 + None -> main_action := Some (name, action)
  30 + | Some (old_name, _) ->
  31 + Printf.fprintf stderr "You cannot specify both actions %s and %s\n%!"
  32 + old_name name;
  33 + exit 2
  34 +*)
  35 +
  36 +let current_file = ref (None : (string * ByteFile.t) option)
  37 +let current_action = ref (None : ( (string list ref) * (string list -> unit) ) option)
  38 +let must_save = ref false
916 tools/ocp-bytecode/byteCode.ml
... ... @@ -0,0 +1,916 @@
  1 +open ByteMisc
  2 +
  3 +module Uint = struct
  4 + type t = int
  5 + let get s pos = LittleEndian.get_uint s pos, pos + 4
  6 +end
  7 +
  8 +module Sint = struct
  9 + type t = int
  10 + let get s pos = LittleEndian.get_sint s pos, pos + 4
  11 +end
  12 +
  13 +module Disp = struct
  14 + type t = int
  15 + let get s pos = pos / 4 + LittleEndian.get_sint s pos, pos + 4
  16 +end
  17 +
  18 +let string_of_intarray t =
  19 + String.concat ", " (Array.to_list (Array.map string_of_int (t)))
  20 +
  21 +module Closurerec = struct
  22 + type t =
  23 + int (* nfuncs *)
  24 + * int (* nvars *)
  25 + * int array
  26 +
  27 + let get s pos =
  28 + let nfuncs = LittleEndian.get_uint s pos in
  29 + let nvars = LittleEndian.get_uint s (pos+4) in
  30 + let orig = pos + 8 in
  31 + let funcs = Array.init nfuncs (fun i ->
  32 + orig/4 + LittleEndian.get_sint s (orig + i * 4)
  33 + ) in
  34 + (nfuncs, nvars, funcs), orig + 4 * nfuncs
  35 +
  36 + let to_string (nfuncs, nvars, funcs) =
  37 + Printf.sprintf "{nfuncs=%d, nvars=%d, funcs=[%s]}"
  38 + nfuncs nvars (string_of_intarray funcs)
  39 +
  40 +end
  41 +
  42 +module Global = struct
  43 + type t = int
  44 + let get s pos = LittleEndian.get_uint s pos, pos + 4
  45 +end
  46 +
  47 +module Switch = struct
  48 + type t = int array * int array
  49 +
  50 + let get s pos =
  51 + let n = LittleEndian.get_uint s pos in
  52 + let orig = pos + 4 in
  53 + let pc = orig / 4 in
  54 + let nconsts = n land 0xFFFF in
  55 + let t1 = Array.init nconsts (fun i ->
  56 + pc + LittleEndian.get_sint s (orig + i * 4)
  57 + ) in
  58 + let n_nonconsts = n lsr 16 in
  59 + let orig = orig + nconsts * 4 in
  60 + let t2 = Array.init n_nonconsts (fun i ->
  61 + pc + LittleEndian.get_sint s (orig + i * 4)
  62 + ) in
  63 + let orig = orig + n_nonconsts * 4 in
  64 + (t1, t2), orig
  65 +
  66 + let to_string (t1, t2) =
  67 + Printf.sprintf "{ consts = [%s]; non_consts = [%s] }"
  68 + (string_of_intarray t1)
  69 + (string_of_intarray t2)
  70 +end
  71 +
  72 +module Primitive = struct
  73 + type t = int * int
  74 + let get s pos = (pos, LittleEndian.get_uint s pos), pos + 4
  75 +end
  76 +
  77 +module Pubmet = struct
  78 + type t = int
  79 + let get s pos =
  80 + let tag = LittleEndian.get_sint s pos in
  81 + let _cache = LittleEndian.get_uint s (pos+4) in
  82 + tag, pos+8
  83 +end
  84 +
  85 +type opcode =
  86 + | ACC0
  87 + | ACC1
  88 + | ACC2
  89 + | ACC3
  90 + | ACC4
  91 + | ACC5
  92 + | ACC6
  93 + | ACC7
  94 + | ACC of Uint.t
  95 + | PUSH
  96 + | PUSHACC0
  97 + | PUSHACC1
  98 + | PUSHACC2
  99 + | PUSHACC3
  100 + | PUSHACC4
  101 + | PUSHACC5
  102 + | PUSHACC6
  103 + | PUSHACC7
  104 + | PUSHACC of Uint.t
  105 + | POP of Uint.t
  106 + | ASSIGN of Uint.t
  107 + | ENVACC1
  108 + | ENVACC2
  109 + | ENVACC3
  110 + | ENVACC4
  111 + | ENVACC of Uint.t
  112 + | PUSHENVACC1
  113 + | PUSHENVACC2
  114 + | PUSHENVACC3
  115 + | PUSHENVACC4
  116 + | PUSHENVACC of Uint.t
  117 + | PUSH_RETADDR of Disp.t
  118 + | APPLY of Uint.t
  119 + | APPLY1
  120 + | APPLY2
  121 + | APPLY3
  122 + | APPTERM of Uint.t * Uint.t
  123 + | APPTERM1 of Uint.t
  124 + | APPTERM2 of Uint.t
  125 + | APPTERM3 of Uint.t
  126 + | RETURN of Uint.t
  127 + | RESTART
  128 + | GRAB of Uint.t
  129 + | CLOSURE of Uint.t * Disp.t
  130 + | CLOSUREREC of Closurerec.t
  131 + | OFFSETCLOSUREM2
  132 + | OFFSETCLOSURE0
  133 + | OFFSETCLOSURE2
  134 + | OFFSETCLOSURE of Sint.t (* was Uint *)
  135 + | PUSHOFFSETCLOSUREM2
  136 + | PUSHOFFSETCLOSURE0
  137 + | PUSHOFFSETCLOSURE2
  138 + | PUSHOFFSETCLOSURE of Sint.t (* was Nothing *)
  139 + | GETGLOBAL of Global.t
  140 + | PUSHGETGLOBAL of Global.t
  141 + | GETGLOBALFIELD of Global.t * Uint.t
  142 + | PUSHGETGLOBALFIELD of Global.t * Uint.t
  143 + | SETGLOBAL of Global.t
  144 + | ATOM0
  145 + | ATOM of Uint.t
  146 + | PUSHATOM0
  147 + | PUSHATOM of Uint.t
  148 + | MAKEBLOCK of Uint.t * Uint.t
  149 + | MAKEBLOCK1 of Uint.t
  150 + | MAKEBLOCK2 of Uint.t
  151 + | MAKEBLOCK3 of Uint.t
  152 + | MAKEFLOATBLOCK of Uint.t
  153 + | GETFIELD0
  154 + | GETFIELD1
  155 + | GETFIELD2
  156 + | GETFIELD3
  157 + | GETFIELD of Uint.t
  158 + | GETFLOATFIELD of Uint.t
  159 + | SETFIELD0
  160 + | SETFIELD1
  161 + | SETFIELD2
  162 + | SETFIELD3
  163 + | SETFIELD of Uint.t
  164 + | SETFLOATFIELD of Uint.t
  165 + | VECTLENGTH
  166 + | GETVECTITEM
  167 + | SETVECTITEM
  168 + | GETSTRINGCHAR
  169 + | SETSTRINGCHAR
  170 + | BRANCH of Disp.t
  171 + | BRANCHIF of Disp.t
  172 + | BRANCHIFNOT of Disp.t
  173 + | SWITCH of Switch.t
  174 + | BOOLNOT
  175 + | PUSHTRAP of Disp.t
  176 + | POPTRAP
  177 + | RAISE
  178 + | CHECK_SIGNALS
  179 + | C_CALL1 of Primitive.t
  180 + | C_CALL2 of Primitive.t
  181 + | C_CALL3 of Primitive.t
  182 + | C_CALL4 of Primitive.t