Example of error recovery with Menhir For the demo: make ./parse example.input Look at the comments in parse.ml for the implementation technique I used.