Arnt Gulbrandsen
About meAbout this blog

Parser generators

I have a feeling that most (all?) parser generators are written with one overwhelming goal: Parse fast/well when the grammar and input are both correct.

Other worthwhile goals include: Handle buggy grammars well. Handle errant input well (some generators do try to do this, although I don't know any that both provide automatic fallback mechanisms and good ways to emit appropriate error messages). Provide a pleasant API between the generated parser and the program in which it lives. Leverage the compiler's diagnostics to help correctness as the program and grammar evolve (foo not used, enum value not handled in switch, blah). Lessen the effect of the language boundary, e.g. make it as easy/natural to singlestep the generated parser as the rest of the program.

I am frustrated. Stupid Monday + stupid grammar blah = frustration.