Oppolzer - Informatik / Stanford Pascal Compiler


Home       Lebenslauf       Schwerpunkte       Kenntnisse       Seminare       Kunden       Projekte       Produkte       Blog       Stanford Pascal       Kontakt

The Stanford Pascal Compiler / Evolution Steps

Back to Compiler main page

First extensions to the compiler in 2011

Once I had managed to compile the compiler (using itself), and the new compiler still worked, I could try to do some minor improvements.

I first made some changes to the source code scanner; in fact I rewrote it. From IBM's Pascal compiler, I was accustomed to use (. and .) as synonyms for [ and ], but Stanford Pascal didn't allow this, so I changed that. Another substitute I was used to was -> for the pointer symbol; Stanford, too, didn't know that. I fixed that, too. I kept all the other substitutes that existed in the Stanford compiler, for example (/ and /) for [ and ].

Then I wanted some additional comment notation; Stanford already supported three (!). First the curly brackets { and }, then the common substitute (* and *), and - which sounds strange at first - all text which is enclosed in quotes is a comment in Stanford Pascal, too. I couldn't get rid of this, because it is used in the compiler and the P-Code translator, and: in my believe you always have to respect such things, because if there exists some sources somewhere that were understood by earlier releases of the compiler, they should well be accepted by later releases, if possible.

But anyway: I added the PL/1 and C style of comments /* */ as the 4th variant. In Stanford, comments may be nested, controlled by a certain compiler switch, so I had to take care not to break that feature. But it is defined that nesting of comments is only supported for comments of the same type.

Changes to symbol layout etc. are kind of easy, because they have no impact at all on code generation. That's why I started with such extensions.

From the years at the Stuttgart university and at SSB AG, I had a source code formatter program, written in Pascal. I tested this on Stanford Pascal, and it worked without problems. I had to do some maintenance to this formatter to, so that it supported all the extensions of McGill - for example structured constants - and of my own, which in part was done not before 2016.

Back to Compiler main page