Does anyone know?

What I am about to write, is about my DOG. I do not really have another app to ask, so... My dog was dropped off at my house sometime in 2011. I am unsure about how old he is, but he is on the older side. He has been having these spells, for the past 2/3 months where he sounds like he’s hyperventilating. I go over to him, and he starts to “hyperventilate” and then sometimes starts to gag. He will then lick his lips. Then afterwards, he acts like he is okay, but he has to gather himself. Will someone please let me know. I may post another post, but attach a video if anyone does not understand my description. I’m sorry that this is out of the comfort zone and does not relate to anything on this app, but I am just wondering, and I’m scared for my doggie.