Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle menhir #110

Open
kit-ty-kate opened this issue Sep 11, 2014 · 8 comments
Open

Handle menhir #110

kit-ty-kate opened this issue Sep 11, 2014 · 8 comments

Comments

@kit-ty-kate
Copy link

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 ?

@kit-ty-kate kit-ty-kate changed the title Handle merlin Handle menhir Sep 11, 2014
@UnixJunkie
Copy link

I guess not.

@UnixJunkie
Copy link

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.

@jeromemaloberti
Copy link
Contributor

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.

@kit-ty-kate
Copy link
Author

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

@kit-ty-kate
Copy link
Author

I guess we should have a $ocamlc variable.

@jeromemaloberti
Copy link
Contributor

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.

@kit-ty-kate
Copy link
Author

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.

@UnixJunkie
Copy link

If obuild supports menhir, I have another colleague who could switch to obuild (instead of a very ugly and complicated makefile).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants