Jay
Jay

Reputation: 31

Translate vbscript to C# using ANTLR

I need to write a translator for vbscript to c#. What would be the basic steps invloved to translate using ANTLR? I am not very clear about whether to use grammar (lexer/parser? file or stringtemplate or AST or all. Suggestions? Thanks in advance.

Upvotes: 3

Views: 1872

Answers (3)

gschizas
gschizas

Reputation: 90

The easiest way to translate VBScript to C# would be using VB.NET as an intermediate step. VBScript is very similar to VB.NET (there are some differences though), so all you need to do is copy-paste your code in a new solution in Visual Studio. After you make a few changes, the code will be able to compile.

You can leave it at that (you can call the resulting DLL from your C# code), but even if you don't want to do that, converting VB.NET to C# is trivial. You can even decompile your resulting DLL/EXE (although this will lead to some loss of information) or use any online VB.NET to C# converter.

Upvotes: 0

Uwe Keim
Uwe Keim

Reputation: 40746

Is this really possible?

I'm "translating" (read: rewriting) a MS Access/VBA application since two years to C# and found out that even the online available converters (like this one which is more VB.NET, but anyway) fails at most basic conversions.

So my assumption until now is that there are way too much kind of constructs that are simply not translatable from VBScript to C#.

Upvotes: 1

Related Questions