How to convert many thousands of VBScript lines to C #?

I have a collection of about 10,000 small VBScript programs (50-100 lines each) and a small collection of large ones, and I'm looking for a way to convert them to C # without resorting to joint transliteration. These programs are automated test cases for a web application written for HP / Mercury QuickTest Pro, and I'm trying to turn them into test cases for Selenium. Fortunately, the tests seem to be well written using a library of building blocks and idioms (larger programs), so the test cases actually resemble a domain-specific language than VBScript, and QTP is buried inside the libraries.

Ideally, I'm looking for a tool that can perform syntax conversion from VBScript to C # for both dsl-ish test cases and more complex building block libraries. That would leave me with a manual library cleanup and probably worked very little on the test cases. If I could find a VBScript-to -VB.NET translator, I would take it too, since I suspect that I can compile VB.NET and then decompile it in C # using .NET Relector or something similar. Plan B is to write your own translator for test cases, as they have a very straightforward style, but that will not help the libraries.

Any suiggestins? I have not written a compiler for at least 15 years, and although I have not forgotten how to do this, I do not look forward to it - least of all for VBScript!

+4
source share
2 answers

Most vbscript is valid VB6 code, so one option would be to simply rename them from .vbs to what was used in VB6, then add them all to the VB6 project and see if the VB6 - VB.Net Update Wizard appears Some versions of Visual Studio may help you.

+2
source

GreatMigrations has a tool that handles the conversion of VB6 to C # (and other languages) well. I know that the company is ready to work with organizations to adapt the product to their specific needs.

+1
source

Source: https://habr.com/ru/post/1312761/


All Articles