This repository contains Python implementations of the interpreters described in Samuel Kamin's excellent PLIBA [1] book.
[1] Samuel Kamin, "Programming Languages, An Interpreter-Based Approach", Addison-Wesley, Reading, MA, 1990. ISBN 0-201-06824-9.
Examples designed to make it easier to understand the essentials of an interpreter.
-
SimpleCalc: single-module arithmetic expressions calculator.
-
Calculator: arithmetic expressions calculator with separate parser and evaluator.
-
CalcWithVars: arithmetic expressions calculator with variables.
Kamin's "chapter 1 language", minimal yet Turing-complete, inspired by Pascal with s-expression syntax. SubPascal is our name for it.
-
SubPascalWithoutFunc: SubPascal without function definitions.
-
SubPascalHappyPaths: "complete" SubPascal language, with function definitions but almost no error handling and limited REPL.
-
SubPascal: complete SubPascal with better error handling, multi-line REPL and source file execution.
PLIBA book errata and source code in Pascal and C:
http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/impl/kamin/0.html