This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Yet Another LR Implementation

This is another implementation of the classic LR(1) parsing algorithm, along with Knuth’s LR(1) table generation algorithm.

Rather than follow the model of tools like yacc and require external code generation, this library is driven dynamically from Python code.

An obvious question is, “why?”

Two reasons:

  • firstly, to experiment with surface syntax for expressing grammars in Python code in as uninvasive a way as possible.

    The package “ptk” takes a similar approach here.

  • secondly, to provide a playground to look at other “cutting-edge” parsing algorithms, as a basis for improving my own understanding of them.

By “cutting-edge” I’m largely referring to the late 1970s.

The current implementation is largely inspired by yacc, including yacc’s various deficiencies:

  • there’s a linearisation used for reduce/reduce conflict resolution;
  • there’s a linearisation used for token precedence.

In practice, it’s easy to get bitten by both of these - as it is for the default shift/reduce resolution to mask errors. A more flexible partial ordering is certainly feasible.


Some of the example grammars included in the tests are derived from the (Red) Dragon Book, which I’ve had since I was about 16; it’s a book which definitely shaped my life.

I’ve no idea how the reference numbers line up with later additions.

Compilers: Principles, Techniques, and Tools (1986) by Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
yalr-0.0.5.tar.gz (9.6 kB) Copy SHA256 Checksum SHA256 Source Jan 24, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting