The_Larks wrote
Would this be a trivial exercise? Say, to convert the final compiler you've created into one that can write executable ANSI C assembly? You would just have to change the grammar a bit and obviously the target of the assembly... no?
Compiling to assembly language is going to depend on the computer you intend to run on and the assembler that you intend to use.
I think it would be a moderate amount of work to compile from Jack to C++ (C would be more difficult since it doesn't support objects).
You would need to do multiple passes. The first pass would gather type information for all functions and variables so that it could write appropriate casts on all assignments and function arguments.
Next pass could generate .h files containing class definitions from each Jack file. Final pass would generate the .cpp files.
--Mark