• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

converting C# to C++

Red Squirrel

No Lifer
I'm toying with the idea of converting a C# app to C++.

Lot of it would be manual, but some would be straight up conversions as the way the scripts are coded they have similarities.

What would be the best way to parse out such syntax then regenerate in a different way? I'm thinking perl would be a good language to learn in order to write conversion scripts. Any other good options? C++ is ok as well but wondering if there's something easier to use as far as parsing/generating goes. I know zero perl but I suppose it's fairly easy to pick it up.
 
I would think (but am not sure) that C# is close enough to c++ to allow almost a straight copy paste. Where you see differences, I doubt a parser could fix for you. (IE using the .Net library in any way) Those parts that don't just copy straight over will most likely have to be re-written by hand.
 
well some stuff is different like how in C++ class prototypes should be seperated from source and what not, so I'll basically take the C# code, look at the functions, generate the prototype and then generate the proper files. I will also handle the special cases where .net specific stuff is to be converted to another format.

But come to think of it I might actually be able to run the entire thing through a parser of some sort, just need to decide how to go about writing this parser.
 
Originally posted by: RedSquirrel
I'm toying with the idea of converting a C# app to C++.

Lot of it would be manual, but some would be straight up conversions as the way the scripts are coded they have similarities.

What would be the best way to parse out such syntax then regenerate in a different way? I'm thinking perl would be a good language to learn in order to write conversion scripts. Any other good options? C++ is ok as well but wondering if there's something easier to use as far as parsing/generating goes. I know zero perl but I suppose it's fairly easy to pick it up.

I'd go with Python over Perl as there are visual and OO similarities between Python and C++.
 
Back
Top