PEG
The zen of PEG writing has reached the SCG labs...
What is a PEG?
Parsing expression grammars (PEGs) are an alternative to context free grammars by Bryan Ford for formally specifying syntax, and packrat parsers are parsers for PEGs that operate in guaranteed linear time through the use of memoization.
- http://en.wikipedia.org/wiki/Parsing_expression_grammar
- http://pdos.csail.mit.edu/~baford/packrat/popl04
PEGs at the SCG
PEG in Ruby, by Adrian Kuhn
- http://www.iam.unibe.ch/~akuhn/blog/2008/04/executable-grammar-parser
- http://www.iam.unibe.ch/~akuhn/blog/2008/05/executable-grammar-dsl
- http://www.iam.unibe.ch/~akuhn/blog/2008/05/executable-grammar-memoization
PEG in Scheme, part of SchemeTalk by Toon Verwaest
PEG in Smalltalk, by Oscar Nierstrasz
PEG in Smalltalk, by Lukas Renggli
- PetitParser: http://source.lukas-renggli.ch/petit.html
(Full test coverage, DSL for parser definition, Optional memoization)
PEG in Python, by Sandro De Zanet