I'm not an expert and have never had a dog with these symptoms but have read alot on the subject - and I really doubt it's cramps.
I think you need to take him to the vet asap - they can tell you what's going on. There are a few things that could be happening - but so you're informed when you go - here's a site for you to read that talks about the common and unnecessary problems that happen with Yorkies ..such as Legg-Calve-Perthes Disease (LCP) & Patellar Luxation or Luxating Patellar (LP)
http://www.yorkshire-terrier.biz/health-problems.aspx (if people didn't breed dogs with pre-existing conditions ...many of these ailments would be erased from the breed).
I'm sorry your baby is in pain.