C-to-PASCAL/PASCAL-to-C converter
Date of Publication
1994
Document Type
Bachelor's Thesis
Degree Name
Bachelor of Science in Computer Science major in Software Technology
College
College of Computer Studies
Department/Unit
Software Technology
Abstract/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.
Abstract Format
html
Language
English
Format
Accession Number
TU08555
Shelf Location
Archives, The Learning Commons, 12F, Henry Sy Sr. Hall
Physical Description
2 v. (various pagings)
Keywords
Turbo C (Computer program language); PASCAL P (Computer program); Computational linguistics; Computer programs--Computer prose
Recommended Citation
Baquillos, J. S., Bautista, H. D., De los Reyes, C. T., & Paoa, R. M. (1994). C-to-PASCAL/PASCAL-to-C converter. Retrieved from https://animorepository.dlsu.edu.ph/etd_bachelors/16459