Escape (if possible)
Leave the location, if possible. You and other members of the public are a target. Make a habit of locating emergency exits etc.
Find cover (hide, if escape is not possible)
If you can't leave the location, find a place you deem to be safe and which provides protection. Pay attention to what you see and hear. Silence your phone and don't make any unnecessary calls to people who may be present in the danger zone.
Call the emergency services
It is the task of the police to disrupt an ongoing attack. Call 112 as soon as practically possible. The Police will need to know: the location, what happened, how many suspects did you see, what weapons did they use, what do they look like and where did you last see them?
Follow the instructions of the police. When the police arrive on the scene, make sure you can't be mistaken for a suspect. Don't hold anything in your hands that could be mistaken for a weapon. Be prepared for the possibility of a further terrorist attack.