Lab 7: Simple code generation and type checking

  1. For every Exp class, ConstExp and BinExp for example, in their analyze(), you have to do 2 things: In their gen(), you will have to use temp somehow.
  2. To learn how to compile a MiniJava code, read here.
  3. C-minor code is actually C++ code in a weird looking way :), so you should be able to compile using g++ and run it. For example:
    $ compile Trivial.java > trival.cc
    $ g++ trival.cc -o trival
    $ trival
    123
    
  4. A graphical view: