Tink - IF it hurts, STOP. You will only exacerbate areas 'of' inflammation.
Flippin bore. Sigh.
Go to the gym by all means, but, do NOT overdo it. Let yr body 'tell' you where you are at. So, it con't mean *Stop everything. Continue to go, but, be careful. Spell yourself.
Perhaps a word with yr instructor would be in order. The instructor should know which exercises are good for you, which ones need modification and which exercises to leave out of the regime altogether.
Go well - go carefully.
All the sort of advice I was going to give you, Tinks - except the 'talk to the instructor' bit, as sadly that person will know a lot less about AS and its effects on the body than you do...
My suggestions (from a PT PoV...) would be to keep going to the classes for the benefits that you are seeing....however, don't push your limits quite as far. Maybe stop halfway through a set of exercises, stretches etc, or cut the pace in half. Don't worry that you are having a little rest and the rest of the class *might* think you're a slacker - it's called "being self-protective"!
You can probably work out which bits NOT to do - any standing 'twisty' things for your SIJs, any jumping or prolonged standing for your feet etc...
It's a right royal pain in the *everywhere* (for us!
) that we have to pace ourselves and find out the hard way where our limits WERE.