Parsers, Perl 6 Rules, and the Parrot Grammar Engine

Patrick Michaud, Consultant,

Track: Perl
Date: Wednesday, July 26
Time: 10:45am - 11:30am
Location: Portland 251

Perl 6 defines a new, powerful pattern-matching syntax known as "rule expressions", which is an extension and redesign of the regular expression syntax used in earlier versions of Perl. Notably, Perl 6 rule syntax has been explicitly designed to ease the task of creating language parsers.

The Parrot Grammar Engine (PGE) is the implementation of Perl 6 rules on top of Parrot, the virtual machine implementation underlying Perl 6. PGE not only implements Perl 6 rule syntax for top-down parsing, but it also integrates a bottom-up operator precedence parser for fast processing of common expressions. PGE also allows the arbitrary mixing of top-down, bottom-up, and custom parsing subroutines.

This talk will a detailed overview of Perl 6 rules, an introduction to using PGE, and how these can be quickly used to build custom parsers for a variety of languages. Numerous examples will be provided, including complete examples for simple languages and key excerpts from the Perl 6 parser (written using Perl 6 rules and PGE).