# Dune error when adding a second parser to a Menhir project

**URL:** <https://discuss.ocaml.org/t/dune-error-when-adding-a-second-parser-to-a-menhir-project/10569>\
**Category:** Learning\
**Tags:** menhir\
**Created:** [October 2, 2022, 12:36pm UTC](https://discuss.ocaml.org/t/dune-error-when-adding-a-second-parser-to-a-menhir-project/10569 "2022-10-02T12:36:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olleharstedt](https://avatars.discourse-cdn.com/v4/letter/o/f1d935/32.png) [@olleharstedt](https://discuss.ocaml.org/u/olleharstedt)\
**Post date:** [October 2, 2022, 12:36pm UTC](https://discuss.ocaml.org/t/dune-error-when-adding-a-second-parser-to-a-menhir-project/10569/1 "2022-10-02T12:36:39Z")

</div>

Edit: Sorry, I think was actually a simple file naming error… Imagine if the error said “no such file” instead. 😂

Sorry for spamming the forum. Not much beginner info available online, I’m afraid.

So, I’m testing to add a second parser, to parse a token stream of a small DSL inside the main language. Get a basic error:

```auto
10 | (menhir
11 | (modules parser docblockparser))
Error: No rule found for lib/docblockparser.mly

```

Full dune file in that folder:

```nohighlight
(library
 (libraries base stdio str re dolog expect_test_helpers_kernel)
 (preprocess (pps ppx_deriving.show ppx_deriving.ord ppx_inline_test ppx_assert ppx_expect ppx_compare ppx_sexp_conv))
 (inline_tests)
 (name pholyglot))

(ocamllex
  (modules lexer))

(menhir
  (modules parser docblockparser))

(env
  (dev
    (flags (:standard -warn-error -A))))

```

Compiling the main parser works fine.

Any ideas?

---

<div class="post-metadata">

**Author:** ![otini](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/otini/32/3533_2.png) [@otini](https://discuss.ocaml.org/u/otini)\
**Post date:** [October 3, 2022, 9:55am UTC](https://discuss.ocaml.org/t/dune-error-when-adding-a-second-parser-to-a-menhir-project/10569/2 "2022-10-03T09:55:07Z")

</div>

> [@olleharstedt](#):
>
> Edit: Sorry, I think was actually a simple file naming error… Imagine if the error said “no such file” instead. 😂

Sometimes during a Dune build, some files are not present in the source tree but are generated using Dune rules. So it makes some kind of sense that Dune’s error is “No rule found for `<filename>`”. That being said, a more helpful error message may be “File `<filename>` not found and no rule found to generate it.”
