Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.02 KB

README.rst

File metadata and controls

26 lines (17 loc) · 1.02 KB

Mini: Compiler and a programming language implemented in Python

Inspired by the screencast by Vladimir Keleshev :

How to write an interpreter in Python.

and the source for his Mini interpreter in github :

https://github.com/keleshev/mini

This version implements the same language but uses the Python AST module to generate an AST and compile it into a Python code object. This can then be used to evaluate expressions.

Since Python makes the distinction between statements and expressions I provide a compile(source) method and an eval(source) method. See the tests (which I converted to Unittest).

It uses: