However, there were a few reasons that a true P5, a straightforward update of the old p4, was a good idea. First, the source code of the "Model Implementation" is not generally available. Second, the "Model Implementation" is a complete scratch rewrite of the compiler, and shares virtually nothing in common with the original P4. This was important because several books, articles and online resources exist for the P4 compiler
What I wanted for p5 was a compiler that both accepted ISO 7185 standard Pascal, and was also written in it. The compiler is an extended version of P4 and uses the same intermediate codes where possible.
P5 is somewhat of a work in progress. It now accepts the full ISO 7185 language, and has passed a test suite based on that. However, the next major step is to overhaul the back end of the compiler so that it is reasonably efficient for today's machines. For example, I extended the string length to 80 characters to get reasonable programs to compile, but the back end really stores 80 characters for each string, regardless of if they are used. The goal is to make the system not just work, but be reasonably efficient.
The long term goal is also to be able to get P5 to self compile. Stay tuned.
Assembler/interpreter Windows binary
P5.bat - A program to run both passes on the code.
I'll be publishing more details on the P5 system as time goes on.
The P5 compiler/assembler is much easier than P4 in one respect. There are no limitations to remember verses ISO 7185 Pascal. If it is legal Standard Pascal, it will compile and run.
Unlike p4, P5 accepts all of its files as parameters. Use the following format:
pcom source.pas intermediate.int
pint intermediate.int program.out
All files must be specified. The compiler uses IP Pascals ability to connect program header files to command line filenames.