Practical PLT Part 5: A Parser Generator
At this point we’ve developed a complete, though very simple, interpreter and runtime environment. To some degree, this interpreter is all we need. It can express any function, it can easily be extended, it has a simple parser, and it has a working garbage collector. What more could we ask for? Life is good.
Life is good, that is, until we ask somebody else to use it. Their first response is probably an annoyance at the syntax — it’s a little surprising to have to write (+ 1 1) after grade school has burned 1 + 1 into our minds — and, truth be told, the S-Expression syntax isn’t the most natural or compact for every problem.
Luckily we can, with a little work, entirely eliminate this complaint by creating a parser generator — a function that takes as input a grammar (a formal description of a language), and produces as output a parser for that language.


