The CMa is a virtual machine which executes instructions based on a C-like language.
In the Main class, you can specify the path to the .cma file with the program's instruction.
The files used for testing are in the src/main/resources/cma directory.
When executing the main method, it outputs the top-most item from the stack into stdout.
The MaMa is a virtual machines for instructions based on a functional language based on OCaml.
In the Main class, you can specify the path to the .mama file with the program's instruction.
To create a MaMa virtual machine, you must use the .fromMaMaCodeFile static method from the Helpers class.
This can be changed in the Main class.
The files used for testing are in the src/main/resources/mama directory.
When executing the main method, it outputs the top-most item from the stack into stdout.
If the top of the stack is a reference to a BasicValue in the heap, consider adding a getbasic instruction before halting
to get the value of the reference on top of the stack. Otherwise, the program will only print the address of the value in the heap.
I included a feature to debug and see the Virtual Machines' state after every instruction.
To activate this, set the DEBUG constant in the corresponding class (CMa | MaMa) to TRUE.
The state will get printed to stdout.