Open kit-ty-kate opened 10 years ago
I guess not.
In obuild/generators.ml, you can maybe hard code something as a workaround. In the long term, I guess we should have an option on the command line or in the X.obuild file to tell which tool to use for that.
Indeed, not yet. I started to implement a pre-build step which can call any kind of generator, but I didn't finish it yet (mostly because I didn't come with a definitive design). The idea is to have something like: Library l1 ... Modules: X, Y, G1, G2 per G1 G2 pre-build: menhir $base.mly -o $base.ml
I'm not sure it is sufficient for every cases, though. For examples, if many files are generated, it may become painful to specify all of them that way. Also, it doesn't work with generators creating for than 1 file. Ideas are welcome.
I'm afraid this is not sufficient of menhir :/ It should be called with the ocamlc command, like:
menhir --ocamlc 'ocamlc theparams thepackages … -I things' --infer $base.mly
I guess we should have a $ocamlc
variable.
I'm surprised, why does menhir needs to invoke ocaml ? Anyway, maybe menhir should be handled natively by obuild with a tag, instead of creating an overcomplicated pre-build API. Furthermore many users would be confused/annoyed to have to make such a complex configuration. On the other hand, if pre-build can invoke menhir, then it is kind of good torture test for the design.
Menhir requires ocamlc when using the --infer parameter. This parameter is used to improve type error messages. For example if I don't use it, it prints the following warning:
Warning: you are using the standard library and/or the %inline keyword. We
recommend switching on --infer in order to avoid obscure type error messages.
If obuild supports menhir, I have another colleague who could switch to obuild (instead of a very ugly and complicated makefile).
I'm testing again obuild and I can't find the way to tell him that it should compile .mly files with menhir instead of ocamlyacc. Is this feature exists ?