Presets
Input Source Code
Abstract Syntax Tree
Ready.
Click "Parse Code" to inspect the AST.
## About Smalltalk-80 Grammar
Smalltalk-80 is an object-oriented, dynamically typed programming language with a minimal, message-oriented syntax.
### Key Parser Features
- **Historical Context**: PetitParser originated in the Smalltalk ecosystem as part of Lukas Renggli's PhD research on **Helvetia** at the University of Bern; this Smalltalk grammar was the first grammar implemented for PetitParser.
- **Message-Passing Syntax**: Models Smalltalk message precedence across unary (`receiver msg`), binary (`a + b`), and keyword (`receiver msg: a with: b`) messages, as well as message cascades (`receiver m1; m2`).
- **Typed AST Nodes**: Builds an AST representing methods, sequences, blocks (`[:arg | ...]`), assignments, return statements, and pragmas.
- **Production Switching**: Supports parsing complete methods or isolated expressions and sequences.