Re: Translating from lagugae which allows Goto's

Lex Spoon <lex@cc.gatech.edu>
17 Jul 2003 00:27:42 -0400

          From comp.compilers

Related articles
Translating from lagugae which allows Goto's dana.subscriptions@virgin.net (Dana Freer) (2003-07-04)
Re: Translating from lagugae which allows Goto's joachim.durchholz@web.de (Joachim Durchholz) (2003-07-13)
Re: Translating from lagugae which allows Goto's syring@email.com (Karl M Syring) (2003-07-13)
Re: Translating from lagugae which allows Goto's strohm@airmail.net (John R. Strohm) (2003-07-13)
Re: Translating from lagugae which allows Goto's bsheff2@yahoo.com (Bob Sheff) (2003-07-15)
Re: Translating from lagugae which allows Goto's postmaster@paul.washington.dc.us (Paul Robinson) (2003-07-15)
Re: Translating from lagugae which allows Goto's genew@mail.ocis.net (2003-07-15)
Re: Translating from lagugae which allows Goto's lex@cc.gatech.edu (Lex Spoon) (2003-07-17)
Re: Translating from lagugae which allows Goto's nmm1@cus.cam.ac.uk (2003-07-17)
Re: Translating from lagugae which allows Goto's joachim.durchholz@web.de (Joachim Durchholz) (2003-07-17)
Re: Translating from lagugae which allows Goto's vbdis@aol.com (2003-07-17)
Re: Translating from lagugae which allows Goto's Martin.Ward@durham.ac.uk (Martin Ward) (2003-07-21)
Re: Translating from lagugae which allows Goto's strohm@airmail.net (John R. Strohm) (2003-07-21)
| List of all articles for this month |

From: Lex Spoon <lex@cc.gatech.edu>
Newsgroups: comp.compilers
Date: 17 Jul 2003 00:27:42 -0400
Organization: Georgia Institute of Technology
References: 03-07-042 03-07-067
Keywords: analysis
Posted-Date: 17 Jul 2003 00:27:42 EDT

> Dana Freer wrote:
>> I am not a compiler writer but have the task of writing a tranlslator to
>> convert from a language which allows GOTO, GOSUB, RETURN into a language
>> (like VbScript) which does not alllow GOTO etc. Is this impossible? Will
>> human intervention always be required?


This sounds like an excellent use of a refactoring browser. Human
intervention would be required, but a lot of the tedium would go away.
At least, that's the idea.


To elaborate, most uses of GOTO will fall into certain looping
patterns that can be detected. If the programmer highlights a region
of code and says "this is a for loop", the browser could verify this
and rewrite it for you. With a truly excellent tool, the browser can
give useful feedback when it fails, e.g. "there is a GOTO pointing
inside the loop from elsewhere".


There are a lot of details, and there's a lot of programming required
to make such a browser, but if the legacy code base is humongous it
might be worthwhile. I am tempted to say that there isn't enough VB
code that it is worth the effort; however, I should probably instead
say that there *shouldn't* be enough VB code that it would be worth
the effort. :)


Oh, and whoever makes such at thing should be forced to read a few
tens of thousands of lines of legacy code before they do it. This
tool would require matching on *common* patterns.




Lex


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.