I’ve been tinkering with monadic parser combinators combined with continuations (see Monads, Mother of All), but my latest toy simplifies all that by using PEG grammars. PEGs and CFGs are nearly interchangable for most parsing of computer languages, and can be parsed in linear time and space by packrat parsing — parsing with backtracking, but …
Category Archives: parsing
Some parser combinators for Python
I’ve got two parser combinators today for you to play with, both whipped up this evening from pieces of earlier experiments.