Blog do Ramalho.org

PEG Parsing Series Overview

by Guido van Rossum

My series of blog posts about PEG parsing keeps expanding. Instead of updating each part to link to all other parts, here’s the table of content:

  1. PEG Parsers
  2. Building a PEG Parser
  3. Generating a PEG Parser
  4. Visualizing PEG Parsing
  5. Left-recursive PEG Grammars
  6. Adding Actions to a PEG Grammar
  7. A Meta-Grammar for PEG Parsers
  8. Implementing PEG Features
  9. PEG at the Core Developer Sprint (original)

A video of a talk I gave about this topic at North Bay Python is up on YouTube:
Writing a PEG parser for fun and profit.

screenshot of pegen viewer

Update: April 2, 2020. In case you are wondering what’s happening, we now have PEP 617 up, which proposes to replace the current parser in CPython with a PEG-based parser.

© 2019, Guido van Rossum.
License for this article, the series, and the code shown: CC BY-NC-SA 4.0

Info

Source code for the examples is at
https://github.com/we-like-parsers/pegen_experiments
where story1/ has the code for Part 2 and so on.

Guido van Rossum posted this series originally on Medium.com. Thanks to the Creative Commons license he chose, I can post the series here, and also on Github, using Markdown format to make it easier for anyone to share, so that people can learn from Guido long after Medium.com is gone. — LR

Tags: