What are the top of the castle walls called?

Answer:
A Parapet

The battlement can be used in general reference to a location possibly during a battle or siege. Another more elegant and synonymous name describing a sawtooth shaped parapet is crenelation. The crenelation is made up of merlons (the high part protecting shooters) and crenels (the low part exposing shooters)

A crenelation is usually found protecting an allure (wall walk) on the outer wall.
First answer by Lazarus. Last edit by Cliffclof. Contributor trust: 15 [recommend contributor recommended]. Question popularity: 2 [recommend question].