A toy PL/0 compiler.
Michael Hope d60fb90b53 build: fix a type error. peek() returning !None means read() will return !None. 4 months ago
examples examples: added a selection of examples and tests. 2 years ago
lib general: added copyright headers and license file. 2 years ago
pl0 build: fix a type error. peek() returning !None means read() will return !None. 4 months ago
tests general: ran pylint and tidied up. 2 years ago
CONTRIBUTING.md general: added copyright headers and license file. 2 years ago
GRAMMER.md Added an initial PL/0 lex and parser. 2 years ago
LICENSE general: added copyright headers and license file. 2 years ago
Makefile pl0: switch from tc to mypy for type checking. 1 year ago
NOTES.md Added an initial PL/0 lex and parser. 2 years ago
README.md general: minor fixes to the language in the README. 2 years ago

README.md

PL/0 implementation

A toy compiler for the PL/0 educational language.

Motivation

I’ve worked with compilers for a fair part of my life but have never written one from scratch. I decided on PL/0 after hearing about “Algorithms + Data Structures = Programs” by Niklaus Wirth who happens to work nearby at ETH.

Usage

python3 -m pl0.driver [-o output.c] [source.pl0]

See Makefile for further rules and examples/ for examples.

-- Michael Hope mlhx@google.com michaelh@juju.net.nz