Add code generator to real state #3