add generator.cpp