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

Menhir parser? #203

Open
gasche opened this issue Dec 24, 2019 · 2 comments
Open

Menhir parser? #203

gasche opened this issue Dec 24, 2019 · 2 comments
Labels

Comments

@gasche
Copy link

gasche commented Dec 24, 2019

I came from the DNS server blog post, which mentions that you use ocamlyacc as a parser, and that pull requests to improve the parser are welcome.

I wonder if you considered using Menhir as a parser? (Is there a blocker related to adding extra dependencies?) In my experience Menhir results in more readable parsers (thanks in particular to the ability to name symbols instead of using $n), and I could send a conversion PR.

@hannesm
Copy link
Member

hannesm commented Dec 24, 2019

yes, I've heard good things about menhir (including the possibility of nicer error messages). In terms of dependencies, I think it is fine. The current parser (in the zone subdirectory) was inherited from the original ocaml-dns (from 2005), and changing it to menhir would be great. Our dhcp server uses menhir as well, thus it will work in a MirageOS environment. Thanks.

EDIT Disclaimer: I usually find working on text-based parsers tiring and tedious, thus I avoid it.

@gasche
Copy link
Author

gasche commented Dec 24, 2019

Menhir gives the possibility of nicer error messages, but currently it takes work from the grammar author to achieve this, it is not a consequence of the switch. (I would say that it take an hour of work for a small grammar, and several hours to a day for a medium-complexity grammar. We don't know how to make the current approach scale to larger grammars.)

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

No branches or pull requests

3 participants