A toolchain for the automatic generation of computer codes for correlated wavefunction calculations