Active Oberon is an experimental language extension of Oberon developed to describe active objects. Furthermore, Active Oberon offers object bodies in order to formulate object specific behaviour, type local methods to prevent uncoordinated access, dynamic arrays and abstract operators. Oberon-2 has a different syntax, but can be seen as a semantic subset of Active Oberon. In order to easily port existing Oberon-2 programs without any programming effort, automatic translatation is desirable.
The goals of this project were:
Attention had to be paid to the clarity, correctness and robustness of the software.
A translator has been implemented that is able to convert (almost) any source code fully automatically. Especially methods can cause problems, because the loss of a receiver can lead to a shadowing of global or local declarations by record fields. This problem has partly been solved by reintroducing the former receiver as a local variable. Global shadowing has been prooved to be too difficult to be resolved automatically because of potential invalidation of client modules.
Security holes caused by insufficient type checks within WITH-statements are fixed by using IF-statements and explicit type checks instead of WITH. The reduction of efficency is the price one has to pay for type security.
The translator tries to keep the original layout of the program as much intact as possible while "fitting" the newly generated code into that layout. Pretty printing concepts have been used to make this possible.The author can be reached at firstname.lastname@example.org