Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Language Translation

Similar presentations


Presentation on theme: "Programming Language Translation"— Presentation transcript:

1 Programming Language Translation
Jamie McAtamney

2 Introduction Purpose: to write a fully functional translator
C to Java Hasn’t been done before Java some advantages over C: Easier to write Java (idiot-proof)‏ More portable Scope: as wide as possible Currently have all the “basics” Need to do struct translation, pointers, graphics

3 Background Similar research
Jazillian pay-per-program translation company Terekhov & Verhoef’s paper on translation difficulties Lili Qiu's paper on procedural vs. object-oriented languages

4 Methodology Approach Everything is modular
Have modules for different translations Have “translate()” methods to coordinate everything Have separate programs to handle appearance of code Aspects of C closest to Java translated first Saved memory manipulation for last

5 Methodology Translation algorithm Formatting Tokenization
Remove programming idiosyncrasies Tokenization Keywords and punctuation Keyword search-replace Ex: char* → String Context-sensitive search Ex: printf(“\n”); → System.out.println();

6 Methodology Finished Timeline In Progress Coming “Soon” Coming Maybe
Primitive types Arrays Method headers Input/output Preprocessor directives Two-pass translator Timeline In Progress Package methods Coming “Soon” Structs → Classes Pointers Graphics Coming Maybe Computer-to-computer communication

7 Methodology Testing & Analysis Testing old C programs
Have a few “fake” programs to test particular modules Script to do testing Added another translator to traverse Java program a second time

8 Methodology Problems: Can't move “backwards” for writing to Java file
Solved with two-pass translator Some C methods “overloaded” in Java Ex: PrintStream append() and print()‏

9 Progress Results Thus Far Program is error-free
All implemented areas fully translated Translator outputs compilable and runnable program

10 Progress Analysis Where to go from here Ahead of schedule
Didn't expect to get to structs and pointers before end of 3rd quarter Didn't expect output of compilable and runnable program until 3rd quarter Graphics will be much easier than I originally thought Where to go from here Will try Java to C if I finish by beginning of 4th quarter


Download ppt "Programming Language Translation"

Similar presentations


Ads by Google