A toy PL/0 compiler.
Find a file
2018-10-22 12:30:17 +02:00
examples examples: added a selection of examples and tests. 2016-05-29 17:06:38 +02:00
lib general: added copyright headers and license file. 2016-05-29 21:10:39 +02:00
pl0 build: fix a type error. peek() returning !None means read() will return !None. 2018-10-22 12:30:17 +02:00
tests general: ran pylint and tidied up. 2016-05-29 21:33:45 +02:00
CONTRIBUTING.md general: added copyright headers and license file. 2016-05-29 21:10:39 +02:00
GRAMMER.md Added an initial PL/0 lex and parser. 2016-05-01 19:06:57 +00:00
LICENSE general: added copyright headers and license file. 2016-05-29 21:10:39 +02:00
Makefile pl0: switch from tc to mypy for type checking. 2017-07-04 18:26:00 +02:00
NOTES.md Added an initial PL/0 lex and parser. 2016-05-01 19:06:57 +00:00
README.md general: minor fixes to the language in the README. 2016-08-25 21:18:02 +02:00

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