/ModulaToOberon

Transpiler from Modula-2 to Oberon and Component Pascal

ModulaToOberon

Transpiler from Modula-2 to Oberon and Component Pascal

In the second half of the last decade of the last century, I found Niklaus Wirth's Modula to Oberon transpiler as binhex files on some ftp server, most probably it was the ftp server of the GWDG (Gesellschaft für wissenschaftliche Datenverarbeitung, part of the German Max Planck Society), where it is still (as of 26-Apr-2023) available at this directory. I have contacted the admins of that server and they stated that they will keep the mirror and they switched the status of the mirror to dead in their overview page.

Nw's original version skips comments and presents syntax errors as error numbers. The latter was typical compiler behavior in the times when Modula-2 was better known (at least for those compilers written by NW's group). There should have been also a list, which explaines the meaning of the error numbers. This list was missing for the transpiler. I contacted NW for help, but he could not provide any further help, so I used the error list of the Modula-2 compiler M2RT11, which I had used in the 1980ies, and guessed the meaning of the remaining error numbers of the transpiler in my first usable version. Later I used BlackBox error elements for the error messages in the BlackBox version, which are active, i.e. clickable elements, which give an explanation, when clicked upon. I also modified the transpiler so that it was able to preserve comments, eventually combining them from both, the DEFINITION and the IMPLEMENTATION MODULE when same or similar comments were present in both.

In the late 1990ies I used Oberon-V4 and BlackBox in parallel and I tried to keep both versions in sync. For that purpose I used version and fold elements, which are available in Oberon-V4 (see the infos about Text Elements on this page (scroll down to the middle of the page). The links to the Linz FTP-server given there are currently (as of 12-Jul-2023) defunc, but the corresponding files can be found in the 78.1 MB archive linked as "Oberon from the Linz server" on this page. I include the BlackBox StdCoded file m2o.txt. Sorrily the importer of the current BlackBox version (1.7.3) for *.Eth files does not import the fold elements correcty and cannot handle the V4 version elements. But the importer available from CPC (Component Pascal Collection) handles the fold elements correctly. So you have to decode it in BlackBox (see Std/Docu/Coder.odc in the BlackBox documentation) and then use Oberon-V4 to switch to the correct version and then go back to BlackBox to import these files with CpcETHConv. I'll try my best in the next time to provide the BlackBox versions directly. On request (by opening an issue), I'll try to provide the V4 version also. Feel free to cantact me by filing an issue, but give me some time to react.

As a first step I added ASCII versions of the two versions contained in the source files Modula.Eth and M2S.Eth, as Modula-V4.Mod.txt and Modula-CP.Mod.txt and M2S-V4.Mod.txt and M2S-CP.Mod.txt. ASCII versions of the other utility modules will follow real soon now.