I am VERY glad to you are going to the vet.
It sounds like he is obviously experiencing pain in the mouth or upper GI tract.
I would carefully inspect his mouth and as far back in his throat as you can. Look for any thing foreign, sores, redness, broken teeth, cuts, and that sort of thing.
Dental issues are the most commonly seen condition when cats behave in this manner.
Also he may have swallowed something that he shouldn't have. It could be causing pain, and unable to pass through his stomach, intestines, and bowels on its own.
Those are your 2 main concerns to have your vet look into when you go.
It is very important that you do get him seen. As when a cat stops eating, the liver can become impaired very quickly in cats. As soon as 2 days.
If you can, at least try to hydrate him with a medicine dropper. Try using unflavored pediltye. Just 2 cc every hour for a couple hours.
Let me know what you vet find out.