Skip to content

Transpiler from Modula-2 to Oberon and Component Pascal

Notifications You must be signed in to change notification settings

btreut/ModulaToOberon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 that they switched the status of the mirror to dead in the overview.

Nw's original version skips comments and presents syntax errors as error numbers. The latter was typical compiler behavior in early Modula-2 times (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 the first version. Later I used BlackBox error elements for the error messages in the BlackBox version. I also modified the transpiler so that it was able to preserve comments, eventually doubling them when same or similar comments were present in both, the DEFINITION and the IMPLEMENTATION MODULE.

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. 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.

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.

About

Transpiler from Modula-2 to Oberon and Component Pascal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published