add some format for generating code

add some format  for generating code(new line, space, indent and undent, etc)