Red Echo

March 21, 2011

Simple, clear, well-written introduction to Pratt parsers

If recursive descent is peanut butter, Pratt parsing is jelly. When you mix the two together, you get a simple, terse, readable parser that can handle any grammar you throw at it.

Pratt’s technique for handling operator precedence and infix expressions is so simple and effective it’s a mystery why almost no one knows about it.

I would guess that it’s overlooked because the programming tools world is still largely convinced that automatic parser generators are something more than a dead end. People who don’t know any better see all the emphasis on parser generators and conclude that parsing must be some kind of inhumanly difficult, heinously complex process far beyond the capacity of an unaided human mind.