Embed standard.mly directly inside menhir
As discussed, I propose to embed standard.mly
directly inside menhir
. The upside is that menhir
no longer needs to find this file at runtime, which simplifies matters (in particular, a future dune
port). Also, there is no danger of using an outdated standard.mly
.
The changes in this patch are:
- Define a generic rule in
myocamlbuild.ml
to produce a fileXXX_mly.ml
fromXXX.mly
. The contents of the produced file are exactlylet contents = "<contents of XXX.mly>"
- Modify grammar loading logic to load the standard library
standard.mly
directly fromStandard_mly.contents
. Note that the dummy filename<standard.mly>
is used at this point. This filename ends up in line directives in the generated OCaml parsers. - Remove support for
--stdlib
andMENHIR_STDLIB
(the command line flag is left in place for backwards-compatibility but is ignored) - Adapt the distribution script so that
standard.mly
is no longer installed - Adapt the manual