The Madelung synthesis is based on the formation of a benzylic carbanion that cyclizes on an amide substituent.

madelung 01

Mechanism:

Step 1. Deprotonation of the amide

madelung 02

Stage 2. Deprotonation of the benzylic position

madelung 03

Stage 3. Cyclization.

madelung 04

Stage 4. Aqueous acid treatment

madelung 05

Stage 5. Loss of water

madelung 06