Grammars for programming languages are traditionally specified statically. They are hard to compose and reuse due to ambiguities that inevitably arise. PetitParser combines ideas from scannerless parsing, parser combinators, parsing expression grammars and packrat parsers to model grammars and parsers as objects that can be reconfigured dynamically.
PetitParser for Smalltalk
The framework has been ported to numerous other programming languages.
Running PetitParser in Pharo
To install the original version of PetitParser in Pharo, evaluate the following code snippet:
Gofer new renggli: 'petit'; package: 'PetitParser'; load.
To get the full toolset, including a dedicated editor and some experimental tools, use the following Metacello script:
Gofer new renggli: 'petit'; package: 'ConfigurationOfPetitParser'; load. (Smalltalk at: #ConfigurationOfPetitParser) perform: #loadDefault.
PetitParser is licensed under the MIT license.