C-to-PASCAL/PASCAL-to-C converter

The significance of a source code translator between Turbo Pascal and Turbo C cannot be underestimated and has been the main thrust of the proponents of this thesis. And with the addition of an optional code optimization phase, the system becomes a valuable tool to students, programmers, and softwar...

Full description

Saved in:
Bibliographic Details
Main Authors: Baquillos, Jose Ross S., Bautista, Harold Paulo D., De los Reyes, Conrado T., Paoa, Ronald M.
Format: text
Language:English
Published: Animo Repository 1994
Subjects:
Online Access:https://animorepository.dlsu.edu.ph/etd_bachelors/16459
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: De La Salle University
Language: English
Description
Summary:The significance of a source code translator between Turbo Pascal and Turbo C cannot be underestimated and has been the main thrust of the proponents of this thesis. And with the addition of an optional code optimization phase, the system becomes a valuable tool to students, programmers, and software developers alike. In implementing the study, indirect translation was utilized instead of the direct (word-for-word substitution) approach. Compiler techniques were employed to allow more in-depth analysis of the program and to allow code-improvement transformations to be performed. The source program is represented in memory as a dynamic tree based on abstract syntax trees. LEX and YACC were used to generate the lexical analyzers and parts of the syntactic analyzers. Algorithms for the optimization methods -- namely: constant propagation, constant folding, loop jamming, and loop optimization -- were designed and implemented. Equivalents for a great number of the library functions of both languages were also written, and record files for them maintained. By limiting the supported features of Turbo Pascal and Turbo C to subsets of the two languages, the system is able to correctly translate program code into an equivalent in the opposite language. Also, the code optimization phase was able to perform the selected local transformations on the code which generally showed improvements in its execution. The objectives of the study were met with adequately. The system shows that it can potentially be of great aid to programmers in C and / or Pascal. It is suggested, however, that future studies attempt to improve the system by enlarging the scope of the features of the languages it supports and by adding on more optimization transformations, perhaps even employing global optimization processes to further improve the performance of the resulting code.