[ANN] New release of Menhir (20231231)

It is my pleasure to announce a new version of Menhir, 20231231.
It should be available now:

  opam update
  opam install menhir.20231231

The main new features are as follows:

  • The new command line switch --unparsing (which must be used in conjunction
    with --table) causes Menhir to generate an unparsing API. In short,
    unparsing is the process of transforming abstract syntax trees back into
    text. The unparsing API is intended to help users write correct unparsers,
    but does not automate the whole process.

    For more details, please see the paper Correct, Fast LR(1)
    Unparsing
    .

    The unparsing API requires linking with the library MenhirCST, and
    requires OCaml 4.08.

  • Attributes can now be attached with a production. (In previous versions of
    Menhir, attributes could be attached only with a symbol, with a specific
    occurrence of a symbol in the right-hand side of a production, or with the
    whole grammar.) This is achieved by letting one or more attributes appear
    immediately after the semantic action.

    During the two grammar transformation phases (expansion of parameterized
    nonterminal symbols and elimination of %inline nonterminal symbols), the
    [@name] attributes attached with productions receive special treatment,
    so as to allow each production to receive a unique name.

10 Likes