a program to translate tdb into c++ function.