add codeGen.py and optimize the parser.