Reference manual for Menhir version 20240715, a parser generator that turns high-level grammar specifications into parsers.
Menhir is a parser generator that turns high-level grammar specifications decorated with semantic actions into parsers. It is based on Knuth’s LR(1) parser construction technique and is inspired by yacc, ML-Yacc, and ocamlyacc.
The manual covers usage, lexical conventions, grammar specification syntax, advanced features, conflicts, positions, interpreter mode, generated APIs, and error handling. It also describes the Coq back-end, building grammarware on top of Menhir, interaction with build systems, comparison with ocamlyacc, and technical background.
| Version | 20240715 |
|---|---|
| Parser construction technique | Knuth’s LR(1) |
| Default back-end | code |
| Table back-end option | --table |
| Grammar file extension | .mly |
| Coq grammar file extension | .vy |
Menhir is a parser generator that turns high-level grammar specifications into parsers.
Menhir uses Knuth’s LR(1) parser construction technique.
The code back-end is the default back-end.
It is selected by passing --table on the command line.