Make customization of Generators to be more flexible

Now the TYPE attribute of generator descriptor is a string template in
which the name of parameters can be customized using $. The backward
compatibability is maintained.