[Omake] Menhir, --raw-depend, --infer, and OMake
Francois Pottier
Francois.Pottier at inria.fr
Thu Feb 1 01:43:43 PST 2007
Hello,
On Wed, Jan 31, 2007 at 11:14:19PM -0500, Michael Furr wrote:
> then --raw-depend does NOT include the dependency
> parser.ml: helper.cmo
>
> and instead only shows dependencies on parser.cm[iox]. Therefore when
> menhir typechecks the rules before generating the grammar (based on
> --infer), it may not have rebuilt helper.cmo if it changed. Note that the
> regular "--depend" flag *does* show this dependency.
Thanks for pointing this problem out.
Let's see. I can't say that I fully understand these dependency issues, but
I can recapitulate what Menhir does.
Both --raw-depend and --depend begin their work in the same way, by
generating parser.{ml,mli} and invoking ocamldep on them. In both
cases, ocamldep's output is echoed by menhir. Then comes the difference
between --raw-depend and --depend. The former stops here, while the
latter looks for the line that begins with "parser.cmo:", replaces
"parser.cmo:" with "parser.ml parser.mli:", removes "parser.cmi"
from the right-hand side, and echoes that line. This extra line
is supposed to reflect the additional requirements imposed by --infer,
that is, we must be able to typecheck the semantic actions before we
can produce parser.{ml,mli}.
I am not sure why --raw-depend is useful for omake. I think Jason Hickey
wanted to use ocamldep with the -modules flag, which caused "menhir --depend"
to become confused (since it parses ocamldep's output in order to fix it). So
he asked me for a --raw-depend flag which echoes ocamldep's output verbatim.
However, in the process, perhaps we lost that extra dependency line (which I
assumed would be somehow produced by OCaml.om)? Jason, could you comment on
this issue? I am willing to make whatever changes are appropriate.
Best regards,
--
François Pottier
Francois.Pottier at inria.fr
http://cristal.inria.fr/~fpottier/
More information about the Omake
mailing list