Cairn: A derivation explorer and logger for Menhir Parser

Dear all,

I am happy to announce the release of a small tool I’ve implemented for explaining how a LR parser works for my students. The tool is called cairn, and lets you visualize the step by step building of the parsing tree of the input of a parser, and can be used with any grammar written with menhir (basically, you provide menhir generated modules and cmly file to a functor from cairn and you’re all set). It can either generate a text file or launch a small terminal user interface to explore the execution of the parser step by step.
It is probably only useful on small inputs, and mainly for teaching purposes, but I thought it might be useful to share.

The homepage of the project is there, and it can be installed directly through opam with :

opam install cairn

Best,

Vincent Penelle.

15 Likes

I just tried Cairn and this is great!
I strongly suggest that anyone teaching parsing with Menhir is giving it a try (and then show that to students).

2 Likes