Why are grapes described as khamr in this passage?

Metonymy, Compound Figurative Expression and Mental Attribution