Chances are your generator only puts out single phase. So you are out the air compressor when the power is off. Just put some sort of a backfeed preventer on your single phase panel and connect the generator to it.
almost all generators make 240vac, single phase. this will power most air compressors, as they are also 240 vac single phase.
having ENOUGH amperage though, is the question, especially if trying to run anything else.
I'm not trying to nitpick,
but a backfeed preventer? there are backflow preventers`in the plumbing/pipefitting field, but sorry, this is improper nomenclature. As a rough description, I get it, but as a master electrician, I'm gonna tell ya; you need a double pole, double throw transfer switch.
http://www.smps.us/transferswitch.html
a lot of spirited debate, and good advice here in this thread. but the bottom line is, there are a lot of shortcuts, and all are meant to save money, not save lives.
cord arrow, if you have your inspection,
and a few more wires wander thru?..............................
its only a problem if you have a fire in the panel area, and the fire marshals or insurance investigators find out. IT IS a fire hazard, too many current carrying conductors are a risk.
a slight risk, though. get it?