LEMON and That parse.y File in SQLite Source

I had really only took a cursory glimpse of SQLite’s source, and I had always thought the parse.y file was a yacc/Bison parser source. I was wrong: It’s the parser source for LEMON, the parser generator written by SQLite’s author, D. Richard Hipp.

According to its web page:

  • The parser generated by Lemon is both re-entrant and thread-safe.
  • Lemon includes the concept of a non-terminal destructor, which makes it much easier to write a parser that does not leak memory.

SQLite is such an amazing example of source and tool self-reliance.