The EP2002 is a bit unusual because it is a Programmer and Wiring Centre combined. The terminals A B C & D are just terminals. They are simply used to connect wires together and are not connected to the programmer functions.
It is not a straight forward swap. You will need to have a fairly high level of electrical understanding and skill to do it. It is not really for a novice. However, if you are competent, I am happy to inform you about the wiring. Otherwise, I would recommend that you engage the service of a professional.
Your biggest problem is that the Nest does not have the 'junction box' facility to accommodate so many wires. To get around this, I would normally sink a single gang flush mounting socket box in the wall behind the programmer to use for the additional connectors.
N and L are self explanatory they are the same for the Potterton and the Nest. As there are so many lives, you may have to terminate the lives separately in a separate terminal block and then run one live to supply the Nest. The same for the Neutrals.
Potterton Terminal 3 is the Hot Water Call for Heat (Nest terminal 6)
Potterton Terminal 4 is the Heating Call for Heat (Nest terminal 3)
The wires from Potterton Terminal 5 link to live as they are now.
Link the two Nest common connections (terminals 2 and 5) to L
The 2 wires presently in terminal B just connect together in a terminal block
The 2 wires presently in terminal C connect together in a terminal block
Finally the existing room thermostat needs to be decommissioned. It can't just be removed or the heating circuit will be 'open circuit' and never come on. So first remove the neutral, and then the switching wires (yellow and red) should be connected together. If you can find the other end of the thermostat cable and disconnect it and then link where the yellow and red wires came from, that would be better than leaving live wires running to where the existing thermostat is located.
[Edit]
You don't give any information about the heating system that you want to connect the Nest to, and it is impossible to tell just from the wiring. AFAIK Nest controls still don't have the internal function to control older heating systems with pumped central heating combined with gravity circulated hot water. (IE those that need the hot water to be 'on' before the central heating can operate)
Your wiring indicates that you don't have a 'Y Plan' system (one with a three port motorised valve) so I'm assuming that you have a 'S Plan' (with 2 x two port motorised valves)