-
Notifications
You must be signed in to change notification settings - Fork 391
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
Menhir support in jbuilder? #285
Comments
Would you mind putting up a reproducible example? |
So, I was trying to devise an MWE, but the error I get is not even the one cited above. I'm used to Ocamlbuild which can deal very easily with grammars spanning many files and where some files only define (syntactic) tokens and others only use them (options So as a first example, I don't even see how to compile with jbuilder the |
Hi, my project is now released publically... and I don't see at all how to compile it with dune. As I (and others elsewhere) said, Menhir has an |
I had a look at (jbuild_version 1)
(executable
((name calc)))
(ocamllex (lexer))
(menhir
((flags (--only-tokens))
(modules (tokens))))
(menhir
((merge_into algebraic)
(flags (--external-tokens Tokens))
(modules (tokens algebraic common))))
(menhir
((merge_into reverse)
(flags (--external-tokens Tokens))
(modules (tokens reverse common)))) Regarding the
In fact, these 3 steps are always required in this order; to compile a .ml file we need to have compiled its dependencies first, and to know its dependencies we need the final source code. However this doesn't work when step 1 needs to use the typer. This is the case of |
Thanks I will have a look at this, then. I'd love to switch my project to Dune but my experiments until now have failed. I'll see if I can succeed now. |
All right, so I can build my project (in this branch), but I'm not sure I got all your explanations (and I'm pretty sure my jbuild file is non-conventional: I had some trouble having ppx_deriving, ppx_blob and visitors all work; as well as disabling several flags at once), in particular regarding |
No, it's not possible to use |
Well I don't have an example at hand where |
Ok. I noticed there is another ticket about
yes, it's a bit painful at the moment. Switching ppx_blob to ocaml-migrate-parsetree should allow to use a more standard |
Yeah sure thank you. |
I am trying to set up jbuilder to run Menhir in various ways on several files. Namely, I have two parsers:
Parser.mly
andSMV_trace_parser.mly
. They are unrelated but located in the same directory. However, forSMV_trace_parser.mly
, I rely on the Menhir option of defining the (parsing) tokens in another Menhir file calledSMV_trace_tokens.mly
.Hence I added the following rules (using only the
menhir
rule did not work, even with flags added when necessary):When running jbuilder, I get the following error:
The text was updated successfully, but these errors were encountered: