Weird medical issue.

I've had a cough for over a week now. I ignored it because I thought it was just a chest cold. It's gotten worse every single day and for the past four nights I've woken up multiple times drenched in sweat and in the middle of a horrible coughing fit which leads to me vomiting a foam-like substance. I'm 8 months pregnant and I've never experienced this before. My throat doesn't hurt, it's just in my chest so cough drops don't help. I've also tried robitussen, Tylenol, a humidifier, hot tea, honey- none of it has made any sort of difference at all. Has anyone else gone through this? I'm going to the dr tomorrow but it's honestly scary at this point and I dread going to sleep at night because I know I'll wake up and go through that multiple times.