Grammars made of objects: a PetitParser2 reading path
A grammar can be a network of objects you inspect and combine. This evergreen reading path introduces PetitParser2, with a small question to keep beside every example: did it consume the whole input?
Published · Curated links & context
WHAT CAUGHT OUR EYE
News & articles
Dates below belong to the original sources. Evergreen resources are labeled separately from dated news.
EVERGREEN RESOURCE · PHARO
Compose a parser, then inspect what it accepts
Publication date not established · Evergreen tutorial, not release news
Jan Kurš’s PetitParser2 tutorial starts with an identifier grammar, examines the resulting parser objects, and then builds an arithmetic parser. Along the way it introduces sequencing, ordered choice, repetition and failure objects. Its end parser is especially worth noticing: recognizing a beginning is not the same as accepting the complete input.
Why explore it?
Read the identifier section first. On paper, predict what a valid name, a leading digit and a valid name followed by punctuation should do. Then look for the rule that requires the end of input. This is a different learning angle from our earlier SmaCC recommendation: the focus here is composing and inspecting parser objects, not surveying parser tools.
University of Bern Software Composition Group · Undated project overview
The project overview distinguishes the original Smalltalk implementation from PetitParser2 and links to both generations. Use that distinction when comparing class names and installation examples; an older snippet is not a promise of compatibility with your image.
Glamorous Toolkit documentation · Not a new release announcement
Use this companion entry when exploring parsing in Glamorous Toolkit. Keep its environment-specific tools separate from plain Pharo and Squeak; we have not installed or tested this framework for this edition.
Existing Squeak tutorial · Not a newly published lesson
Our tiny interpreter provides a contrasting route from text to messages. Compare where each approach recognizes syntax and where it gives that syntax meaning.
Published 13 November 2026. We checked all 15 earlier Updates editions and found this PetitParser2 tutorial unfeatured. This is an evergreen recommendation, not a newly released library or tutorial. Sources are the author’s tutorial, the University of Bern project overview and the Glamorous Toolkit book. Their publication dates were not established. No third-party imagery is rehosted, and no compatibility or execution results are claimed.