From: | "Gopi Bulusu" <gopi@sankhya.com> |
Newsgroups: | comp.compilers |
Date: | 8 Nov 2002 11:04:26 -0500 |
Organization: | http://groups.google.com/ |
References: | 02-11-013 |
Keywords: | translator |
Posted-Date: | 08 Nov 2002 11:04:26 EST |
"socrates" <socrates171@yahoo.com> wrote
> What I have is very minimal. No compiler for the dead language, no
> text books, only one reference manual and hundreds of program codes
> that used the dead language.
>
> Do you think it's possible to build a translator with such minimal
> resources? And could you give me some pointers on how to start
> building a translator?
This is certainly possible, although translating to a language like C
is probably a better approach (it would be simpler to add C++ or Java
wrappers around the generated C). Here would be a high level approach:
1) Perform an extensive code walkthrough and determine the system level
functions used and make a list.
2) Create a grammar specification for DL (the dead language) and verify
the same by parsing the existing DL programs
3) Create a C library for functions identified in (1)
4) Create a translator that uses the grammar from (2) and generates
the equivalent C code.
A good test for (4) is to build a reverse translator to check that
the generated C code (using library functions from 3) can be translated
back to the original DL (may not always be feasible).
Naturally, there can be a trade-off between steps 3 and 4 (more functions
in the library would decrease the complexity of the translator).
Regards,
gopi
---
Gopi Kumar Bulusu
Sankhya Technologies Private Limited
http://www.sankhya.com
Tel: +91 44 822 7358
Fax: +91 44 822 7357
Return to the
comp.compilers page.
Search the
comp.compilers archives again.