stephen@teti.qhtours.oz (Stephen Chung) (11/22/89)
I know, I know, this is another one of those XYZ Language --> C posting again. Is there a BASIC to C translator? Obviously, it will be trivial to write some form of a translater that translates BASIC programs to C, but not READABLE and MAINTAINABLE C. I am planning to write a translater that does a bit of thinking. First of all, it should use flow analysis to determine chunks of code that should be "function"ized and make them into functions. Second of all, it should determine (from the usage) whether a variable (A, A1, B, C15 etc.) is constant, local or global. Certain variables, notisably X and I, are used extensively to run counter loops. Although the usages are global, they should be translated into a number of local counter variables for each function. The same apply to other variables. It should probably rename obvious variables or prompt the author for it. My goal is to translate BASIC into C programs that MEAN something, and maintainable, instead of simply translator output. That way, a lot of programs written by non-computer people who only knows BASIC can be transferred easily to UNIX. Any suggestions on which BASIC to go for? I am biased towards GW BASIC on the PC because it is popular. In my plan, the translator should generate a C program with curses calls if the BASIC program uses screen addressing. Obviously, nothing much will be done (at this point) for graphics. I will appreciate any ideas, suggestions etc. If you know such a translator already exists, please tell me so I won't reinvent the chocolate chip cookie. Cheers Stephen
wgh@ubbpc.UUCP (William G. Hutchison) (11/28/89)
In article <255@teti.qhtours.oz>, stephen@teti.qhtours.oz (Stephen Chung) writes: > I know, I know, this is another one of those XYZ Language --> C > posting again. > > Is there a BASIC to C translator? [ ... ] > Yes, there are about 5 for sale in the USA. I maintain a list of language translation products available on UNIX as part of my job here at the Unisys UNIX Portation Center. I keep posting the information, but it gets tiresome to see the same questions popping up over and over again. Is somebody willing to maintain a 'frequently asked questions' file for comp.lang.c or comp.lang.misc? If so, I will forward my list of language translators ONCE MORE ONLY! > I am planning to write a translater that does a bit of thinking. Please tell me about it when it is done. > Any suggestions on which BASIC to go for? Microsoft BASIC, DG Business BASIC, Thoroughbred BASIC, VAX BASIC Plus. -- Bill Hutchison, DP Consultant rutgers!cbmvax!burdvax!ubbpc!wgh Unisys UNIX Portation Center "Unless you are very rich and very eccentric, P.O. Box 500, M.S. B121 you will not enjoy the luxury of a computer Blue Bell, PA 19424 in your own home", Edward Yourdon, 1975.