Compiling semantic analysis - almost fully implemented