Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

jzelinskie/pascal-p2

Repository files navigation

                         THE PASCAL-P2 COMPILER/INTERPRETER

============================== Description =====================================

This is the 2nd version of the Pascal-P compiler from Zurich. It is mostly
identical to the compiler released from Zurich. I made minor changes in it
to allow it to compile under ISO 7185 Pascal, and to change the sizes of
internal tables to run programs.

This is the Pascal-p2 compiler modified to be ISO 7185 Pascal compliant,
both in the implementation language.

Pascal-P was an implementation kit, created between 1972 and 1974, for the
original language Pascal. The source for the original compiler was passed around
and modified quite a bit, but Niklaus Wirth noted that it was very popular, and
represented a good method to popularize the language. He gathered the source
into a clean version called Pascal-P2, which was the basis of UCSD Pascal, which
in turn was the base language for Borland Pascal. The Zurich group then created
an improved version called Pascal-p2.

============================== Quick start =====================================

Pascal-p2 uses the standard GNU release layout. You execute:

[Windows]

> setpath
> configure
> make

[linux]

> ./setpath
> ./configure
> make

(You can avoid "setpath" by placing the ./bin directory on your path)

This will make the compiler and interpreter set. You can then try a sample
program as:

> p2 sample_programs/hello

Note: Pascal-p2 has an issue where it tries to load the first character of the
input before the program runs. Because of this, it is usually necessary to
hit a carriage return to start the program.

================================== Problems ====================================

You need a working gpc implementation. It is strongly suggested you use the
gpc version 20070904. gpc has/had various compliance issues with ISO 7185, and
the compiler has ceased to be supported. This version is found to be solid.

You will need a working set of linux tooling (grep, ls, rm, etc). Mingw has
an excellent set of tools for Windows users.

You need the "flip" line ending adapation program. If you don't have it, we
include a copy you can compile, or you can simply go find it. It is a widely
available program.

About

A mirror of Niklaus Wirth's P2 Pascal Compiler

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published