Hello, I'm working on a project for class. I'm not trying to cheat so i'll refrain from sending massive chunks of code but for some information here the lab setup:
In this project you will get experience developing a small processor for a very simple mathematically oriented language called NMU: Namu . A compiler will be written to interpret the high level language into a low level machine instruction language called ALT: Alaton which can be run directly on a very basic stack based machine.
I have made each instruction for Alaton as a new class. The alaton class itself holds the stack and the instructions. Now I have the namu classes that need to use the instructions. The instructions need to modify the stack in the namu class but take in the Alaton class in the constructor. How would I go about making the Namu classes that can use the same Alaton class or at least edit the same stack.