You are here: VS Home>Products> Source Code>Pascal-S Compiler

Pascal-S Compiler: Source Code Set

Pascal-S is a compiler for a subset of the Pascal language. The design is documented in an article by N. Wirth in the book, Pascal: The Language and its Implementation (D.W.Barron, Ed.): "The Pascal-S system is a compiler that translates Pascal-S programs into code for a hypothetical stack computer. This computer is itself defined as an algorithm, called the interpreter of the compiled code. Both compiler and interpreter are described in a largely machine-independent way by using the high-level language Pascal exclusively."

Pascal-S will actually read and execute many simple Pascal programs, but lacks too many features and executes too slowly to be practical for use as a production Pascal system. It was originally written as an economical and fast compiler for student use, but today it is primarily used as an educational example of how compilers are designed and implemented. Professor Niklaus Wirth, the author, has written Visible Software verifying that Pascal-S and the accompanying technical report are in the public domain. This means that the software can be freely used, copied, passed on, and modified. Pascal-S is written in ISO Level 0 Standard Pascal, with all compiler dependencies in a single procedure, so it should be usable with little change on any Standard Pascal implementation. The one compiler-dependent procedure includes code for Dr. Pascal's Extended Pascal compiler and for THINK Pascal. Pascal-S is a little too large for the Dr. Pascal interpreter, but users report that they have trimmed it a bit and run it with Dr. Pascal.

This Visible Software source code set includes the Pascal-S source code in Pascal, MS-DOS and Macintosh (68K) executables of Pascal-S, and a technical report (both ASCII and PDF). The technical report, written by Niklaus Wirth, provides both theoretical background and implementation design.

This is an excellent package for learning how compilers work and for experimenting with compiler design and modification.

Note: see Terms and Licensing on Source Code page.

Purchase and download Pascal-S

or, back to Source Code page

VS Home page | All Products | Dr. Pascal | EP Compiler | pix | Source code | ePurchase | News | Pascal Info | Visible Software | About this site | Site Map

© 2004, Visible Software. All rights reserved.