PetitParser2 is a framework for building parsers. PetitParser2 is a new version of PetitParser with focus on performance and flexibility.
There are many reasons why to switch to PetitParser2:
#startOfLine
, #endOfLine
, can express tolerant or context sensitive grammars.PP2BufferStream
). We already migrated many parsers to PetitParser2 (e.g. Smalltalk, Pillar, ...). If you find anything that is not working for you, please open an issue. See Migration from PetitParser for more details.
Use the configuration manager in your Pharo image and install the stable version.
Installing standard version for the latest Pharo:
Metacello new
baseline: 'PetitParser2';
repository: 'github://kursjan/petitparser2';
load.
To install graphical tools (with GToolkit
and Roassal2
dependencies):
Metacello new
baseline: 'PetitParser2Gui';
repository: 'github://kursjan/petitparser2';
load.
To install a core with minimal external dependencies, use:
Metacello new
baseline: 'PetitParser2Core';
repository: 'github://kursjan/petitparser2';
load.
To install additional languages, use:
Metacello new
baseline: 'PetitParser2Languages';
repository: 'github://kursjan/petitparser2';
load.
The following grammars are available:
Learn more about PetitParser2. In the tutorial we cover all the topics related to PetitParser2. We discuss PetitParser2 best practices, testing, abstract syntax tree generation, optimizations or even context-sensitive parsing.
https://kursjan.github.io/petitparser2/
Here you can find an illustrative explanation how to debug when parsers do not work as expected.
Feel free to open an issue or post a StackOverflow question with the petitparser2
tag.