[ANN] New release of Menhir (20230608)

Dear users of Menhir,

I am happy to announce a new release of Menhir, with several minor changes and bug fixes, listed below.

  opam update
  opam upgrade menhir

Happy parsing,
François Pottier


  • The new command line switch --dump-menhirLib <directory> causes the source
    files menhirLib.ml and menhirLib.mli to be created in the designated
    directory. This command can be useful to users with special needs who wish
    to use menhirLib but do not want to rely on it being installed somewhere
    in the file system. (Contributed by Nicolás Ojeda Bär.)

  • Changes in the public API of the library MenhirSdk.
    (Contributed by Frédéric Bour.)

    • The function Lr1.reductions,
      whose type is t -> (terminal * production list) list,
      is still present but is now deprecated.
      The function Lr1.get_reductions,
      whose type is t -> (terminal * production) list,
      should be used instead.
      The library offers a view of the automaton after conflict resolution,
      so, for each token, at most one production can be reduced.

    • The function Lr1.default_reduction : Lr1.t -> production option
      appears. This function indicates which states have a default reduction.

    • The function Cmly_read.read_channel appears.

    • The module Cmly_read.Lift appears.

  • The new experimental flag --specialize-token causes the code back-end
    to perform code specialization so as to guarantee that each token is
    examined exactly once (thus never more than once) by the parser. This
    causes an increase in code size and does not (yet) allow a performance
    increase. This feature is independent of the choice between -O 0,
    -O 1 and -O 2. It may disappear in the future.

  • Inconsistent type definitions used to be produced when --only-tokens and
    --inspection were passed on the command line. The type terminal was
    defined at the toplevel, whereas it should always be defined inside the
    submodule MenhirInterpreter. (Reported and fixed by Frédéric Bour.)

  • Malformed code and type definitions used to be produced when
    --external-tokens and --inspection were passed on the command line.
    Fixed. (Reported by Maxime Dénès.)

  • Enable OCaml warning 39 (unused rec flag) in the OCaml code produced
    by Menhir’s code back-end. Menhir now carefully emits let instead
    of let rec when a function is not recursive.