如何在OCaml中用Dune生成Menhir的.automaton文件?
无法通过Dune生成Menhir的.automaton文件
我尝试生成.automaton文件,已在lib目录下的dune文件中添加如下配置:
(menhir (flags --explain --dump) (modules parser))
执行dune build后,用find . -name '*.automaton'找不到预期的文件。可通过以下步骤复现问题:
git clone https://github.com/dhilst/pfpy.git && cd pfpy opam install --deps-only . dune build
更新1
执行dune build --verbose后确认Menhir已执行:
Running[23]: (cd _build/.sandbox/740f245a4e0ba91f52e6ab53118b4542/default && /home/me/.opam/4.14.1/bin/menhir --explain --inspection --table --dump lib/parser.mly --base lib/parser --infer-read-reply lib/parser__mock.mli.inferred)
但构建完成后.sandbox文件夹为空:
$ ls -l _build/.sandbox total 0
更新2
目前临时解决方法是直接执行menhir --explain --dump lib/parser.mly,该命令虽返回错误状态,但能生成所需的.automaton文件。
内容的提问来源于stack exchange,提问作者geckos
相关产品推荐
相关产品推荐

