Suppose the purpose of the assignment is to write a compiler that works with a subset of the C language (you can read a subset of any language by simply maintaining the main expressiveness of the scripts without having complicated things like objects).
What intermediate code can be used to verify the compiler? I talked with the professor, and he talked about the fact that he did not know what to give his students as a virtual machine to be used for the βcompiled codeβ, so I thought that might be a good solution.
Subset of C -> Compiler -> Code? -> VM
in which the code can be either in binary format or better in ASCII format (something like pseudo-asm).
I'm looking for something already done, and not how to structure this intermediate code and virtual machine, just lightweight and simple, ready to test some compiled programs.
source
share