3 ms·
In order to use the tools, I think you'll need to understand some basic compiler theory. I can't say for certain, since I only looked at various compiler-relate
by scott_s 17y ago
In order to use the tools, I think you'll need to understand some basic compiler theory. I can't say for certain, since I only looked at various compiler-related tools after taking a compilers course. But any tool is going to introduce some incidental complexity, and it's having a grasp of the basics that will let you realize "Oh, this is just how the tool does ___."
The good news is that the basics of compilers theory and implementation isn't that difficult. You should be able to learn a lot just through some Googling and some time spent on Wikipedia pages.
With that said, a tool such as ANTLR should handle all of step 2, and part of step 3. The biggest step, though, is step 1, and that's all you.
Since you're a math person, think of this in terms of functions. You need to write a function that takes Basic code and produces semantically equivalent JavaScript code. The bulk of the work is in determining the semantic JavaScript equivalents to all Basic constructs. This also implies that you need to have a deep understanding of the semantics of both languages.
edit: It just occurred to me that I don't know if you want to do this for your own edification, or for a practical purpose. If you have a practical reason, there's probably an easier solution.